Stratax
Scientific computing containers and operations
Loading...
Searching...
No Matches
creation Namespace Reference

Functions

template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > zeros (const stratax::core::Shape &shape)
 Creates a tensor filled with zeros.
template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > ones (const stratax::core::Shape &shape)
 Creates a tensor filled with ones.
template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > full (const stratax::core::Shape &shape, const T &value)
 Creates a tensor filled with a constant value.
template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > identity (const std::size_t size)
 Creates a square identity tensor.

Function Documentation

◆ full()

template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > creation::full ( const stratax::core::Shape & shape,
const T & value )

Creates a tensor filled with a constant value.

Template Parameters
TNumeric value type.
Parameters
shapeTarget shape.
valueValue to copy into every element.
Returns
Tensor filled with the requested value.

Definition at line 54 of file Creation.hpp.

◆ identity()

template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > creation::identity ( const std::size_t size)

Creates a square identity tensor.

Template Parameters
TNumeric value type.
Parameters
sizeSide length of the identity matrix.
Returns
Square tensor with ones on the diagonal and zeros elsewhere.

Definition at line 69 of file Creation.hpp.

References zeros().

◆ ones()

template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > creation::ones ( const stratax::core::Shape & shape)

Creates a tensor filled with ones.

Template Parameters
TNumeric value type.
Parameters
shapeTarget shape.
Returns
Tensor filled with numeric ones.

Definition at line 38 of file Creation.hpp.

◆ zeros()

template<typename T>
requires Numeric<T>
stratax::container::Tensor< T > creation::zeros ( const stratax::core::Shape & shape)

Creates a tensor filled with zeros.

Template Parameters
TNumeric value type.
Parameters
shapeTarget shape.
Returns
Tensor filled with default-constructed numeric zeros.

Definition at line 23 of file Creation.hpp.

Referenced by identity().