Class Shape#
Defined in File shape.hpp
Class Documentation#
-
class Shape#
Public Types
-
using SizeType = uint32_t#
Public Functions
-
Shape() = default#
Default constructor.
-
template<typename Scalar, size_t... Dimensions>
explicit Shape(const FixedStorage<Scalar, Dimensions...> &fixed)# Create a shape object from the dimensions of a FixedStorage object. This is used.
- Template Parameters
Scalar – Scalar type of the FixedStorage object
Dimensions – Dimensions of the FixedStorage object
- Parameters
fixed – The FixedStorage object
-
template<typename V>
Shape(const std::initializer_list<V> &vals)# Create a Shape object from a list of values
- Template Parameters
V – Scalar type of the values
- Parameters
vals – The dimensions for the object
-
template<typename V>
explicit Shape(const std::vector<V> &vals)# Create a Shape object from a vector of values
- Template Parameters
V – Scalar type of the values
- Parameters
vals – The dimensions for the object
-
Shape(const Shape &other) = default#
Create a copy of a Shape object
- Parameters
other – Shape object to copy
-
Shape(const MatrixShape &other)#
-
Shape(const VectorShape &other)#
-
Shape(Shape &&other) noexcept = default#
Create a Shape from an RValue
- Parameters
other – Temporary Shape object to copy
-
template<size_t Dim>
Shape(Shape &&other) noexcept# Create a Shape object from one with a different type and number of dimensions, moving it instead of copying it.
- Template Parameters
V – Scalar type of the values
Dim – Number of dimensions
- Parameters
other – Temporary Shape object to move
-
template<typename V>
auto operator=(const std::initializer_list<V> &vals) -> Shape&# Assign a Shape object to this object
-
template<typename V>
auto operator=(const std::vector<V> &vals) -> Shape&# Assign a Shape object to this object
-
auto operator=(Shape &&other) noexcept -> Shape& = default#
Assign an RValue Shape to this object
- Parameters
other – RValue to move
- Returns
-
auto operator=(const Shape &other) -> Shape& = default#
Assign a Shape to this object
- Parameters
other – Shape to copy
- Returns
-
template<typename Index>
auto operator[](Index index) const -> const SizeType&# Access an element of the Shape object
- Template Parameters
Index – Typename of the index
- Parameters
index – Index to access
- Returns
The value at the index
-
template<typename Index>
auto operator[](Index index) -> SizeType&# Access an element of the Shape object
- Template Parameters
Index – Typename of the index
- Parameters
index – Index to access
- Returns
A reference to the value at the index
-
auto operator==(const Shape &other) const -> bool#
Compare two Shape objects, returning true if and only if they are identical
- Parameters
other – Shape object to compare
- Returns
true if the objects are identical
-
auto operator!=(const Shape &other) const -> bool#
Compare two Shape objects, returning true if and only if they are not identical
- Parameters
other – Shape object to compare
- Returns
true if the objects are not identical
-
auto ndim() const -> int#
Return the number of dimensions in the Shape object
- Returns
Number of dimensions
-
auto subshape(int start, int end) const -> Shape#
Return a subshape of the Shape object
- Parameters
start – Starting index
end – Ending index
- Returns
Subshape
Public Static Functions
Public Static Attributes
-
static constexpr size_t MaxDimensions = LIBRAPID_MAX_ARRAY_DIMS#
-
using SizeType = uint32_t#