19#ifndef CCGSL_MATRIX_UCHAR_HPP
20#define CCGSL_MATRIX_UCHAR_HPP
22#include<gsl/gsl_matrix.h>
24#include<gsl/gsl_permute_matrix_uchar.h>
75 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_uchar_alloc( n1, n2 );
79 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
81 if( n1 > 0 and n2 > 0 ) gsl_matrix_uchar_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_uchar 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_uchar_free(
ccgsl_pointer );
124 for(
auto row : initializer_list ){
126 for(
auto x :
row ){
set( r, c, x ); ++c; }
168 gsl_matrix_uchar_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_uchar const,vector_uchar const,reverse_t>{
709 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_uchar", __FILE__, __LINE__, GSL_EFAULT );
710#ifndef GSL_RANGE_CHECK_OFF
712 gsl_error(
"matrix_uchar size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
722 unsigned char const*
data()
const {
723 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_uchar", __FILE__, __LINE__, GSL_EFAULT );
724#ifndef GSL_RANGE_CHECK_OFF
726 gsl_error(
"matrix_uchar size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
745 gsl_matrix_uchar_tricpy( Uplo, Diag,
get(), src.
get() );
754 gsl_matrix_uchar_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
766 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
767 *m = gsl_matrix_uchar_submatrix(
get(), i, j, n1, n2 ).matrix;
776 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
777 *w = gsl_matrix_uchar_row(
get(), i ).vector;
786 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
787 *w = gsl_matrix_uchar_column(
get(), j ).vector;
795 diagonal(){ gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
796 *w = gsl_matrix_uchar_diagonal(
get() ).vector;
805 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
806 *w = gsl_matrix_uchar_subdiagonal(
get(), k ).vector;
815 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
816 *w = gsl_matrix_uchar_superdiagonal(
get(), k ).vector;
827 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
828 *w = gsl_matrix_uchar_subrow(
get(), i, offset,
n ).vector;
839 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
840 *w = gsl_matrix_uchar_subcolumn(
get(), j, offset,
n ).vector;
851 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
852 *m = gsl_matrix_uchar_view_array( base, n1, n2 ).matrix;
864 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
865 *m = gsl_matrix_uchar_view_array_with_tda( base, n1, n2, tda ).matrix;
876 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
877 *m = gsl_matrix_uchar_view_vector( v.
get(), n1, n2 ).matrix;
889 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
890 *m = gsl_matrix_uchar_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
903 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
904 *m = gsl_matrix_uchar_const_submatrix(
get(), i, j, n1, n2 ).matrix;
913 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
914 *w = gsl_matrix_uchar_const_row(
get(), i ).vector;
923 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
924 *w = gsl_matrix_uchar_const_column(
get(), j ).vector;
932 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
933 *w = gsl_matrix_uchar_const_diagonal(
get() ).vector;
942 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
943 *w = gsl_matrix_uchar_const_subdiagonal(
get(), k ).vector;
952 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
953 *w = gsl_matrix_uchar_const_superdiagonal(
get(), k ).vector;
964 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
965 *w = gsl_matrix_uchar_const_subrow(
get(), i, offset,
n ).vector;
976 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
977 *w = gsl_matrix_uchar_const_subcolumn(
get(), j, offset,
n ).vector;
989 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
990 *m = gsl_matrix_uchar_const_submatrix(
get(), i, j, n1, n2 ).matrix;
999 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1000 *w = gsl_matrix_uchar_const_row(
get(), i ).vector;
1009 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1010 *w = gsl_matrix_uchar_const_column(
get(), j ).vector;
1018 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1019 *w = gsl_matrix_uchar_const_diagonal(
get() ).vector;
1028 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1029 *w = gsl_matrix_uchar_const_subdiagonal(
get(), k ).vector;
1038 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1039 *w = gsl_matrix_uchar_const_superdiagonal(
get(), k ).vector;
1050 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1051 *w = gsl_matrix_uchar_const_subrow(
get(), i, offset,
n ).vector;
1062 gsl_vector_uchar* w =
static_cast<gsl_vector_uchar*
>( malloc(
sizeof( gsl_vector_uchar ) ) );
1063 *w = gsl_matrix_uchar_const_subcolumn(
get(), j, offset,
n ).vector;
1074 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1075 *m = gsl_matrix_uchar_const_view_array( base, n1, n2 ).matrix;
1088 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1089 *m = gsl_matrix_uchar_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1100 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1101 *m = gsl_matrix_uchar_const_view_vector( v.
get(), n1, n2 ).matrix;
1114 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1115 *m = gsl_matrix_uchar_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1126 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1127 *m = gsl_matrix_uchar_const_view_array( base, n1, n2 ).matrix;
1140 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1141 *m = gsl_matrix_uchar_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1152 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1153 *m = gsl_matrix_uchar_const_view_vector( v.
get(), n1, n2 ).matrix;
1166 gsl_matrix_uchar* m =
static_cast<gsl_matrix_uchar*
>( malloc(
sizeof( gsl_matrix_uchar ) ) );
1167 *m = gsl_matrix_uchar_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1211#ifdef __GXX_EXPERIMENTAL_CXX0X__
1232 void set_all(
unsigned char x ){ gsl_matrix_uchar_set_all(
get(), x ); }
1243 unsigned char max()
const {
return gsl_matrix_uchar_max(
get() ); }
1248 unsigned char min()
const {
return gsl_matrix_uchar_min(
get() ); }
1254 void minmax(
unsigned char* min_out,
unsigned char* max_out )
const {
1255 gsl_matrix_uchar_minmax(
get(), min_out, max_out ); }
1261 void minmax(
unsigned char& min_out,
unsigned char& max_out )
const {
1262 gsl_matrix_uchar_minmax(
get(), &min_out, &max_out ); }
1280 int scale(
unsigned char const x ){
return gsl_matrix_uchar_scale(
get(), x ); }
1286 int add_constant(
unsigned char const x ){
return gsl_matrix_uchar_add_constant(
get(), x ); }
1291 int isnull()
const {
return gsl_matrix_uchar_isnull(
get() ); }
1296 int ispos()
const {
return gsl_matrix_uchar_ispos(
get() ); }
1301 int isneg()
const {
return gsl_matrix_uchar_isneg(
get() ); }
1313 unsigned char get(
size_t const i,
size_t const j )
const {
return gsl_matrix_uchar_get(
get(), i, j ); }
1320 void set(
size_t const i,
size_t const j,
unsigned char x ){ gsl_matrix_uchar_set(
get(), i, j, x ); }
1327 unsigned char*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_uchar_ptr(
get(), i, j ); }
1334 unsigned char const*
const_ptr(
size_t const i,
size_t const j )
const {
1335 return gsl_matrix_uchar_const_ptr(
get(), i, j ); }
1341 int fread( FILE* stream ){
return gsl_matrix_uchar_fread( stream,
get() ); }
1347 int fwrite( FILE* stream )
const {
return gsl_matrix_uchar_fwrite( stream,
get() ); }
1353 int fscanf( FILE* stream ){
return gsl_matrix_uchar_fscanf( stream,
get() ); }
1360 int fprintf( FILE* stream,
char const* format )
const {
1361 return gsl_matrix_uchar_fprintf( stream,
get(), format ); }
1371 ccgsl_pointer = gsl_matrix_uchar_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_uchar_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_uchar_swap_rows(
get(), i, j ); }
1417 return gsl_matrix_uchar_swap_columns(
get(), i, j ); }
1424 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_uchar_swap_rowcol(
get(), i, j ); }
1436 return gsl_matrix_uchar_transpose_memcpy(
get(), src.
get() ); }
1443 void max_index(
size_t* imax,
size_t* jmax )
const {
1444 gsl_matrix_uchar_max_index(
get(), imax, jmax ); }
1450 void min_index(
size_t* imin,
size_t* jmin )
const {
1451 gsl_matrix_uchar_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_uchar_minmax_index(
get(), imin, jmin, imax, jmax ); }
1468 gsl_matrix_uchar_max_index(
get(), &imax, &jmax ); }
1475 gsl_matrix_uchar_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_uchar_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1492 return gsl_matrix_uchar_mul_elements(
get(),
b.get() ); }
1500 return gsl_matrix_uchar_div_elements(
get(),
b.get() ); }
1506 return gsl_matrix_uchar_norm1(
get() ); }
1513 return gsl_matrix_uchar_scale_rows(
get(), x.
get() ); }
1520 return gsl_matrix_uchar_scale_columns(
get(), x.
get() ); }
1527 return gsl_matrix_uchar_add_diagonal(
get(), x ); }
1535 return gsl_matrix_uchar_get_row( v.
get(),
get(), i ); }
1543 return gsl_matrix_uchar_get_col( v.
get(),
get(), j ); }
1551 return gsl_matrix_uchar_set_row(
get(), i, v.
get() ); }
1559 return gsl_matrix_uchar_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_uchar",
1582#ifdef __GXX_EXPERIMENTAL_CXX0X__
1591 gsl_vector_uchar_view w = gsl_matrix_uchar_row(
ccgsl_pointer, i );
1609 gsl_vector_uchar_view w = gsl_matrix_uchar_row(
ccgsl_pointer, i );
1620 return gsl_permute_matrix_uchar( p.
get(),
get() ); }
1626 return vector_uchar ( gsl_vector_uchar_alloc_row_from_matrix( m.get(), i ) ); }
1628 return vector_uchar ( gsl_vector_uchar_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_uchars 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(iterator_t< reverse_t > const &i)
A copy constructor.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
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.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
const_iterator_t< reverse_t > operator--(int)
The postfix – operator.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t(matrix_uchar const *v, size_t position)
This constructor allows vector_uchar to create non-default iterators.
const_iterator_t()
The default constructor.
const_iterator_t< reverse_t > & operator++()
The prefix ++ operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
We create a suitable class for iterator types here.
vector_uchar value_type
An iterator must have a value type.
vector_uchar_ptr pointer
An iterator must have a pointer typea.
container * v
Store a pointer to a matrix_uchar we can iterate over: 0 if no matrix_uchar.
size_t position
Mark position of iterator within matrix_uchar.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
pointer operator->() const
Dereference the pointer.
iterator_base()
The iterator is default constructible.
value_type reference
An iterator must have a reference type.
reference operator*() const
Dereference the pointer.
iterator_base(container *v, size_t position)
This constructor allows vector_uchar to create non-default iterators.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
void decrement()
Decrement the iterator.
void increment()
Increment the iterator.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
A class template for the two non-const iterators.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t()
The default constructor.
iterator_t(matrix_uchar *v, size_t position)
This constructor allows vector_uchar to create non-default 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--()
The prefix – operator.
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.
This class handles matrix_uchar objects as shared handles.
int fwrite(FILE *stream) const
C++ version of gsl_matrix_uchar_fwrite().
int transpose_memcpy(matrix_uchar const &src)
C++ version of gsl_matrix_uchar_transpose_memcpy().
void wrap_gsl_matrix_uchar_without_ownership(gsl_matrix_uchar *v)
This function is intended mainly for internal use.
unsigned char max() const
C++ version of gsl_matrix_uchar_max().
vector_uchar const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_uchar_const_subcolumn().
matrix_uchar(matrix_uchar &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_alloc_from_matrix().
unsigned char const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_uchar_const_ptr().
unsigned char min() const
C++ version of gsl_matrix_uchar_min().
iterator_t< false > iterator
The iterator type.
int transpose()
C++ version of gsl_matrix_uchar_transpose().
int mul_elements(matrix_uchar const &b)
C++ version of gsl_matrix_uchar_mul_elements().
int isnonneg() const
C++ version of gsl_matrix_uchar_isnonneg().
matrix_uchar(matrix_uchar const &v)
The copy constructor.
int add(matrix_uchar const &b)
C++ version of gsl_matrix_uchar_add().
matrix_uchar 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_uchar_const_submatrix().
vector_uchar const diagonal() const
Another C++ version of gsl_matrix_uchar_const_diagonal().
vector_uchar superdiagonal(size_t const k)
C++ version of gsl_matrix_uchar_superdiagonal().
matrix_uchar & operator=(matrix_uchar const &v)
The assignment operator.
vector_uchar subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_uchar_subcolumn().
void minmax(unsigned char &min_out, unsigned char &max_out) const
C++ version of gsl_matrix_uchar_minmax().
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_uchar_max_index().
static matrix_uchar const const_view_vector(vector_uchar const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_const_view_vector().
vector_uchar subdiagonal(size_t const k)
C++ version of gsl_matrix_uchar_subdiagonal().
void set_zero()
C++ version of gsl_matrix_uchar_set_zero().
iterator end()
Get iterator pointing beyond last vector_uchar element.
vector_uchar const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_uchar_const_superdiagonal().
static matrix_uchar const const_view_array_with_tda(unsigned char const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_uchar_const_view_array_with_tda().
void set(size_t const i, size_t const j, unsigned char x)
C++ version of gsl_matrix_uchar_set().
void set_all(unsigned char x)
C++ version of gsl_matrix_uchar_set_all().
vector_uchar diagonal()
C++ version of gsl_matrix_uchar_diagonal().
vector_uchar subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_uchar_subrow().
int fread(FILE *stream)
C++ version of gsl_matrix_uchar_fread().
const_iterator begin() const
Get iterator pointing to first vector_uchar element.
int add_diagonal(unsigned char const x)
C++ version of gsl_matrix_uchar_add_diagonal().
unsigned char * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_uchar_ptr().
int scale(unsigned char const x)
C++ version of gsl_matrix_uchar_scale().
matrix_uchar 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_uchar_const_submatrix().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
size_t use_count() const
Find how many matrix_uchar objects share this pointer.
int scale_columns(vector_uchar const &x)
C++ version of gsl_matrix_uchar_scale_columns().
reverse_iterator rbegin()
Get iterator pointing to first vector_uchar element.
matrix_uchar(std::initializer_list< std::initializer_list< unsigned char > > initializer_list)
Could construct from a std::initializer_list in C++11.
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_uchar_minmax_index().
vector_uchar const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_uchar_const_subcolumn().
bool unique() const
Find if this is the only object sharing the gsl_matrix_uchar.
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_uchar_min_index().
vector_uchar const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_uchar_const_subdiagonal().
matrix_uchar(size_t const n1, size_t const n2)
This constructor creates a new matrix_uchar with n1 rows and n2 columns.
iterator begin()
Get iterator pointing to first vector_uchar element.
bool owns_data
Used to allow a vector that does not own its data.
vector_uchar const operator[](size_t const i) const
This function allows us to use a matrix_uchar like an array.
void set_identity()
C++ version of gsl_matrix_uchar_set_identity().
static matrix_uchar view_vector_with_tda(vector_uchar &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_uchar_view_vector_with_tda().
static matrix_uchar const view_array(unsigned char const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_uchar_const_view_array().
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_uchar const &src)
Copy the upper or lower triangular part of matrix src to this.
matrix_uchar(matrix_uchar &&v)
Move constructor.
iterator_t< true > reverse_iterator
The reverse_iterator type.
matrix_uchar(block_uchar &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_uchar_alloc_from_block().
int fscanf(FILE *stream)
C++ version of gsl_matrix_uchar_fscanf().
vector_uchar const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_uchar_const_subrow().
matrix_uchar(gsl_matrix_uchar *v)
Could construct from a gsl_matrix_uchar.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_uchar_fprintf().
size_t * count
The shared reference count.
vector_uchar const const_row(size_t const i) const
C++ version of gsl_matrix_uchar_const_row().
size_t size1() const
The number of rows of the matrix_uchar.
static matrix_uchar view_array_with_tda(unsigned char *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_uchar_view_array_with_tda().
int set_row(size_t const i, vector_uchar const &v)
C++ version of gsl_matrix_uchar_set_row().
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_uchar const &src)
Copy the upper or lower triangular part of matrix src to this.
vector_uchar column(size_t const j)
C++ version of gsl_matrix_uchar_column().
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_uchar_swap_rows().
int scale_rows(vector_uchar const &x)
C++ version of gsl_matrix_uchar_scale_rows().
vector_uchar const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_uchar_const_superdiagonal().
int sub(matrix_uchar const &b)
C++ version of gsl_matrix_uchar_sub().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_uchar element.
vector_uchar const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_uchar_const_subdiagonal().
vector_uchar const const_diagonal() const
C++ version of gsl_matrix_uchar_const_diagonal().
vector_uchar const row(size_t const i) const
Another C++ version of gsl_matrix_uchar_const_row().
unsigned char * data()
Give access to the data block_uchar.
matrix_uchar submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_submatrix().
~matrix_uchar()
The destructor only deletes the pointers if count reaches zero.
static matrix_uchar view_array(unsigned char *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_view_array().
vector_uchar operator[](size_t const i)
This function allows us to use a matrix_uchar like an array.
reverse_iterator rend()
Get iterator pointing beyond last vector_uchar element.
static matrix_uchar const const_view_vector_with_tda(vector_uchar const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_uchar_const_view_vector_with_tda().
size_t size_type
A container must have a size_type.
int get_row(vector_uchar &v, size_t const i) const
C++ version of gsl_matrix_uchar_get_row().
int div_elements(matrix_uchar const &b)
C++ version of gsl_matrix_uchar_div_elements().
vector_uchar const column(size_t const j) const
Another C++ version of gsl_matrix_uchar_const_column().
int add_constant(unsigned char const x)
C++ version of gsl_matrix_uchar_add_constant().
static matrix_uchar const view_vector_with_tda(vector_uchar const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_uchar_const_view_vector_with_tda().
vector_uchar const const_column(size_t const j) const
C++ version of gsl_matrix_uchar_const_column().
static matrix_uchar const const_view_array(unsigned char const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_const_view_array().
int isneg() const
C++ version of gsl_matrix_uchar_isneg().
int get_col(vector_uchar &v, size_t const j) const
C++ version of gsl_matrix_uchar_get_col().
gsl_matrix_uchar * get()
Get the gsl_matrix_uchar.
int permute(permutation &p)
Permute the columns of this by permutation p.
int set_col(size_t const j, vector_uchar const &v)
C++ version of gsl_matrix_uchar_set_col().
static matrix_uchar const view_vector(vector_uchar const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_uchar_const_view_vector().
size_t size2() const
The number of columns of the matrix_uchar.
matrix_uchar()
The default constructor is only really useful for assigning to.
void minmax(unsigned char *min_out, unsigned char *max_out) const
C++ version of gsl_matrix_uchar_minmax().
const_iterator end() const
Get iterator pointing beyond last vector_uchar element.
static matrix_uchar calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_calloc().
const_iterator_t< false > const_iterator
The const_iterator type.
int isnull() const
C++ version of gsl_matrix_uchar_isnull().
unsigned char get(size_t const i, size_t const j) const
C++ version of gsl_matrix_uchar_get().
matrix_uchar & operator=(matrix_uchar &&v)
Move operator.
static matrix_uchar const view_array_with_tda(unsigned char const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_uchar_const_view_array_with_tda().
unsigned char norm1() const
C++ version of gsl_matrix_uchar_norm1().
void reset()
Stop sharing ownership of the shared pointer.
unsigned char const * data() const
Give access to the data block_uchar.
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_uchar_swap_rowcol().
vector_uchar const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_uchar_const_subrow().
gsl_matrix_uchar * ccgsl_pointer
The shared pointer.
gsl_matrix_uchar const * get() const
Get the gsl_matrix_uchar.
static matrix_uchar view_vector(vector_uchar &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_uchar_view_vector().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_uchar element.
void swap(matrix_uchar &m)
Swap two matrix_uchar objects.
vector_uchar row(size_t const i)
C++ version of gsl_matrix_uchar_row().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_uchar_swap_columns().
int ispos() const
C++ version of gsl_matrix_uchar_ispos().
int memcpy(matrix_uchar const &src)
C++ version of gsl_matrix_uchar_memcpy().
matrix_uchar clone() const
The clone function.
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_uchar objects as shared handles.
static vector_uchar alloc_col_from_matrix(matrix_uchar &m, size_t const j)
C++ version of gsl_vector_uchar_alloc_col_from_matrix().
vector_uchar()
The default constructor is only really useful for assigning to.
void wrap_gsl_vector_uchar_without_ownership(gsl_vector_uchar *v)
This function is intended mainly for internal use.
static vector_uchar alloc_row_from_matrix(matrix_uchar &m, size_t const i)
C++ version of gsl_vector_uchar_alloc_row_from_matrix().
gsl_vector_uchar * get()
Get the gsl_vector_uchar.
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_uchar * operator->()
Dereference operator.
vector_uchar & operator*()
Dereference operator.
vector_uchar_ptr(vector_uchar const &v)
Typically we have to construct from a vector_uchar.