Visual Servoing Platform  version 3.2.1 under development (2019-10-17) under development (2019-10-17)
vpColVector Class Reference

#include <visp3/core/vpColVector.h>

+ Inheritance diagram for vpColVector:

Public Member Functions

 vpColVector ()
 
 vpColVector (unsigned int n)
 
 vpColVector (unsigned int n, double val)
 
 vpColVector (const vpColVector &v)
 
 vpColVector (const vpColVector &v, unsigned int r, unsigned int nrows)
 
 vpColVector (const vpRotationVector &v)
 
 vpColVector (const vpPoseVector &p)
 
 vpColVector (const vpTranslationVector &t)
 
 vpColVector (const vpMatrix &M)
 
 vpColVector (const vpMatrix &M, unsigned int j)
 
 vpColVector (const std::vector< double > &v)
 
 vpColVector (const std::vector< float > &v)
 
 vpColVector (vpColVector &&v)
 
 vpColVector (const std::initializer_list< double > &list)
 
virtual ~vpColVector ()
 
void clear ()
 
std::ostream & cppPrint (std::ostream &os, const std::string &matrixName="A", bool octet=false) const
 
std::ostream & csvPrint (std::ostream &os) const
 
void deg2rad ()
 
vp_deprecated double euclideanNorm () const
 
vpColVector extract (unsigned int r, unsigned int colsize) const
 
double frobeniusNorm () const
 
vpColVector hadamard (const vpColVector &v) const
 
double infinityNorm () const
 
void init (const vpColVector &v, unsigned int r, unsigned int nrows)
 
void insert (unsigned int i, const vpColVector &v)
 
void insert (const vpColVector &v, unsigned int i)
 
std::ostream & maplePrint (std::ostream &os) const
 
std::ostream & matlabPrint (std::ostream &os) const
 
vpColVectornormalize ()
 
vpColVectornormalize (vpColVector &x) const
 
double & operator[] (unsigned int n)
 
const double & operator[] (unsigned int n) const
 
vpColVectoroperator= (const vpColVector &v)
 
vpColVectoroperator= (const vpPoseVector &p)
 
vpColVectoroperator= (const vpRotationVector &rv)
 
vpColVectoroperator= (const vpTranslationVector &tv)
 
vpColVectoroperator= (const vpMatrix &M)
 
vpColVectoroperator= (const std::vector< double > &v)
 
vpColVectoroperator= (const std::vector< float > &v)
 
vpColVectoroperator= (double x)
 
vpColVectoroperator= (vpColVector &&v)
 
vpColVectoroperator= (const std::initializer_list< double > &list)
 
bool operator== (const vpColVector &v) const
 
bool operator!= (const vpColVector &v) const
 
double operator* (const vpColVector &x) const
 
vpMatrix operator* (const vpRowVector &v) const
 
vpColVector operator* (const double x) const
 
vpColVectoroperator*= (double x)
 
vpColVector operator/ (const double x) const
 
vpColVectoroperator/= (double x)
 
vpColVector operator+ (const vpColVector &v) const
 
vpTranslationVector operator+ (const vpTranslationVector &t) const
 
vpColVectoroperator+= (vpColVector v)
 
vpColVector operator- (const vpColVector &v) const
 
vpColVectoroperator-= (vpColVector v)
 
vpColVector operator- () const
 
vpColVectoroperator<< (const vpColVector &v)
 
vpColVectoroperator<< (double *)
 
vpColVectoroperator<< (double val)
 
vpColVectoroperator, (double val)
 
int print (std::ostream &s, unsigned int length, char const *intro=0) const
 
void rad2deg ()
 
void reshape (vpMatrix &M, const unsigned int &nrows, const unsigned int &ncols)
 
vpMatrix reshape (unsigned int nrows, unsigned int ncols)
 
void resize (const unsigned int i, const bool flagNullify=true)
 
void resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify)
 
void stack (double d)
 
void stack (const vpColVector &v)
 
double sum () const
 
double sumSquare () const
 
vpRowVector t () const
 
std::vector< double > toStdVector ()
 
vpRowVector transpose () const
 
void transpose (vpRowVector &v) const
 
bool operator== (const vpArray2D< float > &A) const
 
Inherited functionalities from vpArray2D
unsigned int getCols () const
 
double getMaxValue () const
 
double getMinValue () const
 
unsigned int getRows () const
 
unsigned int size () const
 
void resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true, const bool recopy_=true)
 
bool operator== (const vpArray2D< double > &A) const
 
bool operator!= (const vpArray2D< double > &A) const
 
vpArray2D< double > hadamard (const vpArray2D< double > &m) const
 

Static Public Member Functions

static vpColVector cross (const vpColVector &a, const vpColVector &b)
 
static vpColVector crossProd (const vpColVector &a, const vpColVector &b)
 
static double dotProd (const vpColVector &a, const vpColVector &b)
 
static vpColVector invSort (const vpColVector &v)
 
static double median (const vpColVector &v)
 
static double mean (const vpColVector &v)
 
static vpMatrix skew (const vpColVector &v)
 
static vpColVector sort (const vpColVector &v)
 
static vpColVector stack (const vpColVector &A, const vpColVector &B)
 
static void stack (const vpColVector &A, const vpColVector &B, vpColVector &C)
 
static double stdev (const vpColVector &v, const bool useBesselCorrection=false)
 
Inherited I/O from vpArray2D with Static Public Member Functions
static bool load (const std::string &filename, vpArray2D< double > &A, const bool binary=false, char *header=NULL)
 
static bool loadYAML (const std::string &filename, vpArray2D< double > &A, char *header=NULL)
 
static bool save (const std::string &filename, const vpArray2D< double > &A, const bool binary=false, const char *header="")
 
static bool saveYAML (const std::string &filename, const vpArray2D< double > &A, const char *header="")
 

Public Attributes

double * data
 

Protected Attributes

unsigned int rowNum
 
unsigned int colNum
 
double ** rowPtrs
 
unsigned int dsize
 

Friends

class vpMatrix
 

Related Functions

(Note that these are not member functions.)

vpColVector operator* (const double &x, const vpColVector &v)
 
enum  vpGEMMmethod
 
void vpGEMM (const vpArray2D< double > &A, const vpArray2D< double > &B, const double &alpha, const vpArray2D< double > &C, const double &beta, vpArray2D< double > &D, const unsigned int &ops=0)
 

Deprecated functions

vp_deprecated void init ()
 
vp_deprecated vpColVector rows (unsigned int first_row, unsigned int last_row) const
 
vp_deprecated void setIdentity (const double &val=1.0)
 
vp_deprecated void stackMatrices (const vpColVector &r)
 
vp_deprecated void insert (const vpColVector &v, const unsigned int r, const unsigned int c=0)
 
static vp_deprecated vpColVector stackMatrices (const vpColVector &A, const vpColVector &B)
 
static vp_deprecated void stackMatrices (const vpColVector &A, const vpColVector &B, vpColVector &C)
 

Detailed Description

Implementation of column vector and the associated operations.

This class provides a data structure for a column vector that contains values of double. It contains also some functions to achieve a set of operations on these vectors.

The vpColVector class is derived from vpArray2D<double>.

The code below shows how to create a 3-element column vector of doubles, set the element values and access them:

#include <visp3/code/vpColVector.h
int main()
{
vpColVector v(3);
v[0] = -1; v[1] = -2.1; v[2] = -3;
std::cout << "v:" << std::endl;
for (unsigned int i = 0; i < v.size(); i++) {
std::cout << v[i] << std::endl;
}
}

Once build, this previous code produces the following output:

v:
-1
-2.1
-3

You can also use operator<< to initialize a column vector as previously:

#include <visp3/code/vpColVector.h
int main()
{
vpColVector v;
v << -1, -2.1, -3;
std::cout << "v:" << v << std::endl;
}

If ViSP is build with c++11 enabled, you can do the same using:

#include <visp3/code/vpColVector.h
int main()
{
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
vpColVector v({-1, -2.1, -3});
std::cout << "v:\n" << v << std::endl;
#endif
}

The vector could also be initialized using operator=(const std::initializer_list< double > &)

int main()
{
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
v = {-1, -2.1, -3};
#endif
}
Examples:
calibrate-hand-eye.cpp, exponentialMap.cpp, frankaSavePosition.cpp, homographyHartleyDLT2DObject.cpp, homographyHLM2DObject.cpp, homographyHLM3DObject.cpp, homographyRansac2DObject.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, mbot-apriltag-2D-half-vs.cpp, mbot-apriltag-ibvs.cpp, mbot-apriltag-pbvs.cpp, mbtGenericTrackingDepth.cpp, mbtGenericTrackingDepthOnly.cpp, moveAfma4.cpp, moveBiclops.cpp, movePioneer.cpp, movePtu46.cpp, photometricVisualServoing.cpp, quadprog.cpp, quadprog_eq.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBebop2.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoFrankaIBVS.cpp, servoFrankaPBVS.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuSphere.cpp, servoSimuSphere2DCamVelocity.cpp, servoSimuSphere2DCamVelocityDisplay.cpp, servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuThetaUCamVelocity.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityLs_cur.cpp, servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp, servoViper650FourPoints2DCamVelocityLs_cur.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_cur.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850FourPoints2DCamVelocityLs_cur.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testArray2D.cpp, testColVector.cpp, testComedi.cpp, testDisplacement.cpp, testEigenConversion.cpp, testFeatureSegment.cpp, testForceTorqueAti.cpp, testForceTorqueAtiNetFTSensor.cpp, testFrankaCartForceTorque-2.cpp, testFrankaCartForceTorque.cpp, testFrankaCartVelocity-2.cpp, testFrankaCartVelocity-3.cpp, testFrankaCartVelocity.cpp, testFrankaGetPose.cpp, testFrankaJointPosition.cpp, testFrankaJointTorque.cpp, testFrankaJointVelocity-2.cpp, testFrankaJointVelocity-3.cpp, testFrankaJointVelocity.cpp, testFrankaJointVelocityLimits.cpp, testGenericTracker.cpp, testGenericTrackerDepth.cpp, testImageFilter.cpp, testImageResize.cpp, testKalmanAcceleration.cpp, testKalmanVelocity.cpp, testMatrix.cpp, testMatrixInitialization.cpp, testQbSoftHand.cpp, testRealSense2_D435_align.cpp, testRealSense2_SR300.cpp, testRobotAfma6Pose.cpp, testRobotBebop2.cpp, testRobotViper650-frames.cpp, testRobotViper850-frames.cpp, testRobotViper850.cpp, testRobotViper850Pose.cpp, testThread2.cpp, testTukeyEstimator.cpp, testTwistMatrix.cpp, testViper650.cpp, testViper850.cpp, testVirtuose.cpp, testVirtuoseAfma6.cpp, testVirtuoseHapticBox.cpp, testVirtuoseJointLimits.cpp, testVirtuosePeriodicFunction.cpp, tutorial-homography-from-points.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-ibvs-4pts.cpp, tutorial-image-simulator.cpp, tutorial-pioneer-robot.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, tutorial-simu-pioneer.cpp, and tutorial-template-tracker.cpp.

Definition at line 130 of file vpColVector.h.

Constructor & Destructor Documentation

◆ vpColVector() [1/14]

vpColVector::vpColVector ( )
inline

Basic constructor that creates an empty 0-size column vector.

Definition at line 136 of file vpColVector.h.

◆ vpColVector() [2/14]

vpColVector::vpColVector ( unsigned int  n)
inlineexplicit

Construct a column vector of size n.

Warning
Elements are not initialized. If you want to set an initial value use vpColVector(unsigned int, double).

Definition at line 140 of file vpColVector.h.

◆ vpColVector() [3/14]

vpColVector::vpColVector ( unsigned int  n,
double  val 
)
inline

Construct a column vector of size n. Each element is set to val.

Definition at line 142 of file vpColVector.h.

◆ vpColVector() [4/14]

vpColVector::vpColVector ( const vpColVector v)
inline

Copy constructor that allows to construct a column vector from an other one.

Definition at line 145 of file vpColVector.h.

References vpMatrix::t().

◆ vpColVector() [5/14]

vpColVector::vpColVector ( const vpColVector v,
unsigned int  r,
unsigned int  nrows 
)

Construct a column vector from a part of an input column vector v.

Parameters
v: Input column vector used for initialization.
r: row index in v that corresponds to the first element of the column vector to contruct.
nrows: Number of rows of the constructed column vector.

The sub-vector starting from v[r] element and ending on v[r+nrows-1] element is used to initialize the contructed column vector.

See also
init()

Definition at line 210 of file vpColVector.cpp.

References init().

◆ vpColVector() [6/14]

vpColVector::vpColVector ( const vpRotationVector v)

Constructor that initialize a column vector from a 3-dim (Euler or $\theta {\bf u}$) or 4-dim (quaternion) rotation vector.

Definition at line 267 of file vpColVector.cpp.

References vpArray2D< Type >::size().

◆ vpColVector() [7/14]

vpColVector::vpColVector ( const vpPoseVector p)

Constructor that initialize a column vector from a 6-dim pose vector.

Definition at line 273 of file vpColVector.cpp.

References vpArray2D< Type >::size().

◆ vpColVector() [8/14]

vpColVector::vpColVector ( const vpTranslationVector t)

Constructor that initialize a column vector from a 3-dim translation vector.

Definition at line 279 of file vpColVector.cpp.

References vpArray2D< Type >::size().

◆ vpColVector() [9/14]

vpColVector::vpColVector ( const vpMatrix M)

Constructor that creates a column vector from a m-by-1 matrix M.

Exceptions
vpException::dimensionErrorIf the matrix is not a m-by-1 matrix.

Definition at line 298 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().

◆ vpColVector() [10/14]

vpColVector::vpColVector ( const vpMatrix M,
unsigned int  j 
)

Constructor that take column j of matrix M.

Definition at line 286 of file vpColVector.cpp.

References vpArray2D< Type >::getCols().

◆ vpColVector() [11/14]

vpColVector::vpColVector ( const std::vector< double > &  v)

Constructor that creates a column vector from a std vector of double.

Definition at line 312 of file vpColVector.cpp.

◆ vpColVector() [12/14]

vpColVector::vpColVector ( const std::vector< float > &  v)

Constructor that creates a column vector from a std vector of float.

Definition at line 320 of file vpColVector.cpp.

◆ vpColVector() [13/14]

vpColVector::vpColVector ( vpColVector &&  v)

◆ vpColVector() [14/14]

vpColVector::vpColVector ( const std::initializer_list< double > &  list)
inline

Definition at line 161 of file vpColVector.h.

References vpArray2D< Type >::data.

◆ ~vpColVector()

virtual vpColVector::~vpColVector ( )
inlinevirtual

Destructor.

Definition at line 169 of file vpColVector.h.

Member Function Documentation

◆ clear()

void vpColVector::clear ( )
inline

Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.

Examples:
testColVector.cpp.

Definition at line 175 of file vpColVector.h.

References vpArray2D< double >::colNum, vpMatrix::cppPrint(), vpMatrix::csvPrint(), vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.

Referenced by vpMbTracker::createCylinderBBox(), and vpQuadProg::solveQPi().

◆ cppPrint()

std::ostream & vpColVector::cppPrint ( std::ostream &  os,
const std::string &  matrixName = "A",
bool  octet = false 
) const

Print to be used as part of a C++ code later.

Parameters
os: the stream to be printed in.
matrixName: name of the column vector, "A" by default.
octet: if false, print using double, if true, print byte per byte each bytes of the double array.

The following code shows how to use this function:

#include <visp3/core/vpColVector.h>
int main()
{
for (unsigned int i=0; i<v.size(); i++)
v[i] = i;
v.cppPrint(std::cout, "v");
}

It produces the following output that could be copy/paste in a C++ code:

v[0] = 0;
v[1] = 1;
v[2] = 2;

Definition at line 1677 of file vpColVector.cpp.

References vpArray2D< double >::getRows().

◆ cross()

static vpColVector vpColVector::cross ( const vpColVector a,
const vpColVector b 
)
inlinestatic

Compute and return the cross product of two 3-dimension vectors: $a \times b$.

Parameters
a: 3-dimension column vector.
b: 3-dimension column vector.
Returns
The cross product $a \times b$.
Exceptions
vpException::dimensionErrorIf the vectors dimension is not equal to 3.

Definition at line 351 of file vpColVector.h.

References vpMatrix::stack().

Referenced by vpMbtDistanceLine::buildFrom(), vpPlane::init(), and vpMbtDistanceLine::~vpMbtDistanceLine().

◆ crossProd()

vpColVector vpColVector::crossProd ( const vpColVector a,
const vpColVector b 
)
static

Compute and return the cross product of two vectors $a \times b$.

Parameters
a: 3-dimension column vector.
b: 3-dimension column vector.
Returns
The cross product $a \times b$.
Exceptions
vpException::dimensionErrorIf the vectors dimension is not equal to 3.

Definition at line 1234 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), and skew().

Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpPose::coplanar(), vpMbTracker::createCylinderBBox(), vpPose::poseLagrangePlan(), and vpImageSimulator::setCameraPosition().

◆ csvPrint()

std::ostream & vpColVector::csvPrint ( std::ostream &  os) const

Print/save a column vector in csv format.

The following code

#include <visp3/core/vpColVector.h>
int main()
{
std::ofstream ofs("log.csv", std::ofstream::out);
for (unsigned int i=0; i<v.size(); i++)
v[i] = i;
v.csvPrint(ofs);
ofs.close();
}

produces log.csv file that contains:

0
1
2

Definition at line 1722 of file vpColVector.cpp.

References vpArray2D< double >::getRows().

◆ deg2rad()

◆ dotProd()

double vpColVector::dotProd ( const vpColVector a,
const vpColVector b 
)
static

Compute end return the dot product of two column vectors:

\[ a \cdot b = \sum_{i=0}^n a_i * b_i\]

where n is the dimension of both vectors.

Exceptions
vpException::dimensionErrorIf the vector dimension differ.

Definition at line 819 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpException::dimensionError, vpException::fatalError, vpArray2D< Type >::getRows(), and vpArray2D< Type >::size().

Referenced by vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtPolygon::isVisible(), vpPose::poseDementhonNonPlan(), and vpImageSimulator::setCameraPosition().

◆ euclideanNorm()

double vpColVector::euclideanNorm ( ) const
Deprecated:
This function is deprecated. You should rather use frobeniusNorm().

Compute and return the Euclidean norm also called Fronebius norm $ ||v|| = \sqrt{ \sum{v_{i}^2}} $.

Returns
The Euclidean norm if the vector is initialized, 0 otherwise.
See also
frobeniusNorm(), infinityNorm()

Definition at line 1573 of file vpColVector.cpp.

References frobeniusNorm().

◆ extract()

vpColVector vpColVector::extract ( unsigned int  r,
unsigned int  colsize 
) const
inline

Extract a sub-column vector from a column vector.

Parameters
r: Index of the row corresponding to the first element of the vector to extract.
colsize: Size of the vector to extract.
Exceptions
vpException::fatalErrorIf the vector to extract is not contained in the original one.
for (unsigned int i=0; i<4; i++)
v1.stack(i);
// v1 is equal to [0 1 2 3]^T
vpColVector v2 = v1.extract(1, 3);
// v2 is equal to [1 2 3]^T
Examples:
testColVector.cpp, testForceTorqueAti.cpp, and testForceTorqueAtiNetFTSensor.cpp.

Definition at line 220 of file vpColVector.h.

References vpException::fatalError, vpMatrix::frobeniusNorm(), vpArray2D< Type >::hadamard(), vpMatrix::infinityNorm(), vpMatrix::init(), vpMatrix::insert(), vpMatrix::maplePrint(), vpMatrix::matlabPrint(), and vpArray2D< double >::rowNum.

Referenced by vpLinProg::colReduction(), vpQuadProg::fromCanonicalCost(), vpLinProg::simplex(), vpLinProg::solveLP(), and vpQuadProg::solveQPi().

◆ frobeniusNorm()

double vpColVector::frobeniusNorm ( ) const

Compute and return the Fronebius norm $ ||v|| = \sqrt{ \sum{v_{i}^2}} $.

Returns
The Fronebius norm if the vector is initialized, 0 otherwise.
See also
infinityNorm()

Definition at line 1586 of file vpColVector.cpp.

References sumSquare().

Referenced by vpServo::computeProjectionOperators(), vpMbTracker::createCylinderBBox(), euclideanNorm(), vpImageSimulator::setCameraPosition(), and vpSimulatorAfma6::setPosition().

◆ getCols()

unsigned int vpArray2D< double >::getCols ( ) const
inlineinherited

Return the number of columns of the 2D array.

See also
getRows(), size()
Examples:
servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, testColVector.cpp, testDisplacement.cpp, testImageFilter.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixConvolution.cpp, testMatrixDeterminant.cpp, testMatrixInitialization.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, testPoseVector.cpp, testRowVector.cpp, testSvd.cpp, testTranslationVector.cpp, and tutorial-matlab.cpp.

Definition at line 279 of file vpArray2D.h.

References vpArray2D< Type >::colNum, vpArray2D< Type >::getMaxValue(), and vpArray2D< Type >::getMinValue().

Referenced by vpMatrix::cond(), vpRowVector::cppPrint(), vpMatrix::cppPrint(), vpRowVector::csvPrint(), vpMatrix::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::inducedL2Norm(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpRotationMatrix::isARotationMatrix(), vpMatrix::kernel(), vpRowVector::maplePrint(), vpMatrix::maplePrint(), vpRowVector::matlabPrint(), vpMatrix::matlabPrint(), vpRowVector::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpRowVector::print(), vpMatrix::print(), vpMatrix::pseudoInverse(), vpMatrix::row(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), and vpMatrix::svdOpenCV().

◆ getMaxValue()

double vpArray2D< double >::getMaxValue ( ) const
inherited

Return the array max value.

Examples:
servoMomentImage.cpp, and testArray2D.cpp.

Definition at line 914 of file vpArray2D.h.

References vpArray2D< Type >::data.

◆ getMinValue()

double vpArray2D< double >::getMinValue ( ) const
inherited

Return the array min value.

Examples:
servoMomentImage.cpp, and testArray2D.cpp.

Definition at line 897 of file vpArray2D.h.

References vpArray2D< Type >::data.

◆ getRows()

unsigned int vpArray2D< double >::getRows ( ) const
inlineinherited

Return the number of rows of the 2D array.

See also
getCols(), size()
Examples:
mbtGenericTrackingDepth.cpp, mbtGenericTrackingDepthOnly.cpp, testColVector.cpp, testDisplacement.cpp, testGenericTracker.cpp, testGenericTrackerDepth.cpp, testImageFilter.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixConvolution.cpp, testMatrixDeterminant.cpp, testMatrixInitialization.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, testPoseVector.cpp, testRowVector.cpp, testSvd.cpp, testTranslationVector.cpp, tutorial-matlab.cpp, tutorial-mb-generic-tracker-rgbd-blender.cpp, and tutorial-mb-generic-tracker-rgbd-realsense.cpp.

Definition at line 289 of file vpArray2D.h.

References vpArray2D< Type >::rowNum.

Referenced by vpMatrix::column(), vpMatrix::cond(), cppPrint(), vpMatrix::cppPrint(), csvPrint(), vpMatrix::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::inducedL2Norm(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpRotationMatrix::isARotationMatrix(), vpMatrix::kernel(), maplePrint(), vpMatrix::maplePrint(), matlabPrint(), vpMatrix::matlabPrint(), operator+(), operator+=(), operator-(), operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpPoseVector::print(), print(), vpMatrix::print(), vpMatrix::pseudoInverse(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), and vpMatrix::svdOpenCV().

◆ hadamard() [1/2]

vpColVector vpColVector::hadamard ( const vpColVector v) const

Compute the Hadamard product (element wise vector multiplication).

Parameters
v: Second vector;
Returns
v1.hadamard(v2) The kronecker product : $ v1 \circ v2 = (v1 \circ v2)_{i} = (v1)_{i} (v2)_{i} $
Examples:
testArray2D.cpp.

Definition at line 1599 of file vpColVector.cpp.

References vpCPUFeatures::checkSSE2(), vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.

◆ hadamard() [2/2]

vpArray2D< double > vpArray2D< double >::hadamard ( const vpArray2D< double > &  m) const
inherited

Compute the Hadamard product (element wise matrix multiplication).

Parameters
m: Second matrix;
Returns
m1.hadamard(m2) The Hadamard product : $ m1 \circ m2 = (m1 \circ m2)_{i,j} = (m1)_{i,j} (m2)_{i,j} $
Examples:
testArray2D.cpp.

Definition at line 934 of file vpArray2D.h.

References vpArray2D< Type >::colNum, vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().

◆ infinityNorm()

double vpColVector::infinityNorm ( ) const

Compute and return the infinity norm $ {||v||}_{\infty} = max\left({\mid v_{i} \mid}\right) $ with $i \in \{0, ..., m-1\}$ where m is the vector size and $v_i$ an element of the vector.

Returns
The infinity norm if the matrix is initialized, 0 otherwise.
See also
frobeniusNorm()

Definition at line 1637 of file vpColVector.cpp.

References vpArray2D< double >::rowNum.

Referenced by vpLinProg::colReduction(), and vpAdaptiveGain::operator()().

◆ init() [1/2]

void vpColVector::init ( const vpColVector v,
unsigned int  r,
unsigned int  nrows 
)

Initialize the column vector from a part of an input column vector v.

Parameters
v: Input column vector used for initialization.
r: row index in v that corresponds to the first element of the column vector to contruct.
nrows: Number of rows of the constructed column vector.

The sub-vector starting from v[r] element and ending on v[r+nrows-1] element is used to initialize the contructed column vector.

The following code shows how to use this function:

#include <visp3/core/vpColVector.h>
int main()
{
int val = 0;
for(size_t i=0; i<v.getRows(); i++) {
v[i] = val++;
}
std::cout << "v: " << v.t() << std::endl;
w.init(v, 0, 2);
std::cout << "w: " << w.t() << std::endl;
}

It produces the following output:

v: 0 1 2 3
w: 1 2
Examples:
testColVector.cpp.

Definition at line 252 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowPtrs.

◆ init() [2/2]

vp_deprecated void vpColVector::init ( )
inline
Deprecated:
Provided only for compat with previous releases. This function does nothing.

Definition at line 377 of file vpColVector.h.

Referenced by vpColVector(), and vpSubColVector::vpSubColVector().

◆ insert() [1/3]

void vpColVector::insert ( unsigned int  i,
const vpColVector v 
)

Insert a column vector.

Parameters
i: Index of the first element to introduce. This index starts from 0.
v: Column vector to insert.

The following example shows how to use this function:

#include <visp3/core/vpColVector.h>
int main()
{
for (unsigned int i=0; i < v.size(); i++)
v[i] = i;
std::cout << "v: " << v.t() << std::endl;
for (unsigned int i=0; i < w.size(); i++)
w[i] = i+10;
std::cout << "w: " << w.t() << std::endl;
v.insert(1, w);
std::cout << "v: " << v.t() << std::endl;
}

It produces the following output:

v: 0 1 2 3
w: 10 11
v: 0 10 11 3
Examples:
testColVector.cpp, and testVirtuoseAfma6.cpp.

Definition at line 1362 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::rowNum, vpArray2D< double >::size(), and vpArray2D< Type >::size().

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbEdgeMultiTracker::computeVVS(), vpMbDepthDenseTracker::computeVVSInteractionMatrixAndResidu(), vpMbDepthNormalTracker::computeVVSInteractionMatrixAndResidu(), vpMbKltMultiTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeKltMultiTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeMultiTracker::computeVVSInteractionMatrixAndResidu(), vpMbGenericTracker::computeVVSInteractionMatrixAndResidu(), vpMbKltMultiTracker::computeVVSWeights(), vpMbEdgeMultiTracker::computeVVSWeights(), vpMbEdgeKltMultiTracker::computeVVSWeights(), vpMbGenericTracker::computeVVSWeights(), vpMbEdgeTracker::computeVVSWeights(), insert(), and vpMbGenericTracker::track().

◆ insert() [2/3]

void vpColVector::insert ( const vpColVector v,
unsigned int  i 
)

◆ insert() [3/3]

void vpColVector::insert ( const vpColVector v,
const unsigned int  r,
const unsigned int  c = 0 
)
Deprecated:
You should rather use insert(unsigned int, const vpColVector &).

Insert column vector v at the given position r in the current column vector.

Warning
Throw vpMatrixException::incorrectMatrixSizeError if the dimensions of the matrices do not allow the operation.
Parameters
v: The column vector to insert.
r: The index of the row to begin to insert data.
c: Not used.

Definition at line 1834 of file vpColVector.cpp.

References insert().

◆ invSort()

vpColVector vpColVector::invSort ( const vpColVector v)
static

Return a column vector with elements of v that are reverse sorted with values going from greatest to lowest.

Example:

#include <visp3/core/vpColVector.h>
int main()
{
vpColVector v(10);
v[0] = 5; v[1] = 7; v[2] = 4; v[3] = 2; v[4] = 8;
v[5] = 6; v[6] = 1; v[7] = 9; v[8] = 0; v[9] = 3;
std::cout << "v: " << v.t() << std::endl;
std::cout << "s: " << s.t() << std::endl;
}

Output:

v: 5 7 4 2 8 6 1 9 0 3
s: 9 8 7 6 5 4 3 2 1 0
See also
sort()

Definition at line 907 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpException::fatalError, and vpArray2D< Type >::getRows().

◆ load()

static bool vpArray2D< double >::load ( const std::string &  filename,
vpArray2D< double > &  A,
const bool  binary = false,
char *  header = NULL 
)
inlinestaticinherited

Load a matrix from a file.

Parameters
filename: Absolute file name.
A: Array to be loaded
binary: If true the matrix is loaded from a binary file, else from a text file.
header: Header of the file is loaded in this parameter.
Returns
Returns true if success.
See also
save()

Definition at line 542 of file vpArray2D.h.

References vpException::badValue, and vpArray2D< Type >::resize().

◆ loadYAML()

static bool vpArray2D< double >::loadYAML ( const std::string &  filename,
vpArray2D< double > &  A,
char *  header = NULL 
)
inlinestaticinherited

Load an array from a YAML-formatted file.

Parameters
filename: absolute file name.
A: array to be loaded from the file.
header: header of the file is loaded in this parameter.
Returns
Returns true on success.
See also
saveYAML()
Examples:
servoFrankaIBVS.cpp, servoFrankaPBVS.cpp, and tutorial-hand-eye-calibration.cpp.

Definition at line 654 of file vpArray2D.h.

References vpArray2D< Type >::resize().

◆ maplePrint()

std::ostream & vpColVector::maplePrint ( std::ostream &  os) const

Print using Maple syntax, to copy/paste in Maple later.

The following code

#include <visp3/core/vpColVector.h>
int main()
{
for (unsigned int i=0; i<v.size(); i++)
v[i] = i;
std::cout << "v = "; v.maplePrint(std::cout);
}

produces this output:

v = ([
[0, ],
[1, ],
[2, ],
])

that could be copy/paste in Maple.

Definition at line 1757 of file vpColVector.cpp.

References vpArray2D< double >::getRows().

◆ matlabPrint()

std::ostream & vpColVector::matlabPrint ( std::ostream &  os) const

Print using Matlab syntax, to copy/paste in Matlab later.

The following code

#include <visp3/core/vpColVector.h>
int main()
{
for (unsigned int i=0; i<v.size(); i++)
v[i] = i;
std::cout << "v = "; v.matlabPrint(std::cout);
}

produces this output:

v = [ 0, ;
1, ;
2, ]

that could be copy/paste in Matlab:

>> v = [ 0, ;
1, ;
2, ]
v =
0
1
2
>>

Definition at line 1805 of file vpColVector.cpp.

References vpArray2D< double >::getRows().

◆ mean()

double vpColVector::mean ( const vpColVector v)
static

Compute the mean value of all the elements of the vector.

Examples:
testColVector.cpp.

Definition at line 1103 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< Type >::size(), and sum().

Referenced by stdev().

◆ median()

double vpColVector::median ( const vpColVector v)
static

Compute the median value of all the elements of the vector.

Examples:
testColVector.cpp.

Definition at line 1123 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpException::dimensionError, vpMath::getMedian(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().

◆ normalize() [1/2]

◆ normalize() [2/2]

vpColVector & vpColVector::normalize ( vpColVector x) const

Normalise the vector:

\[ {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} \]

Definition at line 852 of file vpColVector.cpp.

References sumSquare().

◆ operator!=() [1/2]

bool vpColVector::operator!= ( const vpColVector v) const

Definition at line 775 of file vpColVector.cpp.

◆ operator!=() [2/2]

bool vpArray2D< double >::operator!= ( const vpArray2D< double > &  A) const
inherited

Not equal to comparison operator of a 2D array.

Definition at line 995 of file vpArray2D.h.

◆ operator*() [1/3]

double vpColVector::operator* ( const vpColVector v) const

Operator that performs the dot product between two column vectors.

Exceptions
vpException::dimensionErrorIf the vector dimension differ.
See also
dotProd()

Definition at line 146 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< double >::rowNum, vpArray2D< double >::size(), and vpArray2D< Type >::size().

◆ operator*() [2/3]

vpMatrix vpColVector::operator* ( const vpRowVector v) const

Multiply a column vector by a row vector.

Parameters
v: Row vector.
Returns
The resulting matrix.

Definition at line 170 of file vpColVector.cpp.

References vpArray2D< Type >::getCols(), and vpArray2D< double >::rowNum.

◆ operator*() [3/3]

vpColVector vpColVector::operator* ( const double  x) const

Operator that allows to multiply each element of a column vector by a scalar.

Parameters
x: The scalar.
Returns
The column vector multiplied by the scalar. The current column vector (*this) is unchanged.
v[0] = 1;
v[1] = 2;
v[2] = 3;
vpColVector w = v * 3;
// v is unchanged
// w is now equal to : [3, 6, 9]

Definition at line 390 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.

◆ operator*=()

vpColVector & vpColVector::operator*= ( double  x)

Operator that allows to multiply each element of a column vector by a scalar.

Parameters
x: The scalar.
Returns
The column vector multiplied by the scalar.
v[0] = 1;
v[1] = 2;
v[2] = 3;
v *= 3;
// v is now equal to : [3, 6, 9]

Definition at line 420 of file vpColVector.cpp.

References vpArray2D< double >::rowNum.

◆ operator+() [1/2]

vpColVector vpColVector::operator+ ( const vpColVector v) const

Operator that allows to add two column vectors.

Definition at line 67 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.

◆ operator+() [2/2]

vpTranslationVector vpColVector::operator+ ( const vpTranslationVector t) const

Operator that allows to add a column vector to a translation vector.

Parameters
t: 3-dimension translation vector to add.
Returns
The sum of the current columnn vector (*this) and the translation vector to add.
v[0] = 4;
v[1] = 5;
v[2] = 6;
t2 = v + t1;
// t1 and v leave unchanged
// t2 is now equal to : 5, 7, 9

Definition at line 100 of file vpColVector.cpp.

References vpException::dimensionError, and vpArray2D< double >::getRows().

◆ operator+=()

vpColVector & vpColVector::operator+= ( vpColVector  v)

Operator that allows to add two column vectors.

Definition at line 115 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.

◆ operator,()

vpColVector & vpColVector::operator, ( double  val)

This operator could be used to set column vector elements:

#include <visp3/code/vpColVector.h
int main()
{
vpColVector v;
v << -1, -2.1, -3;
std::cout << "v:" << v << std::endl;
}

It produces the following printings:

v: -1 -2.1 -3
See also
operator<<()

Definition at line 675 of file vpColVector.cpp.

References vpArray2D< double >::data, resize(), and vpArray2D< double >::rowNum.

◆ operator-() [1/2]

vpColVector vpColVector::operator- ( const vpColVector v) const

operator substraction of two vectors V = A-v

Definition at line 182 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.

◆ operator-() [2/2]

vpColVector vpColVector::operator- ( ) const

Operator that allows to negate all the column vector elements.

vpColVector r(3, 1);
// r contains [1 1 1]^T
vpColVector v = -r;
// v contains [-1 -1 -1]^T

Definition at line 356 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpArray2D< double >::data, resize(), and vpArray2D< double >::rowNum.

◆ operator-=()

vpColVector & vpColVector::operator-= ( vpColVector  v)

Operator that allows to substract two column vectors.

Definition at line 127 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.

◆ operator/()

vpColVector vpColVector::operator/ ( const double  x) const

Operator that allows to divide each element of a column vector by a scalar.

Parameters
x: The scalar.
Returns
The column vector divided by the scalar. The current column vector (*this) is unchanged.
v[0] = 8;
v[1] = 4;
v[2] = 2;
vpColVector w = v / 2;
// v is unchanged
// w is now equal to : [4, 2, 1]

Definition at line 470 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.

◆ operator/=()

vpColVector & vpColVector::operator/= ( double  x)

Operator that allows to divide each element of a column vector by a scalar.

Parameters
x: The scalar.
Returns
The column vector divided by the scalar.
v[0] = 8;
v[1] = 4;
v[2] = 2;
v /= 2;
// v is now equal to : [4, 2, 1]

Definition at line 444 of file vpColVector.cpp.

References vpArray2D< double >::rowNum.

◆ operator<<() [1/3]

vpColVector & vpColVector::operator<< ( const vpColVector v)

Copy operator. Allows operation such as A << v

#include <visp3/core/vpColVector.h>
int main()
{
vpColVector A, B(5);
for (unsigned int i=0; i<B.size(); i++)
B[i] = i;
A << B;
std::cout << "A: " << A.t() << std::endl;
}

In column vector A we get:

A: 0 1 2 3 4

Definition at line 592 of file vpColVector.cpp.

◆ operator<<() [2/3]

vpColVector & vpColVector::operator<< ( double *  x)

Assigment operator. Allow operation such as A = *v

The following example shows how to use this operator.

#include <visp3/core/vpColVector.h>
int main()
{
size_t n = 5;
double *B = new double [n];
for (unsigned int i = 0; i < n; i++)
B[i] = i;
A << B;
std::cout << "A: " << A.t() << std::endl;
delete [] B;
}

It produces the following output:

A: 0 1 2 3 4

Definition at line 622 of file vpColVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.

◆ operator<<() [3/3]

vpColVector & vpColVector::operator<< ( double  val)

This operator could be used to set column vector elements:

#include <visp3/code/vpColVector.h
int main()
{
vpColVector v;
v << -1, -2.1, -3;
std::cout << "v:" << v << std::endl;
}

It produces the following printings:

v: -1 -2.1 -3
See also
operator,()

Definition at line 650 of file vpColVector.cpp.

References vpArray2D< double >::data, and resize().

◆ operator=() [1/10]

vpColVector & vpColVector::operator= ( const vpColVector v)

Copy operator. Allow operation such as A = v.

Definition at line 521 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, resize(), vpArray2D< Type >::rowNum, and vpArray2D< double >::rowNum.

◆ operator=() [2/10]

vpColVector & vpColVector::operator= ( const vpPoseVector p)

Operator that allows to convert a pose vector into a column vector.

Definition at line 561 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.

◆ operator=() [3/10]

vpColVector & vpColVector::operator= ( const vpRotationVector rv)

Operator that allows to convert a rotation vector into a column vector.

Definition at line 548 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.

◆ operator=() [4/10]

vpColVector & vpColVector::operator= ( const vpTranslationVector tv)

Operator that allows to convert a translation vector into a column vector.

Definition at line 535 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.

◆ operator=() [5/10]

vpColVector & vpColVector::operator= ( const vpMatrix M)

Transform a m-by-1 matrix into a column vector.

Warning
Handled with care; M should be a 1 column matrix.
Exceptions
vpException::dimensionErrorIf the matrix has more than 1 column.

Definition at line 487 of file vpColVector.cpp.

References vpArray2D< double >::data, vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.

◆ operator=() [6/10]

vpColVector & vpColVector::operator= ( const std::vector< double > &  v)

Initialize a row vector from a standard vector of double.

Definition at line 503 of file vpColVector.cpp.

References resize().

◆ operator=() [7/10]

vpColVector & vpColVector::operator= ( const std::vector< float > &  v)

Initialize a row vector from a standard vector of double.

Definition at line 513 of file vpColVector.cpp.

References resize().

◆ operator=() [8/10]

vpColVector & vpColVector::operator= ( double  x)

Set each element of the column vector to x.

Definition at line 683 of file vpColVector.cpp.

References vpArray2D< double >::data, and vpArray2D< double >::rowNum.

◆ operator=() [9/10]

vpColVector & vpColVector::operator= ( vpColVector &&  other)

Overloaded move assignment operator taking rvalue.

Definition at line 709 of file vpColVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.

◆ operator=() [10/10]

vpColVector & vpColVector::operator= ( const std::initializer_list< double > &  list)

Set vector elements and size from a list of values.

Parameters
list: List of double. Vector size matches the number of elements.
Returns
The modified vector.
#include <visp3/core/vpColVector.h>
int main()
{
c = { 0, -1, -2 };
std::cout << "c:\n" << c << std::endl;
}
It produces the following printings:
c:
0
-1
-2
See also
operator<<()

Definition at line 754 of file vpColVector.cpp.

References vpArray2D< double >::data, and resize().

◆ operator==() [1/3]

bool vpColVector::operator== ( const vpColVector v) const

◆ operator==() [2/3]

bool vpArray2D< double >::operator== ( const vpArray2D< double > &  A) const
inherited

Equal to comparison operator of a 2D array.

Definition at line 950 of file vpArray2D.h.

References vpArray2D< Type >::colNum, vpArray2D< Type >::data, vpArray2D< Type >::operator==(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().

◆ operator==() [3/3]

bool vpArray2D< float >::operator== ( const vpArray2D< float > &  A) const
inlineinherited

◆ operator[]() [1/2]

double& vpColVector::operator[] ( unsigned int  n)
inline

Operator that allows to set a value of an element $v_i$: v[i] = x.

Definition at line 247 of file vpColVector.h.

References vpArray2D< double >::data.

◆ operator[]() [2/2]

◆ print()

int vpColVector::print ( std::ostream &  s,
unsigned int  length,
char const *  intro = 0 
) const

Pretty print a column vector. The data are tabulated. The common widths before and after the decimal point are set with respect to the parameter maxlen.

Parameters
sStream used for the printing.
lengthThe suggested width of each vector element. The actual width grows in order to accomodate the whole integral part, and shrinks if the whole extent is not needed for all the numbers.
introThe introduction which is printed before the vector. Can be set to zero (or omitted), in which case the introduction is not printed.
Returns
Returns the common total width for all vector elements.
See also
std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A)
Examples:
servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocity.cpp, testColVector.cpp, and testTwistMatrix.cpp.

Definition at line 1391 of file vpColVector.cpp.

References vpArray2D< double >::getRows(), and vpMath::maximum().

◆ rad2deg()

void vpColVector::rad2deg ( )
inline

Convert a column vector containing angles in radians into degrees.

See also
deg2rad()

Definition at line 294 of file vpColVector.h.

References vpArray2D< Type >::reshape().

Referenced by vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpRobotViper650::setVelocity(), and vpRobotViper850::setVelocity().

◆ reshape() [1/2]

void vpColVector::reshape ( vpMatrix M,
const unsigned int &  nrows,
const unsigned int &  ncols 
)

Reshape the column vector in a matrix.

Parameters
M: the reshaped matrix.
nrows: number of rows of the matrix.
ncols: number of columns of the matrix.
Exceptions
vpException::dimensionErrorIf the matrix and the column vector have not the same size.

The following example shows how to use this method.

#include <visp3/core/vpColVector.h>
int main()
{
int var=0;
vpMatrix mat(3, 4);
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++)
mat[i][j] = ++var;
std::cout << "mat: \n" << mat << std::endl;
vpColVector col = mat.stackColumns();
std::cout << "column vector: \n" << col << std::endl;
vpMatrix remat = col.reshape(3, 4);
std::cout << "remat: \n" << remat << std::endl;
}

If you run the previous example, you get:

mat:
1 2 3 4
5 6 7 8
9 10 11 12
column vector:
1
5
9
2
6
10
3
7
11
4
8
12
remat:
1 2 3 4
5 6 7 8
9 10 11 12
Examples:
testMatrixInitialization.cpp.

Definition at line 1316 of file vpColVector.cpp.

References vpArray2D< double >::data, vpException::dimensionError, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), and vpArray2D< double >::rowNum.

Referenced by reshape().

◆ reshape() [2/2]

vpMatrix vpColVector::reshape ( unsigned int  nrows,
unsigned int  ncols 
)

Reshape the column vector in a matrix.

Parameters
nrows: number of rows of the matrix
ncols: number of columns of the matrix
Returns
The reshaped matrix.
See also
reshape(vpMatrix &, const unsigned int &, const unsigned int &)

Definition at line 1254 of file vpColVector.cpp.

References reshape().

◆ resize() [1/3]

void vpArray2D< double >::resize ( const unsigned int  nrows,
const unsigned int  ncols,
const bool  flagNullify = true,
const bool  recopy_ = true 
)
inlineinherited

Set the size of the array and initialize all the values to zero.

Parameters
nrows: number of rows.
ncols: number of column.
flagNullify: if true, then the array is re-initialized to 0 after resize. If false, the initial values from the common part of the array (common part between old and new version of the array) are kept. Default value is true.
recopy_: if true, will perform an explicit recopy of the old data if needed and if flagNullify is set to false.
Examples:
testArray2D.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixDeterminant.cpp, testMatrixInitialization.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, and testSvd.cpp.

Definition at line 305 of file vpArray2D.h.

References vpArray2D< Type >::colNum, vpArray2D< Type >::dsize, vpException::memoryAllocationError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.

Referenced by vpMatrix::diag(), vpMatrix::eye(), vpMatrix::init(), vpMatrix::operator,(), vpMatrix::operator<<(), vpMatrix::operator=(), vpMatrix::stack(), and vpMatrix::svdOpenCV().

◆ resize() [2/3]

void vpColVector::resize ( const unsigned int  i,
const bool  flagNullify = true 
)
inline

Modify the size of the column vector.

Parameters
i: Size of the vector. This value corresponds to the vector number of rows.
flagNullify: If true, set the data to zero.
Exceptions
vpException::fatalErrorWhen ncols is not equal to 1.
Examples:
moveAfma4.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoViper850Point2DCamVelocityKalman.cpp, testColVector.cpp, testMatrixInitialization.cpp, and testThread2.cpp.

Definition at line 310 of file vpColVector.h.

References vpArray2D< Type >::resize().

Referenced by vpMatrix::add2Matrices(), vpPoint::changeFrame(), vpLine::changeFrame(), vpRobotAfma6::checkJointLimits(), vpLinProg::colReduction(), vpMbtFaceDepthNormal::computeDesiredFeaturesPCL(), vpMbtFaceDepthNormal::computeDesiredFeaturesSVD(), vpHomography::computeDisplacement(), vpServo::computeError(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), vpMbTracker::computeJTR(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpPoseFeatures::computePose(), vpMbEdgeKltTracker::computeVVS(), vpMbDepthDenseTracker::computeVVSInit(), vpMbDepthNormalTracker::computeVVSInit(), vpMbKltMultiTracker::computeVVSInit(), vpMbEdgeKltMultiTracker::computeVVSInit(), vpMbEdgeMultiTracker::computeVVSInit(), vpMbGenericTracker::computeVVSInit(), vpMbKltTracker::computeVVSInit(), vpMbEdgeTracker::computeVVSInit(), vpFeatureMoment::duplicate(), vp::eigen2visp(), vpFeatureLuminance::error(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpThetaUVector::extract(), vpRobotFranka::getCoriolis(), vpQbSoftHand::getCurrent(), vpMatrix::getDiag(), vpRobotPtu46::getDisplacement(), vpRobotBiclops::getDisplacement(), vpSimulatorAfma6::getDisplacement(), vpRobotAfma4::getDisplacement(), vpSimulatorViper850::getDisplacement(), vpRobotAfma6::getDisplacement(), vpRobotViper650::getDisplacement(), vpRobotViper850::getDisplacement(), vpRobotFranka::getForceTorque(), vpRobotViper650::getForceTorque(), vpRobotViper850::getForceTorque(), vpRobotFranka::getGravity(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpPlane::getNormal(), vpQbSoftHand::getPosition(), vpRobotPtu46::getPosition(), vpRobotBiclops::getPosition(), vpSimulatorCamera::getPosition(), vpRobotCamera::getPosition(), vpSimulatorPioneer::getPosition(), vpSimulatorPioneerPan::getPosition(), vpSimulatorAfma6::getPosition(), vpRobotAfma4::getPosition(), vpSimulatorViper850::getPosition(), vpRobotAfma6::getPosition(), vpRobotFranka::getPosition(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotPioneer::getVelocity(), vpRobotPtu46::getVelocity(), vpRobotBiclops::getVelocity(), vpSimulatorAfma6::getVelocity(), vpRobotAfma4::getVelocity(), vpSimulatorViper850::getVelocity(), vpRobotAfma6::getVelocity(), vpRobotFranka::getVelocity(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpPoint::getWorldCoordinates(), hadamard(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpPoint::init(), vpRobotBiclops::init(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpLine::init(), vpFeatureLuminance::init(), vpKalmanFilter::init(), vpFeatureSegment::init(), vpTemplateTrackerTriangle::init(), vpCylinder::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpImageSimulator::init(), vpFeatureMoment::init(), vpFeatureLine::init(), init(), vpRobotAfma4::init(), vpFeaturePoint3D::init(), vpSimulatorAfma6::init(), vpRobotAfma6::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpSimulatorViper850::init(), vpFeatureTranslation::init(), vpRobotViper650::init(), vpRobotViper850::init(), vpTemplateTrackerMIESM::initCompInverse(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpMbtDistanceCircle::initInteractionMatrixError(), vpMbtDistanceLine::initInteractionMatrixError(), vpMbtDistanceCylinder::initInteractionMatrixError(), vpMbEdgeKltMultiTracker::initMbtTracking(), vpRobust::MEstimator(), vpMatrix::multMatrixVector(), operator,(), operator-(), operator<<(), vpSubColVector::operator=(), operator=(), vpPose::poseVirtualVSrobust(), vpPoint::projection(), vpLine::projection(), vpMatrix::pseudoInverse(), vpSimulatorAfma6::readPosFile(), vpRobotAfma4::readPosFile(), vpSimulatorViper850::readPosFile(), vpRobotAfma6::readPosFile(), vpRobotFranka::readPosFile(), vpRobotViper650::readPosFile(), vpRobotViper850::readPosFile(), vpRobotBiclops::readPositionFile(), vpRobotPtu46::readPositionFile(), vpRobust::resize(), vpLinProg::simplex(), vpLinProg::solveLP(), vpQuadProg::solveQPi(), stack(), vpMatrix::stackColumns(), vpMatrix::sub2Matrices(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpMbGenericTracker::track(), vpMbEdgeKltTracker::trackFirstLoop(), vpFeatureMoment::update(), vpGenericFeature::vpGenericFeature(), vpImageSimulator::vpImageSimulator(), vpRobotWireFrameSimulator::vpRobotWireFrameSimulator(), vpRobust::vpRobust(), vpSickLDMRS::vpSickLDMRS(), vpTemplateTracker::vpTemplateTracker(), vpTemplateTrackerMI::vpTemplateTrackerMI(), vpTemplateTrackerSSD::vpTemplateTrackerSSD(), vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM(), vpTemplateTrackerZNCC::vpTemplateTrackerZNCC(), and vpViper::vpViper().

◆ resize() [3/3]

void vpColVector::resize ( const unsigned int  nrows,
const unsigned int  ncols,
const bool  flagNullify 
)
inline

Resize the column vector to a nrows-dimension vector. This function can only be used with ncols = 1.

Parameters
nrows: Vector number of rows. This value corresponds to the size of the vector.
ncols: Vector number of columns. This value should be set to 1.
flagNullify: If true, set the data to zero.
Exceptions
vpException::fatalErrorWhen ncols is not equal to 1.

Definition at line 321 of file vpColVector.h.

References vpException::fatalError, vpArray2D< Type >::resize(), vpMatrix::stack(), vpMatrix::sum(), vpMatrix::sumSquare(), vpMatrix::t(), and vpMatrix::transpose().

◆ rows()

vp_deprecated vpColVector vpColVector::rows ( unsigned int  first_row,
unsigned int  last_row 
) const
inline
Deprecated:
You should rather use extract().

Definition at line 381 of file vpColVector.h.

References vpMatrix::setIdentity().

◆ save()

static bool vpArray2D< double >::save ( const std::string &  filename,
const vpArray2D< double > &  A,
const bool  binary = false,
const char *  header = "" 
)
inlinestaticinherited

Save a matrix to a file.

Parameters
filename: Absolute file name.
A: Array to be saved.
binary: If true the matrix is saved in a binary file, else a text file.
header: Optional line that will be saved at the beginning of the file.
Returns
Returns true if success.

Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.

See also
load()

Definition at line 739 of file vpArray2D.h.

References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().

◆ saveYAML()

static bool vpArray2D< double >::saveYAML ( const std::string &  filename,
const vpArray2D< double > &  A,
const char *  header = "" 
)
inlinestaticinherited

Save an array in a YAML-formatted file.

Parameters
filename: absolute file name.
A: array to be saved in the file.
header: optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any.
Returns
Returns true if success.

Here is an example of outputs.

vpArray2D::saveYAML("matrix.yml", M, "example: a YAML-formatted header");
vpArray2D::saveYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted
header\n - with inner indentation");

Content of matrix.yml:

example: a YAML-formatted header
rows: 3
cols: 4
- [0, 0, 0, 0]
- [0, 0, 0, 0]
- [0, 0, 0, 0]

Content of matrixIndent.yml:

example:
- a YAML-formatted header
- with inner indentation
rows: 3
cols: 4
- [0, 0, 0, 0]
- [0, 0, 0, 0]
- [0, 0, 0, 0]
See also
loadYAML()
Examples:
tutorial-chessboard-pose.cpp, tutorial-franka-acquire-calib-data.cpp, and tutorial-hand-eye-calibration.cpp.

Definition at line 832 of file vpArray2D.h.

References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().

◆ setIdentity()

vp_deprecated void vpColVector::setIdentity ( const double &  val = 1.0)
Deprecated:
You should rather use eye()

◆ size()

◆ skew()

vpMatrix vpColVector::skew ( const vpColVector v)
static

Compute the skew symmetric matrix $[{\bf v}]_\times$ of vector v.

\[ \mbox{if} \quad {\bf V} = \left( \begin{array}{c} x \\ y \\ z \end{array}\right), \quad \mbox{then} \qquad [{\bf v}]_\times = \left( \begin{array}{ccc} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{array}\right) \]

Parameters
v: Input vector used to compute the skew symmetric matrix.
Examples:
servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp, and testVirtuoseHapticBox.cpp.

Definition at line 1202 of file vpColVector.cpp.

References vpException::dimensionError, vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().

Referenced by vpMatrix::computeCovarianceMatrixVVS(), crossProd(), and vpFeatureThetaU::interaction().

◆ sort()

vpColVector vpColVector::sort ( const vpColVector v)
static

Return a column vector with elements of v that are sorted with values going from lowest to geatest.

Example:

#include <visp3/core/vpColVector.h>
int main()
{
vpColVector v(10);
v[0] = 5; v[1] = 7; v[2] = 4; v[3] = 2; v[4] = 8;
v[5] = 6; v[6] = 1; v[7] = 9; v[8] = 0; v[9] = 3;
std::cout << "v: " << v.t() << std::endl;
std::cout << "s: " << s.t() << std::endl;
}

Output:

v: 5 7 4 2 8 6 1 9 0 3
s: 0 1 2 3 4 5 6 7 8 9
See also
invSort()

Definition at line 959 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpException::fatalError, and vpArray2D< Type >::getRows().

◆ stack() [1/4]

◆ stack() [2/4]

void vpColVector::stack ( const vpColVector v)

Stack column vectors.

Parameters
v: Vector to stack to the existing one.
vpColVector v1(3, 1);
// v1 is equal to [1 1 1]^T
vpColVector v2(2, 3);
// v2 is equal to [3 3]^T
v1.stack(v2);
// v1 is equal to [1 1 1 3 3]^T
See also
stack(const vpColVector &, const double &)
stack(const vpColVector &, const vpColVector &)
stack(const vpColVector &, const vpColVector &, vpColVector &)

Definition at line 1025 of file vpColVector.cpp.

References stack().

◆ stack() [3/4]

vpColVector vpColVector::stack ( const vpColVector A,
const vpColVector B 
)
static

Stack column vectors.

Parameters
A: Initial vector.
B: Vector to stack at the end of A.
Returns
Stacked vector $[A B]^T$.
C = vpColVector::stack(A, B); // C = [A B]T
// C is now an 8 dimension column vector
See also
stack(const vpColVector &)
stack(const vpColVector &, const vpColVector &, vpColVector &)

Definition at line 1045 of file vpColVector.cpp.

References stack().

◆ stack() [4/4]

void vpColVector::stack ( const vpColVector A,
const vpColVector B,
vpColVector C 
)
static

Stack column vectors.

Parameters
A: Initial vector.
B: Vector to stack at the end of A.
C: Resulting stacked vector $C = [A B]^T$.
vpColVector::stack(A, B, C); // C = [A B]T
// C is now an 8 dimension column vector
See also
stack(const vpColVector &)
stack(const vpColVector &, const vpColVector &)

Definition at line 1070 of file vpColVector.cpp.

References vpArray2D< Type >::getRows(), and resize().

◆ stackMatrices() [1/3]

vp_deprecated void vpColVector::stackMatrices ( const vpColVector r)
inline
Deprecated:
You should rather use stack(const vpColVector &)

Definition at line 392 of file vpColVector.h.

References vpMatrix::stack().

◆ stackMatrices() [2/3]

static vp_deprecated vpColVector vpColVector::stackMatrices ( const vpColVector A,
const vpColVector B 
)
inlinestatic
Deprecated:
You should rather use stack(const vpColVector &A, const vpColVector &B)

Definition at line 397 of file vpColVector.h.

References vpMatrix::stack().

◆ stackMatrices() [3/3]

static vp_deprecated void vpColVector::stackMatrices ( const vpColVector A,
const vpColVector B,
vpColVector C 
)
inlinestatic
Deprecated:
You should rather use stack(const vpColVector &A, const vpColVector &B, vpColVector &C)

Definition at line 402 of file vpColVector.h.

References vpMatrix::insert(), vpMatrix::operator*(), and vpMatrix::stack().

◆ stdev()

double vpColVector::stdev ( const vpColVector v,
const bool  useBesselCorrection = false 
)
static

Compute the standard deviation value of all the elements of the vector.

Examples:
testColVector.cpp.

Definition at line 1137 of file vpColVector.cpp.

References vpCPUFeatures::checkSSE2(), vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getRows(), mean(), and vpArray2D< Type >::size().

◆ sum()

double vpColVector::sum ( ) const

Return the sum of all the elements $v_{i}$ of the column vector v(m).

Returns
The value

\[\sum{i=0}^{m} v_i\]

.
Examples:
testColVector.cpp, and testThread2.cpp.

Definition at line 1480 of file vpColVector.cpp.

References vpCPUFeatures::checkSSE2(), vpArray2D< double >::data, and vpArray2D< double >::rowNum.

Referenced by mean().

◆ sumSquare()

◆ t()

vpRowVector vpColVector::t ( ) const

Transpose the column vector. The resulting vector becomes a row vector.

Examples:
moveAfma4.cpp, movePtu46.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoBebop2.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp, testColVector.cpp, testComedi.cpp, testDisplacement.cpp, testEigenConversion.cpp, testForceTorqueAti.cpp, testForceTorqueAtiNetFTSensor.cpp, testFrankaCartForceTorque-2.cpp, testFrankaCartForceTorque.cpp, testFrankaCartVelocity-2.cpp, testFrankaCartVelocity-3.cpp, testFrankaCartVelocity.cpp, testFrankaGetPose.cpp, testFrankaJointPosition.cpp, testFrankaJointTorque.cpp, testFrankaJointVelocity-2.cpp, testFrankaJointVelocity-3.cpp, testFrankaJointVelocity.cpp, testFrankaJointVelocityLimits.cpp, testKalmanAcceleration.cpp, testKalmanVelocity.cpp, testMatrix.cpp, testMatrixInitialization.cpp, testRobotViper650-frames.cpp, testRobotViper850-frames.cpp, testRobotViper850.cpp, testVirtuose.cpp, testVirtuoseAfma6.cpp, testVirtuosePeriodicFunction.cpp, tutorial-homography-from-points.cpp, and tutorial-pioneer-robot.cpp.

Definition at line 782 of file vpColVector.cpp.

References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.

Referenced by vpHomography::computeDisplacement(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), vpServo::computeProjectionOperators(), vpRobotBiclops::getPosition(), vpRobotBiclops::getVelocity(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpSimulatorAfma6::initialiseCameraRelativeToObject(), vpSimulatorViper850::initialiseCameraRelativeToObject(), vpHomography::load(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpForwardProjection::print(), vpServo::print(), vpPose::printPoint(), vpServoData::save(), vpRobotBiclops::setVelocity(), vpLinProg::simplex(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and transpose().

◆ toStdVector()

std::vector< double > vpColVector::toStdVector ( )

Converts the vpColVector to a std::vector.

Returns
The corresponding std::vector<double>.
Examples:
testColVector.cpp.

Definition at line 696 of file vpColVector.cpp.

References vpArray2D< double >::data, and vpArray2D< double >::size().

◆ transpose() [1/2]

vpRowVector vpColVector::transpose ( ) const

Transpose the column vector. The resulting vector becomes a row vector.

See also
t()

Definition at line 793 of file vpColVector.cpp.

References t().

◆ transpose() [2/2]

void vpColVector::transpose ( vpRowVector v) const

Transpose the column vector. The resulting vector v becomes a row vector.

See also
t()

Definition at line 799 of file vpColVector.cpp.

References t().

Friends And Related Function Documentation

◆ operator*()

vpColVector operator* ( const double &  x,
const vpColVector v 
)
related

Allows to multiply a scalar by a column vector.

Definition at line 805 of file vpColVector.cpp.

◆ vpGEMM()

void vpGEMM ( const vpArray2D< double > &  A,
const vpArray2D< double > &  B,
const double &  alpha,
const vpArray2D< double > &  C,
const double &  beta,
vpArray2D< double > &  D,
const unsigned int &  ops = 0 
)
related

This function performs generalized matrix multiplication: D = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T. Operation on A, B and C matrices is described by enumeration vpGEMMmethod().

For example, to compute D = alpha*A^T*B^T+beta*C we need to call :

vpGEMM(A, B, alpha, C, beta, D, VP_GEMM_A_T + VP_GEMM_B_T);

If C is not used, vpGEMM must be called using an empty array null. Thus to compute D = alpha*A^T*B, we have to call:

vpGEMM(A, B, alpha, null, 0, D, VP_GEMM_B_T);
Exceptions
vpException::incorrectMatrixSizeErrorif the sizes of the matrices do not allow the operations.
Parameters
A: An array that could be a vpMatrix.
B: An array that could be a vpMatrix.
alpha: A scalar.
C: An array that could be a vpMatrix.
beta: A scalar.
D: The resulting array that could be a vpMatrix.
ops: A scalar describing operation applied on the matrices. Possible values are the one defined in vpGEMMmethod(): VP_GEMM_A_T, VP_GEMM_B_T, VP_GEMM_C_T.

Definition at line 393 of file vpGEMM.h.

References vpException::functionNotImplementedError.

◆ vpGEMMmethod

enum vpGEMMmethod
related

Enumeration of the operations applied on matrices in vpGEMM() function.

Operations are :

  • VP_GEMM_A_T to use the transpose matrix of A instead of the matrix A
  • VP_GEMM_B_T to use the transpose matrix of B instead of the matrix B
  • VP_GEMM_C_T to use the transpose matrix of C instead of the matrix C

Definition at line 57 of file vpGEMM.h.

◆ vpMatrix

friend class vpMatrix
friend

Definition at line 132 of file vpColVector.h.

Member Data Documentation

◆ colNum

unsigned int vpArray2D< double >::colNum
protectedinherited

Number of columns in the array.

Definition at line 137 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpMatrix::AtA(), clear(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUGsl(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpMatrix::eye(), vpMatrix::getDiag(), vpMatrix::getRow(), hadamard(), vpMatrix::hadamard(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUGsl(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpRotationMatrix::operator*(), vpRowVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpRowVector::operator*=(), vpMatrix::operator*=(), vpRowVector::operator+(), vpRowVector::operator+=(), vpMatrix::operator+=(), vpRowVector::operator,(), vpMatrix::operator,(), vpRowVector::operator-(), vpRowVector::operator-=(), vpMatrix::operator-=(), vpRowVector::operator/(), vpMatrix::operator/(), vpRowVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), operator<<(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpRowVector::operator=(), operator=(), vpMatrix::operator=(), vpRowVector::operator==(), operator==(), vpMatrix::qr(), vpMatrix::qrPivot(), vpRowVector::reshape(), vpMatrix::setIdentity(), vpMatrix::solveByQR(), vpMatrix::solveBySVD(), vpMatrix::stack(), vpRowVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpRowVector::sum(), vpMatrix::sum(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), vpRowVector::t(), vpMatrix::transpose(), vpColVector(), vpMatrix::vpMatrix(), and vpRowVector::vpRowVector().

◆ data

double * vpArray2D< double >::data
inherited

Address of the first element of the data array.

Examples:
testArray2D.cpp, testDisplacement.cpp, testEigenConversion.cpp, testImageFilter.cpp, testMatrix.cpp, testTranslationVector.cpp, and tutorial-matlab.cpp.

Definition at line 145 of file vpArray2D.h.

Referenced by vpMatrix::AtA(), vpQuaternionVector::buildFrom(), vpHomogeneousMatrix::buildFrom(), vpThetaUVector::buildFrom(), vpRzyzVector::buildFrom(), vpRxyzVector::buildFrom(), vpRzyxVector::buildFrom(), vpSubColVector::checkParentStatus(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), clear(), vpHomogeneousMatrix::convert(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUOpenCV(), vpMatrix::expm(), vpThetaUVector::extract(), vpMatrix::frobeniusNorm(), vpMatrix::getRow(), vpThetaUVector::getTheta(), vpThetaUVector::getU(), hadamard(), vpMatrix::hadamard(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUOpenCV(), vpTranslationVector::operator*(), vpRowVector::operator*(), vpHomography::operator*(), operator*(), vpMatrix::operator*(), vpRotationVector::operator,(), vpTranslationVector::operator,(), vpRotationMatrix::operator,(), vpRowVector::operator,(), operator,(), vpTranslationVector::operator-(), vpRowVector::operator-(), operator-(), vpTranslationVector::operator/(), vpRowVector::operator/(), vpHomography::operator/(), operator/(), vpHomography::operator/=(), vpRotationVector::operator<<(), vpTranslationVector::operator<<(), vpRotationMatrix::operator<<(), vpRowVector::operator<<(), operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpQuaternionVector::operator=(), vpTranslationVector::operator=(), vpRotationMatrix::operator=(), vpRxyzVector::operator=(), vpRzyzVector::operator=(), vpRzyxVector::operator=(), vpRowVector::operator=(), vpThetaUVector::operator=(), operator=(), vpMatrix::operator=(), vpRowVector::operator==(), operator==(), operator[](), vpMatrix::qr(), vpMatrix::qrPivot(), vpRowVector::reshape(), reshape(), vpQuaternionVector::set(), vpMatrix::stack(), vpMatrix::stackRows(), sum(), sumSquare(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpRotationVector::t(), vpTranslationVector::t(), vpPoseVector::t(), vpRowVector::t(), t(), vpRotationVector::toStdVector(), vpRowVector::toStdVector(), toStdVector(), vpColVector(), vpMatrix::vpMatrix(), vpRowVector::vpRowVector(), vpQuaternionVector::w(), vpQuaternionVector::x(), vpQuaternionVector::y(), vpQuaternionVector::z(), vpSubColVector::~vpSubColVector(), vpSubMatrix::~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().

◆ dsize

◆ rowNum

unsigned int vpArray2D< double >::rowNum
protectedinherited

Number of rows in the array.

Definition at line 135 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpMatrix::AtA(), clear(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUGsl(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), extract(), vpMatrix::eye(), vpMatrix::getCol(), vpMatrix::getDiag(), vpMatrix::getRow(), hadamard(), vpMatrix::hadamard(), infinityNorm(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUGsl(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpTranslationVector::operator*(), vpRotationMatrix::operator*(), vpHomogeneousMatrix::operator*(), operator*(), vpMatrix::operator*(), vpTranslationVector::operator*=(), vpRotationMatrix::operator*=(), operator*=(), vpMatrix::operator*=(), operator+(), operator+=(), vpMatrix::operator+=(), operator,(), operator-(), operator-=(), vpMatrix::operator-=(), operator/(), vpMatrix::operator/(), vpTranslationVector::operator/=(), operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), operator=(), vpMatrix::operator=(), vpRowVector::operator==(), operator==(), vpMatrix::qr(), vpMatrix::qrPivot(), reshape(), vpMatrix::setIdentity(), vpMatrix::stack(), stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), sum(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), sumSquare(), vpMatrix::sumSquare(), vpTranslationVector::t(), vpPoseVector::t(), t(), vpMatrix::transpose(), vpColVector(), vpMatrix::vpMatrix(), and vpRowVector::vpRowVector().

◆ rowPtrs