Open C++ Libraries.org develop
Loading...
Searching...
No Matches
math_fwd.hpp
1// SPDX-License-Identifier: BSL-1.0
2// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org)
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5// Official repository: https://github.com/open-cpp-libraries/core
6
7#pragma once
8
9#ifndef _USE_MATH_DEFINES
10#define _USE_MATH_DEFINES
11#endif
12
13#include <ocl/detail/math/config.hpp>
14#include <ocl/equiv_fwd.hpp>
15#include <ocl/option_fwd.hpp>
16#include <ocl/scientific_fwd.hpp>
17
19
20#define Im(x) std::complex(x)
21#define Re(x) ((::ocl::scientific::real_type)x)
22#define Q(x) ((std::int32_t)x)
23#define P(x) ((::ocl::scientific::real_type)x)
24
28#define pi (3.14159265358979323846)
29#define euler_num (2.71828182845904523536)
30#define euler_masch (0.57721566490153286060651209008240243104215933593992)
31#define apery (zeta_apery)
32#define golden_ratio (((1 + std::sqrt(5)) / 2))
33#define sqrt_two (std::sqrt(2))
34#define gelfond_schneider (std::pow(2, sqrt_two))
35#define catalan (0.9159655941772190150)
36
37namespace ocl::scientific::solver
38{
39
40 using variable_count_type = int;
41
42 template <variable_count_type functions_cnt,
43 variable_count_type variable_cnt>
45 {
46 public:
47 pde_solver() = default;
48
49 using number_type = real_type;
50
51 number_type operator()(const number_type& left, const std::vector<number_type>& right)
52 {
53 return {};
54 }
55 };
56
57 template <variable_count_type variable_cnt>
59
60 template <variable_count_type variable_cnt>
62 {
63 public:
64 nth_deriv_solver() = default;
65
66 using number_type = real_type;
67
68 number_type operator()(const number_type& left, const std::vector<number_type>& right)
69 {
70 return {};
71 }
72 };
73
74 template <variable_count_type variable_cnt>
76 {
77 public:
78 nth_int_solver() = default;
79
80 using number_type = real_type;
81
82 number_type operator()(const number_type& left, const std::vector<number_type>& right)
83 {
84 return {};
85 }
86 };
87
89 {
90 public:
91 eq_solver_two() = default;
92
93 using number_type = real_type;
94
96 number_type operator()(const number_type& left, const std::vector<number_type>& right)
97 {
98 return {};
99 }
100 };
101
103 {
104 public:
105 ineq_solver_two() = default;
106
107 using number_type = real_type;
108
110 number_type operator()(const number_type& left, const std::vector<number_type>& right)
111 {
112 return {};
113 }
114 };
115
116#ifndef sorry
117#define sorry true
118#endif
119
120 template <class Friend>
122 {
123 public:
124 friend Friend;
125
126 using pointer = Friend;
127
128 uint64_t id_{};
129 pointer self_{};
130
132 static const bool is_formalized = false;
133
134 };
135
137 // and contradiction methods in mathematical proofs.
138
139 template <class Friend>
141 {
142 };
143
144 template <class Friend>
146 {
147 };
148
149 template <class Friend>
151 {
152 };
153
155 template <class Solver, class Friend>
157 {
158 public:
159 static_assert(Solver::is_formalized, "The Solver you want to base this chain on is not solved. Use ::sorry to make this error go away.");
160
161 Solver pre_cond_;
162
163 };
164
166 template <class Friend>
168
169 template <class Solver, class Friend>
171
172
173} // namespace ocl::scientific::solver
Solve a mathematical conjecture using a pre-solved solver first.
Definition math_fwd.hpp:157
Definition math_fwd.hpp:89
number_type operator()(const number_type &left, const std::vector< number_type > &right)
basic equality solver for two parameters.
Definition math_fwd.hpp:96
Provides a set of solvers for induction, construction,.
Definition math_fwd.hpp:141
Definition math_fwd.hpp:103
number_type operator()(const number_type &left, const std::vector< number_type > &right)
basic inequality solver for two parameters.
Definition math_fwd.hpp:110
static const bool is_formalized
This guarantees that the solver is indeed solved.
Definition math_fwd.hpp:132
Definition math_fwd.hpp:76
Definition math_fwd.hpp:45