#include <Base/Math/Vector.hh>


Public Types | |
| typedef const T * | const_iterator |
| typedef const T & | const_reference |
| typedef T | element_type |
| typedef T * | iterator |
| typedef T * | pointer |
| typedef T & | reference |
| typedef Subscript | size_type |
| typedef T | value_type |
Public Member Functions | |
| const iterator | begin () const |
| iterator | begin () |
| void | clear () |
| stl conform interface JW | |
| Subscript | dim () const |
| double | Dist (const Vector< T > &vec) const |
| Return the euclidian distance of 2 vectors. | |
| Vector< T > | ElementwiseProduct (const Vector< T > &arg) const |
| multiply this with arg elementwise and return the result | |
| void | ElementwiseProduct (const Vector< T > &arg, Vector< T > &dest) const |
| multiply this with arg elementwise and store the result in dest | |
| const iterator | end () const |
| iterator | end () |
| void | Fill (const T &scalar) |
| fills complete Vector with scalar value | |
| T * | GetData () const |
| get the pointer to the data array of the vector (for faster direct memory access) | |
| T * | GetDataLast () const |
| Get the pointer to last element of the data array. | |
| double | GetMean (void) const |
| int | GetNumElements () const |
| conformance interface JW | |
| std::vector< T > | GetSTLVec () const |
| void | GetSTLVec (std::vector< T > &vec) const |
| bool | IsZero () const |
| void | KroneckerProduct (const Vector< T > &arg, Vector< T > &dst) const |
| kronecker product | |
| Subscript | lbound () const |
| double | Length () const |
| returns the Euclidean Length of the Vector | |
| bool | Load (const std::string &filename) |
| method to load directly from a given filename. | |
| void | Multiply (const T &scalar, Vector< T > &res) const |
| multiply components with scalar storing result in res | |
| void | MultiplyIP (const T &scalar) |
| in place multiplication with scalar | |
| Vector< T > & | newsize (Subscript N) |
| T | NormL1 () const |
| Return the L1 norm: |a| + |b| + |c| + . | |
| double | NormL2 () const |
| Return the L2 norm: sqrt(a^1 + a^2 + . | |
| bool | operator!= (const Vector< T > &vec) const |
| const_reference | operator() (Subscript i) const |
| reference | operator() (Subscript i) |
| void | operator*= (T scalar) |
| void | operator+= (const Vector< T > &vec) |
| void | operator-= (const Vector< T > &vec) |
| void | operator/= (T scalar) |
| Vector< T > & | operator= (const Vector< T > &vec) |
| assignment operator calling corresponding operator from base class "TNT::Vector" if appropriate | |
| Vector< T > & | operator= (const TNT::Vector< T > &vec) |
| assignment operators calling corresponding operator from base class "TNT::Vector" if appropriate | |
| bool | operator== (const Vector< T > &vec) const |
| const_reference | operator[] (Subscript i) const |
| reference | operator[] (Subscript i) |
| Matrix< T > | OuterProduct (const Vector< T > &v) const |
| outer product, constructs a matrix. | |
| bool | Save (const std::string &filename) const |
| method to save directly to a given filename. | |
| void | ScalarProduct (const Vector< T > &argvec, T &result) const |
| scalar product (inner product) of two vectors returning a scalar, storing the result in result | |
| T | ScalarProduct (const Vector< T > &argvec) const |
| scalar product (inner product) of two vectors returning a scalr | |
| void | Set (const T &scalar) |
| void | SetZero () |
| equivalent to matrix call | |
| Subscript | size () const |
| unsigned int | Size () const |
| length of the vector | |
| void | Sub (const Vector< T > &arg, Vector< T > &dest) const |
| Substraction of vector, storing results in destination vector. | |
| void | SubIP (const Vector< T > &argmat) |
| in place subtracting | |
| Vector< T > | SubVec (int length, int offset=0) const |
| returns the subvector with elements between offset and offset+length-1 | |
| Vector (const std::vector< T > &v) | |
| Vector (const Vector4< T > &v) | |
| Vector (const Vector3< T > &v) | |
| Vector (const Vector2< T > &v) | |
| Vector (const TNT::Vector< T > &v) | |
| Vector (const Vector< T > &v) | |
| Vector (int rows, const T *v) | |
| Vector (int rows, const T &value) | |
| assignment with a constant value for all elements (=set) | |
| Vector (const int rows, const std::string &s) | |
| JW. | |
| Vector (const int rows) | |
| Vector () | |
| virtual | ~Vector () |
Protected Member Functions | |
| void | copy (const T *v) |
| void | destroy () |
| void | initialize (Subscript N) |
| void | set (const T &val) |
Protected Attributes | |
| Subscript | n_ |
| T * | v_ |
| T * | vm1_ |
Related Functions | |
| (Note that these are not member functions.) | |
| template<class T > | |
| Vector< T > | operator* (const Matrix< T > &mat, const Vector2< T > &vec) |
| template<class T > | |
| T | operator* (const Vector< T > &v, const Vector< T > &argvec) |
| template<class T > | |
| Vector< T > | operator* (const T &scalar, const Vector< T > &v) |
| template<class T > | |
| Vector< T > | operator* (const Vector< T > &v, const T &scalar) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &os, const BIAS::Vector< T > &vec) |
class Vector is the vector class that should be used by common BIAS algorithms and data structures. It is derived from TNT::Vector to inherit the basic operations and algorithm. Special implementations should be done here and NOT in TNT:Vector because the true 'base' Matrix class "TNT::Vector" should be interchangeable and aside from this maintained by NIST.
changed from BIAS to BIAS 11/05/2002 (jw)
The Vector is in row-major order (=n rows, 1 column)
Definition at line 67 of file Vector.hh.
typedef const T* TNT::Vector< T >::const_iterator [inherited] |
typedef const T& TNT::Vector< T >::const_reference [inherited] |
typedef T TNT::Vector< T >::element_type [inherited] |
typedef T* TNT::Vector< T >::iterator [inherited] |
typedef T* TNT::Vector< T >::pointer [inherited] |
typedef T& TNT::Vector< T >::reference [inherited] |
typedef Subscript TNT::Vector< T >::size_type [inherited] |
typedef T TNT::Vector< T >::value_type [inherited] |
| Vector::~Vector | ( | ) | [inline, virtual] |
| BIAS::Vector< T >::Vector | ( | ) | [inline] |
| BIAS::Vector< T >::Vector | ( | const int | rows | ) | [inline, explicit] |
| Vector::Vector | ( | const int | rows, | |
| const std::string & | s | |||
| ) | [inline, explicit] |
| BIAS::Vector< T >::Vector | ( | int | rows, | |
| const T & | value | |||
| ) | [inline] |
| BIAS::Vector< T >::Vector | ( | int | rows, | |
| const T * | v | |||
| ) | [inline] |
| BIAS::Vector< T >::Vector | ( | const Vector< T > & | v | ) | [inline] |
| BIAS::Vector< T >::Vector | ( | const TNT::Vector< T > & | v | ) | [inline] |
Definition at line 53 of file Vector.cpp.
Definition at line 59 of file Vector.cpp.
Definition at line 65 of file Vector.cpp.
| Vector::Vector | ( | const std::vector< T > & | v | ) | [inline, explicit] |
| const iterator TNT::Vector< T >::begin | ( | ) | const [inline, inherited] |
| iterator TNT::Vector< T >::begin | ( | ) | [inline, inherited] |
Definition at line 164 of file vec.h.
Referenced by Upper_symmetric_eigenvalue_solve(), and TNT::Upper_symmetric_eigenvalue_solve().
| void BIAS::Vector< T >::clear | ( | ) | [inline] |
| void TNT::Vector< T >::copy | ( | const T * | v | ) | [inline, protected, inherited] |
Definition at line 92 of file vec.h.
Referenced by TNT::Vector< TNT_SUBSCRIPT_TYPE >::operator=(), and TNT::Vector< TNT_SUBSCRIPT_TYPE >::Vector().
| void TNT::Vector< T >::destroy | ( | ) | [inline, protected, inherited] |
Definition at line 147 of file vec.h.
Referenced by TNT::Vector< TNT_SUBSCRIPT_TYPE >::newsize(), TNT::Vector< TNT_SUBSCRIPT_TYPE >::operator=(), and TNT::Vector< TNT_SUBSCRIPT_TYPE >::~Vector().
| Subscript TNT::Vector< T >::dim | ( | ) | const [inline, inherited] |
Definition at line 257 of file vec.h.
Referenced by TNT::dot_prod(), TNT::matmult(), TNT::operator*(), TNT::operator+(), TNT::operator-(), TNT::QR_solve(), and TNT::R_solve().
| double BIAS::Vector< T >::Dist | ( | const Vector< T > & | vec | ) | const [inline] |
Return the euclidian distance of 2 vectors.
Definition at line 424 of file Vector.hh.
References BIASASSERT, BIAS::Vector< T >::GetData(), BIAS::Vector< T >::GetDataLast(), TNT::Vector< T >::size(), and T.
| Vector< T > BIAS::Vector< T >::ElementwiseProduct | ( | const Vector< T > & | arg | ) | const [inline] |
multiply this with arg elementwise and return the result
Definition at line 459 of file Vector.hh.
References BIAS::Vector< T >::ElementwiseProduct().
| void BIAS::Vector< T >::ElementwiseProduct | ( | const Vector< T > & | arg, | |
| Vector< T > & | dest | |||
| ) | const [inline] |
multiply this with arg elementwise and store the result in dest
Definition at line 448 of file Vector.hh.
References BIASASSERT, TNT::Vector< T >::newsize(), BIAS::Vector< T >::Size(), and TNT::Vector< T >::size().
Referenced by BIAS::Vector< T >::ElementwiseProduct(), BIAS::CondensHisto::GetMaxVariance(), BIAS::CondensHisto::GetMeanVariance(), BIAS::Condensation::GetVariance(), and BIAS::Condensation::GetWeightedVariance().
| const iterator TNT::Vector< T >::end | ( | ) | const [inline, inherited] |
| iterator TNT::Vector< T >::end | ( | ) | [inline, inherited] |
fills complete Vector with scalar value
Definition at line 90 of file Vector.cpp.
References BIAS::Vector< T >::operator=().
Referenced by BIAS::IntegralHistogram::GenerateIntegralHist(), BIAS::IntegralHistogram::GenerateIntegralHistDiffBin(), and BIAS::Matrix< T >::Mult().
| T* BIAS::Vector< T >::GetData | ( | ) | const [inline] |
get the pointer to the data array of the vector (for faster direct memory access)
Definition at line 214 of file Vector.hh.
Referenced by BIAS::CheckJacobian(), BIAS::SVD3x3::Compute(), BIAS::FFT::Compute(), BIAS::ComputeCovariance(), BIAS::ComputeJacobian(), BIAS::IntegralHistogram::CopyNoCheck(), BIAS::Vector< T >::Dist(), Lapack_LLS_QR_linear_solve(), Lapack_LU_linear_solve(), Lapack_WLLS_solve(), BIAS::LevenbergMarquardt(), BIAS::LevenbergMarquardtExtended(), BIAS::Vector< T >::NormL1(), BIAS::Vector< T >::NormL2(), BIAS::Vector< T >::operator*=(), BIAS::Vector< T >::operator+=(), BIAS::Vector< T >::operator-=(), BIAS::Vector< T >::operator/=(), BIAS::Vector3< HOMGPOINT2D_TYPE >::operator=(), BIAS::Vector< T >::operator==(), BIAS::Powell(), BIAS::PowellExtended(), BIAS::PMatrixBase::SetFromVector(), and BIAS::glfShaderProgram::SetUniform().
| T* BIAS::Vector< T >::GetDataLast | ( | ) | const [inline] |
Get the pointer to last element of the data array.
Definition at line 221 of file Vector.hh.
Referenced by BIAS::Vector< T >::Dist(), BIAS::Vector< T >::NormL1(), and BIAS::Vector< T >::NormL2().
| double Vector::GetMean | ( | void | ) | const [inline] |
| int BIAS::Vector< T >::GetNumElements | ( | ) | const [inline] |
conformance interface JW
Definition at line 142 of file Vector.hh.
Referenced by BIAS::glfShaderProgram::SetUniform().
| std::vector< T > Vector::GetSTLVec | ( | ) | const [inline] |
Definition at line 189 of file Vector.cpp.
Definition at line 178 of file Vector.cpp.
References BIAS::Vector< T >::Size().
Referenced by BIAS::ProjectionParametersCylindric::XMLOut().
| void TNT::Vector< T >::initialize | ( | Subscript | N | ) | [inline, protected, inherited] |
Definition at line 80 of file vec.h.
Referenced by TNT::Vector< TNT_SUBSCRIPT_TYPE >::newsize(), TNT::Vector< TNT_SUBSCRIPT_TYPE >::operator=(), and TNT::Vector< TNT_SUBSCRIPT_TYPE >::Vector().
| bool Vector::IsZero | ( | ) | const [inline] |
Definition at line 125 of file Vector.cpp.
References TNT::Vector< T >::size(), T, and TNT::Vector< T >::v_.
Referenced by BIAS::TriangleMesh::TestContraction().
| void Vector::KroneckerProduct | ( | const Vector< T > & | arg, | |
| Vector< T > & | dst | |||
| ) | const [inline] |
kronecker product
Definition at line 109 of file Vector.cpp.
References TNT::Vector< T >::newsize(), and TNT::Vector< T >::size().
Referenced by BIAS::Triangulation::GetCovarianceProjective().
| Subscript TNT::Vector< T >::lbound | ( | ) | const [inline, inherited] |
Definition at line 70 of file vec.h.
Referenced by TNT::QR_factor(), TNT::QR_solve(), and TNT::R_solve().
| double BIAS::Vector< T >::Length | ( | ) | const [inline] |
| bool Vector::Load | ( | const std::string & | filename | ) | [inline] |
method to load directly from a given filename.
internally using stream operator
Definition at line 149 of file Vector.cpp.
| void BIAS::Vector< T >::Multiply | ( | const T & | scalar, | |
| Vector< T > & | res | |||
| ) | const [inline] |
multiply components with scalar storing result in res
Definition at line 366 of file Vector.hh.
References TNT::Vector< T >::size(), and TNT::Vector< T >::v_.
Referenced by BIAS::Vector< T >::operator*().
| void BIAS::Vector< T >::MultiplyIP | ( | const T & | scalar | ) | [inline] |
in place multiplication with scalar
Definition at line 197 of file Vector.hh.
Referenced by BIAS::Condensation::CalculateMean_(), and main().
| Vector<T>& TNT::Vector< T >::newsize | ( | Subscript | N | ) | [inline, inherited] |
Definition at line 220 of file vec.h.
Referenced by BIAS::GenSynthMatches::_AddParameter(), BIAS::Binomial< InputStorageType, OutputStorageType >::_CalculateKernel(), BIAS::Param::AddParamVecDbl(), BIAS::Param::AddParamVecInt(), BIAS::CheckJacobian(), BIAS::ContourDetectorBSpline< StorageType >::CPntsToQ_(), BIAS::FilterMask::CreateFloatFilter(), BIAS::FilterMask::CreateIntFilter(), TNT::eigenproblem_special_quadratic_matrix_solve(), TNT::eigenvalue_solve(), BIAS::Vector< T >::ElementwiseProduct(), BIAS::CamPoseCalib::Estimate(), BIAS::GenerateGauss::Gauss1D(), General_singular_value_decomposition(), BIAS::SVD::GetLeftNullvector(), BIAS::FFT::GetMagnitude(), BIAS::CondensHisto::GetMaxValue(), BIAS::CondensHisto::GetMaxVariance(), BIAS::Random::GetMeanAndCovariance(), BIAS::CondensHisto::GetMeanVariance(), BIAS::SVD::GetNullvector(), BIAS::PMatrixLinear::GetPEstSystemInHom(), BIAS::FFT::GetPhase(), BIAS::ContourDetectorBSpline< StorageType >::GetPointAndParamVec_(), BIAS::Random::GetQuasiUniformDistributed(), GetSystem(), BIAS::Condensation::GetVariance(), BIAS::Condensation::GetWeightedVariance(), BIAS::Condensation::Init(), BIAS::LeastSquaresBase::Init(), BIAS::SparseMatrix::InvertAndSolve(), BIAS::Vector< T >::KroneckerProduct(), main(), BIAS::Matrix< T >::Mult(), BIAS::SparseMatrix::Multiply(), BIAS::Matrix< T >::MultLeft(), BIAS::MxArrToBIASVector(), MySqTransform(), BIAS::GenSynthMatches::operator=(), TNT::operator>>(), BIAS::UnVignette::PrepareLeastSquaresMin_(), BIAS::PMDImageProc::PreparePolyDepthCalibration(), BIAS::Covariance3Dto2DHomg::Project(), BIAS::Covariance3Dto2D::Project(), TNT::QR_factor(), BIAS::FilterMask::ResetFloatFilter(), BIAS::FilterMask::ResetIntFilter(), BIAS::LeastSquaresSVD::Solve(), BIAS::SparseMatrix::Solve(), BIAS::Vector< T >::Sub(), BIAS::SVD3x3::SVD3x3(), BIAS::TextureTransformDisparity::TextureTransformDisparity(), BIAS::TextureTransformDisplacement::TextureTransformDisplacement(), BIAS::TextureTransformEuclidian::TextureTransformEuclidian(), BIAS::TextureTransformRotation::TextureTransformRotation(), BIAS::TextureTransformSimilar::TextureTransformSimilar(), BIAS::Tracker< StorageType, CalculationType >::Tracker(), BIAS::MonteCarloTransform::Transform(), AffineBackTransform::Transform_(), AffineTransform::Transform_(), BIAS::CovTransformPose::Transform_(), BIAS::CovQuaternion2AxisAngle::Transform_(), BIAS::CovEuler2Quaternion::Transform_(), BIAS::Covariance3Dto2D::Transform_(), BIAS::Cov3Dto2DPoseCertain::Transform_(), BIAS::CamPoseCalib::TransformVec(), Upper_symmetric_eigenvalue_solve(), BIAS::Matrix< T >::Vec(), BIAS::Tracker< StorageType, CalculationType >::Vector2FilterMask_(), and BIAS::LeastSquaresSVD::WeightedSolve().
| T BIAS::Vector< T >::NormL1 | ( | ) | const [inline] |
Return the L1 norm: |a| + |b| + |c| + .
..
Definition at line 394 of file Vector.hh.
References BIAS::Vector< T >::GetData(), BIAS::Vector< T >::GetDataLast(), and T.
Referenced by BIAS::FilterMask::ComputeIntPrecisionBits().
| double BIAS::Vector< T >::NormL2 | ( | ) | const [inline] |
Return the L2 norm: sqrt(a^1 + a^2 + .
..)
Definition at line 405 of file Vector.hh.
References BIAS::Vector< T >::GetData(), BIAS::Vector< T >::GetDataLast(), and T.
Referenced by BIAS::ImageAlignment::Align(), BIAS::ImageBlender::ComputeCylCamGeometry(), BIAS::TriangleMesh::TestContraction(), BIAS::Covariance3Dto2DHomg::Transform_(), and Upper_symmetric_eigenvalue_solve().
| bool BIAS::Vector< T >::operator!= | ( | const Vector< T > & | vec | ) | const [inline] |
| const_reference TNT::Vector< T >::operator() | ( | Subscript | i | ) | const [inline, inherited] |
| reference TNT::Vector< T >::operator() | ( | Subscript | i | ) | [inline, inherited] |
| void BIAS::Vector< T >::operator*= | ( | T | scalar | ) | [inline] |
Definition at line 311 of file Vector.hh.
References BIAS::Vector< T >::GetData(), TNT::Vector< T >::size(), and T.
| void BIAS::Vector< T >::operator+= | ( | const Vector< T > & | vec | ) | [inline] |
Definition at line 287 of file Vector.hh.
References BIASASSERT, BIAS::Vector< T >::GetData(), TNT::Vector< T >::size(), and T.
| void BIAS::Vector< T >::operator-= | ( | const Vector< T > & | vec | ) | [inline] |
Definition at line 299 of file Vector.hh.
References BIASASSERT, BIAS::Vector< T >::GetData(), TNT::Vector< T >::size(), and T.
| void BIAS::Vector< T >::operator/= | ( | T | scalar | ) | [inline] |
Definition at line 322 of file Vector.hh.
References BIAS::Vector< T >::GetData(), BIAS::Vector< T >::Size(), TNT::Vector< T >::size(), and T.
| Vector< T > & Vector::operator= | ( | const TNT::Vector< T > & | vec | ) | [inline] |
assignment operators calling corresponding operator from base class "TNT::Vector" if appropriate
Reimplemented from TNT::Vector< T >.
Definition at line 83 of file Vector.cpp.
Referenced by BIAS::Vector< T >::Fill().