ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
matrix_complex_long_double.hpp
Go to the documentation of this file.
1/*
2 * $Id: matrix_complex_long_double.hpp 313 2014-02-22 14:29:57Z jdl3 $
3 * Copyright (C) 2010, 2011, 2012, 2019, 2021, 2024 John D Lamb
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef CCGSL_MATRIX_COMPLEX_LONG_DOUBLE_HPP
21#define CCGSL_MATRIX_COMPLEX_LONG_DOUBLE_HPP
22
23#include<gsl/gsl_matrix.h>
24#include<new>
25#ifdef __GXX_EXPERIMENTAL_CXX0X__
26#include<complex>
27#endif
28#include<gsl/gsl_permute_matrix_complex_long_double.h>
29
30#include"exception.hpp"
32#include"permutation.hpp"
33
34// This file is a template
35#define CCGSL_MTY 2
36
37namespace gsl {
63 public:
68 ccgsl_pointer = 0;
69 count = 0; // initially nullptr will do
70 }
71 // Refines random access container
72 // Refines assignable
78 explicit matrix_complex_long_double( size_t const n1, size_t const n2 ){
79 if( n1 > 0 and n2 > 0 ) ccgsl_pointer = gsl_matrix_complex_long_double_alloc( n1, n2 );
80 else { ccgsl_pointer = new gsl_matrix_complex_long_double; ccgsl_pointer->size1 = n1;
81 ccgsl_pointer->size2 = n2; ccgsl_pointer->data = 0; }
82 // just plausibly we could allocate matrix but not count
83 try { count = new size_t; } catch( std::bad_alloc& e ){
84 // try to tidy up before rethrowing
85 if( n1 > 0 and n2 > 0 ) gsl_matrix_complex_long_double_free( ccgsl_pointer );
86 else delete ccgsl_pointer;
87 throw e;
88 }
89 *count = 1; // initially there is just one reference to ccgsl_pointer
90 }
96 explicit matrix_complex_long_double( gsl_matrix_complex_long_double* v ){
97 ccgsl_pointer = v;
98 // just plausibly we could fail to allocate count: no further action needed.
99 count = new size_t;
100 *count = 1; // initially there is just one reference to ccgsl_pointer
101 }
102#ifdef __GXX_EXPERIMENTAL_CXX0X__
107 matrix_complex_long_double( std::initializer_list<std::initializer_list<std::complex<long double> > > initializer_list ){
108 size_t const n1 = initializer_list.size();
109 size_t const n2 = initializer_list.begin()->size();
110 for( auto l : initializer_list ){
111 if( l.size() != n2 ){
112 gsl::exception e( "matrix rows have unequal sizes", __FILE__, __LINE__,
114 throw( e );
115 }
116 }
117 ccgsl_pointer = gsl_matrix_complex_long_double_alloc( n1, n2 );
118 // just plausibly we could allocate matrix but not count
119 try { count = new size_t; } catch( std::bad_alloc& e ){
120 // try to tidy up before rethrowing
121 if( n1 > 0 and n2 > 0 ) gsl_matrix_complex_long_double_free( ccgsl_pointer );
122 else delete ccgsl_pointer;
123 throw e;
124 }
125 *count = 1; // initially there is just one reference to ccgsl_pointer
126 // now copy
127 int r = 0;
128 for( auto row : initializer_list ){
129 size_t c = 0;
130 for( auto x : row ){ set( r, c, x ); ++c; }
131 ++r;
132 }
133 }
134#endif
135 // copy constructor
141 if( count != 0 ) ++*count; // matrix_complex_long_double is now shared.
142 }
143 // assignment operator
149 // first, possibly delete anything pointed to by this
150 if( count == 0 or --*count == 0 ){
151 if( ccgsl_pointer != 0 and ccgsl_pointer->size1 > 0 and ccgsl_pointer->size2 > 0 ) gsl_matrix_complex_long_double_free( ccgsl_pointer );
152 else delete ccgsl_pointer;
153 delete count;
154 }
155 // Then copy
157 count = v.count;
158 if( count != 0 ) ++*count; // block_complex_long_double is now shared.
159 return *this;
160 }
161 // clone()
169 // Now copy
170 gsl_matrix_complex_long_double_memcpy( copy.get(), get() );
171 // return new object
172 return copy;
173 }
174 // destructor
179 if( count != 0 and --*count == 0 ){
180 // could have allocated null pointer
181 if( ccgsl_pointer != 0 ){
182 if( ccgsl_pointer->size1 > 0 and ccgsl_pointer->size2 > 0 ) gsl_matrix_complex_long_double_free( ccgsl_pointer );
183 else delete ccgsl_pointer; }
184 delete count;
185 }
186 }
190 void reset(){ matrix_complex_long_double().swap( *this ); }
191#ifdef __GXX_EXPERIMENTAL_CXX0X__
197 std::swap( count, v.count );
198 v.ccgsl_pointer = nullptr;
199 }
206 matrix_complex_long_double( std::move( v ) ).swap( *this );
207 return *this;
208 }
209#endif
210 private:
230 };
235 template<typename container,typename content,bool reverse_t> class iterator_base {
237 public:
241 typedef std::bidirectional_iterator_tag iterator_category;
254 public:
255 // // operator*
261 // Always try to return something
262 static content something;
263 // First check that iterator is initialised.
264 if( v == 0 ){
265 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
266 return something;
267 } else if( v->ccgsl_pointer == 0 ){
268 gsl_error( "matrix not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
269 return something;
270 }
271 // Check that position make sense
272 if( position >= v->size1() ){
273 gsl_error( "trying to dereference end()", __FILE__, __LINE__, exception::GSL_EFAILED );
274 return something;
275 }
276 // position and v are valid: return data
277 return v->row( position );
278 }
279 // // operator->
285 // Always try to return something
286 static content something_base;
287 static vector_complex_long_double_ptr something( something_base );
288 // First check that iterator is initialised.
289 if( v == 0 ){
290 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
291 return something;
292 } else if( v->ccgsl_pointer == 0 ){
293 gsl_error( "matrix not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
294 return something;
295 }
296 // Check that position make sense
297 if( position >= v->size1() ){
298 gsl_error( "trying to dereference end()", __FILE__, __LINE__, exception::GSL_EFAILED );
299 return something;
300 }
301 // position and v are valid: return data
303#ifdef __GXX_EXPERIMENTAL_CXX0X__
304 return std::move( ptr );
305#else
306 return ptr;
307#endif
308 }
315 return this->v == i.v and this->position == i.position;
316 }
323 return not this->operator==( i );
324 }
325 protected:
330 void increment(){
331 // Only makes sense if v points to a matrix
332 if( v == 0 ){
333 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
334 return;
335 } else if( v->ccgsl_pointer == 0 ){
336 gsl_error( "matrix not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
337 return;
338 }
339 // increment position and check against size
340 if( reverse_t ){ if( position >= 0 ) --position; }
341 else { if( position < v->size1() ) ++position; }
342 }
347 void decrement(){
348 // Only makes sense if v points to a matrix
349 if( v == 0 ){
350 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
351 return;
352 } else if( v->ccgsl_pointer == 0 ){
353 gsl_error( "matrix not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
354 return;
355 }
356 // decrement position and check against size
357 if( reverse_t ){ if( position < v->size1() ) ++position; }
358 else { if( position >= 0 ) --position; }
359 }
363 iterator_base(){ v = 0; }
369 iterator_base( container* v, size_t position )
370 : v( v ), position( position ){}
374 container* v;
378 size_t position;
379 };
380 // Need to know about const_iterator_t
381 template<bool reverse_t> class const_iterator_t;
385 template<bool reverse_t> class iterator_t : public iterator_base<matrix_complex_long_double,vector_complex_long_double,reverse_t>{
386 public:
387 // // Refines output iterator
388 // // operator=
396 return *this;
397 }
398 // // Refines forward iterator
399 // // operator++ (both)
406 return *this;
407 }
413 // return value
416 return result;
417 }
418 // // Refines bidirectional iterator
419 // // operator-- (both)
426 return *this;
427 }
433 // return value
436 return result;
437 }
444 return this->v == i.v and this->position == i.position;
445 }
452 return not this->operator==( i );
453 }
458 protected:
460 // We need a constructor for matrix_complex_long_double
468 };
472 template<bool reverse_t> class const_iterator_t
473 : public iterator_base<matrix_complex_long_double const,vector_complex_long_double const,reverse_t>{
474 public:
475 // // Refines output iterator
476 // // operator=
484 return *this;
485 }
486 // // Refines forward iterator
487 // // operator++ (both)
494 return *this;
495 }
501 // return value
504 return result;
505 }
506 // // Refines bidirectional iterator
507 // // operator-- (both)
514 return *this;
515 }
521 // return value
524 return result;
525 }
537 }
543 bool operator==( iterator_t<reverse_t> const& i ) const {
544 return this->v == i.v and this->position == i.position;
545 }
551 bool operator!=( iterator_t<reverse_t> const& i ) const {
552 return not this->operator==( i );
553 }
560 return this->v == i.v and this->position == i.position;
561 }
568 return not this->operator==( i );
569 }
570 protected:
571 // We need a constructor for matrix_complex_long_double
580 };
581 public:
601 typedef size_t size_type;
602 // begin()
608 return iterator( this, 0 );
609 }
615 return const_iterator( this, 0 );
616 }
617 // end()
623 if( ccgsl_pointer == 0 ) return iterator( this, 0 );
624 return iterator( this, size1() );
625 }
631 if( ccgsl_pointer == 0 ) return const_iterator( this, 0 );
632 return const_iterator( this, size1() );
633 }
634 // rbegin()
640 if( ccgsl_pointer ==0 ) return reverse_iterator( this, 0 );
641 return reverse_iterator( this, size1() - 1 );
642 }
648 if( ccgsl_pointer == 0 ) return const_reverse_iterator( this, 0 );
649 return const_reverse_iterator( this, size1() - 1 );
650 }
651 // rend()
657 return reverse_iterator( this, -1 );
658 }
664 return const_reverse_iterator( this, -1 );
665 }
666 public:
667 // Sizes
672 size_t size1() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->size1; }
677 size_t size2() const { return ccgsl_pointer == 0 ? 0 : ccgsl_pointer->size2; }
684 gsl_matrix_complex_long_double* tmp = ccgsl_pointer; ccgsl_pointer = m.ccgsl_pointer; m.ccgsl_pointer = tmp;
685 size_t* tmp2 = count; count = m.count; m.count = tmp2;
686 }
693 void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_complex_long_double const& src){
694 gsl_matrix_complex_long_double_tricpy( Uplo, Diag, get(), src.get() );
695 }
702 void
703 transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_complex_long_double const&
704 src){
705 gsl_matrix_complex_long_double_transpose_tricpy( Uplo, Diag, get(), src.get() );
706 }
707 // view operations
716 matrix_complex_long_double submatrix( size_t const i, size_t const j, size_t const n1, size_t const n2 ){
717 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
718 *m = gsl_matrix_complex_long_double_submatrix( get(), i, j, n1, n2 ).matrix;
719 return matrix_complex_long_double( m );
720 }
727 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
728 *w = gsl_matrix_complex_long_double_row( get(), i ).vector;
729 return vector_complex_long_double( w );
730 }
737 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
738 *w = gsl_matrix_complex_long_double_column( get(), j ).vector;
739 return vector_complex_long_double( w );
740 }
746 diagonal(){ gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
747 *w = gsl_matrix_complex_long_double_diagonal( get() ).vector;
748 return vector_complex_long_double( w );
749 }
756 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
757 *w = gsl_matrix_complex_long_double_subdiagonal( get(), k ).vector;
758 return vector_complex_long_double( w );
759 }
766 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
767 *w = gsl_matrix_complex_long_double_superdiagonal( get(), k ).vector;
768 return vector_complex_long_double( w );
769 }
777 vector_complex_long_double subrow( size_t const i, size_t const offset, size_t const n ){
778 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
779 *w = gsl_matrix_complex_long_double_subrow( get(), i, offset, n ).vector;
780 return vector_complex_long_double( w );
781 }
789 vector_complex_long_double subcolumn( size_t const j, size_t const offset, size_t const n ){
790 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
791 *w = gsl_matrix_complex_long_double_subcolumn( get(), j, offset, n ).vector;
792 return vector_complex_long_double( w );
793 }
801 static matrix_complex_long_double view_array( long double* base, size_t const n1, size_t const n2 ){
802 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
803 *m = gsl_matrix_complex_long_double_view_array( base, n1, n2 ).matrix;
804 return matrix_complex_long_double( m );
805 }
814 static matrix_complex_long_double view_array_with_tda( long double* base, size_t const n1, size_t const n2, size_t const tda ){
815 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
816 *m = gsl_matrix_complex_long_double_view_array_with_tda( base, n1, n2, tda ).matrix;
817 return matrix_complex_long_double( m );
818 }
826 static matrix_complex_long_double view_vector( vector_complex_long_double& v, size_t const n1, size_t const n2 ){
827 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
828 *m = gsl_matrix_complex_long_double_view_vector( v.get(), n1, n2 ).matrix;
829 return matrix_complex_long_double( m );
830 }
839 static matrix_complex_long_double view_vector_with_tda( vector_complex_long_double& v, size_t const n1, size_t const n2, size_t const tda ){
840 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
841 *m = gsl_matrix_complex_long_double_view_vector_with_tda( v.get(), n1, n2, tda ).matrix;
842 return matrix_complex_long_double( m );
843 }
844 // const versions ...
853 matrix_complex_long_double const const_submatrix( size_t const i, size_t const j, size_t const n1, size_t const n2 ) const {
854 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
855 *m = gsl_matrix_complex_long_double_const_submatrix( get(), i, j, n1, n2 ).matrix;
856 return matrix_complex_long_double( m );
857 }
863 vector_complex_long_double const const_row( size_t const i ) const {
864 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
865 *w = gsl_matrix_complex_long_double_const_row( get(), i ).vector;
866 return vector_complex_long_double( w );
867 }
873 vector_complex_long_double const const_column( size_t const j ) const {
874 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
875 *w = gsl_matrix_complex_long_double_const_column( get(), j ).vector;
876 return vector_complex_long_double( w );
877 }
883 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
884 *w = gsl_matrix_complex_long_double_const_diagonal( get() ).vector;
885 return vector_complex_long_double( w );
886 }
892 vector_complex_long_double const const_subdiagonal( size_t const k ) const {
893 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
894 *w = gsl_matrix_complex_long_double_const_subdiagonal( get(), k ).vector;
895 return vector_complex_long_double( w );
896 }
902 vector_complex_long_double const const_superdiagonal( size_t const k ) const {
903 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
904 *w = gsl_matrix_complex_long_double_const_superdiagonal( get(), k ).vector;
905 return vector_complex_long_double( w );
906 }
914 vector_complex_long_double const const_subrow( size_t const i, size_t const offset, size_t const n ) const {
915 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
916 *w = gsl_matrix_complex_long_double_const_subrow( get(), i, offset, n ).vector;
917 return vector_complex_long_double( w );
918 }
926 vector_complex_long_double const const_subcolumn( size_t const j, size_t const offset, size_t const n ) const {
927 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
928 *w = gsl_matrix_complex_long_double_const_subcolumn( get(), j, offset, n ).vector;
929 return vector_complex_long_double( w );
930 }
938 static matrix_complex_long_double const const_view_array( long double const* base, size_t const n1, size_t const n2 ){
939 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
940 *m = gsl_matrix_complex_long_double_const_view_array( base, n1, n2 ).matrix;
941 return matrix_complex_long_double( m );
942 }
951 static matrix_complex_long_double const
952 const_view_array_with_tda( long double const* base, size_t const n1, size_t const n2, size_t const tda ){
953 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
954 *m = gsl_matrix_complex_long_double_const_view_array_with_tda( base, n1, n2, tda ).matrix;
955 return matrix_complex_long_double( m );
956 }
964 static matrix_complex_long_double const const_view_vector( vector_complex_long_double const& v, size_t const n1, size_t const n2 ){
965 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
966 *m = gsl_matrix_complex_long_double_const_view_vector( v.get(), n1, n2 ).matrix;
967 return matrix_complex_long_double( m );
968 }
977 static matrix_complex_long_double const
978 const_view_vector_with_tda( vector_complex_long_double const& v, size_t const n1, size_t const n2, size_t const tda ){
979 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
980 *m = gsl_matrix_complex_long_double_const_view_vector_with_tda( v.get(), n1, n2, tda ).matrix;
981 return matrix_complex_long_double( m );
982 }
991 matrix_complex_long_double const submatrix( size_t const i, size_t const j, size_t const n1, size_t const n2 ) const {
992 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
993 *m = gsl_matrix_complex_long_double_const_submatrix( get(), i, j, n1, n2 ).matrix;
994 return matrix_complex_long_double( m );
995 }
1001 vector_complex_long_double const row( size_t const i ) const {
1002 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1003 *w = gsl_matrix_complex_long_double_const_row( get(), i ).vector;
1004 return vector_complex_long_double( w );
1005 }
1011 vector_complex_long_double const column( size_t const j ) const {
1012 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1013 *w = gsl_matrix_complex_long_double_const_column( get(), j ).vector;
1014 return vector_complex_long_double( w );
1015 }
1021 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1022 *w = gsl_matrix_complex_long_double_const_diagonal( get() ).vector;
1023 return vector_complex_long_double( w );
1024 }
1030 vector_complex_long_double const subdiagonal( size_t const k ) const {
1031 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1032 *w = gsl_matrix_complex_long_double_const_subdiagonal( get(), k ).vector;
1033 return vector_complex_long_double( w );
1034 }
1040 vector_complex_long_double const superdiagonal( size_t const k ) const {
1041 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1042 *w = gsl_matrix_complex_long_double_const_superdiagonal( get(), k ).vector;
1043 return vector_complex_long_double( w );
1044 }
1052 vector_complex_long_double const subrow( size_t const i, size_t const offset, size_t const n ) const {
1053 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1054 *w = gsl_matrix_complex_long_double_const_subrow( get(), i, offset, n ).vector;
1055 return vector_complex_long_double( w );
1056 }
1064 vector_complex_long_double const subcolumn( size_t const j, size_t const offset, size_t const n ) const {
1065 gsl_vector_complex_long_double* w = static_cast<gsl_vector_complex_long_double*>( malloc( sizeof( gsl_vector_complex_long_double ) ) );
1066 *w = gsl_matrix_complex_long_double_const_subcolumn( get(), j, offset, n ).vector;
1067 return vector_complex_long_double( w );
1068 }
1076 static matrix_complex_long_double const view_array( long double const* base, size_t const n1, size_t const n2 ){
1077 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
1078 *m = gsl_matrix_complex_long_double_const_view_array( base, n1, n2 ).matrix;
1079 return matrix_complex_long_double( m );
1080 }
1089 static matrix_complex_long_double const
1090 view_array_with_tda( long double const* base, size_t const n1, size_t const n2, size_t const tda ){
1091 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
1092 *m = gsl_matrix_complex_long_double_const_view_array_with_tda( base, n1, n2, tda ).matrix;
1093 return matrix_complex_long_double( m );
1094 }
1102 static matrix_complex_long_double const view_vector( vector_complex_long_double const& v, size_t const n1, size_t const n2 ){
1103 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
1104 *m = gsl_matrix_complex_long_double_const_view_vector( v.get(), n1, n2 ).matrix;
1105 return matrix_complex_long_double( m );
1106 }
1115 static matrix_complex_long_double const
1116 view_vector_with_tda( vector_complex_long_double const& v, size_t const n1, size_t const n2, size_t const tda ){
1117 gsl_matrix_complex_long_double* m = static_cast<gsl_matrix_complex_long_double*>( malloc( sizeof( gsl_matrix_complex_long_double ) ) );
1118 *m = gsl_matrix_complex_long_double_const_view_vector_with_tda( v.get(), n1, n2, tda ).matrix;
1119 return matrix_complex_long_double( m );
1120 }
1121 private:
1125 gsl_matrix_complex_long_double* ccgsl_pointer;
1129 size_t* count;
1130 public:
1131 // shared reference functions
1136 gsl_matrix_complex_long_double* get(){ return ccgsl_pointer; }
1141 gsl_matrix_complex_long_double const* get() const { return ccgsl_pointer; }
1147 bool unique() const { return *count == 1; }
1152 size_t use_count() const { return count == 0 ? 0 : *count; }
1158#ifdef __GXX_EXPERIMENTAL_CXX0X__
1159 explicit
1160#endif
1161 operator bool() const { return ccgsl_pointer != 0; }
1162 // GSL functions
1170 static matrix_complex_long_double calloc( size_t const n1, size_t const n2 ){ return matrix_complex_long_double( gsl_matrix_complex_long_double_calloc( n1, n2 ) ); }
1174 void set_zero(){ gsl_matrix_complex_long_double_set_zero( get() ); }
1179 void set_all( complex_long_double x ){ gsl_matrix_complex_long_double_set_all( get(), x ); }
1185 int memcpy( matrix_complex_long_double const& src ){ return gsl_matrix_complex_long_double_memcpy( get(), src.get() ); }
1191 int add( matrix_complex_long_double const& b ){ return gsl_matrix_complex_long_double_add( get(), b.get() ); }
1197 int sub( matrix_complex_long_double const& b ){ return gsl_matrix_complex_long_double_sub( get(), b.get() ); }
1203 int scale( complex_long_double const x ){ return gsl_matrix_complex_long_double_scale( get(), x ); }
1209 int add_constant( complex_long_double const x ){ return gsl_matrix_complex_long_double_add_constant( get(), x ); }
1214 int isnull() const { return gsl_matrix_complex_long_double_isnull( get() ); }
1219 int ispos() const { return gsl_matrix_complex_long_double_ispos( get() ); }
1224 int isneg() const { return gsl_matrix_complex_long_double_isneg( get() ); }
1229 int isnonneg() const { return gsl_matrix_complex_long_double_isnonneg( get() ); }
1236 complex_long_double get( size_t const i, size_t const j ) const { return gsl_matrix_complex_long_double_get( get(), i, j ); }
1243 void set( size_t const i, size_t const j, complex_long_double x ){ gsl_matrix_complex_long_double_set( get(), i, j, x ); }
1250 complex_long_double_ptr ptr( size_t const i, size_t const j ){
1251 if( i >= ccgsl_pointer->size1 )
1252 gsl_error( "Index out of range", __FILE__, __LINE__, exception::GSL_EINVAL );
1253 if( j >= ccgsl_pointer->size2 )
1254 gsl_error( "Index out of range", __FILE__, __LINE__, exception::GSL_EINVAL );
1255 return complex_long_double_ptr( get()->data + CCGSL_MTY * (i * get()->tda + j ) ); }
1262 complex_long_double_ptr const const_ptr( size_t const i, size_t const j ) const {
1263 if( i >= ccgsl_pointer->size1 )
1264 gsl_error( "Index out of range", __FILE__, __LINE__, exception::GSL_EINVAL );
1265 if( j >= ccgsl_pointer->size2 )
1266 gsl_error( "Index out of range", __FILE__, __LINE__, exception::GSL_EINVAL );
1267 return complex_long_double_ptr( get()->data + CCGSL_MTY * (i * get()->tda + j ) ); }
1273 int fread( FILE* stream ){ return gsl_matrix_complex_long_double_fread( stream, get() ); }
1279 int fwrite( FILE* stream ) const { return gsl_matrix_complex_long_double_fwrite( stream, get() ); }
1285 int fscanf( FILE* stream ){ return gsl_matrix_complex_long_double_fscanf( stream, get() ); }
1292 int fprintf( FILE* stream, char const* format ) const {
1293 return gsl_matrix_complex_long_double_fprintf( stream, get(), format ); }
1302 matrix_complex_long_double( block_complex_long_double& b, size_t const offset, size_t const n1, size_t const n2, size_t const d2 ){
1303 ccgsl_pointer = gsl_matrix_complex_long_double_alloc_from_block( b.get(), offset, n1, n2, d2 );
1304 // just plausibly we could allocate vector_complex_long_double but not count
1305 try { count = new size_t; } catch( std::bad_alloc& e ){
1306 // try to tidy up before rethrowing
1307 gsl_matrix_complex_long_double_free( ccgsl_pointer );
1308 throw e;
1309 }
1310 *count = 1; // initially there is just one reference to ccgsl_pointer
1311 }
1320 matrix_complex_long_double( matrix_complex_long_double& m, size_t const k1, size_t const k2, size_t const n1, size_t const n2 ){
1321 ccgsl_pointer = gsl_matrix_complex_long_double_alloc_from_matrix( m.get(), k1, k2, n1, n2 );
1322 // just plausibly we could allocate matrix_complex_long_double but not count
1323 try { count = new size_t; } catch( std::bad_alloc& e ){
1324 // try to tidy up before rethrowing
1325 gsl_matrix_complex_long_double_free( ccgsl_pointer );
1326 throw e;
1327 }
1328 *count = 1; // initially there is just one reference to ccgsl_pointer
1329 }
1330 // More functions
1334 void set_identity(){ gsl_matrix_complex_long_double_set_identity( get() ); }
1341 int swap_rows( size_t const i, size_t const j ){ return gsl_matrix_complex_long_double_swap_rows( get(), i, j ); }
1348 int swap_columns( size_t const i, size_t const j ){
1349 return gsl_matrix_complex_long_double_swap_columns( get(), i, j ); }
1357 int swap_rowcol( size_t const i, size_t const j ){ return gsl_matrix_complex_long_double_swap_rowcol( get(), i, j ); }
1362 int transpose(){ return gsl_matrix_complex_long_double_transpose( get() ); }
1369 return gsl_matrix_complex_long_double_transpose_memcpy( get(), src.get() ); }
1375 int
1377 return gsl_matrix_complex_long_double_mul_elements( get(), b.get() ); }
1385 return gsl_matrix_complex_long_double_div_elements( get(), b.get() ); }
1392 return gsl_matrix_complex_long_double_conjtrans_memcpy( get(), src.get() ); }
1399 return gsl_matrix_complex_long_double_scale_rows( get(), x.get() ); }
1406 return gsl_matrix_complex_long_double_scale_columns( get(), x.get() ); }
1413 return gsl_matrix_complex_long_double_add_diagonal( get(), x ); }
1420 int get_row( vector_complex_long_double& v, size_t const i ) const {
1421 return gsl_matrix_complex_long_double_get_row( v.get(), get(), i ); }
1428 int get_col( vector_complex_long_double& v, size_t const j ) const {
1429 return gsl_matrix_complex_long_double_get_col( v.get(), get(), j ); }
1436 int set_row( size_t const i, vector_complex_long_double const& v ){
1437 return gsl_matrix_complex_long_double_set_row( get(), i, v.get() ); }
1444 int set_col( size_t const j, vector_complex_long_double const& v ){
1445 return gsl_matrix_complex_long_double_set_col( get(), j, v.get() ); }
1446 // Extra functions for []
1455 // First check that iterator is initialised.
1456 if( ccgsl_pointer == 0 ){
1457 gsl_error( "matrix_complex_long_double is null", __FILE__, __LINE__, exception::GSL_EFAILED );
1459 }
1461 gsl_vector_complex_long_double_view w = gsl_matrix_complex_long_double_row( ccgsl_pointer, i );
1463 return v;
1464 }
1472 vector_complex_long_double const operator[]( size_t const i ) const {
1473 // First check that iterator is initialised.
1474 if( ccgsl_pointer == 0 ){
1475 gsl_error( "matrix_complex_long_double is null", __FILE__, __LINE__, exception::GSL_EFAILED );
1477 }
1479 gsl_vector_complex_long_double_view w = gsl_matrix_complex_long_double_row( ccgsl_pointer, i );
1481 return v;
1482 }
1488 inline int
1490 return gsl_permute_matrix_complex_long_double( p.get(), get() ); }
1491 };
1492
1493 // Extra functions for vector_complex_long_double allocation from matrix_complex_long_double objects
1495 inline vector_complex_long_double vector_complex_long_double::alloc_row_from_matrix( matrix_complex_long_double& m, size_t const i ){
1496 return vector_complex_long_double ( gsl_vector_complex_long_double_alloc_row_from_matrix( m.get(), i ) ); }
1497 inline vector_complex_long_double vector_complex_long_double::alloc_col_from_matrix( matrix_complex_long_double& m, size_t const i ){
1498 return vector_complex_long_double ( gsl_vector_complex_long_double_alloc_col_from_matrix( m.get(), i ) ); }
1500}
1501#undef CCGSL_MTY
1502#endif
This class handles vector_complex_long_doubles as shared handles.
This class can be used like a pointer for complex_long_double objects so that we can iterate over a v...
This class handles complex_long_double numbers.
This class is used to handle gsl exceptions so that gsl can use these rather than the GSL error handl...
Definition: exception.hpp:387
@ GSL_EFAILED
generic failure
Definition: exception.hpp:476
@ GSL_EINVAL
invalid argument supplied by user
Definition: exception.hpp:475
@ GSL_EBADLEN
matrix, vector lengths are not conformant
Definition: exception.hpp:490
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > operator--(int)
The postfix – operator.
const_iterator_t(matrix_complex_long_double const *v, size_t position)
This constructor allows vector to create non-default iterators.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
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< reverse_t > & operator--()
The prefix – operator.
const_iterator_t< reverse_t > & operator=(const_iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
We create a suitable class for iterator types here.
iterator_base(container *v, size_t position)
This constructor allows vector to create non-default iterators.
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.
vector_complex_long_double_ptr pointer
An iterator must have a pointer typea.
size_t position
Mark position of iterator within matrix.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
value_type reference
An iterator must have a reference type.
container * v
Store a pointer to a matrix we can iterate over: 0 if no matrix.
vector_complex_long_double value_type
An iterator must have a value type.
reference operator*() const
Dereference the pointer.
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--(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.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t(matrix_complex_long_double *v, size_t position)
This constructor allows vector 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.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
This class handles matrix_complex_long_double objects as shared handles.
static matrix_complex_long_double view_vector_with_tda(vector_complex_long_double &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_complex_long_double_view_vector_with_tda().
const_iterator begin() const
Get iterator pointing to first vector_complex_long_double element.
vector_complex_long_double const const_diagonal() const
C++ version of gsl_matrix_complex_long_double_const_diagonal().
static matrix_complex_long_double calloc(size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_calloc().
static matrix_complex_long_double const view_vector_with_tda(vector_complex_long_double const &v, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_complex_long_double_const_view_vector_with_tda().
vector_complex_long_double superdiagonal(size_t const k)
C++ version of gsl_matrix_complex_long_double_superdiagonal().
int ispos() const
C++ version of gsl_matrix_complex_long_double_ispos().
matrix_complex_long_double & operator=(matrix_complex_long_double &&v)
Move operator.
int transpose()
C++ version of gsl_matrix_complex_long_double_transpose().
void transpose_tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_complex_long_double const &src)
Copy the upper or lower triangular part of matrix src to this.
iterator begin()
Get iterator pointing to first vector_complex_long_double element.
matrix_complex_long_double(matrix_complex_long_double &&v)
Move constructor.
vector_complex_long_double diagonal()
C++ version of gsl_matrix_complex_long_double_diagonal().
gsl_matrix_complex_long_double * get()
Get the gsl_matrix_complex_long_double.
vector_complex_long_double subdiagonal(size_t const k)
C++ version of gsl_matrix_complex_long_double_subdiagonal().
static matrix_complex_long_double const const_view_vector_with_tda(vector_complex_long_double const &v, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_complex_long_double_const_view_vector_with_tda().
void swap(matrix_complex_long_double &m)
Swap two matrix_complex_long_double objects.
static matrix_complex_long_double const view_array_with_tda(long double const *base, size_t const n1, size_t const n2, size_t const tda)
Another C++ version of gsl_matrix_complex_long_double_const_view_array_with_tda().
matrix_complex_long_double clone() const
The clone function.
int swap_rows(size_t const i, size_t const j)
C++ version of gsl_matrix_complex_long_double_swap_rows().
iterator_t< false > iterator
The iterator type.
static matrix_complex_long_double const const_view_array(long double const *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_const_view_array().
void reset()
Stop sharing ownership of the shared pointer.
vector_complex_long_double const operator[](size_t const i) const
This function allows us to use a matrix_complex_long_double like an array.
vector_complex_long_double const const_subdiagonal(size_t const k) const
C++ version of gsl_matrix_complex_long_double_const_subdiagonal().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
reverse_iterator rend()
Get iterator pointing beyond last vector_complex_long_double element.
complex_long_double_ptr ptr(size_t const i, size_t const j)
C++ version of gsl_matrix_complex_long_double_ptr().
int swap_columns(size_t const i, size_t const j)
C++ version of gsl_matrix_complex_long_double_swap_columns().
int add_diagonal(complex_long_double const x)
C++ version of gsl_matrix_complex_long_double_add_diagonal().
static matrix_complex_long_double const view_array(long double const *base, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_complex_long_double_const_view_array().
const_iterator end() const
Get iterator pointing beyond last vector_complex_long_double element.
vector_complex_long_double const subdiagonal(size_t const k) const
Another C++ version of gsl_matrix_complex_long_double_const_subdiagonal().
static matrix_complex_long_double view_array_with_tda(long double *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_complex_long_double_view_array_with_tda().
static matrix_complex_long_double const const_view_array_with_tda(long double const *base, size_t const n1, size_t const n2, size_t const tda)
C++ version of gsl_matrix_complex_long_double_const_view_array_with_tda().
size_t use_count() const
Find how many matrix_complex_long_double objects share this pointer.
vector_complex_long_double const subcolumn(size_t const j, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_complex_long_double_const_subcolumn().
void tricpy(CBLAS_UPLO_t Uplo, CBLAS_DIAG_t Diag, matrix_complex_long_double const &src)
Copy the upper or lower triangular part of matrix src to this.
gsl_matrix_complex_long_double const * get() const
Get the gsl_matrix_complex_long_double.
static matrix_complex_long_double const const_view_vector(vector_complex_long_double const &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_const_view_vector().
int memcpy(matrix_complex_long_double const &src)
C++ version of gsl_matrix_complex_long_double_memcpy().
matrix_complex_long_double 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_complex_long_double_const_submatrix().
vector_complex_long_double const column(size_t const j) const
Another C++ version of gsl_matrix_complex_long_double_const_column().
int scale_rows(vector_complex_long_double const &x)
C++ version of gsl_matrix_complex_long_double_scale_rows().
int isneg() const
C++ version of gsl_matrix_complex_long_double_isneg().
bool unique() const
Find if this is the only object sharing the gsl_matrix_complex_long_double.
vector_complex_long_double const subrow(size_t const i, size_t const offset, size_t const n) const
Another C++ version of gsl_matrix_complex_long_double_const_subrow().
static matrix_complex_long_double const view_vector(vector_complex_long_double const &v, size_t const n1, size_t const n2)
Another C++ version of gsl_matrix_complex_long_double_const_view_vector().
complex_long_double_ptr const const_ptr(size_t const i, size_t const j) const
C++ version of gsl_matrix_complex_long_double_const_ptr().
int isnonneg() const
C++ version of gsl_matrix_complex_long_double_isnonneg().
matrix_complex_long_double(gsl_matrix_complex_long_double *v)
Could construct from a gsl_matrix_complex_long_double.
int fread(FILE *stream)
C++ version of gsl_matrix_complex_long_double_fread().
vector_complex_long_double const const_row(size_t const i) const
C++ version of gsl_matrix_complex_long_double_const_row().
vector_complex_long_double const const_subrow(size_t const i, size_t const offset, size_t const n) const
C++ version of gsl_matrix_complex_long_double_const_subrow().
matrix_complex_long_double(size_t const n1, size_t const n2)
The default constructor creates a new matrix_complex_long_double with n1 * n1 elements.
static matrix_complex_long_double view_array(long double *base, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_view_array().
static matrix_complex_long_double view_vector(vector_complex_long_double &v, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_view_vector().
vector_complex_long_double subcolumn(size_t const j, size_t const offset, size_t const n)
C++ version of gsl_matrix_complex_long_double_subcolumn().
reverse_iterator rbegin()
Get iterator pointing to first vector_complex_long_double element.
int swap_rowcol(size_t const i, size_t const j)
C++ version of gsl_matrix_complex_long_double_swap_rowcol().
int sub(matrix_complex_long_double const &b)
C++ version of gsl_matrix_complex_long_double_sub().
vector_complex_long_double operator[](size_t const i)
This function allows us to use a matrix_complex_long_double like an array.
matrix_complex_long_double 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_complex_long_double_const_submatrix().
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_complex_long_double element.
matrix_complex_long_double(matrix_complex_long_double &m, size_t const k1, size_t const k2, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_alloc_from_matrix().
vector_complex_long_double const const_column(size_t const j) const
C++ version of gsl_matrix_complex_long_double_const_column().
vector_complex_long_double const const_subcolumn(size_t const j, size_t const offset, size_t const n) const
C++ version of gsl_matrix_complex_long_double_const_subcolumn().
size_t size_type
A container must have a size_type.
void set_identity()
C++ version of gsl_matrix_complex_long_double_set_identity().
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_matrix_complex_long_double_fprintf().
iterator end()
Get iterator pointing beyond last vector_complex_long_double element.
matrix_complex_long_double()
The default constructor is only really useful for assigning to.
int set_row(size_t const i, vector_complex_long_double const &v)
C++ version of gsl_matrix_complex_long_double_set_row().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_complex_long_double element.
int scale(complex_long_double const x)
C++ version of gsl_matrix_complex_long_double_scale().
int set_col(size_t const j, vector_complex_long_double const &v)
C++ version of gsl_matrix_complex_long_double_set_col().
int get_col(vector_complex_long_double &v, size_t const j) const
C++ version of gsl_matrix_complex_long_double_get_col().
iterator_t< true > reverse_iterator
The reverse_iterator type.
size_t size2() const
The number of columns of the matrix_complex_long_double.
matrix_complex_long_double(std::initializer_list< std::initializer_list< std::complex< long double > > > initializer_list)
Could construct from a std::initializer_list in C++11.
matrix_complex_long_double submatrix(size_t const i, size_t const j, size_t const n1, size_t const n2)
C++ version of gsl_matrix_complex_long_double_submatrix().
vector_complex_long_double const diagonal() const
Another C++ version of gsl_matrix_complex_long_double_const_diagonal().
int isnull() const
C++ version of gsl_matrix_complex_long_double_isnull().
gsl_matrix_complex_long_double * ccgsl_pointer
The shared pointer.
int get_row(vector_complex_long_double &v, size_t const i) const
C++ version of gsl_matrix_complex_long_double_get_row().
matrix_complex_long_double(block_complex_long_double &b, size_t const offset, size_t const n1, size_t const n2, size_t const d2)
C++ version of gsl_matrix_complex_long_double_alloc_from_block().
int div_elements(matrix_complex_long_double const &b)
C++ version of gsl_matrix_complex_long_double_div_elements().
vector_complex_long_double const row(size_t const i) const
Another C++ version of gsl_matrix_complex_long_double_const_row().
int add_constant(complex_long_double const x)
C++ version of gsl_matrix_complex_long_double_add_constant().
vector_complex_long_double column(size_t const j)
C++ version of gsl_matrix_complex_long_double_column().
void set_all(complex_long_double x)
C++ version of gsl_matrix_complex_long_double_set_all().
vector_complex_long_double const const_superdiagonal(size_t const k) const
C++ version of gsl_matrix_complex_long_double_const_superdiagonal().
~matrix_complex_long_double()
The destructor only deletes the pointers if count reaches zero.
int permute(permutation &p)
Permute the columns of this by permutation p.
matrix_complex_long_double & operator=(matrix_complex_long_double const &v)
The assignment operator.
void set(size_t const i, size_t const j, complex_long_double x)
C++ version of gsl_matrix_complex_long_double_set().
void set_zero()
C++ version of gsl_matrix_complex_long_double_set_zero().
size_t size1() const
The number of rows of the matrix_complex_long_double.
int transpose_memcpy(matrix_complex_long_double const &src)
C++ version of gsl_matrix_complex_long_double_transpose_memcpy().
int scale_columns(vector_complex_long_double const &x)
C++ version of gsl_matrix_complex_long_double_scale_columns().
int add(matrix_complex_long_double const &b)
C++ version of gsl_matrix_complex_long_double_add().
vector_complex_long_double row(size_t const i)
C++ version of gsl_matrix_complex_long_double_row().
complex_long_double get(size_t const i, size_t const j) const
C++ version of gsl_matrix_complex_long_double_get().
int fwrite(FILE *stream) const
C++ version of gsl_matrix_complex_long_double_fwrite().
vector_complex_long_double subrow(size_t const i, size_t const offset, size_t const n)
C++ version of gsl_matrix_complex_long_double_subrow().
const_iterator_t< false > const_iterator
The const_iterator type.
size_t * count
The shared reference count.
int mul_elements(matrix_complex_long_double const &b)
C++ version of gsl_matrix_complex_long_double_mul_elements().
int fscanf(FILE *stream)
C++ version of gsl_matrix_complex_long_double_fscanf().
int conjtrans_memcpy(matrix_complex_long_double const &src)
C++ version of gsl_matrix_complex_long_double_conjtrans_memcpy().
vector_complex_long_double const superdiagonal(size_t const k) const
Another C++ version of gsl_matrix_complex_long_double_const_superdiagonal().
matrix_complex_long_double(matrix_complex_long_double const &v)
The copy constructor.
This class handles GSL permutation objects.
Definition: permutation.hpp:33
gsl_permutation * get()
Get the gsl_permutation.
This class handles vector_complex_long_double objects as shared handles.
static vector_complex_long_double alloc_col_from_matrix(matrix_complex_long_double &m, size_t const j)
C++ version of gsl_vector_complex_long_double_alloc_col_from_matrix().
vector_complex_long_double()
The default constructor is only really useful for assigning to.
static vector_complex_long_double alloc_row_from_matrix(matrix_complex_long_double &m, size_t const i)
C++ version of gsl_vector_complex_long_double_alloc_row_from_matrix().
gsl_vector_complex_long_double * get()
Get the gsl_vector_complex_long_double.
void wrap_gsl_vector_complex_long_double_without_ownership(gsl_vector_complex_long_double *v)
This function is intended mainly for internal use.
#define CCGSL_MTY
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
Definition: rstat.hpp:299
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
Definition: sf_mathieu.hpp:298
gsl_sf_result result
Typedef for gsl_sf_result.
Definition: sf_result.hpp:30
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34
This is a pointer-like type for iterator return values.
vector_complex_long_double_ptr(vector_complex_long_double const &v)
Typically we have to construct from a vector_complex_long_double.
vector_complex_long_double & operator*()
Dereference operator.
vector_complex_long_double * operator->()
Dereference operator.