Stratax
Scientific computing containers and operations
Loading...
Searching...
No Matches
stratax::container Namespace Reference

Namespaces

namespace  detail

Classes

class  Matrix
class  Tensor
class  Vector

Functions

template<typename T>
std::ostream & operator<< (std::ostream &os, const Vector< T > &vector)
 Writes a vector in compact bracketed list form.
template<typename T>
std::ostream & operator<< (std::ostream &os, const Matrix< T > &matrix)
 Writes a matrix in a human-readable row-major layout.
template<typename T>
std::ostream & operator<< (std::ostream &os, const Tensor< T > &tensor)
 Writes a tensor in nested bracket notation.

Function Documentation

◆ operator<<() [1/3]

template<typename T>
std::ostream & stratax::container::operator<< ( std::ostream & os,
const Matrix< T > & matrix )

Writes a matrix in a human-readable row-major layout.

Parameters
osOutput stream.
matrixMatrix to print.
Returns
The updated output stream.

Definition at line 115 of file Print.hpp.

References stratax::container::Matrix< T >::cols(), and stratax::container::Matrix< T >::rows().

◆ operator<<() [2/3]

template<typename T>
std::ostream & stratax::container::operator<< ( std::ostream & os,
const Tensor< T > & tensor )

Writes a tensor in nested bracket notation.

Empty tensors are written as []. Non-empty tensors are printed recursively using the tensor shape and row-major strides.

Parameters
osOutput stream.
tensorTensor to print.
Returns
The updated output stream.

Definition at line 154 of file Print.hpp.

References stratax::core::Shape::elements(), stratax::container::detail::print_tensor_recursive(), and stratax::container::Tensor< T >::shape().

◆ operator<<() [3/3]

template<typename T>
std::ostream & stratax::container::operator<< ( std::ostream & os,
const Vector< T > & vector )

Writes a vector in compact bracketed list form.

Parameters
osOutput stream.
vectorVector to print.
Returns
The updated output stream.

Definition at line 86 of file Print.hpp.

References stratax::container::Vector< T >::begin(), and stratax::container::Vector< T >::end().