TRIQS / nda

C++ library for multi-dimensional arrays
https://triqs.github.io/nda
Other
15 stars 12 forks source link

nda::zeros for fortran layout #42

Closed jasonkaye closed 1 year ago

jasonkaye commented 1 year ago

nda::zeros does not work for Fortran layout arrays. I'd like to be able to write

auto b = nda::zeros<double, F_layout>(m,n,p);

and get an array of zeros in Fortran layout.

Wentzell commented 1 year ago

Dear @jasonkaye,

For each array type you can use the static member function zeros

auto ac = nda::array<double, 3>::zeros(m,n,p);
auto af = nda::array<double, 3, F_layout>::zeros(m,n,p);

The free function nda::zeros is intended for the default array case and does at this point not allow for customizations of memory layout, algebra and such.

jasonkaye commented 1 year ago

Excellent, thanks Nils.