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
9namespace sleipnir {
10
11template <typename T>
12concept ScalarLike = requires(T t) {
13 t + 1.0;
14 t = 1.0;
15};
16
17template <typename T>
18concept SleipnirMatrixLike = requires(T t, int rows, int cols) {
19 t.Rows();
20 t.Cols();
21 t(rows, cols);
22};
23
24template <typename T>
25concept EigenMatrixLike = std::derived_from<T, Eigen::MatrixBase<T>>;
26
27template <typename T>
29
30template <typename T>
31concept EigenSolver = requires(T t) { t.solve(Eigen::VectorXd{}); };
32
33} // namespace sleipnir
Definition Concepts.hpp:25
Definition Concepts.hpp:31
Definition Concepts.hpp:28
Definition Concepts.hpp:12
Definition Concepts.hpp:18
Definition Hessian.hpp:18