SLIP  1.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | Related Functions | List of all members
slip::Signal< T > Class Template Reference

Numerical Signal class. This container statisfies the RandomAccessContainer concepts of the Standard Template Library (STL). Data are stored using a Vector class. It extends the interface of Vector adding signal read/write operations. More...

#include <Signal.hpp>

Public Types

typedef T value_type
 
typedef Signal< T > self
 
typedef const Signal< T > const_self
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef slip::stride_iterator
< pointer
iterator_range
 
typedef slip::stride_iterator
< const_pointer
const_iterator_range
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef std::reverse_iterator
< iterator_range
reverse_iterator_range
 
typedef std::reverse_iterator
< const_iterator_range
const_reverse_iterator_range
 
typedef slip::lin_alg_traits
< value_type >::value_type 
norm_type
 
typedef iterator default_iterator
 
typedef const_iterator const_default_iterator
 

Public Member Functions

void resize (const size_type new_n, const T &val=T())
 Resizes a Signal. More...
 
std::string name () const
 Returns the name of the class. More...
 
size_type size () const
 Returns the number of elements in the Signal. More...
 
size_type max_size () const
 Returns the maximal size (number of elements) in the Signal. More...
 
bool empty () const
 Returns true if the Signal is empty. (Thus size() == 0) More...
 
void swap (self &M)
 Swaps data with another Signal. More...
 
T & min () const
 Returns the min element of the Signal according to the operator < if T is std::complex, it returns the element of minimum magnitude. More...
 
T & max () const
 Returns the max element of the Signal according to the operator >, if T is std::complex, it returns the element of maximum magnitude. More...
 
sum () const
 Returns the sum of the elements of the Signal. More...
 
norm_type Euclidean_norm () const
 Returns the Euclidean norm $\left(\sum_i x_i\bar{x_i} \right)^{\frac{1}{2}}$ of the elements of the Signal. More...
 
norm_type L2_norm () const
 Returns the Euclidean norm $\left(\sum_i x_i\bar{x_i} \right)^{\frac{1}{2}}$ of the elements of the Signal. More...
 
norm_type L1_norm () const
 Returns the L1 norm ( $\sum_i |xi|$) of the elements of the Signal. More...
 
norm_type L22_norm () const
 Returns the L22 norm ( $\sum_i xi\bar{x_i}$) of the elements of the Signal. More...
 
norm_type infinite_norm () const
 Returns the infinite norm ( $\max_i\{|xi|\}$) of the elements of the Signal. More...
 
Signal< T > & apply (T(*fun)(T))
 Applys the one-parameter C-function fun to each element of the Signal. More...
 
Signal< T > & apply (T(*fun)(const T &))
 Applys the one-parameter C-function fun to each element of the Signal. More...
 
template<typename T>
 Signal (typename Signal< T >::size_type n)
 
template<typename T>
 Signal (typename Signal< T >::size_type n, const T &val)
 
template<typename T>
 Signal (typename Signal< T >::size_type n, const T *val)
 
Constructors & Destructors
 Signal ()
 Constructs a Signal. More...
 
 Signal (const size_type n)
 Constructs a Signal. More...
 
 Signal (const size_type n, const T &val)
 Constructs a Signal initialized by the scalar value val. More...
 
 Signal (const size_type n, const T *val)
 Constructs a Signal initialized by an array val. More...
 
template<typename InputIterator >
 Signal (InputIterator first, InputIterator last)
 Contructs a Signal from a range. More...
 
 Signal (const self &rhs)
 Constructs a copy of the Signal rhs. More...
 
 ~Signal ()
 Destructor of the Signal. More...
 
iterators
iterator begin ()
 Returns a read/write iterator that points to the first element in the Signal. Iteration is done in ordinary element order. More...
 
const_iterator begin () const
 Returns a read-only (constant) iterator that points to the first element in the Signal. Iteration is done in ordinary element order. More...
 
iterator end ()
 Returns a read/write iterator that points one past the last element in the Signal. Iteration is done in ordinary element order. More...
 
const_iterator end () const
 Returns a read-only (constant) iterator that points one past the last element in the Signal. Iteration is done in ordinary element order. More...
 
reverse_iterator rbegin ()
 Returns a read/write reverse iterator that points to the last element in the Signal. Iteration is done in reverse element order. More...
 
const_reverse_iterator rbegin () const
 Returns a read-only (constant) reverse iterator that points to the last element in the Signal. Iteration is done in reverse element order. More...
 
reverse_iterator rend ()
 Returns a read/write reverse iterator that points to one before the first element in the Signal. Iteration is done in reverse element order. More...
 
const_reverse_iterator rend () const
 Returns a read-only (constant) reverse iterator that points to one before the first element in the Signal. Iteration is done in reverse element order. More...
 
iterator_range begin (const slip::Range< int > &range)
 Returns a read/write iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range. More...
 
const_iterator_range begin (const slip::Range< int > &range) const
 Returns a read-only (constant) iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range. More...
 
iterator_range end (const slip::Range< int > &range)
 Returns a read/write iterator_range that points one past the last element in the Signal. Iteration is done in ordinary element order according to the Range. More...
 
const_iterator_range end (const slip::Range< int > &range) const
 Returns a read-only (constant) iterator_range that points one past the last element in the Signal. Iteration is done in ordinary element order according to the Range. More...
 
iterator begin (const slip::Box1d< int > &box)
 Returns a read/write iterator that points the first element within the Box1d. Iteration is done in ordinary element order. More...
 
const_iterator begin (const slip::Box1d< int > &box) const
 Returns a read-only (constant) iterator that points the first element within the Box1d. Iteration is done in ordinary element order. More...
 
iterator end (const slip::Box1d< int > &box)
 Returns a read/write iterator that points one past the last element in the Signal. Iteration is done in ordinary element order. More...
 
const_iterator end (const slip::Box1d< int > &box) const
 Returns a read-only (constant) iterator that points one past the last element within the Box1d. Iteration is done in ordinary element order. More...
 
reverse_iterator_range rbegin (const slip::Range< int > &range)
 Returns a read/write reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range. More...
 
const_reverse_iterator_range rbegin (const slip::Range< int > &range) const
 Returns a read-only (constant) reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range. More...
 
reverse_iterator_range rend (const slip::Range< int > &range)
 Returns a read/write reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range. More...
 
const_reverse_iterator_range rend (const slip::Range< int > &range) const
 Returns a read-only (constant) reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range. More...
 
reverse_iterator rbegin (const slip::Box1d< int > &box)
 Returns a read/write reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order. More...
 
const_reverse_iterator rbegin (const slip::Box1d< int > &box) const
 Returns a read-only (constant) reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order. More...
 
reverse_iterator rend (const slip::Box1d< int > &box)
 Returns a read/write reverse_iterator that points one previous the first element in the Box1d. Iteration is done in reverse element order. More...
 
const_reverse_iterator rend (const slip::Box1d< int > &box) const
 Returns a read-only (constant) reverse_iterator that points one previous the first element of the Box1d. Iteration is done in reverse element order. More...
 
Assignment operators and methods
selfoperator= (const self &rhs)
 Assign a Signal. More...
 
selfoperator= (const T &val)
 Assigns all the element of the Signal by val. More...
 
void fill (const T &value)
 Fills the container range [begin(),begin()+size()) with copies of value. More...
 
void fill (const T *value)
 Fills the container range [begin(),begin()+size()) with a copy of the value array. More...
 
template<typename InputIterator >
void fill (InputIterator first, InputIterator last)
 Fills the container range [begin(),begin()+size()) with a copy of the range [first,last) More...
 
Element access operators
reference operator[] (const size_type i)
 Subscript access to the data contained in the Signal. More...
 
const_reference operator[] (const size_type i) const
 Subscript access to the data contained in the Signal. More...
 
reference operator() (const size_type i)
 Subscript access to the data contained in the Signal. More...
 
const_reference operator() (const size_type i) const
 Subscript access to the data contained in the Signal. More...
 
reference operator() (const slip::Point1d< size_type > &p)
 Subscript access to the data contained in the Signal. More...
 
const_reference operator() (const slip::Point1d< size_type > &p) const
 Subscript access to the data contained in the Signal. More...
 
self operator() (const slip::Range< int > &range)
 Subscript access to the data contained in the Signal. More...
 
Arithmetic operators
selfoperator+= (const T &val)
 Add val to each element of the Signal. More...
 
selfoperator-= (const T &val)
 
selfoperator*= (const T &val)
 
selfoperator/= (const T &val)
 
self operator- () const
 
selfoperator+= (const self &rhs)
 
selfoperator-= (const self &rhs)
 
selfoperator*= (const self &rhs)
 
selfoperator/= (const self &rhs)
 

Static Public Attributes

static const std::size_t DIM = 1
 

Friends

class boost::serialization::access
 
Comparison operators
bool operator== (const Signal< T > &x, const Signal< T > &y)
 Signal equality comparison. More...
 
bool operator!= (const Signal< T > &x, const Signal< T > &y)
 Signal inequality comparison. More...
 
bool operator< (const Signal< T > &x, const Signal< T > &y)
 Less than comparison operator (Signal ordering relation) More...
 
bool operator> (const Signal< T > &x, const Signal< T > &y)
 More than comparison operator. More...
 
bool operator<= (const Signal< T > &x, const Signal< T > &y)
 Less than equal comparison operator. More...
 
bool operator>= (const Signal< T > &x, const Signal< T > &y)
 More than equal comparison operator. More...
 

Related Functions

(Note that these are not member functions.)

template<typename T >
T & min (const Signal< T > &M1)
 Returns the min element of a Signal, if T is std::complex, it returns the element of minimum magnitude. More...
 
template<typename T >
T & max (const Signal< T > &M1)
 Returns the max element of a Signal, if T is std::complex, it returns the element of maximum magnitude. More...
 
template<typename T >
Signal< typename
slip::lin_alg_traits< T >
::value_type
abs (const Signal< T > &V)
 Returns the abs value of each element of the Signal. More...
 
template<typename T >
Signal< T > sqrt (const Signal< T > &V)
 Returns the sqrt value of each element of the Signal. More...
 
template<typename T >
Signal< T > cos (const Signal< T > &V)
 Returns the cos value of each element of the Signal. More...
 
Signal< float > acos (const Signal< float > &V)
 Returns the acos value of each element of the Signal. More...
 
Signal< double > acos (const Signal< double > &V)
 Returns the acos value of each element of the Signal. More...
 
Signal< long double > acos (const Signal< long double > &V)
 Returns the acos value of each element of the Signal. More...
 
template<typename T >
Signal< T > sin (const Signal< T > &V)
 Returns the sin value of each element of the Signal. More...
 
Signal< float > asin (const Signal< float > &V)
 Returns the asin value of each element of the Signal. More...
 
Signal< double > asin (const Signal< double > &V)
 Returns the asin value of each element of the Signal. More...
 
Signal< long double > asin (const Signal< long double > &V)
 Returns the asin value of each element of the Signal. More...
 
template<typename T >
Signal< T > tan (const Signal< T > &V)
 Returns the tan value of each element of the Signal. More...
 
Signal< float > atan (const Signal< float > &V)
 Returns the atan value of each element of the Signal. More...
 
Signal< double > atan (const Signal< double > &V)
 Returns the atan value of each element of the Signal. More...
 
Signal< long double > atan (const Signal< long double > &V)
 Returns the atan value of each element of the Signal. More...
 
template<typename T >
Signal< T > exp (const Signal< T > &V)
 Returns the exp value of each element of the Signal. More...
 
template<typename T >
Signal< T > log (const Signal< T > &V)
 Returns the log value of each element of the Signal. More...
 
template<typename T >
Signal< T > cosh (const Signal< T > &V)
 Returns the cosh value of each element of the Signal. More...
 
template<typename T >
Signal< T > sinh (const Signal< T > &V)
 Returns the sinh value of each element of the Signal. More...
 
template<typename T >
Signal< T > tanh (const Signal< T > &V)
 Returns the tanh value of each element of the Signal. More...
 
template<typename T >
Signal< T > log10 (const Signal< T > &V)
 Returns the log10 value of each element of the Signal. More...
 

i/o operators

std::ostream & operator<< (std::ostream &out, const self &v)
 Write the Signal to the ouput stream. More...
 
void write_ascii (const std::string &file_path_name) const
 Write the Signal to an ASCII file. More...
 
void read_ascii (const std::string &file_path_name)
 Read the Signal from an ASCII file. More...
 

Detailed Description

template<typename T>
class slip::Signal< T >

Numerical Signal class. This container statisfies the RandomAccessContainer concepts of the Standard Template Library (STL). Data are stored using a Vector class. It extends the interface of Vector adding signal read/write operations.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/04/05
Since
1.4.0
Parameters
T.Type of object in the Signal

Definition at line 105 of file Signal.hpp.

Member Typedef Documentation

template<typename T>
typedef const_iterator slip::Signal< T >::const_default_iterator

Definition at line 185 of file Signal.hpp.

template<typename T>
typedef const_pointer slip::Signal< T >::const_iterator

Definition at line 170 of file Signal.hpp.

Definition at line 173 of file Signal.hpp.

template<typename T>
typedef const value_type* slip::Signal< T >::const_pointer

Definition at line 162 of file Signal.hpp.

template<typename T>
typedef const value_type& slip::Signal< T >::const_reference

Definition at line 164 of file Signal.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator> slip::Signal< T >::const_reverse_iterator

Definition at line 176 of file Signal.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator_range> slip::Signal< T >::const_reverse_iterator_range

Definition at line 179 of file Signal.hpp.

template<typename T>
typedef const Signal<T> slip::Signal< T >::const_self

Definition at line 159 of file Signal.hpp.

template<typename T>
typedef iterator slip::Signal< T >::default_iterator

Definition at line 184 of file Signal.hpp.

template<typename T>
typedef ptrdiff_t slip::Signal< T >::difference_type

Definition at line 166 of file Signal.hpp.

template<typename T>
typedef pointer slip::Signal< T >::iterator

Definition at line 169 of file Signal.hpp.

template<typename T>
typedef slip::stride_iterator<pointer> slip::Signal< T >::iterator_range

Definition at line 172 of file Signal.hpp.

template<typename T>
typedef slip::lin_alg_traits<value_type>::value_type slip::Signal< T >::norm_type

Definition at line 181 of file Signal.hpp.

template<typename T>
typedef value_type* slip::Signal< T >::pointer

Definition at line 161 of file Signal.hpp.

template<typename T>
typedef value_type& slip::Signal< T >::reference

Definition at line 163 of file Signal.hpp.

template<typename T>
typedef std::reverse_iterator<iterator> slip::Signal< T >::reverse_iterator

Definition at line 175 of file Signal.hpp.

template<typename T>
typedef std::reverse_iterator<iterator_range> slip::Signal< T >::reverse_iterator_range

Definition at line 178 of file Signal.hpp.

template<typename T>
typedef Signal<T> slip::Signal< T >::self

Definition at line 158 of file Signal.hpp.

template<typename T>
typedef std::size_t slip::Signal< T >::size_type

Definition at line 167 of file Signal.hpp.

template<typename T>
typedef T slip::Signal< T >::value_type

Definition at line 157 of file Signal.hpp.

Constructor & Destructor Documentation

template<typename T >
slip::Signal< T >::Signal ( )
inline

Constructs a Signal.

Definition at line 1421 of file Signal.hpp.

template<typename T>
slip::Signal< T >::Signal ( const size_type  n)

Constructs a Signal.

Parameters
nnumber of element in the Signal
template<typename T>
slip::Signal< T >::Signal ( const size_type  n,
const T &  val 
)

Constructs a Signal initialized by the scalar value val.

Parameters
nnumber of element in the Signal
valinitialization value of the elements
template<typename T>
slip::Signal< T >::Signal ( const size_type  n,
const T *  val 
)

Constructs a Signal initialized by an array val.

Parameters
nnumber of element in the Signal
valinitialization array value of the elements
template<typename T>
template<typename InputIterator >
slip::Signal< T >::Signal ( InputIterator  first,
InputIterator  last 
)
inline

Contructs a Signal from a range.

Parameters
firstAn input iterator.
lastAn input iterator.

Create a Signal consisting of copies of the elements from [first,last).

Definition at line 232 of file Signal.hpp.

template<typename T>
slip::Signal< T >::Signal ( const self rhs)
inline

Constructs a copy of the Signal rhs.

Definition at line 1447 of file Signal.hpp.

template<typename T >
slip::Signal< T >::~Signal ( )
inline

Destructor of the Signal.

Definition at line 1464 of file Signal.hpp.

template<typename T>
template<typename T>
slip::Signal< T >::Signal ( typename Signal< T >::size_type  n)
inline

Definition at line 1427 of file Signal.hpp.

template<typename T>
template<typename T>
slip::Signal< T >::Signal ( typename Signal< T >::size_type  n,
const T &  val 
)
inline

Definition at line 1433 of file Signal.hpp.

template<typename T>
template<typename T>
slip::Signal< T >::Signal ( typename Signal< T >::size_type  n,
const T *  val 
)
inline

Definition at line 1440 of file Signal.hpp.

Member Function Documentation

template<typename T>
Signal< T > & slip::Signal< T >::apply ( T(*)(T)  fun)
inline

Applys the one-parameter C-function fun to each element of the Signal.

Parameters
funThe one-parameter C function
Returns
the resulting Signal
Example:
//fill V with values from 1 to 7 with step 1
slip::iota(V.begin(),V.end(),1.0,1.0);
//apply std::sqrt to each element of V

Definition at line 1880 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::apply ( T(*)(const T &)  fun)
inline

Applys the one-parameter C-function fun to each element of the Signal.

Parameters
funThe one-const-parameter C function
Returns
the resulting Signal
Example:
//fill V with values from 1 to 7 with step 1
slip::iota(V.begin(),V.end(),1.0,1.0);
//apply std::sqrt to each element of V

Definition at line 1889 of file Signal.hpp.

template<typename T >
Signal< T >::iterator slip::Signal< T >::begin ( )
inline

Returns a read/write iterator that points to the first element in the Signal. Iteration is done in ordinary element order.

Returns
begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1488 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator slip::Signal< T >::begin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the Signal. Iteration is done in ordinary element order.

Returns
const begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1502 of file Signal.hpp.

template<typename T >
Signal< T >::iterator_range slip::Signal< T >::begin ( const slip::Range< int > &  range)
inline

Returns a read/write iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
end iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1551 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator_range slip::Signal< T >::begin ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1567 of file Signal.hpp.

template<typename T >
Signal< T >::iterator slip::Signal< T >::begin ( const slip::Box1d< int > &  box)
inline

Returns a read/write iterator that points the first element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
end iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1586 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator slip::Signal< T >::begin ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) iterator that points the first element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
const_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1602 of file Signal.hpp.

template<typename T >
bool slip::Signal< T >::empty ( ) const
inline

Returns true if the Signal is empty. (Thus size() == 0)

Definition at line 1771 of file Signal.hpp.

template<typename T >
Signal< T >::iterator slip::Signal< T >::end ( )
inline

Returns a read/write iterator that points one past the last element in the Signal. Iteration is done in ordinary element order.

Returns
end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1495 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator slip::Signal< T >::end ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the Signal. Iteration is done in ordinary element order.

Returns
const end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1510 of file Signal.hpp.

template<typename T >
Signal< T >::iterator_range slip::Signal< T >::end ( const slip::Range< int > &  range)
inline

Returns a read/write iterator_range that points one past the last element in the Signal. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
end iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1559 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator_range slip::Signal< T >::end ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) iterator_range that points one past the last element in the Signal. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1576 of file Signal.hpp.

template<typename T >
Signal< T >::iterator slip::Signal< T >::end ( const slip::Box1d< int > &  box)
inline

Returns a read/write iterator that points one past the last element in the Signal. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
end iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1594 of file Signal.hpp.

template<typename T >
Signal< T >::const_iterator slip::Signal< T >::end ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) iterator that points one past the last element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
const_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1611 of file Signal.hpp.

template<typename T>
norm_type slip::Signal< T >::Euclidean_norm ( ) const
inline

Returns the Euclidean norm $\left(\sum_i x_i\bar{x_i} \right)^{\frac{1}{2}}$ of the elements of the Signal.

Precondition
size() != 0

Definition at line 996 of file Signal.hpp.

template<typename T>
void slip::Signal< T >::fill ( const T &  value)
inline

Fills the container range [begin(),begin()+size()) with copies of value.

Parameters
valueA reference-to-const of arbitrary type.

Definition at line 723 of file Signal.hpp.

template<typename T>
void slip::Signal< T >::fill ( const T *  value)
inline

Fills the container range [begin(),begin()+size()) with a copy of the value array.

Parameters
valueA pointer of arbitrary type.

Definition at line 734 of file Signal.hpp.

template<typename T>
template<typename InputIterator >
void slip::Signal< T >::fill ( InputIterator  first,
InputIterator  last 
)
inline

Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)

Parameters
firstAn input iterator.
lastAn input iterator.

Definition at line 748 of file Signal.hpp.

template<typename T>
norm_type slip::Signal< T >::infinite_norm ( ) const
inline

Returns the infinite norm ( $\max_i\{|xi|\}$) of the elements of the Signal.

Precondition
size() != 0

Definition at line 1033 of file Signal.hpp.

template<typename T>
norm_type slip::Signal< T >::L1_norm ( ) const
inline

Returns the L1 norm ( $\sum_i |xi|$) of the elements of the Signal.

Precondition
size() != 0

Definition at line 1014 of file Signal.hpp.

template<typename T>
norm_type slip::Signal< T >::L22_norm ( ) const
inline

Returns the L22 norm ( $\sum_i xi\bar{x_i}$) of the elements of the Signal.

Precondition
size() != 0

Definition at line 1024 of file Signal.hpp.

template<typename T>
norm_type slip::Signal< T >::L2_norm ( ) const
inline

Returns the Euclidean norm $\left(\sum_i x_i\bar{x_i} \right)^{\frac{1}{2}}$ of the elements of the Signal.

Precondition
size() != 0

Definition at line 1005 of file Signal.hpp.

template<typename T >
T & slip::Signal< T >::max ( ) const
inline

Returns the max element of the Signal according to the operator >, if T is std::complex, it returns the element of maximum magnitude.

Precondition
size() != 0

Definition at line 1866 of file Signal.hpp.

template<typename T >
Signal< T >::size_type slip::Signal< T >::max_size ( ) const
inline

Returns the maximal size (number of elements) in the Signal.

Definition at line 1764 of file Signal.hpp.

template<typename T >
T & slip::Signal< T >::min ( ) const
inline

Returns the min element of the Signal according to the operator < if T is std::complex, it returns the element of minimum magnitude.

Precondition
size() != 0

Definition at line 1859 of file Signal.hpp.

template<typename T >
std::string slip::Signal< T >::name ( ) const
inline

Returns the name of the class.

Definition at line 1753 of file Signal.hpp.

template<typename T>
reference slip::Signal< T >::operator() ( const size_type  i)

Subscript access to the data contained in the Signal.

Parameters
iThe index of the row for which the data should be accessed.
Returns
Read/write reference to data.
Precondition
i < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Signal< T >::operator() ( const size_type  i) const

Subscript access to the data contained in the Signal.

Parameters
iThe index of the row for which the data should be accessed.
Returns
Read_only (constant) reference to data.
Precondition
i < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
reference slip::Signal< T >::operator() ( const slip::Point1d< size_type > &  p)

Subscript access to the data contained in the Signal.

Parameters
pThe index point corresponding of the element for which data should be accessed.
Returns
Read/write reference to data.
Precondition
p[0] < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Signal< T >::operator() ( const slip::Point1d< size_type > &  p) const

Subscript access to the data contained in the Signal.

Parameters
pThe index point corresponding of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Precondition
p[0] < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
Signal< T > slip::Signal< T >::operator() ( const slip::Range< int > &  range)
inline

Subscript access to the data contained in the Signal.

Parameters
rangeThe range of the Signal.
Returns
a copy of the range.
Precondition
range must be valid.
The ranges indices must be inside the ranges of the Signal ones.

This operator allows for easy, 1d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

Definition at line 1740 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator*= ( const T &  val)
inline

Definition at line 1802 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator*= ( const self rhs)
inline

Definition at line 1843 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator+= ( const T &  val)
inline

Add val to each element of the Signal.

Parameters
valvalue
Returns
reference to the resulting Signal

Definition at line 1786 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator+= ( const self rhs)
inline

Definition at line 1827 of file Signal.hpp.

template<typename T >
Signal< T > slip::Signal< T >::operator- ( ) const
inline

Definition at line 1819 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator-= ( const T &  val)
inline

Definition at line 1794 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator-= ( const self rhs)
inline

Definition at line 1835 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator/= ( const T &  val)
inline

Definition at line 1810 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator/= ( const self rhs)
inline

Definition at line 1851 of file Signal.hpp.

template<typename T >
Signal< T > & slip::Signal< T >::operator= ( const self rhs)
inline

Assign a Signal.

Assign elements of Signal in rhs

Parameters
rhsSignal to get the values from.
Returns

Definition at line 1453 of file Signal.hpp.

template<typename T>
Signal< T > & slip::Signal< T >::operator= ( const T &  val)
inline

Assigns all the element of the Signal by val.

Parameters
valaffectation value
Returns
reference to corresponding Signal

Definition at line 1471 of file Signal.hpp.

template<typename T>
reference slip::Signal< T >::operator[] ( const size_type  i)

Subscript access to the data contained in the Signal.

Parameters
iThe index of the row for which the data should be accessed.
Returns
Read/write reference to data.
Precondition
i < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Signal< T >::operator[] ( const size_type  i) const

Subscript access to the data contained in the Signal.

Parameters
iThe index of the row for which the data should be accessed.
Returns
Read_only (constant) reference to data.
Precondition
i < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
Signal< T >::reverse_iterator slip::Signal< T >::rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the Signal. Iteration is done in reverse element order.

Returns
reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1519 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator slip::Signal< T >::rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the Signal. Iteration is done in reverse element order.

Returns
const reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1533 of file Signal.hpp.

template<typename T >
Signal< T >::reverse_iterator_range slip::Signal< T >::rbegin ( const slip::Range< int > &  range)
inline

Returns a read/write reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
reverse_iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1653 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator_range slip::Signal< T >::rbegin ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
cons_treverse__iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1669 of file Signal.hpp.

template<typename T >
Signal< T >::reverse_iterator slip::Signal< T >::rbegin ( const slip::Box1d< int > &  box)
inline

Returns a read/write reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
reverse_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1620 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator slip::Signal< T >::rbegin ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
const_reverse_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1636 of file Signal.hpp.

template<typename T>
void slip::Signal< T >::read_ascii ( const std::string &  file_path_name)
inline

Read the Signal from an ASCII file.

Parameters
file_path_name

Definition at line 690 of file Signal.hpp.

template<typename T >
Signal< T >::reverse_iterator slip::Signal< T >::rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the Signal. Iteration is done in reverse element order.

Returns
reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1526 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator slip::Signal< T >::rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the Signal. Iteration is done in reverse element order.

Returns
const reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1541 of file Signal.hpp.

template<typename T >
Signal< T >::reverse_iterator_range slip::Signal< T >::rend ( const slip::Range< int > &  range)
inline

Returns a read/write reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
reverse_iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1661 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator_range slip::Signal< T >::rend ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_reverse_iterator_range value
Precondition
The range must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1678 of file Signal.hpp.

template<typename T >
Signal< T >::reverse_iterator slip::Signal< T >::rend ( const slip::Box1d< int > &  box)
inline

Returns a read/write reverse_iterator that points one previous the first element in the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
reverse_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1628 of file Signal.hpp.

template<typename T >
Signal< T >::const_reverse_iterator slip::Signal< T >::rend ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) reverse_iterator that points one previous the first element of the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
const_reverse_iterator value
Precondition
The box must be inside the whole range of the Signal.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1645 of file Signal.hpp.

template<typename T>
void slip::Signal< T >::resize ( const size_type  new_n,
const T &  val = T() 
)
inline

Resizes a Signal.

Parameters
new_nnew dimension of the Signal
valnew value for all the elements

Definition at line 1479 of file Signal.hpp.

template<typename T >
Signal< T >::size_type slip::Signal< T >::size ( ) const
inline

Returns the number of elements in the Signal.

Definition at line 1757 of file Signal.hpp.

template<typename T >
T slip::Signal< T >::sum ( ) const
inline

Returns the sum of the elements of the Signal.

Precondition
size() != 0

Definition at line 1873 of file Signal.hpp.

template<typename T >
void slip::Signal< T >::swap ( self M)
inline

Swaps data with another Signal.

Parameters
MA Signal of the same element type

Definition at line 1778 of file Signal.hpp.

template<typename T>
void slip::Signal< T >::write_ascii ( const std::string &  file_path_name) const
inline

Write the Signal to an ASCII file.

Parameters
file_path_name

Definition at line 680 of file Signal.hpp.

Friends And Related Function Documentation

template<typename T >
Signal< typename slip::lin_alg_traits< T >::value_type > abs ( const Signal< T > &  V)
related

Returns the abs value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2026 of file Signal.hpp.

template<typename T>
Signal< float > acos ( const Signal< float > &  V)
related

Returns the acos value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2054 of file Signal.hpp.

template<typename T>
Signal< double > acos ( const Signal< double > &  V)
related

Returns the acos value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2062 of file Signal.hpp.

template<typename T>
Signal< long double > acos ( const Signal< long double > &  V)
related

Returns the acos value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2070 of file Signal.hpp.

template<typename T>
Signal< float > asin ( const Signal< float > &  V)
related

Returns the asin value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2089 of file Signal.hpp.

template<typename T>
Signal< double > asin ( const Signal< double > &  V)
related

Returns the asin value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2097 of file Signal.hpp.

template<typename T>
Signal< long double > asin ( const Signal< long double > &  V)
related

Returns the asin value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2105 of file Signal.hpp.

template<typename T>
Signal< float > atan ( const Signal< float > &  V)
related

Returns the atan value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2122 of file Signal.hpp.

template<typename T>
Signal< double > atan ( const Signal< double > &  V)
related

Returns the atan value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2130 of file Signal.hpp.

template<typename T>
Signal< long double > atan ( const Signal< long double > &  V)
related

Returns the atan value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2138 of file Signal.hpp.

template<typename T>
friend class boost::serialization::access
friend

Definition at line 1075 of file Signal.hpp.

template<typename T >
Signal< T > cos ( const Signal< T > &  V)
related

Returns the cos value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2045 of file Signal.hpp.

template<typename T >
Signal< T > cosh ( const Signal< T > &  V)
related

Returns the cosh value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2165 of file Signal.hpp.

template<typename T >
Signal< T > exp ( const Signal< T > &  V)
related

Returns the exp value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2147 of file Signal.hpp.

template<typename T >
Signal< T > log ( const Signal< T > &  V)
related

Returns the log value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2156 of file Signal.hpp.

template<typename T >
Signal< T > log10 ( const Signal< T > &  V)
related

Returns the log10 value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2192 of file Signal.hpp.

template<typename T >
T & max ( const Signal< T > &  M1)
related

Returns the max element of a Signal, if T is std::complex, it returns the element of maximum magnitude.

Parameters
M1the Signal
Returns
the max element

Definition at line 2019 of file Signal.hpp.

template<typename T >
T & min ( const Signal< T > &  M1)
related

Returns the min element of a Signal, if T is std::complex, it returns the element of minimum magnitude.

Parameters
M1the Signal
Returns
the min element

Definition at line 2012 of file Signal.hpp.

template<typename T>
bool operator!= ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

Signal inequality comparison.

Parameters
xA Signal
yA Signal of the same type of x
Returns
true if !(x == y)

Definition at line 2211 of file Signal.hpp.

template<typename T>
bool operator< ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

Less than comparison operator (Signal ordering relation)

Parameters
xA Signal
yA Signal of the same type of x
Returns
true iff x is lexicographically less than y

Definition at line 2221 of file Signal.hpp.

template<typename T>
std::ostream& operator<< ( std::ostream &  out,
const self v 
)
friend

Write the Signal to the ouput stream.

Parameters
outoutput std:ostream
vSignal to write to the output stream

Definition at line 1687 of file Signal.hpp.

template<typename T>
bool operator<= ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

Less than equal comparison operator.

Parameters
xA Signal
yA Signal of the same type of x
Returns
true iff !(y > x)

Definition at line 2237 of file Signal.hpp.

template<typename T>
bool operator== ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

Signal equality comparison.

Parameters
xA Signal
yA Signal of the same type of x
Returns
true iff the size and the elements of the Arrays are equal

Definition at line 2203 of file Signal.hpp.

template<typename T>
bool operator> ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

More than comparison operator.

Parameters
xA Signal
yA Signal of the same type of x
Returns
true iff y > x

Definition at line 2229 of file Signal.hpp.

template<typename T>
bool operator>= ( const Signal< T > &  x,
const Signal< T > &  y 
)
friend

More than equal comparison operator.

Parameters
xA Signal
yA Signal of the same type of x
Returns
true iff !(x < y)

Definition at line 2245 of file Signal.hpp.

template<typename T >
Signal< T > sin ( const Signal< T > &  V)
related

Returns the sin value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2079 of file Signal.hpp.

template<typename T >
Signal< T > sinh ( const Signal< T > &  V)
related

Returns the sinh value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2174 of file Signal.hpp.

template<typename T >
Signal< T > sqrt ( const Signal< T > &  V)
related

Returns the sqrt value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2036 of file Signal.hpp.

template<typename T >
Signal< T > tan ( const Signal< T > &  V)
related

Returns the tan value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2114 of file Signal.hpp.

template<typename T >
Signal< T > tanh ( const Signal< T > &  V)
related

Returns the tanh value of each element of the Signal.

Parameters
VThe Signal
Returns
the resulting Signal

Definition at line 2183 of file Signal.hpp.

Member Data Documentation

template<typename T>
const std::size_t slip::Signal< T >::DIM = 1
static

Definition at line 188 of file Signal.hpp.


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