![]() |
Documentation 6b54b78464
|
A templated vector/matrix object. More...
#include "../toolboxes/allocation_toolbox.hpp"#include "../basic_types/datatype_structure.hpp"#include "../parallelization/vectorization.hpp"#include <utility>#include <type_traits>Go to the source code of this file.
Namespaces | |
| namespace | container_details |
Macros | |
| #define | DUMMY_ALLOCATOR |
| #define | REAL_ALLOCATOR(EXTRA) |
| #define | CUSTOM_CTOR_AND_DTOR_BASE(INIT, MOVE) |
| #define | CUSTOM_CTOR_AND_DTOR(X) CUSTOM_CTOR_AND_DTOR_BASE(X = 0, X = other.X; other.X = 0) |
| #define | UNIV_ACCESSORS |
| #define | MATRIX_ACCESSORS(M, N) |
| #define | VECTOR_ACCESSORS(M, ROWMAJOR) |
Typedefs | |
| template<class T > | |
| using | su2vector = C2DContainer< unsigned long, T, StorageType::ColumnMajor, 64, DynamicSize, 1 > |
| Useful typedefs with default template parameters. | |
| template<class T > | |
| using | su2matrix = C2DContainer< unsigned long, T, StorageType::RowMajor, 64, DynamicSize, DynamicSize > |
| template<class T > | |
| using | ColMajorMatrix = C2DContainer< unsigned long, T, StorageType::ColumnMajor, 64, DynamicSize, DynamicSize > |
| using | su2activevector = su2vector< su2double > |
| using | su2activematrix = su2matrix< su2double > |
| using | su2passivevector = su2vector< passivedouble > |
| using | su2passivematrix = su2matrix< passivedouble > |
Enumerations | |
| enum class | StorageType { StorageType::RowMajor = 0 , StorageType::ColumnMajor = 1 } |
| Supported ways to flatten a matrix into an array. Contiguous rows or contiguous columns respectively. More... | |
| enum | SizeType : size_t { DynamicSize = 0 } |
| Special value "DynamicSize" to indicate a dynamic size. More... | |
A templated vector/matrix object.
SU2 Project Website: https://su2code.github.io
The SU2 Project is maintained by the SU2 Foundation (http://su2foundation.org)
Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
SU2 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
SU2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with SU2. If not, see http://www.gnu.org/licenses/.
| #define CUSTOM_CTOR_AND_DTOR | ( | X | ) | CUSTOM_CTOR_AND_DTOR_BASE(X = 0, X = other.X; other.X = 0) |
Shorthand for when specialization has only one more member than m_data.
| #define CUSTOM_CTOR_AND_DTOR_BASE | ( | INIT, | |
| MOVE | |||
| ) |
Dynamic types need to manage internal data as the derived class would not compile if it tried to set m_data to null on static specializations. Move construct/assign are enabled by transferring ownership of data pointer, the rvalue is left in the empty state. The default ctor needs to "INIT" some fields. The move ctor/assign need to "MOVE" those fields, i.e. copy and set "other" appropriately.
| #define DUMMY_ALLOCATOR |
Static size specializations use this do-nothing allocation macro.
| #define MATRIX_ACCESSORS | ( | M, | |
| N | |||
| ) |
Operator (,) gives pointwise access, operator [] returns a pointer to the first element of the row/column of a row/column-major matrix respectively.
| #define REAL_ALLOCATOR | ( | EXTRA | ) |
Dynamic size specializations use this one, EXTRA is used to set some runtime internal value that depend on the number of rows/columns. What values need setting depends on the specialization as not all have members for e.g. number of rows and cols (static size optimization). Because aligned allocation is used, "placement new" is used after to default construct the elements of non-trivial type. Such types also need to be destructed explicitly before freeing the memory.
| #define UNIV_ACCESSORS |
Universal accessors return a raw pointer to the data.
| #define VECTOR_ACCESSORS | ( | M, | |
| ROWMAJOR | |||
| ) |
Vectors provide both [] and () with the same behavior.