Files
Upsilon/poincare/src/determinant.cpp
Émilie Feral 1964d61fdc [libaxx] add cmath and use cmath instead of math.h when required
Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
2017-08-16 09:55:29 +02:00

36 lines
799 B
C++

#include <poincare/determinant.h>
#include <poincare/matrix.h>
extern "C" {
#include <assert.h>
}
#include <cmath>
namespace Poincare {
Determinant::Determinant() :
Function("det")
{
}
Expression::Type Determinant::type() const {
return Type::Determinant;
}
Expression * Determinant::cloneWithDifferentOperands(Expression** newOperands,
int numberOfOperands, bool cloneOperands) const {
assert(newOperands != nullptr);
Determinant * d = new Determinant();
d->setArgument(newOperands, numberOfOperands, cloneOperands);
return d;
}
Evaluation * Determinant::privateEvaluate(Context& context, AngleUnit angleUnit) const {
Evaluation * input = m_args[0]->evaluate(context, angleUnit);
Evaluation * result = input->createDeterminant();
delete input;
return result;
}
}