Main MRPT website > C++ reference for MRPT 1.9.9
math/include/mrpt/math/bits_math.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 namespace mrpt
12 {
13 namespace math
14 {
15 // This inline function is used everywhere, so just move it here even it's not a
16 // forward declaration!
17 /*! Returns the size of the matrix in the i'th dimension: 1=rows, 2=columns
18  * (MATLAB-compatible function)
19  * \note Template argument MATRIXLIKE can be: mrpt::math::CMatrixTemplate,
20  * mrpt::math::CMatrixTemplateNumeric, mrpt::math::CMatrixFixedNumeric
21  */
22 template <class MATRIXLIKE>
23 inline size_t size(const MATRIXLIKE& m, const int dim)
24 {
25  if (dim == 1)
26  return m.rows();
27  else if (dim == 2)
28  return m.cols();
29  else
31  "size: Queried matrix dimension must be 1 or 2. Called with i=%i",
32  dim);
33 }
34 
35 } // End of namespace
36 } // end of namespace
size_t size(const MATRIXLIKE &m, const int dim)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
Definition: exceptions.h:43



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019