Basic Image AlgorithmS Library
2.8.0
|
class Vector4 contains a Vector of dim. More...
#include <Base/Math/Vector4.hh>
Public Types | |
typedef T | value_type |
Public Member Functions | |
void | Add (const T &scalar, Vector4< T > &dest) const |
Addition with a scalar, storing results in destionation vector. More... | |
void | Add (const Vector4< T > &argvec, Vector4< T > &destvec) const |
adding of two vectors, storing the result in destvec More... | |
void | AddIP (const T &scalar) |
Addition (in place) of an scalar. More... | |
void | AddIP (const Vector4< T > &argvec) |
in place adding More... | |
void | clear () |
void | Copy (const T *pv) |
copy the array of vectorsize beginning at *T to this->data_ More... | |
double | Dist (const Vector4< T > &vec) const |
Return the euclidean distance of 2 vectors. More... | |
void | Divide (const T &scalar, Vector4< T > &dest) const |
Division with a scalar, storing results in destionation vector. More... | |
void | DivideIP (const T &scalar) |
Division (in place) of an scalar. More... | |
void | ElementwiseProduct (const Vector4< T > &argvec, Vector4< T > &destvec) const |
multiply two vectors elementwise, storing the result in destvec More... | |
const T * | GetData () const |
get the data pointer the member function itself is const (before {..}) because it doesn't change the this object. More... | |
T * | GetData () |
const unsigned int | GetNumElements () const |
bool | Load (const std::string &filename) |
method to load directly from a given filename. More... | |
void | Multiply (const T &scalar, Vector4< T > &dest) const |
Multiplication with a scalar, storing results in destionation vector. More... | |
void | MultiplyIP (const T &scalar) |
Multiplication (in place) of an scalar. More... | |
T | NormL1 () const |
Return the L1 norm: |a| + |b| + |c|+ |d|. More... | |
double | NormL2 () const |
Return the L2 norm: sqrt(a^2 + b^2 + c^2 + d^2) More... | |
bool | operator!= (const Vector4< T > &arg) const |
Comparison operator 'not equal'. More... | |
Vector4< T > & | operator*= (const T &scalar) |
Multiplication operator with scalar argument. More... | |
Vector4< T > & | operator+= (const T &scalar) |
Addition operator with scalar argument. More... | |
Vector4< T > & | operator+= (const Vector4< T > &argvec) |
add operator for two Vectors More... | |
Vector4< T > & | operator-= (const T &scalar) |
Substraction operator with scalar argument. More... | |
Vector4< T > & | operator-= (const Vector4< T > &argvec) |
sub operator for two Vectors More... | |
Vector4< T > & | operator/= (const T &scalar) |
Division operator with scalar argument. More... | |
Vector4< T > & | operator= (const T &scalar) |
assignment operator set the vector elementwise to scalar value More... | |
Vector4< T > & | operator= (const Vector4< T > &vec) |
assignment operator More... | |
bool | operator== (const Vector4< T > &arg) const |
Comparison operator 'equal'. More... | |
const T & | operator[] (const int i) const |
access an element of the vector with 0-based indizes. More... | |
T & | operator[] (const int i) |
access an element of the vector with 0-based indizes. More... | |
Matrix4x4< T > | OuterProduct (const Vector4< T > &v) const |
outer product, constructs a matrix. More... | |
bool | Save (const std::string &filename) const |
method to save directly to a given filename. More... | |
void | ScalarProduct (const Vector4< T > &argvec, T &result) const |
scalar product (=inner product) of two vectors, storing the result in result More... | |
T | ScalarProduct (const Vector4< T > &argvec) const |
void | Set (const T &scalar) |
set all elements to a scalat value More... | |
void | Set (const T &x, const T &y, const T &z, const T &w) |
set elementwise with given scalr values More... | |
void | SetZero () |
set all values to 0 More... | |
const unsigned int | Size () const |
const unsigned int | size () const |
void | Sub (const T &scalar, Vector4< T > &dest) const |
Substraction with a scalar, storing results in destionation vector. More... | |
void | Sub (const Vector4< T > &argvec, Vector4< T > &destvec) const |
subtracting of two Vectors, storing the result in destvec More... | |
void | SubIP (const T &scalar) |
Substraction (in place) of an scalar. More... | |
void | SubIP (const Vector4< T > &argvec) |
in place substraction More... | |
Matrix< T > | transposed () const |
return a new Matrix with 1 row and 4 columns representing a transposed vector More... | |
Vector4 () | |
Vector4 (const Vector4< T > &vec) | |
copy constructor More... | |
Vector4 (const T &scalar) | |
assignment with a constant value for all elements More... | |
Vector4 (const T *pv) | |
assignment with an array of values which is copied into this ones class members More... | |
Vector4 (char *s) | |
constructor with element assignment More... | |
Vector4 (const T v0, const T v1, const T v2, const T v3) | |
constructor with element assigment using explicit values More... | |
Vector4 (const Vector< T > &v) | |
cast constructor More... | |
~Vector4 () | |
Iterator Functions | |
T const * | begin () const |
Iterator to first component of vector. More... | |
T * | begin () |
T const * | end () const |
Iterator pointing to one element after the last vector element. More... | |
T * | end () |
Protected Attributes | |
T | data_ [VECTOR4SIZE] |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
Vector4< T > | operator* (const Vector4< T > &v, const T &scalar) |
template<class T > | |
Vector4< T > | operator* (const T &scalar, const Vector4< T > &v) |
template<class T > | |
T | operator* (const Vector4< T > &v, const Vector4< T > &argvec) |
template<class T > | |
Vector4< T > | operator* (const Matrix4x4< T > &mat, const Vector4< T > &argvec) |
template<class T > | |
Vector3< T > | operator* (const Matrix3x4< T > &mat, const Vector4< T > &argvec) |
template<class T > | |
Vector< T > | operator* (const BIAS::Matrix< T > &mat, const Vector4< T > &vec) |
template<class T > | |
Vector4< T > | operator+ (const Vector4< T > &v, const T &scalar) |
template<class T > | |
Vector4< T > | operator+ (const Vector4< T > &v, const Vector4< T > &argvec) |
template<class T > | |
Vector4< T > | operator- (const Vector4< T > &v) |
template<class T > | |
Vector4< T > | operator- (const Vector4< T > &v, const T &scalar) |
template<class T > | |
Vector4< T > | operator- (const Vector4< T > &v, const Vector4< T > &argvec) |
template<class T > | |
Vector4< T > | operator/ (const Vector4< T > &v, const T &scalar) |
template<class T > | |
bool | operator< (const Vector4< T > &a, const Vector4< T > &b) |
std::ostream & | operator<< (std::ostream &os, const Vector4< unsigned char > &vec) |
Input with streams specialization for numerical display of unsigned char instead of alphebetically. fout format should be consistent with template implementation and Vector<> More... | |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const Vector4< T > &vec) |
Input with streams fout format should be consistent with template implementation and Vector<> More... | |
template<class T > | |
bool | operator<= (const Vector4< T > &a, const Vector4< T > &b) |
template<class T > | |
bool | operator> (const Vector4< T > &a, const Vector4< T > &b) |
template<class T > | |
bool | operator>= (const Vector4< T > &a, const Vector4< T > &b) |
std::istream & | operator>> (std::istream &is, Vector4< unsigned char > &vec) |
Input with streams specialization for numerical display of unsigned char instead of alphebetically. fout format should be consistent with template implementation and Vector<> More... | |
template<class T > | |
std::istream & | operator>> (std::istream &is, Vector4< T > &vec) |
Input with streams fout format should be consistent with template implementation and Vector<> More... | |
class Vector4 contains a Vector of dim.
4 and fixed dimension
It's elment type is templated. manual loop unrolling is used if possible. The Vector is in row-major order (4 rows, 1 column) the indizes begin with zero (to size-1)
Definition at line 65 of file Vector4.hh.
typedef T BIAS::Vector4< T >::value_type |
Definition at line 67 of file Vector4.hh.
|
inline |
Definition at line 69 of file Vector4.hh.
|
inline |
copy constructor
Definition at line 74 of file Vector4.hh.
|
inlineexplicit |
assignment with a constant value for all elements
Definition at line 384 of file Vector4.hh.
|
inlineexplicit |
assignment with an array of values
which is copied into this ones class members
Definition at line 406 of file Vector4.hh.
|
inlineexplicit |
constructor with element assignment
Definition at line 390 of file Vector4.hh.
|
inline |
constructor with element assigment using explicit values
Definition at line 400 of file Vector4.hh.
Vector4::Vector4 | ( | const Vector< T > & | v | ) |
|
inline |
Definition at line 116 of file Vector4.hh.
|
inline |
Addition with a scalar, storing results in destionation vector.
Definition at line 567 of file Vector4.hh.
References BIAS::Vector4< T >::data_.
Referenced by BIAS::Vector4< T >::operator+().
|
inline |
adding of two vectors, storing the result in destvec
Definition at line 667 of file Vector4.hh.
|
inline |
Addition (in place) of an scalar.
Definition at line 561 of file Vector4.hh.
|
inline |
in place adding
Definition at line 661 of file Vector4.hh.
|
inline |
Iterator to first component of vector.
Definition at line 152 of file Vector4.hh.
|
inline |
Definition at line 155 of file Vector4.hh.
|
inline |
Definition at line 710 of file Vector4.hh.
|
inline |
copy the array of vectorsize beginning at *T to this->data_
Definition at line 412 of file Vector4.hh.
|
inline |
|
inline |
Division with a scalar, storing results in destionation vector.
Definition at line 637 of file Vector4.hh.
References BIAS::Vector4< T >::data_.
Referenced by BIAS::Vector4< T >::operator/().
|
inline |
Division (in place) of an scalar.
Definition at line 633 of file Vector4.hh.
|
inline |
multiply two vectors elementwise, storing the result in destvec
Definition at line 491 of file Vector4.hh.
|
inline |
Iterator pointing to one element after the last vector element.
Definition at line 161 of file Vector4.hh.
|
inline |
Definition at line 164 of file Vector4.hh.
|
inline |
get the data pointer
the member function itself is const (before {..}) because it doesn't change the this object.
Definition at line 177 of file Vector4.hh.
Referenced by BIAS::GLProjectionParametersBase::BeginDraw_(), BIAS::DistortionRendering::BeginRendering(), BIAS::OutputLensDistortion::Draw_(), BIAS::GLProjectionOutputAttachment::InitShader(), BIAS::ThreeDOut::OpenGLOutEllipsoids(), BIAS::ThreeDOut::OpenGLOutLines(), BIAS::ThreeDOut::OpenGLOutPMatrices_(), BIAS::ThreeDOut::OpenGLOutPoints(), BIAS::HomgPoint3D::operator=(), BIAS::Vector4< HOMGPOINT3D_TYPE >::operator=(), BIAS::Quaternion< QUAT_TYPE >::operator=(), BIAS::Vector4< T >::operator>>(), BIAS::operator>>(), BIAS::GLProjectionOutputAttachment::StandardDraw_(), BIAS::ProjectionParametersBase::XMLIn(), and BIAS::ProjectionParametersBase::XMLOut().
|
inline |
Definition at line 181 of file Vector4.hh.
|
inline |
Definition at line 145 of file Vector4.hh.
bool Vector4::Load | ( | const std::string & | filename | ) |
method to load directly from a given filename.
internally using stream operator
Definition at line 50 of file Vector4.cpp.
|
inline |
Multiplication with a scalar, storing results in destionation vector.
Definition at line 615 of file Vector4.hh.
References BIAS::Vector4< T >::data_.
Referenced by BIAS::Vector4< T >::operator*().
|
inline |
Multiplication (in place) of an scalar.
Definition at line 609 of file Vector4.hh.
Referenced by BIAS::Quaternion< QUAT_TYPE >::Interpolate(), and BIAS::RotationAveraging::QuaternionL2Mean().
|
inline |
Return the L1 norm: |a| + |b| + |c|+ |d|.
Definition at line 501 of file Vector4.hh.
|
inline |
Return the L2 norm: sqrt(a^2 + b^2 + c^2 + d^2)
Definition at line 510 of file Vector4.hh.
Referenced by BIAS::HomgLine3D::Distance(), BIAS::TriangleMesh::GenerateTexturedCamera(), BIAS::ProjectionMapping< InputStorageType, OutputStorageType >::GetSourceCoordinates_(), BIAS::SphericalCoordinates::GetSphericalCoordinatesFullPhi(), BIAS::HomgLine3D::Homogenize(), BIAS::TriangleMesh::MakeTriangles_(), BIAS::HMatrix::MapAcrossPlane(), and BIAS::HomgPlane3D::Set().
|
inline |
Comparison operator 'not equal'.
Definition at line 546 of file Vector4.hh.
|
inline |
Multiplication operator with scalar argument.
Definition at line 602 of file Vector4.hh.
|
inline |
Addition operator with scalar argument.
Definition at line 554 of file Vector4.hh.
|
inline |
add operator for two Vectors
Definition at line 654 of file Vector4.hh.
|
inline |
Substraction operator with scalar argument.
Definition at line 578 of file Vector4.hh.
|
inline |
sub operator for two Vectors
Definition at line 678 of file Vector4.hh.
|
inline |
Division operator with scalar argument.
Definition at line 626 of file Vector4.hh.
|
inline |
assignment operator
set the vector elementwise to scalar value
Definition at line 449 of file Vector4.hh.
Referenced by BIAS::HomgPlane3D::HomgPlane3D().
|
inline |
assignment operator
Definition at line 194 of file Vector4.hh.
|
inline |
Comparison operator 'equal'.
Definition at line 539 of file Vector4.hh.
References BIAS::Vector4< T >::data_.
|
inline |
access an element of the vector with 0-based indizes.
read only (no write) member funciton const because it doesn't change this object
Definition at line 456 of file Vector4.hh.
|
inline |
access an element of the vector with 0-based indizes.
write allowed
Definition at line 464 of file Vector4.hh.
outer product, constructs a matrix.
Often written as v * v^T for col vectors
Definition at line 79 of file Vector4.cpp.
References BIAS::Vector4< T >::Size().
Referenced by BIAS::PlueckerMatrix::Set().
bool Vector4::Save | ( | const std::string & | filename | ) | const |
method to save directly to a given filename.
internally using stream operator
Definition at line 65 of file Vector4.cpp.
|
inline |
scalar product (=inner product) of two vectors, storing
the result in result
Definition at line 475 of file Vector4.hh.
Referenced by BIAS::PMatrix::GetIntersectionOfImagePlanes(), BIAS::Quaternion< QUAT_TYPE >::Interpolate(), BIAS::Quaternion< QUAT_TYPE >::InterpolateLinear(), and BIAS::Vector4< T >::operator*().
|
inline |
Definition at line 482 of file Vector4.hh.
|
inline |
set all elements to a scalat value
Definition at line 421 of file Vector4.hh.
Referenced by BIAS::DistortionRendering::DistortionRendering(), BIAS::OpenGLCanvasBase::GetPixelValueRGBA(), BIAS::GLProjectionOutputAttachment::InitShader(), BIAS::RMatrix::RMatrix(), and BIAS::HomgPoint3D::Set().
|
inline |
set elementwise with given scalr values
Definition at line 427 of file Vector4.hh.
|
inline |
set all values to 0
Definition at line 702 of file Vector4.hh.
Referenced by BIAS::RotationAveraging::ChordalL2Mean(), and BIAS::RotationAveraging::QuaternionL2Mean().
|
inline |
@return the size of this vector
Definition at line 442 of file Vector4.hh.
Referenced by BIAS::Vector4< T >::operator>>(), BIAS::operator>>(), and BIAS::Vector4< T >::OuterProduct().
|
inline |
Definition at line 436 of file Vector4.hh.
Referenced by BIAS::Quaternion< QUAT_TYPE >::EnforceRigidCouplingConstraint().
|
inline |
Substraction with a scalar, storing results in destionation vector.
Definition at line 591 of file Vector4.hh.
References BIAS::Vector4< T >::data_.
Referenced by BIAS::TrackballControl::MiddleMouseMoved(), and BIAS::Vector4< T >::operator-().
|
inline |
subtracting of two Vectors, storing the result in destvec
Definition at line 691 of file Vector4.hh.
|
inline |
Substraction (in place) of an scalar.
Definition at line 585 of file Vector4.hh.
|
inline |
in place substraction
Definition at line 685 of file Vector4.hh.
|
inline |
return a new Matrix with 1 row and 4 columns representing a
transposed vector
Definition at line 528 of file Vector4.hh.
References BIAS::Matrix< T >::GetData().
Multiplication operator with scalar argument, returning new vector
Definition at line 232 of file Operators.hh.
References BIAS::Vector4< T >::Multiply().
Multiplication operator with scalar argument, returning new vector
Definition at line 243 of file Operators.hh.
References BIAS::Vector4< T >::Multiply().
op* to multiply two vectors by their dotproduct
Definition at line 495 of file Operators.hh.
References BIAS::Vector4< T >::ScalarProduct().
|
related |
matrix-vector multiplication using 'Mult'
Definition at line 651 of file Operators.hh.
References BIAS::Matrix4x4< T >::Mult().
|
related |
Definition at line 724 of file Operators.hh.
References BIAS::Matrix3x4< T >::Mult().
|
related |
Definition at line 734 of file Operators.hh.
References TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), and BIAS::Vector< T >::Set().
Addition operator with scalar argument, returning new vector
Definition at line 271 of file Operators.hh.
References BIAS::Vector4< T >::Add().
|
related |
add operator for two Vectors, returning new vector
Definition at line 517 of file Operators.hh.
References BIAS::Vector4< T >::Add().
Definition at line 66 of file Operators.hh.
Subtraction operator with scalar argument, returning new vector
Definition at line 282 of file Operators.hh.
References BIAS::Vector4< T >::Sub().
|
related |
sub operator for two Vectors, returning new vector
Definition at line 506 of file Operators.hh.
References BIAS::Vector4< T >::Sub().
Division operator with scalar argument, returning new vector
Definition at line 254 of file Operators.hh.
References BIAS::Vector4< T >::Divide().
Definition at line 476 of file Operators.hh.
|
related |
Input with streams specialization for numerical display of unsigned char instead of alphebetically. fout format should be consistent with template implementation and Vector<>
Definition at line 729 of file Vector4.hh.
References BIAS::IsConsoleStream().
|
related |
Input with streams fout format should be consistent with template implementation and Vector<>
Definition at line 775 of file Vector4.hh.
References BIAS::IsConsoleStream().
Definition at line 470 of file Operators.hh.
Definition at line 488 of file Operators.hh.
Definition at line 482 of file Operators.hh.
|
related |
Input with streams specialization for numerical display of unsigned char instead of alphebetically. fout format should be consistent with template implementation and Vector<>
Definition at line 805 of file Vector4.hh.
References BIAS::Vector4< T >::GetData(), and BIAS::Vector4< T >::Size().
|
related |
Input with streams fout format should be consistent with template implementation and Vector<>
Definition at line 851 of file Vector4.hh.
References BIAS::Vector4< T >::GetData(), and BIAS::Vector4< T >::Size().
|
protected |
Definition at line 375 of file Vector4.hh.
Referenced by BIAS::Vector4< T >::Add(), BIAS::Vector4< T >::Divide(), BIAS::Vector4< T >::Multiply(), BIAS::Vector4< T >::operator==(), and BIAS::Vector4< T >::Sub().