25    static std::string str(
const X1& x1)
 
   27      return "-" + x1->str(!x1->is_str_leaf());
 
   31    static std::pair<Index,Index> output_shape(
const X1& s1) {
 
   32      return s1->output_shape();
 
   35    static Interval fwd(
const Interval& x1);
 
   36    static ScalarType fwd_natural(
const ScalarType& x1);
 
   37    static ScalarType fwd_centered(
const ScalarType& x1);
 
   38    static void bwd(
const Interval& y, Interval& x1);
 
   41    static VectorType fwd_natural(
const VectorType& x1);
 
   42    static VectorType fwd_centered(
const VectorType& x1);
 
   46    static MatrixType fwd_natural(
const MatrixType& x1);
 
   47    static MatrixType fwd_centered(
const MatrixType& x1);
 
   52    template<
typename X1,
typename X2>
 
   53    static std::string str(
const X1& x1, 
const X2& x2)
 
   55      return x1->str(!x1->is_str_leaf()) + 
"-" + x2->str(!x2->is_str_leaf());
 
   58    template<
typename X1, 
typename X2>
 
   59    static std::pair<Index,Index> output_shape(
const X1& s1, [[maybe_unused]] 
const X2& s2)
 
   61      auto shape1 = s1->output_shape();
 
   62      assert(shape1 == s2->output_shape());
 
   66    static Interval fwd(
const Interval& x1, 
const Interval& x2);
 
   67    static ScalarType fwd_natural(
const ScalarType& x1, 
const ScalarType& x2);
 
   68    static ScalarType fwd_centered(
const ScalarType& x1, 
const ScalarType& x2);
 
   69    static void bwd(
const Interval& y, Interval& x1, Interval& x2);
 
   72    static VectorType fwd_natural(
const VectorType& x1, 
const VectorType& x2);
 
   73    static VectorType fwd_centered(
const VectorType& x1, 
const VectorType& x2);
 
   77    static MatrixType fwd_natural(
const MatrixType& x1, 
const MatrixType& x2);
 
   78    static MatrixType fwd_centered(
const MatrixType& x1, 
const MatrixType& x2);
 
   88    return { std::make_shared<AnalyticOperationExpr<SubOp,ScalarType,ScalarType>>(x1) };
 
   94    return { std::make_shared<AnalyticOperationExpr<SubOp,VectorType,VectorType>>(x1) };
 
  100    return { std::make_shared<AnalyticOperationExpr<SubOp,MatrixType,MatrixType>>(x1) };
 
  107  operator-(
const ScalarExpr& x1, 
const ScalarExpr& x2)
 
  109    return { std::make_shared<AnalyticOperationExpr<SubOp,ScalarType,ScalarType,ScalarType>>(x1,x2) };
 
  113  operator-(
const VectorExpr& x1, 
const VectorExpr& x2)
 
  115    return { std::make_shared<AnalyticOperationExpr<SubOp,VectorType,VectorType,VectorType>>(x1,x2) };
 
  119  operator-(
const MatrixExpr& x1, 
const MatrixExpr& x2)
 
  121    return { std::make_shared<AnalyticOperationExpr<SubOp,MatrixType,MatrixType,MatrixType>>(x1,x2) };
 
  131  inline ScalarType SubOp::fwd_natural(
const ScalarType& x1)
 
  139  inline ScalarType SubOp::fwd_centered(
const ScalarType& x1)
 
  152    SubOp::bwd(y, x2_, x1);
 
  160  inline VectorType SubOp::fwd_natural(
const VectorType& x1)
 
  168  inline VectorType SubOp::fwd_centered(
const VectorType& x1)
 
  180    assert(y.size() == x1.size());
 
  181    for(Index i = 0 ; i < y.size() ; i++)
 
  190  inline MatrixType SubOp::fwd_natural(
const MatrixType& x1)
 
  198  inline MatrixType SubOp::fwd_centered(
const MatrixType& x1)
 
  210    assert(y.size() == x1.size());
 
  211    for(Index i = 0 ; i < y.size() ; i++)
 
  212      SubOp::bwd(*(y.data()+i), *(x1.data()+i));
 
  220  inline ScalarType SubOp::fwd_natural(
const ScalarType& x1, 
const ScalarType& x2)
 
  224      x1.def_domain && x2.def_domain
 
  228  inline ScalarType SubOp::fwd_centered(
const ScalarType& x1, 
const ScalarType& x2)
 
  230    if(centered_form_not_available_for_args(x1,x2))
 
  231      return fwd_natural(x1,x2);
 
  233    assert(x1.da.rows() == x2.da.rows() && x1.da.cols() == x2.da.cols());
 
  238      x1.def_domain && x2.def_domain
 
  253    assert(x1.size() == x2.size());
 
  257  inline VectorType SubOp::fwd_natural(
const VectorType& x1, 
const VectorType& x2)
 
  261      x1.def_domain && x2.def_domain
 
  265  inline VectorType SubOp::fwd_centered(
const VectorType& x1, 
const VectorType& x2)
 
  267    if(centered_form_not_available_for_args(x1,x2))
 
  268      return fwd_natural(x1,x2);
 
  270    assert(x1.da.rows() == x2.da.rows() && x1.da.cols() == x2.da.cols());
 
  275      x1.def_domain && x2.def_domain
 
  281    assert(y.size() == x1.size() && y.size() == x2.size());
 
  282    for(Index i = 0 ; i < y.size() ; i++)
 
  283      SubOp::bwd(y[i], x1[i], x2[i]);
 
  288    assert(x1.size() == x2.size());
 
  292  inline MatrixType SubOp::fwd_natural(
const MatrixType& x1, 
const MatrixType& x2)
 
  294    assert(x1.a.cols() == x2.a.cols() && x1.a.rows() == x2.a.rows());
 
  297      x1.def_domain && x2.def_domain
 
  301  inline MatrixType SubOp::fwd_centered(
const MatrixType& x1, 
const MatrixType& x2)
 
  303    assert(x1.a.cols() == x2.a.cols() && x1.a.rows() == x2.a.rows());
 
  308      x1.def_domain && x2.def_domain
 
  314    assert(y.size() == x1.size() && y.size() == x2.size());
 
  315    for(Index i = 0 ; i < y.size() ; i++)
 
  316      SubOp::bwd(*(y.data()+i), *(x1.data()+i), *(x2.data()+i));
 
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
bool is_empty() const
Checks whether the interval matrix is empty.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:56
Definition codac2_OctaSym.h:21
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25
Interval operator-(const Interval &x, double y)
Returns  with .
Definition codac2_Interval_impl.h:422
Eigen::Matrix< Interval,-1,-1 > IntervalMatrix
Alias for a dynamic-size matrix of intervals.
Definition codac2_IntervalMatrix.h:25