@@ -23,9 +23,9 @@ namespace mgis::function::algorithm {
2323 * \param[in] po: iterator to the output values
2424 */
2525 template <size_type N, typename InputIterator, typename OutputIterator>
26- void copy (const InputIterator p,
27- const InputIterator pe,
28- OutputIterator po) requires(N > 0 ) {
26+ constexpr void copy (const InputIterator p,
27+ const InputIterator pe,
28+ OutputIterator po) requires(N > 0 ) {
2929 if constexpr ((std::random_access_iterator<InputIterator>)&& //
3030 (std::random_access_iterator<OutputIterator>)) {
3131 if constexpr (N > 9 ) {
@@ -56,110 +56,117 @@ namespace mgis::function::algorithm {
5656
5757namespace mgis ::function::internals {
5858
59- inline void assign_value (auto & lhs, const auto & rhs) {
59+ constexpr void assign_value (auto & lhs, const auto & rhs) {
6060 std::copy (rhs.begin (), rhs.end (), lhs.begin ());
6161 }
6262
63- inline void assign_value (std::span<real> lhs, const auto & rhs) {
63+ constexpr void assign_value (std::span<real> lhs, const auto & rhs) {
6464 std::copy (rhs.begin (), rhs.end (), lhs.begin ());
6565 }
6666
67- inline void assign_value (std::span<real> lhs,
68- const std::span<const real> rhs) {
67+ constexpr void assign_value (std::span<real> lhs,
68+ const std::span<const real> rhs) {
6969 std::copy (rhs.begin (), rhs.end (), lhs.begin ());
7070 }
7171
72- inline void assign_value (std::span<real> lhs, const std::span<real> rhs) {
72+ constexpr void assign_value (std::span<real> lhs, const std::span<real> rhs) {
7373 std::copy (rhs.begin (), rhs.end (), lhs.begin ());
7474 }
7575
76- inline void assign_value (real& lhs, const std::span<real>& rhs) {
76+ constexpr void assign_value (real& lhs, const std::span<real>& rhs) {
7777 lhs = rhs[0 ];
7878 }
7979
80- inline void assign_value (real& lhs, const std::span<const real>& rhs) {
80+ constexpr void assign_value (real& lhs, const std::span<const real>& rhs) {
8181 lhs = rhs[0 ];
8282 }
8383
84- inline void assign_value (real& lhs, const std::span<real, 1u >& rhs) {
84+ constexpr void assign_value (real& lhs, const std::span<real, 1u >& rhs) {
8585 lhs = rhs[0 ];
8686 }
8787
88- inline void assign_value (real& lhs, const std::span<const real, 1u >& rhs) {
88+ constexpr void assign_value (real& lhs, const std::span<const real, 1u >& rhs) {
8989 lhs = rhs[0 ];
9090 }
9191
92- inline void assign_value (real& lhs, const std::array<real, 1u >& rhs) {
92+ constexpr void assign_value (real& lhs, const std::array<real, 1u >& rhs) {
9393 lhs = rhs[0 ];
9494 }
9595
96- inline void assign_value (std::array<real, 1u >& lhs, const real rhs) {
96+ constexpr void assign_value (std::array<real, 1u >& lhs, const real rhs) {
9797 lhs[0 ] = rhs;
9898 }
9999
100- inline void assign_value (std::array<real, 1u >& lhs,
101- const std::array<real, 1u > rhs) {
100+ constexpr void assign_value (std::array<real, 1u >& lhs,
101+ const std::array<real, 1u > rhs) {
102102 lhs[0 ] = rhs[0 ];
103103 }
104104
105- inline void assign_value (std::array<real, 1u >& lhs, const std::span<real> rhs) {
105+ constexpr void assign_value (std::array<real, 1u >& lhs,
106+ const std::span<real> rhs) {
106107 lhs[0 ] = rhs[0 ];
107108 }
108109
109- inline void assign_value (std::array<real, 1u >& lhs, const std::span<const real> rhs) {
110+ constexpr void assign_value (std::array<real, 1u >& lhs,
111+ const std::span<const real> rhs) {
110112 lhs[0 ] = rhs[0 ];
111113 }
112114
113- inline void assign_value (std::array<real, 1u >& lhs, const std::span<real, 1u > rhs) {
115+ constexpr void assign_value (std::array<real, 1u >& lhs,
116+ const std::span<real, 1u > rhs) {
114117 lhs[0 ] = rhs[0 ];
115118 }
116119
117- inline void assign_value (std::array<real, 1u >& lhs, const std::span<const real, 1u > rhs) {
120+ constexpr void assign_value (std::array<real, 1u >& lhs,
121+ const std::span<const real, 1u > rhs) {
118122 lhs[0 ] = rhs[0 ];
119123 }
120124
121- inline void assign_value (std::span<real, 1u > lhs, const real rhs) {
125+ constexpr void assign_value (std::span<real, 1u > lhs, const real rhs) {
122126 lhs[0 ] = rhs;
123127 }
124128
125- inline void assign_value (std::span<real> lhs, const real rhs) {
129+ constexpr void assign_value (std::span<real> lhs, const real rhs) {
126130 lhs[0 ] = rhs;
127131 }
128132
129- inline void assign_value (std::span<real> lhs, const std::span<real, 1u > rhs) {
133+ constexpr void assign_value (std::span<real> lhs,
134+ const std::span<real, 1u > rhs) {
130135 lhs[0 ] = rhs[0 ];
131136 }
132137
133- inline void assign_value (std::span<real> lhs,
134- const std::span<const real, 1u > rhs) {
138+ constexpr void assign_value (std::span<real> lhs,
139+ const std::span<const real, 1u > rhs) {
135140 lhs[0 ] = rhs[0 ];
136141 }
137142
138- inline void assign_value (std::span<real, 1u > lhs, const std::span<real> rhs) {
143+ constexpr void assign_value (std::span<real, 1u > lhs,
144+ const std::span<real> rhs) {
139145 lhs[0 ] = rhs[0 ];
140146 }
141147
142- inline void assign_value (std::span<real, 1u > lhs,
143- const std::span<const real> rhs) {
148+ constexpr void assign_value (std::span<real, 1u > lhs,
149+ const std::span<const real> rhs) {
144150 lhs[0 ] = rhs[0 ];
145151 }
146152
147- inline void assign_value (std::span<real, 1u > lhs,
148- const std::span<real, 1u > rhs) {
153+ constexpr void assign_value (std::span<real, 1u > lhs,
154+ const std::span<real, 1u > rhs) {
149155 lhs[0 ] = rhs[0 ];
150156 }
151157
152- inline void assign_value (std::span<real, 1u > lhs,
153- const std::span<const real, 1u > rhs) {
158+ constexpr void assign_value (std::span<real, 1u > lhs,
159+ const std::span<const real, 1u > rhs) {
154160 lhs[0 ] = rhs[0 ];
155161 }
156162
157- inline void assign_value (std::span<real, 1u > lhs, const std::array<real, 1u >& rhs) {
163+ constexpr void assign_value (std::span<real, 1u > lhs,
164+ const std::array<real, 1u >& rhs) {
158165 lhs[0 ] = rhs[0 ];
159166 }
160167
161168 template <typename FunctionType, EvaluatorConcept EvaluatorType>
162- void assign_scalar_impl (FunctionType& f, EvaluatorType e) requires(
169+ constexpr void assign_scalar_impl (FunctionType& f, EvaluatorType e) requires(
163170 (LinearElementSpaceConcept<std::decay_t <decltype (getSpace(f))>>)&&(
164171 !hasElementWorkspace<std::decay_t <decltype (getSpace(f))>>)) {
165172 using Space = std::decay_t <decltype (getSpace (f))>;
@@ -171,7 +178,7 @@ namespace mgis::function::internals {
171178 } // end of assign_scalar_impl
172179
173180 template <typename FunctionType, EvaluatorConcept EvaluatorType>
174- void assign_scalar_impl (FunctionType& f, EvaluatorType e) requires(
181+ constexpr void assign_scalar_impl (FunctionType& f, EvaluatorType e) requires(
175182 (LinearElementSpaceConcept<std::decay_t <decltype (getSpace(f))>>)&&(
176183 hasElementWorkspace<std::decay_t <decltype (getSpace(f))>>)) {
177184 using Space = std::decay_t <decltype (getSpace (f))>;
@@ -184,7 +191,7 @@ namespace mgis::function::internals {
184191 } // end of assign_scalar_impl
185192
186193 template <typename FunctionType, EvaluatorConcept EvaluatorType>
187- void assign_impl (FunctionType& f, EvaluatorType e) requires(
194+ constexpr void assign_impl (FunctionType& f, EvaluatorType e) requires(
188195 (LinearElementSpaceConcept<std::decay_t <decltype (getSpace(f))>>)&&(
189196 !hasElementWorkspace<std::decay_t <decltype (getSpace(f))>>)) {
190197 using Space = std::decay_t <decltype (getSpace (f))>;
@@ -206,7 +213,7 @@ namespace mgis::function::internals {
206213 } // end of assign_impl
207214
208215 template <typename FunctionType, EvaluatorConcept EvaluatorType>
209- void assign_impl (FunctionType& f, EvaluatorType e) requires(
216+ constexpr void assign_impl (FunctionType& f, EvaluatorType e) requires(
210217 (LinearElementSpaceConcept<std::decay_t <decltype (getSpace(f))>>)&&(
211218 hasElementWorkspace<std::decay_t <decltype (getSpace(f))>>)) {
212219 using Space = std::decay_t <decltype (getSpace (f))>;
@@ -233,9 +240,9 @@ namespace mgis::function::internals {
233240namespace mgis ::function {
234241
235242 template <typename FunctionType, EvaluatorConcept EvaluatorType>
236- bool assign (Context & ctx,
237- FunctionType& f,
238- EvaluatorType e) //
243+ constexpr bool assign (AbstractErrorHandler & ctx,
244+ FunctionType& f,
245+ EvaluatorType e) //
239246 requires(((LinearElementSpaceConcept<std::decay_t <
240247 decltype (getSpace(std::declval<EvaluatorType>()))>>) ||
241248 (LinearQuadratureSpaceConcept<std::decay_t <
@@ -266,7 +273,7 @@ namespace mgis::function {
266273 } // end of assign
267274
268275 template <EvaluatorConcept EvaluatorType, typename OperatorType>
269- [[nodiscard]] std::optional<real> scalar_reduce (Context & ctx,
276+ [[nodiscard]] std::optional<real> scalar_reduce (AbstractErrorHandler & ctx,
270277 EvaluatorType e,
271278 const OperatorType op,
272279 const real initial_value) //
0 commit comments