Sleipnir C++ API
Loading...
Searching...
No Matches
concepts.hpp
1// Copyright (c) Sleipnir contributors
2
3#pragma once
4
5#include <concepts>
6#include <type_traits>
7
8#include <Eigen/Core>
9
10namespace slp {
11
12template <typename T>
13concept ScalarLike = requires(std::decay_t<T> t) {
14 t + 1.0;
15 t = 1.0;
16};
17
18template <typename T>
20 std::derived_from<std::decay_t<T>, Eigen::MatrixBase<std::decay_t<T>>>;
21
22template <typename T>
23concept SleipnirMatrixLike = requires(T t, int rows, int cols) {
24 t.rows();
25 t.cols();
27
28template <typename T>
30
31} // namespace slp
Definition concepts.hpp:19
Definition concepts.hpp:29
Definition concepts.hpp:13
Definition concepts.hpp:23