|
numerics 0.1.0
|
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 | |
| Matrix & | operator= (const Matrix &) |
| Matrix & | operator= (Matrix &&) noexcept |
| constexpr idx | rows () const noexcept |
| constexpr idx | cols () const noexcept |
| constexpr idx | size () const noexcept |
| real * | data () |
| const real * | data () const |
| real & | operator() (idx i, idx j) |
| real | operator() (idx i, idx j) const |
| void | to_gpu () |
| void | to_cpu () |
| real * | gpu_data () |
| const real * | gpu_data () const |
| bool | on_gpu () const |
Dense row-major matrix with optional GPU storage.
Definition at line 12 of file matrix.hpp.
|
inline |
Definition at line 14 of file matrix.hpp.
Definition at line 23 of file matrix.cpp.
Definition at line 28 of file matrix.cpp.
References size().
| num::Matrix::~Matrix | ( | ) |
Definition at line 35 of file matrix.cpp.
References num::cuda::free().
| num::Matrix::Matrix | ( | const Matrix & | o | ) |
Definition at line 40 of file matrix.cpp.
References size().
|
noexcept |
Definition at line 47 of file matrix.cpp.
|
inlineconstexprnoexcept |
Definition at line 25 of file matrix.hpp.
Referenced by num::cg(), num::backends::lapack::eig_sym(), num::backends::omp::eig_sym(), num::backends::seq::eig_sym(), num::gauss_seidel(), num::gmres(), num::inverse_iteration(), num::jacobi(), num::lu_solve(), num::backends::blas::matmul(), num::backends::gpu::matmul(), num::backends::omp::matmul(), num::backends::seq::matmul(), num::backends::seq::matmul_blocked(), num::backends::seq::matmul_register_blocked(), num::backends::blas::matvec(), num::backends::gpu::matvec(), num::backends::omp::matvec(), num::backends::seq::matvec(), num::kernel::subspace::mgs_orthogonalize(), num::power_iteration(), num::backends::lapack::qr(), num::backends::seq::qr(), num::qr_solve(), num::rayleigh_iteration(), num::backends::lapack::svd(), num::backends::seq::svd(), num::svd_truncated(), num::kernel::dense::trsv_lower(), and num::kernel::dense::trsv_upper().
|
inline |
Definition at line 28 of file matrix.hpp.
Referenced by num::backends::lapack::eig_sym(), num::kernel::dense::ger(), num::backends::lapack::lu(), num::backends::blas::matadd(), num::backends::omp::matadd(), num::backends::seq::matadd(), num::backends::blas::matmul(), num::backends::omp::matmul(), num::backends::seq::matmul_blocked(), num::backends::seq::matmul_register_blocked(), num::backends::blas::matvec(), num::kernel::subspace::mgs_orthogonalize(), num::backends::lapack::qr(), num::backends::lapack::svd(), num::kernel::dense::trsv_lower(), and num::kernel::dense::trsv_upper().
|
inline |
Definition at line 29 of file matrix.hpp.
|
inline |
Definition at line 35 of file matrix.hpp.
Referenced by num::backends::gpu::matmul(), and num::backends::gpu::matvec().
|
inline |
Definition at line 36 of file matrix.hpp.
|
inline |
Definition at line 37 of file matrix.hpp.
Definition at line 30 of file matrix.hpp.
Definition at line 31 of file matrix.hpp.
Definition at line 56 of file matrix.cpp.
References size().
Definition at line 66 of file matrix.cpp.
References num::cuda::free().
|
inlineconstexprnoexcept |
Definition at line 24 of file matrix.hpp.
Referenced by num::kernel::subspace::DenseOp::apply(), num::cg(), num::backends::lapack::eig_sym(), num::backends::omp::eig_sym(), num::backends::seq::eig_sym(), num::gauss_seidel(), num::gmres(), num::inverse_iteration(), num::jacobi(), num::backends::lapack::lu(), num::backends::seq::lu(), num::lu_det(), num::lu_inv(), num::lu_solve(), num::lu_solve(), num::backends::blas::matmul(), num::backends::gpu::matmul(), num::backends::omp::matmul(), num::backends::seq::matmul(), num::backends::seq::matmul_blocked(), num::backends::seq::matmul_register_blocked(), num::backends::blas::matvec(), num::backends::gpu::matvec(), num::backends::omp::matvec(), num::backends::seq::matvec(), num::kernel::subspace::mgs_orthogonalize(), num::power_iteration(), num::backends::lapack::qr(), num::backends::seq::qr(), num::qr_solve(), num::rayleigh_iteration(), num::backends::lapack::svd(), num::backends::seq::svd(), num::svd_truncated(), num::kernel::dense::trsv_lower(), and num::kernel::dense::trsv_upper().
|
inlineconstexprnoexcept |
Definition at line 26 of file matrix.hpp.
Referenced by num::backends::blas::matadd(), num::backends::omp::matadd(), num::backends::seq::matadd(), Matrix(), Matrix(), operator=(), to_cpu(), and to_gpu().
| void num::Matrix::to_cpu | ( | ) |
Definition at line 87 of file matrix.cpp.
References num::cuda::free(), size(), and num::cuda::to_host().
| void num::Matrix::to_gpu | ( | ) |
Definition at line 80 of file matrix.cpp.
References num::cuda::alloc(), size(), and num::cuda::to_device().