@@ -76,9 +76,10 @@ inline
76
76
constexpr auto operator*( EL&& lhs, ER&& rhs ) noexcept
77
77
{
78
78
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
79
+ using value_type = typename tensor_type::value_type;
79
80
80
81
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
81
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::multiplies<>{}
82
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::multiplies<value_type >{}
82
83
);
83
84
}
84
85
@@ -91,9 +92,10 @@ inline
91
92
constexpr auto operator+( EL&& lhs, ER&& rhs ) noexcept
92
93
{
93
94
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
95
+ using value_type = typename tensor_type::value_type;
94
96
95
97
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
96
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::plus<>{}
98
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::plus<value_type >{}
97
99
);
98
100
}
99
101
@@ -106,9 +108,10 @@ inline
106
108
constexpr auto operator-( EL&& lhs, ER&& rhs ) noexcept
107
109
{
108
110
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
111
+ using value_type = typename tensor_type::value_type;
109
112
110
113
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
111
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::minus<>{}
114
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::minus<value_type >{}
112
115
);
113
116
}
114
117
@@ -121,9 +124,10 @@ inline
121
124
constexpr auto operator/( EL&& lhs, ER&& rhs ) noexcept
122
125
{
123
126
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
127
+ using value_type = typename tensor_type::value_type;
124
128
125
129
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
126
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::divides<>{}
130
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::divides<value_type >{}
127
131
);
128
132
}
129
133
@@ -136,9 +140,10 @@ inline
136
140
constexpr auto operator*( EL&& lhs, ER&& rhs ) noexcept
137
141
{
138
142
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
143
+ using value_type = typename tensor_type::value_type;
139
144
140
145
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
141
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::multiplies<>{}
146
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::multiplies<value_type >{}
142
147
);
143
148
}
144
149
@@ -151,9 +156,10 @@ inline
151
156
constexpr auto operator+( EL&& lhs, ER&& rhs ) noexcept
152
157
{
153
158
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
159
+ using value_type = typename tensor_type::value_type;
154
160
155
161
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
156
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::plus<>{}
162
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::plus<value_type >{}
157
163
);
158
164
}
159
165
@@ -166,9 +172,10 @@ inline
166
172
constexpr auto operator-( EL&& lhs, ER&& rhs ) noexcept
167
173
{
168
174
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
175
+ using value_type = typename tensor_type::value_type;
169
176
170
177
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
171
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::minus<>{}
178
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::minus<value_type >{}
172
179
);
173
180
}
174
181
@@ -180,9 +187,10 @@ template <typename EL, typename ER>
180
187
inline constexpr auto operator/( EL&& lhs, ER&& rhs ) noexcept
181
188
{
182
189
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
190
+ using value_type = typename tensor_type::value_type;
183
191
184
192
return boost::numeric::ublas::detail::make_binary_tensor_expression<tensor_type>(
185
- std::forward<EL>(lhs), std::forward<ER>(rhs), std::divides<>{}
193
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::divides<value_type >{}
186
194
);
187
195
}
188
196
@@ -204,7 +212,7 @@ inline constexpr auto operator+( EL&& lhs, ER&& rhs ) noexcept
204
212
);
205
213
206
214
return boost::numeric::ublas::detail::make_binary_tensor_expression<ltensor_t > (
207
- std::forward<EL>(lhs), std::forward<ER>(rhs), []( auto const & l, auto const & r){ return l + r; }
215
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::plus< lvalue_t >{ }
208
216
);
209
217
}
210
218
@@ -227,7 +235,7 @@ inline constexpr auto operator-( EL&& lhs, ER&& rhs ) noexcept
227
235
);
228
236
229
237
return boost::numeric::ublas::detail::make_binary_tensor_expression<ltensor_t > (
230
- std::forward<EL>(lhs), std::forward<ER>(rhs), []( auto const & l, auto const & r){ return l - r; }
238
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::minus< lvalue_t >{ }
231
239
);
232
240
}
233
241
@@ -249,7 +257,7 @@ inline constexpr auto operator*( EL&& lhs, ER&& rhs ) noexcept
249
257
);
250
258
251
259
return boost::numeric::ublas::detail::make_binary_tensor_expression<ltensor_t > (
252
- std::forward<EL>(lhs), std::forward<ER>(rhs), []( auto const & l, auto const & r){ return l * r; }
260
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::multiplies< lvalue_t >{ }
253
261
);
254
262
}
255
263
@@ -271,7 +279,7 @@ inline constexpr auto operator/( EL&& lhs, ER&& rhs ) noexcept
271
279
);
272
280
273
281
return boost::numeric::ublas::detail::make_binary_tensor_expression<ltensor_t > (
274
- std::forward<EL>(lhs), std::forward<ER>(rhs), []( auto const & l, auto const & r){ return l / r; }
282
+ std::forward<EL>(lhs), std::forward<ER>(rhs), std::divides< lvalue_t >{ }
275
283
);
276
284
}
277
285
@@ -284,10 +292,11 @@ inline constexpr auto operator+(
284
292
ER&& rhs
285
293
) noexcept {
286
294
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
295
+ using value_type = typename tensor_type::value_type;
287
296
288
297
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
289
298
std::forward<ER>(rhs),
290
- [lhs](auto const & r){ return lhs + r; }
299
+ [lhs](value_type const & r){ return lhs + r; }
291
300
);
292
301
}
293
302
@@ -298,10 +307,11 @@ inline constexpr auto operator-(
298
307
ER&& rhs
299
308
) noexcept {
300
309
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
310
+ using value_type = typename tensor_type::value_type;
301
311
302
312
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
303
313
std::forward<ER>(rhs),
304
- [lhs](auto const & r){ return lhs - r; }
314
+ [lhs](value_type const & r){ return lhs - r; }
305
315
);
306
316
}
307
317
@@ -312,10 +322,11 @@ inline constexpr auto operator*(
312
322
ER&& rhs
313
323
) noexcept {
314
324
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
325
+ using value_type = typename tensor_type::value_type;
315
326
316
327
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
317
328
std::forward<ER>(rhs),
318
- [lhs](auto const & r){ return lhs * r; }
329
+ [lhs](value_type const & r){ return lhs * r; }
319
330
);
320
331
}
321
332
@@ -326,10 +337,11 @@ inline constexpr auto operator/(
326
337
ER&& rhs
327
338
) noexcept {
328
339
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <ER>;
340
+ using value_type = typename tensor_type::value_type;
329
341
330
342
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
331
343
std::forward<ER>(rhs),
332
- [lhs](auto const & r){ return lhs / r; }
344
+ [lhs](value_type const & r){ return lhs / r; }
333
345
);
334
346
}
335
347
@@ -340,10 +352,11 @@ inline constexpr auto operator+(
340
352
typename boost::numeric::ublas::detail::real_expression_type_t <EL>::value_type rhs
341
353
) noexcept {
342
354
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
355
+ using value_type = typename tensor_type::value_type;
343
356
344
357
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
345
358
std::forward<EL>(lhs),
346
- [rhs] (auto const & l) { return l + rhs; }
359
+ [rhs] (value_type const & l) { return l + rhs; }
347
360
);
348
361
}
349
362
@@ -354,10 +367,11 @@ inline constexpr auto operator-(
354
367
typename boost::numeric::ublas::detail::real_expression_type_t <EL>::value_type rhs
355
368
) noexcept {
356
369
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
370
+ using value_type = typename tensor_type::value_type;
357
371
358
372
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
359
373
std::forward<EL>(lhs),
360
- [rhs] (auto const & l) { return l - rhs; }
374
+ [rhs] (value_type const & l) { return l - rhs; }
361
375
);
362
376
}
363
377
@@ -368,10 +382,11 @@ inline constexpr auto operator*(
368
382
typename boost::numeric::ublas::detail::real_expression_type_t <EL>::value_type rhs
369
383
) noexcept {
370
384
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
385
+ using value_type = typename tensor_type::value_type;
371
386
372
387
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
373
388
std::forward<EL>(lhs),
374
- [rhs] (auto const & l) { return l * rhs; }
389
+ [rhs] (value_type const & l) { return l * rhs; }
375
390
);
376
391
}
377
392
@@ -382,10 +397,11 @@ inline constexpr auto operator/(
382
397
typename boost::numeric::ublas::detail::real_expression_type_t <EL>::value_type rhs
383
398
) noexcept {
384
399
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <EL>;
400
+ using value_type = typename tensor_type::value_type;
385
401
386
402
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
387
403
std::forward<EL>(lhs),
388
- [rhs] (auto const & l) { return l / rhs; }
404
+ [rhs] (value_type const & l) { return l / rhs; }
389
405
);
390
406
}
391
407
@@ -394,7 +410,8 @@ inline constexpr auto& operator += (
394
410
boost::numeric::ublas::tensor_core<T>& lhs,
395
411
boost::numeric::ublas::detail::tensor_expression<boost::numeric::ublas::tensor_core<T>,D> const & expr
396
412
){
397
- boost::numeric::ublas::detail::eval (lhs, expr (), [](auto & l, auto const & r) { l+=r; } );
413
+ using value_type = typename boost::numeric::ublas::tensor_core<T>::value_type;
414
+ boost::numeric::ublas::detail::eval (lhs, expr (), [](value_type& l, value_type const & r) { l+=r; } );
398
415
return lhs;
399
416
}
400
417
@@ -403,7 +420,8 @@ inline constexpr auto& operator -= (
403
420
boost::numeric::ublas::tensor_core<T>& lhs,
404
421
const boost::numeric::ublas::detail::tensor_expression<boost::numeric::ublas::tensor_core<T>,D> &expr
405
422
){
406
- boost::numeric::ublas::detail::eval (lhs, expr (), [](auto & l, auto const & r) { l-=r; } );
423
+ using value_type = typename boost::numeric::ublas::tensor_core<T>::value_type;
424
+ boost::numeric::ublas::detail::eval (lhs, expr (), [](value_type& l, value_type const & r) { l-=r; } );
407
425
return lhs;
408
426
}
409
427
@@ -412,7 +430,8 @@ inline constexpr auto& operator *= (
412
430
boost::numeric::ublas::tensor_core<T>& lhs,
413
431
const boost::numeric::ublas::detail::tensor_expression<boost::numeric::ublas::tensor_core<T>,D> &expr
414
432
){
415
- boost::numeric::ublas::detail::eval (lhs, expr (), [](auto & l, auto const & r) { l*=r; } );
433
+ using value_type = typename boost::numeric::ublas::tensor_core<T>::value_type;
434
+ boost::numeric::ublas::detail::eval (lhs, expr (), [](value_type& l, value_type const & r) { l*=r; } );
416
435
return lhs;
417
436
}
418
437
@@ -421,7 +440,8 @@ inline constexpr auto& operator /= (
421
440
boost::numeric::ublas::tensor_core<T>& lhs,
422
441
const boost::numeric::ublas::detail::tensor_expression<boost::numeric::ublas::tensor_core<T>,D> &expr
423
442
){
424
- boost::numeric::ublas::detail::eval (lhs, expr (), [](auto & l, auto const & r) { l/=r; } );
443
+ using value_type = typename boost::numeric::ublas::tensor_core<T>::value_type;
444
+ boost::numeric::ublas::detail::eval (lhs, expr (), [](value_type& l, value_type const & r) { l/=r; } );
425
445
return lhs;
426
446
}
427
447
@@ -433,7 +453,8 @@ inline constexpr auto& operator += (
433
453
boost::numeric::ublas::tensor_core<TensorEngine>& lhs,
434
454
typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type r
435
455
){
436
- boost::numeric::ublas::detail::eval (lhs, [r](auto & l) { l+=r; } );
456
+ using value_type = typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type;
457
+ boost::numeric::ublas::detail::eval (lhs, [r](value_type& l) { l+=r; } );
437
458
return lhs;
438
459
}
439
460
@@ -442,7 +463,8 @@ inline constexpr auto& operator -= (
442
463
boost::numeric::ublas::tensor_core<TensorEngine>& lhs,
443
464
typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type r
444
465
){
445
- boost::numeric::ublas::detail::eval (lhs, [r](auto & l) { l-=r; } );
466
+ using value_type = typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type;
467
+ boost::numeric::ublas::detail::eval (lhs, [r](value_type& l) { l-=r; } );
446
468
return lhs;
447
469
}
448
470
@@ -451,7 +473,8 @@ inline constexpr auto& operator *= (
451
473
boost::numeric::ublas::tensor_core<TensorEngine>& lhs,
452
474
typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type r
453
475
){
454
- boost::numeric::ublas::detail::eval (lhs, [r](auto & l) { l*=r; } );
476
+ using value_type = typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type;
477
+ boost::numeric::ublas::detail::eval (lhs, [r](value_type& l) { l*=r; } );
455
478
return lhs;
456
479
}
457
480
@@ -460,7 +483,8 @@ inline constexpr auto& operator /= (
460
483
boost::numeric::ublas::tensor_core<TensorEngine>& lhs,
461
484
typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type r
462
485
){
463
- boost::numeric::ublas::detail::eval (lhs, [r](auto & l) { l/=r; } );
486
+ using value_type = typename boost::numeric::ublas::tensor_core<TensorEngine>::value_type;
487
+ boost::numeric::ublas::detail::eval (lhs, [r](value_type& l) { l/=r; } );
464
488
return lhs;
465
489
}
466
490
@@ -476,8 +500,9 @@ template<typename E>
476
500
requires boost::numeric::ublas::detail::TensorExpression<E>
477
501
inline constexpr auto operator -(E&& e) {
478
502
using tensor_type = boost::numeric::ublas::detail::real_expression_type_t <E>;
503
+ using value_type = typename tensor_type::value_type;
479
504
return boost::numeric::ublas::detail::make_unary_tensor_expression<tensor_type> (
480
- std::forward<E>(e), std::negate<>{}
505
+ std::forward<E>(e), std::negate<value_type >{}
481
506
);
482
507
}
483
508
0 commit comments