From 2f82b81c7af7c4ff33065205e17016a079d6c7f4 Mon Sep 17 00:00:00 2001 From: Amaury Johnan <amjohnen@gmail.com> Date: Mon, 17 Jun 2013 09:54:46 +0000 Subject: [PATCH] add getDoubleMonomials() --- Numeric/pointsGenerators.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Numeric/pointsGenerators.cpp b/Numeric/pointsGenerators.cpp index 2b6365b127..20ff853be9 100644 --- a/Numeric/pointsGenerators.cpp +++ b/Numeric/pointsGenerators.cpp @@ -11,6 +11,22 @@ #include "MPrism.h" #include "MPyramid.h" +void getDoubleMonomials(fullMatrix<double>& doubleMon, + fullMatrix<int> (*genIntMonomials)(int, bool), + int order, bool serendip ) +{ + fullMatrix<int> mon; + mon = (*genIntMonomials)(order, serendip); + + doubleMon.resize(mon.size1(), mon.size2()); + + for (int i = 0; i < mon.size1(); ++i) { + for (int j = 0; j < mon.size2(); ++j) { + doubleMon(i, j) = static_cast<double>(mon(i, j)); + } + } +} + /* --- Lines --- */ fullMatrix<double> gmshGeneratePointsLine(int order) -- GitLab