Visual Servoing Platform
version 3.0.0
|
#include <visp3/core/vpArray2D.h>
Public Member Functions | |
vpArray2D () | |
vpArray2D (const vpArray2D< Type > &A) | |
vpArray2D (unsigned int r, unsigned int c) | |
vpArray2D (unsigned int r, unsigned int c, Type val) | |
virtual | ~vpArray2D () |
Static Public Member Functions | |
Inherited I/O from vpArray2D with Static Public Member Functions | |
static bool | load (const std::string &filename, vpArray2D< Type > &A, const bool binary=false, char *header=NULL) |
static bool | loadYAML (const std::string &filename, vpArray2D< Type > &A, char *header=NULL) |
static bool | save (const std::string &filename, const vpArray2D< Type > &A, const bool binary=false, const char *header="") |
static bool | saveYAML (const std::string &filename, const vpArray2D< Type > &A, const char *header="") |
Public Attributes | |
Type * | data |
Protected Attributes | |
unsigned int | rowNum |
unsigned int | colNum |
Type ** | rowPtrs |
unsigned int | dsize |
Related Functions | |
(Note that these are not member functions.) | |
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) |
Inherited functionalities from vpArray2D | |
std::ostream & | operator<< (std::ostream &s, const vpArray2D< Type > &A) |
Type | getMinValue () const |
Type | getMaxValue () const |
unsigned int | getRows () const |
unsigned int | getCols () const |
unsigned int | size () const |
void | resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true) |
vpArray2D< Type > & | operator= (Type x) |
vpArray2D< Type > & | operator= (const vpArray2D< Type > &A) |
Type * | operator[] (unsigned int i) |
Type * | operator[] (unsigned int i) const |
Implementation of a generic 2D array used as vase class of matrices and vectors.
This class implements a 2D array as a template class and all the basic functionalities common to matrices and vectors. More precisely:
Definition at line 70 of file vpArray2D.h.
Basic constructor of a 2D array. Number of columns and rows are set to zero.
Definition at line 91 of file vpArray2D.h.
Copy constructor of a 2D array.
Definition at line 97 of file vpArray2D.h.
Constructor that initializes a 2D array with 0.
r | : Array number of rows. |
c | : Array number of columns. |
Definition at line 109 of file vpArray2D.h.
|
inline |
Constructor that initialize a 2D array with val.
r | : Array number of rows. |
c | : Array number of columns. |
val | : Each element of the array is set to val. |
Definition at line 121 of file vpArray2D.h.
Destructor that desallocate memory.
Definition at line 130 of file vpArray2D.h.
|
inline |
Return the number of columns of the 2D array.
Definition at line 154 of file vpArray2D.h.
Referenced by vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpServo::computeControlLaw(), vpMatrix::computeCovarianceMatrix(), vpMatrix::computeHLM(), vpServo::computeInteractionMatrix(), vpMbTracker::computeJTR(), vpServo::computeProjectionOperators(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMatrix::cond(), vpImageSimulator::getImage(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::init(), vpMatrix::init(), vpCameraParameters::initFromCalibrationMatrix(), vpRowVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::juxtaposeMatrices(), vpMatrix::kron(), vpRowVector::mean(), vpMatrix::mult2Matrices(), vpMatrix::multMatrixVector(), vpRotationMatrix::operator*(), vpTranslationVector::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpRowVector::operator*(), vpColVector::operator*(), vpMatrix::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpMatrix::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpMatrix::operator-=(), vpSubRowVector::operator=(), vpSubColVector::operator=(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpHomography::operator=(), vpPose::poseDementhonPlan(), vpMatrix::printSize(), vpMatrix::pseudoInverse(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), vpArray2D< double >::save(), vpArray2D< double >::saveYAML(), vpServo::secondaryTask(), vpServo::secondaryTaskJointLimitAvoidance(), vpRowVector::stack(), vpMatrix::stack(), vpMatrix::stackRows(), vpMatrix::sub2Matrices(), vpMatrix::svd(), vpColVector::vpColVector(), and vpRowVector::vpRowVector().
Type vpArray2D< Type >::getMaxValue | ( | ) | const |
Return the array max value.
Definition at line 639 of file vpArray2D.h.
Type vpArray2D< Type >::getMinValue | ( | ) | const |
Return the array min value.
Definition at line 621 of file vpArray2D.h.
|
inline |
Return the number of rows of the 2D array.
Definition at line 152 of file vpArray2D.h.
Referenced by vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpLine::changeFrame(), vpSubColVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpServo::computeControlLaw(), vpMatrix::computeCovarianceMatrix(), vpServo::computeError(), vpMatrix::computeHLM(), vpServo::computeInteractionMatrix(), vpMbTracker::computeJTR(), vpPtu46::computeMGD(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMatrix::createDiagonalMatrix(), vpColVector::crossProd(), vpDot2::defineDots(), vpMatrix::diag(), vpProjectionDisplay::display(), vpColVector::dotProd(), vpGenericFeature::error(), vpImageFilter::filter(), vpPtu46::get_eJe(), vpBiclops::get_eJe(), vpPtu46::get_fJe(), vpBiclops::get_fJe(), vpBiclops::get_fMe(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpImageSimulator::getImage(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpSubColVector::init(), vpSubMatrix::init(), vpColVector::init(), vpMatrix::init(), vpCameraParameters::initFromCalibrationMatrix(), vpMatrix::insert(), vpFeatureLuminance::interaction(), vpGenericFeature::interaction(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByLU(), vpMatrix::inverseByQRLapack(), vpColVector::invSort(), vpMatrix::juxtaposeMatrices(), vpMatrix::kernel(), vpScale::KernelDensity(), vpScale::KernelDensityGradient(), vpMatrix::kron(), vpColVector::mean(), vpScale::MeanShift(), vpRobust::MEstimator(), vpMatrix::mult2Matrices(), vpMatrix::multMatrixVector(), vpRotationMatrix::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpHomogeneousMatrix::operator*(), vpRowVector::operator*(), vpMatrix::operator*(), vpColVector::operator+(), vpColVector::operator+=(), vpMatrix::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpMatrix::operator-=(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpRGBa::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpHomography::operator=(), vpPlot::plot(), vpPose::poseDementhonPlan(), vpPose::poseVirtualVSrobust(), vpKalmanFilter::prediction(), vpMatrix::printSize(), vpLine::projection(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), vpArray2D< double >::save(), vpArray2D< double >::saveYAML(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpMbTracker::setEstimatedDoF(), vpGenericFeature::setInteractionMatrix(), vpSimulatorAfma6::setJointLimit(), vpSimulatorViper850::setJointLimit(), vpRobotAfma4::setPosition(), vpRobotPtu46::setVelocity(), vpRobotBiclops::setVelocity(), vpSimulatorAfma6::setVelocity(), vpSimulatorViper850::setVelocity(), vpRobotAfma4::setVelocity(), vpLine::setWorldCoordinates(), vpRobust::simultMEstimator(), vpColVector::skew(), vpColVector::sort(), vpColVector::stack(), vpMatrix::stack(), vpMatrix::stackRows(), vpMatrix::sub2Matrices(), vpMatrix::svd(), vpColVector::vpColVector(), and vpRowVector::vpRowVector().
|
inlinestatic |
Load a matrix from a file.
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. |
Definition at line 308 of file vpArray2D.h.
Referenced by vpMatrix::loadMatrix().
|
inlinestatic |
Load an array from a YAML-formatted file.
filename | : absolute file name. |
A | : array to be loaded from the file. |
header | : header of the file is loaded in this parameter. |
Definition at line 392 of file vpArray2D.h.
Referenced by vpMatrix::loadMatrixYAML().
Set all the elements of the array to x.
Definition at line 239 of file vpArray2D.h.
|
inline |
Copy operator of a 2D array.
Definition at line 251 of file vpArray2D.h.
|
inline |
Set element using A[i][j] = x.
Definition at line 259 of file vpArray2D.h.
|
inline |
Get element using x = A[i][j].
Definition at line 261 of file vpArray2D.h.
|
inline |
Set the size of the array and initialize all the values to zero.
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. |
Definition at line 167 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpMatrix::AtA(), vpMatrix::computeHLM(), vpServo::computeProjectionOperators(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMatrix::createDiagonalMatrix(), vpProjectionDisplay::display(), vpHomography::DLT(), vpMatrix::eigenValues(), vpPtu46::get_eJe(), vpAfma4::get_eJe(), vpAfma6::get_eJe(), vpBiclops::get_eJe(), vpPtu46::get_fJe(), vpAfma4::get_fJe(), vpAfma6::get_fJe(), vpBiclops::get_fJe(), vpAfma4::get_fJe_inverse(), vpViper::get_fJw(), vpProjectionDisplay::init(), vpKalmanFilter::init(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initCompInverse(), vpMbtDistanceCircle::initInteractionMatrixError(), vpMbtDistanceCylinder::initInteractionMatrixError(), vpTemplateTracker::initTracking(), vpMatrix::insert(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureLuminance::interaction(), vpFeatureSegment::interaction(), vpGenericFeature::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), vpMatrix::juxtaposeMatrices(), vpMatrix::kernel(), vpArray2D< double >::load(), vpArray2D< double >::loadYAML(), vpMatrix::mult2Matrices(), vpMatrix::negateMatrix(), vpMatrix::operator/(), vpRotationVector::operator=(), vpArray2D< double >::operator=(), vpPose::poseDementhonPlan(), vpPose::poseVirtualVSrobust(), vpMatrix::pseudoInverse(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), vpRowVector::resize(), vpColVector::resize(), vpHomography::robust(), vpServo::secondaryTask(), vpTemplateTrackerWarp::setNbParam(), vpTranslationVector::skew(), vpColVector::skew(), vpMatrix::stack(), vpMatrix::sub2Matrices(), vpMatrix::svd(), vpMatrix::t(), vpMatrix::transpose(), vpArray2D< double >::vpArray2D(), vpTemplateTrackerMI::vpTemplateTrackerMI(), vpTemplateTrackerSSD::vpTemplateTrackerSSD(), vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM(), vpTemplateTrackerSSDInverseCompositional::vpTemplateTrackerSSDInverseCompositional(), vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpHomographySL3::vpTemplateTrackerWarpHomographySL3(), vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation(), and vpTemplateTrackerZNCC::vpTemplateTrackerZNCC().
|
inlinestatic |
Save a matrix to a file.
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. |
Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.
Definition at line 468 of file vpArray2D.h.
Referenced by vpMatrix::saveMatrix().
|
inlinestatic |
Save an array in a YAML-formatted file.
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. |
Here is an example of outputs.
Content of matrix.yml:
Content of matrixIndent.yml:
Definition at line 560 of file vpArray2D.h.
Referenced by vpMatrix::saveMatrixYAML().
|
inline |
Return the number of elements of the 2D array.
Definition at line 156 of file vpArray2D.h.
Referenced by vpCalibration::calibrationTsai(), vpColVector::dotProd(), vpPoint::getWorldCoordinates(), vpRowVector::insert(), vpColVector::insert(), vpRowVector::median(), vpColVector::median(), vpColVector::operator*(), vpHomography::operator*(), vpRotationVector::operator=(), vpPlot::plot(), vpRobot::saturateVelocities(), vpServo::secondaryTaskJointLimitAvoidance(), vpSimulatorPioneer::setVelocity(), vpSimulatorPioneerPan::setVelocity(), vpRobotPioneer::setVelocity(), vpPoint::setWorldCoordinates(), vpRowVector::stdev(), vpColVector::stdev(), vpColVector::vpColVector(), and vpTemplateTrackerWarp::warpTriangle().
|
friend |
Writes the given array to the output stream and returns a reference to the output stream.
Definition at line 267 of file vpArray2D.h.
|
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 :
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:
vpException::incorrectMatrixSizeError | if the sizes of the matrices do not allow the operations. |
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 358 of file vpGEMM.h.
References vpException::functionNotImplementedError.
|
related |
Enumeration of the operations applied on matrices in vpGEMM() function.
Operations are :
|
protected |
Number of columns in the array.
Definition at line 76 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpMatrix::AtA(), vpArray2D< double >::getCols(), vpMatrix::kron(), vpMatrix::mult2Matrices(), vpMatrix::multMatrixVector(), vpMatrix::negateMatrix(), vpRowVector::operator=(), vpArray2D< double >::operator=(), vpArray2D< double >::resize(), vpMatrix::stackColumns(), vpMatrix::sub2Matrices(), and vpMatrix::vpMatrix().
Type* vpArray2D< Type >::data |
Address of the first element of the data array.
Definition at line 84 of file vpArray2D.h.
Referenced by vpColVector::dotProd(), vpMatrix::expm(), vpRobotViper650::getForceTorque(), vpRobotViper850::getForceTorque(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotViper850::getVelocity(), vpRobotViper650::getVelocity(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRobotViper650::init(), vpRobotViper850::init(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByQRLapack(), vpColVector::invSort(), vpRowVector::mean(), vpColVector::mean(), vpRowVector::median(), vpColVector::median(), vpTranslationVector::operator*(), vpRowVector::operator*(), vpColVector::operator*(), vpHomography::operator*(), vpTranslationVector::operator-(), vpRowVector::operator-(), vpColVector::operator-(), vpTranslationVector::operator/(), vpRowVector::operator/(), vpColVector::operator/(), vpHomography::operator/(), vpSubColVector::operator=(), vpTranslationVector::operator=(), vpRotationVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpArray2D< double >::operator=(), vpHomography::robust(), vpRobotAfma4::setPosition(), vpRobotViper850::setPosition(), vpRobotViper650::setPosition(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), vpRobotViper850::setVelocity(), vpRobotViper650::setVelocity(), vpColVector::sort(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpRowVector::stdev(), vpColVector::stdev(), vpTranslationVector::t(), vpPoseVector::t(), vpRowVector::t(), and vpColVector::t().
|
protected |
Current array size (rowNum * colNum)
Definition at line 80 of file vpArray2D.h.
Referenced by vpArray2D< double >::resize().
|
protected |
Number of rows in the array.
Definition at line 74 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpMatrix::AtA(), vpArray2D< double >::getRows(), vpMatrix::kron(), vpMatrix::mult2Matrices(), vpMatrix::multMatrixVector(), vpMatrix::negateMatrix(), vpTranslationVector::operator=(), vpColVector::operator=(), vpArray2D< double >::operator=(), vpArray2D< double >::resize(), vpArray2D< double >::size(), vpMatrix::stackColumns(), vpMatrix::sub2Matrices(), and vpMatrix::vpMatrix().
|
protected |
Address of the first element of each rows.
Definition at line 78 of file vpArray2D.h.
Referenced by vpMatrix::add2Matrices(), vpMatrix::add2WeightedMatrices(), vpMatrix::mult2Matrices(), vpMatrix::multMatrixVector(), vpMatrix::negateMatrix(), vpRotationMatrix::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpMatrix::operator+=(), vpMatrix::operator-=(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpForceTwistMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpHomogeneousMatrix::operator=(), vpArray2D< double >::resize(), vpMatrix::sub2Matrices(), and vpMatrix::transpose().