19#ifndef CCGSL_MATRIX_ULONG_HPP
20#define CCGSL_MATRIX_ULONG_HPP
22#include<gsl/gsl_matrix.h>
24#include<gsl/gsl_permute_matrix_ulong.h>
75 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_ulong_alloc( n1, n2 );
79 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
81 if( n1 > 0 and n2 > 0 ) gsl_matrix_ulong_free(
ccgsl_pointer );
98#ifdef __GXX_EXPERIMENTAL_CXX0X__
104 size_t const n1 = initializer_list.size();
105 size_t const n2 = initializer_list.begin()->size();
106 for(
auto l : initializer_list ){
107 if( l.size() != n2 ){
108 gsl::exception e(
"matrix_ulong rows have unequal sizes", __FILE__, __LINE__,
115 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
117 if( n1 > 0 and n2 > 0 ) gsl_matrix_ulong_free(
ccgsl_pointer );
124 for(
auto row : initializer_list ){
126 for(
auto x :
row ){
set( r, c, x ); ++c; }
168 gsl_matrix_ulong_memcpy( copy.
get(),
get() );
213#ifdef __GXX_EXPERIMENTAL_CXX0X__
220 std::swap(
count, v.count );
221 v.ccgsl_pointer =
nullptr;
258 template<
typename container,
typename content,
bool reverse_t>
class iterator_base {
285 static content something;
290 }
else if(
v->ccgsl_pointer == 0 ){
309 static content something_base;
315 }
else if(
v->ccgsl_pointer == 0 ){
326#ifdef __GXX_EXPERIMENTAL_CXX0X__
327 return std::move(
ptr );
358 }
else if(
v->ccgsl_pointer == 0 ){
375 }
else if(
v->ccgsl_pointer == 0 ){
496 :
public iterator_base<matrix_ulong const,vector_ulong const,reverse_t>{
709 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_ulong", __FILE__, __LINE__, GSL_EFAULT );
710#ifndef GSL_RANGE_CHECK_OFF
712 gsl_error(
"matrix_ulong size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
722 unsigned long const*
data()
const {
723 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_ulong", __FILE__, __LINE__, GSL_EFAULT );
724#ifndef GSL_RANGE_CHECK_OFF
726 gsl_error(
"matrix_ulong size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
745 gsl_matrix_ulong_tricpy( Uplo, Diag,
get(), src.
get() );
754 gsl_matrix_ulong_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
766 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
767 *m = gsl_matrix_ulong_submatrix(
get(), i, j, n1, n2 ).matrix;
776 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
777 *w = gsl_matrix_ulong_row(
get(), i ).vector;
786 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
787 *w = gsl_matrix_ulong_column(
get(), j ).vector;
795 diagonal(){ gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
796 *w = gsl_matrix_ulong_diagonal(
get() ).vector;
805 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
806 *w = gsl_matrix_ulong_subdiagonal(
get(), k ).vector;
815 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
816 *w = gsl_matrix_ulong_superdiagonal(
get(), k ).vector;
827 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
828 *w = gsl_matrix_ulong_subrow(
get(), i, offset,
n ).vector;
839 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
840 *w = gsl_matrix_ulong_subcolumn(
get(), j, offset,
n ).vector;
851 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
852 *m = gsl_matrix_ulong_view_array( base, n1, n2 ).matrix;
864 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
865 *m = gsl_matrix_ulong_view_array_with_tda( base, n1, n2, tda ).matrix;
876 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
877 *m = gsl_matrix_ulong_view_vector( v.
get(), n1, n2 ).matrix;
889 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
890 *m = gsl_matrix_ulong_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
903 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
904 *m = gsl_matrix_ulong_const_submatrix(
get(), i, j, n1, n2 ).matrix;
913 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
914 *w = gsl_matrix_ulong_const_row(
get(), i ).vector;
923 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
924 *w = gsl_matrix_ulong_const_column(
get(), j ).vector;
932 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
933 *w = gsl_matrix_ulong_const_diagonal(
get() ).vector;
942 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
943 *w = gsl_matrix_ulong_const_subdiagonal(
get(), k ).vector;
952 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
953 *w = gsl_matrix_ulong_const_superdiagonal(
get(), k ).vector;
964 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
965 *w = gsl_matrix_ulong_const_subrow(
get(), i, offset,
n ).vector;
976 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
977 *w = gsl_matrix_ulong_const_subcolumn(
get(), j, offset,
n ).vector;
989 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
990 *m = gsl_matrix_ulong_const_submatrix(
get(), i, j, n1, n2 ).matrix;
999 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1000 *w = gsl_matrix_ulong_const_row(
get(), i ).vector;
1009 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1010 *w = gsl_matrix_ulong_const_column(
get(), j ).vector;
1018 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1019 *w = gsl_matrix_ulong_const_diagonal(
get() ).vector;
1028 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1029 *w = gsl_matrix_ulong_const_subdiagonal(
get(), k ).vector;
1038 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1039 *w = gsl_matrix_ulong_const_superdiagonal(
get(), k ).vector;
1050 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1051 *w = gsl_matrix_ulong_const_subrow(
get(), i, offset,
n ).vector;
1062 gsl_vector_ulong* w =
static_cast<gsl_vector_ulong*
>( malloc(
sizeof( gsl_vector_ulong ) ) );
1063 *w = gsl_matrix_ulong_const_subcolumn(
get(), j, offset,
n ).vector;
1074 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1075 *m = gsl_matrix_ulong_const_view_array( base, n1, n2 ).matrix;
1088 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1089 *m = gsl_matrix_ulong_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1100 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1101 *m = gsl_matrix_ulong_const_view_vector( v.
get(), n1, n2 ).matrix;
1114 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1115 *m = gsl_matrix_ulong_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1126 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1127 *m = gsl_matrix_ulong_const_view_array( base, n1, n2 ).matrix;
1140 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1141 *m = gsl_matrix_ulong_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1152 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1153 *m = gsl_matrix_ulong_const_view_vector( v.
get(), n1, n2 ).matrix;
1166 gsl_matrix_ulong* m =
static_cast<gsl_matrix_ulong*
>( malloc(
sizeof( gsl_matrix_ulong ) ) );
1167 *m = gsl_matrix_ulong_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1211#ifdef __GXX_EXPERIMENTAL_CXX0X__
1232 void set_all(
unsigned long x ){ gsl_matrix_ulong_set_all(
get(), x ); }
1243 unsigned long max()
const {
return gsl_matrix_ulong_max(
get() ); }
1248 unsigned long min()
const {
return gsl_matrix_ulong_min(
get() ); }
1254 void minmax(
unsigned long* min_out,
unsigned long* max_out )
const {
1255 gsl_matrix_ulong_minmax(
get(), min_out, max_out ); }
1261 void minmax(
unsigned long& min_out,
unsigned long& max_out )
const {
1262 gsl_matrix_ulong_minmax(
get(), &min_out, &max_out ); }
1280 int scale(
unsigned long const x ){
return gsl_matrix_ulong_scale(
get(), x ); }
1286 int add_constant(
unsigned long const x ){
return gsl_matrix_ulong_add_constant(
get(), x ); }
1291 int isnull()
const {
return gsl_matrix_ulong_isnull(
get() ); }
1296 int ispos()
const {
return gsl_matrix_ulong_ispos(
get() ); }
1301 int isneg()
const {
return gsl_matrix_ulong_isneg(
get() ); }
1313 unsigned long get(
size_t const i,
size_t const j )
const {
return gsl_matrix_ulong_get(
get(), i, j ); }
1320 void set(
size_t const i,
size_t const j,
unsigned long x ){ gsl_matrix_ulong_set(
get(), i, j, x ); }
1327 unsigned long*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_ulong_ptr(
get(), i, j ); }
1334 unsigned long const*
const_ptr(
size_t const i,
size_t const j )
const {
1335 return gsl_matrix_ulong_const_ptr(
get(), i, j ); }
1341 int fread( FILE* stream ){
return gsl_matrix_ulong_fread( stream,
get() ); }
1347 int fwrite( FILE* stream )
const {
return gsl_matrix_ulong_fwrite( stream,
get() ); }
1353 int fscanf( FILE* stream ){
return gsl_matrix_ulong_fscanf( stream,
get() ); }
1360 int fprintf( FILE* stream,
char const* format )
const {
1361 return gsl_matrix_ulong_fprintf( stream,
get(), format ); }
1371 ccgsl_pointer = gsl_matrix_ulong_alloc_from_block(
b.get(), offset, n1, n2, d2 );
1373 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1389 ccgsl_pointer = gsl_matrix_ulong_alloc_from_matrix( m.
get(), k1, k2, n1, n2 );
1391 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1409 int swap_rows(
size_t const i,
size_t const j ){
return gsl_matrix_ulong_swap_rows(
get(), i, j ); }
1417 return gsl_matrix_ulong_swap_columns(
get(), i, j ); }
1424 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_ulong_swap_rowcol(
get(), i, j ); }
1436 return gsl_matrix_ulong_transpose_memcpy(
get(), src.
get() ); }
1443 void max_index(
size_t* imax,
size_t* jmax )
const {
1444 gsl_matrix_ulong_max_index(
get(), imax, jmax ); }
1450 void min_index(
size_t* imin,
size_t* jmin )
const {
1451 gsl_matrix_ulong_min_index(
get(), imin, jmin ); }
1459 void minmax_index(
size_t* imin,
size_t* jmin,
size_t* imax,
size_t* jmax )
const {
1460 gsl_matrix_ulong_minmax_index(
get(), imin, jmin, imax, jmax ); }
1468 gsl_matrix_ulong_max_index(
get(), &imax, &jmax ); }
1475 gsl_matrix_ulong_min_index(
get(), &imin, &jmin ); }
1483 void minmax_index(
size_t& imin,
size_t& jmin,
size_t& imax,
size_t& jmax )
const {
1484 gsl_matrix_ulong_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1492 return gsl_matrix_ulong_mul_elements(
get(),
b.get() ); }
1500 return gsl_matrix_ulong_div_elements(
get(),
b.get() ); }
1506 return gsl_matrix_ulong_norm1(
get() ); }
1513 return gsl_matrix_ulong_scale_rows(
get(), x.
get() ); }
1520 return gsl_matrix_ulong_scale_columns(
get(), x.
get() ); }
1527 return gsl_matrix_ulong_add_diagonal(
get(), x ); }
1535 return gsl_matrix_ulong_get_row( v.
get(),
get(), i ); }
1543 return gsl_matrix_ulong_get_col( v.
get(),
get(), j ); }
1551 return gsl_matrix_ulong_set_row(
get(), i, v.
get() ); }
1559 return gsl_matrix_ulong_set_col(
get(), j, v.
get() ); }
1574#ifndef GSL_RANGE_CHECK_OFF
1575#ifndef __GXX_EXPERIMENTAL_CXX0X__
1580 gsl_error(
"trying to read beyond last row of matrix_ulong",
1582#ifdef __GXX_EXPERIMENTAL_CXX0X__
1591 gsl_vector_ulong_view w = gsl_matrix_ulong_row(
ccgsl_pointer, i );
1609 gsl_vector_ulong_view w = gsl_matrix_ulong_row(
ccgsl_pointer, i );
1620 return gsl_permute_matrix_ulong( p.
get(),
get() ); }
1626 return vector_ulong ( gsl_vector_ulong_alloc_row_from_matrix( m.get(), i ) ); }
1628 return vector_ulong ( gsl_vector_ulong_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_ulongs as shared handles.
This class is used to handle gsl exceptions so that gsl can use these rather than the GSL error handl...
@ GSL_EFAILED
generic failure
@ GSL_EINVAL
invalid argument supplied by user
@ GSL_EBADLEN
matrix, vector lengths are not conformant
@ GSL_EFAULT
invalid pointer
A class template for the const iterators.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
const_iterator_t< reverse_t > & operator++()
The prefix ++ operator.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
const_iterator_t< reverse_t > & operator=(const_iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
const_iterator_t(matrix_ulong const *v, size_t position)
This constructor allows vector_ulong to create non-default iterators.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t()
The default constructor.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > operator--(int)
The postfix – operator.
We create a suitable class for iterator types here.
vector_ulong_ptr pointer
An iterator must have a pointer typea.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
void increment()
Increment the iterator.
pointer operator->() const
Dereference the pointer.
vector_ulong value_type
An iterator must have a value type.
void decrement()
Decrement the iterator.
container * v
Store a pointer to a matrix_ulong we can iterate over: 0 if no matrix_ulong.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
size_t position
Mark position of iterator within matrix_ulong.
value_type reference
An iterator must have a reference type.
iterator_base()
The iterator is default constructible.
reference operator*() const
Dereference the pointer.
iterator_base(container *v, size_t position)
This constructor allows vector_ulong to create non-default iterators.
A class template for the two non-const iterators.
iterator_t< reverse_t > & operator--()
The prefix – operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t()
The default constructor.
iterator_t< reverse_t > & operator=(iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
iterator_t(matrix_ulong *v, size_t position)
This constructor allows vector_ulong to create non-default iterators.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t< reverse_t > operator--(int)
The postfix – operator.
This class handles matrix_ulong objects as shared handles.
reverse_iterator rend()
Get iterator pointing beyond last vector_ulong element.
size_t use_count() const
Find how many matrix_ulong objects share this pointer.
size_t size1() const
The number of rows of the matrix_ulong.
unsigned long norm1() const
C++ version of gsl_matrix_ulong_norm1().
int fread(FILE *stream)
C++ version of gsl_matrix_ulong_fread().
size_t size_type
A container must have a size_type.
vector_ulong const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_ulong_const_superdiagonal().
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_ulong_min_index().
unsigned long min() const
C++ version of gsl_matrix_ulong_min().
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_ulong_max_index().
gsl_matrix_ulong * ccgsl_pointer
The shared pointer.
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_ulong_swap_columns().
static matrix_ulong view_vector(vector_ulong &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_view_vector().
void minmax(unsigned long &min_out, unsigned long &max_out) const
C++ version of gsl_matrix_ulong_minmax().
size_t size2() const
The number of columns of the matrix_ulong.
void reset()
Stop sharing ownership of the shared pointer.
gsl_matrix_ulong const * get() const
Get the gsl_matrix_ulong.
bool owns_data
Used to allow a vector that does not own its data.
static matrix_ulong calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_calloc().
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_ulong_minmax_index().
void set(size_t const i, size_t const j, unsigned long x)
C++ version of gsl_matrix_ulong_set().
vector_ulong const const_row(size_t const i) const
C++ version of gsl_matrix_ulong_const_row().
int scale_rows(vector_ulong const &x)
C++ version of gsl_matrix_ulong_scale_rows().
vector_ulong const operator[](size_t const i) const
This function allows us to use a matrix_ulong like an array.
matrix_ulong(matrix_ulong &&v)
Move constructor.
static matrix_ulong const const_view_vector(vector_ulong const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_const_view_vector().
static matrix_ulong const const_view_array(unsigned long const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_const_view_array().
matrix_ulong clone() const
The clone function.
vector_ulong const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_ulong_const_subcolumn().
vector_ulong subdiagonal(size_t const k)
C++ version of gsl_matrix_ulong_subdiagonal().
unsigned long max() const
C++ version of gsl_matrix_ulong_max().
const_iterator end() const
Get iterator pointing beyond last vector_ulong element.
unsigned long get(size_t const i, size_t const j) const
C++ version of gsl_matrix_ulong_get().
vector_ulong const const_column(size_t const j) const
C++ version of gsl_matrix_ulong_const_column().
int transpose()
C++ version of gsl_matrix_ulong_transpose().
int mul_elements(matrix_ulong const &b)
C++ version of gsl_matrix_ulong_mul_elements().
const_iterator begin() const
Get iterator pointing to first vector_ulong element.
int set_row(size_t const i, vector_ulong const &v)
C++ version of gsl_matrix_ulong_set_row().
matrix_ulong submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_submatrix().
int fscanf(FILE *stream)
C++ version of gsl_matrix_ulong_fscanf().
iterator_t< false > iterator
The iterator type.
vector_ulong const row(size_t const i) const
Another C++ version of gsl_matrix_ulong_const_row().
vector_ulong superdiagonal(size_t const k)
C++ version of gsl_matrix_ulong_superdiagonal().
void wrap_gsl_matrix_ulong_without_ownership(gsl_matrix_ulong *v)
This function is intended mainly for internal use.
int isneg() const
C++ version of gsl_matrix_ulong_isneg().
void set_identity()
C++ version of gsl_matrix_ulong_set_identity().
unsigned long const * data() const
Give access to the data block_ulong.
unsigned long const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_ulong_const_ptr().
matrix_ulong(matrix_ulong &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_alloc_from_matrix().
vector_ulong const diagonal() const
Another C++ version of gsl_matrix_ulong_const_diagonal().
static matrix_ulong view_array_with_tda(unsigned long *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ulong_view_array_with_tda().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_ulong_fwrite().
int scale_columns(vector_ulong const &x)
C++ version of gsl_matrix_ulong_scale_columns().
int isnonneg() const
C++ version of gsl_matrix_ulong_isnonneg().
static matrix_ulong const view_vector(vector_ulong const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_ulong_const_view_vector().
vector_ulong subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_ulong_subcolumn().
int div_elements(matrix_ulong const &b)
C++ version of gsl_matrix_ulong_div_elements().
reverse_iterator rbegin()
Get iterator pointing to first vector_ulong element.
matrix_ulong(std::initializer_list< std::initializer_list< unsigned long > > initializer_list)
Could construct from a std::initializer_list in C++11.
matrix_ulong const submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2) const
Another C++ version of gsl_matrix_ulong_const_submatrix().
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_ulong_swap_rows().
vector_ulong const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_ulong_const_subrow().
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_ulong_swap_rowcol().
static matrix_ulong const const_view_vector_with_tda(vector_ulong const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ulong_const_view_vector_with_tda().
gsl_matrix_ulong * get()
Get the gsl_matrix_ulong.
matrix_ulong(gsl_matrix_ulong *v)
Could construct from a gsl_matrix_ulong.
static matrix_ulong const view_vector_with_tda(vector_ulong const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_ulong_const_view_vector_with_tda().
matrix_ulong(matrix_ulong const &v)
The copy constructor.
iterator end()
Get iterator pointing beyond last vector_ulong element.
int get_row(vector_ulong &v, size_t const i) const
C++ version of gsl_matrix_ulong_get_row().
int transpose_memcpy(matrix_ulong const &src)
C++ version of gsl_matrix_ulong_transpose_memcpy().
matrix_ulong const const_submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2) const
C++ version of gsl_matrix_ulong_const_submatrix().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_ulong element.
int get_col(vector_ulong &v, size_t const j) const
C++ version of gsl_matrix_ulong_get_col().
int add_constant(unsigned long const x)
C++ version of gsl_matrix_ulong_add_constant().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_ulong element.
~matrix_ulong()
The destructor only deletes the pointers if count reaches zero.
int add(matrix_ulong const &b)
C++ version of gsl_matrix_ulong_add().
int set_col(size_t const j, vector_ulong const &v)
C++ version of gsl_matrix_ulong_set_col().
vector_ulong operator[](size_t const i)
This function allows us to use a matrix_ulong like an array.
int permute(permutation &p)
Permute the columns of this by permutation p.
vector_ulong const const_diagonal() const
C++ version of gsl_matrix_ulong_const_diagonal().
static matrix_ulong const view_array(unsigned long const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_ulong_const_view_array().
vector_ulong const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_ulong_const_subdiagonal().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
vector_ulong subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_ulong_subrow().
size_t * count
The shared reference count.
int sub(matrix_ulong const &b)
C++ version of gsl_matrix_ulong_sub().
static matrix_ulong view_array(unsigned long *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ulong_view_array().
void set_all(unsigned long x)
C++ version of gsl_matrix_ulong_set_all().
unsigned long * data()
Give access to the data block_ulong.
void minmax(unsigned long *min_out, unsigned long *max_out) const
C++ version of gsl_matrix_ulong_minmax().
int memcpy(matrix_ulong const &src)
C++ version of gsl_matrix_ulong_memcpy().
static matrix_ulong const view_array_with_tda(unsigned long const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_ulong_const_view_array_with_tda().
int isnull() const
C++ version of gsl_matrix_ulong_isnull().
int ispos() const
C++ version of gsl_matrix_ulong_ispos().
vector_ulong column(size_t const j)
C++ version of gsl_matrix_ulong_column().
matrix_ulong & operator=(matrix_ulong const &v)
The assignment operator.
vector_ulong const column(size_t const j) const
Another C++ version of gsl_matrix_ulong_const_column().
void set_zero()
C++ version of gsl_matrix_ulong_set_zero().
vector_ulong const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_ulong_const_superdiagonal().
matrix_ulong(size_t const n1, size_t const n2)
This constructor creates a new matrix_ulong with n1 rows and n2 columns.
vector_ulong const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_ulong_const_subrow().
int scale(unsigned long const x)
C++ version of gsl_matrix_ulong_scale().
unsigned long * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_ulong_ptr().
matrix_ulong & operator=(matrix_ulong &&v)
Move operator.
vector_ulong const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_ulong_const_subdiagonal().
static matrix_ulong view_vector_with_tda(vector_ulong &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ulong_view_vector_with_tda().
int add_diagonal(unsigned long const x)
C++ version of gsl_matrix_ulong_add_diagonal().
vector_ulong row(size_t const i)
C++ version of gsl_matrix_ulong_row().
matrix_ulong(block_ulong &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_ulong_alloc_from_block().
iterator begin()
Get iterator pointing to first vector_ulong element.
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_ulong const &src)
Copy the upper or lower triangular part of matrix src to this.
iterator_t< true > reverse_iterator
The reverse_iterator type.
const_iterator_t< false > const_iterator
The const_iterator type.
void swap(matrix_ulong &m)
Swap two matrix_ulong objects.
matrix_ulong()
The default constructor is only really useful for assigning to.
vector_ulong const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_ulong_const_subcolumn().
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_ulong const &src)
Copy the upper or lower triangular part of matrix src to this.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_ulong_fprintf().
static matrix_ulong const const_view_array_with_tda(unsigned long const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ulong_const_view_array_with_tda().
bool unique() const
Find if this is the only object sharing the gsl_matrix_ulong.
vector_ulong diagonal()
C++ version of gsl_matrix_ulong_diagonal().
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_ulong objects as shared handles.
void wrap_gsl_vector_ulong_without_ownership(gsl_vector_ulong *v)
This function is intended mainly for internal use.
vector_ulong()
The default constructor is only really useful for assigning to.
static vector_ulong alloc_row_from_matrix(matrix_ulong &m, size_t const i)
C++ version of gsl_vector_ulong_alloc_row_from_matrix().
static vector_ulong alloc_col_from_matrix(matrix_ulong &m, size_t const j)
C++ version of gsl_vector_ulong_alloc_col_from_matrix().
gsl_vector_ulong * get()
Get the gsl_vector_ulong.
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
gsl_sf_result result
Typedef for gsl_sf_result.
The gsl package creates an interface to the GNU Scientific Library for C++.
This is a pointer-like type for iterator return values.
vector_ulong & operator*()
Dereference operator.
vector_ulong_ptr(vector_ulong const &v)
Typically we have to construct from a vector_ulong.
vector_ulong * operator->()
Dereference operator.