Visual Computing Library  devel
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_SPACE_CORE_MATRIX_H
24#define VCL_SPACE_CORE_MATRIX_H
25
26#include "array.h"
27#include "matrix/affine.h"
28#include "matrix/matrix.h"
29
30namespace vcl {
31
32/* Concepts */
33
43template<typename T>
45
51template<typename T>
53 EigenMatrixConcept<T> && (RemoveRef<T>::RowsAtCompileTime == 3) &&
54 (RemoveRef<T>::ColsAtCompileTime == 3);
55
61template<typename T>
63 EigenMatrixConcept<T> && (RemoveRef<T>::RowsAtCompileTime == 4) &&
64 (RemoveRef<T>::ColsAtCompileTime == 4);
65
71template<typename T>
73
74/* Utility functions */
75
85template<MatrixConcept MatrixType>
87{
88 vcl::MatrixStorageType stg = vcl::MatrixStorageType::ROW_MAJOR;
89
90 // Eigen matrices can be column major
92 if constexpr (!MatrixType::IsRowMajor) {
93 stg = vcl::MatrixStorageType::COLUMN_MAJOR;
94 }
95 }
96
97 return stg;
98}
99
100} // namespace vcl
101
102#endif // VCL_SPACE_CORE_MATRIX_H
A class representing a box in N-dimensional space.
Definition box.h:46
A concept representing a 2-dimensional array.
Definition array.h:714
A concept representing an Eigen Matrix.
Definition matrix.h:102
Concept for 3x3 matrices.
Definition matrix.h:52
Concept for 3x3 or 4x4 matrices.
Definition matrix.h:72
Concept for 4x4 matrices.
Definition matrix.h:62
Concept for 2D arrays (matrices). It is satisfied when T is a matrix, no matter its sizes.
Definition matrix.h:44
MatrixStorageType
A simple type that enumerates the main storage types for matrices (row or column major).
Definition base.h:76
vcl::MatrixStorageType matrixStorageType()
Get the storage type of a matrix.
Definition matrix.h:86