WPILibC++
2025.1.1
Loading...
Searching...
No Matches
Concepts.hpp
Go to the documentation of this file.
1
// Copyright (c) Sleipnir contributors
2
3
#pragma once
4
5
#include <concepts>
6
7
#include <Eigen/Core>
8
9
namespace
sleipnir
{
10
11
template
<
typename
T>
12
concept
ScalarLike
=
requires
(T t) {
13
t + 1.0;
14
t = 1.0;
15
};
16
17
template
<
typename
T>
18
concept
SleipnirMatrixLike
=
requires
(T t,
int
rows,
int
cols) {
19
t.Rows();
20
t.Cols();
21
t(rows, cols);
22
};
23
24
template
<
typename
T>
25
concept
EigenMatrixLike
= std::derived_from<T, Eigen::MatrixBase<T>>;
26
27
template
<
typename
T>
28
concept
MatrixLike
=
SleipnirMatrixLike<T>
||
EigenMatrixLike<T>
;
29
30
template
<
typename
T>
31
concept
EigenSolver
=
requires
(T t) { t.solve(Eigen::VectorXd{}); };
32
33
}
// namespace sleipnir
sleipnir::EigenMatrixLike
Definition
Concepts.hpp:25
sleipnir::EigenSolver
Definition
Concepts.hpp:31
sleipnir::MatrixLike
Definition
Concepts.hpp:28
sleipnir::ScalarLike
Definition
Concepts.hpp:12
sleipnir::SleipnirMatrixLike
Definition
Concepts.hpp:18
sleipnir
Definition
Hessian.hpp:18
thirdparty
sleipnir
include
sleipnir
util
Concepts.hpp
Generated on Thu Jan 2 2025 00:19:44 for WPILibC++ by
1.12.0