ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
spmatrix_uint.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010, 2011, 2012, 2019, 2020, 2021 John D Lamb
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef CCGSL_SPMATRIX_HPP
20#define CCGSL_SPMATRIX_HPP
21
22#include<cstddef>
23#include<gsl/gsl_spmatrix.h>
24#include<new>
25
26#include"exception.hpp"
27#include"vector_uint.hpp"
28#include"matrix_uint.hpp"
29
30namespace gsl {
38 public:
42 enum {
44 COO = GSL_SPMATRIX_COO,
46 CSC = GSL_SPMATRIX_CSC,
48 CSR = GSL_SPMATRIX_CSR,
50 TRIPLET = GSL_SPMATRIX_TRIPLET,
52 CCS = GSL_SPMATRIX_CCS,
54 CRS = GSL_SPMATRIX_CRS
55 };
60 ccgsl_pointer = 0;
61 count = 0; // initially nullptr will do
62 }
63 // Refines random access container
64 // Refines assignable
70 explicit spmatrix_uint( size_t const n1, size_t const n2 ){
71 if( n1 > 0 and n2 > 0 ) ccgsl_pointer = gsl_spmatrix_uint_alloc( n1, n2 );
72 else { ccgsl_pointer = new gsl_spmatrix_uint; ccgsl_pointer->size1 = n1;
73 ccgsl_pointer->size2 = n2; ccgsl_pointer->data = 0; }
74 // just plausibly we could allocate spmatrix_uint but not count
75 try { count = new size_t; } catch( std::bad_alloc& e ){
76 // try to tidy up before rethrowing
77 if( n1 > 0 and n2 > 0 ) gsl_spmatrix_uint_free( ccgsl_pointer );
78 else delete ccgsl_pointer;
79 throw e;
80 }
81 *count = 1; // initially there is just one reference to ccgsl_pointer
82 }
91 explicit spmatrix_uint( size_t const n1, size_t const n2, size_t nzmax, size_t sptype ){
92 if( n1 > 0 and n2 > 0 )
93 ccgsl_pointer = gsl_spmatrix_uint_alloc_nzmax( n1, n2, nzmax, sptype );
94 else { ccgsl_pointer = new gsl_spmatrix_uint; ccgsl_pointer->size1 = n1;
95 ccgsl_pointer->size2 = n2; ccgsl_pointer->data = 0; }
96 // just plausibly we could allocate spmatrix_uint but not count
97 try { count = new size_t; } catch( std::bad_alloc& e ){
98 // try to tidy up before rethrowing
99 if( n1 > 0 and n2 > 0 ) gsl_spmatrix_uint_free( ccgsl_pointer );
100 else delete ccgsl_pointer;
101 throw e;
102 }
103 *count = 1; // initially there is just one reference to ccgsl_pointer
104 }
110 explicit spmatrix_uint( gsl_spmatrix_uint* v ){
111 ccgsl_pointer = v;
112 // just plausibly we could fail to allocate count: no further action needed.
113 count = new size_t;
114 *count = 1; // initially there is just one reference to ccgsl_pointer
115 }
116#ifdef __GXX_EXPERIMENTAL_CXX0X__
121 spmatrix_uint( std::initializer_list<std::initializer_list<unsigned int> > initializer_list ){
122 size_t const n1 = initializer_list.size();
123 size_t const n2 = initializer_list.begin()->size();
124 for( auto l : initializer_list ){
125 if( l.size() != n2 ){
126 gsl::exception e( "matrix_uint rows have unequal sizes", __FILE__, __LINE__,
128 throw( e );
129 }
130 }
131 ccgsl_pointer = gsl_spmatrix_uint_alloc( n1, n2 );
132 // just plausibly we could allocate spmatrix_uint but not count
133 try { count = new size_t; } catch( std::bad_alloc& e ){
134 // try to tidy up before rethrowing
135 if( n1 > 0 and n2 > 0 ) gsl_spmatrix_uint_free( ccgsl_pointer );
136 else delete ccgsl_pointer;
137 throw e;
138 }
139 *count = 1; // initially there is just one reference to ccgsl_pointer
140 // now copy
141 int r = 0;
142 for( auto row : initializer_list ){
143 size_t c = 0;
144 for( auto x : row ){ set( r, c, x ); ++c; }
145 ++r;
146 }
147 }
148#endif
149 // copy constructor
155 if( count != 0 ) ++*count; // spmatrix_uint is now shared.
156 }
157 // assignment operator
163 // first, possibly delete anything pointed to by this
164 if( count == 0 or --*count == 0 ){
165 if( ccgsl_pointer != 0 and ccgsl_pointer->size1 > 0
166 and ccgsl_pointer->size2 > 0 ) gsl_spmatrix_uint_free( ccgsl_pointer );
167 else delete ccgsl_pointer;
168 delete count;
169 }
170 // Then copy
172 count = v.count;
173 if( count != 0 ) ++*count; // block is now shared.
174 return *this;
175 }
176 // clone()
183 spmatrix_uint copy( get()->size1, get()->size2 );
184 // Now copy
185 gsl_spmatrix_uint_memcpy( copy.get(), get() );
186 // return new object
187 return copy;
188 }
189 // destructor
194 if( count != 0 and --*count == 0 ){
195 // could have allocated null pointer
196 if( ccgsl_pointer != 0 ){
197 if( ccgsl_pointer->size1 > 0 and ccgsl_pointer->size2 > 0 )
198 gsl_spmatrix_uint_free( ccgsl_pointer );
199 else delete ccgsl_pointer; }
200 delete count;
201 }
202 }
203 // Allow possibility of assigning from gsl_spmatrix_uint without sharing
212 void wrap_gsl_spmatrix_uint_without_ownership( gsl_spmatrix_uint* v ){
213 if( count != 0 and --*count == 0 ){
214 // could have allocated null pointer
215 if( ccgsl_pointer != 0 ){
216 if( ccgsl_pointer->size1 != 0 and ccgsl_pointer->size1 != 0 )
217 gsl_spmatrix_uint_free( ccgsl_pointer );
218 else delete ccgsl_pointer; }
219 }
220 ccgsl_pointer = v;
221 if(0 == count) count = new size_t;
222 *count = 2; // should never be able to delete ccgsl_pointer
223 }
227 void reset(){ spmatrix_uint().swap( *this ); }
228#ifdef __GXX_EXPERIMENTAL_CXX0X__
234 std::swap( count, v.count );
235 v.ccgsl_pointer = nullptr;
236 }
243 spmatrix_uint( std::move( v ) ).swap( *this );
244 return *this;
245 }
246#endif
247 public:
248 // Sizes
253 size_t size1() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->size1; }
258 size_t size2() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->size2; }
263 size_t nzmax() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->nzmax; }
268 int sptype() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->sptype; }
273 unsigned int* data() {
274 if( ccgsl_pointer == 0 ) gsl_error( "null vector_uint", __FILE__, __LINE__, GSL_EFAULT );
275 return ccgsl_pointer->data; }
280 unsigned int const* data() const {
281 if( ccgsl_pointer == 0 ) gsl_error( "null vector_uint", __FILE__, __LINE__, GSL_EFAULT );
282 return ccgsl_pointer->data; }
288 void swap( spmatrix_uint& m ){
289 std::swap( ccgsl_pointer, m.ccgsl_pointer );
290 std::swap( count, m.count );
291 }
297 int realloc( size_t const nzmax ){ return gsl_spmatrix_uint_realloc( nzmax, get() ); }
302 size_t nnz() const { return gsl_spmatrix_uint_nnz( get() ); }
307 char const* type() const { return gsl_spmatrix_uint_type( get() ); }
312 int set_zero(){ return gsl_spmatrix_uint_set_zero( get() ); }
317 int tree_rebuild(){ return gsl_spmatrix_uint_tree_rebuild( get() ); }
324 spmatrix_uint dest { size1(), size2() };
325 gsl_spmatrix_uint_csc( dest.get(), get() );
326 return dest;
327 }
334 spmatrix_uint dest { size1(), size2() };
335 gsl_spmatrix_uint_csr( dest.get(), get() );
336 return dest;
337 }
343 spmatrix_uint compress( int const sptype ) const {
344 spmatrix_uint dest { gsl_spmatrix_uint_compress( get(), sptype ) };
345 return dest; }
351 spmatrix_uint dest { gsl_spmatrix_uint_compcol( get() ) };
352 return dest; }
358 spmatrix_uint dest { gsl_spmatrix_uint_ccs( get() ) };
359 return dest; }
365 spmatrix_uint dest { gsl_spmatrix_uint_crs( get() ) };
366 return dest; }
372 int memcpy( spmatrix_uint& dest ) const { return gsl_spmatrix_uint_memcpy( dest.get(), get() ); }
379 int fprintf( FILE* stream, char const* format ) const {
380 return gsl_spmatrix_uint_fprintf( stream, get(), format ); }
386 int fwrite( FILE* stream ) const {
387 return gsl_spmatrix_uint_fwrite( stream, get() ); }
393 int fread( FILE* stream ){
394 return gsl_spmatrix_uint_fread( stream, get() ); }
401 unsigned int get( size_t const i, size_t const j ) const {
402 return gsl_spmatrix_uint_get( get(), i, j ); }
410 int set( size_t const i, size_t const j, unsigned int const x ){
411 return gsl_spmatrix_uint_set( get(), i, j, x ); }
418 unsigned int* ptr( size_t const i, size_t const j ) const {
419 return gsl_spmatrix_uint_ptr( get(), i, j ); }
420 // BEGIN REAL ONLY
427 int minmax( unsigned int& min_out, unsigned int& max_out ) const {
428 return gsl_spmatrix_uint_minmax( get(), &min_out, &max_out ); }
435 int min_index( size_t& imin_out, size_t& jmin_out ) const {
436 return gsl_spmatrix_uint_min_index( get(), &imin_out, &jmin_out ); }
437 // END REAL ONLY
443 int scale( unsigned int const x ){ return gsl_spmatrix_uint_scale( get(), x ); }
450 return gsl_spmatrix_uint_scale_columns( get(), x.get() ); }
457 return gsl_spmatrix_uint_scale_rows( get(), x.get() ); }
463 int equal( spmatrix_uint const& b ) const { return gsl_spmatrix_uint_equal( get(), b.get() ); }
468 int transpose(){ return gsl_spmatrix_uint_transpose( get() ); }
473 int transpose2(){ return gsl_spmatrix_uint_transpose2( get() ); }
474 // Now the static functions
482 static int realloc( size_t const nzmax, gsl::spmatrix_uint& spMatrix ){
483 return gsl_spmatrix_uint_realloc( nzmax, spMatrix.get() ); }
489 static size_t nnz( spmatrix_uint const& spMatrix ){
490 return gsl_spmatrix_uint_nnz( spMatrix.get() ); }
496 static char const* type( spmatrix_uint const& spMatrix ){
497 return gsl_spmatrix_uint_type( spMatrix.get() ); }
503 static int set_zero( spmatrix_uint& spMatrix ){
504 return gsl_spmatrix_uint_set_zero( spMatrix.get() ); }
510 static int tree_rebuild( spmatrix_uint& spMatrix ){
511 return gsl_spmatrix_uint_tree_rebuild( spMatrix.get() ); }
518 static spmatrix_uint csc( spmatrix_uint const& spMatrix ){
519 spmatrix_uint dest { spMatrix.size1(), spMatrix.size2() };
520 gsl_spmatrix_uint_csc( dest.get(), spMatrix.get() );
521 return dest; }
528 static spmatrix_uint csr( spmatrix_uint const& spMatrix ){
529 spmatrix_uint dest { spMatrix.size1(), spMatrix.size2() };
530 gsl_spmatrix_uint_csr( dest.get(), spMatrix.get() );
531 return dest; }
538 static spmatrix_uint compress( spmatrix_uint const& spMatrix, int const sptype ){
539 spmatrix_uint dest { gsl_spmatrix_uint_compress( spMatrix.get(), sptype ) };
540 return dest; }
546 static spmatrix_uint compcol( spmatrix_uint const& spMatrix ){
547 spmatrix_uint dest { gsl_spmatrix_uint_compcol( spMatrix.get() ) };
548 return dest; }
554 static spmatrix_uint ccs( spmatrix_uint const& spMatrix ){
555 spmatrix_uint dest { gsl_spmatrix_uint_ccs( spMatrix.get() ) };
556 return dest; }
562 static spmatrix_uint crs( spmatrix_uint const& spMatrix ){
563 spmatrix_uint dest { gsl_spmatrix_uint_crs( spMatrix.get() ) };
564 return dest; }
571 static int memcpy( spmatrix_uint& dest, spmatrix_uint const& src ){
572 return gsl_spmatrix_uint_memcpy( dest.get(), src.get() ); }
580 static int fprintf( FILE* stream, spmatrix_uint const& spMatrix, char const* format ){
581 return gsl_spmatrix_uint_fprintf( stream, spMatrix.get(), format ); }
587 static spmatrix_uint fscanf( FILE* stream ){
588 return spmatrix_uint { gsl_spmatrix_uint_fscanf( stream ) }; }
595 static int fwrite( FILE* stream, spmatrix_uint& spMatrix ){
596 return gsl_spmatrix_uint_fwrite( stream, spMatrix.get() ); }
603 static int fread( FILE* stream, spmatrix_uint& spMatrix ){
604 return gsl_spmatrix_uint_fread( stream, spMatrix.get() ); }
612 static int add( spmatrix_uint& c, spmatrix_uint const& a, spmatrix_uint const& b ){
613 return gsl_spmatrix_uint_add( c.get(), a.get(), b.get() ); }
620 static spmatrix_uint add( spmatrix_uint const& a, spmatrix_uint const& b ){
621 spmatrix_uint c { a.size1(), a.size2() };
622 gsl_spmatrix_uint_add( c.get(), a.get(), b.get() );
623 return c;
624 }
625#ifndef GSL_DISABLE_DEPRECATED
633 return gsl_spmatrix_uint_add_to_dense( a.get(), b.get() ); }
634#endif
642 return gsl_spmatrix_uint_dense_add( a.get(), b.get() ); }
650 return gsl_spmatrix_uint_dense_sub( a.get(), b.get() ); }
656 static uint norm1( gsl::spmatrix_uint const& a ){
657 return gsl_spmatrix_uint_norm1( a.get() ); }
664 static int d2sp( gsl::spmatrix_uint& S, gsl::matrix_uint const& A ){
665 return gsl_spmatrix_uint_d2sp( S.get(), A.get() ); }
672 static int sp2d( gsl::matrix_uint& A, spmatrix_uint const& S ){
673 return gsl_spmatrix_uint_sp2d( A.get(), S.get() ); }
680 static int equal( spmatrix_uint const& a, spmatrix_uint const& b ){
681 return gsl_spmatrix_uint_equal( a.get(), b.get() ); }
687 static int transpose( spmatrix_uint& a ){ return gsl_spmatrix_uint_transpose( a.get() ); }
693 static int transpose2( spmatrix_uint& a ){ return gsl_spmatrix_uint_transpose2( a.get() ); }
700 static int transpose_memcpy( spmatrix_uint& dest, spmatrix_uint const& src ){
701 return gsl_spmatrix_uint_transpose_memcpy( dest.get(), src.get() ); }
702 private:
706 gsl_spmatrix_uint* ccgsl_pointer;
710 size_t* count;
711 public:
712 // shared reference functions
717 gsl_spmatrix_uint* get(){ return ccgsl_pointer; }
722 gsl_spmatrix_uint const* get() const { return ccgsl_pointer; }
728 bool unique() const { return count != 0 and *count == 1; }
733 size_t use_count() const { return count == 0 ? 0 : *count; }
739#ifdef __GXX_EXPERIMENTAL_CXX0X__
740 explicit
741#endif
742 operator bool() const { return ccgsl_pointer != 0; }
743 };
744}
745#endif
This class is used to handle gsl exceptions so that gsl can use these rather than the GSL error handl...
Definition: exception.hpp:387
@ GSL_EBADLEN
matrix, vector lengths are not conformant
Definition: exception.hpp:490
This class handles matrix_uint objects as shared handles.
Definition: matrix_uint.hpp:57
gsl_matrix_uint * get()
Get the gsl_matrix_uint.
This class handles sparse matrix_uint objects as shared handles.
spmatrix_uint & operator=(spmatrix_uint &&v)
Move operator.
static int fprintf(FILE *stream, spmatrix_uint const &spMatrix, char const *format)
C++ version of gsl_spmatrix_uint_fprintf().
static int dense_sub(gsl::matrix_uint &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_dense_sub().
unsigned int get(size_t const i, size_t const j) const
C++ version of gsl_spmatrix_uint_get().
static int sp2d(gsl::matrix_uint &A, spmatrix_uint const &S)
C++ version of gsl_spmatrix_uint_sp2d().
void reset()
Stop sharing ownership of the shared pointer.
static int fwrite(FILE *stream, spmatrix_uint &spMatrix)
C++ version of gsl_spmatrix_uint_fwrite().
static int set_zero(spmatrix_uint &spMatrix)
C++ version of gsl_spmatrix_uint_set_zero().
static int add(spmatrix_uint &c, spmatrix_uint const &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_uint_add().
static int fread(FILE *stream, spmatrix_uint &spMatrix)
C++ version of gsl_spmatrix_uint_fread().
int tree_rebuild()
C++ version of gsl_spmatrix_uint_tree_rebuild().
size_t nnz() const
C++ version of gsl_spmatrix_uint_nnz().
void swap(spmatrix_uint &m)
Swap two spmatrix_uint objects.
spmatrix_uint(spmatrix_uint const &v)
The copy constructor.
int min_index(size_t &imin_out, size_t &jmin_out) const
C++ version of gsl_spmatrix_uint_min_index().
char const * type() const
C++ version of gsl_spmatrix_uint_type().
int sptype() const
The type of the spmatrix_uint.
static int memcpy(spmatrix_uint &dest, spmatrix_uint const &src)
C++ version of gsl_spmatrix_uint_memcpy().
gsl_spmatrix_uint const * get() const
Get the gsl_spmatrix_uint.
unsigned int * data()
Give access to the data block.
int transpose()
C++ version of gsl_spmatrix_uint_transpose().
static int d2sp(gsl::spmatrix_uint &S, gsl::matrix_uint const &A)
C++ version of gsl_spmatrix_uint_d2sp().
unsigned int * ptr(size_t const i, size_t const j) const
C++ version of gsl_spmatrix_uint_ptr().
gsl_spmatrix_uint * get()
Get the gsl_spmatrix_uint.
int set_zero()
C++ version of gsl_spmatrix_uint_set_zero().
spmatrix_uint & operator=(spmatrix_uint const &v)
The assignment operator.
int set(size_t const i, size_t const j, unsigned int const x)
C++ version of gsl_spmatrix_uint_set().
spmatrix_uint ccs() const
C++ version of gsl_spmatrix_uint_ccs().
unsigned int const * data() const
Give access to the data block.
spmatrix_uint csr() const
C++ version of gsl_spmatrix_uint_csr().
static int realloc(size_t const nzmax, gsl::spmatrix_uint &spMatrix)
C++ version of gsl_spmatrix_uint_realloc(): matches a function in gsl that is intended for internal u...
static spmatrix_uint csr(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_csr().
static int add_to_dense(gsl::matrix_uint &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_add_to_dense().
static spmatrix_uint fscanf(FILE *stream)
C++ version of gsl_spmatrix_uint_fscanf().
int memcpy(spmatrix_uint &dest) const
C++ version of gsl_spmatrix_uint_memcpy().
static int transpose_memcpy(spmatrix_uint &dest, spmatrix_uint const &src)
C++ version of gsl_spmatrix_uint_transpose_memcpy().
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_spmatrix_uint_fprintf().
static int dense_add(gsl::matrix_uint &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_dense_add().
static size_t nnz(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_nnz().
gsl_spmatrix_uint * ccgsl_pointer
The shared pointer.
int equal(spmatrix_uint const &b) const
C++ version of gsl_spmatrix_uint_equal().
static int transpose2(spmatrix_uint &a)
C++ version of gsl_spmatrix_uint_transpose2().
static char const * type(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_type().
size_t size2() const
The number of columns of the matrix_uint.
spmatrix_uint csc() const
C++ version of gsl_spmatrix_uint_csc().
size_t nzmax() const
The maximum number of nonzero elements.
static uint norm1(gsl::spmatrix_uint const &a)
C++ version of gsl_spmatrix_uint_norm1().
spmatrix_uint clone() const
The clone function.
spmatrix_uint(spmatrix_uint &&v)
Move constructor.
static spmatrix_uint csc(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_csc().
int scale(unsigned int const x)
C++ version of gsl_spmatrix_uint_scale().
static int transpose(spmatrix_uint &a)
C++ version of gsl_spmatrix_uint_transpose().
spmatrix_uint compress(int const sptype) const
C++ version of gsl_spmatrix_uint_compress().
static spmatrix_uint compress(spmatrix_uint const &spMatrix, int const sptype)
C++ version of gsl_spmatrix_uint_compress().
spmatrix_uint()
The default constructor is only really useful for assigning to.
int scale_columns(gsl::vector_uint const &x)
C++ version of gsl_spmatrix_uint_scale_columns().
spmatrix_uint compcol() const
C++ version of gsl_spmatrix_uint_compcol().
int fread(FILE *stream)
C++ version of gsl_spmatrix_uint_fread().
static spmatrix_uint add(spmatrix_uint const &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_uint_add().
static int tree_rebuild(spmatrix_uint &spMatrix)
C++ version of gsl_spmatrix_uint_tree_rebuild().
size_t size1() const
The number of rows of the matrix_uint.
static spmatrix_uint crs(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_crs().
size_t use_count() const
Find how many spmatrix_uint objects share this pointer.
size_t * count
The shared reference count.
@ CRS
GSL_SPMATRIX_CRS.
@ CSC
GSL_SPMATRIX_CSC.
@ CCS
GSL_SPMATRIX_CCS.
@ CSR
GSL_SPMATRIX_CSR.
@ COO
GSL_SPMATRIX_COO.
@ TRIPLET
GSL_SPMATRIX_TRIPLET.
int scale_rows(gsl::vector_uint const &x)
C++ version of gsl_spmatrix_uint_scale_rows().
~spmatrix_uint()
The destructor only deletes the pointers if count reaches zero.
int transpose2()
C++ version of gsl_spmatrix_uint_transpose2().
spmatrix_uint crs() const
C++ version of gsl_spmatrix_uint_crs().
int minmax(unsigned int &min_out, unsigned int &max_out) const
C++ version of gsl_spmatrix_uint_minmax().
void wrap_gsl_spmatrix_uint_without_ownership(gsl_spmatrix_uint *v)
This function is intended mainly for internal use.
static spmatrix_uint compcol(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_compcol().
int realloc(size_t const nzmax)
C++ version of gsl_spmatrix_uint_realloc().
bool unique() const
Find if this is the only object sharing the gsl_spmatrix_uint.
spmatrix_uint(gsl_spmatrix_uint *v)
Could construct from a gsl_spmatrix_uint.
spmatrix_uint(size_t const n1, size_t const n2)
This constructor creates a new matrix_uint with n1 rows and n2 columns.
spmatrix_uint(std::initializer_list< std::initializer_list< unsigned int > > initializer_list)
Could construct from a std::initializer_list in C++11 and later.
int fwrite(FILE *stream) const
C++ version of gsl_spmatrix_uint_fwrite().
spmatrix_uint(size_t const n1, size_t const n2, size_t nzmax, size_t sptype)
This constructor creates a new matrix_uint with n1 rows and n2 columns.
static spmatrix_uint ccs(spmatrix_uint const &spMatrix)
C++ version of gsl_spmatrix_uint_ccs().
static int equal(spmatrix_uint const &a, spmatrix_uint const &b)
C++ version of gsl_spmatrix_uint_equal().
This class handles vector_uint objects as shared handles.
Definition: vector_uint.hpp:45
gsl_vector_uint * get()
Get the gsl_vector_uint.
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
Definition: sf_mathieu.hpp:298
double a(int order, double qq)
C++ version of gsl_sf_mathieu_a().
Definition: sf_mathieu.hpp:272
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34