21 template<
typename... X>
22 static inline std::string str(
const X&... x)
24 std::string s = ((
"\t" + x->str() +
",\n") + ...);
25 s.pop_back(); s.pop_back();
26 return "[\n" + s +
"\n]";
29 template<
typename... X>
30 static std::pair<Index,Index> output_shape([[maybe_unused]]
const X&... x)
32 return {
sizeof...(X), 1 };
35 template<
typename... X>
36 requires (std::is_base_of_v<Interval,X> && ...)
37 static inline IntervalVector fwd(
const X&... x)
39 return IntervalVector({x...});
42 template<
typename... X>
43 requires (std::is_base_of_v<ScalarType,X> && ...)
44 static inline VectorType fwd_natural(
const X&... x)
46 bool def_domain =
true;
47 ((def_domain &= x.def_domain), ...);
55 template<
typename... X>
56 requires (std::is_base_of_v<ScalarType,X> && ...)
57 static inline VectorType fwd_centered(
const X&... x)
59 if(centered_form_not_available_for_args(x...))
60 return fwd_natural(x...);
62 IntervalMatrix d(
sizeof...(X),std::get<0>(std::tie(x...)).da.cols());
64 ((d.row(i++) = x.da), ...);
66 bool def_domain =
true;
67 ((def_domain &= x.def_domain), ...);
77 template<
typename... X>
78 requires (std::is_base_of_v<Interval,X> && ...)
79 static inline void bwd(
const IntervalVector& y, X&... x)
89 inline const ScalarExpr& _add_to_vec(
const ScalarExpr& x)
94 inline ScalarExpr _add_to_vec(
double x)
96 return const_value(x);
99 template<
typename... X>
100 requires ((std::is_same_v<typename ExprType<X>::Type,ScalarType>) && ...)
104 return { std::make_shared<AnalyticOperationExpr<VectorOp,VectorType,typename ExprType<X>::Type...>>(_add_to_vec(x)...) };