logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

RsbMatrix - Represent a sparse matrix in RSB format by means of librsb.

Author

       Generated automatically by Doxygen for librsb from the source code.

librsb                                           Version 1.3.0.2                              RsbMatrix<NT>(3)

Constructor & Destructor Documentation

template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(rsb_coo_idx_tnrA,rsb_coo_idx_tncA,constRsbSymsym=IsGen)[inline]
       Begin assembling a sparse matrix of given dimensions and type.
       Then you can use set_val() or set_vals() repeatedly to populate the matrix.
       After populating the matrix, use close() to terminate its assembly.
        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_alloc_from_coo_begin() from <rsb.h>.template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(rsb_coo_idx_tnrA,constrsb_coo_idx_t*RP,constrsb_coo_idx_t*JA,constNT*VA,constRsbSymsym=IsGen)[inline]
       Assemble a sparse matrix given CSR input.
       Note
           Directly based on C function rsb_mtx_alloc_from_csr_const() from <rsb.h>.template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(constrsb_coo_idx_t*IA,constrsb_coo_idx_t*JA,constNT*VA,rsb_nnz_idx_tnnzA,constrsb_flags_tflagsA=RSB_FLAG_NOFLAGS)[inline]
       Assemble a sparse matrix given COO input.
       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 C function rsb_mtx_alloc_from_coo_const() from <rsb.h>.template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(constrsb_char_t*filename,constRsbSymsym=IsGen)[inline]
       Assemble a sparse matrix given filename input.
       Note
           Directly based on C function rsb_file_mtx_load() from <rsb.h>.template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(constRsbMatrix<NT>&A_Rsb,booldo_trans=false,rsb_flags_tflagsA=RSB_FLAG_NOFLAGS)[inline]
       Copy a sparse matrix given example input.
       Can either clone it, or transpose it or change flags (structure) in the process.

   template<RSBP_Scalar_tNT>RsbMatrix<NT>::RsbMatrix(RsbMatrix<NT>&&other)[inline]
       Move constructor.
       The moved matrix object will be invalid afterwards.
       Example snip from examples/misc.cpp:

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

   template<RSBP_Scalar_tNT>RsbMatrix<NT>::~RsbMatrix(void)[inline]
       Destructor.
       Frees matrix object memory.
       Note
           Directly based on C function rsb_mtx_free() from <rsb.h>.

Detailed Description

template<RSBP_Scalar_tNT>
       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),andpasstheparametersastheyare,sotheerrorcheckingisdonebylibrsb.WhilemostoflibrsbCfunctionsusevoid*pointersinsteadofnumericaldata,RsbMatrixistemplatedbyatypeparameter.Thisintroducestypesafetyatcompiletime.

       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.

       ParametersNT 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.hinterfaceisstable,thersb.hppinterfaceisneitherstable,norcomplete:earlyusers'feedbackisverywelcome.Shallall$alpha$and$beta$bepassedbyvaluesonly?ThisisnaturalandfitsC++.Butrsb_tune_spmm()/rsb_tune_spsm()havemoreparameterswithanullptr-like`default'value:howtodealwiththeminRsbMatrix::tune_spmm()/RsbMatrix::tune_spsm()withoutintroducingtoomanyspecialcases?SimilarlyfortheconsistencyofRsbMatrix::get_flags_t(),RsbMatrix::get_type_t(),RsbMatrix::get_info_coo_t(),andsimilar:shalltheythrowanexceptionifgivenaflagnotmatchingthereturntype?OrmaybekeepingonlyRsbMatrix::get_info(),withper-typereferenceoverloads?Furthermore:ifworkingunderC++20,shallRsbLibavoidpointer-basedinterfacescompletely(usingstd::spanonly)?

Member Enumeration Documentation

template<RSBP_Scalar_tNT>enumRsbMatrix::RsbSym
       Matrix structure: either general, symmetric, hermitian, or triangular (also see rsb_flags_t).

       EnumeratorIsGen  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).

Member Function Documentation

template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::_add(rsb_coo_idx_ti,rsb_coo_idx_tj,NTval)[inline]Deprecated
           Use set_val() and set_vals() instead.

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::_close(void)[inline]Deprecated
           Use close() instead.

   template<RSBP_Scalar_tNT>size_tRsbMatrix<NT>::_get_index_storage_bytes(void)const[inline]Warning
           The name of this member function is expected to change.

   template<RSBP_Scalar_tNT>size_tRsbMatrix<NT>::_get_storage_bytes(void)const[inline]Warning
           The name of this member function is expected to change.

   template<RSBP_Scalar_tNT>rsb_string_tRsbMatrix<NT>::_info(void)const[inline]Warning
           The name of this member function is expected to change.

   template<RSBP_Scalar_tNT>boolRsbMatrix<NT>::_is_complex(void)const[inline]Warning
           The name of this member function is expected to change.

   template<RSBP_Scalar_tNT>rsb_blk_idx_tRsbMatrix<NT>::blocks(void)const[inline]template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::close(void)[inline]
       Terminate assembly of a previously started and populated matrix.
       Shall be called once.

       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);

       SeealsoRsbMatrix::RsbMatrix(rsb_coo_idx_tnrA, rsb_coo_idx_tncA, constRsbSymsym = IsGen );

       Note
           Directly based on C function rsb_mtx_alloc_from_coo_end() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_coo_idx_tRsbMatrix<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;

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::file_save(constrsb_char_t*filename=RSBP_NULL)const[inline]Note
           Directly based on C function rsb_file_mtx_save() from <rsb.h>.

       Example snip from examples/misc.cpp:

           mtx.file_save(); // print to stdout

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::get_coo(rsb_trans_ttransA,NT*VA,rsb_coo_idx_t*IA,rsb_coo_idx_t*JA,rsb_flags_tflags)const[inline]Note
           Directly based on C function rsb_mtx_get_coo() from <rsb.h>.Warning
           Only transA=RSB_TRANSPOSITION_N 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.

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::get_csr(rsb_trans_ttransA,NT*VA,rsb_coo_idx_t*RP,rsb_coo_idx_t*JA,rsb_flags_tflags)const[inline]Note
           Directly based on C function rsb_mtx_get_csr() from <rsb.h>.Warning
           Only transA=RSB_TRANSPOSITION_N 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.

   template<RSBP_Scalar_tNT>rsb_flags_tRsbMatrix<NT>::get_flags_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::get_info(enumrsb_mif_tmiflags,void*minfop)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_blk_idx_tRsbMatrix<NT>::get_info_blk_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_coo_idx_tRsbMatrix<NT>::get_info_coo_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_nnz_idx_tRsbMatrix<NT>::get_info_nnz_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_flags_tRsbMatrix<NT>::get_info_rsb_flags_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>size_tRsbMatrix<NT>::get_info_size_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_string_tRsbMatrix<NT>::get_info_str(constchar*key)const[inline]Note
           Directly based on C function rsb_mtx_get_info_str() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::get_nrm(NT*Np,enumrsb_extff_tflags)const[inline]Note
           Directly based on C function rsb_mtx_get_nrm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::get_rows_sparse(rsb_trans_ttransA,constNT*alphap,NT*VA,rsb_coo_idx_t*IA,rsb_coo_idx_t*JA,rsb_coo_idx_tfrA,rsb_coo_idx_tlrA,rsb_nnz_idx_t*rnzp,rsb_flags_tflags)const[inline]Note
           Directly based on 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.

   template<RSBP_Scalar_tNT>rsb_type_tRsbMatrix<NT>::get_type_t(enumrsb_mif_tmif)const[inline]Note
           Directly based on C function rsb_mtx_get_info() from <rsb.h>.template<RSBP_Scalar_tNT>NTRsbMatrix<NT>::get_val(constrsb_coo_idx_ti,constrsb_coo_idx_tj,rsb_flags_tflags=RSB_FLAG_NOFLAGS)const[inline]Note
           Directly based on C function rsb_mtx_get_vals() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::get_vals(NT*VA,constrsb_coo_idx_t*IA,constrsb_coo_idx_t*JA,rsb_nnz_idx_tnnz,rsb_flags_tflags)const[inline]Note
           Directly based on C function rsb_mtx_get_vals() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::get_vec(NT*Dp,enumrsb_extff_tflags)const[inline]Note
           Directly based on C function rsb_mtx_get_vec() from <rsb.h>.template<RSBP_Scalar_tNT>rsb_nnz_idx_tRsbMatrix<NT>::nnz(void)const[inline]template<RSBP_Scalar_tNT>NTRsbMatrix<NT>::normInf(void)const[inline]template<RSBP_Scalar_tNT>NTRsbMatrix<NT>::normOne(void)const[inline]template<RSBP_Scalar_tNT>boolRsbMatrix<NT>::operator!=(constRsbMatrix<NT>&B_Rsb)const[inline]
       Example snip from examples/misc.cpp:

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

       SeealsoRsbMatrix::operator==(constRsbMatrix&B_Rsb)const;

   template<RSBP_Scalar_tNT>RsbMatrix&RsbMatrix<NT>::operator=(constRsbMatrix<NT>&A_Rsb)[inline]
       A copy constructor. Will clone the input matrix contents.

   template<RSBP_Scalar_tNT>boolRsbMatrix<NT>::operator==(constRsbMatrix<NT>&B_Rsb)const[inline]
       Deep comparison: compare if the two matrices have same dimensions, nonzeroes count, nonzeroes pattern and
       value. Meant for very sporadic use. Inefficient: it can involve matrices copying.

       Example snip from examples/misc.cpp:

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

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::rndr(constrsb_char_t*filename=RSBP_NULL,rsb_coo_idx_tpmWidth=512,rsb_coo_idx_tpmHeight=512,rsb_marf_trflags=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());

   template<RSBP_Scalar_tNT>rsb_coo_idx_tRsbMatrix<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;

   template<RSBP_Scalar_tNT>rsb_flags_tRsbMatrix<NT>::rsbflags(void)const[inline]template<RSBP_Scalar_tNT>rsb_type_tRsbMatrix<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;

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::set_val(constNTval,constrsb_coo_idx_ti,constrsb_coo_idx_tj,rsb_flags_tflags=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);

       Seealsoset_vals().

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::set_vals(constNT*VA,constrsb_coo_idx_t*IA,constrsb_coo_idx_t*JA,rsb_nnz_idx_tnnz,rsb_flags_tflags)[inline]
       Add a single entry during the assembly of a matrix created empty.
       Use close() to terminate matrix assembly.

       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>.template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::spmm(rsb_trans_ttransA,constNT*alphap,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,rsb_nnz_idx_tldB,constNT*betap,NT*Cp,rsb_nnz_idx_tldC)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.

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spmm(rsb_trans_ttransA,constNTalpha,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,constNTbeta,NT*Cp)const[inline]Note
           Indirectly based on C function rsb_spmm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spmm(rsb_trans_ttransA,constNTalpha,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,rsb_nnz_idx_tldB,constNTbeta,NT*Cp,rsb_nnz_idx_tldC)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>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spmv(NT*y,constNT*x,booldo_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);

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::spmv(rsb_trans_ttransA,constNT*alphap,constNT*Xp,rsb_coo_idx_tincX,constNT*betap,NT*Yp,rsb_coo_idx_tincY)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.

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spmv(rsb_trans_ttransA,constNTalpha,constNT*Xp,constNTbeta,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);

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spmv(rsb_trans_ttransA,constNTalpha,constNT*Xp,rsb_coo_idx_tincX,constNTbeta,NT*Yp,rsb_coo_idx_tincY)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);

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsm(NT*y,constNT*x,rsb_coo_idx_tnrhs,booldo_trans=false)const[inline]Note
           Indirectly based on C function rsb_spsm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsm(NT*y,rsb_coo_idx_tnrhs,booldo_trans=false)const[inline]Note
           Indirectly based on C function rsb_spsm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::spsm(rsb_trans_ttransT,constNT*alphap,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*betap,constNT*Bp,rsb_nnz_idx_tldB,NT*Cp,rsb_nnz_idx_tldC)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.

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsm(rsb_trans_ttransT,constNTalpha,rsb_coo_idx_tnrhs,constNT*Bp,NT*Cp)const[inline]Note
           Indirectly based on C function rsb_spsm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsm(rsb_trans_ttransT,constNTalpha,rsb_coo_idx_tnrhs,rsb_flags_torder,constNTbeta,constNT*Bp,rsb_nnz_idx_tldB,NT*Cp,rsb_nnz_idx_tldC)const[inline]Note
           Indirectly based on C function rsb_spsm() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsv(NT*y,booldo_trans=false)const[inline]Note
           Indirectly based on C function rsb_spsv() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsv(NT*y,constNT*x,booldo_trans=false)const[inline]Note
           Indirectly based on C function rsb_spsv() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::spsv(rsb_trans_ttransT,constNT*alphap,constNT*Xp,rsb_coo_idx_tincX,NT*Yp,rsb_coo_idx_tincY)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.

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::spsv(rsb_trans_ttransT,constNTalpha,constNT*Xp,NT*Yp)const[inline]Note
           Indirectly based on C function rsb_spsv() from <rsb.h>.template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::tune_spmm(rsb_real_t&sf,rsb_trans_ttransA,constNTalpha,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,constNTbeta,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

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::tune_spmm(rsb_real_t*sfp,rsb_int_t*tnp,rsb_int_tmaxr,rsb_time_tmaxt,rsb_trans_ttransA,constNT*alphap,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,rsb_nnz_idx_tldB,constNT*betap,NT*Cp,rsb_nnz_idx_tldC)[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.

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::tune_spmm(rsb_real_t*sfp,rsb_int_t*tnp,rsb_int_tmaxr,rsb_time_tmaxt,rsb_trans_ttransA,constNTalpha,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,rsb_nnz_idx_tldB,constNTbeta,NT*Cp,rsb_nnz_idx_tldC)[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

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::tune_spmm_threads(rsb_real_t*sfp=RSBP_NULL,rsb_int_t*tnp=RSBP_NULL,rsb_int_tmaxr=0,rsb_time_tmaxt=0,rsb_trans_ttransA=RSB_TRANSPOSITION_N,constNT*alphap=RSBP_NULL,rsb_coo_idx_tnrhs=1,rsb_flags_torder=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER,constNT*Bp=RSBP_NULL,rsb_nnz_idx_tldB=0,constNT*betap=RSBP_NULL,NT*Cp=RSBP_NULL,rsb_nnz_idx_tldC=0)const[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.

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::tune_spsm(rsb_real_t*sfp,rsb_int_t*tnp,rsb_int_tmaxr,rsb_time_tmaxt,rsb_trans_ttransA,constNT*alphap,rsb_coo_idx_tnrhs,rsb_flags_torder,constNT*Bp,rsb_nnz_idx_tldB,constNT*betap,NT*Cp,rsb_nnz_idx_tldC)[inline]Note
           Directly based on 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.

   template<RSBP_Scalar_tNT>RSBP_RVTRSBP_DEPRECATEDErr_tRsbMatrix<NT>::tune_spsm_threads(rsb_real_t*sfp=RSBP_NULL,rsb_int_t*tnp=RSBP_NULL,rsb_int_tmaxr=0,rsb_time_tmaxt=0,rsb_trans_ttransA=RSB_TRANSPOSITION_N,constNT*alphap=RSBP_NULL,rsb_coo_idx_tnrhs=1,rsb_flags_torder=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER,constNT*Bp=RSBP_NULL,rsb_nnz_idx_tldB=0,constNT*betap=RSBP_NULL,NT*Cp=RSBP_NULL,rsb_nnz_idx_tldC=0)const[inline]Note
           Directly based on 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.

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::upd_vals(enumrsb_elopf_telop_flags,constNT&omega)[inline]Note
           Directly based on 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

   template<RSBP_Scalar_tNT>RSBP_RVTErr_tRsbMatrix<NT>::upd_vals(enumrsb_elopf_telop_flags,constNT*omegap)[inline]Note
           Directly based on 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.

Name

       RsbMatrix - Represent a sparse matrix in RSB format by means of librsb.

Synopsis

       #include <rsb.hpp>

   PublicTypes
       enum RsbSym { IsGen = RSB_FLAG_NOFLAGS, IsHer = RSB_FLAG_HERMITIAN, IsSym = RSB_FLAG_SYMMETRIC, IsTri =
           RSB_FLAG_TRIANGULAR }

   PublicMemberFunctionsRsbMatrix (rsb_coo_idx_tnrA, rsb_coo_idx_tncA, constRsbSymsym=IsGen)
       RsbMatrix (rsb_coo_idx_tnrA, constrsb_coo_idx_t *RP, constrsb_coo_idx_t *JA, const NT *VA, constRsbSymsym=IsGen)
       RsbMatrix (constrsb_coo_idx_t *IA, constrsb_coo_idx_t *JA, const NT *VA, rsb_nnz_idx_tnnzA, constrsb_flags_tflagsA=RSB_FLAG_NOFLAGS)
       RsbMatrix (constrsb_char_t *filename, constRsbSymsym=IsGen)
       RsbMatrix (constRsbMatrix &A_Rsb, booldo_trans=false, rsb_flags_tflagsA=RSB_FLAG_NOFLAGS)
       RsbMatrix (RsbMatrix &&other)
       ~RsbMatrix (void)
       RSBP_RVTRSBP_DEPRECATEDErr_t_add (rsb_coo_idx_ti, rsb_coo_idx_tj, NT val)
       RSBP_RVTErr_tclose (void)
       RSBP_RVTRSBP_DEPRECATEDErr_t_close (void)
       RSBP_RVTRSBP_DEPRECATEDErr_tspmv (rsb_trans_ttransA, const NT *alphap, const NT *Xp, rsb_coo_idx_tincX, const NT *betap, NT *Yp, rsb_coo_idx_tincY) constRSBP_RVTErr_tspmv (rsb_trans_ttransA, const NT alpha, const NT *Xp, rsb_coo_idx_tincX, const NT beta,
           NT *Yp, rsb_coo_idx_tincY) constRSBP_RVTErr_tspmv (rsb_trans_ttransA, const NT alpha, const NT *Xp, const NT beta, NT *Yp) constRSBP_RVTErr_tspmv (NT *y, const NT *x, booldo_trans=false) constRSBP_RVTRSBP_DEPRECATEDErr_tspmm (rsb_trans_ttransA, const NT *alphap, rsb_coo_idx_tnrhs,
           rsb_flags_torder, const NT *Bp, rsb_nnz_idx_tldB, const NT *betap, NT *Cp, rsb_nnz_idx_tldC) constRSBP_RVTErr_tspmm (rsb_trans_ttransA, const NT alpha, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT
           *Bp, rsb_nnz_idx_tldB, const NT beta, NT *Cp, rsb_nnz_idx_tldC) constRSBP_RVTErr_tspmm (rsb_trans_ttransA, const NT alpha, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT
           *Bp, const NT beta, NT *Cp) constRSBP_RVTRSBP_DEPRECATEDErr_tspsm (rsb_trans_ttransT, const NT *alphap, rsb_coo_idx_tnrhs,
           rsb_flags_torder, const NT *betap, const NT *Bp, rsb_nnz_idx_tldB, NT *Cp, rsb_nnz_idx_tldC) constRSBP_RVTErr_tspsm (rsb_trans_ttransT, const NT alpha, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT
           beta, const NT *Bp, rsb_nnz_idx_tldB, NT *Cp, rsb_nnz_idx_tldC) constRSBP_RVTErr_tspsm (rsb_trans_ttransT, const NT alpha, rsb_coo_idx_tnrhs, const NT *Bp, NT *Cp) constRSBP_RVTErr_tspsm (NT *y, const NT *x, rsb_coo_idx_tnrhs, booldo_trans=false) constRSBP_RVTErr_tspsm (NT *y, rsb_coo_idx_tnrhs, booldo_trans=false) constRSBP_RVTRSBP_DEPRECATEDErr_tspsv (rsb_trans_ttransT, const NT *alphap, const NT *Xp, rsb_coo_idx_tincX, NT *Yp, rsb_coo_idx_tincY) constRSBP_RVTErr_tspsv (rsb_trans_ttransT, const NT alpha, const NT *Xp, NT *Yp) constRSBP_RVTErr_tspsv (NT *y, const NT *x, booldo_trans=false) constRSBP_RVTErr_tspsv (NT *y, booldo_trans=false) constsize_tget_info_size_t (enumrsb_mif_tmif) constrsb_flags_tget_info_rsb_flags_t (enumrsb_mif_tmif) constrsb_blk_idx_tget_info_blk_t (enumrsb_mif_tmif) constrsb_nnz_idx_tget_info_nnz_t (enumrsb_mif_tmif) constrsb_flags_tget_flags_t (enumrsb_mif_tmif) constrsb_type_tget_type_t (enumrsb_mif_tmif) constrsb_coo_idx_tget_info_coo_t (enumrsb_mif_tmif) constsize_t_get_index_storage_bytes (void) constsize_t_get_storage_bytes (void) constrsb_nnz_idx_tnnz (void) constrsb_blk_idx_tblocks (void) constrsb_coo_idx_trows (void) constrsb_coo_idx_tcols (void) constRSBP_RVTErr_tget_vals (NT *VA, constrsb_coo_idx_t *IA, constrsb_coo_idx_t *JA, rsb_nnz_idx_tnnz,
           rsb_flags_tflags) const
       NT get_val (constrsb_coo_idx_ti, constrsb_coo_idx_tj, rsb_flags_tflags=RSB_FLAG_NOFLAGS) constRSBP_RVTErr_tset_val (const NT val, constrsb_coo_idx_ti, constrsb_coo_idx_tj, rsb_flags_tflags=RSB_FLAG_NOFLAGS)
       RSBP_RVTErr_tset_vals (const NT *VA, constrsb_coo_idx_t *IA, constrsb_coo_idx_t *JA, rsb_nnz_idx_tnnz, rsb_flags_tflags)
       RSBP_RVTErr_tget_vec (NT *Dp, enumrsb_extff_tflags) constRSBP_RVTRSBP_DEPRECATEDErr_tget_coo (rsb_trans_ttransA, NT *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA,
           rsb_flags_tflags) constRSBP_RVTRSBP_DEPRECATEDErr_tget_csr (rsb_trans_ttransA, NT *VA, rsb_coo_idx_t *RP, rsb_coo_idx_t *JA,
           rsb_flags_tflags) constRSBP_RVTRSBP_DEPRECATEDErr_tget_rows_sparse (rsb_trans_ttransA, const NT *alphap, NT *VA,
           rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_coo_idx_tfrA, rsb_coo_idx_tlrA, rsb_nnz_idx_t *rnzp,
           rsb_flags_tflags) constRSBP_RVTErr_tupd_vals (enumrsb_elopf_telop_flags, const NT &omega)
       RSBP_RVTErr_tupd_vals (enumrsb_elopf_telop_flags, const NT *omegap)
       RSBP_RVTErr_tget_nrm (NT *Np, enumrsb_extff_tflags) constrsb_type_trsbtype (void) constrsb_flags_trsbflags (void) constrsb_string_tget_info_str (constchar *key) constRSBP_RVTErr_tget_info (enumrsb_mif_tmiflags, void *minfop) constrsb_string_t_info (void) constRSBP_RVTRSBP_DEPRECATEDErr_ttune_spsm_threads (rsb_real_t *sfp=RSBP_NULL, rsb_int_t *tnp=RSBP_NULL,
           rsb_int_tmaxr=0, rsb_time_tmaxt=0, rsb_trans_ttransA=RSB_TRANSPOSITION_N, const NT
           *alphap=RSBP_NULL, rsb_coo_idx_tnrhs=1, rsb_flags_torder=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT
           *Bp=RSBP_NULL, rsb_nnz_idx_tldB=0, const NT *betap=RSBP_NULL, NT *Cp=RSBP_NULL, rsb_nnz_idx_tldC=0)
           constRSBP_RVTRSBP_DEPRECATEDErr_ttune_spmm_threads (rsb_real_t *sfp=RSBP_NULL, rsb_int_t *tnp=RSBP_NULL,
           rsb_int_tmaxr=0, rsb_time_tmaxt=0, rsb_trans_ttransA=RSB_TRANSPOSITION_N, const NT
           *alphap=RSBP_NULL, rsb_coo_idx_tnrhs=1, rsb_flags_torder=RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, const NT
           *Bp=RSBP_NULL, rsb_nnz_idx_tldB=0, const NT *betap=RSBP_NULL, NT *Cp=RSBP_NULL, rsb_nnz_idx_tldC=0)
           constRSBP_RVTRSBP_DEPRECATEDErr_ttune_spmm (rsb_real_t *sfp, rsb_int_t *tnp, rsb_int_tmaxr, rsb_time_tmaxt, rsb_trans_ttransA, const NT *alphap, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT *Bp,
           rsb_nnz_idx_tldB, const NT *betap, NT *Cp, rsb_nnz_idx_tldC)
       RSBP_RVTRSBP_DEPRECATEDErr_ttune_spmm (rsb_real_t *sfp, rsb_int_t *tnp, rsb_int_tmaxr, rsb_time_tmaxt, rsb_trans_ttransA, const NT alpha, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT *Bp,
           rsb_nnz_idx_tldB, const NT beta, NT *Cp, rsb_nnz_idx_tldC)
       RSBP_RVTErr_ttune_spmm (rsb_real_t &sf, rsb_trans_ttransA, const NT alpha, rsb_coo_idx_tnrhs,
           rsb_flags_torder, const NT *Bp, const NT beta, NT *Cp)
       RSBP_RVTRSBP_DEPRECATEDErr_ttune_spsm (rsb_real_t *sfp, rsb_int_t *tnp, rsb_int_tmaxr, rsb_time_tmaxt, rsb_trans_ttransA, const NT *alphap, rsb_coo_idx_tnrhs, rsb_flags_torder, const NT *Bp,
           rsb_nnz_idx_tldB, const NT *betap, NT *Cp, rsb_nnz_idx_tldC)
       RSBP_RVTErr_tfile_save (constrsb_char_t *filename=RSBP_NULL) constRsbMatrix & operator= (constRsbMatrix &A_Rsb)
       bool_is_complex (void) constbooloperator== (constRsbMatrix &B_Rsb) constbooloperator!= (constRsbMatrix &B_Rsb) const
       NT normOne (void) const
       NT normInf (void) constRSBP_RVTErr_trndr (constrsb_char_t *filename=RSBP_NULL, rsb_coo_idx_tpmWidth=512, rsb_coo_idx_tpmHeight=512, rsb_marf_trflags=RSB_MARF_EPS) const

See Also