MRPT
2.0.3
mrpt
math
matrix_size_t.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <array>
12
13
namespace
mrpt::math
14
{
15
/** Auxiliary class used in CMatrixDynamic:size(), CMatrixDynamic::resize(),
16
* CMatrixFixed::size(), CMatrixFixed::resize(), to mimic the
17
* behavior of STL-containers.
18
* \ingroup mrpt_math_grp
19
*/
20
struct
matrix_size_t
:
public
std::array<std::size_t, 2>
21
{
22
constexpr
matrix_size_t
() : std::array<std::size_t, 2>{0, 0} {}
23
constexpr
matrix_size_t
(
const
std::size_t rows,
const
std::size_t cols)
24
: std::array<std::size_t, 2>{rows, cols}
25
{
26
}
27
28
/** Cast to size_t as the overall number of matrix/vector elements */
29
operator
std::size_t()
const
{
return
at(0) * at(1); }
30
};
31
32
}
// namespace mrpt::math
mrpt::math::matrix_size_t::matrix_size_t
constexpr matrix_size_t()
Definition:
matrix_size_t.h:22
mrpt::math::matrix_size_t::matrix_size_t
constexpr matrix_size_t(const std::size_t rows, const std::size_t cols)
Definition:
matrix_size_t.h:23
mrpt::math
This base provides a set of functions for maths stuff.
Definition:
math/include/mrpt/math/bits_math.h:11
mrpt::math::matrix_size_t
Auxiliary class used in CMatrixDynamic:size(), CMatrixDynamic::resize(), CMatrixFixed::size(),...
Definition:
matrix_size_t.h:20
Page generated by
Doxygen 1.8.17
for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020