19#ifndef CCGSL_MATRIX_SHORT_HPP
20#define CCGSL_MATRIX_SHORT_HPP
22#include<gsl/gsl_matrix.h>
24#include<gsl/gsl_permute_matrix_short.h>
75 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_short_alloc( n1, n2 );
79 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
81 if( n1 > 0 and n2 > 0 ) gsl_matrix_short_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_short 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_short_free(
ccgsl_pointer );
124 for(
auto row : initializer_list ){
126 for(
auto x :
row ){
set( r, c, x ); ++c; }
168 gsl_matrix_short_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_short const,vector_short const,reverse_t>{
709 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_short", __FILE__, __LINE__, GSL_EFAULT );
710#ifndef GSL_RANGE_CHECK_OFF
712 gsl_error(
"matrix_short size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
723 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_short", __FILE__, __LINE__, GSL_EFAULT );
724#ifndef GSL_RANGE_CHECK_OFF
726 gsl_error(
"matrix_short size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
745 gsl_matrix_short_tricpy( Uplo, Diag,
get(), src.
get() );
754 gsl_matrix_short_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
766 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
767 *m = gsl_matrix_short_submatrix(
get(), i, j, n1, n2 ).matrix;
776 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
777 *w = gsl_matrix_short_row(
get(), i ).vector;
786 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
787 *w = gsl_matrix_short_column(
get(), j ).vector;
795 diagonal(){ gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
796 *w = gsl_matrix_short_diagonal(
get() ).vector;
805 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
806 *w = gsl_matrix_short_subdiagonal(
get(), k ).vector;
815 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
816 *w = gsl_matrix_short_superdiagonal(
get(), k ).vector;
827 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
828 *w = gsl_matrix_short_subrow(
get(), i, offset,
n ).vector;
839 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
840 *w = gsl_matrix_short_subcolumn(
get(), j, offset,
n ).vector;
851 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
852 *m = gsl_matrix_short_view_array( base, n1, n2 ).matrix;
864 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
865 *m = gsl_matrix_short_view_array_with_tda( base, n1, n2, tda ).matrix;
876 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
877 *m = gsl_matrix_short_view_vector( v.
get(), n1, n2 ).matrix;
889 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
890 *m = gsl_matrix_short_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
903 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
904 *m = gsl_matrix_short_const_submatrix(
get(), i, j, n1, n2 ).matrix;
913 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
914 *w = gsl_matrix_short_const_row(
get(), i ).vector;
923 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
924 *w = gsl_matrix_short_const_column(
get(), j ).vector;
932 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
933 *w = gsl_matrix_short_const_diagonal(
get() ).vector;
942 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
943 *w = gsl_matrix_short_const_subdiagonal(
get(), k ).vector;
952 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
953 *w = gsl_matrix_short_const_superdiagonal(
get(), k ).vector;
964 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
965 *w = gsl_matrix_short_const_subrow(
get(), i, offset,
n ).vector;
976 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
977 *w = gsl_matrix_short_const_subcolumn(
get(), j, offset,
n ).vector;
989 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
990 *m = gsl_matrix_short_const_submatrix(
get(), i, j, n1, n2 ).matrix;
999 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1000 *w = gsl_matrix_short_const_row(
get(), i ).vector;
1009 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1010 *w = gsl_matrix_short_const_column(
get(), j ).vector;
1018 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1019 *w = gsl_matrix_short_const_diagonal(
get() ).vector;
1028 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1029 *w = gsl_matrix_short_const_subdiagonal(
get(), k ).vector;
1038 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1039 *w = gsl_matrix_short_const_superdiagonal(
get(), k ).vector;
1050 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1051 *w = gsl_matrix_short_const_subrow(
get(), i, offset,
n ).vector;
1062 gsl_vector_short* w =
static_cast<gsl_vector_short*
>( malloc(
sizeof( gsl_vector_short ) ) );
1063 *w = gsl_matrix_short_const_subcolumn(
get(), j, offset,
n ).vector;
1074 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1075 *m = gsl_matrix_short_const_view_array( base, n1, n2 ).matrix;
1088 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1089 *m = gsl_matrix_short_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1100 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1101 *m = gsl_matrix_short_const_view_vector( v.
get(), n1, n2 ).matrix;
1114 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1115 *m = gsl_matrix_short_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1126 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1127 *m = gsl_matrix_short_const_view_array( base, n1, n2 ).matrix;
1140 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1141 *m = gsl_matrix_short_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1152 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1153 *m = gsl_matrix_short_const_view_vector( v.
get(), n1, n2 ).matrix;
1166 gsl_matrix_short* m =
static_cast<gsl_matrix_short*
>( malloc(
sizeof( gsl_matrix_short ) ) );
1167 *m = gsl_matrix_short_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1211#ifdef __GXX_EXPERIMENTAL_CXX0X__
1243 short max()
const {
return gsl_matrix_short_max(
get() ); }
1248 short min()
const {
return gsl_matrix_short_min(
get() ); }
1254 void minmax(
short* min_out,
short* max_out )
const {
1255 gsl_matrix_short_minmax(
get(), min_out, max_out ); }
1261 void minmax(
short& min_out,
short& max_out )
const {
1262 gsl_matrix_short_minmax(
get(), &min_out, &max_out ); }
1280 int scale(
short const x ){
return gsl_matrix_short_scale(
get(), x ); }
1291 int isnull()
const {
return gsl_matrix_short_isnull(
get() ); }
1296 int ispos()
const {
return gsl_matrix_short_ispos(
get() ); }
1301 int isneg()
const {
return gsl_matrix_short_isneg(
get() ); }
1313 short get(
size_t const i,
size_t const j )
const {
return gsl_matrix_short_get(
get(), i, j ); }
1320 void set(
size_t const i,
size_t const j,
short x ){ gsl_matrix_short_set(
get(), i, j, x ); }
1327 short*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_short_ptr(
get(), i, j ); }
1334 short const*
const_ptr(
size_t const i,
size_t const j )
const {
1335 return gsl_matrix_short_const_ptr(
get(), i, j ); }
1341 int fread( FILE* stream ){
return gsl_matrix_short_fread( stream,
get() ); }
1347 int fwrite( FILE* stream )
const {
return gsl_matrix_short_fwrite( stream,
get() ); }
1353 int fscanf( FILE* stream ){
return gsl_matrix_short_fscanf( stream,
get() ); }
1360 int fprintf( FILE* stream,
char const* format )
const {
1361 return gsl_matrix_short_fprintf( stream,
get(), format ); }
1371 ccgsl_pointer = gsl_matrix_short_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_short_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_short_swap_rows(
get(), i, j ); }
1417 return gsl_matrix_short_swap_columns(
get(), i, j ); }
1424 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_short_swap_rowcol(
get(), i, j ); }
1436 return gsl_matrix_short_transpose_memcpy(
get(), src.
get() ); }
1443 void max_index(
size_t* imax,
size_t* jmax )
const {
1444 gsl_matrix_short_max_index(
get(), imax, jmax ); }
1450 void min_index(
size_t* imin,
size_t* jmin )
const {
1451 gsl_matrix_short_min_index(
get(), imin, jmin ); }
1459 gsl_matrix_short_max_index(
get(), &imax, &jmax ); }
1466 gsl_matrix_short_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_short_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1483 return gsl_matrix_short_mul_elements(
get(),
b.get() ); }
1491 return gsl_matrix_short_div_elements(
get(),
b.get() ); }
1497 return gsl_matrix_short_norm1(
get() ); }
1504 return gsl_matrix_short_scale_rows(
get(), x.
get() ); }
1511 return gsl_matrix_short_scale_columns(
get(), x.
get() ); }
1518 return gsl_matrix_short_add_diagonal(
get(), x ); }
1526 return gsl_matrix_short_get_row( v.
get(),
get(), i ); }
1534 return gsl_matrix_short_get_col( v.
get(),
get(), j ); }
1542 return gsl_matrix_short_set_row(
get(), i, v.
get() ); }
1550 return gsl_matrix_short_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_short",
1573#ifdef __GXX_EXPERIMENTAL_CXX0X__
1582 gsl_vector_short_view w = gsl_matrix_short_row(
ccgsl_pointer, i );
1600 gsl_vector_short_view w = gsl_matrix_short_row(
ccgsl_pointer, i );
1611 return gsl_permute_matrix_short( p.
get(),
get() ); }
1617 return vector_short ( gsl_vector_short_alloc_row_from_matrix( m.get(), i ) ); }
1619 return vector_short ( gsl_vector_short_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_shorts 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.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
const_iterator_t(matrix_short const *v, size_t position)
This constructor allows vector_short to create non-default iterators.
const_iterator_t()
The default constructor.
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.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse_t > & operator++()
The prefix ++ operator.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ 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_short_ptr pointer
An iterator must have a pointer typea.
value_type reference
An iterator must have a reference type.
void decrement()
Decrement the iterator.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
iterator_base()
The iterator is default constructible.
reference operator*() const
Dereference the pointer.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
void increment()
Increment the iterator.
pointer operator->() const
Dereference the pointer.
iterator_base(container *v, size_t position)
This constructor allows vector_short to create non-default iterators.
vector_short value_type
An iterator must have a value type.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
container * v
Store a pointer to a matrix_short we can iterate over: 0 if no matrix_short.
size_t position
Mark position of iterator within matrix_short.
A class template for the two non-const iterators.
iterator_t()
The default constructor.
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< reverse_t > operator--(int)
The postfix – operator.
iterator_t(matrix_short *v, size_t position)
This constructor allows vector_short to create non-default iterators.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
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.
This class handles matrix_short objects as shared handles.
short min() const
C++ version of gsl_matrix_short_min().
int add_diagonal(short const x)
C++ version of gsl_matrix_short_add_diagonal().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_short_swap_columns().
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_short_min_index().
short const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_short_const_ptr().
size_t use_count() const
Find how many matrix_short objects share this pointer.
~matrix_short()
The destructor only deletes the pointers if count reaches zero.
static matrix_short const const_view_array_with_tda(short const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_short_const_view_array_with_tda().
int mul_elements(matrix_short const &b)
C++ version of gsl_matrix_short_mul_elements().
matrix_short & operator=(matrix_short &&v)
Move operator.
int transpose()
C++ version of gsl_matrix_short_transpose().
static matrix_short const view_array(short const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_short_const_view_array().
void minmax(short &min_out, short &max_out) const
C++ version of gsl_matrix_short_minmax().
matrix_short(size_t const n1, size_t const n2)
This constructor creates a new matrix_short with n1 rows and n2 columns.
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_short const &src)
Copy the upper or lower triangular part of matrix src to this.
vector_short subdiagonal(size_t const k)
C++ version of gsl_matrix_short_subdiagonal().
static matrix_short const const_view_array(short const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_const_view_array().
reverse_iterator rbegin()
Get iterator pointing to first vector_short element.
matrix_short submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_submatrix().
int get_row(vector_short &v, size_t const i) const
C++ version of gsl_matrix_short_get_row().
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_short_max_index().
iterator_t< true > reverse_iterator
The reverse_iterator type.
vector_short const const_row(size_t const i) const
C++ version of gsl_matrix_short_const_row().
vector_short const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_short_const_subcolumn().
matrix_short(std::initializer_list< std::initializer_list< short > > initializer_list)
Could construct from a std::initializer_list in C++11.
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_short_swap_rowcol().
int scale_columns(vector_short const &x)
C++ version of gsl_matrix_short_scale_columns().
int isnonneg() const
C++ version of gsl_matrix_short_isnonneg().
matrix_short(block_short &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_short_alloc_from_block().
const_iterator_t< false > const_iterator
The const_iterator type.
vector_short const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_short_const_superdiagonal().
matrix_short(matrix_short &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_alloc_from_matrix().
vector_short const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_short_const_subcolumn().
size_t size1() const
The number of rows of the matrix_short.
int scale(short const x)
C++ version of gsl_matrix_short_scale().
int fread(FILE *stream)
C++ version of gsl_matrix_short_fread().
matrix_short(matrix_short &&v)
Move constructor.
vector_short superdiagonal(size_t const k)
C++ version of gsl_matrix_short_superdiagonal().
iterator end()
Get iterator pointing beyond last vector_short element.
void set(size_t const i, size_t const j, short x)
C++ version of gsl_matrix_short_set().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_short_fwrite().
static matrix_short calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_calloc().
static matrix_short view_array(short *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_view_array().
short const * data() const
Give access to the data block_short.
static matrix_short const const_view_vector(vector_short const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_const_view_vector().
int add(matrix_short const &b)
C++ version of gsl_matrix_short_add().
gsl_matrix_short const * get() const
Get the gsl_matrix_short.
int add_constant(short const x)
C++ version of gsl_matrix_short_add_constant().
int fscanf(FILE *stream)
C++ version of gsl_matrix_short_fscanf().
vector_short row(size_t const i)
C++ version of gsl_matrix_short_row().
vector_short const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_short_const_subrow().
bool owns_data
Used to allow a vector that does not own its data.
matrix_short 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_short_const_submatrix().
static matrix_short view_vector_with_tda(vector_short &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_short_view_vector_with_tda().
int permute(permutation &p)
Permute the columns of this by permutation p.
int isnull() const
C++ version of gsl_matrix_short_isnull().
static matrix_short const view_vector_with_tda(vector_short const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_short_const_view_vector_with_tda().
gsl_matrix_short * get()
Get the gsl_matrix_short.
vector_short const row(size_t const i) const
Another C++ version of gsl_matrix_short_const_row().
int transpose_memcpy(matrix_short const &src)
C++ version of gsl_matrix_short_transpose_memcpy().
void minmax(short *min_out, short *max_out) const
C++ version of gsl_matrix_short_minmax().
short get(size_t const i, size_t const j) const
C++ version of gsl_matrix_short_get().
vector_short const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_short_const_subdiagonal().
vector_short subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_short_subrow().
static matrix_short view_vector(vector_short &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_short_view_vector().
short * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_short_ptr().
matrix_short(matrix_short const &v)
The copy constructor.
void swap(matrix_short &m)
Swap two matrix_short objects.
vector_short const column(size_t const j) const
Another C++ version of gsl_matrix_short_const_column().
vector_short column(size_t const j)
C++ version of gsl_matrix_short_column().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_short element.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_short_fprintf().
vector_short diagonal()
C++ version of gsl_matrix_short_diagonal().
vector_short const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_short_const_superdiagonal().
matrix_short()
The default constructor is only really useful for assigning to.
int get_col(vector_short &v, size_t const j) const
C++ version of gsl_matrix_short_get_col().
gsl_matrix_short * ccgsl_pointer
The shared pointer.
reverse_iterator rend()
Get iterator pointing beyond last vector_short element.
matrix_short(gsl_matrix_short *v)
Could construct from a gsl_matrix_short.
int memcpy(matrix_short const &src)
C++ version of gsl_matrix_short_memcpy().
static matrix_short const view_vector(vector_short const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_short_const_view_vector().
void set_all(short x)
C++ version of gsl_matrix_short_set_all().
vector_short subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_short_subcolumn().
matrix_short & operator=(matrix_short const &v)
The assignment operator.
int isneg() const
C++ version of gsl_matrix_short_isneg().
size_t size2() const
The number of columns of the matrix_short.
const_iterator end() const
Get iterator pointing beyond last vector_short element.
int set_row(size_t const i, vector_short const &v)
C++ version of gsl_matrix_short_set_row().
vector_short const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_short_const_subdiagonal().
vector_short const operator[](size_t const i) const
This function allows us to use a matrix_short like an array.
vector_short operator[](size_t const i)
This function allows us to use a matrix_short like an array.
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
vector_short const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_short_const_subrow().
void reset()
Stop sharing ownership of the shared pointer.
matrix_short 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_short_const_submatrix().
iterator_t< false > iterator
The iterator type.
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_short const &src)
Copy the upper or lower triangular part of matrix src to this.
short * data()
Give access to the data block_short.
void wrap_gsl_matrix_short_without_ownership(gsl_matrix_short *v)
This function is intended mainly for internal use.
static matrix_short const view_array_with_tda(short const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_short_const_view_array_with_tda().
short max() const
C++ version of gsl_matrix_short_max().
vector_short const const_column(size_t const j) const
C++ version of gsl_matrix_short_const_column().
int scale_rows(vector_short const &x)
C++ version of gsl_matrix_short_scale_rows().
bool unique() const
Find if this is the only object sharing the gsl_matrix_short.
const_iterator begin() const
Get iterator pointing to first vector_short element.
static matrix_short const const_view_vector_with_tda(vector_short const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_short_const_view_vector_with_tda().
short norm1() const
C++ version of gsl_matrix_short_norm1().
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_short_swap_rows().
int set_col(size_t const j, vector_short const &v)
C++ version of gsl_matrix_short_set_col().
vector_short const diagonal() const
Another C++ version of gsl_matrix_short_const_diagonal().
matrix_short clone() const
The clone function.
int div_elements(matrix_short const &b)
C++ version of gsl_matrix_short_div_elements().
void set_zero()
C++ version of gsl_matrix_short_set_zero().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_short element.
vector_short const const_diagonal() const
C++ version of gsl_matrix_short_const_diagonal().
size_t size_type
A container must have a size_type.
static matrix_short view_array_with_tda(short *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_short_view_array_with_tda().
int sub(matrix_short const &b)
C++ version of gsl_matrix_short_sub().
size_t * count
The shared reference count.
iterator begin()
Get iterator pointing to first vector_short element.
int ispos() const
C++ version of gsl_matrix_short_ispos().
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_short_minmax_index().
void set_identity()
C++ version of gsl_matrix_short_set_identity().
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_short objects as shared handles.
static vector_short alloc_row_from_matrix(matrix_short &m, size_t const i)
C++ version of gsl_vector_short_alloc_row_from_matrix().
void wrap_gsl_vector_short_without_ownership(gsl_vector_short *v)
This function is intended mainly for internal use.
vector_short()
The default constructor is only really useful for assigning to.
gsl_vector_short * get()
Get the gsl_vector_short.
static vector_short alloc_col_from_matrix(matrix_short &m, size_t const j)
C++ version of gsl_vector_short_alloc_col_from_matrix().
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_short * operator->()
Dereference operator.
vector_short_ptr(vector_short const &v)
Typically we have to construct from a vector_short.
vector_short & operator*()
Dereference operator.