Go to the documentation of this file.
24 template <
typename T, std::
size_t N>
35 template <
typename T1,
typename T2>
36 inline std::vector<T1>&
operator*=(std::vector<T1>&
a,
const std::vector<T2>&
b)
39 const size_t N =
a.size();
40 for (
size_t i = 0; i < N; i++)
a[i] *=
b[i];
45 template <
typename T1>
48 const size_t N =
a.size();
49 for (
size_t i = 0; i < N; i++)
a[i] *=
b;
54 template <
typename T1,
typename T2>
56 const std::vector<T1>&
a,
const std::vector<T2>&
b)
59 const size_t N =
a.size();
60 std::vector<T1> ret(N);
61 for (
size_t i = 0; i < N; i++) ret[i] =
a[i] *
b[i];
66 template <
typename T1,
typename T2>
67 inline std::vector<T1>&
operator+=(std::vector<T1>&
a,
const std::vector<T2>&
b)
70 const size_t N =
a.size();
71 for (
size_t i = 0; i < N; i++)
a[i] +=
b[i];
76 template <
typename T1>
79 const size_t N =
a.size();
80 for (
size_t i = 0; i < N; i++)
a[i] +=
b;
85 template <
typename T1,
typename T2>
87 const std::vector<T1>&
a,
const std::vector<T2>&
b)
90 const size_t N =
a.size();
91 std::vector<T1> ret(N);
92 for (
size_t i = 0; i < N; i++) ret[i] =
a[i] +
b[i];
96 template <
typename T1,
typename T2>
98 const std::vector<T1>&
v1,
const std::vector<T2>&
v2)
101 std::vector<T1>
res(
v1.size());
102 for (
size_t i = 0; i <
v1.size(); i++)
res[i] =
v1[i] -
v2[i];
111 std::ostream&
operator<<(std::ostream& out,
const std::vector<T>& d)
113 const std::streamsize old_pre = out.precision();
114 const std::ios_base::fmtflags old_flags = out.flags();
115 out <<
"[" << std::fixed << std::setprecision(4);
116 std::copy(d.begin(), d.end(), std::ostream_iterator<T>(out,
" "));
118 out.flags(old_flags);
119 out.precision(old_pre);
126 std::ostream&
operator<<(std::ostream& out, std::vector<T>* d)
128 const std::streamsize old_pre = out.precision();
129 const std::ios_base::fmtflags old_flags = out.flags();
130 out <<
"[" << std::fixed << std::setprecision(4);
131 copy(d->begin(), d->end(), std::ostream_iterator<T>(out,
" "));
133 out.flags(old_flags);
134 out.precision(old_pre);
139 template <
typename T,
size_t N>
143 ostrm << mrpt::typemeta::TTypeName<CArrayNumeric<T, N>>::get();
149 template <
typename T,
size_t N>
159 "Error deserializing: expected '%s', got '%s'",
160 namExpect.c_str(), nam.c_str()));
std::ostream & operator<<(std::ostream &o, const TPoint2D &p)
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
TPose3D operator-(const TPose3D &p)
Unary $\ominus$ operator: computes inverse SE(3) element.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, CMatrix::Ptr &pObj)
std::vector< T1 > & operator+=(std::vector< T1 > &a, const std::vector< T2 > &b)
a+=b (element-wise sum)
GLfloat GLfloat GLfloat v2
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
std::vector< T1 > operator+(const std::vector< T1 > &a, const std::vector< T2 > &b)
a+b (element-wise sum)
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually,...
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
size_t ReadBufferFixEndianness(T *ptr, size_t ElementCount)
Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream s...
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
std::vector< T1 > & operator*=(std::vector< T1 > &a, const std::vector< T2 > &b)
a*=b (element-wise multiplication)
GLsizei const GLchar ** string
void WriteBufferFixEndianness(const T *ptr, size_t ElementCount)
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running arch...
GLubyte GLubyte GLubyte a
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |