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 55 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
std::vector< T > toStdVector ()
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 67 of file Vector.hpp.

typedef const T& const_reference
 

STL const reference type.

Definition at line 63 of file Vector.hpp.

typedef T* iterator
 

STL iterator type.

Definition at line 65 of file Vector.hpp.

typedef T& reference
 

STL reference type.

Definition at line 61 of file Vector.hpp.

typedef T value_type
 

STL value type.

Definition at line 59 of file Vector.hpp.


Constructor & Destructor Documentation

Vector  )  [inline]
 

Default constructor.

Definition at line 70 of file Vector.hpp.

Vector size_t  siz  )  [inline]
 

Constructor given an initial size.

Definition at line 72 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 84 of file Vector.hpp.

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

Copy constructor from a ConstVectorBase type.

Definition at line 98 of file Vector.hpp.

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

Copy constructor.

Definition at line 111 of file Vector.hpp.

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

Valarray constructor.

Definition at line 124 of file Vector.hpp.

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

subvector constructor

Definition at line 137 of file Vector.hpp.

~Vector  )  [inline]
 

Destructor.

Definition at line 161 of file Vector.hpp.


Member Function Documentation

const_iterator begin  )  const [inline]
 

STL const iterator begin.

Definition at line 167 of file Vector.hpp.

iterator begin  )  [inline]
 

STL iterator begin.

Definition at line 165 of file Vector.hpp.

bool empty void   )  const [inline]
 

STL empty.

Definition at line 177 of file Vector.hpp.

const_iterator end  )  const [inline]
 

STL const iterator end.

Definition at line 171 of file Vector.hpp.

iterator end  )  [inline]
 

STL iterator end.

Definition at line 169 of file Vector.hpp.

Referenced by satTypeValueMap::getMatrixOfTypes(), satTypeValueMap::getTypeID(), satTypeValueMap::insertMatrix(), satTypeValueMap::insertTypeIDVector(), SolverGeneral::preCompute(), ForceModelList::printForceModel(), SolverPPP::Process(), and ForceModelList::setForceModelType().

const_reference front  )  const [inline]
 

STL const front.

Definition at line 175 of file Vector.hpp.

value_type front  )  [inline]
 

STL front.

Definition at line 173 of file Vector.hpp.

size_t max_size  )  const [inline]
 

STL max_size.

Definition at line 181 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 288 of file Vector.hpp.

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

Returns the concatenation of this Vector and Vector b.

Definition at line 270 of file Vector.hpp.

T operator() size_t  i  )  const [inline]
 

Const operator ().

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

Definition at line 193 of file Vector.hpp.

T& operator() size_t  i  )  [inline]
 

Non-const operator ().

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

Definition at line 190 of file Vector.hpp.

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

*this will be cleared and resized as necessary

Definition at line 220 of file Vector.hpp.

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

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

Definition at line 216 of file Vector.hpp.

Vector& operator= const T  x  )  [inline]
 

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

Definition at line 213 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 210 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 206 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 201 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 197 of file Vector.hpp.

T operator[] size_t  i  )  const [inline]
 

Const operator [].

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

Definition at line 187 of file Vector.hpp.

T& operator[] size_t  i  )  [inline]
 

Non-const operator [].

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

Definition at line 184 of file Vector.hpp.

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

resize with new default value

Definition at line 251 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 234 of file Vector.hpp.

Referenced by PolyFit< double >::Add(), PRSolution::AutonomousPRSolution(), SolarRadiationPressure::doCompute(), RelativityEffect::doCompute(), ARLambda::factorize(), ForceModelList::getDerivatives(), ReferenceFrames::getJ2kPosVel(), Spacecraft::initStateVector(), SVD::operator()(), IERS::planetJ2kPosVel(), SRIleastSquares::Reset(), SRIFilter::Reset(), SimpleKalmanFilter::Reset(), Spacecraft::resetState(), RungeKuttaFehlberg::rkfs78(), ARMLambda::search(), ARLambda::search(), SatOrbitPropagator::setInitState(), SatOrbitPropagator::setState(), Spacecraft::setStateVector(), Spacecraft::setTransitionMatrix(), SRI::split(), and SatOrbitPropagator::updateMatrix().

size_t size void   )  const [inline]
 

STL size.

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

Definition at line 179 of file Vector.hpp.

Referenced by TwoSampleStats< double >::Add(), Stats< double >::Add(), PolyFit< double >::Add(), BivarStats::add(), SphericalHarmonicGravity::computeVW(), GeneralConstraint::constraintToSolver(), ConstVectorSlice::ConstVectorSlice(), ENUUtil::convertToENU(), NEDUtil::convertToNED(), RACRotation::convertToRAC(), SRIleastSquares::dataUpdate(), IonexData::dump(), PolyFit< double >::Evaluate(), TestEOM::getDerivatives(), Spacecraft::getSensitivityMatrix(), SRI::getState(), Spacecraft::getStateTransitionMatrix(), Spacecraft::getStateVector(), Spacecraft::getTransitionMatrix(), SphericalHarmonicGravity::gravity(), SphericalHarmonicGravity::gravityGradient(), Spacecraft::initStateVector(), RungeKuttaFehlberg::integrateAdaptive(), ARLambda::lambda(), gpstk::mat2str(), MatrixTest1(), MatrixTest4(), MatrixTest5(), MatrixTest6(), MatrixTest9(), Vector< DayTime >::operator &&(), gpstk::operator<<(), PolyTest(), ModeledPR::Prepare(), SimpleKalmanFilter::Reset(), RungeKuttaFehlberg::rkfqcs(), RungeKuttaFehlberg::rkfs78(), ConstraintSystem::setConstraint(), SatOrbitPropagator::setInitState(), SatOrbitPropagator::setState(), Spacecraft::setStateVector(), ConstVectorSlice::size(), VectorSlice::size(), SRI::split(), KeplerOrbit::Stack(), SRI::stateFix(), TwoSampleStats< double >::Subtract(), Stats< double >::Subtract(), BivarStats::subtract(), VectorSlice::VectorSlice(), and VectorTest().

std::vector<T> toStdVector  )  [inline]
 

Definition at line 261 of file Vector.hpp.


The documentation for this class was generated from the following file:
Generated on Wed Feb 8 03:31:43 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1