I have been adding more tests to the MixedModels package and encountered a 
peculiar situation where, AFAICS, a test should produce one type of failure 
and it doesn't.  It fails at a later point but I can't see how it gets 
there.

To reproduce, check out a copy of the MixedModels master branch.

Pkg.add("MixedModels")
Pkg.checkout("MixedModels")
MixedModels.inject!(speye(4), sparse(ones(4, 4)))

The unexported function inject!(A, B) zeros A, then copies the contents B 
into A.   For sparse matrices, the nonzero positions of B must be a subset 
of those in A.  What I expect to happen in this case is that the code will 
enter the block in lines 52 - 54 
of https://github.com/dmbates/MixedModels.jl/blob/master/src/inject.jl.  In 
fact, if you uncomment line 51 in that file the output from the @show macro 
shows that indeed 

kk > length(dnzrv)

the second time through the "for k in snzr" loop.  But when I run that 
example, the error thrown is a BoundsError at line 55.   What I don't 
understand is how it gets to line 55 the second time through the loop.

I have been looking at this for a long time trying to see if I am doing 
something stupid but I can't.  Does the BoundsError get thrown for others? 
 My versioninfo is

julia> versioninfo()
Julia Version 0.4.2
Commit bb73f34 (2015-12-06 21:47 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Prescott)
  LAPACK: liblapack.so.3
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

I haven't upgraded to 0.4.3 because the Ubuntu package is not yet available 
but I can test on 0.4.3 if that would help.

Reply via email to