This is the homepage of TRIQS/nda v1.3.0. The source code can be found on GitHub.
nda is a C++ library providing an efficient and flexible multi-dimensional array class. It is an essential building-block of the TRIQS project.
Some features include
- coded in C++17/20 using concepts
- expressions are implemented lazily for maximum performance
- flexible and lightweight view types
- matrix and vector class with BLAS/LAPACK backend
- easily store and retrieve arrays to and from HDF5 files using TRIQS/h5
- common MPI functionality using TRIQS/mpi
- Python bindings
- GPU and CUDA support
- and more.
Motivating example
#include <h5/h5.hpp>
int main() {
A() = 0;
A(0, 1, 2) = 40;
int a = A(0, 1, 2) + B(0, 1);
auto V = A(range(0, 3), range(0, 2), 0);
auto C = V + 2 * B;
{
h5::file file("dat.h5", 'w');
h5::write(file, "A", A);
}
array<long, 3> D;
{
h5::file file("dat.h5", 'r');
h::read(file, "A", D);
}
}
A generic multi-dimensional array.
auto max_element(A const &a)
Find the maximum element of an array.
auto sum(A const &a)
Sum all the elements of an nda::Array object.
auto min_element(A const &a)
Find the minimum element of an array.
decltype(auto) make_regular(A &&a)
Make a given object regular.
Provides HDF5 support for the nda library.
Includes all relevant headers for the core nda library.
Where to start?
The Installation section tells you how to get the library and make it available on your system.
Integration in C++ projects explains how to integrate nda in your own C++ code.
Then, you can start with the Examples section to get an overview of the library's features and how nda can be used in practice.
Furthermore, we provide a detailed reference API Documentation to answer your questions.
If you experience any problem with the library, you can post an Issue on GitHub.