mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
#ifndef POINCARE_BINOMIAL_COEFFICIENT_H
|
|
#define POINCARE_BINOMIAL_COEFFICIENT_H
|
|
|
|
#include <poincare/layout_engine.h>
|
|
#include <poincare/static_hierarchy.h>
|
|
|
|
namespace Poincare {
|
|
|
|
class BinomialCoefficient : public StaticHierarchy<2> {
|
|
using StaticHierarchy<2>::StaticHierarchy;
|
|
public:
|
|
Type type() const override;
|
|
Expression * clone() const override;
|
|
private:
|
|
constexpr static int k_maxNValue = 300;
|
|
/* Layout */
|
|
ExpressionLayout * privateCreateLayout(FloatDisplayMode floatDisplayMode, ComplexFormat complexFormat) const override;
|
|
int writeTextInBuffer(char * buffer, int bufferSize) const override {
|
|
return LayoutEngine::writePrefixExpressionTextInBuffer(this, buffer, bufferSize, "binomial");
|
|
}
|
|
/* Simplification */
|
|
Expression * shallowReduce(Context& context, AngleUnit angleUnit) override;
|
|
/* Evaluation */
|
|
Expression * privateEvaluate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedEvaluate<float>(context, angleUnit); }
|
|
Expression * privateEvaluate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedEvaluate<double>(context, angleUnit); }
|
|
template<typename T> Expression * templatedEvaluate(Context& context, AngleUnit angleUnit) const;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|