Stratax 0.4.0rc1
Loading...
Searching...
No Matches
Print.hpp File Reference

Logical array formatting for owning containers and views. More...

#include <ostream>
#include <string>
#include <stratax/containers/Matrix.hpp>
#include <stratax/containers/Tensor.hpp>
#include <stratax/containers/Vector.hpp>
#include <stratax/core/ArrayView.hpp>
Include dependency graph for Print.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
void stratax::container::detail::print_value (std::ostream &os, const T &value)
 Writes booleans as true/false and 8-bit integers as numbers; otherwise uses stream insertion.
 
template<Array A>
void stratax::container::detail::print_recursive (std::ostream &os, const A &array, std::size_t dim, std::size_t offset, std::size_t depth, const char *sibling_separator)
 Recursively prints a tensor using nested bracket notation.
 
template<Array A>
std::ostream & stratax::container::detail::print_array (std::ostream &os, const A &array)
 Prints elements in logical row-major order with nested brackets. Empty arrays print as [], regardless of shape. Higher-rank nesting uses four-space indentation. Rank-two rows are separated by newlines; higher-rank siblings by commas and newlines. Stream formatting applies to scalar values.
 
template<typename T >
std::ostream & stratax::container::operator<< (std::ostream &os, const Vector< T > &vector)
 Writes a Vector using logical nested-bracket formatting.
 
template<typename T >
std::ostream & stratax::container::operator<< (std::ostream &os, const Matrix< T > &matrix)
 Writes a Matrix using logical nested-bracket formatting.
 
template<typename T >
std::ostream & stratax::container::operator<< (std::ostream &os, const Tensor< T > &tensor)
 Writes a Tensor using logical nested-bracket formatting.
 
template<typename T >
std::ostream & stratax::core::operator<< (std::ostream &os, const ArrayView< T > &view)
 Writes a ArrayView using logical nested-bracket formatting.
 

Detailed Description

Logical array formatting for owning containers and views.

Definition in file Print.hpp.

Function Documentation

◆ operator<<() [1/4]

template<typename T >
std::ostream & stratax::core::operator<< ( std::ostream &  os,
const ArrayView< T > &  view 
)

Writes a ArrayView using logical nested-bracket formatting.

Returns
The output stream.
See also
stratax::container::detail::print_array

Definition at line 155 of file Print.hpp.

◆ operator<<() [2/4]

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

Writes a Matrix using logical nested-bracket formatting.

Returns
The output stream.
See also
stratax::container::detail::print_array

Definition at line 137 of file Print.hpp.

◆ operator<<() [3/4]

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

Writes a Tensor using logical nested-bracket formatting.

Returns
The output stream.
See also
stratax::container::detail::print_array

Definition at line 144 of file Print.hpp.

◆ operator<<() [4/4]

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

Writes a Vector using logical nested-bracket formatting.

Returns
The output stream.
See also
stratax::container::detail::print_array

Definition at line 130 of file Print.hpp.

◆ print_array()

template<Array A>
std::ostream & stratax::container::detail::print_array ( std::ostream &  os,
const A &  array 
)

Prints elements in logical row-major order with nested brackets. Empty arrays print as [], regardless of shape. Higher-rank nesting uses four-space indentation. Rank-two rows are separated by newlines; higher-rank siblings by commas and newlines. Stream formatting applies to scalar values.

Returns
The output stream.

Definition at line 103 of file Print.hpp.

◆ print_recursive()

template<Array A>
void stratax::container::detail::print_recursive ( std::ostream &  os,
const A &  array,
std::size_t  dim,
std::size_t  offset,
std::size_t  depth,
const char *  sibling_separator 
)

Recursively prints a tensor using nested bracket notation.

Definition at line 42 of file Print.hpp.

◆ print_value()

template<typename T >
void stratax::container::detail::print_value ( std::ostream &  os,
const T &  value 
)

Writes booleans as true/false and 8-bit integers as numbers; otherwise uses stream insertion.

Definition at line 20 of file Print.hpp.