|
Stratax
Scientific computing containers and operations
|
#include <stratax/core/Buffer.hpp>#include <stratax/core/Concepts.hpp>#include <stratax/core/Config.hpp>#include <stratax/core/Exceptions.hpp>#include <stratax/core/Shape.hpp>#include <stratax/core/Validation.hpp>#include <stratax/containers/Tensor.hpp>#include <stratax/containers/Matrix.hpp>#include <stratax/containers/Vector.hpp>Go to the source code of this file.
Functions | |
| template<Array A> | |
| stratax::container::Tensor< typename A::value_type > | reshape (const A &arr, const stratax::core::Shape &shape) |
| Reshapes an array-like object into a tensor with the requested shape. | |
| template<Array A> | |
| stratax::container::Vector< typename A::value_type > | flatten (const A &arr) |
| Flattens an array-like object into a vector. | |
| stratax::container::Vector< typename A::value_type > flatten | ( | const A & | arr | ) |
Flattens an array-like object into a vector.
The values are copied in storage order.
| arr | Source array. |
Definition at line 55 of file Reshape.hpp.
| stratax::container::Tensor< typename A::value_type > reshape | ( | const A & | arr, |
| const stratax::core::Shape & | shape ) |
Reshapes an array-like object into a tensor with the requested shape.
The element order is preserved while the logical shape changes.
| arr | Source array. |
| shape | Target shape. |
| Exceptions::ShapeError | If the shape does not match the number of elements. |
Definition at line 27 of file Reshape.hpp.
References stratax::core::Shape::elements(), stratax::core::validation::require_equal_size(), and stratax::container::Tensor< T >::size().