50 #include <visp3/core/vpDebug.h>
51 #include <visp3/core/vpException.h>
52 #include <visp3/core/vpMath.h>
53 #include <visp3/core/vpMatrixException.h>
54 #include <visp3/core/vpPoseVector.h>
227 for (
unsigned int i = 0; i < 3; i++) {
229 (*this)[i + 3] = tu[i];
340 for (
unsigned int i = 0; i < 6; i++)
342 std::cout << (*this)[i] <<
" ";
345 std::cout << std::endl;
381 for (
unsigned int i = 0; i < 6; i++) {
421 typedef std::string::size_type size_type;
426 std::vector<std::string> values(m * n);
427 std::ostringstream oss;
428 std::ostringstream ossFixed;
429 std::ios_base::fmtflags original_flags = oss.flags();
432 ossFixed.setf(std::ios::fixed, std::ios::floatfield);
434 size_type maxBefore = 0;
435 size_type maxAfter = 0;
437 for (
unsigned int i = 0; i < m; ++i) {
440 if (oss.str().find(
"e") != std::string::npos) {
442 ossFixed << (*this)[i];
443 oss.str(ossFixed.str());
446 values[i] = oss.str();
447 size_type thislen = values[i].size();
448 size_type p = values[i].find(
'.');
450 if (p == std::string::npos) {
459 size_type totalLength = length;
463 maxAfter = (std::min)(maxAfter, totalLength - maxBefore);
472 s <<
"[" << m <<
"," << n <<
"]=\n";
474 for (
unsigned int i = 0; i < m; i++) {
476 size_type p = values[i].find(
'.');
477 s.setf(std::ios::right, std::ios::adjustfield);
478 s.width((std::streamsize)maxBefore);
479 s << values[i].substr(0, p).c_str();
482 s.setf(std::ios::left, std::ios::adjustfield);
483 if (p != std::string::npos) {
484 s.width((std::streamsize)maxAfter);
485 s << values[i].substr(p, maxAfter).c_str();
487 assert(maxAfter > 1);
488 s.width((std::streamsize)maxAfter);
498 s.flags(original_flags);
500 return (
int)(maxBefore + maxAfter);
509 std::vector<double> v(this->
size());
511 for (
unsigned int i = 0; i < this->
size(); i++)
Implementation of a generic 2D array used as base class for matrices and vectors.
Type * data
Address of the first element of the data array.
unsigned int rowNum
Number of rows in the array.
unsigned int size() const
Return the number of elements of the 2D array.
unsigned int getRows() const
error that can be emited by ViSP classes.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
static Type maximum(const Type &a, const Type &b)
static double deg(double rad)
Implementation of a pose vector and operations on poses.
vpTranslationVector getTranslationVector() const
std::vector< double > toStdVector() const
void load(std::ifstream &f)
void save(std::ofstream &f) const
void extract(vpRotationMatrix &R) const
void set(double tx, double ty, double tz, double tux, double tuy, double tuz)
vpThetaUVector getThetaUVector() const
vpPoseVector buildFrom(double tx, double ty, double tz, double tux, double tuy, double tuz)
vpRotationMatrix getRotationMatrix() const
Implementation of a rotation vector as quaternion angle minimal representation.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
Implementation of a rotation matrix and operations on such kind of matrices.
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
Implementation of row vector and the associated operations.
Implementation of a rotation vector as axis-angle minimal representation.
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
Class that consider the case of a translation vector.