If you have a Basis{N}N>1 and you try to construct a BasisStructure at a single point, you cannot represent that point as a Vector{Float64} of length N.
Test case to reproduce:
julia> using CompEcon
julia> basis = Basis(ChebParams(10, -1, 1), ChebParams(5, 2, 4))
2 dimensional Basis on the hypercube formed by [-1.0,2.0] × [1.0,4.0].
Basis families are CompEcon.Cheb × CompEcon.Cheb
julia> pt = [0.5, 2.1]
2-element Array{Float64,1}:
0.5
2.1
julia> BasisStructure(basis, Direct(), pt)
ERROR: BoundsError: attempt to access 2-element Array{Float64,1}:
0.5
2.1
at index [Colon(),2]
in throw_boundserror at abstractarray.jl:155
in call at /Users/sglyon/.julia/v0.4/CompEcon/src/basis_structure.jl:160
in call at /Users/sglyon/.julia/v0.4/CompEcon/src/basis_structure.jl:142
julia> BasisStructure(basis, Direct(), pt')
BasisStructure{CompEcon.Direct} of order [0 0]
If you have a
Basis{N}
N>1
and you try to construct aBasisStructure
at a single point, you cannot represent that point as aVector{Float64}
of lengthN
.Test case to reproduce: