Skip to content
Snippets Groups Projects
Commit e6d091b4 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Template version of vector and Tensor

It allows to declare vectors (tensors) of arbitrary
size N (NxM). The difference wrt Matrix and std::vector
is that dimensions should be declared at compilation time.
This allows to save the storage of extra information
(useful for small 3 or 3x3 objects) and to optimize the code.

To improve the performance, I used a single n*m array
for Tensors (instead of a [n][m] array). However,
the external interface is untouched.

Finally, I defined some typedefs to simplify usage:
Vector (for 3d, so as to maintain compatibility with the rest of plumed)
Tensor (for 3x3d, so as to maintain compatibility with the rest of plumed)

From the tests that I performed, there is no visible overhead
when compared with the older (fixed 3 or 3x3) vector/tensor.
parent 4cfbef8f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment