22 static std::string str(
const X1& x1)
24 return "transpose(" + x1->str() +
")";
28 static std::pair<Index,Index> output_shape(
const X1& s1)
30 auto shape1 = s1->output_shape();
31 return { shape1.second, shape1.first };
34 static IntervalMatrix fwd(
const IntervalMatrix& x1);
35 static MatrixType fwd_natural(
const MatrixType& x1);
36 static MatrixType fwd_centered(
const MatrixType& x1);
37 static void bwd(
const IntervalMatrix& y, IntervalMatrix& x1);
44 transpose(
const MatrixExpr &x1)
46 return { std::make_shared<AnalyticOperationExpr<TransposeOp,MatrixType,MatrixType>>(x1) };
51 inline IntervalMatrix TransposeOp::fwd(
const IntervalMatrix& x1)
53 return x1.transpose();
56 inline MatrixType TransposeOp::fwd_natural(
const MatrixType& x1)
64 inline MatrixType TransposeOp::fwd_centered(
const MatrixType& x1)
66 if(centered_form_not_available_for_args(x1))
67 return fwd_natural(x1);
69 IntervalMatrix d(x1.da.rows(),x1.da.cols());
70 for (Index i=0; i<x1.a.rows(); i++)
71 for (Index j=0;j<x1.a.cols(); j++) {
73 d.row(j+i*x1.a.cols()) = x1.da.row(i+j*x1.a.rows());
84 inline void TransposeOp::bwd(
const IntervalMatrix& y, IntervalMatrix& x1)