1 #ifndef CLASSIC_FTpsData_H
2 #define CLASSIC_FTpsData_H
47 static inline int getOrder(
int index);
50 static inline int getSize(
int order);
57 static inline int orderStart(
int order,
int nv);
60 static inline int orderEnd(
int order);
63 static inline int orderEnd(
int order,
int nv);
69 static inline int orderLength(
int orderL,
int orderH);
82 static void setup(
int order);
91 void build(
int order);
156 template <
int N>
inline
159 return theBook->expon[index];
169 for(
int var = N; var-- > 0;) {
171 index += theBook->binom[order][var];
178 template <
int N>
inline
181 return theBook->expon[index].getOrder();
185 template <
int N>
inline
188 return theBook->bin[order+1];
192 template <
int N>
inline
195 return theBook->bin[order];
199 template <
int N>
inline
202 return theBook->binom[order][N-nv];
206 template <
int N>
inline
209 return theBook->bin[order+1];
213 template <
int N>
inline
216 return theBook->binom[order+1][N-nv];
220 template <
int N>
inline
224 return theBook->binom[order+1][1];
228 template <
int N>
inline
231 return theBook->bin[orderH+1] - theBook->bin[orderL];
235 template <
int N>
inline
238 return theBook->prod[index];
242 template <
int N>
inline
245 return theBook->vrblList[index];
266 template <
int N>
inline
269 return theBook->subTable;
276 theBook->build(order);
304 if(topOrder < order) {
312 for(
int var = N + 1; var-- > 0;) binom[0][var] = 0;
313 for(
int ord = 1; ord <= topOrder + 1; ord++) {
316 for(
int var = N; var-- > 0;)
317 binom[ord][var] = binom[ord-1][var] + binom[ord][var+1];
322 for(
int i = 0; i < topOrder + 2; i++) bin[i] = binom[i][0];
327 topSize = bin[topOrder+1];
332 for(
int index = 1; index < topSize; index++) expon[index][0] = index;
334 for(
int index = 1; index < topSize; index++) {
335 int carry = power[N-1];
338 while(power[lastnz] == 0 && lastnz-- > 0) {}
340 if(lastnz == -1) power[0] = 1 + carry;
343 power[lastnz+1] += 1 + carry;
346 expon[index] = power;
354 for(
int xord = 0; xord <= topOrder; xord++) {
355 int yord = topOrder - xord;
356 int ysize = bin[yord+1];
357 for(
int i = bin[xord]; i < bin[xord+1]; i++) {
360 for(
int j = 0; j <
std::min(i, ysize); j++) {
364 for(
int j = i; j < ysize; j++) {
365 power = expon[i] * expon[j];
368 for(
int vv = N; vv-- > 0;) {
370 ind += binom[ord][vv];
383 int *vars =
new int[topOrder];
385 int j = 1, N1 = N - 1;
387 for(
int ord = 1; ord <= topOrder; ord++) {
390 std::fill(vars, vars + ord,
int(0));
392 int last_j = bin[ord+1];
393 int *vlast = vars + ord;
395 while(++j < last_j) {
398 while(*--vi == N1) {};
400 std::fill(vi, vlast, k);
403 std::copy(vars, vars + ord, vrblList[j].
begin());
414 fillSubst(0, 1, power, next);
423 for(
int v = var; v < N; v++) {
428 for(
int vv = N; vv-- > 0;) {
430 ind += binom[ord][vv];
436 if(order < topOrder) fillSubst(v, order + 1, power, next);
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
T::PETE_Expr_t::PETE_Return_t prod(const PETE_Expr< T > &expr)
Representation of the exponents for a monomial with fixed dimension.
Internal utility class for FTps<T,N> class.
static int orderEnd(int order)
static const FMonomial< N > & getExponents(int index)
void fillSubst(int var, int order, FMonomial< N > &pow, int &next)
static int getIndex(const FMonomial< N > &)
static const Array1D< TpsSubstitution > & getSubTable()
Array1D< Array1D< int > > prod
static FTpsData< N > * theBook
FTpsData(const FTpsData &)
Array1D< Array1D< int > > vrblList
static int getOrder(int index)
static int getSize(int order)
Array1D< TpsSubstitution > subTable
static const Array1D< int > & getVariableList(int index)
static void setup(int order)
static int orderLength(int order)
Array1D< FArray1D< int, N+1 > > binom
void operator=(const FTpsData &)
Array1D< int > Giorgilli2ExponIndex
static int orderStart(int order)
static const Array1D< int > & getProductArray(int index)
Array1D< FMonomial< N > > expon