Geoffrey Irving
unread,Aug 5, 2014, 3:00:40 PM8/5/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to xdress
Our current C++/Python interaction layer has a bunch of logic for
converting nested array, vector, and matrix types in C++ into numpy
arrays in Python. For example, we have classes
Vector<T,d> - static size vectors of T
Matrix<T,m,n> - static size m by n matrices of T
Array<T,d> - rectangular d-dimensional arrays of d
and a type like
Array<Vector<Matrix<T,3,2>,5>,4>
would turn into 7D numpy array with shape (a,b,c,d,5,3,2).
I am a bit lost as to how to cleanly expose this structure to xdress.
At first I thought I could just reuse our existing
from_python/to_python C++ functions and teach xdress about them via
register_class, but that doesn't work if the underling "scalar" type
is something only xdress knows how to convert.
I imagine this is somewhat similar to the stl layer, the main
difference being that Array can share memory with other instances and
therefore be convert to and from numpy arrays without copying.
Geoffrey