Visual Computing Library
Loading...
Searching...
No Matches
matrix.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_CONCEPTS_SPACE_MATRIX_H
24#define VCL_CONCEPTS_SPACE_MATRIX_H
25
26#include "array.h"
27
28#include <vclib/concepts/const_correctness.h>
29
30namespace vcl {
31
52template<typename T>
53concept EigenMatrixConcept = requires (T&& obj) {
54 typename RemoveRef<T>::Scalar;
55
56 RemoveRef<T>();
57
58 obj.RowsAtCompileTime;
59 obj.ColsAtCompileTime;
60
61 obj.rows();
62 obj.cols();
63
64 obj.operator()(std::size_t(), std::size_t());
65 obj.operator()(std::size_t(), std::size_t());
66
67 // non const requirements
68 requires IsConst<T> || requires {
69 obj.resize(std::size_t(), std::size_t());
70 obj.conservativeResize(std::size_t(), std::size_t());
71 };
72};
73
81template<typename T>
83
87template<typename T>
89 EigenMatrixConcept<T> && (RemoveRef<T>::RowsAtCompileTime == 3) &&
90 (RemoveRef<T>::ColsAtCompileTime == 3);
91
95template<typename T>
97 EigenMatrixConcept<T> && (RemoveRef<T>::RowsAtCompileTime == 4) &&
98 (RemoveRef<T>::ColsAtCompileTime == 4);
99
100} // namespace vcl
101
102#endif // VCL_CONCEPTS_SPACE_MATRIX_H
A concept representing a 2-dimensional array.
Definition array.h:105
Concept for Eigen matrices. It is satisfied when T is an Eigen matrix.
Definition matrix.h:53
The IsConst concept is satisfied if T satisfies one of the following conditions:
Definition const_correctness.h:43
Concept for 3x3 matrices.
Definition matrix.h:88
Concept for 4x4 matrices.
Definition matrix.h:96
Concept for 2D arrays (matrices). It is satisfied when T is a matrix, no matter its sizes.
Definition matrix.h:82