21 Expression * PermuteCoefficient::shallowReduce(
Context& context, AngleUnit angleUnit) {
22 Expression * e = Expression::shallowReduce(context, angleUnit);
28 #if MATRIX_EXACT_REDUCING 35 if (!r0->denominator().isOne() || r0->numerator().isNegative()) {
41 if (!r1->denominator().isOne() || r1->numerator().isNegative()) {
51 Integer n = r0->numerator();
52 Integer k = r1->numerator();
53 if (n.isLowerThan(k)) {
58 if (Integer(k_maxNValue).isLowerThan(n)) {
62 int clippedK = k.extractedInt();
63 for (
int i = 0; i < clippedK; i++) {
71 Complex<T> * PermuteCoefficient::templatedApproximate(Context& context, AngleUnit angleUnit)
const {
77 T n =
static_cast<Complex<T> *
>(nInput)->toScalar();
78 T k =
static_cast<Complex<T> *
>(kInput)->toScalar();
88 for (
int i = (
int)n-(int)k+1; i <= (int)n; i++) {
friend class PermuteCoefficient
Type type() const override
Expression * replaceWith(Expression *newOperand, bool deleteAfterReplace=true)
Expression * approximate(Context &context, AngleUnit angleUnit=AngleUnit::Default) const
Expression * clone() const override
Expression * editableOperand(int i)
const Expression * m_operands[T]
static Complex< T > Float(T x)
static Integer Subtraction(const Integer &i, const Integer &j)
static Integer Multiplication(const Integer &i, const Integer &j)
const Expression * operand(int i) const