ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::spmatrix_ushort Class Reference

This class handles sparse matrix_ushort objects as shared handles. More...

#include <spmatrix_ushort.hpp>

Collaboration diagram for gsl::spmatrix_ushort:
Collaboration graph

Public Types

enum  {
  COO = GSL_SPMATRIX_COO , CSC = GSL_SPMATRIX_CSC , CSR = GSL_SPMATRIX_CSR , TRIPLET = GSL_SPMATRIX_TRIPLET ,
  CCS = GSL_SPMATRIX_CCS , CRS = GSL_SPMATRIX_CRS
}
 Reference to GSL_SPMATRIX constants. More...
 

Public Member Functions

 spmatrix_ushort ()
 The default constructor is only really useful for assigning to. More...
 
 spmatrix_ushort (size_t const n1, size_t const n2)
 This constructor creates a new matrix_ushort with n1 rows and n2 columns. More...
 
 spmatrix_ushort (size_t const n1, size_t const n2, size_t nzmax, size_t sptype)
 This constructor creates a new matrix_ushort with n1 rows and n2 columns. More...
 
 spmatrix_ushort (gsl_spmatrix_ushort *v)
 Could construct from a gsl_spmatrix_ushort. More...
 
 spmatrix_ushort (std::initializer_list< std::initializer_list< unsigned short > > initializer_list)
 Could construct from a std::initializer_list in C++11 and later. More...
 
 spmatrix_ushort (spmatrix_ushort const &v)
 The copy constructor. More...
 
spmatrix_ushortoperator= (spmatrix_ushort const &v)
 The assignment operator. More...
 
spmatrix_ushort clone () const
 The clone function. More...
 
 ~spmatrix_ushort ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void wrap_gsl_spmatrix_ushort_without_ownership (gsl_spmatrix_ushort *v)
 This function is intended mainly for internal use. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 spmatrix_ushort (spmatrix_ushort &&v)
 Move constructor. More...
 
spmatrix_ushortoperator= (spmatrix_ushort &&v)
 Move operator. More...
 
size_t size1 () const
 The number of rows of the matrix_ushort. More...
 
size_t size2 () const
 The number of columns of the matrix_ushort. More...
 
size_t nzmax () const
 The maximum number of nonzero elements. More...
 
int sptype () const
 The type of the spmatrix_ushort. More...
 
unsigned short * data ()
 Give access to the data block. More...
 
unsigned short const * data () const
 Give access to the data block. More...
 
void swap (spmatrix_ushort &m)
 Swap two spmatrix_ushort objects. More...
 
int realloc (size_t const nzmax)
 C++ version of gsl_spmatrix_ushort_realloc(). More...
 
size_t nnz () const
 C++ version of gsl_spmatrix_ushort_nnz(). More...
 
char const * type () const
 C++ version of gsl_spmatrix_ushort_type(). More...
 
int set_zero ()
 C++ version of gsl_spmatrix_ushort_set_zero(). More...
 
int tree_rebuild ()
 C++ version of gsl_spmatrix_ushort_tree_rebuild(). More...
 
spmatrix_ushort csc () const
 C++ version of gsl_spmatrix_ushort_csc(). More...
 
spmatrix_ushort csr () const
 C++ version of gsl_spmatrix_ushort_csr(). More...
 
spmatrix_ushort compress (int const sptype) const
 C++ version of gsl_spmatrix_ushort_compress(). More...
 
spmatrix_ushort compcol () const
 C++ version of gsl_spmatrix_ushort_compcol(). More...
 
spmatrix_ushort ccs () const
 C++ version of gsl_spmatrix_ushort_ccs(). More...
 
spmatrix_ushort crs () const
 C++ version of gsl_spmatrix_ushort_crs(). More...
 
int memcpy (spmatrix_ushort &dest) const
 C++ version of gsl_spmatrix_ushort_memcpy(). More...
 
int fprintf (FILE *stream, char const *format) const
 C++ version of gsl_spmatrix_ushort_fprintf(). More...
 
int fwrite (FILE *stream) const
 C++ version of gsl_spmatrix_ushort_fwrite(). More...
 
int fread (FILE *stream)
 C++ version of gsl_spmatrix_ushort_fread(). More...
 
unsigned short get (size_t const i, size_t const j) const
 C++ version of gsl_spmatrix_ushort_get(). More...
 
int set (size_t const i, size_t const j, unsigned short const x)
 C++ version of gsl_spmatrix_ushort_set(). More...
 
unsigned short * ptr (size_t const i, size_t const j) const
 C++ version of gsl_spmatrix_ushort_ptr(). More...
 
int minmax (unsigned short &min_out, unsigned short &max_out) const
 C++ version of gsl_spmatrix_ushort_minmax(). More...
 
int min_index (size_t &imin_out, size_t &jmin_out) const
 C++ version of gsl_spmatrix_ushort_min_index(). More...
 
int scale (unsigned short const x)
 C++ version of gsl_spmatrix_ushort_scale(). More...
 
int scale_columns (gsl::vector_ushort const &x)
 C++ version of gsl_spmatrix_ushort_scale_columns(). More...
 
int scale_rows (gsl::vector_ushort const &x)
 C++ version of gsl_spmatrix_ushort_scale_rows(). More...
 
int equal (spmatrix_ushort const &b) const
 C++ version of gsl_spmatrix_ushort_equal(). More...
 
int transpose ()
 C++ version of gsl_spmatrix_ushort_transpose(). More...
 
int transpose2 ()
 C++ version of gsl_spmatrix_ushort_transpose2(). More...
 
gsl_spmatrix_ushort * get ()
 Get the gsl_spmatrix_ushort. More...
 
gsl_spmatrix_ushort const * get () const
 Get the gsl_spmatrix_ushort. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_spmatrix_ushort. More...
 
size_t use_count () const
 Find how many spmatrix_ushort objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 

Static Public Member Functions

static int realloc (size_t const nzmax, gsl::spmatrix_ushort &spMatrix)
 C++ version of gsl_spmatrix_ushort_realloc(): matches a function in gsl that is intended for internal use. More...
 
static size_t nnz (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_nnz(). More...
 
static char const * type (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_type(). More...
 
static int set_zero (spmatrix_ushort &spMatrix)
 C++ version of gsl_spmatrix_ushort_set_zero(). More...
 
static int tree_rebuild (spmatrix_ushort &spMatrix)
 C++ version of gsl_spmatrix_ushort_tree_rebuild(). More...
 
static spmatrix_ushort csc (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_csc(). More...
 
static spmatrix_ushort csr (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_csr(). More...
 
static spmatrix_ushort compress (spmatrix_ushort const &spMatrix, int const sptype)
 C++ version of gsl_spmatrix_ushort_compress(). More...
 
static spmatrix_ushort compcol (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_compcol(). More...
 
static spmatrix_ushort ccs (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_ccs(). More...
 
static spmatrix_ushort crs (spmatrix_ushort const &spMatrix)
 C++ version of gsl_spmatrix_ushort_crs(). More...
 
static int memcpy (spmatrix_ushort &dest, spmatrix_ushort const &src)
 C++ version of gsl_spmatrix_ushort_memcpy(). More...
 
static int fprintf (FILE *stream, spmatrix_ushort const &spMatrix, char const *format)
 C++ version of gsl_spmatrix_ushort_fprintf(). More...
 
static spmatrix_ushort fscanf (FILE *stream)
 C++ version of gsl_spmatrix_ushort_fscanf(). More...
 
static int fwrite (FILE *stream, spmatrix_ushort &spMatrix)
 C++ version of gsl_spmatrix_ushort_fwrite(). More...
 
static int fread (FILE *stream, spmatrix_ushort &spMatrix)
 C++ version of gsl_spmatrix_ushort_fread(). More...
 
static int add (spmatrix_ushort &c, spmatrix_ushort const &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_ushort_add(). More...
 
static spmatrix_ushort add (spmatrix_ushort const &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_ushort_add(). More...
 
static int add_to_dense (gsl::matrix_ushort &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_add_to_dense(). More...
 
static int dense_add (gsl::matrix_ushort &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_dense_add(). More...
 
static int dense_sub (gsl::matrix_ushort &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_dense_sub(). More...
 
static ushort norm1 (gsl::spmatrix_ushort const &a)
 C++ version of gsl_spmatrix_ushort_norm1(). More...
 
static int d2sp (gsl::spmatrix_ushort &S, gsl::matrix_ushort const &A)
 C++ version of gsl_spmatrix_ushort_d2sp(). More...
 
static int sp2d (gsl::matrix_ushort &A, spmatrix_ushort const &S)
 C++ version of gsl_spmatrix_ushort_sp2d(). More...
 
static int equal (spmatrix_ushort const &a, spmatrix_ushort const &b)
 C++ version of gsl_spmatrix_ushort_equal(). More...
 
static int transpose (spmatrix_ushort &a)
 C++ version of gsl_spmatrix_ushort_transpose(). More...
 
static int transpose2 (spmatrix_ushort &a)
 C++ version of gsl_spmatrix_ushort_transpose2(). More...
 
static int transpose_memcpy (spmatrix_ushort &dest, spmatrix_ushort const &src)
 C++ version of gsl_spmatrix_ushort_transpose_memcpy(). More...
 

Private Attributes

gsl_spmatrix_ushort * ccgsl_pointer
 The shared pointer. More...
 
size_t * count
 The shared reference count. More...
 

Detailed Description

This class handles sparse matrix_ushort objects as shared handles.

It models a random access container so that STL functions work with matrix_ushort.

Definition at line 37 of file spmatrix_ushort.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Reference to GSL_SPMATRIX constants.

Enumerator
COO 

GSL_SPMATRIX_COO.

CSC 

GSL_SPMATRIX_CSC.

CSR 

GSL_SPMATRIX_CSR.

TRIPLET 

GSL_SPMATRIX_TRIPLET.

CCS 

GSL_SPMATRIX_CCS.

CRS 

GSL_SPMATRIX_CRS.

Definition at line 42 of file spmatrix_ushort.hpp.

Constructor & Destructor Documentation

◆ spmatrix_ushort() [1/7]

gsl::spmatrix_ushort::spmatrix_ushort ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 59 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

Referenced by operator=(), and reset().

◆ spmatrix_ushort() [2/7]

gsl::spmatrix_ushort::spmatrix_ushort ( size_t const  n1,
size_t const  n2 
)
inlineexplicit

This constructor creates a new matrix_ushort with n1 rows and n2 columns.

Parameters
n1The number of rows in the matrix_ushort
n2The number of columns in the matrix_ushort

Definition at line 70 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

◆ spmatrix_ushort() [3/7]

gsl::spmatrix_ushort::spmatrix_ushort ( size_t const  n1,
size_t const  n2,
size_t  nzmax,
size_t  sptype 
)
inlineexplicit

This constructor creates a new matrix_ushort with n1 rows and n2 columns.

Parameters
n1The number of rows in the matrix_ushort
n2The number of columns in the matrix_ushort
nzmaxThe maximum number of nonzero elements that will be added to the matrix_ushort
sptypeThe storage format of the sparse matrix_ushort: one of gsl::spmatrix_ushort::COO, gsl::spmatrix_ushort::CSC or gsl::spmatrix_ushort::CSR

Definition at line 91 of file spmatrix_ushort.hpp.

References ccgsl_pointer, count, nzmax(), and sptype().

◆ spmatrix_ushort() [4/7]

gsl::spmatrix_ushort::spmatrix_ushort ( gsl_spmatrix_ushort *  v)
inlineexplicit

Could construct from a gsl_spmatrix_ushort.

This is not usually a good idea. In this case you should not use gsl_spmatrix_ushort_free() to deallocate the memory.

Parameters
vThe matrix_ushort

Definition at line 110 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

◆ spmatrix_ushort() [5/7]

gsl::spmatrix_ushort::spmatrix_ushort ( std::initializer_list< std::initializer_list< unsigned short > >  initializer_list)
inline

Could construct from a std::initializer_list in C++11 and later.

Parameters
initializer_listThe initializer_list.

Definition at line 121 of file spmatrix_ushort.hpp.

References ccgsl_pointer, count, gsl::exception::GSL_EBADLEN, and set().

◆ spmatrix_ushort() [6/7]

gsl::spmatrix_ushort::spmatrix_ushort ( spmatrix_ushort const &  v)
inline

The copy constructor.

This shares the matrix_ushort. Use clone() if you want a full copy.

Parameters
vThe spmatrix_ushort to copy.

Definition at line 154 of file spmatrix_ushort.hpp.

References count.

◆ ~spmatrix_ushort()

gsl::spmatrix_ushort::~spmatrix_ushort ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 193 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

◆ spmatrix_ushort() [7/7]

gsl::spmatrix_ushort::spmatrix_ushort ( spmatrix_ushort &&  v)
inline

Move constructor.

Parameters
vThe spmatrix_ushort to move.

Definition at line 233 of file spmatrix_ushort.hpp.

References count.

Member Function Documentation

◆ add() [1/2]

static int gsl::spmatrix_ushort::add ( spmatrix_ushort c,
spmatrix_ushort const &  a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_add().

Parameters
cAn spmatrix_ushort object
aAn spmatrix_ushort object
bAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 612 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), gsl::sf::mathieu::b(), and get().

◆ add() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::add ( spmatrix_ushort const &  a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_add().

Parameters
aAn spmatrix_ushort object
bAn spmatrix_ushort object
Returns
The sum of a and b

Definition at line 620 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), and gsl::sf::mathieu::b().

◆ add_to_dense()

static int gsl::spmatrix_ushort::add_to_dense ( gsl::matrix_ushort a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_add_to_dense().

Parameters
aA gsl::matrix_ushort (return value is sum)
bA gsl::spmatrix_ushort
Returns
Error code on failure

Definition at line 632 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), and gsl::sf::mathieu::b().

◆ ccs() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::ccs ( ) const
inline

C++ version of gsl_spmatrix_ushort_ccs().

Returns
A compressed matrix_ushort

Definition at line 357 of file spmatrix_ushort.hpp.

References get().

◆ ccs() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::ccs ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_ccs().

Parameters
spMatrixAn spmatrix_ushort object
Returns
A compressed matrix_ushort

Definition at line 554 of file spmatrix_ushort.hpp.

References get().

◆ clone()

spmatrix_ushort gsl::spmatrix_ushort::clone ( ) const
inline

The clone function.

Use this if you want a copy of the spmatrix_ushort that does not share the underlying data.

Returns
a new copy of this.

Definition at line 182 of file spmatrix_ushort.hpp.

References get(), size1(), and size2().

◆ compcol() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::compcol ( ) const
inline

C++ version of gsl_spmatrix_ushort_compcol().

Returns
A compressed matrix_ushort

Definition at line 350 of file spmatrix_ushort.hpp.

References get().

◆ compcol() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::compcol ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_compcol().

Parameters
spMatrixAn spmatrix_ushort object
Returns
A compressed matrix_ushort

Definition at line 546 of file spmatrix_ushort.hpp.

References get().

◆ compress() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::compress ( int const  sptype) const
inline

C++ version of gsl_spmatrix_ushort_compress().

Parameters
sptypeOne of gsl::spmatrix_ushort::COO, gsl::spmatrix_ushort::CSC or gsl::spmatrix_ushort::CSR
Returns
The compressed matrix_ushort

Definition at line 343 of file spmatrix_ushort.hpp.

References get(), and sptype().

◆ compress() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::compress ( spmatrix_ushort const &  spMatrix,
int const  sptype 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_compress().

Parameters
spMatrixAn spmatrix_ushort object
sptypeOne of gsl::spmatrix_ushort::COO, gsl::spmatrix_ushort::CSC or gsl::spmatrix_ushort::CSR
Returns
The compressed matrix_ushort

Definition at line 538 of file spmatrix_ushort.hpp.

References get(), and sptype().

◆ crs() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::crs ( ) const
inline

C++ version of gsl_spmatrix_ushort_crs().

Returns
A compressed matrix_ushort

Definition at line 364 of file spmatrix_ushort.hpp.

References get().

◆ crs() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::crs ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_crs().

Parameters
spMatrixAn spmatrix_ushort object
Returns
A compressed matrix_ushort

Definition at line 562 of file spmatrix_ushort.hpp.

References get().

◆ csc() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::csc ( ) const
inline

C++ version of gsl_spmatrix_ushort_csc().

Returns
a sparse matrix_ushort in compressed sparse column format from this which must be in COO format

Definition at line 323 of file spmatrix_ushort.hpp.

References get(), size1(), and size2().

◆ csc() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::csc ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_csc().

Sets dest to a sparse matrix_ushort in compressed sparse column format from the input sparse matrix_ushort src, which must be in COO format

Parameters
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 518 of file spmatrix_ushort.hpp.

References get(), size1(), and size2().

◆ csr() [1/2]

spmatrix_ushort gsl::spmatrix_ushort::csr ( ) const
inline

C++ version of gsl_spmatrix_ushort_csr().

Returns
a sparse matrix_ushort in compressed sparse row format from this which must be in COO format

Definition at line 333 of file spmatrix_ushort.hpp.

References get(), size1(), and size2().

◆ csr() [2/2]

static spmatrix_ushort gsl::spmatrix_ushort::csr ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_csr().

Sets dest to a sparse matrix_ushort in compressed sparse row format from the input sparse matrix_ushort src, which must be in COO format

Parameters
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 528 of file spmatrix_ushort.hpp.

References get(), size1(), and size2().

◆ d2sp()

static int gsl::spmatrix_ushort::d2sp ( gsl::spmatrix_ushort S,
gsl::matrix_ushort const &  A 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_d2sp().

Parameters
SA gsl::spmatrix_ushort (return value)
AA gsl::matrix_ushort
Returns
Error code on failure

Definition at line 664 of file spmatrix_ushort.hpp.

References gsl::matrix_ushort::get(), and get().

◆ data() [1/2]

unsigned short * gsl::spmatrix_ushort::data ( )
inline

Give access to the data block.

Returns
The data block.

Definition at line 273 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

◆ data() [2/2]

unsigned short const * gsl::spmatrix_ushort::data ( ) const
inline

Give access to the data block.

Returns
The data block.

Definition at line 280 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

◆ dense_add()

static int gsl::spmatrix_ushort::dense_add ( gsl::matrix_ushort a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_dense_add().

Parameters
aA gsl::matrix_ushort (return value is sum)
bA gsl::spmatrix_ushort
Returns
Error code on failure

Definition at line 641 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), and gsl::sf::mathieu::b().

◆ dense_sub()

static int gsl::spmatrix_ushort::dense_sub ( gsl::matrix_ushort a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_dense_sub().

Parameters
aA gsl::matrix_ushort (return value is difference)
bA gsl::spmatrix_ushort
Returns
Error code on failure

Definition at line 649 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), and gsl::sf::mathieu::b().

◆ equal() [1/2]

static int gsl::spmatrix_ushort::equal ( spmatrix_ushort const &  a,
spmatrix_ushort const &  b 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_equal().

Parameters
aAn spmatrix_ushort
bAn spmatrix_ushort
Returns
1 or 0 according as a and b are equal or not

Definition at line 680 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a(), and gsl::sf::mathieu::b().

◆ equal() [2/2]

int gsl::spmatrix_ushort::equal ( spmatrix_ushort const &  b) const
inline

C++ version of gsl_spmatrix_ushort_equal().

Parameters
bAn spmatrix_ushort
Returns
1 or 0 according as a and b are equal or not

Definition at line 463 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::b(), and get().

◆ fprintf() [1/2]

int gsl::spmatrix_ushort::fprintf ( FILE *  stream,
char const *  format 
) const
inline

C++ version of gsl_spmatrix_ushort_fprintf().

Parameters
streamA file stream
formatOne of the g, e or f formats for floating point numbers
Returns
Error code on failure

Definition at line 379 of file spmatrix_ushort.hpp.

References get().

◆ fprintf() [2/2]

static int gsl::spmatrix_ushort::fprintf ( FILE *  stream,
spmatrix_ushort const &  spMatrix,
char const *  format 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_fprintf().

Parameters
streamA file stream
spMatrixAn spmatrix_ushort object
formatOne of the g, e or f formats for floating point numbers
Returns
Error code on failure

Definition at line 580 of file spmatrix_ushort.hpp.

References get().

◆ fread() [1/2]

int gsl::spmatrix_ushort::fread ( FILE *  stream)
inline

C++ version of gsl_spmatrix_ushort_fread().

Parameters
streamA file stream
Returns
Error code on failure

Definition at line 393 of file spmatrix_ushort.hpp.

References get().

◆ fread() [2/2]

static int gsl::spmatrix_ushort::fread ( FILE *  stream,
spmatrix_ushort spMatrix 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_fread().

Parameters
streamA file stream
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 603 of file spmatrix_ushort.hpp.

References get().

◆ fscanf()

static spmatrix_ushort gsl::spmatrix_ushort::fscanf ( FILE *  stream)
inlinestatic

C++ version of gsl_spmatrix_ushort_fscanf().

Parameters
streamA file stream
Returns
The spMatrix read from a file stream

Definition at line 587 of file spmatrix_ushort.hpp.

◆ fwrite() [1/2]

int gsl::spmatrix_ushort::fwrite ( FILE *  stream) const
inline

C++ version of gsl_spmatrix_ushort_fwrite().

Parameters
streamA file stream
Returns
Error code on failure

Definition at line 386 of file spmatrix_ushort.hpp.

References get().

◆ fwrite() [2/2]

static int gsl::spmatrix_ushort::fwrite ( FILE *  stream,
spmatrix_ushort spMatrix 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_fwrite().

Parameters
streamA file stream
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 595 of file spmatrix_ushort.hpp.

References get().

◆ get() [1/3]

gsl_spmatrix_ushort * gsl::spmatrix_ushort::get ( )
inline

Get the gsl_spmatrix_ushort.

Returns
the gsl_spmatrix_ushort

Definition at line 717 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

Referenced by ccs(), clone(), compcol(), compress(), crs(), csc(), csr(), equal(), fprintf(), fread(), fwrite(), get(), memcpy(), min_index(), minmax(), nnz(), ptr(), realloc(), scale(), scale_columns(), scale_rows(), set(), set_zero(), transpose(), transpose2(), tree_rebuild(), and type().

◆ get() [2/3]

gsl_spmatrix_ushort const * gsl::spmatrix_ushort::get ( ) const
inline

Get the gsl_spmatrix_ushort.

Returns
the gsl_spmatrix_ushort

Definition at line 722 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

◆ get() [3/3]

unsigned short gsl::spmatrix_ushort::get ( size_t const  i,
size_t const  j 
) const
inline

C++ version of gsl_spmatrix_ushort_get().

Parameters
iRow index
jColumn index
Returns
Value in sparse matrix_ushort

Definition at line 401 of file spmatrix_ushort.hpp.

References get().

Referenced by add(), ccs(), clone(), compcol(), compress(), crs(), csc(), csr(), d2sp(), fprintf(), fread(), fwrite(), memcpy(), nnz(), realloc(), set_zero(), sp2d(), transpose_memcpy(), tree_rebuild(), and type().

◆ memcpy() [1/2]

int gsl::spmatrix_ushort::memcpy ( spmatrix_ushort dest) const
inline

C++ version of gsl_spmatrix_ushort_memcpy().

Parameters
destThe destination spmatrix_ushort
Returns
Error code on failure

Definition at line 372 of file spmatrix_ushort.hpp.

References get().

◆ memcpy() [2/2]

static int gsl::spmatrix_ushort::memcpy ( spmatrix_ushort dest,
spmatrix_ushort const &  src 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_memcpy().

Parameters
destThe destination spmatrix_ushort
srcThe source spmatrix_ushort
Returns
Error code on failure

Definition at line 571 of file spmatrix_ushort.hpp.

References get().

◆ min_index()

int gsl::spmatrix_ushort::min_index ( size_t &  imin_out,
size_t &  jmin_out 
) const
inline

C++ version of gsl_spmatrix_ushort_min_index().

Parameters
imin_outThe row index of the minimum nonzero element (by reference)
jmin_outThe column index of the minimum nonzero element (by reference)
Returns
Error code on failure

Definition at line 435 of file spmatrix_ushort.hpp.

References get().

◆ minmax()

int gsl::spmatrix_ushort::minmax ( unsigned short &  min_out,
unsigned short &  max_out 
) const
inline

C++ version of gsl_spmatrix_ushort_minmax().

Parameters
min_outThe minimum element (by reference)
max_outThe maximum element (by reference)
Returns
Error code on failure

Definition at line 427 of file spmatrix_ushort.hpp.

References get().

◆ nnz() [1/2]

size_t gsl::spmatrix_ushort::nnz ( ) const
inline

C++ version of gsl_spmatrix_ushort_nnz().

Returns
The number of nonzero elements of this

Definition at line 302 of file spmatrix_ushort.hpp.

References get().

◆ nnz() [2/2]

static size_t gsl::spmatrix_ushort::nnz ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_nnz().

Parameters
spMatrixAn spmatrix_ushort object
Returns
The number of nonzero elements of spMatrix

Definition at line 489 of file spmatrix_ushort.hpp.

References get().

◆ norm1()

static ushort gsl::spmatrix_ushort::norm1 ( gsl::spmatrix_ushort const &  a)
inlinestatic

C++ version of gsl_spmatrix_ushort_norm1().

Parameters
aA gsl::spmatrix_ushort
Returns
The 1-norm

Definition at line 656 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a().

◆ nzmax()

size_t gsl::spmatrix_ushort::nzmax ( ) const
inline

The maximum number of nonzero elements.

Returns
the maximum number of nonzero elements

Definition at line 263 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

Referenced by realloc(), and spmatrix_ushort().

◆ operator bool()

gsl::spmatrix_ushort::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

Returns
true or false according as this contains a pointer to a gsl_spmatrix_ushort

Definition at line 742 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

spmatrix_ushort & gsl::spmatrix_ushort::operator= ( spmatrix_ushort &&  v)
inline

Move operator.

Parameters
vThe spmatrix_ushort to move.
Returns
A reference to this.

Definition at line 242 of file spmatrix_ushort.hpp.

References spmatrix_ushort().

◆ operator=() [2/2]

spmatrix_ushort & gsl::spmatrix_ushort::operator= ( spmatrix_ushort const &  v)
inline

The assignment operator.

This makes a shared copy.

Parameters
vThe matrix_ushort to copy

Definition at line 162 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

◆ ptr()

unsigned short * gsl::spmatrix_ushort::ptr ( size_t const  i,
size_t const  j 
) const
inline

C++ version of gsl_spmatrix_ushort_ptr().

Parameters
iRow index
jColumn index
Returns
Error code on failure

Definition at line 418 of file spmatrix_ushort.hpp.

References get().

◆ realloc() [1/2]

int gsl::spmatrix_ushort::realloc ( size_t const  nzmax)
inline

C++ version of gsl_spmatrix_ushort_realloc().

This is not usually used.

Parameters
nzmaxThe maximum number of nonzero elements
Returns
Error code on failure

Definition at line 297 of file spmatrix_ushort.hpp.

References get(), and nzmax().

◆ realloc() [2/2]

static int gsl::spmatrix_ushort::realloc ( size_t const  nzmax,
gsl::spmatrix_ushort spMatrix 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_realloc(): matches a function in gsl that is intended for internal use.

Parameters
nzmaxThe maximum number of nonzero elements
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 482 of file spmatrix_ushort.hpp.

References get(), and nzmax().

◆ reset()

void gsl::spmatrix_ushort::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 227 of file spmatrix_ushort.hpp.

References spmatrix_ushort().

◆ scale()

int gsl::spmatrix_ushort::scale ( unsigned short const  x)
inline

C++ version of gsl_spmatrix_ushort_scale().

Parameters
xA scaling factor
Returns
Error code on failure

Definition at line 443 of file spmatrix_ushort.hpp.

References get().

◆ scale_columns()

int gsl::spmatrix_ushort::scale_columns ( gsl::vector_ushort const &  x)
inline

C++ version of gsl_spmatrix_ushort_scale_columns().

Parameters
xA scaling gsl::vector_ushort
Returns
Error code on failure

Definition at line 449 of file spmatrix_ushort.hpp.

References get(), and gsl::vector_ushort::get().

◆ scale_rows()

int gsl::spmatrix_ushort::scale_rows ( gsl::vector_ushort const &  x)
inline

C++ version of gsl_spmatrix_ushort_scale_rows().

Parameters
xA scaling gsl::vector_ushort
Returns
Error code on failure

Definition at line 456 of file spmatrix_ushort.hpp.

References get(), and gsl::vector_ushort::get().

◆ set()

int gsl::spmatrix_ushort::set ( size_t const  i,
size_t const  j,
unsigned short const  x 
)
inline

C++ version of gsl_spmatrix_ushort_set().

Parameters
iRow index
jColumn value
xNew matrix_ushort entry
Returns
Error code on failure

Definition at line 410 of file spmatrix_ushort.hpp.

References get().

Referenced by spmatrix_ushort().

◆ set_zero() [1/2]

int gsl::spmatrix_ushort::set_zero ( )
inline

C++ version of gsl_spmatrix_ushort_set_zero().

Reinitialise spmatrix_ushort to zeros.

Returns
Error code on failure

Definition at line 312 of file spmatrix_ushort.hpp.

References get().

◆ set_zero() [2/2]

static int gsl::spmatrix_ushort::set_zero ( spmatrix_ushort spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_set_zero().

Reinitialise spmatrix_ushort to zeros.

Parameters
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 503 of file spmatrix_ushort.hpp.

References get().

◆ size1()

size_t gsl::spmatrix_ushort::size1 ( ) const
inline

The number of rows of the matrix_ushort.

Returns
The number of rows of the matrix_ushort

Definition at line 253 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

Referenced by clone(), csc(), and csr().

◆ size2()

size_t gsl::spmatrix_ushort::size2 ( ) const
inline

The number of columns of the matrix_ushort.

Returns
The number of columns of the matrix_ushort

Definition at line 258 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

Referenced by clone(), csc(), and csr().

◆ sp2d()

static int gsl::spmatrix_ushort::sp2d ( gsl::matrix_ushort A,
spmatrix_ushort const &  S 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_sp2d().

Parameters
AA gsl::matrix_ushort (return value)
SA gsl::spmatrix_ushort
Returns
Error code on failure

Definition at line 672 of file spmatrix_ushort.hpp.

References gsl::matrix_ushort::get(), and get().

◆ sptype()

int gsl::spmatrix_ushort::sptype ( ) const
inline

The type of the spmatrix_ushort.

Returns
the type of the spmatrix_ushort

Definition at line 268 of file spmatrix_ushort.hpp.

References ccgsl_pointer.

Referenced by compress(), and spmatrix_ushort().

◆ swap()

void gsl::spmatrix_ushort::swap ( spmatrix_ushort m)
inline

Swap two spmatrix_ushort objects.

This works even if the spmatrix_ushort objects have different sizes because it swaps pointers.

Parameters
mThe spmatrix_ushort to swap with this.

Definition at line 288 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

◆ transpose() [1/2]

int gsl::spmatrix_ushort::transpose ( )
inline

C++ version of gsl_spmatrix_ushort_transpose().

Returns
Error code on failure

Definition at line 468 of file spmatrix_ushort.hpp.

References get().

◆ transpose() [2/2]

static int gsl::spmatrix_ushort::transpose ( spmatrix_ushort a)
inlinestatic

C++ version of gsl_spmatrix_ushort_transpose().

Parameters
aAn spmatrix_ushort
Returns
Error code on failure

Definition at line 687 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a().

◆ transpose2() [1/2]

int gsl::spmatrix_ushort::transpose2 ( )
inline

C++ version of gsl_spmatrix_ushort_transpose2().

Returns
Error code on failure

Definition at line 473 of file spmatrix_ushort.hpp.

References get().

◆ transpose2() [2/2]

static int gsl::spmatrix_ushort::transpose2 ( spmatrix_ushort a)
inlinestatic

C++ version of gsl_spmatrix_ushort_transpose2().

Parameters
aAn spmatrix_ushort
Returns
Error code on failure

Definition at line 693 of file spmatrix_ushort.hpp.

References gsl::sf::mathieu::a().

◆ transpose_memcpy()

static int gsl::spmatrix_ushort::transpose_memcpy ( spmatrix_ushort dest,
spmatrix_ushort const &  src 
)
inlinestatic

C++ version of gsl_spmatrix_ushort_transpose_memcpy().

Parameters
destAn spmatrix_ushort (return)
srcAn spmatrix_ushort
Returns
Error code on failure

Definition at line 700 of file spmatrix_ushort.hpp.

References get().

◆ tree_rebuild() [1/2]

int gsl::spmatrix_ushort::tree_rebuild ( )
inline

C++ version of gsl_spmatrix_ushort_tree_rebuild().

Returns
Error code on failure

Definition at line 317 of file spmatrix_ushort.hpp.

References get().

◆ tree_rebuild() [2/2]

static int gsl::spmatrix_ushort::tree_rebuild ( spmatrix_ushort spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_tree_rebuild().

Parameters
spMatrixAn spmatrix_ushort object
Returns
Error code on failure

Definition at line 510 of file spmatrix_ushort.hpp.

References get().

◆ type() [1/2]

char const * gsl::spmatrix_ushort::type ( ) const
inline

C++ version of gsl_spmatrix_ushort_type().

Returns
A string describing the sparse matrix_ushort storage format

Definition at line 307 of file spmatrix_ushort.hpp.

References get().

◆ type() [2/2]

static char const * gsl::spmatrix_ushort::type ( spmatrix_ushort const &  spMatrix)
inlinestatic

C++ version of gsl_spmatrix_ushort_type().

Parameters
spMatrixAn spmatrix_ushort object
Returns
A string describing the sparse matrix_ushort storage format

Definition at line 496 of file spmatrix_ushort.hpp.

References get().

◆ unique()

bool gsl::spmatrix_ushort::unique ( ) const
inline

Find if this is the only object sharing the gsl_spmatrix_ushort.

Returns
true or falses according as this is the only spmatrix_ushort object sharing the gsl_spmatrix_ushort

Definition at line 728 of file spmatrix_ushort.hpp.

References count.

◆ use_count()

size_t gsl::spmatrix_ushort::use_count ( ) const
inline

Find how many spmatrix_ushort objects share this pointer.

Returns
the number of spmatrix_ushort objects that share this pointer

Definition at line 733 of file spmatrix_ushort.hpp.

References count.

◆ wrap_gsl_spmatrix_ushort_without_ownership()

void gsl::spmatrix_ushort::wrap_gsl_spmatrix_ushort_without_ownership ( gsl_spmatrix_ushort *  v)
inline

This function is intended mainly for internal use.

It allows this to point to a gsl_spmatrix_ushort without the possibility deleting it when this is no longer in scope. It is the responsibility of the programmer to delete v. The function is used internally for converting a function that takes a gsl::spmatrix_ushort* argument to one that takes a gsl_spmatrix_ushort* argument.

Parameters
vThe gsl_spmatrix_ushort

Definition at line 212 of file spmatrix_ushort.hpp.

References ccgsl_pointer, and count.

Member Data Documentation

◆ ccgsl_pointer

gsl_spmatrix_ushort* gsl::spmatrix_ushort::ccgsl_pointer
private

◆ count

size_t* gsl::spmatrix_ushort::count
private

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