Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
shammath::vec< T, n > Class Template Reference

Vector class based on std::array storage and mdspan. More...

#include <shammath/include/shammath/matrix.hpp>

+ Collaboration diagram for shammath::vec< T, n >:

Public Member Functions

constexpr auto get_mdspan ()
 Get the vector data as a mdspan.
 
constexpr auto get_mdspan_mat_col ()
 Get the vector data as a mdspan of a matrix with one column.
 
constexpr auto get_mdspan_mat_row ()
 Get the vector data as a mdspan of a matrix with one row.
 
constexpr T & operator[] (int i)
 Access the vector entry at position i.
 
bool operator== (const vec< T, n > &other)
 Check if this vector is equal to another one.
 

Public Attributes

std::array< T, n > data
 The vector data.
 

Detailed Description

template<class T, int n>
class shammath::vec< T, n >

Vector class based on std::array storage and mdspan.

Template Parameters
Tthe type of the vector entries
nthe number of entries

Definition at line 96 of file matrix.hpp.

Member Function Documentation

◆ get_mdspan()

template<class T , int n>
constexpr auto shammath::vec< T, n >::get_mdspan ( )
inlineconstexpr

Get the vector data as a mdspan.

Definition at line 102 of file matrix.hpp.

◆ get_mdspan_mat_col()

template<class T , int n>
constexpr auto shammath::vec< T, n >::get_mdspan_mat_col ( )
inlineconstexpr

Get the vector data as a mdspan of a matrix with one column.

Definition at line 107 of file matrix.hpp.

◆ get_mdspan_mat_row()

template<class T , int n>
constexpr auto shammath::vec< T, n >::get_mdspan_mat_row ( )
inlineconstexpr

Get the vector data as a mdspan of a matrix with one row.

Definition at line 112 of file matrix.hpp.

◆ operator==()

template<class T , int n>
bool shammath::vec< T, n >::operator== ( const vec< T, n > &  other)
inline

Check if this vector is equal to another one.

Definition at line 120 of file matrix.hpp.

◆ operator[]()

template<class T , int n>
constexpr T & shammath::vec< T, n >::operator[] ( int  i)
inlineconstexpr

Access the vector entry at position i.

Definition at line 117 of file matrix.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ data

template<class T , int n>
std::array<T, n> shammath::vec< T, n >::data

The vector data.

Definition at line 99 of file matrix.hpp.


The documentation for this class was generated from the following file: