19#ifndef CCGSL_MATRIX_LONG_HPP
20#define CCGSL_MATRIX_LONG_HPP
22#include<gsl/gsl_matrix.h>
24#include<gsl/gsl_permute_matrix_long.h>
75 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_long_alloc( n1, n2 );
79 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
81 if( n1 > 0 and n2 > 0 ) gsl_matrix_long_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_long 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_long_free(
ccgsl_pointer );
124 for(
auto row : initializer_list ){
126 for(
auto x :
row ){
set( r, c, x ); ++c; }
168 gsl_matrix_long_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_long const,vector_long const,reverse_t>{
709 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_long", __FILE__, __LINE__, GSL_EFAULT );
710#ifndef GSL_RANGE_CHECK_OFF
712 gsl_error(
"matrix_long size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
723 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_long", __FILE__, __LINE__, GSL_EFAULT );
724#ifndef GSL_RANGE_CHECK_OFF
726 gsl_error(
"matrix_long size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
745 gsl_matrix_long_tricpy( Uplo, Diag,
get(), src.
get() );
754 gsl_matrix_long_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
766 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
767 *m = gsl_matrix_long_submatrix(
get(), i, j, n1, n2 ).matrix;
776 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
777 *w = gsl_matrix_long_row(
get(), i ).vector;
786 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
787 *w = gsl_matrix_long_column(
get(), j ).vector;
795 diagonal(){ gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
796 *w = gsl_matrix_long_diagonal(
get() ).vector;
805 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
806 *w = gsl_matrix_long_subdiagonal(
get(), k ).vector;
815 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
816 *w = gsl_matrix_long_superdiagonal(
get(), k ).vector;
827 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
828 *w = gsl_matrix_long_subrow(
get(), i, offset,
n ).vector;
839 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
840 *w = gsl_matrix_long_subcolumn(
get(), j, offset,
n ).vector;
851 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
852 *m = gsl_matrix_long_view_array( base, n1, n2 ).matrix;
864 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
865 *m = gsl_matrix_long_view_array_with_tda( base, n1, n2, tda ).matrix;
876 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
877 *m = gsl_matrix_long_view_vector( v.
get(), n1, n2 ).matrix;
889 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
890 *m = gsl_matrix_long_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
903 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
904 *m = gsl_matrix_long_const_submatrix(
get(), i, j, n1, n2 ).matrix;
913 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
914 *w = gsl_matrix_long_const_row(
get(), i ).vector;
923 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
924 *w = gsl_matrix_long_const_column(
get(), j ).vector;
932 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
933 *w = gsl_matrix_long_const_diagonal(
get() ).vector;
942 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
943 *w = gsl_matrix_long_const_subdiagonal(
get(), k ).vector;
952 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
953 *w = gsl_matrix_long_const_superdiagonal(
get(), k ).vector;
964 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
965 *w = gsl_matrix_long_const_subrow(
get(), i, offset,
n ).vector;
976 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
977 *w = gsl_matrix_long_const_subcolumn(
get(), j, offset,
n ).vector;
989 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
990 *m = gsl_matrix_long_const_submatrix(
get(), i, j, n1, n2 ).matrix;
999 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1000 *w = gsl_matrix_long_const_row(
get(), i ).vector;
1009 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1010 *w = gsl_matrix_long_const_column(
get(), j ).vector;
1018 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1019 *w = gsl_matrix_long_const_diagonal(
get() ).vector;
1028 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1029 *w = gsl_matrix_long_const_subdiagonal(
get(), k ).vector;
1038 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1039 *w = gsl_matrix_long_const_superdiagonal(
get(), k ).vector;
1050 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1051 *w = gsl_matrix_long_const_subrow(
get(), i, offset,
n ).vector;
1062 gsl_vector_long* w =
static_cast<gsl_vector_long*
>( malloc(
sizeof( gsl_vector_long ) ) );
1063 *w = gsl_matrix_long_const_subcolumn(
get(), j, offset,
n ).vector;
1074 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1075 *m = gsl_matrix_long_const_view_array( base, n1, n2 ).matrix;
1088 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1089 *m = gsl_matrix_long_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1100 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1101 *m = gsl_matrix_long_const_view_vector( v.
get(), n1, n2 ).matrix;
1114 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1115 *m = gsl_matrix_long_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1126 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1127 *m = gsl_matrix_long_const_view_array( base, n1, n2 ).matrix;
1140 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1141 *m = gsl_matrix_long_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1152 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1153 *m = gsl_matrix_long_const_view_vector( v.
get(), n1, n2 ).matrix;
1166 gsl_matrix_long* m =
static_cast<gsl_matrix_long*
>( malloc(
sizeof( gsl_matrix_long ) ) );
1167 *m = gsl_matrix_long_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1211#ifdef __GXX_EXPERIMENTAL_CXX0X__
1243 long max()
const {
return gsl_matrix_long_max(
get() ); }
1248 long min()
const {
return gsl_matrix_long_min(
get() ); }
1254 void minmax(
long* min_out,
long* max_out )
const {
1255 gsl_matrix_long_minmax(
get(), min_out, max_out ); }
1261 void minmax(
long& min_out,
long& max_out )
const {
1262 gsl_matrix_long_minmax(
get(), &min_out, &max_out ); }
1280 int scale(
long const x ){
return gsl_matrix_long_scale(
get(), x ); }
1291 int isnull()
const {
return gsl_matrix_long_isnull(
get() ); }
1296 int ispos()
const {
return gsl_matrix_long_ispos(
get() ); }
1301 int isneg()
const {
return gsl_matrix_long_isneg(
get() ); }
1313 long get(
size_t const i,
size_t const j )
const {
return gsl_matrix_long_get(
get(), i, j ); }
1320 void set(
size_t const i,
size_t const j,
long x ){ gsl_matrix_long_set(
get(), i, j, x ); }
1327 long*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_long_ptr(
get(), i, j ); }
1334 long const*
const_ptr(
size_t const i,
size_t const j )
const {
1335 return gsl_matrix_long_const_ptr(
get(), i, j ); }
1341 int fread( FILE* stream ){
return gsl_matrix_long_fread( stream,
get() ); }
1347 int fwrite( FILE* stream )
const {
return gsl_matrix_long_fwrite( stream,
get() ); }
1353 int fscanf( FILE* stream ){
return gsl_matrix_long_fscanf( stream,
get() ); }
1360 int fprintf( FILE* stream,
char const* format )
const {
1361 return gsl_matrix_long_fprintf( stream,
get(), format ); }
1371 ccgsl_pointer = gsl_matrix_long_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_long_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_long_swap_rows(
get(), i, j ); }
1417 return gsl_matrix_long_swap_columns(
get(), i, j ); }
1424 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_long_swap_rowcol(
get(), i, j ); }
1436 return gsl_matrix_long_transpose_memcpy(
get(), src.
get() ); }
1443 void max_index(
size_t* imax,
size_t* jmax )
const {
1444 gsl_matrix_long_max_index(
get(), imax, jmax ); }
1450 void min_index(
size_t* imin,
size_t* jmin )
const {
1451 gsl_matrix_long_min_index(
get(), imin, jmin ); }
1459 gsl_matrix_long_max_index(
get(), &imax, &jmax ); }
1466 gsl_matrix_long_min_index(
get(), &imin, &jmin ); }
1474 void minmax_index(
size_t& imin,
size_t& jmin,
size_t& imax,
size_t& jmax )
const {
1475 gsl_matrix_long_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1483 return gsl_matrix_long_mul_elements(
get(),
b.get() ); }
1491 return gsl_matrix_long_div_elements(
get(),
b.get() ); }
1497 return gsl_matrix_long_norm1(
get() ); }
1504 return gsl_matrix_long_scale_rows(
get(), x.
get() ); }
1511 return gsl_matrix_long_scale_columns(
get(), x.
get() ); }
1518 return gsl_matrix_long_add_diagonal(
get(), x ); }
1526 return gsl_matrix_long_get_row( v.
get(),
get(), i ); }
1534 return gsl_matrix_long_get_col( v.
get(),
get(), j ); }
1542 return gsl_matrix_long_set_row(
get(), i, v.
get() ); }
1550 return gsl_matrix_long_set_col(
get(), j, v.
get() ); }
1565#ifndef GSL_RANGE_CHECK_OFF
1566#ifndef __GXX_EXPERIMENTAL_CXX0X__
1571 gsl_error(
"trying to read beyond last row of matrix_long",
1573#ifdef __GXX_EXPERIMENTAL_CXX0X__
1582 gsl_vector_long_view w = gsl_matrix_long_row(
ccgsl_pointer, i );
1600 gsl_vector_long_view w = gsl_matrix_long_row(
ccgsl_pointer, i );
1611 return gsl_permute_matrix_long( p.
get(),
get() ); }
1617 return vector_long ( gsl_vector_long_alloc_row_from_matrix( m.get(), i ) ); }
1619 return vector_long ( gsl_vector_long_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_longs 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.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
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< reverse_t > operator--(int)
The postfix – operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
const_iterator_t(matrix_long const *v, size_t position)
This constructor allows vector_long to create non-default iterators.
const_iterator_t()
The default constructor.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
We create a suitable class for iterator types here.
iterator_base()
The iterator is default constructible.
reference operator*() const
Dereference the pointer.
container * v
Store a pointer to a matrix_long we can iterate over: 0 if no matrix_long.
void increment()
Increment the iterator.
value_type reference
An iterator must have a reference type.
size_t position
Mark position of iterator within matrix_long.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
vector_long value_type
An iterator must have a value type.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
pointer operator->() const
Dereference the pointer.
iterator_base(container *v, size_t position)
This constructor allows vector_long to create non-default iterators.
void decrement()
Decrement the iterator.
vector_long_ptr pointer
An iterator must have a pointer typea.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
A class template for the two non-const iterators.
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< reverse_t > operator--(int)
The postfix – operator.
iterator_t< reverse_t > & operator=(iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
iterator_t()
The default constructor.
iterator_t< reverse_t > & operator--()
The prefix – operator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t(matrix_long *v, size_t position)
This constructor allows vector_long to create non-default iterators.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
This class handles matrix_long objects as shared handles.
static matrix_long const const_view_vector_with_tda(vector_long const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_long_const_view_vector_with_tda().
bool owns_data
Used to allow a vector that does not own its data.
static matrix_long const view_array(long const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_long_const_view_array().
int transpose()
C++ version of gsl_matrix_long_transpose().
vector_long const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_long_const_superdiagonal().
const_iterator begin() const
Get iterator pointing to first vector_long element.
matrix_long clone() const
The clone function.
long * data()
Give access to the data block_long.
static matrix_long view_array(long *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_view_array().
long max() const
C++ version of gsl_matrix_long_max().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_long element.
vector_long subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_long_subrow().
int scale_columns(vector_long const &x)
C++ version of gsl_matrix_long_scale_columns().
int fscanf(FILE *stream)
C++ version of gsl_matrix_long_fscanf().
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_long_minmax_index().
gsl_matrix_long * ccgsl_pointer
The shared pointer.
static matrix_long view_vector_with_tda(vector_long &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_long_view_vector_with_tda().
vector_long const operator[](size_t const i) const
This function allows us to use a matrix_long like an array.
static matrix_long const view_array_with_tda(long const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_long_const_view_array_with_tda().
int get_col(vector_long &v, size_t const j) const
C++ version of gsl_matrix_long_get_col().
void set_all(long x)
C++ version of gsl_matrix_long_set_all().
iterator end()
Get iterator pointing beyond last vector_long element.
~matrix_long()
The destructor only deletes the pointers if count reaches zero.
matrix_long(size_t const n1, size_t const n2)
This constructor creates a new matrix_long with n1 rows and n2 columns.
long const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_long_const_ptr().
iterator begin()
Get iterator pointing to first vector_long element.
long get(size_t const i, size_t const j) const
C++ version of gsl_matrix_long_get().
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_long_swap_rowcol().
void set(size_t const i, size_t const j, long x)
C++ version of gsl_matrix_long_set().
long norm1() const
C++ version of gsl_matrix_long_norm1().
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_long_fprintf().
vector_long const diagonal() const
Another C++ version of gsl_matrix_long_const_diagonal().
matrix_long 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_long_const_submatrix().
reverse_iterator rbegin()
Get iterator pointing to first vector_long element.
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_long element.
vector_long const column(size_t const j) const
Another C++ version of gsl_matrix_long_const_column().
static matrix_long const const_view_array(long const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_const_view_array().
size_t use_count() const
Find how many matrix_long objects share this pointer.
static matrix_long view_vector(vector_long &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_view_vector().
int transpose_memcpy(matrix_long const &src)
C++ version of gsl_matrix_long_transpose_memcpy().
static matrix_long view_array_with_tda(long *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_long_view_array_with_tda().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_long_swap_columns().
static matrix_long calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_calloc().
vector_long const const_column(size_t const j) const
C++ version of gsl_matrix_long_const_column().
vector_long diagonal()
C++ version of gsl_matrix_long_diagonal().
int permute(permutation &p)
Permute the columns of this by permutation p.
matrix_long & operator=(matrix_long &&v)
Move operator.
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
static matrix_long const const_view_array_with_tda(long const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_long_const_view_array_with_tda().
vector_long subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_long_subcolumn().
vector_long const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_long_const_subrow().
vector_long superdiagonal(size_t const k)
C++ version of gsl_matrix_long_superdiagonal().
matrix_long(matrix_long const &v)
The copy constructor.
matrix_long(block_long &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_long_alloc_from_block().
void swap(matrix_long &m)
Swap two matrix_long objects.
int ispos() const
C++ version of gsl_matrix_long_ispos().
void minmax(long *min_out, long *max_out) const
C++ version of gsl_matrix_long_minmax().
void set_identity()
C++ version of gsl_matrix_long_set_identity().
iterator_t< true > reverse_iterator
The reverse_iterator type.
matrix_long 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_long_const_submatrix().
vector_long const const_diagonal() const
C++ version of gsl_matrix_long_const_diagonal().
int isnull() const
C++ version of gsl_matrix_long_isnull().
int scale(long const x)
C++ version of gsl_matrix_long_scale().
const_iterator end() const
Get iterator pointing beyond last vector_long element.
long * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_long_ptr().
long const * data() const
Give access to the data block_long.
matrix_long(matrix_long &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_alloc_from_matrix().
vector_long const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_long_const_subdiagonal().
vector_long subdiagonal(size_t const k)
C++ version of gsl_matrix_long_subdiagonal().
void reset()
Stop sharing ownership of the shared pointer.
long min() const
C++ version of gsl_matrix_long_min().
vector_long const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_long_const_subdiagonal().
int isnonneg() const
C++ version of gsl_matrix_long_isnonneg().
vector_long const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_long_const_superdiagonal().
gsl_matrix_long const * get() const
Get the gsl_matrix_long.
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_long const &src)
Copy the upper or lower triangular part of matrix src to this.
reverse_iterator rend()
Get iterator pointing beyond last vector_long element.
matrix_long(matrix_long &&v)
Move constructor.
int scale_rows(vector_long const &x)
C++ version of gsl_matrix_long_scale_rows().
static matrix_long const view_vector_with_tda(vector_long const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_long_const_view_vector_with_tda().
vector_long operator[](size_t const i)
This function allows us to use a matrix_long like an array.
matrix_long(gsl_matrix_long *v)
Could construct from a gsl_matrix_long.
iterator_t< false > iterator
The iterator type.
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_long const &src)
Copy the upper or lower triangular part of matrix src to this.
vector_long const const_row(size_t const i) const
C++ version of gsl_matrix_long_const_row().
matrix_long(std::initializer_list< std::initializer_list< long > > initializer_list)
Could construct from a std::initializer_list in C++11.
int add_constant(long const x)
C++ version of gsl_matrix_long_add_constant().
void wrap_gsl_matrix_long_without_ownership(gsl_matrix_long *v)
This function is intended mainly for internal use.
vector_long const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_long_const_subcolumn().
vector_long column(size_t const j)
C++ version of gsl_matrix_long_column().
int fread(FILE *stream)
C++ version of gsl_matrix_long_fread().
size_t size_type
A container must have a size_type.
static matrix_long const view_vector(vector_long const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_long_const_view_vector().
int set_row(size_t const i, vector_long const &v)
C++ version of gsl_matrix_long_set_row().
vector_long const row(size_t const i) const
Another C++ version of gsl_matrix_long_const_row().
vector_long row(size_t const i)
C++ version of gsl_matrix_long_row().
size_t * count
The shared reference count.
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_long_max_index().
int sub(matrix_long const &b)
C++ version of gsl_matrix_long_sub().
int isneg() const
C++ version of gsl_matrix_long_isneg().
int add_diagonal(long const x)
C++ version of gsl_matrix_long_add_diagonal().
matrix_long()
The default constructor is only really useful for assigning to.
static matrix_long const const_view_vector(vector_long const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_const_view_vector().
int div_elements(matrix_long const &b)
C++ version of gsl_matrix_long_div_elements().
gsl_matrix_long * get()
Get the gsl_matrix_long.
void set_zero()
C++ version of gsl_matrix_long_set_zero().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_long_fwrite().
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_long_min_index().
int memcpy(matrix_long const &src)
C++ version of gsl_matrix_long_memcpy().
vector_long const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_long_const_subrow().
int set_col(size_t const j, vector_long const &v)
C++ version of gsl_matrix_long_set_col().
void minmax(long &min_out, long &max_out) const
C++ version of gsl_matrix_long_minmax().
matrix_long & operator=(matrix_long const &v)
The assignment operator.
int add(matrix_long const &b)
C++ version of gsl_matrix_long_add().
int mul_elements(matrix_long const &b)
C++ version of gsl_matrix_long_mul_elements().
size_t size2() const
The number of columns of the matrix_long.
const_iterator_t< false > const_iterator
The const_iterator type.
size_t size1() const
The number of rows of the matrix_long.
int get_row(vector_long &v, size_t const i) const
C++ version of gsl_matrix_long_get_row().
vector_long const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_long_const_subcolumn().
matrix_long submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_long_submatrix().
bool unique() const
Find if this is the only object sharing the gsl_matrix_long.
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_long_swap_rows().
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_long objects as shared handles.
static vector_long alloc_row_from_matrix(matrix_long &m, size_t const i)
C++ version of gsl_vector_long_alloc_row_from_matrix().
void wrap_gsl_vector_long_without_ownership(gsl_vector_long *v)
This function is intended mainly for internal use.
vector_long()
The default constructor is only really useful for assigning to.
static vector_long alloc_col_from_matrix(matrix_long &m, size_t const j)
C++ version of gsl_vector_long_alloc_col_from_matrix().
gsl_vector_long * get()
Get the gsl_vector_long.
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_long * operator->()
Dereference operator.
vector_long & operator*()
Dereference operator.
vector_long_ptr(vector_long const &v)
Typically we have to construct from a vector_long.