Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammath::vec_d< T > Class Template Reference

Vector class with runtime size based on std::vector storage and mdspan. More...

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

Collaboration diagram for shammath::vec_d< T >:

Public Member Functions

 vec_d (int size)
 Constructor.
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_d< T > &other) const
 Check if this vector is equal to another one.

Public Attributes

std::vector< T > data
 The vector data.
int size
 The vector size.

Detailed Description

template<class T>
class shammath::vec_d< T >

Vector class with runtime size based on std::vector storage and mdspan.

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

Definition at line 190 of file matrix.hpp.

Constructor & Destructor Documentation

◆ vec_d()

template<class T>
shammath::vec_d< T >::vec_d ( int size)
inline

Constructor.

Definition at line 198 of file matrix.hpp.

Member Function Documentation

◆ get_mdspan()

template<class T>
auto shammath::vec_d< T >::get_mdspan ( )
inlineconstexpr

Get the vector data as a mdspan.

Definition at line 201 of file matrix.hpp.

◆ get_mdspan_mat_col()

template<class T>
auto shammath::vec_d< T >::get_mdspan_mat_col ( )
inlineconstexpr

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

Definition at line 206 of file matrix.hpp.

◆ get_mdspan_mat_row()

template<class T>
auto shammath::vec_d< T >::get_mdspan_mat_row ( )
inlineconstexpr

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

Definition at line 211 of file matrix.hpp.

◆ operator==()

template<class T>
bool shammath::vec_d< T >::operator== ( const vec_d< T > & other) const
inline

Check if this vector is equal to another one.

Definition at line 219 of file matrix.hpp.

Here is the call graph for this function:

◆ operator[]()

template<class T>
T & shammath::vec_d< T >::operator[] ( int i)
inlineconstexpr

Access the vector entry at position i.

Definition at line 216 of file matrix.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ data

template<class T>
std::vector<T> shammath::vec_d< T >::data

The vector data.

Definition at line 193 of file matrix.hpp.

◆ size

template<class T>
int shammath::vec_d< T >::size

The vector size.

Definition at line 195 of file matrix.hpp.


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