numerics 0.1.0
Loading...
Searching...
No Matches
num::BasicMatrix< T > Class Template Reference

Dense row-major owning matrix. More...

#include <matrix.hpp>

Public Member Functions

 BasicMatrix ()
 
 BasicMatrix (idx rows, idx cols)
 
 BasicMatrix (idx rows, idx cols, T val)
 
 ~BasicMatrix ()
 
 BasicMatrix (const BasicMatrix &o)
 
 BasicMatrix (BasicMatrix &&o) noexcept
 
BasicMatrixoperator= (const BasicMatrix &o)
 
BasicMatrixoperator= (BasicMatrix &&o) noexcept
 
constexpr idx rows () const noexcept
 
constexpr idx cols () const noexcept
 
constexpr idx size () const noexcept
 
T * data ()
 
const T * data () const
 
T & operator() (idx i, idx j)
 
operator() (idx i, idx j) const
 
void to_gpu ()
 
void to_cpu ()
 
T * gpu_data ()
 
const T * gpu_data () const
 
bool on_gpu () const
 

Detailed Description

template<std::floating_point T>
class num::BasicMatrix< T >

Dense row-major owning matrix.

Definition at line 17 of file matrix.hpp.

Constructor & Destructor Documentation

◆ BasicMatrix() [1/5]

template<std::floating_point T>
num::BasicMatrix< T >::BasicMatrix ( )
inline

Definition at line 19 of file matrix.hpp.

◆ BasicMatrix() [2/5]

template<std::floating_point T>
num::BasicMatrix< T >::BasicMatrix ( idx  rows,
idx  cols 
)
inline

Definition at line 24 of file matrix.hpp.

◆ BasicMatrix() [3/5]

template<std::floating_point T>
num::BasicMatrix< T >::BasicMatrix ( idx  rows,
idx  cols,
val 
)
inline

Definition at line 29 of file matrix.hpp.

References num::BasicMatrix< T >::size().

◆ ~BasicMatrix()

template<std::floating_point T>
num::BasicMatrix< T >::~BasicMatrix ( )
inline

Definition at line 36 of file matrix.hpp.

References num::cuda::free().

◆ BasicMatrix() [4/5]

template<std::floating_point T>
num::BasicMatrix< T >::BasicMatrix ( const BasicMatrix< T > &  o)
inline

Definition at line 44 of file matrix.hpp.

References num::BasicMatrix< T >::size().

◆ BasicMatrix() [5/5]

template<std::floating_point T>
num::BasicMatrix< T >::BasicMatrix ( BasicMatrix< T > &&  o)
inlinenoexcept

Definition at line 51 of file matrix.hpp.

Member Function Documentation

◆ cols()

◆ data() [1/2]

◆ data() [2/2]

template<std::floating_point T>
const T * num::BasicMatrix< T >::data ( ) const
inline

Definition at line 92 of file matrix.hpp.

◆ gpu_data() [1/2]

template<std::floating_point T>
T * num::BasicMatrix< T >::gpu_data ( )
inline

Definition at line 116 of file matrix.hpp.

Referenced by num::backends::gpu::matmul(), and num::backends::gpu::matvec().

◆ gpu_data() [2/2]

template<std::floating_point T>
const T * num::BasicMatrix< T >::gpu_data ( ) const
inline

Definition at line 117 of file matrix.hpp.

◆ on_gpu()

template<std::floating_point T>
bool num::BasicMatrix< T >::on_gpu ( ) const
inline

Definition at line 118 of file matrix.hpp.

◆ operator()() [1/2]

template<std::floating_point T>
T & num::BasicMatrix< T >::operator() ( idx  i,
idx  j 
)
inline

Definition at line 94 of file matrix.hpp.

◆ operator()() [2/2]

template<std::floating_point T>
T num::BasicMatrix< T >::operator() ( idx  i,
idx  j 
) const
inline

Definition at line 95 of file matrix.hpp.

◆ operator=() [1/2]

template<std::floating_point T>
BasicMatrix & num::BasicMatrix< T >::operator= ( BasicMatrix< T > &&  o)
inlinenoexcept

Definition at line 70 of file matrix.hpp.

References num::cuda::free().

◆ operator=() [2/2]

template<std::floating_point T>
BasicMatrix & num::BasicMatrix< T >::operator= ( const BasicMatrix< T > &  o)
inline

Definition at line 60 of file matrix.hpp.

References num::BasicMatrix< T >::size().

◆ rows()

◆ size()

◆ to_cpu()

template<std::floating_point T>
void num::BasicMatrix< T >::to_cpu ( )
inline

◆ to_gpu()

template<std::floating_point T>
void num::BasicMatrix< T >::to_gpu ( )
inline

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