30 template <
size_t NROWS,
size_t NCOLS>
38 M.cols() == aux.cols() && M.rows() == aux.rows(),
40 "Size mismatch: deserialized is %ux%u, expected is %ux%u",
41 (
unsigned)aux.rows(), (unsigned)aux.cols(), (unsigned)NROWS,
48 template <
size_t NROWS,
size_t NCOLS>
56 M.cols() == aux.cols() && M.rows() == aux.rows(),
58 "Size mismatch: deserialized is %ux%u, expected is %ux%u",
59 (
unsigned)aux.rows(), (unsigned)aux.cols(), (unsigned)NROWS,
67 template <
size_t NROWS,
size_t NCOLS>
78 template <
size_t NROWS,
size_t NCOLS>
95 template <
typename T,
size_t NROWS,
size_t NCOLS>
100 fmt.matSuffix =
"\n";
101 return s << m.format(fmt);
106 template <
typename T>
111 fmt.matSuffix =
"\n";
112 return s << m.format(fmt);
117 template <
typename MAT>
122 for (decltype(N) i = 0; i < N; i++) in >> m(i, i);
123 for (decltype(N)
r = 0;
r < N - 1;
r++)
125 for (decltype(N)
c =
r + 1;
c < N;
c++)
129 m(
r,
c) = m(
c,
r) =
x;
136 template <
typename MAT>
141 for (decltype(N) i = 0; i < N; i++) out << m(i, i);
142 for (decltype(N)
r = 0;
r < N - 1;
r++)
143 for (decltype(N)
c =
r + 1;
c < N;
c++) out << m(
r,
c);
void serializeSymmetricMatrixTo(MAT &m, mrpt::serialization::CArchive &out)
Binary serialization of symmetric matrices, saving the space of duplicated values.
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
std::ostream & operator<<(std::ostream &o, const TPoint2D &p)
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
void deserializeSymmetricMatrixFrom(MAT &m, mrpt::serialization::CArchive &in)
Binary serialization of symmetric matrices, saving the space of duplicated values.
CMatrixTemplateNumeric< float > CMatrixFloat
Declares a matrix of float numbers (non serializable).
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
Virtual base class for "archives": classes abstracting I/O streams.
GLdouble GLdouble GLdouble r
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
A matrix of dynamic size.
void WriteObject(const CSerializable *o)
Writes an object to the stream.
This class is a "CSerializable" wrapper for "CMatrixFloat".
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, CMatrix::Ptr &pObj)