25    static std::string str(
const X1& x1)
 
   27      return "det(" + x1->str() + 
")";
 
   30    template<
typename X1,
typename X2>
 
   31    static std::string str(
const X1& x1, 
const X2& x2)
 
   33      return "det(" + x1->str() + 
"," + x2->str() + 
")";
 
   36    template<
typename X1,
typename X2,
typename X3>
 
   37    static std::string str(
const X1& x1, 
const X2& x2, 
const X3& x3)
 
   39      return "det(" + x1->str() + 
"," + x2->str() + 
"," + x3->str() + 
")";
 
   44    static std::pair<Index,Index> output_shape([[maybe_unused]] 
const X1& s1)
 
   50    static ScalarType fwd_natural(
const MatrixType& x);
 
   51    static ScalarType fwd_centered(
const MatrixType& x);
 
   55    template<
typename X1, 
typename X2>
 
   56    static std::pair<Index,Index> output_shape([[maybe_unused]] 
const X1& s1, [[maybe_unused]] 
const X2& s2)
 
   62    static ScalarType fwd_natural(
const VectorType& x1, 
const VectorType& x2);
 
   63    static ScalarType fwd_centered(
const VectorType& x1, 
const VectorType& x2);
 
   67    template<
typename X1, 
typename X2, 
typename X3>
 
   68    static std::pair<Index,Index> output_shape([[maybe_unused]] 
const X1& s1, [[maybe_unused]] 
const X2& s2, [[maybe_unused]] 
const X3& s3)
 
   74    static ScalarType fwd_natural(
const VectorType& x1, 
const VectorType& x2, 
const VectorType& x3);
 
   75    static ScalarType fwd_centered(
const VectorType& x1, 
const VectorType& x2, 
const VectorType& x3);
 
   83  det(
const MatrixExpr& x1)
 
   85    return { std::make_shared<AnalyticOperationExpr<DetOp,ScalarType,MatrixType>>(x1) };
 
   89  det(
const VectorExpr& x1, 
const VectorExpr& x2)
 
   91    return { std::make_shared<AnalyticOperationExpr<DetOp,ScalarType,VectorType,VectorType>>(x1,x2) };
 
   95  det(
const VectorExpr& x1, 
const VectorExpr& x2, 
const VectorExpr& x3)
 
   97    return { std::make_shared<AnalyticOperationExpr<DetOp,ScalarType,VectorType,VectorType,VectorType>>(x1,x2,x3) };
 
  104    assert_release(x.is_squared() && 
"can only compute determinants for a square matrix");
 
  105    assert_release((x.rows() == 1 || x.rows() == 2) && 
"determinant not yet computable for n×n matrices, n>2");
 
  110    else if(x.rows() == 2) 
 
  111      return x(0,0)*x(1,1)-x(0,1)*x(1,0);
 
  117  inline ScalarType DetOp::fwd_natural(
const MatrixType& x)
 
  125  inline ScalarType DetOp::fwd_centered(
const MatrixType& x)
 
  127    if(centered_form_not_available_for_args(x)) 
 
  128      return fwd_natural(x);
 
  141       for (Index i=0; i < d.cols() ; i++) {
 
  142          d(0,i) = x.da(0,i)*x.a(1,1) + x.da(3,i)*x.a(0,0)
 
  143         - x.da(1,i)*x.a(0,1) - x.da(2,i)*x.a(1,0);
 
  158    assert_release(x.is_squared() && 
"can only compute determinants for a square matrix");
 
  159    assert_release((x.rows() == 1 || x.rows() == 2) && 
"determinant not yet computable for n×n matrices, n>2");
 
  164    else if(x.rows() == 2) 
 
  166      Interval z1 = x(0,0)*x(1,1), z2 = x(1,0)*x(0,1);
 
  167      SubOp::bwd(y, z1, z2);
 
  168      MulOp::bwd(z1, x(0,0), x(1,1));
 
  169      MulOp::bwd(z2, x(1,0), x(0,1));
 
  180    assert_release(x1.size() == 2 && x2.size() == 2 && 
"determinant only computable for pairs of 2d vectors");
 
  182    m.col(0) = x1; m.col(1) = x2;
 
  183    return DetOp::fwd(m);
 
  186  inline ScalarType DetOp::fwd_natural(
const VectorType& x1, 
const VectorType& x2)
 
  189    a.col(0) = x1.a; a.col(1) = x2.a;
 
  193      x1.def_domain && x2.def_domain
 
  197  inline ScalarType DetOp::fwd_centered(
const VectorType& x1, 
const VectorType& x2)
 
  199    if(centered_form_not_available_for_args(x1,x2))
 
  200      return fwd_natural(x1,x2);
 
  203    m.col(0) = x1.m; m.col(1) = x2.m;
 
  205    a.col(0) = x1.a; a.col(1) = x2.a;
 
  207    assert(x1.da.cols() == x2.da.cols());
 
  209    for (Index i=0; i < d.cols() ; i++) {
 
  210          d(0,i) = x1.da(0,i)*x2.a[1] + x1.a[0]*x2.da(1,i)
 
  211         - x1.da(1,i)*x2.a[0] - x1.a[1]*x2.da(0,i);
 
  218      x1.def_domain && x2.def_domain
 
  224    assert_release(x1.size() == 2 && x2.size() == 2 && 
"determinant only computable for pairs of 2d vectors");
 
  226    m.col(0) = x1; m.col(1) = x2;
 
  234    assert_release(x1.size() == 3 && x2.size() == 3 && x3.size() == 3 && 
"determinant only computable for triplet of 3d vectors");
 
  236    m.col(0) = x1; m.col(1) = x2; m.col(2) = x3;
 
  237    return DetOp::fwd(m);
 
  240  inline ScalarType DetOp::fwd_natural(
const VectorType& x1, 
const VectorType& x2, 
const VectorType& x3)
 
  243    a.col(0) = x1.a; a.col(1) = x2.a; a.col(2) = x3.a;
 
  247      x1.def_domain && x2.def_domain && x3.def_domain
 
  251  inline ScalarType DetOp::fwd_centered(
const VectorType& x1, 
const VectorType& x2, 
const VectorType& x3)
 
  253    if(centered_form_not_available_for_args(x1,x2,x3))
 
  254      return fwd_natural(x1,x2,x3);
 
  257    m.col(0) = x1.m; m.col(1) = x2.m; m.col(2) = x3.m;
 
  259    a.col(0) = x1.a; a.col(1) = x2.a; a.col(2) = x3.a;
 
  265      x1.def_domain && x2.def_domain && x3.def_domain
 
  271    assert_release(x1.size() == 3 && x2.size() == 3 && x3.size() == 3 && 
"determinant only computable for triplet of 3d vectors");
 
  274    m.col(0) = x1; m.col(1) = x2; m.col(2) = x3;
 
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
static Interval empty()
Provides an empty interval.
Definition codac2_Interval_impl.h:568
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
Eigen::Matrix< Interval,-1,-1 > IntervalMatrix
Alias for a dynamic-size matrix of intervals.
Definition codac2_IntervalMatrix.h:25