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);
void load(std::ifstream &f)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
vpTranslationVector getTranslationVector() const
void set(double tx, double ty, double tz, double tux, double tuy, double tuz)
error that can be emited by ViSP classes.
Type * data
Address of the first element of the data array.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
Implementation of a generic 2D array used as base class for matrices and vectors. ...
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
unsigned int rowNum
Number of rows in the array.
void save(std::ofstream &f) const
vpRotationMatrix getRotationMatrix() const
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
vpPoseVector buildFrom(double tx, double ty, double tz, double tux, double tuy, double tuz)
void extract(vpRotationMatrix &R) const
Implementation of a rotation vector as quaternion angle minimal representation.
unsigned int getRows() const
static double deg(double rad)
Implementation of a pose vector and operations on poses.
vpThetaUVector getThetaUVector() const
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.