35 for (
int i = 1; i < r.size(); ++i) {
41 Eigen::VectorXd r(n + 1);
46 void BinomialMatrix::extend(
int const n) {
48 auto& old = getMatrix();
49 int const m = old.rows() - 1;
51 Eigen::MatrixXd updated = Eigen::MatrixXd::Zero(n + 1, n + 1);
52 updated.topLeftCorner(old.rows(), old.cols()) = old;
53 for (
int i = m + 1; i <= n; ++i) {
56 for (
int j = 1; j < i; ++j) {
57 updated(i, j) = updated(i - 1, j - 1) * (
static_cast<double>(i) / static_cast<double>(j));
64 Eigen::MatrixXd& BinomialMatrix::getMatrix() {
65 static Eigen::MatrixXd it = Eigen::MatrixXd::Constant(2, 2, 1.0);
A base class for image defects.
void computePowers(Eigen::VectorXd &r, double x)
Fill an array with integer powers of x, so .