You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we store the controls on the grid in any exogenous state i_m \in [0,N_m] as a Vector{ListOfPoints{d}} where the size of the vector is N_m and the size of each ListOfPoints is N.
Given an element $x \in Vector{ListOfPoints{d}}$, we tediously perform the following operations:
1/ compute error maxabs(x) which is the supremum norm over all the elements
2/ access i-th list of points x[i] isa ListOfPoints{d}
3/ convert to/from a flat vector
Last item is problematic: we make a copy of the data in x which is a shame. The question I'm asking there is whether we could have an object, whose data would be one single contiguous vector that could also be treated as a Vector of ListOfPoints.
There is at least one problem I foresee:
we currently use reinterpret a lot, which converts vectors into other vectors. If I'm not mistaken in >0.7, it would return an AbstractArray instead. So the natural approach would be to define x[ì] as a basic view over the data.* But we (I) have recently made the assumption everywhere that we are dealing with contiguous vectors. We'll have to reconsider, probably re-AbstractVectorize everything...
Some features that would be nice for this object:
not assume that all lists of points have the same length
not make precise assumption about the type of element. For instance it could work with Point{d} and Jacobian{d} as well (a square matrix).
I guess it should be possible to make something simple and robust here, so let's think it hard !
Something like:
struct StangeArray{T}
data::Vector{T}
views::Vector{ArrayView{T}}
end
The text was updated successfully, but these errors were encountered:
Currently we store the controls on the grid in any exogenous state
i_m \in [0,N_m]
as aVector{ListOfPoints{d}}
where the size of the vector isN_m
and the size of eachListOfPoints
isN
.Given an element$x \in Vector{ListOfPoints{d}}$ , we tediously perform the following operations:
1/ compute error
maxabs(x)
which is the supremum norm over all the elements2/ access i-th list of points
x[i] isa ListOfPoints{d}
3/ convert to/from a flat vector
Last item is problematic: we make a copy of the data in x which is a shame. The question I'm asking there is whether we could have an object, whose data would be one single contiguous vector that could also be treated as a Vector of ListOfPoints.
There is at least one problem I foresee:
Some features that would be nice for this object:
Point{d}
andJacobian{d}
as well (a square matrix).I guess it should be possible to make something simple and robust here, so let's think it hard !
The text was updated successfully, but these errors were encountered: