![]() |
Ginkgo Generated from branch based on master. Ginkgo version 1.7.0
A numerical linear algebra library targeting many-core architectures
|
A type representing the dimensions of a multidimensional object. More...
#include <ginkgo/core/base/dim.hpp>
Public Types | |
using | dimension_type = DimensionType |
Public Member Functions | |
constexpr | dim (const dimension_type &size=dimension_type{}) |
Creates a dimension object with all dimensions set to the same value. | |
template<typename... Rest> | |
constexpr | dim (const dimension_type &first, const Rest &... rest) |
Creates a dimension object with the specified dimensions. | |
constexpr const dimension_type & | operator[] (const size_type &dimension) const noexcept |
Returns the requested dimension. | |
dimension_type & | operator[] (const size_type &dimension) noexcept |
constexpr | operator bool () const |
Checks if all dimensions evaluate to true. | |
Static Public Attributes | |
static constexpr size_type | dimensionality = Dimensionality |
Friends | |
struct | dim< dimensionality+1 > |
constexpr bool | operator== (const dim &x, const dim &y) |
Checks if two dim objects are equal. | |
constexpr dim | operator* (const dim &x, const dim &y) |
Multiplies two dim objects. | |
std::ostream & | operator<< (std::ostream &os, const dim &x) |
A stream operator overload for dim. | |
A type representing the dimensions of a multidimensional object.
Dimensionality | number of dimensions of the object |
DimensionType | datatype used to represent each dimension |
|
inlineconstexpr |
Creates a dimension object with all dimensions set to the same value.
size | the size of each dimension |
|
inlineconstexpr |
Creates a dimension object with the specified dimensions.
If the number of dimensions given is less than the dimensionality of the object, the remaining dimensions are set to the same value as the last value given.
For example, in the context of matrices dim<2>{2, 3}
creates the dimensions for a 2-by-3 matrix.
first | first dimension |
rest | other dimensions |
|
inlineexplicitconstexpr |
Checks if all dimensions evaluate to true.
For standard arithmetic types, this is equivalent to all dimensions being different than zero.
|
inlineconstexprnoexcept |
Returns the requested dimension.
For example, if d
is a dim<2> object representing matrix dimensions, d[0]
returns the number of rows, and d[1]
returns the number of columns.
dimension | the requested dimension |
dimension
-th dimension References gko::one().
|
inlinenoexcept |
References gko::one().
|
friend |
Multiplies two dim objects.
x | first object |
y | second object |
x * y
|
friend |
A stream operator overload for dim.
os | stream object |
x | dim object |
|
friend |
Checks if two dim objects are equal.
x | first object |
y | second object |