ovector_base_tlate Class Template Reference

A base class for ovector and ovector_view. More...

#include <ovector_tlate.h>

Inheritance diagram for ovector_base_tlate:

ovector_const_view_tlate ovector_reverse_tlate ovector_subvector_reverse_tlate ovector_tlate ovector_view_tlate ofvector omatrix_col_tlate omatrix_diag_tlate omatrix_row_tlate ovector_array_stride_tlate ovector_array_tlate ovector_cx_imag_tlate ovector_cx_real_tlate ovector_subvector_tlate

Detailed Description

template<class data_t, class vparent_t, class block_t>
class ovector_base_tlate< data_t, vparent_t, block_t >

A base class for ovector and ovector_view.

This class provides a base class for ovector and ovector_view, mostly useful for creating function arguments which accept either ovector or ovector_view.

Definition at line 472 of file ovector_tlate.h.


Public Member Functions

Copy constructors
 ovector_base_tlate (ovector_base_tlate &v)
 Shallow copy constructor - create a new view of the same vector.
ovector_base_tlateoperator= (ovector_base_tlate &v)
 Shallow copy constructor - create a new view of the same vector.
Get and set methods
const data_t & operator[] (size_t i) const
 Array-like indexing.
const data_t & operator() (size_t i) const
 Array-like indexing with operator().
data_t & operator[] (size_t i)
 Array-like indexing.
data_t & operator() (size_t i)
 Array-like indexing with operator().
data_t * get_ptr (size_t i)
 Get pointer (with optional range-checking).
int set (size_t i, data_t val)
 Set (with optional range-checking).
int set_all (double val)
 Set all of the value to be the value val.
Arithmetic


ovector_base_tlate< data_t,
vparent_t, block_t > & 
operator+= (const ovector_base_tlate< data_t, vparent_t, block_t > &x)
 operator+=
ovector_base_tlate< data_t,
vparent_t, block_t > & 
operator-= (const ovector_base_tlate< data_t, vparent_t, block_t > &x)
 operator-=
ovector_base_tlate< data_t,
vparent_t, block_t > & 
operator+= (const data_t &x)
 operator+=
ovector_base_tlate< data_t,
vparent_t, block_t > & 
operator-= (const data_t &x)
 operator-=
ovector_base_tlate< data_t,
vparent_t, block_t > & 
operator*= (const data_t &y)
 operator*=
Other methods
vparent_t * get_gsl_vector ()
 Return a gsl vector.
const vparent_t * get_gsl_vector_const () const
 Return a const gsl vector.

Protected Member Functions

 ovector_base_tlate ()
 Empty constructor for use by children.

Member Function Documentation

ovector_base_tlate<data_t,vparent_t,block_t>& operator*= ( const data_t &  y  )  [inline]

operator*=

If the vector is empty, this function does not perform any modifications and does not call the error handler.

Definition at line 687 of file ovector_tlate.h.

ovector_base_tlate<data_t,vparent_t,block_t>& operator+= ( const data_t &  x  )  [inline]

operator+=

If the vector is empty, this function does not perform any modifications and does not call the error handler.

Definition at line 664 of file ovector_tlate.h.

ovector_base_tlate<data_t,vparent_t,block_t>& operator+= ( const ovector_base_tlate< data_t, vparent_t, block_t > &  x  )  [inline]

operator+=

This operator only operates on elements which are present in both vectors, i.e. elements which are present in one vector but missing in the other will be ignored. If one of the two vectors is empty, this function does nothing and does not call the error handler.

Definition at line 632 of file ovector_tlate.h.

ovector_base_tlate<data_t,vparent_t,block_t>& operator-= ( const data_t &  x  )  [inline]

operator-=

If the vector is empty, this function does not perform any modifications and does not call the error handler.

Definition at line 675 of file ovector_tlate.h.

ovector_base_tlate<data_t,vparent_t,block_t>& operator-= ( const ovector_base_tlate< data_t, vparent_t, block_t > &  x  )  [inline]

operator-=

This operator only operates on elements which are present in both vectors, i.e. elements which are present in one vector but missing in the other will be ignored. If one of the two vectors is empty, this function does nothing and does not call the error handler.

Definition at line 650 of file ovector_tlate.h.

int set_all ( double  val  )  [inline]

Set all of the value to be the value val.

If the vector is empty, this function does not perform any assignment and does not call the error handler.

Reimplemented in ovector_reverse_tlate, and ovector_subvector_reverse_tlate.

Definition at line 612 of file ovector_tlate.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page