PhysicsBasedAnimationToolkit
0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
Concepts.h
Go to the documentation of this file.
1
10
11
#ifndef PBAT_MATH_CONCEPTS_H
12
#define PBAT_MATH_CONCEPTS_H
13
14
#include <concepts>
15
#include <
pbat/Aliases.h
>
16
#include <
pbat/common/Concepts.h
>
17
18
namespace
pbat
{
19
namespace
math
{
20
26
template
<
class
Q>
27
concept
CQuadratureRule
=
requires
(Q q)
28
{
29
requires
std::integral<
decltype
(Q::kDims)>;
30
requires
common::CContiguousArithmeticRange
<
decltype
(q.points)>;
31
requires
common::CContiguousArithmeticRange
<
decltype
(q.weights)>;
32
{
33
q.points.size()
34
} -> std::convertible_to<int>;
35
{
36
q.weights.size()
37
} -> std::convertible_to<int>;
38
};
39
45
template
<
class
Q>
46
concept
CFixedPointQuadratureRule
=
requires
(Q q)
47
{
48
requires
CQuadratureRule<Q>
;
49
requires
std::is_integral_v<
decltype
(Q::kPoints)>;
50
{q.points.size() / q.weights.size() == Q::kDims};
51
{q.weights.size() == Q::kPoints};
52
};
53
59
template
<
class
Q>
60
concept
CPolynomialQuadratureRule
=
requires
(Q q)
61
{
62
requires
CQuadratureRule<Q>
;
63
requires
std::is_integral_v<
decltype
(Q::kOrder)>;
64
};
65
71
template
<
class
Q>
72
concept
CFixedPointPolynomialQuadratureRule
=
73
CFixedPointQuadratureRule<Q>
and
CPolynomialQuadratureRule<Q>
;
74
75
}
// namespace math
76
}
// namespace pbat
77
78
#endif
// PBAT_MATH_CONCEPTS_H
Aliases.h
Concepts.h
Concepts for common types.
pbat::common::CContiguousArithmeticRange
Contiguous range of arithmetic types.
Definition
Concepts.h:91
pbat::math::CFixedPointPolynomialQuadratureRule
Definition
Concepts.h:72
pbat::math::CFixedPointQuadratureRule
Definition
Concepts.h:46
pbat::math::CPolynomialQuadratureRule
Definition
Concepts.h:60
pbat::math::CQuadratureRule
Definition
Concepts.h:27
pbat::math
Math related functionality.
Definition
Concepts.h:19
pbat
The main namespace of the library.
Definition
Aliases.h:15
source
pbat
math
Concepts.h
Generated by
1.13.2