22 Expression * e = Expression::shallowReduce(context, angleUnit);
27 #if MATRIX_EXACT_REDUCING 30 if (m->numberOfRows() != m->numberOfColumns()) {
33 int n = m->numberOfRows();
35 for (
int i = 0; i < n; i++) {
36 Expression * diagEntry = m->editableOperand(i+n*i);
37 m->detachOperand(diagEntry);
38 a->addOperand(diagEntry);
40 return replaceWith(a,
true)->shallowReduce(context, angleUnit);
52 Expression * MatrixTrace::templatedApproximate(Context& context, AngleUnit angleUnit)
const {
56 result = input->clone();
59 result =
static_cast<Matrix *
>(input)->createTrace<T>();
Type type() const override
Expression * replaceWith(Expression *newOperand, bool deleteAfterReplace=true)
Expression * approximate(Context &context, AngleUnit angleUnit=AngleUnit::Default) const
static bool IsMatrix(const Expression *e, Context &context)
Expression * editableOperand(int i)
const Expression * m_operands[T]
Expression * clone() const override
const Expression * operand(int i) const