ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
block_complex_long_double.hpp
Go to the documentation of this file.
1/*
2 * $Id: block_complex_long_double.hpp 288 2012-12-04 15:31:18Z jdl3 $
3 * Copyright (C) 2010, 2011, 2012, 2024 John D Lamb
4 * Enum copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef CCGSL_BLOCK_COMPLEX_LONG_DOUBLE_HPP
22#define CCGSL_BLOCK_COMPLEX_LONG_DOUBLE_HPP
23
24#include<gsl/gsl_block.h>
25#include<new>
26#include<iterator>
27#include<cstring>
28#include<cstddef>
29#ifdef __GXX_EXPERIMENTAL_CXX0X__
30#include<complex>
31#endif
32
33#include"exception.hpp"
34
35// This file is autogenerated
37#define CCGSL_MTY 2
38
39namespace gsl {
45 public:
50 ccgsl_pointer = 0;
51 count = 0; // initially nullptr will do
52 }
53 // Refines random access container
54 // Refines assignable
59 explicit block_complex_long_double( size_t const n ){
60 ccgsl_pointer = gsl_block_complex_long_double_calloc( n );
61 if( n > 0 )
62 ccgsl_pointer = gsl_block_complex_long_double_alloc( n );
63 else {
64 ccgsl_pointer = new gsl_block_complex_long_double;
65 ccgsl_pointer->size = 0;
66 ccgsl_pointer->data = 0;
67 }
68 // just plausibly we could allocate block_complex_long_double but not count
69 try { count = new size_t; } catch( std::bad_alloc& e ){
70 // try to tidy up before rethrowing
71 if( n > 0 ) gsl_block_complex_long_double_free( ccgsl_pointer );
72 else delete ccgsl_pointer;
73 throw e;
74 }
75 *count = 1; // initially there is just one reference to ccgsl_pointer
76 }
82 explicit block_complex_long_double( gsl_block_complex_long_double* v ){
83 ccgsl_pointer = v;
84 // just plausibly we could fail to allocate count: no further action needed.
85 count = new size_t;
86 *count = 1; // initially there is just one reference to ccgsl_pointer
87 }
88#ifdef __GXX_EXPERIMENTAL_CXX0X__
93 block_complex_long_double( std::initializer_list<std::complex<long double> > initializer_list ){
94 size_t const n = initializer_list.size();
95 ccgsl_pointer = gsl_block_complex_long_double_alloc( n );
96 // just plausibly we could allocate vector but not count
97 try { count = new size_t; } catch( std::bad_alloc& e ){
98 // try to tidy up before rethrowing
99 if( n > 0 ) gsl_block_complex_long_double_free( ccgsl_pointer );
100 else delete ccgsl_pointer;
101 throw e;
102 }
103 *count = 1; // initially there is just one reference to ccgsl_pointer
104 // now copy
105 auto p = begin();
106 for( auto x : initializer_list ){
107 *p = complex_long_double( std::move( x ) ); ++p;
108 }
109 }
110#endif
111 // copy constructor
117 if( count != 0 ) ++*count; // block_complex_long_double is now shared.
118 }
119 // assignment operator
125 // first, possibly delete anything pointed to by this
126 if( count == 0 or --*count == 0 ){
127 if( ccgsl_pointer != 0 ){
128 if( ccgsl_pointer->size > 0 ) gsl_block_complex_long_double_free( ccgsl_pointer );
129 else delete ccgsl_pointer; }
130 delete count;
131 }
132 // Then copy
134 count = v.count;
135 if( count != 0 ) ++*count; // block_complex_long_double is now shared.
136 return *this;
137 }
138 // clone()
146 // Now copy
147 memcpy( copy.ccgsl_pointer->data, ccgsl_pointer->data,
148 CCGSL_MTY * ccgsl_pointer->size * sizeof( long double ) );
149 // return new object
150 return copy;
151 }
152 // destructor
157 if( count != 0 and --*count == 0 ){
158 // could have allocated null pointer
159 if( ccgsl_pointer != 0 ){
160 if( ccgsl_pointer->size > 0 ) gsl_block_complex_long_double_free( ccgsl_pointer );
161 else delete ccgsl_pointer; }
162 delete count;
163 }
164 }
168 void reset(){ block_complex_long_double().swap( *this ); }
169#ifdef __GXX_EXPERIMENTAL_CXX0X__
175 std::swap( count, v.count );
176 v.ccgsl_pointer = nullptr;
177 }
184 block_complex_long_double( std::move( v ) ).swap( *this );
185 return *this;
186 }
187#endif
188 // Refines equality comparable
189 // == operator
196 bool operator==( block_complex_long_double const& v ) const {
197 // trivially equal if gsl_block_complex_long_double*s are identical
198 if( ccgsl_pointer == v.ccgsl_pointer ) return true;
199 // trivially not equal if one is zero: != should be same as xor here
200 if( (ccgsl_pointer == 0) != (v.ccgsl_pointer == 0 ) ) return false;
201 // trivially not equal if sizes are different
202 if( ccgsl_pointer->size != v.ccgsl_pointer->size ) return false;
203 // check elementwise for equality
204 for( size_t i = 0; i < CCGSL_MTY * ccgsl_pointer->size; ++i )
205 if( ccgsl_pointer->data[i] != v.ccgsl_pointer->data[i] ) return false;
206 return true;
207 }
208 // != operator
215 bool operator!=( block_complex_long_double const& v ) const { return not operator==( v ); }
216 // Refines forward container
217 // Refines less than comparable
218 // operator<
227 bool operator<( block_complex_long_double const& v ) const {
228 // null block_complex_long_double comes first
229 if( ccgsl_pointer == 0 ) return v.ccgsl_pointer != 0;
230 // if v is null then this > v
231 if( v.ccgsl_pointer == 0 ) return false;
232 // Now compare elementwise
233 size_t const size = CCGSL_MTY * ccgsl_pointer->size;
234 size_t const v_size = CCGSL_MTY * v.ccgsl_pointer->size;
235 size_t const min = size > v_size ? size : v_size;
236 for( size_t i = 0; i < min; ++i ){
237 long double const t = ccgsl_pointer->data[i];
238 long double const u =v.ccgsl_pointer->data[i];
239 if( t < u ) return true;
240 if( u < t ) return false;
241 }
242 // elements match.
243 return size < v_size;
244 }
245 // operator>
254 bool operator>( block_complex_long_double const& v ) const {
255 // null block_complex_long_double comes first
256 if( ccgsl_pointer == 0 ) return false;
257 // if v is null then this > v
258 if( v.ccgsl_pointer == 0 ) return true;
259 // Now compare elementwise
260 size_t const size = CCGSL_MTY * ccgsl_pointer->size;
261 size_t const v_size = CCGSL_MTY * v.ccgsl_pointer->size;
262 size_t const min = size > v_size ? size : v_size;
263 for( size_t i = 0; i < min; ++i ){
264 long double const t = ccgsl_pointer->data[i];
265 long double const u =v.ccgsl_pointer->data[i];
266 if( t > u ) return true;
267 if( u > t ) return false;
268 }
269 // elements match.
270 return size > v_size;
271 }
272 // operator<=
281 bool operator<=( block_complex_long_double const& v ) const {
282 return operator<( v ) or operator==( v );
283 }
284 // operator>=
293 bool operator>=( block_complex_long_double const& v ) const {
294 return operator>( v ) or operator==( v );
295 }
296 // Refines container
297 // type value_type
302 // type reference
307 // type const_reference
312 // type pointer
317 // type const_pointer
322 // type iterator
323 private:
328 template<typename container, typename content,bool reverse>
331 public:
347 typedef std::random_access_iterator_tag iterator_category;
348 // // type iterator_traits<block_complex_long_double>::difference_type
352 typedef ptrdiff_t difference_type;
353 public:
354 // // operator*
360 // First check that iterator is initialised.
361 if( v == 0 ){
362 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
363 return complex_long_double_ref( 0 );
364 } else if( v->ccgsl_pointer == 0 ){
365 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
366 return complex_long_double_ref( 0 );
367 }
368 // Check that position make sense
369 if( position >= static_cast<difference_type>( v->size() ) ){
370 gsl_error( "trying to dereference beyond rbegin()", __FILE__, __LINE__, exception::GSL_EFAILED );
371 return complex_long_double_ref( 0 );
372 }
373 if( position <= -1 ){
374 gsl_error( "trying to dereference beyond begin()", __FILE__, __LINE__, exception::GSL_EFAILED );
375 return complex_long_double_ref( 0 );
376 }
377 // position and v are valid: return data
378 return complex_long_double_ref( v->ccgsl_pointer->data + CCGSL_MTY * position );
379 }
380 // // operator->
386 // First check that iterator is initialised.
387 if( v == 0 ){
388 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
389 return pointer( 0 );
390 } else if( v->ccgsl_pointer == 0 ){
391 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
392 return pointer( 0 );
393 }
394 // Check that position make sense
395 if( position >= static_cast<difference_type>( v->size() ) ){
396 gsl_error( "trying to dereference end()", __FILE__, __LINE__, exception::GSL_EFAILED );
397 return pointer( 0 );
398 }
399 if( position <= -1 ){
400 gsl_error( "trying to dereference rend()", __FILE__, __LINE__, exception::GSL_EFAILED );
401 return pointer( 0 );
402 }
403 // position and v are valid: return data
404 return pointer( v->ccgsl_pointer->data + CCGSL_MTY * position );
405 }
406 // // operator[]
413 // First check that iterator is initialised.
414 if( v == 0 ){
415 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
416 return complex_long_double_ref( 0 );
417 } else if( v->ccgsl_pointer == 0 ){
418 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
419 return complex_long_double_ref( 0 );
420 }
421 // Check that position make sense
422 difference_type const p = reverse ? position - n : position + n;
423 if( p >= static_cast<difference_type>( v->size() ) ){
424 gsl_error( "trying to dereference beyond rbegin()", __FILE__, __LINE__, exception::GSL_EFAILED );
425 return complex_long_double_ref( 0 );
426 }
427 if( p <= -1 ){
428 gsl_error( "trying to dereference beyond begin()", __FILE__, __LINE__, exception::GSL_EFAILED );
429 return complex_long_double_ref( 0 );
430 }
431 // p is a valid position
432 return complex_long_double_ref( v->ccgsl_pointer->data + CCGSL_MTY * p );
433 }
434 // // operator-: find distance between two iterators
441 // Warn if either iterator undefined
442 if( v == 0 or i.v == 0 ){
443 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
444 return 0;
445 } else if( v->ccgsl_pointer == 0 or i.v->ccgsl_pointer == 0 ){
446 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
447 return 0;
448 }
449 // Warn if iterators do not point to same block_complex_long_double
450 if( v->ccgsl_pointer != i.v->ccgsl_pointer ){
451 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
453 return 0;
454 }
455 return reverse ? i.position - position : position - i.position;
456 }
457 // // operator!=
458 // // operator<
465 return this->v == i.v and this->position == i.position;
466 }
473 return not this->operator==( i );
474 }
483 // Warn if either iterator undefined
484 if( v == 0 or i.v == 0 ){
485 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
486 return false;
487 }
488 // Warn if iterators do not point to same block_complex_long_double
489 if( v->ccgsl_pointer != i.v->ccgsl_pointer ){
490 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
492 return false;
493 }
494 return reverse ? i.position < position : position < i.position;
495 }
496 protected:
501 void increment(){
502 // Only makes sense if v points to a block_complex_long_double
503 if( v == 0 ){
504 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
505 return;
506 } else if( v->ccgsl_pointer == 0 ){
507 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
508 return;
509 }
510 // increment position and check against size
511 if( reverse ){ if( position >= 0 ) --position; }
512 else { if( position < static_cast<difference_type>( v->size() ) ) ++position; }
513 }
518 void decrement(){
519 // Only makes sense if v points to a block_complex_long_double
520 if( v == 0 ){
521 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
522 return;
523 } else if( v->ccgsl_pointer == 0 ){
524 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
525 return;
526 }
527 // decrement position and check against size
528 if( reverse ){ if( position < static_cast<difference_type>( v->size() ) ) ++position; }
529 else { if( position >= 0 ) --position; }
530 }
535 void shift( difference_type const n ){
536 // Warn if iterator undefined
537 if( v == 0 ){
538 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
539 return;
540 } else if( v->ccgsl_pointer == 0 ){
541 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
542 return;
543 }
544 position += reverse ? -n : n;
545 }
549 iterator_base(){ v = 0; }
556 : v( v ), position( position ){}
560 container* v;
565 };
566 // Need to know about const_iterator_t
567 template<bool reverse> class const_iterator_t;
571 template<bool reverse> class iterator_t : public iterator_base<block_complex_long_double,long double,reverse>{
572 public:
573 // // Refines output iterator
574 // // operator=
582 return *this;
583 }
584 // // Refines forward iterator
585 // // operator++ (both)
592 return *this;
593 }
599 // return value
602 return result;
603 }
604 // // Refines bidirectional iterator
605 // // operator-- (both)
612 return *this;
613 }
619 // return value
622 return result;
623 }
629 // // operator+=
636 this->shift( n );
637 return *this;
638 }
639 // // operator-=
646 this->shift( -n );
647 return *this;
648 }
649 // // operator+ (n+i)(i+n)
658 result.shift( n );
659 return result;
660 }
661 // // operator- (n-i)(i-n)(i-j)
670 result.shift( -n );
671 return result;
672 }
680 }
687 // Warn if either iterator undefined
688 if( this->v == 0 or i.v == 0 ){
689 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
690 return 0;
691 } else if( this->v->ccgsl_pointer == 0 or i.v->ccgsl_pointer == 0 ){
692 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
693 return 0;
694 }
695 // Warn if iterators do not point to same block_complex_long_double
696 if( this->v->ccgsl_pointer != i.v->ccgsl_pointer ){
697 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
699 return 0;
700 }
701 return reverse ? i.position - this->position : this->position - i.position;
702 }
708 bool operator==( const_iterator_t<reverse> const& i ) const {
709 return this->v == i.v and this->position == i.position;
710 }
716 bool operator!=( const_iterator_t<reverse> const& i ) const {
717 return not this->operator==( i );
718 }
724 bool operator<( const_iterator_t<reverse> const& i ) const {
725 // Warn if either iterator undefined
726 if( this->v == 0 or i.v == 0 ){
727 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
728 return false;
729 }
730 // Warn if iterators do not point to same block_complex_long_double
731 if( this->v->ccgsl_pointer != i.v->ccgsl_pointer ){
732 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
734 return false;
735 }
736 return reverse ? i.position < this->position : this->position < i.position;
737 }
742 protected:
744 // We need a constructor for block_complex_long_double
751 : iterator_base<block_complex_long_double,long double,reverse>( v, position ){}
752 };
756 template<bool reverse> class const_iterator_t
757 : public iterator_base<block_complex_long_double const,long double,reverse>{
758 public:
759 // // Refines output iterator
760 // // operator=
768 return *this;
769 }
770 // // Refines forward iterator
771 // // operator++ (both)
778 return *this;
779 }
785 // return value
788 return result;
789 }
790 // // Refines bidirectional iterator
791 // // operator-- (both)
798 return *this;
799 }
805 // return value
808 return result;
809 }
815 // // operator+=
822 this->shift( n );
823 return *this;
824 }
825 // // operator-=
832 this->shift( -n );
833 return *this;
834 }
835 // // operator+ (n+i)(i+n)
844 result += n;
845 return result;
846 }
847 // // operator- (n-i)(i-n)(i-j)
856 result -= n;
857 return result;
858 }
866 }
873 // Warn if either iterator undefined
874 if( this->v == 0 or i.v == 0 ){
875 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
876 return 0;
877 } else if( this->v->ccgsl_pointer == 0 or i.v->ccgsl_pointer == 0 ){
878 gsl_error( "block_complex_long_double not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
879 return 0;
880 }
881 // Warn if iterators do not point to same block_complex_long_double
882 if( this->v->ccgsl_pointer != i.v->ccgsl_pointer ){
883 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
885 return 0;
886 }
887 return reverse ? i.position - this->position : this->position - i.position;
888 }
900 }
906 bool operator==( iterator_t<reverse> const& i ) const {
907 return this->v == i.v and this->position == i.position;
908 }
914 bool operator!=( iterator_t<reverse> const& i ) const {
915 return not this->operator==( i );
916 }
922 bool operator<( iterator_t<reverse> const& i ) const {
923 // Warn if either iterator undefined
924 if( this->v == 0 or i.v == 0 ){
925 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
926 return false;
927 }
928 // Warn if iterators do not point to same block_complex_long_double
929 if( this->v->ccgsl_pointer != i.v->ccgsl_pointer ){
930 gsl_error( "trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
932 return false;
933 }
934 return reverse ? i.position < this->position : this->position < i.position;
935 }
941 bool operator==( const_iterator_t<reverse> const& i ) const {
942 return this->v == i.v and this->position == i.position;
943 }
949 bool operator!=( const_iterator_t<reverse> const& i ) const {
950 return not this->operator==( i );
951 }
957 bool operator<( const_iterator_t<reverse> const& i ) const {
958 // Warn if either iterator undefined
959 if( this->v == 0 or i.v == 0 ){
960 gsl_error( "iterator not initialised", __FILE__, __LINE__, exception::GSL_EFAILED );
961 return false;
962 }
963 // Warn if iterators do not point to same block_complex
964 if( this->v->ccgsl_pointer != i.v->ccgsl_pointer ){
965 gsl_error( "trying to take difference of iterators for different block_complexs", __FILE__, __LINE__,
967 return false;
968 }
969 return reverse ? i.position < this->position : this->position < i.position;
970 }
971 protected:
972 // We need a constructor for block_complex_long_double
980 : iterator_base<block_complex_long_double const,long double,reverse>( v, position ){}
981 };
982 public:
999 // type difference_type
1004 // type size_type
1008 typedef size_t size_type;
1009 // begin()
1015 return iterator( this, 0 );
1016 }
1022 return const_iterator( this, 0 );
1023 }
1024 // end()
1030 if( ccgsl_pointer == 0 ) return iterator( this, 0 );
1031 return iterator( this, size() );
1032 }
1038 if( ccgsl_pointer == 0 ) return const_iterator( this, 0 );
1039 return const_iterator( this, size() );
1040 }
1041 // size()
1046 size_type size() const { return ccgsl_pointer->size; }
1052 long double* data() {
1053 if( ccgsl_pointer == 0 ) gsl_error( "null block", __FILE__, __LINE__, GSL_EFAULT );
1054 return ccgsl_pointer->data; }
1060 long double const* data() const {
1061 if( ccgsl_pointer == 0 ) gsl_error( "null block", __FILE__, __LINE__, GSL_EFAULT );
1062 return ccgsl_pointer->data; }
1063 // max_size()
1069 size_type max_size() const { return ccgsl_pointer->size; }
1070 // empty()
1075 bool empty() const { return ccgsl_pointer == 0 or ccgsl_pointer->size == 0; }
1076 // swap() --- should work even if sizes don't match
1083 gsl_block_complex_long_double* tmp = ccgsl_pointer; ccgsl_pointer = v.ccgsl_pointer; v.ccgsl_pointer = tmp;
1084 size_t* tmp2 = count; count = v.count; v.count = tmp2;
1085 }
1086 // Refines reversible container
1087 // rbegin()
1093 if( ccgsl_pointer ==0 ) return reverse_iterator( this, 0 );
1094 return reverse_iterator( this, size() - 1 );
1095 }
1101 if( ccgsl_pointer ==0 ) return const_reverse_iterator( this, 0 );
1102 return const_reverse_iterator( this, size() - 1 );
1103 }
1104 // rend()
1110 return reverse_iterator( this, -1 );
1111 }
1117 return const_reverse_iterator( this, -1 );
1118 }
1119 // operator[]
1125 reference operator[]( size_t const n ){
1126 // Always try to return something
1127 static complex_long_double something;
1128 // First check that iterator is initialised.
1129 if( ccgsl_pointer == 0 ){
1130 gsl_error( "block_complex_long_double is null", __FILE__, __LINE__, exception::GSL_EFAILED );
1131 return something;
1132 }
1133#ifndef GSL_RANGE_CHECK_OFF
1134 // Check that position make sense
1135 if( n >= size() ){
1136 gsl_error( "trying to read beyond end of block_complex_long_double", __FILE__, __LINE__, exception::GSL_EFAILED );
1137 return something;
1138 }
1139 // n is a valid position
1140#endif
1142 }
1148 const_reference operator[]( size_t const n ) const {
1149 // Always try to return something
1150 static complex_long_double something;
1151 // First check that iterator is initialised.
1152 if( ccgsl_pointer == 0 ){
1153 gsl_error( "block_complex_long_double is null", __FILE__, __LINE__, exception::GSL_EFAILED );
1154 return something;
1155 }
1156#ifndef GSL_RANGE_CHECK_OFF
1157 // Check that position make sense
1158 if( n >= size() ){
1159 gsl_error( "trying to read beyond end of block_complex_long_double", __FILE__, __LINE__, exception::GSL_EFAILED );
1160 return something;
1161 }
1162 // n is a valid position
1163#endif
1165 }
1166 private:
1170 gsl_block_complex_long_double* ccgsl_pointer;
1174 size_t* count;
1175 public:
1176 // shared reference functions
1181 gsl_block_complex_long_double* get() const { return ccgsl_pointer; }
1187 bool unique() const { return count != 0 and *count == 1; }
1192 size_t use_count() const { return count == 0 ? 0 : *count; }
1198#ifdef __GXX_EXPERIMENTAL_CXX0X__
1199 explicit
1200#endif
1201 operator bool() const { return ccgsl_pointer != 0; }
1202 };
1203
1204 // gsl functions
1205
1215 return i + n;
1216 }
1217
1227 return i + n;
1228 }
1229
1239 return i + n;
1240 }
1241
1251 return i + n;
1252 }
1253
1254}
1255
1256#undef CCGSL_MTY
1257#endif
#define CCGSL_MTY
bool operator<(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > operator++(int)
The postfix ++ operator.
difference_type operator-(const_iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
const_iterator_t< reverse > & operator--()
The prefix – operator.
const_iterator_t< reverse > & operator++()
The prefix ++ operator.
const_iterator_t< reverse > & operator=(const_iterator_t< reverse > const &i)
We can assign one output iterator from another.
const_iterator_t< reverse > operator--(int)
The postfix – operator.
bool operator!=(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > & operator+=(difference_type const n)
The += operator.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_base< block_complex_long_doubleconst, longdouble, reverse >::difference_type difference_type
Difference type.
bool operator==(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
bool operator<(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
const_iterator_t(iterator_t< reverse > const &i)
A copy constructor.
const_iterator_t(block_complex_long_double const *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
bool operator==(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
const_iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
const_iterator_t< reverse > operator+(difference_type const n) const
The + operator.
bool operator<(iterator_base< container, content, reverse > const &i) const
The < operator is used to compare iterators.
complex_long_double_ptr pointer
An iterator must have a pointer type.
pointer operator->() const
Dereference the pointer.
void shift(difference_type const n)
Shift iterator n places.
std::random_access_iterator_tag iterator_category
An iterator must have a pointer type.
reference operator[](difference_type const n) const
Get element at i + n by reference ([] operator).
ptrdiff_t difference_type
An iterator must have a difference_type.
iterator_base()
The iterator is default constructible.
complex_long_double value_type
An iterator must have a value_type.
bool operator==(iterator_base< container, content, reverse > const &i) const
The == operator.
container * v
Store a pointer to a block_complex_long_double we can iterate over: 0 if no block_complex_long_double...
bool operator!=(iterator_base< container, content, reverse > const &i) const
The != operator.
complex_long_double_ref reference
An iterator must have a reference type.
difference_type operator-(iterator_base< container, content, reverse > const &i) const
The - operator: find distance between two iterators.
reference operator*() const
Dereference the pointer.
difference_type position
Mark position of iterator within block_complex_long_double.
iterator_base(container *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
A class template for the two non-const iterators.
bool operator==(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse > operator+(difference_type const n) const
The + operator.
iterator_t< reverse > & operator++()
The prefix ++ operator.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_t< reverse > operator--(int)
The postfix – operator.
bool operator<(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
iterator_t< reverse > & operator--()
The prefix – operator.
iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
iterator_t< reverse > operator++(int)
The postfix ++ operator.
iterator_t(block_complex_long_double *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
iterator_t< reverse > & operator=(iterator_t< reverse > const &i)
We can assign one output iterator from another.
iterator_t< reverse > & operator+=(difference_type const n)
The += operator.
difference_type operator-(const_iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_base< block_complex_long_double, longdouble, reverse >::difference_type difference_type
Difference type.
This class handles vector_complex_long_doubles as shared handles.
block_complex_long_double & operator=(block_complex_long_double const &v)
The assignment operator.
reverse_iterator rend()
Get iterator pointing beyond last block_complex_long_double element.
complex_long_double_ptr const const_pointer
A container must have a constant pointer type.
bool unique() const
Find if this is the only object sharing the gsl_block_complex_long_double.
size_t use_count() const
Find how many block_complex_long_double objects share this pointer.
reference operator[](size_t const n)
Get element at position n by reference ([] operator).
block_complex_long_double(std::initializer_list< std::complex< long double > > initializer_list)
Could construct from a std::initializer_list in C++11.
const_reference operator[](size_t const n) const
Get element at position n by reference ([] operator).
size_t * count
The shared reference count.
block_complex_long_double(size_t const n)
The default constructor creates a new block_complex_long_double with n elements.
complex_long_double_ptr pointer
A container must have a pointer type.
const_iterator::difference_type difference_type
A container must have a difference_type.
const_iterator_t< false > const_iterator
The const_iterator type.
void reset()
Stop sharing ownership of the shared pointer.
block_complex_long_double(gsl_block_complex_long_double *v)
Could construct from a gsl_block_complex_long_double.
gsl_block_complex_long_double * get() const
Get the gsl_block_complex_long_double.
reference const const_reference
A container must have a constant reference type.
const_iterator begin() const
Get iterator pointing to first block_complex_long_double element.
size_type max_size() const
The max size (number of elements) of the block_complex_long_double.
const_reverse_iterator rbegin() const
Get iterator pointing to first block_complex_long_double element.
bool operator<(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
block_complex_long_double(block_complex_long_double const &v)
The copy constructor.
bool operator>(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
block_complex_long_double(block_complex_long_double &&v)
Move constructor.
block_complex_long_double()
The default constructor is only really useful for assigning to.
void swap(block_complex_long_double &v)
Swap two block_complex_long_double objects.
gsl_block_complex_long_double * ccgsl_pointer
The shared pointer.
iterator_t< false > iterator
The iterator type.
bool empty() const
Find if the block_complex_long_double is empty.
block_complex_long_double & operator=(block_complex_long_double &&v)
Move operator.
const_iterator_t< true > const_reverse_iterator
The const_reverse_iterator type.
long double * data()
Give access to the data block.
complex_long_double value_type
A container must have a value_type.
const_reverse_iterator rend() const
Get iterator pointing beyond last block_complex_long_double element.
size_t size_type
A container must have a size_type.
size_type size() const
The size (number of elements) of the block_complex_long_double.
iterator begin()
Get iterator pointing to first block_complex_long_double element.
block_complex_long_double clone() const
The clone function.
const_iterator end() const
Get iterator pointing beyond last block_complex_long_double element.
~block_complex_long_double()
The destructor only deletes the pointers if count reaches zero.
iterator end()
Get iterator pointing beyond last block_complex_long_double element.
complex_long_double_ref reference
A container must have a reference type.
bool operator!=(block_complex_long_double const &v) const
Two block_complex_long_double objects are different equal if their elements are not identical.
reverse_iterator rbegin()
Get iterator pointing to first block_complex_long_double element.
bool operator<=(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
bool operator>=(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
bool operator==(block_complex_long_double const &v) const
Two block_complex_long_double objects are identically equal if their elements are identical.
iterator_t< true > reverse_iterator
The reverse_iterator type.
long double const * data() const
Give access to the data block.
This class can be used like a pointer for complex_long_double objects so that we can iterate over a v...
This class can be used like a reference for complex_long_double objects so that we can iterate over a...
This class handles complex_long_double numbers.
@ GSL_EFAILED
generic failure
Definition: exception.hpp:476
int min(movstat::end_t const endtype, vector const &x, vector &y, workspace &w)
C++ version of gsl_movstat_min().
Definition: movstat.hpp:581
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
Definition: rstat.hpp:299
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