19#ifndef CCGSL_MATRIX_USHORT_HPP
20#define CCGSL_MATRIX_USHORT_HPP
22#include<gsl/gsl_matrix.h>
24#include<gsl/gsl_permute_matrix_ushort.h>
75 if( n1 > 0 and n2 > 0 )
ccgsl_pointer = gsl_matrix_ushort_alloc( n1, n2 );
79 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
81 if( n1 > 0 and n2 > 0 ) gsl_matrix_ushort_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_ushort 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_ushort_free(
ccgsl_pointer );
124 for(
auto row : initializer_list ){
126 for(
auto x :
row ){
set( r, c, x ); ++c; }
168 gsl_matrix_ushort_memcpy( copy.
get(),
get() );
213#ifdef __GXX_EXPERIMENTAL_CXX0X__
219 std::swap(
count, v.count );
220 v.ccgsl_pointer =
nullptr;
257 template<
typename container,
typename content,
bool reverse_t>
class iterator_base {
284 static content something;
289 }
else if(
v->ccgsl_pointer == 0 ){
308 static content something_base;
314 }
else if(
v->ccgsl_pointer == 0 ){
325#ifdef __GXX_EXPERIMENTAL_CXX0X__
326 return std::move(
ptr );
357 }
else if(
v->ccgsl_pointer == 0 ){
374 }
else if(
v->ccgsl_pointer == 0 ){
495 :
public iterator_base<matrix_ushort const,vector_ushort const,reverse_t>{
708 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_ushort", __FILE__, __LINE__, GSL_EFAULT );
709#ifndef GSL_RANGE_CHECK_OFF
711 gsl_error(
"matrix_ushort size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
721 unsigned short const*
data()
const {
722 if(
ccgsl_pointer == 0 ) gsl_error(
"null vector_ushort", __FILE__, __LINE__, GSL_EFAULT );
723#ifndef GSL_RANGE_CHECK_OFF
725 gsl_error(
"matrix_ushort size2 and tda do not match", __FILE__, __LINE__, GSL_EBADLEN );
744 gsl_matrix_ushort_tricpy( Uplo, Diag,
get(), src.
get() );
753 gsl_matrix_ushort_transpose_tricpy( Uplo, Diag,
get(), src.
get() );
765 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
766 *m = gsl_matrix_ushort_submatrix(
get(), i, j, n1, n2 ).matrix;
775 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
776 *w = gsl_matrix_ushort_row(
get(), i ).vector;
785 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
786 *w = gsl_matrix_ushort_column(
get(), j ).vector;
794 diagonal(){ gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
795 *w = gsl_matrix_ushort_diagonal(
get() ).vector;
804 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
805 *w = gsl_matrix_ushort_subdiagonal(
get(), k ).vector;
814 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
815 *w = gsl_matrix_ushort_superdiagonal(
get(), k ).vector;
826 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
827 *w = gsl_matrix_ushort_subrow(
get(), i, offset,
n ).vector;
838 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
839 *w = gsl_matrix_ushort_subcolumn(
get(), j, offset,
n ).vector;
850 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
851 *m = gsl_matrix_ushort_view_array( base, n1, n2 ).matrix;
863 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
864 *m = gsl_matrix_ushort_view_array_with_tda( base, n1, n2, tda ).matrix;
875 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
876 *m = gsl_matrix_ushort_view_vector( v.
get(), n1, n2 ).matrix;
888 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
889 *m = gsl_matrix_ushort_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
902 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
903 *m = gsl_matrix_ushort_const_submatrix(
get(), i, j, n1, n2 ).matrix;
912 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
913 *w = gsl_matrix_ushort_const_row(
get(), i ).vector;
922 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
923 *w = gsl_matrix_ushort_const_column(
get(), j ).vector;
931 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
932 *w = gsl_matrix_ushort_const_diagonal(
get() ).vector;
941 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
942 *w = gsl_matrix_ushort_const_subdiagonal(
get(), k ).vector;
951 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
952 *w = gsl_matrix_ushort_const_superdiagonal(
get(), k ).vector;
963 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
964 *w = gsl_matrix_ushort_const_subrow(
get(), i, offset,
n ).vector;
975 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
976 *w = gsl_matrix_ushort_const_subcolumn(
get(), j, offset,
n ).vector;
988 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
989 *m = gsl_matrix_ushort_const_submatrix(
get(), i, j, n1, n2 ).matrix;
998 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
999 *w = gsl_matrix_ushort_const_row(
get(), i ).vector;
1008 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1009 *w = gsl_matrix_ushort_const_column(
get(), j ).vector;
1017 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1018 *w = gsl_matrix_ushort_const_diagonal(
get() ).vector;
1027 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1028 *w = gsl_matrix_ushort_const_subdiagonal(
get(), k ).vector;
1037 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1038 *w = gsl_matrix_ushort_const_superdiagonal(
get(), k ).vector;
1049 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1050 *w = gsl_matrix_ushort_const_subrow(
get(), i, offset,
n ).vector;
1061 gsl_vector_ushort* w =
static_cast<gsl_vector_ushort*
>( malloc(
sizeof( gsl_vector_ushort ) ) );
1062 *w = gsl_matrix_ushort_const_subcolumn(
get(), j, offset,
n ).vector;
1073 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1074 *m = gsl_matrix_ushort_const_view_array( base, n1, n2 ).matrix;
1087 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1088 *m = gsl_matrix_ushort_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1099 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1100 *m = gsl_matrix_ushort_const_view_vector( v.
get(), n1, n2 ).matrix;
1113 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1114 *m = gsl_matrix_ushort_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1125 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1126 *m = gsl_matrix_ushort_const_view_array( base, n1, n2 ).matrix;
1139 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1140 *m = gsl_matrix_ushort_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1151 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1152 *m = gsl_matrix_ushort_const_view_vector( v.
get(), n1, n2 ).matrix;
1165 gsl_matrix_ushort* m =
static_cast<gsl_matrix_ushort*
>( malloc(
sizeof( gsl_matrix_ushort ) ) );
1166 *m = gsl_matrix_ushort_const_view_vector_with_tda( v.
get(), n1, n2, tda ).matrix;
1210#ifdef __GXX_EXPERIMENTAL_CXX0X__
1231 void set_all(
unsigned short x ){ gsl_matrix_ushort_set_all(
get(), x ); }
1242 unsigned short max()
const {
return gsl_matrix_ushort_max(
get() ); }
1247 unsigned short min()
const {
return gsl_matrix_ushort_min(
get() ); }
1253 void minmax(
unsigned short* min_out,
unsigned short* max_out )
const {
1254 gsl_matrix_ushort_minmax(
get(), min_out, max_out ); }
1260 void minmax(
unsigned short& min_out,
unsigned short& max_out )
const {
1261 gsl_matrix_ushort_minmax(
get(), &min_out, &max_out ); }
1279 int scale(
unsigned short const x ){
return gsl_matrix_ushort_scale(
get(), x ); }
1285 int add_constant(
unsigned short const x ){
return gsl_matrix_ushort_add_constant(
get(), x ); }
1290 int isnull()
const {
return gsl_matrix_ushort_isnull(
get() ); }
1295 int ispos()
const {
return gsl_matrix_ushort_ispos(
get() ); }
1300 int isneg()
const {
return gsl_matrix_ushort_isneg(
get() ); }
1312 unsigned short get(
size_t const i,
size_t const j )
const {
return gsl_matrix_ushort_get(
get(), i, j ); }
1319 void set(
size_t const i,
size_t const j,
unsigned short x ){ gsl_matrix_ushort_set(
get(), i, j, x ); }
1326 unsigned short*
ptr(
size_t const i,
size_t const j ){
return gsl_matrix_ushort_ptr(
get(), i, j ); }
1333 unsigned short const*
const_ptr(
size_t const i,
size_t const j )
const {
1334 return gsl_matrix_ushort_const_ptr(
get(), i, j ); }
1340 int fread( FILE* stream ){
return gsl_matrix_ushort_fread( stream,
get() ); }
1346 int fwrite( FILE* stream )
const {
return gsl_matrix_ushort_fwrite( stream,
get() ); }
1352 int fscanf( FILE* stream ){
return gsl_matrix_ushort_fscanf( stream,
get() ); }
1359 int fprintf( FILE* stream,
char const* format )
const {
1360 return gsl_matrix_ushort_fprintf( stream,
get(), format ); }
1370 ccgsl_pointer = gsl_matrix_ushort_alloc_from_block(
b.get(), offset, n1, n2, d2 );
1372 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1388 ccgsl_pointer = gsl_matrix_ushort_alloc_from_matrix( m.
get(), k1, k2, n1, n2 );
1390 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
1408 int swap_rows(
size_t const i,
size_t const j ){
return gsl_matrix_ushort_swap_rows(
get(), i, j ); }
1416 return gsl_matrix_ushort_swap_columns(
get(), i, j ); }
1423 int swap_rowcol(
size_t const i,
size_t const j ){
return gsl_matrix_ushort_swap_rowcol(
get(), i, j ); }
1435 return gsl_matrix_ushort_transpose_memcpy(
get(), src.
get() ); }
1442 void max_index(
size_t* imax,
size_t* jmax )
const {
1443 gsl_matrix_ushort_max_index(
get(), imax, jmax ); }
1449 void min_index(
size_t* imin,
size_t* jmin )
const {
1450 gsl_matrix_ushort_min_index(
get(), imin, jmin ); }
1458 void minmax_index(
size_t* imin,
size_t* jmin,
size_t* imax,
size_t* jmax )
const {
1459 gsl_matrix_ushort_minmax_index(
get(), imin, jmin, imax, jmax ); }
1467 gsl_matrix_ushort_max_index(
get(), &imax, &jmax ); }
1474 gsl_matrix_ushort_min_index(
get(), &imin, &jmin ); }
1482 void minmax_index(
size_t& imin,
size_t& jmin,
size_t& imax,
size_t& jmax )
const {
1483 gsl_matrix_ushort_minmax_index(
get(), &imin, &jmin, &imax, &jmax ); }
1491 return gsl_matrix_ushort_mul_elements(
get(),
b.get() ); }
1499 return gsl_matrix_ushort_div_elements(
get(),
b.get() ); }
1505 return gsl_matrix_ushort_norm1(
get() ); }
1512 return gsl_matrix_ushort_scale_rows(
get(), x.
get() ); }
1519 return gsl_matrix_ushort_scale_columns(
get(), x.
get() ); }
1526 return gsl_matrix_ushort_add_diagonal(
get(), x ); }
1534 return gsl_matrix_ushort_get_row( v.
get(),
get(), i ); }
1542 return gsl_matrix_ushort_get_col( v.
get(),
get(), j ); }
1550 return gsl_matrix_ushort_set_row(
get(), i, v.
get() ); }
1558 return gsl_matrix_ushort_set_col(
get(), j, v.
get() ); }
1573#ifndef GSL_RANGE_CHECK_OFF
1574#ifndef __GXX_EXPERIMENTAL_CXX0X__
1579 gsl_error(
"trying to read beyond last row of matrix_ushort",
1581#ifdef __GXX_EXPERIMENTAL_CXX0X__
1590 gsl_vector_ushort_view w = gsl_matrix_ushort_row(
ccgsl_pointer, i );
1608 gsl_vector_ushort_view w = gsl_matrix_ushort_row(
ccgsl_pointer, i );
1619 return gsl_permute_matrix_ushort( p.
get(),
get() ); }
1625 return vector_ushort ( gsl_vector_ushort_alloc_row_from_matrix( m.get(), i ) ); }
1627 return vector_ushort ( gsl_vector_ushort_alloc_col_from_matrix( m.get(), i ) ); }
This class handles vector_ushorts 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< reverse_t > operator--(int)
The postfix – operator.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
const_iterator_t(matrix_ushort const *v, size_t position)
This constructor allows vector_ushort to create non-default iterators.
const_iterator_t< reverse_t > & operator--()
The prefix – 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=(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()
The default constructor.
We create a suitable class for iterator types here.
size_t position
Mark position of iterator within matrix_ushort.
value_type reference
An iterator must have a reference type.
container * v
Store a pointer to a matrix_ushort we can iterate over: 0 if no matrix_ushort.
iterator_base()
The iterator is default constructible.
iterator_base(container *v, size_t position)
This constructor allows vector_ushort to create non-default iterators.
void increment()
Increment the iterator.
vector_ushort_ptr pointer
An iterator must have a pointer typea.
std::bidirectional_iterator_tag iterator_category
An iterator must have an iterator category.
void decrement()
Decrement the iterator.
pointer operator->() const
Dereference the pointer.
reference operator*() const
Dereference the pointer.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
vector_ushort value_type
An iterator must have a value type.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
A class template for the two non-const iterators.
iterator_t(matrix_ushort *v, size_t position)
This constructor allows vector_ushort to create non-default iterators.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t()
The default constructor.
iterator_t< reverse_t > & operator=(iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
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--()
The prefix – operator.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
This class handles matrix_ushort objects as shared handles.
vector_ushort const diagonal() const
Another C++ version of gsl_matrix_ushort_const_diagonal().
vector_ushort const operator[](size_t const i) const
This function allows us to use a matrix_ushort like an array.
void set_zero()
C++ version of gsl_matrix_ushort_set_zero().
vector_ushort const column(size_t const j) const
Another C++ version of gsl_matrix_ushort_const_column().
int permute(permutation &p)
Permute the columns of this by permutation p.
matrix_ushort(block_ushort &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_ushort_alloc_from_block().
vector_ushort subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_ushort_subrow().
static matrix_ushort calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_calloc().
const_iterator begin() const
Get iterator pointing to first vector_ushort element.
unsigned short * ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_ushort_ptr().
vector_ushort const const_row(size_t const i) const
C++ version of gsl_matrix_ushort_const_row().
static matrix_ushort const const_view_vector_with_tda(vector_ushort const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ushort_const_view_vector_with_tda().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_ushort element.
int set_row(size_t const i, vector_ushort const &v)
C++ version of gsl_matrix_ushort_set_row().
bool unique() const
Find if this is the only object sharing the gsl_matrix_ushort.
matrix_ushort clone() const
The clone function.
size_t size1() const
The number of rows of the matrix_ushort.
int transpose()
C++ version of gsl_matrix_ushort_transpose().
reverse_iterator rend()
Get iterator pointing beyond last vector_ushort element.
reverse_iterator rbegin()
Get iterator pointing to first vector_ushort element.
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_ushort const &src)
Copy the upper or lower triangular part of matrix src to this.
size_t use_count() const
Find how many matrix_ushort objects share this pointer.
int sub(matrix_ushort const &b)
C++ version of gsl_matrix_ushort_sub().
size_t * count
The shared reference count.
vector_ushort const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_ushort_const_subdiagonal().
int scale_rows(vector_ushort const &x)
C++ version of gsl_matrix_ushort_scale_rows().
vector_ushort diagonal()
C++ version of gsl_matrix_ushort_diagonal().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_ushort_swap_columns().
matrix_ushort(std::initializer_list< std::initializer_list< unsigned short > > initializer_list)
Could construct from a std::initializer_list in C++11.
unsigned short * data()
Give access to the data block_ushort.
vector_ushort const row(size_t const i) const
Another C++ version of gsl_matrix_ushort_const_row().
static matrix_ushort view_array(unsigned short *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_view_array().
int add_diagonal(unsigned short const x)
C++ version of gsl_matrix_ushort_add_diagonal().
void minmax_index(size_t &imin, size_t &jmin, size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_ushort_minmax_index().
static matrix_ushort const view_vector_with_tda(vector_ushort const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_ushort_const_view_vector_with_tda().
iterator_t< true > reverse_iterator
The reverse_iterator type.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_ushort_fprintf().
vector_ushort column(size_t const j)
C++ version of gsl_matrix_ushort_column().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_ushort element.
iterator begin()
Get iterator pointing to first vector_ushort element.
vector_ushort operator[](size_t const i)
This function allows us to use a matrix_ushort like an array.
void set(size_t const i, size_t const j, unsigned short x)
C++ version of gsl_matrix_ushort_set().
void wrap_gsl_matrix_ushort_without_ownership(gsl_matrix_ushort *v)
This function is intended mainly for internal use.
vector_ushort subdiagonal(size_t const k)
C++ version of gsl_matrix_ushort_subdiagonal().
matrix_ushort 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_ushort_const_submatrix().
static matrix_ushort view_array_with_tda(unsigned short *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ushort_view_array_with_tda().
void minmax(unsigned short *min_out, unsigned short *max_out) const
C++ version of gsl_matrix_ushort_minmax().
vector_ushort superdiagonal(size_t const k)
C++ version of gsl_matrix_ushort_superdiagonal().
vector_ushort const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_ushort_const_subcolumn().
matrix_ushort(matrix_ushort const &v)
The copy constructor.
~matrix_ushort()
The destructor only deletes the pointers if count reaches zero.
int ispos() const
C++ version of gsl_matrix_ushort_ispos().
unsigned short const * data() const
Give access to the data block_ushort.
matrix_ushort 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_ushort_const_submatrix().
void minmax(unsigned short &min_out, unsigned short &max_out) const
C++ version of gsl_matrix_ushort_minmax().
static matrix_ushort const view_array_with_tda(unsigned short const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_ushort_const_view_array_with_tda().
gsl_matrix_ushort * ccgsl_pointer
The shared pointer.
int memcpy(matrix_ushort const &src)
C++ version of gsl_matrix_ushort_memcpy().
static matrix_ushort const view_array(unsigned short const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_ushort_const_view_array().
int add(matrix_ushort const &b)
C++ version of gsl_matrix_ushort_add().
matrix_ushort()
The default constructor is only really useful for assigning to.
size_t size_type
A container must have a size_type.
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
vector_ushort subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_ushort_subcolumn().
int mul_elements(matrix_ushort const &b)
C++ version of gsl_matrix_ushort_mul_elements().
unsigned short min() const
C++ version of gsl_matrix_ushort_min().
matrix_ushort(matrix_ushort &&v)
Move constructor.
unsigned short norm1() const
C++ version of gsl_matrix_ushort_norm1().
int isneg() const
C++ version of gsl_matrix_ushort_isneg().
int transpose_memcpy(matrix_ushort const &src)
C++ version of gsl_matrix_ushort_transpose_memcpy().
static matrix_ushort const const_view_array_with_tda(unsigned short const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ushort_const_view_array_with_tda().
int get_col(vector_ushort &v, size_t const j) const
C++ version of gsl_matrix_ushort_get_col().
matrix_ushort(size_t const n1, size_t const n2)
This constructor creates a new matrix_ushort with n1 rows and n2 columns.
int fscanf(FILE *stream)
C++ version of gsl_matrix_ushort_fscanf().
size_t size2() const
The number of columns of the matrix_ushort.
const_iterator_t< false > const_iterator
The const_iterator type.
static matrix_ushort const view_vector(vector_ushort const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_ushort_const_view_vector().
int scale(unsigned short const x)
C++ version of gsl_matrix_ushort_scale().
iterator end()
Get iterator pointing beyond last vector_ushort element.
unsigned short max() const
C++ version of gsl_matrix_ushort_max().
unsigned short const * const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_ushort_const_ptr().
vector_ushort const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_ushort_const_subcolumn().
vector_ushort const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_ushort_const_subrow().
int add_constant(unsigned short const x)
C++ version of gsl_matrix_ushort_add_constant().
void max_index(size_t &imax, size_t &jmax) const
C++ version of gsl_matrix_ushort_max_index().
bool owns_data
Used to allow a vector that does not own its data.
vector_ushort row(size_t const i)
C++ version of gsl_matrix_ushort_row().
static matrix_ushort const const_view_vector(vector_ushort const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_const_view_vector().
void min_index(size_t &imin, size_t &jmin) const
C++ version of gsl_matrix_ushort_min_index().
void swap(matrix_ushort &m)
Swap two matrix_ushort objects.
int get_row(vector_ushort &v, size_t const i) const
C++ version of gsl_matrix_ushort_get_row().
gsl_matrix_ushort const * get() const
Get the gsl_matrix_ushort.
matrix_ushort & operator=(matrix_ushort &&v)
Move operator.
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_ushort_swap_rows().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_ushort_fwrite().
vector_ushort const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_ushort_const_subrow().
static matrix_ushort const const_view_array(unsigned short const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_const_view_array().
matrix_ushort(gsl_matrix_ushort *v)
Could construct from a gsl_matrix_ushort.
vector_ushort const const_diagonal() const
C++ version of gsl_matrix_ushort_const_diagonal().
int isnonneg() const
C++ version of gsl_matrix_ushort_isnonneg().
int fread(FILE *stream)
C++ version of gsl_matrix_ushort_fread().
vector_ushort const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_ushort_const_superdiagonal().
matrix_ushort & operator=(matrix_ushort const &v)
The assignment operator.
void set_all(unsigned short x)
C++ version of gsl_matrix_ushort_set_all().
matrix_ushort(matrix_ushort &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_alloc_from_matrix().
static matrix_ushort view_vector_with_tda(vector_ushort &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_ushort_view_vector_with_tda().
iterator_t< false > iterator
The iterator type.
int set_col(size_t const j, vector_ushort const &v)
C++ version of gsl_matrix_ushort_set_col().
gsl_matrix_ushort * get()
Get the gsl_matrix_ushort.
const_iterator end() const
Get iterator pointing beyond last vector_ushort element.
unsigned short get(size_t const i, size_t const j) const
C++ version of gsl_matrix_ushort_get().
int isnull() const
C++ version of gsl_matrix_ushort_isnull().
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_ushort const &src)
Copy the upper or lower triangular part of matrix src to this.
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_ushort_swap_rowcol().
void reset()
Stop sharing ownership of the shared pointer.
vector_ushort const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_ushort_const_superdiagonal().
void set_identity()
C++ version of gsl_matrix_ushort_set_identity().
matrix_ushort submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_submatrix().
static matrix_ushort view_vector(vector_ushort &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_ushort_view_vector().
vector_ushort const const_column(size_t const j) const
C++ version of gsl_matrix_ushort_const_column().
int div_elements(matrix_ushort const &b)
C++ version of gsl_matrix_ushort_div_elements().
vector_ushort const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_ushort_const_subdiagonal().
int scale_columns(vector_ushort const &x)
C++ version of gsl_matrix_ushort_scale_columns().
This class handles GSL permutation objects.
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_ushort objects as shared handles.
gsl_vector_ushort * get()
Get the gsl_vector_ushort.
static vector_ushort alloc_row_from_matrix(matrix_ushort &m, size_t const i)
C++ version of gsl_vector_ushort_alloc_row_from_matrix().
static vector_ushort alloc_col_from_matrix(matrix_ushort &m, size_t const j)
C++ version of gsl_vector_ushort_alloc_col_from_matrix().
void wrap_gsl_vector_ushort_without_ownership(gsl_vector_ushort *v)
This function is intended mainly for internal use.
vector_ushort()
The default constructor is only really useful for assigning to.
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_ushort * operator->()
Dereference operator.
vector_ushort & operator*()
Dereference operator.
vector_ushort_ptr(vector_ushort const &v)
Typically we have to construct from a vector_ushort.