19#ifndef CCGSL_MATRIX_CHAR_HPP
20#define CCGSL_MATRIX_CHAR_HPP
22#include<gsl/gsl_matrix.h>
23#include<gsl/gsl_permute_matrix_char.h>
76 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_char_alloc( n1, n2 );
80 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
82 if( n1 > 0 and n2 > 0 ) gsl_matrix_char_free(
ccgsl_pointer );
99#ifdef __GXX_EXPERIMENTAL_CXX0X__
105 size_t const n1 = initializer_list.size();
106 size_t const n2 = initializer_list.begin()->size();
107 for(
auto l : initializer_list ){
108 if( l.size() != n2 ){
109 gsl::exception e(
"matrix_char rows have unequal sizes", __FILE__, __LINE__,
116 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
118 if( n1 > 0 and n2 > 0 ) gsl_matrix_char_free(
ccgsl_pointer );
125 for(
auto row : initializer_list ){
127 for(
auto x :
row ){
set( r, c, x ); ++c; }
169 gsl_matrix_char_memcpy( copy.
get(),
get() );
214#ifdef __GXX_EXPERIMENTAL_CXX0X__
221 std::swap(
count, v.count );
222 v.ccgsl_pointer =
nullptr;
259 template<
typename container,
typename content,
bool reverse_t>
class iterator_base {
286 static content something;
291 }
else if(
v->ccgsl_pointer == 0 ){
310 static content something_base;
316 }
else if(
v->ccgsl_pointer == 0 ){
327#ifdef __GXX_EXPERIMENTAL_CXX0X__
328 return std::move(
ptr );
359 }
else if(
v->ccgsl_pointer == 0 ){
376 }
else if(
v->ccgsl_pointer == 0 ){
497 :
public iterator_base<matrix_char const,vector_char const,reverse_t>{
710 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_char", __FILE__, __LINE__, GSL_EFAULT );
711#ifndef GSL_RANGE_CHECK_OFF
713 gsl_error(
"matrix_char size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
724 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_char", __FILE__, __LINE__, GSL_EFAULT );
725#ifndef GSL_RANGE_CHECK_OFF
727 gsl_error(
"matrix_char size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
746 gsl_matrix_char_tricpy( Uplo, Diag,
get(), src.
get() );
755 gsl_matrix_char_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
767 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
768 *m = gsl_matrix_char_submatrix(
get(), i, j, n1, n2 ).matrix;
777 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
778 *w = gsl_matrix_char_row(
get(), i ).vector;
787 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
788 *w = gsl_matrix_char_column(
get(), j ).vector;
796 diagonal(){ gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
797 *w = gsl_matrix_char_diagonal(
get() ).vector;
806 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
807 *w = gsl_matrix_char_subdiagonal(
get(), k ).vector;
816 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
817 *w = gsl_matrix_char_superdiagonal(
get(), k ).vector;
828 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
829 *w = gsl_matrix_char_subrow(
get(), i, offset,
n ).vector;
840 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
841 *w = gsl_matrix_char_subcolumn(
get(), j, offset,
n ).vector;
852 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
853 *m = gsl_matrix_char_view_array( base, n1, n2 ).matrix;
865 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
866 *m = gsl_matrix_char_view_array_with_tda( base, n1, n2, tda ).matrix;
877 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
878 *m = gsl_matrix_char_view_vector( v.
get(), n1, n2 ).matrix;
890 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
891 *m = gsl_matrix_char_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
904 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
905 *m = gsl_matrix_char_const_submatrix(
get(), i, j, n1, n2 ).matrix;
914 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
915 *w = gsl_matrix_char_const_row(
get(), i ).vector;
924 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
925 *w = gsl_matrix_char_const_column(
get(), j ).vector;
933 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
934 *w = gsl_matrix_char_const_diagonal(
get() ).vector;
943 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
944 *w = gsl_matrix_char_const_subdiagonal(
get(), k ).vector;
953 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
954 *w = gsl_matrix_char_const_superdiagonal(
get(), k ).vector;
965 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
966 *w = gsl_matrix_char_const_subrow(
get(), i, offset,
n ).vector;
977 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
978 *w = gsl_matrix_char_const_subcolumn(
get(), j, offset,
n ).vector;
990 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
991 *m = gsl_matrix_char_const_submatrix(
get(), i, j, n1, n2 ).matrix;
1000 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1001 *w = gsl_matrix_char_const_row(
get(), i ).vector;
1010 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1011 *w = gsl_matrix_char_const_column(
get(), j ).vector;
1019 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1020 *w = gsl_matrix_char_const_diagonal(
get() ).vector;
1029 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1030 *w = gsl_matrix_char_const_subdiagonal(
get(), k ).vector;
1039 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1040 *w = gsl_matrix_char_const_superdiagonal(
get(), k ).vector;
1051 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1052 *w = gsl_matrix_char_const_subrow(
get(), i, offset,
n ).vector;
1063 gsl_vector_char* w =
static_cast<gsl_vector_char*
>( malloc(
sizeof( gsl_vector_char ) ) );
1064 *w = gsl_matrix_char_const_subcolumn(
get(), j, offset,
n ).vector;
1075 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1076 *m = gsl_matrix_char_const_view_array( base, n1, n2 ).matrix;
1089 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1090 *m = gsl_matrix_char_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1101 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1102 *m = gsl_matrix_char_const_view_vector( v.
get(), n1, n2 ).matrix;
1115 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1116 *m = gsl_matrix_char_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1127 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1128 *m = gsl_matrix_char_const_view_array( base, n1, n2 ).matrix;
1141 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1142 *m = gsl_matrix_char_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1153 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1154 *m = gsl_matrix_char_const_view_vector( v.
get(), n1, n2 ).matrix;
1167 gsl_matrix_char* m =
static_cast<gsl_matrix_char*
>( malloc(
sizeof( gsl_matrix_char ) ) );
1168 *m = gsl_matrix_char_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1212#ifdef __GXX_EXPERIMENTAL_CXX0X__
1244 char max()
const {
return gsl_matrix_char_max(
get() ); }
1249 char min()
const {
return gsl_matrix_char_min(
get() ); }
1255 void minmax(
char* min_out,
char* max_out )
const {
1256 gsl_matrix_char_minmax(
get(), min_out, max_out ); }
1262 void minmax(
char& min_out,
char& max_out )
const {
1263 gsl_matrix_char_minmax(
get(), &min_out, &max_out ); }
1281 int scale(
char const x ){
return gsl_matrix_char_scale(
get(), x ); }
1292 int isnull()
const {
return gsl_matrix_char_isnull(
get() ); }
1297 int ispos()
const {
return gsl_matrix_char_ispos(
get() ); }
1302 int isneg()
const {
return gsl_matrix_char_isneg(
get() ); }
1314 char get(
size_t const i,
size_t const j )
const {
return gsl_matrix_char_get(
get(), i, j ); }
1321 void set(
size_t const i,
size_t const j,
char x ){ gsl_matrix_char_set(
get(), i, j, x ); }
1328 char*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_char_ptr(
get(), i, j ); }
1335 char const*
const_ptr(
size_t const i,
size_t const j )
const {
1336 return gsl_matrix_char_const_ptr(
get(), i, j ); }
1342 int fread( FILE* stream ){
return gsl_matrix_char_fread( stream,
get() ); }
1348 int fwrite( FILE* stream )
const {
return gsl_matrix_char_fwrite( stream,
get() ); }
1354 int fscanf( FILE* stream ){
return gsl_matrix_char_fscanf( stream,
get() ); }
1361 int fprintf( FILE* stream,
char const* format )
const {
1362 return gsl_matrix_char_fprintf( stream,
get(), format ); }
1372 ccgsl_pointer = gsl_matrix_char_alloc_from_block(
b.get(), offset, n1, n2, d2 );
1374 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1390 ccgsl_pointer = gsl_matrix_char_alloc_from_matrix( m.
get(), k1, k2, n1, n2 );
1392 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1410 int swap_rows(
size_t const i,
size_t const j ){
return gsl_matrix_char_swap_rows(
get(), i, j ); }
1418 return gsl_matrix_char_swap_columns(
get(), i, j ); }
1425 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_char_swap_rowcol(
get(), i, j ); }
1437 return gsl_matrix_char_transpose_memcpy(
get(), src.
get() ); }
1444 void max_index(
size_t* imax,
size_t* jmax )
const {
1445 gsl_matrix_char_max_index(
get(), imax, jmax ); }
1451 void min_index(
size_t* imin,
size_t* jmin )
const {
1452 gsl_matrix_char_min_index(
get(), imin, jmin ); }
1460 void minmax_index(
size_t* imin,
size_t* jmin,
size_t* imax,
size_t* jmax )
const {
1461 gsl_matrix_char_minmax_index(
get(), imin, jmin, imax, jmax ); }
1469 gsl_matrix_char_max_index(
get(), &imax, &jmax ); }
1476 gsl_matrix_char_min_index(
get(), &imin, &jmin ); }
1484 void minmax_index(
size_t& imin,
size_t& jmin,
size_t& imax,
size_t& jmax )
const {
1485 gsl_matrix_char_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1493 return gsl_matrix_char_mul_elements(
get(),
b.get() ); }
1501 return gsl_matrix_char_div_elements(
get(),
b.get() ); }
1507 return gsl_matrix_char_norm1(
get() ); }
1514 return gsl_matrix_char_scale_rows(
get(), x.
get() ); }
1521 return gsl_matrix_char_scale_columns(
get(), x.
get() ); }
1528 return gsl_matrix_char_add_diagonal(
get(), x ); }
1536 return gsl_matrix_char_get_row( v.
get(),
get(), i ); }
1544 return gsl_matrix_char_get_col( v.
get(),
get(), j ); }
1552 return gsl_matrix_char_set_row(
get(), i, v.
get() ); }
1560 return gsl_matrix_char_set_col(
get(), j, v.
get() ); }
1575#ifndef GSL_RANGE_CHECK_OFF
1576#ifndef __GXX_EXPERIMENTAL_CXX0X__
1581 gsl_error(
"trying to read beyond last row of matrix_char",
1583#ifdef __GXX_EXPERIMENTAL_CXX0X__
1592 gsl_vector_char_view w = gsl_matrix_char_row(
ccgsl_pointer, i );
1610 gsl_vector_char_view w = gsl_matrix_char_row(
ccgsl_pointer, i );
1621 return gsl_permute_matrix_char( p.
get(),
get() ); }
1627 return vector_char ( gsl_vector_char_alloc_row_from_matrix( m.get(), i ) ); }
1629 return vector_char ( gsl_vector_char_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_chars 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==(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.
const_iterator_t(matrix_char const *v, size_t position)
This constructor allows vector_char to create non-default iterators.
const_iterator_t< reverse_t > & operator=(const_iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
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< reverse_t > operator--(int)
The postfix – operator.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
const_iterator_t< reverse_t > & operator++()
The prefix ++ operator.
We create a suitable class for iterator types here.
vector_char_ptr pointer
An iterator must have a pointer typea.
pointer operator->() const
Dereference the pointer.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
iterator_base()
The iterator is default constructible.
value_type reference
An iterator must have a reference type.
vector_char value_type
An iterator must have a value type.
container * v
Store a pointer to a matrix_char we can iterate over: 0 if no matrix_char.
iterator_base(container *v, size_t position)
This constructor allows vector_char to create non-default iterators.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
size_t position
Mark position of iterator within matrix_char.
reference operator*() const
Dereference the pointer.
void increment()
Increment the iterator.
void decrement()
Decrement the iterator.
A class template for the two non-const iterators.
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< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t(matrix_char *v, size_t position)
This constructor allows vector_char to create non-default iterators.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t< reverse_t > operator--(int)
The postfix – operator.
iterator_t< reverse_t > & operator--()
The prefix – operator.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
This class handles matrix_char objects as shared handles.
int set_row(size_t const i, vector_char const &v)
C++ version of gsl_matrix_char_set_row().
matrix_char 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_char_const_submatrix().
int scale_columns(vector_char const &x)
C++ version of gsl_matrix_char_scale_columns().
const_iterator_t< false > const_iterator
The const_iterator type.
matrix_char clone() const
The clone function.
vector_char row(size_t const i)
C++ version of gsl_matrix_char_row().
vector_char column(size_t const j)
C++ version of gsl_matrix_char_column().
int sub(matrix_char const &b)
C++ version of gsl_matrix_char_sub().
char max() const
C++ version of gsl_matrix_char_max().
matrix_char(size_t const n1, size_t const n2)
This constructor creates a new matrix_char with n1 rows and n2 columns.
int isnull() const
C++ version of gsl_matrix_char_isnull().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_char element.
static matrix_char calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_calloc().
const_iterator end() const
Get iterator pointing beyond last vector_char element.
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_char_max_index().
vector_char const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_char_const_subcolumn().
bool owns_data
Used to allow a vector that does not own its data.
void set(size_t const i, size_t const j, char x)
C++ version of gsl_matrix_char_set().
int get_row(vector_char &v, size_t const i) const
C++ version of gsl_matrix_char_get_row().
gsl_matrix_char const * get() const
Get the gsl_matrix_char.
vector_char const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_char_const_subcolumn().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_char_swap_columns().
static matrix_char view_array(char *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_view_array().
int isneg() const
C++ version of gsl_matrix_char_isneg().
matrix_char(gsl_matrix_char *v)
Could construct from a gsl_matrix_char.
matrix_char()
The default constructor is only really useful for assigning to.
matrix_char(matrix_char &&v)
Move constructor.
int add_constant(char const x)
C++ version of gsl_matrix_char_add_constant().
int memcpy(matrix_char const &src)
C++ version of gsl_matrix_char_memcpy().
reverse_iterator rbegin()
Get iterator pointing to first vector_char element.
int add(matrix_char const &b)
C++ version of gsl_matrix_char_add().
bool unique() const
Find if this is the only object sharing the gsl_matrix_char.
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_char_min_index().
vector_char const row(size_t const i) const
Another C++ version of gsl_matrix_char_const_row().
const_iterator begin() const
Get iterator pointing to first vector_char element.
void reset()
Stop sharing ownership of the shared pointer.
static matrix_char const const_view_array_with_tda(char const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_char_const_view_array_with_tda().
matrix_char(std::initializer_list< std::initializer_list< char > > initializer_list)
Could construct from a std::initializer_list in C++11.
size_t use_count() const
Find how many matrix_char objects share this pointer.
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_char_minmax_index().
static matrix_char const const_view_vector_with_tda(vector_char const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_char_const_view_vector_with_tda().
static matrix_char const view_array_with_tda(char const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_char_const_view_array_with_tda().
reverse_iterator rend()
Get iterator pointing beyond last vector_char element.
char const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_char_const_ptr().
vector_char const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_char_const_subdiagonal().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
iterator_t< true > reverse_iterator
The reverse_iterator type.
char * data()
Give access to the data block_char.
char get(size_t const i, size_t const j) const
C++ version of gsl_matrix_char_get().
size_t size2() const
The number of columns of the matrix_char.
vector_char const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_char_const_subrow().
void minmax(char *min_out, char *max_out) const
C++ version of gsl_matrix_char_minmax().
static matrix_char const const_view_array(char const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_const_view_array().
int add_diagonal(char const x)
C++ version of gsl_matrix_char_add_diagonal().
vector_char const const_diagonal() const
C++ version of gsl_matrix_char_const_diagonal().
vector_char const const_column(size_t const j) const
C++ version of gsl_matrix_char_const_column().
void set_identity()
C++ version of gsl_matrix_char_set_identity().
vector_char subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_char_subcolumn().
matrix_char 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_char_const_submatrix().
size_t * count
The shared reference count.
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_char const &src)
Copy the upper or lower triangular part of matrix src to this.
int permute(permutation &p)
Permute the columns of this by permutation p.
vector_char const const_row(size_t const i) const
C++ version of gsl_matrix_char_const_row().
int fscanf(FILE *stream)
C++ version of gsl_matrix_char_fscanf().
gsl_matrix_char * get()
Get the gsl_matrix_char.
vector_char diagonal()
C++ version of gsl_matrix_char_diagonal().
iterator end()
Get iterator pointing beyond last vector_char element.
matrix_char submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_submatrix().
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_char_swap_rowcol().
int div_elements(matrix_char const &b)
C++ version of gsl_matrix_char_div_elements().
vector_char const diagonal() const
Another C++ version of gsl_matrix_char_const_diagonal().
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_char const &src)
Copy the upper or lower triangular part of matrix src to this.
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_char element.
vector_char subdiagonal(size_t const k)
C++ version of gsl_matrix_char_subdiagonal().
char min() const
C++ version of gsl_matrix_char_min().
int transpose_memcpy(matrix_char const &src)
C++ version of gsl_matrix_char_transpose_memcpy().
vector_char const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_char_const_subrow().
gsl_matrix_char * ccgsl_pointer
The shared pointer.
int get_col(vector_char &v, size_t const j) const
C++ version of gsl_matrix_char_get_col().
int transpose()
C++ version of gsl_matrix_char_transpose().
static matrix_char view_vector_with_tda(vector_char &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_char_view_vector_with_tda().
matrix_char(block_char &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_char_alloc_from_block().
size_t size1() const
The number of rows of the matrix_char.
int set_col(size_t const j, vector_char const &v)
C++ version of gsl_matrix_char_set_col().
matrix_char & operator=(matrix_char const &v)
The assignment operator.
void swap(matrix_char &m)
Swap two matrix_char objects.
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_char_swap_rows().
char norm1() const
C++ version of gsl_matrix_char_norm1().
size_t size_type
A container must have a size_type.
vector_char const column(size_t const j) const
Another C++ version of gsl_matrix_char_const_column().
vector_char subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_char_subrow().
static matrix_char view_array_with_tda(char *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_char_view_array_with_tda().
vector_char operator[](size_t const i)
This function allows us to use a matrix_char like an array.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_char_fprintf().
iterator_t< false > iterator
The iterator type.
char * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_char_ptr().
static matrix_char const view_vector_with_tda(vector_char const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_char_const_view_vector_with_tda().
int scale_rows(vector_char const &x)
C++ version of gsl_matrix_char_scale_rows().
vector_char const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_char_const_superdiagonal().
int fread(FILE *stream)
C++ version of gsl_matrix_char_fread().
int mul_elements(matrix_char const &b)
C++ version of gsl_matrix_char_mul_elements().
matrix_char(matrix_char const &v)
The copy constructor.
void wrap_gsl_matrix_char_without_ownership(gsl_matrix_char *v)
This function is intended mainly for internal use.
void minmax(char &min_out, char &max_out) const
C++ version of gsl_matrix_char_minmax().
iterator begin()
Get iterator pointing to first vector_char element.
char const * data() const
Give access to the data block_char.
int isnonneg() const
C++ version of gsl_matrix_char_isnonneg().
~matrix_char()
The destructor only deletes the pointers if count reaches zero.
vector_char superdiagonal(size_t const k)
C++ version of gsl_matrix_char_superdiagonal().
vector_char const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_char_const_subdiagonal().
static matrix_char const view_array(char const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_char_const_view_array().
matrix_char & operator=(matrix_char &&v)
Move operator.
static matrix_char const const_view_vector(vector_char const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_const_view_vector().
void set_all(char x)
C++ version of gsl_matrix_char_set_all().
vector_char const operator[](size_t const i) const
This function allows us to use a matrix_char like an array.
static matrix_char view_vector(vector_char &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_view_vector().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_char_fwrite().
matrix_char(matrix_char &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_char_alloc_from_matrix().
static matrix_char const view_vector(vector_char const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_char_const_view_vector().
int scale(char const x)
C++ version of gsl_matrix_char_scale().
vector_char const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_char_const_superdiagonal().
int ispos() const
C++ version of gsl_matrix_char_ispos().
void set_zero()
C++ version of gsl_matrix_char_set_zero().
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_char objects as shared handles.
gsl_vector_char * get()
Get the gsl_vector_char.
static vector_char alloc_row_from_matrix(matrix_char &m, size_t const i)
C++ version of gsl_vector_char_alloc_row_from_matrix().
static vector_char alloc_col_from_matrix(matrix_char &m, size_t const j)
C++ version of gsl_vector_char_alloc_col_from_matrix().
vector_char()
The default constructor is only really useful for assigning to.
void wrap_gsl_vector_char_without_ownership(gsl_vector_char *v)
This function is intended mainly for internal use.
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_char & operator*()
Dereference operator.
vector_char_ptr(vector_char const &v)
Typically we have to construct from a vector_char.
vector_char * operator->()
Dereference operator.