3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 11:43:47 +01:00
dft_tools/doc/reference/arrays/containers/template_parameters.rst

42 lines
2.0 KiB
ReStructuredText
Raw Normal View History

2013-08-27 19:17:17 +02:00
Template parameters of the containers and views
======================================================
.. _arr_templ_par_to:
TraversalOrder
----------------------------
* TraversalOrder is a type encoding of the optimal traversal in memory.
Default is void, corresponding to as regular C-style ordering (slowest index first).
* The traversal of the arrays (iterators, foreach loop) will be written and optimised for this
2013-08-27 19:17:17 +02:00
order.
* It is indeed sometimes necessary to know *at compile time* the traversal order to generate
an optimal code. The default (C-style) is sufficient is most cases, but not always...
2013-08-27 19:17:17 +02:00
* More explanations here...
2013-08-27 19:17:17 +02:00
* Note that this notion is completely independent of the real memory layout of the array,
which is a runtime parameter.
2013-08-27 19:17:17 +02:00
The code will be correct for any order, but may be faster for the TraversalOrder.
* TraversalOrder is not present for vector since there is only one possibility in 1d.
* TODO : document the various possibility beyond C style.
+--------------------------+------------------------------------------------------------+
| TraversalOrder | Meaning |
+==========================+============================================================+
| void | C style traversal (lowest index first). |
+--------------------------+------------------------------------------------------------+
| _traversal_fortran | Fortran style traversal (last index first) |
+--------------------------+------------------------------------------------------------+
| _traversal_dynamical | Traverse in the order specified by the memory layout |
+--------------------------+------------------------------------------------------------+
| _traversal_custom<2,1,0> | Traverse in the order specified by the permutation (2,1,0) |
+--------------------------+------------------------------------------------------------+
2013-08-27 19:17:17 +02:00