RSBMATRIX(3)

πŸŽ€ RsbMatrix< NT >(3) β€” librsb πŸŽ€

okay so bestie, welcome to the librsb cinematic universe πŸ’– we're in section 3, this is the C++ wrapper class, and she is long. like, we're doing this in four parts long. strap in πŸ¦‹


πŸ’– NAME πŸ’–

RsbMatrix β€” represent a sparse matrix in RSB format by means of librsb. πŸ’…


✨ SYNOPSIS ✨

#include <rsb.hpp>

🌈 Public Types 🌈

  • enum RsbSym β€” { IsGen = RSB_FLAG_NOFLAGS, IsHer = RSB_FLAG_HERMITIAN, IsSym = RSB_FLAG_SYMMETRIC, IsTri = RSB_FLAG_TRIANGULAR }
  • enum RsbOp β€” { Sum }

🫢 Public Member Functions 🫢

bestie. look at this list. LOOK at it. every single overload, untouched, iconic, here for you πŸ‘‡

RsbMatrix (rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, const RsbSym sym=IsGen)
RsbMatrix (rsb_coo_idx_t nrA, const rsb_coo_idx_t *RP, const
    rsb_coo_idx_t *JA, const NT *VA, const RsbSym sym=IsGen)
RsbMatrix (const rsb_coo_idx_t *IA, const rsb_coo_idx_t *JA, const NT
    *VA, rsb_nnz_idx_t nnzA, const rsb_flags_t flagsA=RSB_FLAG_NOFLAGS)
RsbMatrix (const rsb_char_t *filename, const RsbSym sym=IsGen)
RsbMatrix (const RsbMatrix &A_Rsb, bool do_trans=false, rsb_flags_t
    flagsA=RSB_FLAG_NOFLAGS)
RsbMatrix (RsbMatrix &&other)
~RsbMatrix (void)
RSBP_RVT RSBP_DEPRECATED Err_t _add (rsb_coo_idx_t i, rsb_coo_idx_t j,
    NT val)
RSBP_RVT Err_t close (void)
RSBP_RVT RSBP_DEPRECATED Err_t _close (void)
RSBP_RVT RSBP_DEPRECATED Err_t spmv (rsb_trans_t transA, const NT
    *alphap, const NT *Xp, rsb_coo_idx_t incX, const NT *betap, NT *Yp,
    rsb_coo_idx_t incY) const
RSBP_RVT Err_t spmv (rsb_trans_t transA, const NT alpha, const NT *Xp,
    rsb_coo_idx_t incX, const NT beta, NT *Yp, rsb_coo_idx_t incY) const
RSBP_RVT Err_t spmv (rsb_trans_t transA, const NT alpha, const NT *Xp,
    const NT beta, NT *Yp) const
RSBP_RVT Err_t spmv (NT *y, const NT *x, bool do_trans=false) const
RSBP_RVT RSBP_DEPRECATED Err_t spmm (rsb_trans_t transA, const NT
    *alphap, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *Bp,
    rsb_nnz_idx_t ldB, const NT *betap, NT *Cp, rsb_nnz_idx_t ldC) const
RSBP_RVT Err_t spmm (rsb_trans_t transA, const NT alpha, rsb_coo_idx_t
    nrhs, rsb_flags_t order, const NT *Bp, rsb_nnz_idx_t ldB, const NT
    beta, NT *Cp, rsb_nnz_idx_t ldC) const
RSBP_RVT Err_t spmm (rsb_trans_t transA, const NT alpha, rsb_coo_idx_t
    nrhs, rsb_flags_t order, const NT *Bp, const NT beta, NT *Cp) const
RSBP_RVT RSBP_DEPRECATED Err_t spsm (rsb_trans_t transT, const NT
    *alphap, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *betap,
    const NT *Bp, rsb_nnz_idx_t ldB, NT *Cp, rsb_nnz_idx_t ldC) const
RSBP_RVT Err_t spsm (rsb_trans_t transT, const NT alpha, rsb_coo_idx_t
    nrhs, rsb_flags_t order, const NT beta, const NT *Bp, rsb_nnz_idx_t
    ldB, NT *Cp, rsb_nnz_idx_t ldC) const
RSBP_RVT Err_t spsm (rsb_trans_t transT, const NT alpha, rsb_coo_idx_t
    nrhs, const NT *Bp, NT *Cp) const
RSBP_RVT Err_t spsm (NT *y, const NT *x, rsb_coo_idx_t nrhs, bool
    do_trans=false) const
RSBP_RVT Err_t spsm (NT *y, rsb_coo_idx_t nrhs, bool do_trans=false)
    const
RSBP_RVT RSBP_DEPRECATED Err_t spsv (rsb_trans_t transT, const NT
    *alphap, const NT *Xp, rsb_coo_idx_t incX, NT *Yp, rsb_coo_idx_t
    incY) const
RSBP_RVT Err_t spsv (rsb_trans_t transT, const NT alpha, const NT *Xp,
    NT *Yp) const
RSBP_RVT Err_t spsv (NT *y, const NT *x, bool do_trans=false) const
RSBP_RVT Err_t spsv (NT *y, bool do_trans=false) const
size_t get_info_size_t (enum rsb_mif_t mif) const
rsb_flags_t get_info_rsb_flags_t (enum rsb_mif_t mif) const
rsb_blk_idx_t get_info_blk_t (enum rsb_mif_t mif) const
rsb_nnz_idx_t get_info_nnz_t (enum rsb_mif_t mif) const
rsb_flags_t get_flags_t (enum rsb_mif_t mif) const
rsb_type_t get_type_t (enum rsb_mif_t mif) const
rsb_coo_idx_t get_info_coo_t (enum rsb_mif_t mif) const
size_t _get_index_storage_bytes (void) const
size_t _get_storage_bytes (void) const
rsb_nnz_idx_t nnz (void) const
rsb_blk_idx_t blocks (void) const
rsb_coo_idx_t rows (void) const
rsb_coo_idx_t cols (void) const
RSBP_RVT Err_t get_vals (NT *VA, const rsb_coo_idx_t *IA, const
    rsb_coo_idx_t *JA, rsb_nnz_idx_t nnz, rsb_flags_t flags) const
NT get_val (const rsb_coo_idx_t i, const rsb_coo_idx_t j, rsb_flags_t
    flags=RSB_FLAG_NOFLAGS) const
RSBP_RVT Err_t set_val (const NT val, const rsb_coo_idx_t i, const
    rsb_coo_idx_t j, rsb_flags_t flags=RSB_FLAG_NOFLAGS)
RSBP_RVT Err_t set_vals (const NT *VA, const rsb_coo_idx_t *IA, const
    rsb_coo_idx_t *JA, rsb_nnz_idx_t nnz, rsb_flags_t flags)
RSBP_RVT Err_t get_vec (NT *Dp, enum rsb_extff_t flags) const
RSBP_RVT RSBP_DEPRECATED Err_t get_coo (rsb_trans_t transA, NT *VA,
    rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_flags_t flags) const
RSBP_RVT RSBP_DEPRECATED Err_t get_csr (rsb_trans_t transA, NT *VA,
    rsb_coo_idx_t *RP, rsb_coo_idx_t *JA, rsb_flags_t flags) const
RSBP_RVT RSBP_DEPRECATED Err_t get_rows_sparse (rsb_trans_t transA,
    const NT *alphap, NT *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA,
    rsb_coo_idx_t frA, rsb_coo_idx_t lrA, rsb_nnz_idx_t *rnzp,
    rsb_flags_t flags) const
RSBP_RVT Err_t upd_vals (enum rsb_elopf_t elop_flags, const NT &omega)
RSBP_RVT Err_t upd_vals (enum rsb_elopf_t elop_flags, const NT *omegap)
RSBP_RVT Err_t get_nrm (NT *Np, enum rsb_extff_t flags) const
rsb_type_t rsbtype (void) const
rsb_flags_t rsbflags (void) const
rsb_string_t get_info_str (const char *key) const
RSBP_RVT Err_t get_info (enum rsb_mif_t miflags, void *minfop) const
rsb_string_t _info (void) const
RSBP_RVT RSBP_DEPRECATED Err_t tune_spsm_threads (rsb_real_t
    *sfp=RSBP_NULL, rsb_int_t *tnp=RSBP_NULL, rsb_int_t maxr=0,
    rsb_time_t maxt=0, rsb_trans_t transA=RSB_TRANSPOSITION_N, const NT
    *alphap=RSBP_NULL, rsb_coo_idx_t nrhs=1, rsb_flags_t
    order=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT *Bp=RSBP_NULL,
    rsb_nnz_idx_t ldB=0, const NT *betap=RSBP_NULL, NT *Cp=RSBP_NULL,
    rsb_nnz_idx_t ldC=0) const
RSBP_RVT RSBP_DEPRECATED Err_t tune_spmm_threads (rsb_real_t
    *sfp=RSBP_NULL, rsb_int_t *tnp=RSBP_NULL, rsb_int_t maxr=0,
    rsb_time_t maxt=0, rsb_trans_t transA=RSB_TRANSPOSITION_N, const NT
    *alphap=RSBP_NULL, rsb_coo_idx_t nrhs=1, rsb_flags_t
    order=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT *Bp=RSBP_NULL,
    rsb_nnz_idx_t ldB=0, const NT *betap=RSBP_NULL, NT *Cp=RSBP_NULL,
    rsb_nnz_idx_t ldC=0) const
RSBP_RVT RSBP_DEPRECATED Err_t tune_spmm (rsb_real_t *sfp, rsb_int_t
    *tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const NT
    *alphap, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *Bp,
    rsb_nnz_idx_t ldB, const NT *betap, NT *Cp, rsb_nnz_idx_t ldC)
RSBP_RVT RSBP_DEPRECATED Err_t tune_spmm (rsb_real_t *sfp, rsb_int_t
    *tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const NT
    alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *Bp,
    rsb_nnz_idx_t ldB, const NT beta, NT *Cp, rsb_nnz_idx_t ldC)
RSBP_RVT Err_t tune_spmm (rsb_real_t &sf, rsb_trans_t transA, const NT
    alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *Bp, const NT
    beta, NT *Cp)
RSBP_RVT RSBP_DEPRECATED Err_t tune_spsm (rsb_real_t *sfp, rsb_int_t
    *tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const NT
    *alphap, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT *Bp,
    rsb_nnz_idx_t ldB, const NT *betap, NT *Cp, rsb_nnz_idx_t ldC)
RSBP_RVT Err_t file_save (const rsb_char_t *filename=RSBP_NULL) const
RsbMatrix & operator= (const RsbMatrix &A_Rsb)
bool _is_complex (void) const
bool operator== (const RsbMatrix &B_Rsb) const
bool operator!= (const RsbMatrix &B_Rsb) const
NT normOne (void) const
NT normInf (void) const
RSBP_RVT Err_t rndr (const rsb_char_t *filename=RSBP_NULL, rsb_coo_idx_t
    pmWidth=512, rsb_coo_idx_t pmHeight=512, rsb_marf_t
    rflags=RSB_MARF_EPS) const
RsbMatrix (rsb_trans_t transA, NT alpha, const RsbMatrix &mtxA,
    rsb_trans_t transB, NT beta, const RsbMatrix &mtxB, RsbOp op)
RsbMatrix (const RsbMatrix &mtxA, const RsbMatrix &mtxB, RsbOp op)

πŸ’« Detailed Description πŸ’«

template<RSBP_Scalar_t NT> class RsbMatrix< NT > β€” "Represent a sparse matrix in RSB format by means of librsb."

Manage construction, destruction, and std::move of numerical matrices. Most of the member functions here translate directly to a single function call to librsb (rsb.h), and pass the parameters as they are, so the error checking is done by librsb.

While most of librsb C functions use void* pointers instead of numerical data, RsbMatrix is templated by a type parameter. This introduces type safety at compile time. ✨

Users of member functions can choose among several overloads. So in additional to the more direct overloads passing e.g. $ alpha $ and $ beta $ by reference, here a user can pass them by value. 🫢

πŸ“ Parameters πŸ“

  • NT β€” the numerical type, at least for the four canonical ones (float, double, std::complex<float>, std::complex<double>); see matrix_supported_numerical_types_section and rsb_type_t for more.

πŸŽ€ Note πŸŽ€

Default error propagation is by exception throw for all constructors and most member functions.

Functions declared to return Err_t can be specialized in rsb_err_t so not to throw exceptions, but to return an error code instead.

Exceptions thrown by member functions (not constructors) can be deactivated at build time by defining RSBP_NOTHROW before including <rsb.hpp>. 😭

One may turn on return error value as default at build time by defining RSBP_WANT_REV=1 .

πŸ‘‘ Warning πŸ‘‘

The error model is work in progress and subject to change. πŸ’€

🧚 Todo 🧚

While the rsb.h interface is stable, the rsb.hpp interface is neither stable, nor complete: early users' feedback is very welcome. 🌈

Shall all $ alpha $ and $ beta $ be passed by values only? This is natural and fits C++. But rsb_tune_spmm() / rsb_tune_spsm() have more parameters with a nullptr-like default value: how to deal with them in RsbMatrix::tune_spmm() / RsbMatrix::tune_spsm() without introducing too many special cases ?

Similarly for the consistency of RsbMatrix::get_flags_t(), RsbMatrix::get_type_t(), RsbMatrix::get_info_coo_t(), and similar: shall they throw an exception if given a flag not matching the return type ?

Or maybe keeping only RsbMatrix::get_info(), with per-type reference overloads ?

Furthermore: if working under C++20, shall RsbLib avoid pointer-based interfaces completely (using std::span only)?


πŸ”₯ Member Enumeration Documentation πŸ”₯

⭐ template<RSBP_Scalar_t NT> enum RsbMatrix::RsbOp

Enumerator

  • Sum

πŸ¦‹ template<RSBP_Scalar_t NT> enum RsbMatrix::RsbSym

Matrix structure: either general, symmetric, hermitian, or triangular (also see rsb_flags_t). πŸ’…

Enumerator

  • IsGen β€” general matrix, no triangle structure or symmetry assumed.
  • IsHer β€” hermitian ($ A == A^H $). Please pass only lower/upper triangle. πŸ™ˆ
  • IsSym β€” symmetric ($ A == A^T $). Please pass only lower/upper triangle. πŸ™ˆ
  • IsTri β€” triangular (required for spsv/ spsm). πŸ”₯

and bestie, that's only part 1 of 4 β€” there is so much more coming, do not go anywhere πŸ’–πŸ¦‹βœ¨

πŸ‘‘ Constructor & Destructor Documentation πŸ‘‘

okay so bestie, welcome to the ✨birthing suite✨ of RsbMatrix β€” every single way to summon one into existence, plus the one way to send it back to the void. All of these are [inline], every one of them is a template<RSBP_Scalar_t NT>, and yes we are going through literally all of them. no skips. πŸ’…


template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, const RsbSym sym = IsGen) [inline]

🌸 Bestie this one begins assembling a sparse matrix of the dimensions and type you hand it. Think of it as opening the assembly line β€” the matrix is raw right now, she's got nothing in her yet.

Then you just keep calling set_val() or set_vals() over and over to actually put stuff in. Feed her. πŸ“

Once you've populated her, call close() to terminate the assembly. Don't forget. If you forget, she's just gonna sit there half-built and sad. 😭

Example snip from examples/assemble.cpp:

const rsb_coo_idx_t nrA { 4 }, ncA { 4 };
RsbMatrix<double> mtx(nrA,ncA); // begin matrix assembly

// insert elements of a tridiagonal matrix, one by one
for (auto i = 0; i < nrA; ++i )
  for (auto j = i-1; j <= i+1; ++j )
    if ( i >= 0 && i < nrA )
      if ( j >= 0 && j < ncA )
        mtx.set_val((i+1)*100+(j+1),i,j); // add entry

mtx.close(); // finish matrix assembly
assert(mtx.nnz() == 3 * nrA - 2);
Note β€” Directly based on the C function rsb_mtx_alloc_from_coo_begin() from <rsb.h>. ✨

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (rsb_coo_idx_t nrA, const rsb_coo_idx_t * RP, const rsb_coo_idx_t * JA, const NT * VA, const RsbSym sym = IsGen) [inline]

🧚 Assemble a sparse matrix straight from CSR input. Hand her the row pointers, the column indices, the values, and she comes out the other side fully formed. Iconic, effortless, no assembly loop needed. πŸ’…

Note β€” Directly based on the C function rsb_mtx_alloc_from_csr_const() from <rsb.h>.

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (const rsb_coo_idx_t * IA, const rsb_coo_idx_t * JA, const NT * VA, rsb_nnz_idx_t nnzA, const rsb_flags_t flagsA = RSB_FLAG_NOFLAGS) [inline]

πŸ¦‹ And now the COO input glow-up. Coordinates in, matrix out. This is the one where you give her three parallel arrays and a count and she says "say less."

Example snip from examples/misc.cpp:

const rsb_nnz_idx_t nnzA { 7 };
const rsb_coo_idx_t nrA { 6 }, ncA { 6 }, nrhs { 1 };
const std::vector<rsb_coo_idx_t> IA {0,1,2,3,4,5,1}, JA {0,1,2,3,4,5,0};
const std::vector<double> VA {1,1,1,1,1,1,2}, X(ncA,1);
RsbMatrix<double> mtx(IA.data(),JA.data(),VA.data(),nnzA);
Note β€” Directly based on the C function rsb_mtx_alloc_from_coo_const() from <rsb.h>. 🫢

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (const rsb_char_t * filename, const RsbSym sym = IsGen) [inline]

πŸ“ Assemble a sparse matrix from filename input. She reads the file, she builds the matrix, she doesn't complain. Main character energy fr fr.

Note β€” Directly based on the C function rsb_file_mtx_load() from <rsb.h>.

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (const RsbMatrix< NT > & A_Rsb, bool do_trans = false, rsb_flags_t flagsA = RSB_FLAG_NOFLAGS) [inline]

πŸŽ€ Copy a sparse matrix from an example input β€” aaaaand she's flexible about it, bestie. You can:

  • just clone her as-is, or
  • transpose her, or
  • change the flags (that means the structure) while she's being copied.

All in one constructor. She said multitasking is a love language. πŸ’œ


template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (RsbMatrix< NT > && other) [inline]

✨ The move constructor. She takes everything from other and runs with it.

⚠️ Heads up: after the move, the moved-from matrix object will be invalid. Like, do not touch her. She gave everything away. It's giving "emptied out and moving on." πŸ’€

Example snip from examples/misc.cpp:

assert( mtx1.nnz() == nnzA );
RsbMatrix<double> mtx3 { std::move(mtx1) };
assert( mtx3.nnz() == nnzA );

template<RSBP_Scalar_t NT> RsbMatrix< NT >::~RsbMatrix (void) [inline]

πŸͺ¦ The destructor. This is the goodbye. She frees the matrix object memory β€” every byte she was holding onto, released. Rest in peace queen, you served. 🌈

Note β€” Directly based on the C function rsb_mtx_free() from <rsb.h>.

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (rsb_trans_t transA, NT alpha, const RsbMatrix< NT > & mtxA, rsb_trans_t transB, NT beta, const RsbMatrix< NT > & mtxB, RsbOp op) [inline]

Note β€” Directly based on the C function rsb_sppsp() from <rsb.h>. That's literally all the manual says here, bestie. No hype paragraph, no example. She's mysterious. πŸ™ˆ

template<RSBP_Scalar_t NT> RsbMatrix< NT >::RsbMatrix (const RsbMatrix< NT > & mtxA, const RsbMatrix< NT > & mtxB, RsbOp op) [inline]

πŸ«₯ And this one? No note, no warning, no example, no nothing. The documentation just... politely lists her and moves on. She's the quiet one at the function party. πŸ’…


πŸ“– Member Function Documentation πŸ“–

okay so now we get to the actual methods, and bestie there are SO many. Strap in. We're going in original order, no reordering, no skipping. πŸ‘‘


template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::_add (rsb_coo_idx_t i, rsb_coo_idx_t j, NT val) [inline]

😭 Deprecated. Use set_val() and set_vals() instead, okay? She's retired. Let her rest.


template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::_close (void) [inline]

😭 Deprecated. Use close() instead. Same energy, new name. Upgrade bestie.


template<RSBP_Scalar_t NT> size_t RsbMatrix< NT >::_get_index_storage_bytes (void) const [inline]

Warning β€” The name of this member function is expected to change. So like, don't get too attached to it. πŸ™ˆ

template<RSBP_Scalar_t NT> size_t RsbMatrix< NT >::_get_storage_bytes (void) const [inline]

Warning β€” The name of this member function is expected to change. Yes, again. Same warning, different method. πŸ’€

template<RSBP_Scalar_t NT> rsb_string_t RsbMatrix< NT >::_info (void) const [inline]

Warning β€” The name of this member function is expected to change. πŸ“

template<RSBP_Scalar_t NT> bool RsbMatrix< NT >::_is_complex (void) const [inline]

Warning β€” The name of this member function is expected to change. Keep up, bestie. πŸ’…

template<RSBP_Scalar_t NT> rsb_blk_idx_t RsbMatrix< NT >::blocks (void) const [inline]

No description, no note, no warning. She's just here. Present. Existing. ✨


template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::close (void) [inline]

πŸŽ€ Okay THIS one matters. She terminates the assembly of a matrix you previously started and populated. Like, the official "we're done here" button.

⚠️ She shall be called once. Once. Not twice. Not zero times. Once. I'm serious. πŸ™

Example snip from examples/assemble.cpp:

const rsb_coo_idx_t nrA { 4 }, ncA { 4 };
RsbMatrix<double> mtx(nrA,ncA); // begin matrix assembly

// insert elements of a tridiagonal matrix, one by one
for (auto i = 0; i < nrA; ++i )
  for (auto j = i-1; j <= i+1; ++j )
    if ( i >= 0 && i < nrA )
      if ( j >= 0 && j < ncA )
        mtx.set_val((i+1)*100+(j+1),i,j); // add entry

mtx.close(); // finish matrix assembly
assert(mtx.nnz() == 3 * nrA - 2);

See also β€” RsbMatrix::RsbMatrix(rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, const RsbSym sym = IsGen );

Note β€” Directly based on the C function rsb_mtx_alloc_from_coo_end() from <rsb.h>. πŸ”₯

template<RSBP_Scalar_t NT> rsb_coo_idx_t RsbMatrix< NT >::cols (void) const [inline]

Example snip from examples/twonnz.cpp:

std::cout << "# Matrix sized " << mtx.rows() << "x" << mtx.cols() << ", " << nnzA << " nnz  built in " << dt << " s and occupies " << mtxocc << " bytes " << std::endl;

Look at her showing off her dimensions in a std::cout. We love a confident queen. πŸ’…


template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::file_save (const rsb_char_t * filename = RSBP_NULL) const [inline]

Note β€” Directly based on the C function rsb_file_mtx_save() from <rsb.h>.

Example snip from examples/misc.cpp:

mtx.file_save(); // print to stdout

πŸ‘€ If you don't give her a filename, she just prints right to stdout. Casual. Obsessed.


template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::get_coo (rsb_trans_t transA, NT * VA, rsb_coo_idx_t * IA, rsb_coo_idx_t * JA, rsb_flags_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_coo() from <rsb.h>.
⚠️ Warning β€” Only transA=RSB_TRANSPOSITION_N is currently supported.

😭 Deprecated β€” This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. So like, go ask for the nicer version. She'll hook you up. 🫢


template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::get_csr (rsb_trans_t transA, NT * VA, rsb_coo_idx_t * RP, rsb_coo_idx_t * JA, rsb_flags_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_csr() from <rsb.h>.
⚠️ Warning β€” Only transA=RSB_TRANSPOSITION_N is currently supported.

😭 Deprecated β€” This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. Yeah, same situation as get_coo. Twins. πŸ’€


template<RSBP_Scalar_t NT> rsb_flags_t RsbMatrix< NT >::get_flags_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>.

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::get_info (enum rsb_mif_t miflags, void * minfop) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. ✨

template<RSBP_Scalar_t NT> rsb_blk_idx_t RsbMatrix< NT >::get_info_blk_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. (Yes, the whole get_info_* family is the same C function. They're a little squad. πŸ‘‘)

template<RSBP_Scalar_t NT> rsb_coo_idx_t RsbMatrix< NT >::get_info_coo_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. πŸ¦‹

template<RSBP_Scalar_t NT> rsb_nnz_idx_t RsbMatrix< NT >::get_info_nnz_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. πŸ“

template<RSBP_Scalar_t NT> rsb_flags_t RsbMatrix< NT >::get_info_rsb_flags_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. πŸ’œ

template<RSBP_Scalar_t NT> size_t RsbMatrix< NT >::get_info_size_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. 🌸

template<RSBP_Scalar_t NT> rsb_string_t RsbMatrix< NT >::get_info_str (const char * key) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info_str() from <rsb.h>. Note that this one is a different C function than the rest of the family β€” she's the string one. Slay. ✨

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::get_nrm (NT * Np, enum rsb_extff_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_nrm() from <rsb.h>.

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::get_rows_sparse (rsb_trans_t transA, const NT * alphap, NT * VA, rsb_coo_idx_t * IA, rsb_coo_idx_t * JA, rsb_coo_idx_t frA, rsb_coo_idx_t lrA, rsb_nnz_idx_t * rnzp, rsb_flags_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_rows_sparse() from <rsb.h>.

😭 Deprecated β€” This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. Third member of the deprecated trio. They're bonding. πŸ™ˆ


template<RSBP_Scalar_t NT> rsb_type_t RsbMatrix< NT >::get_type_t (enum rsb_mif_t mif) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_info() from <rsb.h>. Yes her too. πŸ’…

template<RSBP_Scalar_t NT> NT RsbMatrix< NT >::get_val (const rsb_coo_idx_t i, const rsb_coo_idx_t j, rsb_flags_t flags = RSB_FLAG_NOFLAGS) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_vals() from <rsb.h>. Give her a position (i, j), get a value back. Simple as. 🫢

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::get_vals (NT * VA, const rsb_coo_idx_t * IA, const rsb_coo_idx_t * JA, rsb_nnz_idx_t nnz, rsb_flags_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_vals() from <rsb.h>. The plural version of the one above. Same C function, more val. ✨

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::get_vec (NT * Dp, enum rsb_extff_t flags) const [inline]

Note β€” Directly based on the C function rsb_mtx_get_vec() from <rsb.h>.

template<RSBP_Scalar_t NT> rsb_nnz_idx_t RsbMatrix< NT >::nnz (void) const [inline]

No notes. No warnings. No examples. Just vibes and a count. πŸ¦‹


template<RSBP_Scalar_t NT> NT RsbMatrix< NT >::normInf (void) const [inline]

Silent. Mysterious. Does her thing. πŸ’œ


template<RSBP_Scalar_t NT> NT RsbMatrix< NT >::normOne (void) const [inline]

Also silent. Her and normInf are a duo with no PR team. πŸŽ€


template<RSBP_Scalar_t NT> bool RsbMatrix< NT >::operator!= (const RsbMatrix< NT > & B_Rsb) const [inline]

Example snip from examples/misc.cpp:

assert(   mtx1 == mtx2  );
assert( !(mtx1 != mtx2) );

See her being the literal negation of ==? Mathematical poetry. 😌

See also β€” RsbMatrix::operator==(const RsbMatrix & B_Rsb) const;


template<RSBP_Scalar_t NT> RsbMatrix & RsbMatrix< NT >::operator= (const RsbMatrix< NT > & A_Rsb) [inline]

A copy constructor, basically. Will clone the input matrix contents. So when you assign, you're getting a full-on duplicate, not a little reference handshake. Copy her whole personality. πŸ’…


✨ and there's still more where that came from, bestie β€” the tour is NOT over. πŸ‘‘

operator== β€” the deep compare πŸ’–

template<RSBP_Scalar_t NT> bool RsbMatrix< NT >::operator== (const
    RsbMatrix< NT > & B_Rsb) const [inline]

okay so this one is the deep comparison ✨ β€” it checks whether the two matrices have the same dimensions, the same nonzeroes count, the same nonzeroes pattern and the same value. It's meant for very sporadic use, bestie. And ngl it's inefficient: it can involve matrices copying 😭 so do not put this in your hot loop, periodt.

Example snip from examples/misc.cpp:

         assert(   mtx1 == mtx2  );
         assert( !(mtx1 != mtx2) );

rndr β€” make it a little picture πŸŽ€

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::rndr (const
    rsb_char_t * filename = RSBP_NULL, rsb_coo_idx_t pmWidth = 512,
    rsb_coo_idx_t pmHeight = 512, rsb_marf_t rflags = RSB_MARF_EPS) const
    [inline]
Note πŸ’… Directly based on C function rsb_mtx_rndr() from <rsb.h>.

Example snip from examples/render.cpp:

            mtx.rndr(psfilename.c_str());

rows β€” how many rows, bestie 🌸

template<RSBP_Scalar_t NT> rsb_coo_idx_t RsbMatrix< NT >::rows (void) const
    [inline]

Example snip from examples/twonnz.cpp:

         std::cout << "# Matrix sized " << mtx.rows() << "x" << mtx.cols() << ", " << nnzA << " nnz  built in " << dt << " s and occupies " << mtxocc << " bytes " << std::endl;

rsbflags β€” the flags reveal πŸ¦‹

template<RSBP_Scalar_t NT> rsb_flags_t RsbMatrix< NT >::rsbflags (void)
    const [inline]

rsbtype β€” what type are we even 🧚

template<RSBP_Scalar_t NT> rsb_type_t RsbMatrix< NT >::rsbtype (void) const
    [inline]

Example snip from examples/twonnz.cpp:

                std::cout << "# type=" << mtx.rsbtype() << " nt=1," << rnt << " n=" << n << " nrhs=" << nrhs << " order=" << oc << " alpha=" << alpha << " beta=" << beta << " dt=" << dta[0] << ".." << dta[1] << " spmm-scalability=" << dta[0]/dta[1] << " nnz/s=" << nnzA/dta[0] << ".." << nnzA/dta[1] << " flops=" << flops_c/dta[0] << ".." << flops_c/dta[1] << " occ.=" << opocc << " " << std::endl;

set_val β€” one entry at a time πŸ’œ

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::set_val (const NT
    val, const rsb_coo_idx_t i, const rsb_coo_idx_t j, rsb_flags_t flags =
    RSB_FLAG_NOFLAGS) [inline]
Note πŸ’… Directly based on C function rsb_mtx_set_vals() from <rsb.h>.

Example snip from examples/assemble.cpp:

  const rsb_coo_idx_t nrA { 4 }, ncA { 4 };
  RsbMatrix<double> mtx(nrA,ncA); // begin matrix assembly

  // insert elements of a tridiagonal matrix, one by one
  for (auto i = 0; i < nrA; ++i )
    for (auto j = i-1; j <= i+1; ++j )
      if ( i >= 0 && i < nrA )
        if ( j >= 0 && j < ncA )
          mtx.set_val((i+1)*100+(j+1),i,j); // add entry

  mtx.close(); // finish matrix assembly
  assert(mtx.nnz() == 3 * nrA - 2);

See also 🌈 set_vals().


set_vals β€” the plural version, iconique ✨

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::set_vals (const
    NT * VA, const rsb_coo_idx_t * IA, const rsb_coo_idx_t * JA,
    rsb_nnz_idx_t nnz, rsb_flags_t flags) [inline]

So this one adds a single entry during the assembly of a matrix created empty. And you use close() to terminate matrix assembly β€” do not forget, bestie, that's the vibe check πŸ”₯.

Example snip from examples/assemble.cpp:

  const rsb_coo_idx_t nrA { 4 }, ncA { 4 };
  RsbMatrix<double> mtx(nrA,ncA); // begin matrix assembly

  // insert elements of a tridiagonal matrix, one by one
  for (auto i = 0; i < nrA; ++i )
    for (auto j = i-1; j <= i+1; ++j )
      if ( i >= 0 && i < nrA )
        if ( j >= 0 && j < ncA )
          mtx.set_val((i+1)*100+(j+1),i,j); // add entry

  mtx.close(); // finish matrix assembly
  assert(mtx.nnz() == 3 * nrA - 2);
Note πŸ’… Directly based on C function rsb_mtx_set_vals() from <rsb.h>.

spmm (the deprecated pointer-to-scalar one) πŸ’€

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT
    >::spmm (rsb_trans_t transA, const NT * alphap, rsb_coo_idx_t nrhs,
    rsb_flags_t order, const NT * Bp, rsb_nnz_idx_t ldB, const NT * betap,
    NT * Cp, rsb_nnz_idx_t ldC) const [inline]
Note πŸ’… Directly based on C function rsb_spmm() from <rsb.h>.
Deprecated 😭 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet.

spmm β€” no pointers version 🫢

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spmm (rsb_trans_t
    transA, const NT alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT
    * Bp, const NT beta, NT * Cp) const [inline]
Note πŸ’… Indirectly based on C function rsb_spmm() from <rsb.h>.

spmm β€” the full leaderboard one πŸ‘‘

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spmm (rsb_trans_t
    transA, const NT alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT
    * Bp, rsb_nnz_idx_t ldB, const NT beta, NT * Cp, rsb_nnz_idx_t ldC)
    const [inline]

Example snip from examples/bench.cpp:

                          mtx.spmm(transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC);
Note πŸ’… Indirectly based on C function rsb_spmm() from <rsb.h>.

spmv β€” transpose flag energy 🌈

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spmv (NT * y,
    const NT * x, bool do_trans = false) const [inline]
Note πŸ’… Indirectly based on C function rsb_spmv() from <rsb.h>.

Example snip from examples/span.cpp:

  mtx.tune_spmm(nullptr,&tn,0,0.0,RSB_TRANSPOSITION_N,alpha,nrhs,RSB_FLAG_WANT_COLUMN_MAJOR_ORDER,X,ncA,beta,Y,nrA);
  mtx.spmv(RSB_TRANSPOSITION_N, alpha, X, beta, Y);

spmv (deprecated, pointers everywhere) πŸ’€

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT
    >::spmv (rsb_trans_t transA, const NT * alphap, const NT * Xp,
    rsb_coo_idx_t incX, const NT * betap, NT * Yp, rsb_coo_idx_t incY) const
    [inline]
Note πŸ’… Directly based on C function rsb_spmv() from <rsb.h>.
Deprecated 😭 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet.

spmv β€” the clean one πŸŽ€

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spmv (rsb_trans_t
    transA, const NT alpha, const NT * Xp, const NT beta, NT * Yp) const
    [inline]
Note πŸ’… Indirectly based on C function rsb_spmv() from <rsb.h>.

Example snip from examples/span.cpp:

  mtx.tune_spmm(nullptr,&tn,0,0.0,RSB_TRANSPOSITION_N,alpha,nrhs,RSB_FLAG_WANT_COLUMN_MAJOR_ORDER,X,ncA,beta,Y,nrA);
  mtx.spmv(RSB_TRANSPOSITION_N, alpha, X, beta, Y);

spmv β€” with increments, spicy 🌢️

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spmv (rsb_trans_t
    transA, const NT alpha, const NT * Xp, rsb_coo_idx_t incX, const NT
    beta, NT * Yp, rsb_coo_idx_t incY) const [inline]
Note πŸ’… Indirectly based on C function rsb_spmv() from <rsb.h>.

Example snip from examples/span.cpp:

  mtx.tune_spmm(nullptr,&tn,0,0.0,RSB_TRANSPOSITION_N,alpha,nrhs,RSB_FLAG_WANT_COLUMN_MAJOR_ORDER,X,ncA,beta,Y,nrA);
  mtx.spmv(RSB_TRANSPOSITION_N, alpha, X, beta, Y);

spsm β€” the y and x one πŸ“

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsm (NT * y,
    const NT * x, rsb_coo_idx_t nrhs, bool do_trans = false) const [inline]
Note πŸ’… Indirectly based on C function rsb_spsm() from <rsb.h>.

spsm β€” just y and nrhs 🧚

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsm (NT * y,
    rsb_coo_idx_t nrhs, bool do_trans = false) const [inline]
Note πŸ’… Indirectly based on C function rsb_spsm() from <rsb.h>.

spsm (deprecated, pointer-pilled) πŸ’€

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT
    >::spsm (rsb_trans_t transT, const NT * alphap, rsb_coo_idx_t nrhs,
    rsb_flags_t order, const NT * betap, const NT * Bp, rsb_nnz_idx_t ldB,
    NT * Cp, rsb_nnz_idx_t ldC) const [inline]
Note πŸ’… Directly based on C function rsb_spsm() from <rsb.h>.
Deprecated 😭 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet.

spsm β€” four args, minimal, clean ✨

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsm (rsb_trans_t
    transT, const NT alpha, rsb_coo_idx_t nrhs, const NT * Bp, NT * Cp)
    const [inline]
Note πŸ’… Indirectly based on C function rsb_spsm() from <rsb.h>.

spsm β€” full args, main character πŸ’…

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsm (rsb_trans_t
    transT, const NT alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT
    beta, const NT * Bp, rsb_nnz_idx_t ldB, NT * Cp, rsb_nnz_idx_t ldC)
    const [inline]
Note πŸ’… Indirectly based on C function rsb_spsm() from <rsb.h>.

spsv β€” y only, no thoughts πŸ¦‹

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsv (NT * y,
    bool do_trans = false) const [inline]
Note πŸ’… Indirectly based on C function rsb_spsv() from <rsb.h>.

spsv β€” y and x 🌸

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsv (NT * y,
    const NT * x, bool do_trans = false) const [inline]
Note πŸ’… Indirectly based on C function rsb_spsv() from <rsb.h>.

spsv (deprecated, the pointer era) πŸ’€

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT
    >::spsv (rsb_trans_t transT, const NT * alphap, const NT * Xp,
    rsb_coo_idx_t incX, NT * Yp, rsb_coo_idx_t incY) const [inline]
Note πŸ’… Directly based on C function rsb_spsv() from <rsb.h>.
Deprecated 😭 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet.

spsv β€” alpha and vibes πŸŽ€

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::spsv (rsb_trans_t
    transT, const NT alpha, const NT * Xp, NT * Yp) const [inline]
Note πŸ’… Indirectly based on C function rsb_spsv() from <rsb.h>.

tune_spmm β€” the glow-up machine βœ¨πŸ‘‘

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::tune_spmm
    (rsb_real_t & sf, rsb_trans_t transA, const NT alpha, rsb_coo_idx_t
    nrhs, rsb_flags_t order, const NT * Bp, const NT beta, NT * Cp) [inline]
Note πŸ’… Indirectly based on C function rsb_tune_spmm() from <rsb.h>.

Example snip from examples/autotune.cpp:

                 tt = -rsb_time();
                        mtx.tune_spmm(&sf,&tn,maxr,tmax,transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC);
                        tt += rsb_time();

                        auto nnsmA {mtx.blocks()};
                        std::cout << "Tuning took " << tt << " s ( " << tt / dt << " ops ) and changed " << nsmA << " to " << nnsmA << " blocks" << std::endl;

                        mtx.spmm(transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC); // caches warmup

tune_spmm (deprecated, all the pointers) πŸ’€

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT
    >::tune_spmm (rsb_real_t * sfp, rsb_int_t * tnp, rsb_int_t maxr,
    rsb_time_t maxt, rsb_trans_t transA, const NT * alphap, rsb_coo_idx_t
    nrhs, rsb_flags_t order, const NT * Bp, rsb_nnz_idx_t ldB, const NT *
    betap, NT * Cp, rsb_nnz_idx_t ldC) [inline]
Note πŸ’… Directly based on C function rsb_tune_spmm() from <rsb.h>.

Example snip from examples/autotune.cpp:

                 tt = -rsb_time();
                        mtx.tune_spmm(&sf,&tn,maxr,tmax,transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC);
                        tt += rsb_time();

                        auto nnsmA {mtx.blocks()};
                        std::cout << "Tuning took " << tt << " s ( " << tt / dt << " ops ) and changed " << nsmA << " to " << nnsmA << " blocks" << std::endl;

                        mtx.spmm(transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC); // caches warmup
Deprecated 😭 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet.

okay continuing straight into the rest of the member functions, bestie, no stopping now ✨

tune_spmm πŸ’…

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::tune_spmm (rsb_real_t * sfp, rsb_int_t * tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const NT alpha, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT * Bp, rsb_nnz_idx_t ldB, const NT beta, NT * Cp, rsb_nnz_idx_t ldC) [inline]

Note: it's indirectly based on the C function rsb_tune_spmm() from <rsb.h> β€” so like, it's giving that C energy but through the fancy C++ portal πŸŒ€

Example snip from examples/autotune.cpp:

tt = -rsb_time();
mtx.tune_spmm(&sf,&tn,maxr,tmax,transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC);
tt += rsb_time();

auto nnsmA {mtx.blocks()};
std::cout << "Tuning took " << tt << " s ( " << tt / dt << " ops ) and changed " << nsmA << " to " << nnsmA << " blocks" << std::endl;

mtx.spmm(transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC); // caches warmup

(the nsmA vs nnsmA situation in that std::cout is literally canon, don't @ me, I'm not touching it πŸ’€)

tune_spmm_threads 🧡

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::tune_spmm_threads (rsb_real_t * sfp = RSBP_NULL, rsb_int_t * tnp = RSBP_NULL, rsb_int_t maxr = 0, rsb_time_t maxt = 0, rsb_trans_t transA = RSB_TRANSPOSITION_N, const NT * alphap = RSBP_NULL, rsb_coo_idx_t nrhs = 1, rsb_flags_t order = RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT * Bp = RSBP_NULL, rsb_nnz_idx_t ldB = 0, const NT * betap = RSBP_NULL, NT * Cp = RSBP_NULL, rsb_nnz_idx_t ldC = 0) const [inline]

Note: this one is directly based on the C function rsb_tune_spmm() from <rsb.h>. Same bloodline, different vibes ✨

Example snip from examples/autotune.cpp:

tt = -rsb_time();
mtx.tune_spmm(&sf,&tn,maxr,tmax,transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC);
tt += rsb_time();

auto nnsmA {mtx.blocks()};
std::cout << "Tuning took " << tt << " s ( " << tt / dt << " ops ) and changed " << nsmA << " to " << nnsmA << " blocks" << std::endl;

mtx.spmm(transA,&alpha,nrhs,order,B.data(),ldB,&beta,C.data(),ldC); // caches warmup
Deprecated 🚨 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. Translation: put the pointer-era stuff down, bestie, it's giving 2011 😭

tune_spsm 🌸

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::tune_spsm (rsb_real_t * sfp, rsb_int_t * tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const NT * alphap, rsb_coo_idx_t nrhs, rsb_flags_t order, const NT * Bp, rsb_nnz_idx_t ldB, const NT * betap, NT * Cp, rsb_nnz_idx_t ldC) [inline]

Note: directly based on the C function rsb_tune_spsm() from <rsb.h>.

Deprecated 🚨 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. It's the same story as above, no cap πŸ™ˆ

tune_spsm_threads πŸ¦‹

template<RSBP_Scalar_t NT> RSBP_RVT RSBP_DEPRECATED Err_t RsbMatrix< NT >::tune_spsm_threads (rsb_real_t * sfp = RSBP_NULL, rsb_int_t * tnp = RSBP_NULL, rsb_int_t maxr = 0, rsb_time_t maxt = 0, rsb_trans_t transA = RSB_TRANSPOSITION_N, const NT * alphap = RSBP_NULL, rsb_coo_idx_t nrhs = 1, rsb_flags_t order = RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT * Bp = RSBP_NULL, rsb_nnz_idx_t ldB = 0, const NT * betap = RSBP_NULL, NT * Cp = RSBP_NULL, rsb_nnz_idx_t ldC = 0) const [inline]

Note: directly based on the C function rsb_tune_spsm() from <rsb.h>. Threaded and direct, main character energy πŸ‘‘

Deprecated 🚨 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. Bestie. The pointers. Let them go. 🫢

upd_vals (the omega one) ⭐

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::upd_vals (enum rsb_elopf_t elop_flags, const NT & omega) [inline]

Note: directly based on the C function rsb_mtx_upd_vals() from <rsb.h>.

Example snip from examples/bench.cpp:

mtx.upd_vals(RSB_ELOPF_POW,nt_t{0.0}); // set matrix values to ones

iconic β€” literally just announcing in a comment that we're setting the matrix values to ones, and then doing it πŸ”₯

upd_vals (the omegap one) πŸ’œ

template<RSBP_Scalar_t NT> RSBP_RVT Err_t RsbMatrix< NT >::upd_vals (enum rsb_elopf_t elop_flags, const NT * omegap) [inline]

Note: directly based on the C function rsb_mtx_upd_vals() from <rsb.h>.

Deprecated 🚨 This function overload is deprecated: use the corresponding overload without the C-style pointers-to-scalar, or request one if non existing yet. The reference version up above is the one you want, she's the moment πŸ’…

✍️ Author

Generated automatically by Doxygen for librsb from the source code.

(yes bestie, the robots wrote the docs, and honestly? they ate πŸ€–βœ¨)


and that's a wrap on RsbMatrix< NT >(3), fr fr πŸŽ€ this page is from librsb version 1.3.0.3, dated Tue Mar 31 2026 β€” go tune something, you've got this πŸ«ΆπŸ’–

πŸ“¦ where this page comes from