TransformVariables.jl icon indicating copy to clipboard operation
TransformVariables.jl copied to clipboard

More tests and correctness checks

Open tpapp opened this issue 5 years ago • 3 comments

  • [ ] identity array transformations, especially with generalized indexing (should just copy, check that it is aligned correctly)
  • [ ] use the checkbounds framework for index checking with IndexInto

tpapp avatar Sep 08 '18 09:09 tpapp

Along these lines, what do you think of using a StaticVector for UnitVector transforms? They're fast for low dimensions, and off-by-one errors seem especially likely in this case. Current status below

julia> UnitVector(3)(randn(1))
3-element Array{Float64,1}:
 0.18606499467826754
 0.0                
 0.9825374383479626 

julia> UnitVector(3)(randn(2))
3-element Array{Float64,1}:
 -0.3151137999598784
 -0.2694871471052446
  0.9099889947795644

julia> UnitVector(3)(randn(3))
3-element Array{Float64,1}:
  0.30113461573458   
 -0.14635682348334245
  0.9422831970412359 

julia> UnitVector(3)(randn(4))
3-element Array{Float64,1}:
 -0.09987020258309565
 -0.8775482948455398 
  0.4689722090376966 

cscherrer avatar Apr 22 '19 23:04 cscherrer

Ouch, thanks for the catch. Fixing it soon.

StaticVectors is kind of orthogonal; they may have some advantages like compact packing and loop unrolling, and will eventually be implemented, but programming them nicely is challenging.

tpapp avatar Apr 23 '19 12:04 tpapp

@cscherrer: this is fixed in #41. I will tag a release once the CI passes.

tpapp avatar Apr 23 '19 15:04 tpapp