|
Stratax
Scientific computing containers and operations
|
#include <cstddef>#include <stratax/containers/Matrix.hpp>#include <stratax/containers/Tensor.hpp>#include <stratax/containers/Vector.hpp>#include <stratax/core/Concepts.hpp>#include <stratax/core/Exceptions.hpp>#include <stratax/core/Shape.hpp>#include <stratax/core/Validation.hpp>Go to the source code of this file.
Functions | |
| template<Array A> | |
| stratax::container::Vector< typename A::value_type > | to_vector (const A &arr) |
| Converts an array-like object to a vector. | |
| template<Array A> | |
| stratax::container::Matrix< typename A::value_type > | to_matrix (const A &arr) |
| Converts an array-like object to a matrix. | |
| template<Array A> | |
| stratax::container::Tensor< typename A::value_type > | to_tensor (const A &arr) |
| Converts an array-like object to a tensor. | |
| template<typename To, typename From> requires Numeric<To> && Numeric<From> | |
| stratax::container::Vector< To > | astype (const stratax::container::Vector< From > &vec) |
| Casts a vector to a different numeric value type. | |
| template<typename To, typename From> requires Numeric<To> && Numeric<From> | |
| stratax::container::Matrix< To > | astype (const stratax::container::Matrix< From > &mat) |
| Casts a matrix to a different numeric value type. | |
| template<typename To, typename From> requires Numeric<To> && Numeric<From> | |
| stratax::container::Tensor< To > | astype (const stratax::container::Tensor< From > &tensor) |
| Casts a tensor to a different numeric value type. | |
| stratax::container::Matrix< To > astype | ( | const stratax::container::Matrix< From > & | mat | ) |
Casts a matrix to a different numeric value type.
| To | Target numeric type. |
| From | Source numeric type. |
| mat | Source matrix. |
Definition at line 129 of file Conversions.hpp.
References stratax::container::Matrix< T >::shape(), and stratax::container::Matrix< T >::size().
| stratax::container::Tensor< To > astype | ( | const stratax::container::Tensor< From > & | tensor | ) |
Casts a tensor to a different numeric value type.
| To | Target numeric type. |
| From | Source numeric type. |
| tensor | Source tensor. |
Definition at line 153 of file Conversions.hpp.
References stratax::container::Tensor< T >::shape(), and stratax::container::Tensor< T >::size().
| stratax::container::Vector< To > astype | ( | const stratax::container::Vector< From > & | vec | ) |
Casts a vector to a different numeric value type.
| To | Target numeric type. |
| From | Source numeric type. |
| vec | Source vector. |
Definition at line 105 of file Conversions.hpp.
References stratax::container::Vector< T >::shape(), and stratax::container::Vector< T >::size().
| stratax::container::Matrix< typename A::value_type > to_matrix | ( | const A & | arr | ) |
Converts an array-like object to a matrix.
| A | Source array type. |
| arr | Source array. |
| Exceptions::DimensionError | If the source is not rank 2. |
Definition at line 54 of file Conversions.hpp.
References stratax::core::validation::require_rank().
| stratax::container::Tensor< typename A::value_type > to_tensor | ( | const A & | arr | ) |
Converts an array-like object to a tensor.
| A | Source array type. |
| arr | Source array. |
Definition at line 81 of file Conversions.hpp.
| stratax::container::Vector< typename A::value_type > to_vector | ( | const A & | arr | ) |
Converts an array-like object to a vector.
| A | Source array type. |
| arr | Source array. |
| Exceptions::DimensionError | If the source is not rank 1. |
Definition at line 25 of file Conversions.hpp.
References stratax::core::validation::require_rank().