Vector Class Template Reference
[Vector and Matrix mathematics]

#include <Vector.hpp>

Inheritance diagram for Vector:

Inheritance graph
[legend]
Collaboration diagram for Vector:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class gpstk::Vector< T >

This class pretty much duplicates std::valarray<T> except it's fully STL container compliant.

Remember that operators +=, -=, *= and /= are provided by RefVectorBase.

See also:
matvectest.cpp for examples

Definition at line 54 of file Vector.hpp.

Public Types

typedef T value_type
 STL value type.
typedef T & reference
 STL reference type.
typedef const T & const_reference
 STL const reference type.
typedef T * iterator
 STL iterator type.
typedef const T * const_iterator
 STL const iterator type.

Public Member Functions

 Vector ()
 Default constructor.
 Vector (size_t siz)
 Constructor given an initial size.
 Vector (size_t siz, const T defaultValue)
 Constructor given an initial size and default value for all elements.
template<class E>
 Vector (const ConstVectorBase< T, E > &r)
 Copy constructor from a ConstVectorBase type.
 Vector (const Vector &r)
 Copy constructor.
 Vector (const std::valarray< T > &r)
 Valarray constructor.
template<class E>
 Vector (const ConstVectorBase< T, E > &vec, size_t top, size_t num)
 subvector constructor
 ~Vector ()
 Destructor.
iterator begin ()
 STL iterator begin.
const_iterator begin () const
 STL const iterator begin.
iterator end ()
 STL iterator end.
const_iterator end () const
 STL const iterator end.
value_type front ()
 STL front.
const_reference front () const
 STL const front.
bool empty () const
 STL empty.
size_t size () const
 STL size.
size_t max_size () const
 STL max_size.
T & operator[] (size_t i)
 Non-const operator [].
operator[] (size_t i) const
 Const operator [].
T & operator() (size_t i)
 Non-const operator ().
operator() (size_t i) const
 Const operator ().
VectorSlice< T > operator[] (const std::slice &sli)
 Like valarray, lets you do vec[slice] to get a VectorSlice.
Vectoroperator= (const Vector &x)
 *this will be resized if it isn't as large as x.
template<class E>
Vectoroperator= (const ConstVectorBase< T, E > &x)
 *this will be resized if it isn't as large as x.
Vectoroperator= (const std::valarray< T > &x)
 *this will be resized if it isn't as large as x.
Vectoroperator= (const T x)
 Only (*this).size() elements will be assigned.
Vectoroperator= (const T *x)
 Only (*this).size() elements will be assigned.
Vectoroperator= (const std::vector< T > &x)
 *this will be cleared and resized as necessary
Vectorresize (const size_t index)
 Resizes the vector.
Vectorresize (const size_t index, const T defaultValue)
 resize with new default value
Vector operator && (const Vector &b)
 Returns the concatenation of this Vector and Vector b.
Vector operator && (const T &b)
 Returns the concatenation of this Vector and a scalar of type T.


Member Typedef Documentation

typedef const T* const_iterator
 

STL const iterator type.

Definition at line 66 of file Vector.hpp.

typedef const T& const_reference
 

STL const reference type.

Definition at line 62 of file Vector.hpp.

typedef T* iterator
 

STL iterator type.

Definition at line 64 of file Vector.hpp.

typedef T& reference
 

STL reference type.

Definition at line 60 of file Vector.hpp.

typedef T value_type
 

STL value type.

Definition at line 58 of file Vector.hpp.


Constructor & Destructor Documentation

Vector  )  [inline]
 

Default constructor.

Definition at line 69 of file Vector.hpp.

Vector size_t  siz  )  [inline]
 

Constructor given an initial size.

Definition at line 71 of file Vector.hpp.

Vector size_t  siz,
const T  defaultValue
[inline]
 

Constructor given an initial size and default value for all elements.

Definition at line 83 of file Vector.hpp.

Vector const ConstVectorBase< T, E > &  r  )  [inline]
 

Copy constructor from a ConstVectorBase type.

Definition at line 97 of file Vector.hpp.

Vector const Vector< T > &  r  )  [inline]
 

Copy constructor.

Definition at line 110 of file Vector.hpp.

Vector const std::valarray< T > &  r  )  [inline]
 

Valarray constructor.

Definition at line 123 of file Vector.hpp.

Vector const ConstVectorBase< T, E > &  vec,
size_t  top,
size_t  num
[inline]
 

subvector constructor

Definition at line 136 of file Vector.hpp.

~Vector  )  [inline]
 

Destructor.

Definition at line 160 of file Vector.hpp.


Member Function Documentation

const_iterator begin  )  const [inline]
 

STL const iterator begin.

Definition at line 166 of file Vector.hpp.

iterator begin  )  [inline]
 

STL iterator begin.

Definition at line 164 of file Vector.hpp.

bool empty void   )  const [inline]
 

STL empty.

Definition at line 176 of file Vector.hpp.

const_iterator end  )  const [inline]
 

STL const iterator end.

Definition at line 170 of file Vector.hpp.

iterator end  )  [inline]
 

STL iterator end.

Definition at line 168 of file Vector.hpp.

Referenced by satTypeValueMap::getMatrixOfTypes(), satTypeValueMap::getTypeID(), satTypeValueMap::insertMatrix(), satTypeValueMap::insertTypeIDVector(), SolverPPP::Process(), and IonexModel::Process().

const_reference front  )  const [inline]
 

STL const front.

Definition at line 174 of file Vector.hpp.

value_type front  )  [inline]
 

STL front.

Definition at line 172 of file Vector.hpp.

size_t max_size  )  const [inline]
 

STL max_size.

Definition at line 180 of file Vector.hpp.

Vector operator && const T &  b  )  [inline]
 

Returns the concatenation of this Vector and a scalar of type T.

Definition at line 278 of file Vector.hpp.

Vector operator && const Vector< T > &  b  )  [inline]
 

Returns the concatenation of this Vector and Vector b.

Definition at line 260 of file Vector.hpp.

T operator() size_t  i  )  const [inline]
 

Const operator ().

Reimplemented from ConstVectorBase< T, Vector< T > >.

Definition at line 192 of file Vector.hpp.

T& operator() size_t  i  )  [inline]
 

Non-const operator ().

Reimplemented from RefVectorBase< T, Vector< T > >.

Definition at line 189 of file Vector.hpp.

Vector& operator= const std::vector< T > &  x  )  [inline]
 

*this will be cleared and resized as necessary

Definition at line 219 of file Vector.hpp.

Vector& operator= const T *  x  )  [inline]
 

Only (*this).size() elements will be assigned.

Definition at line 215 of file Vector.hpp.

Vector& operator= const T  x  )  [inline]
 

Only (*this).size() elements will be assigned.

Definition at line 212 of file Vector.hpp.

Vector& operator= const std::valarray< T > &  x  )  [inline]
 

*this will be resized if it isn't as large as x.

Definition at line 209 of file Vector.hpp.

Vector& operator= const ConstVectorBase< T, E > &  x  )  [inline]
 

*this will be resized if it isn't as large as x.

Definition at line 205 of file Vector.hpp.

Vector& operator= const Vector< T > &  x  )  [inline]
 

*this will be resized if it isn't as large as x.

Definition at line 200 of file Vector.hpp.

VectorSlice<T> operator[] const std::slice &  sli  )  [inline]
 

Like valarray, lets you do vec[slice] to get a VectorSlice.

Definition at line 196 of file Vector.hpp.

T operator[] size_t  i  )  const [inline]
 

Const operator [].

Reimplemented from ConstVectorBase< T, Vector< T > >.

Definition at line 186 of file Vector.hpp.

T& operator[] size_t  i  )  [inline]
 

Non-const operator [].

Reimplemented from RefVectorBase< T, Vector< T > >.

Definition at line 183 of file Vector.hpp.

Vector& resize const size_t  index,
const T  defaultValue
[inline]
 

resize with new default value

Definition at line 250 of file Vector.hpp.

Vector& resize const size_t  index  )  [inline]
 

Resizes the vector.

if index > size, the vector will be erased and the contents destroyed.

Definition at line 233 of file Vector.hpp.

Referenced by PolyFit< double >::Add(), PRSolution::AutonomousPRSolution(), SVD::operator()(), SRIleastSquares::Reset(), SRIFilter::Reset(), SimpleKalmanFilter::Reset(), and SRI::split().

size_t size void   )  const [inline]
 

STL size.

Reimplemented from ConstVectorBase< T, Vector< T > >.

Definition at line 178 of file Vector.hpp.

Referenced by TwoSampleStats< double >::Add(), Stats< double >::Add(), PolyFit< double >::Add(), BivarStats::add(), SRI::biasFix(), ConstVectorSlice::ConstVectorSlice(), ENUUtil::convertToENU(), NEDUtil::convertToNED(), RACRotation::convertToRAC(), SRIleastSquares::dataUpdate(), IonexData::dump(), PolyFit< double >::Evaluate(), MatrixTest1(), MatrixTest4(), MatrixTest5(), MatrixTest6(), MatrixTest9(), Vector< DayTime >::operator &&(), gpstk::operator<<(), PolyTest(), ModeledPR::Prepare(), SimpleKalmanFilter::Reset(), ConstVectorSlice::size(), VectorSlice::size(), SRI::split(), TwoSampleStats< double >::Subtract(), Stats< double >::Subtract(), BivarStats::subtract(), VectorSlice::VectorSlice(), and VectorTest().


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 03:32:02 2009 for GPS ToolKit Software Library by  doxygen 1.3.9.1