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::math
12 {
13 // This inline function is used everywhere, so just move it here even it's not a
14 // forward declaration!
15 /*! Returns the size of the matrix in the i'th dimension: 1=rows, 2=columns
16  * (MATLAB-compatible function)
17  * \note Template argument MATRIXLIKE can be: mrpt::math::CMatrixTemplate,
18  * mrpt::math::CMatrixTemplateNumeric, mrpt::math::CMatrixFixedNumeric
19  */
20 template <class MATRIXLIKE>
21 inline size_t size(const MATRIXLIKE& m, const int dim)
22 {
23  if (dim == 1)
24  return m.rows();
25  else if (dim == 2)
26  return m.cols();
27  else
29  "size: Queried matrix dimension must be 1 or 2. Called with i=%i",
30  dim);
31 }
32 } // end of namespace
33 
34 
size_t size(const MATRIXLIKE &m, const int dim)
This base provides a set of functions for maths stuff.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
Definition: exceptions.h:43



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020