-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation excludes all initialisation #101
Comments
Hi @superdump, Enoki arrays are pretty intuitive to initialize. For instance: using Vector3f = enoki::Array<float, 3>;
Vector3f a(); // -> [0.f, 0.f, 0.f]
Vector3f b(2.f); // -> [2.0, 2.0, 2.0]
Vector3f c(2.f, 3.f, 4.f); // -> [2.0, 3.0, 4.0] When using You can also have a look at the Mitsuba 2 codebase for inspiration which uses enoki in all its possible forms 😉 If you have a specific problem in mind / snippet of code, I am happy to help for a "translation". Cheers! |
I think @superdump's request would be to have some auto-translation from standard STL constructs for dynamic arrays, which may be useful to have at some point. My suggestion would be to leave the ticket open and revisit once all the Enoki changes have landed. |
Maybe it's just a documentation issue. In the upcoming Enoki, this would be written as
|
Both responses are useful. That said, if one is using nested arrays with the current enoki release, to leverage packets, so something like: using FloatP = enoki::array<float, 32>;
using Vector3fP = enoki::array<FloatP, 3>; Firstly, how do you initialise a single 3-element vector in a Secondly, how do you efficiently use and maintain a contiguous collection of 3-element vectors in a Vector3fP? As in something similar to |
The documentation excludes all initialisation which makes it difficult to understand how to start using enoki. Examples of how to make arrays of vectors that are optimally formatted (in terms of data layout) would probably help. It should be reasonable to expect that someone using enoki has used plain C++
T[]
arrays, as well asstd::vector<T>
and perhapsstd::array<T>
so examples porting from saystd::vector<Vector3f>
whereVector3f
is a plain struct of 3float
s would be informative.The text was updated successfully, but these errors were encountered: