DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
Loading...
Searching...
No Matches
concepts.hpp
1#pragma once
2#include <concepts>
3#include <type_traits>
4#include <iterator>
5#include <string>
6
7// Time type concept - basic arithmetic types that can represent time
8template<typename T>
9concept can_be_time = std::is_arithmetic_v<T>;
10
11// State concept - supports vectors, matrices, multi-dimensional tensors, etc.
12template<typename T>
13concept system_state = requires(T state) {
14 typename T::value_type;
15 requires std::is_arithmetic_v<typename T::value_type>;
16 requires !std::same_as<T, std::string>; // Exclude string types
17 requires requires {
18 { state.size() } -> std::convertible_to<std::size_t>;
19 { state.begin() } -> std::random_access_iterator;
20 { state.end() } -> std::random_access_iterator;
21 };
22 { state[0] } -> std::convertible_to<typename T::value_type>;
23};