ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::block_complex Class Reference

This class handles vector_complexs as shared handles. More...

#include <block_complex.hpp>

Collaboration diagram for gsl::block_complex:
Collaboration graph

Classes

class  const_iterator_t
 A class template for the const iterators. More...
 
class  iterator_base
 The container must have iterator types. More...
 
class  iterator_t
 A class template for the two non-const iterators. More...
 

Public Types

typedef complex value_type
 A container must have a value_type. More...
 
typedef complex_ref reference
 A container must have a reference type. More...
 
typedef reference const const_reference
 A container must have a constant reference type. More...
 
typedef complex_ptr pointer
 A container must have a pointer type. More...
 
typedef complex_ptr const const_pointer
 A container must have a constant pointer type. More...
 
typedef const_iterator_t< false > const_iterator
 The const_iterator type. More...
 
typedef iterator_t< false > iterator
 The iterator type. More...
 
typedef const_iterator_t< true > const_reverse_iterator
 The const_reverse_iterator type. More...
 
typedef iterator_t< true > reverse_iterator
 The reverse_iterator type. More...
 
typedef const_iterator::difference_type difference_type
 A container must have a difference_type. More...
 
typedef size_t size_type
 A container must have a size_type. More...
 

Public Member Functions

 block_complex ()
 The default constructor is only really useful for assigning to. More...
 
 block_complex (size_t const n)
 The default constructor creates a new block_complex with n elements. More...
 
 block_complex (gsl_block_complex *v)
 Could construct from a gsl_block_complex. More...
 
 block_complex (std::initializer_list< std::complex< double > > initializer_list)
 Could construct from a std::initializer_list in C++11. More...
 
 block_complex (block_complex const &v)
 The copy constructor. More...
 
block_complexoperator= (block_complex const &v)
 The assignment operator. More...
 
block_complex clone () const
 The clone function. More...
 
 ~block_complex ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 block_complex (block_complex &&v)
 Move constructor. More...
 
block_complexoperator= (block_complex &&v)
 Move operator. More...
 
bool operator== (block_complex const &v) const
 Two block_complex objects are identically equal if their elements are identical. More...
 
bool operator!= (block_complex const &v) const
 Two block_complex objects are different equal if their elements are not identical. More...
 
bool operator< (block_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (block_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (block_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (block_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
iterator begin ()
 Get iterator pointing to first block_complex element. More...
 
const_iterator begin () const
 Get iterator pointing to first block_complex element. More...
 
iterator end ()
 Get iterator pointing beyond last block_complex element. More...
 
const_iterator end () const
 Get iterator pointing beyond last block_complex element. More...
 
size_type size () const
 The size (number of elements) of the block_complex. More...
 
double * data ()
 Give access to the data block. More...
 
double const * data () const
 Give access to the data block. More...
 
size_type max_size () const
 The max size (number of elements) of the block_complex. More...
 
bool empty () const
 Find if the block_complex is empty. More...
 
void swap (block_complex &v)
 Swap two block_complex objects. More...
 
reverse_iterator rbegin ()
 Get iterator pointing to first block_complex element. More...
 
const_reverse_iterator rbegin () const
 Get iterator pointing to first block_complex element. More...
 
reverse_iterator rend ()
 Get iterator pointing beyond last block_complex element. More...
 
const_reverse_iterator rend () const
 Get iterator pointing beyond last block_complex element. More...
 
reference operator[] (size_t const n)
 Get element at position n by reference ([] operator). More...
 
const_reference operator[] (size_t const n) const
 Get element at position n by reference ([] operator). More...
 
gsl_block_complex * get () const
 Get the gsl_block_complex. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_block_complex. More...
 
size_t use_count () const
 Find how many block_complex objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 

Private Attributes

gsl_block_complex * ccgsl_pointer
 The shared pointer. More...
 
size_t * count
 The shared reference count. More...
 

Detailed Description

This class handles vector_complexs as shared handles.

It models a random access container so that STL functions work with block_complex.

Definition at line 44 of file block_complex.hpp.

Member Typedef Documentation

◆ const_iterator

The const_iterator type.

Definition at line 986 of file block_complex.hpp.

◆ const_pointer

A container must have a constant pointer type.

Definition at line 321 of file block_complex.hpp.

◆ const_reference

A container must have a constant reference type.

Definition at line 311 of file block_complex.hpp.

◆ const_reverse_iterator

The const_reverse_iterator type.

Definition at line 994 of file block_complex.hpp.

◆ difference_type

A container must have a difference_type.

Definition at line 1003 of file block_complex.hpp.

◆ iterator

The iterator type.

Definition at line 990 of file block_complex.hpp.

◆ pointer

A container must have a pointer type.

Definition at line 316 of file block_complex.hpp.

◆ reference

A container must have a reference type.

Definition at line 306 of file block_complex.hpp.

◆ reverse_iterator

The reverse_iterator type.

Definition at line 998 of file block_complex.hpp.

◆ size_type

A container must have a size_type.

Definition at line 1008 of file block_complex.hpp.

◆ value_type

A container must have a value_type.

Definition at line 301 of file block_complex.hpp.

Constructor & Destructor Documentation

◆ block_complex() [1/6]

gsl::block_complex::block_complex ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 49 of file block_complex.hpp.

References ccgsl_pointer, and count.

Referenced by operator=(), and reset().

◆ block_complex() [2/6]

gsl::block_complex::block_complex ( size_t const  n)
inlineexplicit

The default constructor creates a new block_complex with n elements.

Parameters
nThe number of elements in the block_complex

Definition at line 59 of file block_complex.hpp.

References ccgsl_pointer, count, and gsl::rstat::n().

◆ block_complex() [3/6]

gsl::block_complex::block_complex ( gsl_block_complex *  v)
inlineexplicit

Could construct from a gsl_block_complex.

This is not usually a good idea. In this case you should not use gsl_block_complex_free() to deallocate the memory.

Parameters
vThe block_complex

Definition at line 82 of file block_complex.hpp.

References ccgsl_pointer, and count.

◆ block_complex() [4/6]

gsl::block_complex::block_complex ( std::initializer_list< std::complex< double > >  initializer_list)
inline

Could construct from a std::initializer_list in C++11.

Parameters
initializer_listThe initializer_list.

Definition at line 93 of file block_complex.hpp.

References begin(), ccgsl_pointer, count, and gsl::rstat::n().

◆ block_complex() [5/6]

gsl::block_complex::block_complex ( block_complex const &  v)
inline

The copy constructor.

This shares the block_complex. Use clone() if you want a full copy.

Parameters
vThe block_complex to copy.

Definition at line 116 of file block_complex.hpp.

References count.

◆ ~block_complex()

gsl::block_complex::~block_complex ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 156 of file block_complex.hpp.

References ccgsl_pointer, and count.

◆ block_complex() [6/6]

gsl::block_complex::block_complex ( block_complex &&  v)
inline

Move constructor.

Parameters
vThe block_complex to move.

Definition at line 174 of file block_complex.hpp.

References count.

Member Function Documentation

◆ begin() [1/2]

iterator gsl::block_complex::begin ( )
inline

Get iterator pointing to first block_complex element.

Returns
iterator pointing to first block_complex element

Definition at line 1014 of file block_complex.hpp.

Referenced by block_complex().

◆ begin() [2/2]

const_iterator gsl::block_complex::begin ( ) const
inline

Get iterator pointing to first block_complex element.

Returns
iterator pointing to first block_complex element

Definition at line 1021 of file block_complex.hpp.

◆ clone()

block_complex gsl::block_complex::clone ( ) const
inline

The clone function.

Use this if you want a copy of the block_complex that does not share the underlying data.

Returns
a new copy of this.

Definition at line 144 of file block_complex.hpp.

References CCGSL_MTY, and ccgsl_pointer.

◆ data() [1/2]

double * gsl::block_complex::data ( )
inline

Give access to the data block.

The data() and size() functions mimic the functions of std::array<T> and std::vector<T>.

Returns
The data block.

Definition at line 1052 of file block_complex.hpp.

References ccgsl_pointer.

◆ data() [2/2]

double const * gsl::block_complex::data ( ) const
inline

Give access to the data block.

The data() and size() functions mimic the functions of std::array<T> and std::vector<T>.

Returns
The data block.

Definition at line 1060 of file block_complex.hpp.

References ccgsl_pointer.

◆ empty()

bool gsl::block_complex::empty ( ) const
inline

Find if the block_complex is empty.

Returns
true if has size zero; otherwise false

Definition at line 1075 of file block_complex.hpp.

References ccgsl_pointer.

◆ end() [1/2]

iterator gsl::block_complex::end ( )
inline

Get iterator pointing beyond last block_complex element.

Returns
iterator pointing beyond last block_complex element

Definition at line 1029 of file block_complex.hpp.

References ccgsl_pointer, and size().

◆ end() [2/2]

const_iterator gsl::block_complex::end ( ) const
inline

Get iterator pointing beyond last block_complex element.

Returns
iterator pointing beyond last block_complex element

Definition at line 1037 of file block_complex.hpp.

References ccgsl_pointer, and size().

◆ get()

gsl_block_complex * gsl::block_complex::get ( ) const
inline

Get the gsl_block_complex.

Returns
the gsl_block_complex

Definition at line 1181 of file block_complex.hpp.

References ccgsl_pointer.

◆ max_size()

size_type gsl::block_complex::max_size ( ) const
inline

The max size (number of elements) of the block_complex.

Identical to size but required for a container.

Returns
The size of the block_complex

Definition at line 1069 of file block_complex.hpp.

References ccgsl_pointer.

◆ operator bool()

gsl::block_complex::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

Returns
true or false according as this contains a pointer to a gsl_block_complex

Definition at line 1201 of file block_complex.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::block_complex::operator!= ( block_complex const &  v) const
inline

Two block_complex objects are different equal if their elements are not identical.

Parameters
vThe block_complex to be compared with this
Returns
false or true according as this and v have identical elements or not

Definition at line 215 of file block_complex.hpp.

References operator==().

◆ operator<()

bool gsl::block_complex::operator< ( block_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a block_complex is nonnegative.

Parameters
vThe block_complex to be compared with this
Returns
false or true according as this is less than v lexicographically

Definition at line 227 of file block_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, gsl::movstat::min(), and size().

Referenced by operator<=().

◆ operator<=()

bool gsl::block_complex::operator<= ( block_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a block_complex is nonnegative.

Parameters
vThe block_complex to be compared with this
Returns
false or true according as this is less than or equal to v lexicographically

Definition at line 281 of file block_complex.hpp.

References operator<(), and operator==().

◆ operator=() [1/2]

block_complex & gsl::block_complex::operator= ( block_complex &&  v)
inline

Move operator.

Parameters
vThe block_complex to move.
Returns
A reference to this.

Definition at line 183 of file block_complex.hpp.

References block_complex().

◆ operator=() [2/2]

block_complex & gsl::block_complex::operator= ( block_complex const &  v)
inline

The assignment operator.

This makes a shared copy.

Parameters
vThe block_complex to copy

Definition at line 124 of file block_complex.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::block_complex::operator== ( block_complex const &  v) const
inline

Two block_complex objects are identically equal if their elements are identical.

Parameters
vThe block_complex to be compared with this
Returns
true or false according as this and v have identical elements or not

Definition at line 196 of file block_complex.hpp.

References CCGSL_MTY, and ccgsl_pointer.

Referenced by operator!=(), operator<=(), and operator>=().

◆ operator>()

bool gsl::block_complex::operator> ( block_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a block_complex is nonnegative.

Parameters
vThe block_complex to be compared with this
Returns
false or true according as this is greater than v lexicographically

Definition at line 254 of file block_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, gsl::movstat::min(), and size().

Referenced by operator>=().

◆ operator>=()

bool gsl::block_complex::operator>= ( block_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a block_complex is nonnegative.

Parameters
vThe block_complex to be compared with this
Returns
false or true according as this is no less than v lexicographically

Definition at line 293 of file block_complex.hpp.

References operator==(), and operator>().

◆ operator[]() [1/2]

reference gsl::block_complex::operator[] ( size_t const  n)
inline

Get element at position n by reference ([] operator).

Parameters
nThe position of the element
Returns
a reference to a complex

Definition at line 1125 of file block_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, gsl::exception::GSL_EFAILED, gsl::rstat::n(), and size().

◆ operator[]() [2/2]

const_reference gsl::block_complex::operator[] ( size_t const  n) const
inline

Get element at position n by reference ([] operator).

Parameters
nThe position of the element
Returns
a reference to a complex

Definition at line 1148 of file block_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, gsl::exception::GSL_EFAILED, gsl::rstat::n(), and size().

◆ rbegin() [1/2]

reverse_iterator gsl::block_complex::rbegin ( )
inline

Get iterator pointing to first block_complex element.

Returns
iterator pointing to first block_complex element

Definition at line 1092 of file block_complex.hpp.

References ccgsl_pointer, and size().

◆ rbegin() [2/2]

const_reverse_iterator gsl::block_complex::rbegin ( ) const
inline

Get iterator pointing to first block_complex element.

Returns
iterator pointing to first block_complex element

Definition at line 1100 of file block_complex.hpp.

References ccgsl_pointer, and size().

◆ rend() [1/2]

reverse_iterator gsl::block_complex::rend ( )
inline

Get iterator pointing beyond last block_complex element.

Returns
iterator pointing beyond last block_complex element

Definition at line 1109 of file block_complex.hpp.

◆ rend() [2/2]

const_reverse_iterator gsl::block_complex::rend ( ) const
inline

Get iterator pointing beyond last block_complex element.

Returns
iterator pointing beyond last block_complex element

Definition at line 1116 of file block_complex.hpp.

◆ reset()

void gsl::block_complex::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 168 of file block_complex.hpp.

References block_complex().

◆ size()

size_type gsl::block_complex::size ( ) const
inline

The size (number of elements) of the block_complex.

Returns
The size of the block_complex

Definition at line 1046 of file block_complex.hpp.

References ccgsl_pointer.

Referenced by end(), operator<(), operator>(), operator[](), and rbegin().

◆ swap()

void gsl::block_complex::swap ( block_complex v)
inline

Swap two block_complex objects.

This works even if the block_complex objects have different sizes because it swaps pointers.

Parameters
vThe block_complex to swap with this.

Definition at line 1082 of file block_complex.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::block_complex::unique ( ) const
inline

Find if this is the only object sharing the gsl_block_complex.

Returns
true or falses according as this is the only block_complex object sharing the gsl_block_complex

Definition at line 1187 of file block_complex.hpp.

References count.

◆ use_count()

size_t gsl::block_complex::use_count ( ) const
inline

Find how many block_complex objects share this pointer.

Returns
the number of block_complex objects that share this pointer

Definition at line 1192 of file block_complex.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::block_complex::count
private

The shared reference count.

Definition at line 1174 of file block_complex.hpp.

Referenced by block_complex(), operator=(), swap(), unique(), use_count(), and ~block_complex().


The documentation for this class was generated from the following file: