numerics
Loading...
Searching...
No Matches
num::Matrix Class Reference

Dense row-major matrix with optional GPU storage. More...

#include <matrix.hpp>

Public Member Functions

 Matrix ()
 
 Matrix (idx rows, idx cols)
 
 Matrix (idx rows, idx cols, real val)
 
 ~Matrix ()
 
 Matrix (const Matrix &)
 
 Matrix (Matrix &&) noexcept
 
Matrixoperator= (const Matrix &)
 
Matrixoperator= (Matrix &&) noexcept
 
constexpr idx rows () const noexcept
 
constexpr idx cols () const noexcept
 
constexpr idx size () const noexcept
 
realdata ()
 
const realdata () const
 
realoperator() (idx i, idx j)
 
real operator() (idx i, idx j) const
 
void to_gpu ()
 
void to_cpu ()
 
realgpu_data ()
 
const realgpu_data () const
 
bool on_gpu () const
 

Detailed Description

Dense row-major matrix with optional GPU storage.

Definition at line 12 of file matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/5]

num::Matrix::Matrix ( )
inline

Definition at line 14 of file matrix.hpp.

◆ Matrix() [2/5]

num::Matrix::Matrix ( idx  rows,
idx  cols 
)

Definition at line 22 of file matrix.cpp.

◆ Matrix() [3/5]

num::Matrix::Matrix ( idx  rows,
idx  cols,
real  val 
)

Definition at line 25 of file matrix.cpp.

References num::ipow(), and size().

◆ ~Matrix()

num::Matrix::~Matrix ( )

Definition at line 30 of file matrix.cpp.

References num::cuda::free().

◆ Matrix() [4/5]

num::Matrix::Matrix ( const Matrix o)

Definition at line 34 of file matrix.cpp.

References num::ipow(), and size().

◆ Matrix() [5/5]

num::Matrix::Matrix ( Matrix &&  o)
noexcept

Definition at line 39 of file matrix.cpp.

References num::ipow().

Member Function Documentation

◆ cols()

constexpr idx num::Matrix::cols ( ) const
inlineconstexprnoexcept

Definition at line 25 of file matrix.hpp.

◆ data() [1/2]

real * num::Matrix::data ( )
inline

Definition at line 28 of file matrix.hpp.

◆ data() [2/2]

const real * num::Matrix::data ( ) const
inline

Definition at line 29 of file matrix.hpp.

◆ gpu_data() [1/2]

real * num::Matrix::gpu_data ( )
inline

Definition at line 35 of file matrix.hpp.

◆ gpu_data() [2/2]

const real * num::Matrix::gpu_data ( ) const
inline

Definition at line 36 of file matrix.hpp.

◆ on_gpu()

bool num::Matrix::on_gpu ( ) const
inline

Definition at line 37 of file matrix.hpp.

◆ operator()() [1/2]

real & num::Matrix::operator() ( idx  i,
idx  j 
)
inline

Definition at line 30 of file matrix.hpp.

References num::ipow().

◆ operator()() [2/2]

real num::Matrix::operator() ( idx  i,
idx  j 
) const
inline

Definition at line 31 of file matrix.hpp.

References num::ipow().

◆ operator=() [1/2]

Matrix & num::Matrix::operator= ( const Matrix o)

Definition at line 45 of file matrix.cpp.

References num::ipow(), and size().

◆ operator=() [2/2]

Matrix & num::Matrix::operator= ( Matrix &&  o)
noexcept

Definition at line 55 of file matrix.cpp.

References num::cuda::free(), and num::ipow().

◆ rows()

constexpr idx num::Matrix::rows ( ) const
inlineconstexprnoexcept

Definition at line 24 of file matrix.hpp.

Referenced by num::lu_det(), and num::lu_inv().

◆ size()

constexpr idx num::Matrix::size ( ) const
inlineconstexprnoexcept

Definition at line 26 of file matrix.hpp.

Referenced by Matrix(), Matrix(), operator=(), to_cpu(), and to_gpu().

◆ to_cpu()

void num::Matrix::to_cpu ( )

Definition at line 75 of file matrix.cpp.

References num::cuda::free(), size(), and num::cuda::to_host().

◆ to_gpu()

void num::Matrix::to_gpu ( )

Definition at line 68 of file matrix.cpp.

References num::cuda::alloc(), size(), and num::cuda::to_device().


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