TransformVariables.jl
                                
                                 TransformVariables.jl copied to clipboard
                                
                                    TransformVariables.jl copied to clipboard
                            
                            
                            
                        More tests and correctness checks
- [ ] 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
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 
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.
@cscherrer: this is fixed in #41. I will tag a release once the CI passes.