My Project
Loading...
Searching...
No Matches
ncSAFormula.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/***************************************************************
5 * File: ncSAFormula.cc
6 * Purpose: implementation of multiplication by formulas in simple NC subalgebras
7 * Author: motsak
8 * Created:
9 *******************************************************************/
10
11#define MYTEST 0
12
13#if MYTEST
14#define OM_CHECK 4
15#define OM_TRACK 5
16// these settings must be before "mod2.h" in order to work!!!
17#endif
18
19
20
21
22
23#include "misc/auxiliary.h"
24
25#ifdef HAVE_PLURAL
26
27#define PLURAL_INTERNAL_DECLARATIONS
28
29#ifndef SING_NDEBUG
30#define OUTPUT MYTEST
31#else
32#define OUTPUT 0
33#endif
34
35#include "reporter/reporter.h"
36
37#include "coeffs/numbers.h"
38
39#include "nc/ncSAFormula.h"
40// for CFormulaPowerMultiplier
41
42#include "monomials/ring.h"
43#include "monomials/p_polys.h"
44
45#include "nc/sca.h"
46
47
48
49
51{
52#if OUTPUT
53 PrintS("ncInitSpecialPowersMultiplication(ring), ring: \n");
54 rWrite(r, TRUE);
55 PrintLn();
56#endif
57
59 assume(!rIsSCA(r));
60
61
62 if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
63 {
64 WarnS("Already defined!");
65 return false;
66 }
67
68
69 r->GetNC()->GetFormulaPowerMultiplier() = new CFormulaPowerMultiplier(r);
70
71 return true;
72
73}
74
75
76
77
78
79
80
81// TODO: return q-coeff?
82static inline BOOLEAN AreCommutingVariables(const ring r, int i, int j/*, number *qq*/)
83{
84#if OUTPUT
85 Print("AreCommutingVariables(ring, k: %d, i: %d)!\n", j, i);
86#endif
87
88 assume(i != j);
89
90 assume(i > 0);
91 assume(i <= r->N);
92
93
94 assume(j > 0);
95 assume(j <= r->N);
96
97 const BOOLEAN reverse = (i > j);
98
99 if (reverse) { int k = j; j = i; i = k; }
100
101 assume(i < j);
102
103 {
104 const poly d = GetD(r, i, j);
105
106#if OUTPUT
107 Print("D_{%d, %d} = ", i, j); p_Write(d, r);
108#endif
109
110 if( d != NULL)
111 return FALSE;
112 }
113
114
115 {
116 const number q = p_GetCoeff(GetC(r, i, j), r);
117
118 if( !n_IsOne(q, r->cf) )
119 return FALSE;
120 }
121
122 return TRUE; // [VAR(I), VAR(J)] = 0!!
123
124/*
125 if (reverse)
126 *qq = n_Invers(q, r);
127 else
128 *qq = n_Copy(q, r);
129 return TRUE;
130*/
131}
132
133static inline Enum_ncSAType AnalyzePairType(const ring r, int i, int j)
134{
135#if OUTPUT
136 Print("AnalyzePair(ring, i: %d, j: %d):\n", i, j);
137#endif
138
139 const int N = r->N;
140
141 assume(i < j);
142 assume(i > 0);
143 assume(j <= N);
144
145
146 const poly c = GetC(r, i, j);
147 const number q = pGetCoeff(c);
148 const poly d = GetD(r, i, j);
149
150#if 0 && OUTPUT
151 Print("C_{%d, %d} = ", i, j); p_Write(c, r); PrintLn();
152 Print("D_{%d, %d} = ", i, j); p_Write(d, r);
153#endif
154
155// const number q = p_GetCoeff(c, r);
156
157 if( d == NULL)
158 {
159
160 if( n_IsOne(q, r->cf) ) // commutative
161 return _ncSA_1xy0x0y0;
162
163 if( n_IsMOne(q, r->cf) ) // anti-commutative
164 return _ncSA_Mxy0x0y0;
165
166 return _ncSA_Qxy0x0y0; // quasi-commutative
167 } else
168 {
169 if( n_IsOne(q, r->cf) ) // "Lie" case
170 {
171 if( pNext(d) == NULL ) // Our Main Special Case: d is only a term!
172 {
173// const number g = p_GetCoeff(d, r); // not used for now
174 if( p_LmIsConstantComp(d, r) ) // Weyl
175 return _ncSA_1xy0x0yG;
176
177 const int k = p_IsPurePower(d, r); // k if not pure power
178
179 if( k > 0 ) // d = var(k)^??
180 {
181 const int exp = p_GetExp(d, k, r);
182
183 if (exp == 1)
184 {
185 if(k == i) // 2 -ubalgebra in var(i) & var(j), with linear relation...?
186 return _ncSA_1xyAx0y0;
187
188 if(k == j)
189 return _ncSA_1xy0xBy0;
190 } else if ( exp == 2 && k!= i && k != j) // Homogenized Weyl algebra [x, Dx] = t^2?
191 {
192// number qi, qj;
193 if (AreCommutingVariables(r, k, i/*, &qi*/) && AreCommutingVariables(r, k, j/*, &qj*/) ) // [x, t] = [Dx, t] = 0?
194 {
195 const number g = pGetCoeff(d);
196
197 if (n_IsOne(g, r->cf))
198 return _ncSA_1xy0x0yT2; // save k!?, G = LC(d) == qi == qj == 1!!!
199 }
200 }
201 }
202 }
203 }
204 // Hmm, what about a more general case of q != 1???
205 }
206#if OUTPUT
207 Print("C_{%d, %d} = ", i, j); p_Write(c, r);
208 Print("D_{%d, %d} = ", i, j); p_Write(d, r);
209 PrintS("====>>>>_ncSA_notImplemented\n");
210#endif
211
213}
214
215
216CFormulaPowerMultiplier::CFormulaPowerMultiplier(ring r): m_NVars(r->N), m_BaseRing(r)
217{
218#if OUTPUT
219 PrintS("CFormulaPowerMultiplier::CFormulaPowerMultiplier(ring)!");
220 PrintLn();
221#endif
222
223 m_SAPairTypes = (Enum_ncSAType*)omAlloc0( ((NVars() * (NVars()-1)) / 2) * sizeof(Enum_ncSAType) );
224
225 for( int i = 1; i < NVars(); i++ )
226 for( int j = i + 1; j <= NVars(); j++ )
228}
229
230
231
232
234{
235#if OUTPUT
236 PrintS("CFormulaPowerMultiplier::~CFormulaPowerMultiplier()!");
237 PrintLn();
238#endif
239
240 omFreeSize((ADDRESS)m_SAPairTypes, ((NVars() * (NVars()-1)) / 2) * sizeof(Enum_ncSAType) );
241}
242
243
244
245
246///////////////////////////////////////////////////////////////////////////////////////////
247static inline void CorrectPolyWRTOrdering(poly &pResult, const ring r)
248{
249 if( pNext(pResult) != NULL )
250 {
251 const int cmp = p_LmCmp(pResult, pNext(pResult), r);
252 assume( cmp != 0 ); // must not be equal!!!
253 if( cmp != 1 ) // Wrong order!!!
254 pResult = pReverse(pResult); // Reverse!!!
255 }
256 p_Test(pResult, r);
257}
258///////////////////////////////////////////////////////////////////////////////////////////
259static inline poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
260{
261#if OUTPUT
262 Print("ncSA_1xy0x0y0(var(%d)^{%d}, var(%d)^{%d}, r)!\n", j, m, i, n);
263#endif
264
265 poly p = p_One( r);
266 p_SetExp(p, j, m, r);
267 p_SetExp(p, i, n, r);
268 p_Setm(p, r);
269
270 p_Test(p, r);
271
272 return p;
273
274} // return ncSA_1xy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
275///////////////////////////////////////////////////////////////////////////////////////////
276static inline poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
277{
278#if OUTPUT
279 Print("ncSA_{M = -1}xy0x0y0(var(%d)^{%d}, var(%d)^{%d}, r)!\n", j, m, i, n);
280#endif
281
282 const int sign = 1 - ((n & (m & 1)) << 1);
283 poly p = p_ISet(sign, r);
284 p_SetExp(p, j, m, r);
285 p_SetExp(p, i, n, r);
286 p_Setm(p, r);
287
288
289 p_Test(p, r);
290
291 return p;
292
293} // return ncSA_Mxy0x0y0(GetI(), GetJ(), expRight, expLeft, r);
294///////////////////////////////////////////////////////////////////////////////////////////
295static inline poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
296{
297#if OUTPUT
298 Print("ncSA_Qxy0x0y0(var(%d)^{%d}, var(%d)^{%d}, Q, r)!\n", j, m, i, n);
299#endif
300
301 int min, max;
302
303 if( n < m )
304 {
305 min = n;
306 max = m;
307 }
308 else
309 {
310 min = m;
311 max = n;
312 }
313
314 number qN;
315
316 if( max == 1 )
317 qN = n_Copy(m_q, r->cf);
318 else
319 {
320 number t;
321 n_Power(m_q, max, &t, r->cf);
322
323 if( min > 1 )
324 {
325 n_Power(t, min, &qN, r->cf);
326 n_Delete(&t, r->cf);
327 }
328 else
329 qN = t;
330 }
331
332 poly p = p_NSet(qN, r);
333 p_SetExp(p, j, m, r);
334 p_SetExp(p, i, n, r);
335 p_Setm(p, r);
336
337
338 p_Test(p, r);
339
340 return p;
341
342} // return ncSA_Qxy0x0y0(GetI(), GetJ(), expRight, expLeft, m_q, r);
343///////////////////////////////////////////////////////////////////////////////////////////
344static inline poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
345{
346#if OUTPUT
347 Print("ncSA_1xy0x0yG(var(%d)^{%d}, var(%d)^{%d}, G, r)!\n", j, m, i, n);
348 number t = n_Copy(m_g, r->cf);
349 PrintS("Parameter G: "); n_Write(t, r->cf);
350 n_Delete(&t, r->cf);
351#endif
352
353 int kn = n;
354 int km = m;
355
356 number c = n_Init(1, r->cf);
357
358 poly p = p_One( r);
359
360 p_SetExp(p, j, km--, r); // y ^ (m-k)
361 p_SetExp(p, i, kn--, r); // x ^ (n-k)
362
363 p_Setm(p, r); // pResult = x^n * y^m
364
365
366 poly pResult = p;
367 poly pLast = p;
368
369 int min = si_min(m, n);
370
371 int k = 1;
372
373 for(; k < min; k++ )
374 {
375 number t = n_Init(km + 1, r->cf);
376 n_InpMult(t, m_g, r->cf); // t = ((m - k) + 1) * gamma
377 n_InpMult(c, t, r->cf); // c = c'* ((m - k) + 1) * gamma
378 n_Delete(&t, r->cf);
379
380 t = n_Init(kn + 1, r->cf);
381 n_InpMult(c, t, r->cf); // c = (c'* ((m - k) + 1) * gamma) * ((n - k) + 1)
382 n_Delete(&t, r->cf);
383
384 t = n_Init(k, r->cf);
385 c = n_Div(c, t, r->cf);
386 n_Delete(&t, r->cf);
387
388// n_Normalize(c, r->cf);
389
390 t = n_Copy(c, r->cf); // not the last!
391
392 p = p_NSet(t, r);
393
394 p_SetExp(p, j, km--, r); // y ^ (m-k)
395 p_SetExp(p, i, kn--, r); // x ^ (n-k)
396
397 p_Setm(p, r); // pResult = x^n * y^m
398
399 pNext(pLast) = p;
400 pLast = p;
401 }
402
403 assume(k == min);
404 assume((km == 0) || (kn == 0) );
405
406 {
407 n_InpMult(c, m_g, r->cf); // c = c'* gamma
408
409 if( km > 0 )
410 {
411 number t = n_Init(km + 1, r->cf);
412 n_InpMult(c, t, r->cf); // c = (c'* gamma) * (m - k + 1)
413 n_Delete(&t, r->cf);
414 }
415
416 if( kn > 0 )
417 {
418 number t = n_Init(kn + 1, r->cf);
419 n_InpMult(c, t, r->cf); // c = (c'* gamma) * (n - k + 1)
420 n_Delete(&t, r->cf);
421 }
422
423 number t = n_Init(k, r->cf); // c = ((c'* gamma) * ((n - k + 1) * (m - k + 1))) / k;
424 c = n_Div(c, t, r->cf);
425 n_Delete(&t, r->cf);
426 }
427
428 p = p_NSet(c, r);
429
430 p_SetExp(p, j, km, r); // y ^ (m-k)
431 p_SetExp(p, i, kn, r); // x ^ (n-k)
432
433 p_Setm(p, r); //
434
435 pNext(pLast) = p;
436
437 CorrectPolyWRTOrdering(pResult, r);
438
439 return pResult;
440}
441///////////////////////////////////////////////////////////////////////////////////////////
442///////////////////////////////////////////////////////////////////////////////////////////
443static inline poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int m_k, const ring r)
444{
445#if OUTPUT
446 Print("ncSA_1xy0x0yT2(var(%d)^{%d}, var(%d)^{%d}, t: var(%d), r)!\n", j, m, i, n, m_k);
447#endif
448
449 int kn = n;
450 int km = m;
451
452 // k == 0!
453 number c = n_Init(1, r->cf);
454
455 poly p = p_One( r );
456
457 p_SetExp(p, j, km--, r); // y ^ (m)
458 p_SetExp(p, i, kn--, r); // x ^ (n)
459// p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
460
461 p_Setm(p, r); // pResult = x^n * y^m
462
463
464 poly pResult = p;
465 poly pLast = p;
466
467 int min = si_min(m, n);
468
469 int k = 1;
470
471 for(; k < min; k++ )
472 {
473 number t = n_Init(km + 1, r->cf);
474// n_InpMult(t, m_g, r->cf); // t = ((m - k) + 1) * gamma
475 n_InpMult(c, t, r->cf); // c = c'* ((m - k) + 1) * gamma
476 n_Delete(&t, r->cf);
477
478 t = n_Init(kn + 1, r->cf);
479 n_InpMult(c, t, r->cf); // c = (c'* ((m - k) + 1) * gamma) * ((n - k) + 1)
480 n_Delete(&t, r->cf);
481
482 t = n_Init(k, r->cf);
483 c = n_Div(c, t, r->cf);
484 n_Delete(&t, r->cf);
485
486// // n_Normalize(c, r);
487
488 t = n_Copy(c, r->cf); // not the last!
489
490 p = p_NSet(t, r);
491
492 p_SetExp(p, j, km--, r); // y ^ (m-k)
493 p_SetExp(p, i, kn--, r); // x ^ (n-k)
494
495 p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
496
497 p_Setm(p, r); // pResult = x^(n-k) * y^(m-k)
498
499 pNext(pLast) = p;
500 pLast = p;
501 }
502
503 assume(k == min);
504 assume((km == 0) || (kn == 0) );
505
506 {
507// n_InpMult(c, m_g, r); // c = c'* gamma
508
509 if( km > 0 )
510 {
511 number t = n_Init(km + 1, r->cf);
512 n_InpMult(c, t, r->cf); // c = (c'* gamma) * (m - k + 1)
513 n_Delete(&t, r->cf);
514 }
515
516 if( kn > 0 )
517 {
518 number t = n_Init(kn + 1, r->cf);
519 n_InpMult(c, t, r->cf); // c = (c'* gamma) * (n - k + 1)
520 n_Delete(&t, r->cf);
521 }
522
523 number t = n_Init(k, r->cf); // c = ((c'* gamma) * ((n - k + 1) * (m - k + 1))) / k;
524 c = n_Div(c, t, r->cf);
525 n_Delete(&t, r->cf);
526 }
527
528 p = p_NSet(c, r);
529
530 p_SetExp(p, j, km, r); // y ^ (m-k)
531 p_SetExp(p, i, kn, r); // x ^ (n-k)
532
533 p_SetExp(p, m_k, k << 1, r); // homogenization with var(m_k) ^ (2*k)
534
535 p_Setm(p, r); //
536
537 pNext(pLast) = p;
538
539 CorrectPolyWRTOrdering(pResult, r);
540
541 return pResult;
542}
543///////////////////////////////////////////////////////////////////////////////////////////
544
545
546
547///////////////////////////////////////////////////////////////////////////////////////////
548static inline poly ncSA_ShiftAx(int i, int j, int n, int m, const number m_shiftCoef, const ring r)
549{
550 // Char == 0, otherwise - problem!
551
552 int k = m; // to 0
553
554 number c = n_Init(1, r->cf); // k = m, C_k = 1
555 poly p = p_One( r);
556
557 p_SetExp(p, j, k, r); // Y^{k}
558 p_SetExp(p, i, n, r);
559
560 p_Setm(p, r); // pResult = C_k * x^n * y^k, k == m
561
562
563 poly pResult = p;
564 poly pLast = p;
565
566 number nn = n_Init(n, r->cf); // number(n)!
567 n_InpMult(nn, m_shiftCoef, r->cf); // nn = (alpha*n)
568
569 --k;
570
571 int mk = 1; // mk = (m - k)
572
573 for(; k > 0; k-- )
574 {
575 number t = n_Init(k + 1, r->cf); // t = k+1
576 n_InpMult(c, t, r->cf); // c = c' * (k+1)
577 n_InpMult(c, nn, r->cf); // c = (c' * (k+1)) * (alpha * n)
578
579 n_Delete(&t, r->cf);
580 t = n_Init(mk++, r->cf);
581 c = n_Div(c, t, r->cf); // c = ((c' * (k+1)) * (alpha * n)) / (m-k);
582 n_Delete(&t, r->cf);
583
584// n_Normalize(c, r->cf);
585
586 t = n_Copy(c, r->cf); // not the last!
587
588 p = p_NSet(t, r);
589
590 p_SetExp(p, j, k, r); // y^k
591 p_SetExp(p, i, n, r); // x^n
592
593 p_Setm(p, r); // pResult = x^n * y^m
594
595 pNext(pLast) = p;
596 pLast = p;
597 }
598
599 assume(k == 0);
600
601 {
602 n_InpMult(c, nn, r->cf); // c = (c' * (0+1)) * (alpha * n)
603
604 number t = n_Init(m, r->cf);
605 c = n_Div(c, t, r->cf); // c = ((c' * (0+1)) * (alpha * n)) / (m-0);
606 n_Delete(&t, r->cf);
607 }
608
609 n_Delete(&nn, r->cf);
610
611 p = p_NSet(c, r);
612
613 p_SetExp(p, j, k, r); // y^k
614 p_SetExp(p, i, n, r); // x^n
615
616 p_Setm(p, r); //
617
618 pNext(pLast) = p;
619
620 CorrectPolyWRTOrdering(pResult, r);
621
622 return pResult;
623}
624///////////////////////////////////////////////////////////////////////////////////////////
625static inline poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
626{
627#if OUTPUT
628 Print("ncSA_1xyAx0y0(var(%d)^{%d}, var(%d)^{%d}, A, r)!\n", j, m, i, n);
629 number t = n_Copy(m_shiftCoef, r);
630 PrintS("Parameter A: "); n_Write(t, r);
631 n_Delete(&t, r);
632#endif
633
634 return ncSA_ShiftAx(i, j, n, m, m_shiftCoef, r);
635}
636///////////////////////////////////////////////////////////////////////////////////////////
637static inline poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
638{
639#if OUTPUT
640 Print("ncSA_1xy0xBy0(var(%d)^{%d}, var(%d)^{%d}, B, r)!\n", j, m, i, n);
641 number t = n_Copy(m_shiftCoef, r);
642 PrintS("Parameter B: "); n_Write(t, r);
643 n_Delete(&t, r);
644#endif
645
646 return ncSA_ShiftAx(j, i, m, n, m_shiftCoef, r);
647}
648///////////////////////////////////////////////////////////////////////////////////////////
649///////////////////////////////////////////////////////////////////////////////////////////
650///////////////////////////////////////////////////////////////////////////////////////////
651///////////////////////////////////////////////////////////////////////////////////////////
652
653
654static inline poly ncSA_Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
655{
656#if OUTPUT
657 Print("ncSA_Multiply(type: %d, ring, (var(%d)^{%d} * var(%d)^{%d}, r)!\n", (int)type, j, m, i, n);
658#endif
659
660 assume( type != _ncSA_notImplemented );
661 assume( (n > 0) && (m > 0) );
662
663 if( type == _ncSA_1xy0x0y0 )
664 return ::ncSA_1xy0x0y0(i, j, n, m, r);
665
666 if( type == _ncSA_Mxy0x0y0 )
667 return ::ncSA_Mxy0x0y0(i, j, n, m, r);
668
669 if( type == _ncSA_Qxy0x0y0 )
670 {
671 const number q = p_GetCoeff(GetC(r, i, j), r);
672 return ::ncSA_Qxy0x0y0(i, j, n, m, q, r);
673 }
674
675 const poly d = GetD(r, i, j);
676 const number g = p_GetCoeff(d, r);
677
678 if( type == _ncSA_1xy0x0yG ) // Weyl
679 return ::ncSA_1xy0x0yG(i, j, n, m, g, r);
680
681 if( type == _ncSA_1xy0x0yT2 ) // Homogenous Weyl...
682 return ::ncSA_1xy0x0yT2(i, j, n, m, p_IsPurePower(d, r), r);
683
684 if( type == _ncSA_1xyAx0y0 ) // Shift 1
685 return ::ncSA_1xyAx0y0(i, j, n, m, g, r);
686
687 if( type == _ncSA_1xy0xBy0 ) // Shift 2
688 return ::ncSA_1xy0xBy0(i, j, n, m, g, r);
689
690 assume( type == _ncSA_notImplemented );
691
692 return NULL;
693}
694
695
696poly CFormulaPowerMultiplier::Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
697{
698 return ncSA_Multiply( type, i, j, n, m, r);
699}
700
701
703{
704 return ::AnalyzePairType( r, i, j);
705}
706
707poly CFormulaPowerMultiplier::Multiply( int i, int j, const int n, const int m)
708{
709 return ncSA_Multiply( GetPair(i, j), i, j, n, m, GetBasering());
710}
711
712
713
714
715poly CFormulaPowerMultiplier::ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
716{
717 return ::ncSA_1xy0x0y0(i, j, n, m, r);
718}
719
720poly CFormulaPowerMultiplier::ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
721{
722 return ::ncSA_Mxy0x0y0(i, j, n, m, r);
723}
724
725poly CFormulaPowerMultiplier::ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
726{
727 return ::ncSA_Qxy0x0y0(i, j, n, m, m_q, r);
728}
729
730poly CFormulaPowerMultiplier::ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
731{
732 return ::ncSA_1xy0x0yG(i, j, n, m, m_g, r);
733}
734
735poly CFormulaPowerMultiplier::ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int k, const ring r)
736{
737 return ::ncSA_1xy0x0yT2(i, j, n, m, k, r);
738}
739
740poly CFormulaPowerMultiplier::ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
741{
742 return ::ncSA_1xyAx0y0(i, j, n, m, m_shiftCoef, r);
743}
744
745poly CFormulaPowerMultiplier::ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
746{
747 return ::ncSA_1xy0xBy0(i, j, n, m, m_shiftCoef, r);
748}
749#endif
All the auxiliary stuff.
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
void * ADDRESS
Definition: auxiliary.h:119
static int si_min(const int a, const int b)
Definition: auxiliary.h:125
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:56
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
int k
Definition: cfEzgcd.cc:99
int p
Definition: cfModGcd.cc:4078
g
Definition: cfModGcd.cc:4090
static poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int k, const ring r)
Definition: ncSAFormula.cc:735
virtual ~CFormulaPowerMultiplier()
Definition: ncSAFormula.cc:233
static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition: ncSAFormula.cc:740
static Enum_ncSAType AnalyzePair(const ring r, int i, int j)
Definition: ncSAFormula.cc:702
ring GetBasering() const
Definition: ncSAFormula.h:39
static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition: ncSAFormula.cc:745
static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
Definition: ncSAFormula.cc:725
static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
Definition: ncSAFormula.cc:730
Enum_ncSAType * m_SAPairTypes
Definition: ncSAFormula.h:30
static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:715
static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:720
Enum_ncSAType GetPair(int i, int j) const
Definition: ncSAFormula.h:44
static poly Multiply(Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:696
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:448
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
Definition: coeffs.h:469
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition: coeffs.h:629
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:612
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:588
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:535
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
Definition: coeffs.h:638
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:465
#define Print
Definition: emacs.cc:80
#define WarnS
Definition: emacs.cc:78
int j
Definition: facHensel.cc:110
CanonicalForm reverse(const CanonicalForm &F, int d)
Definition: facMul.cc:3234
static int min(int a, int b)
Definition: fast_mult.cc:268
static int max(int a, int b)
Definition: fast_mult.cc:264
static bool rIsSCA(const ring r)
Definition: nc.h:190
static poly GetD(const ring r, int i, int j)
Definition: nc.h:373
static poly GetC(const ring r, int i, int j)
Definition: nc.h:362
#define assume(x)
Definition: mod2.h:389
#define pNext(p)
Definition: monomials.h:36
#define p_GetCoeff(p, r)
Definition: monomials.h:50
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:357
static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:276
static poly ncSA_Multiply(Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:654
static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition: ncSAFormula.cc:637
static poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int m_k, const ring r)
Definition: ncSAFormula.cc:443
static void CorrectPolyWRTOrdering(poly &pResult, const ring r)
Definition: ncSAFormula.cc:247
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:50
static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r)
Definition: ncSAFormula.cc:259
static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r)
Definition: ncSAFormula.cc:625
static poly ncSA_ShiftAx(int i, int j, int n, int m, const number m_shiftCoef, const ring r)
Definition: ncSAFormula.cc:548
static Enum_ncSAType AnalyzePairType(const ring r, int i, int j)
Definition: ncSAFormula.cc:133
static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r)
Definition: ncSAFormula.cc:295
static BOOLEAN AreCommutingVariables(const ring r, int i, int j)
Definition: ncSAFormula.cc:82
static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r)
Definition: ncSAFormula.cc:344
Enum_ncSAType
Definition: ncSAFormula.h:16
@ _ncSA_1xy0x0yT2
Definition: ncSAFormula.h:24
@ _ncSA_Mxy0x0y0
Definition: ncSAFormula.h:19
@ _ncSA_1xyAx0y0
Definition: ncSAFormula.h:21
@ _ncSA_1xy0x0yG
Definition: ncSAFormula.h:23
@ _ncSA_Qxy0x0y0
Definition: ncSAFormula.h:20
@ _ncSA_notImplemented
Definition: ncSAFormula.h:17
@ _ncSA_1xy0x0y0
Definition: ncSAFormula.h:18
@ _ncSA_1xy0xBy0
Definition: ncSAFormula.h:22
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define NULL
Definition: omList.c:12
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
Definition: p_polys.cc:1226
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1297
poly p_One(const ring r)
Definition: p_polys.cc:1313
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1473
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:342
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:486
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:231
static poly pReverse(poly p)
Definition: p_polys.h:333
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
Definition: p_polys.h:1004
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1578
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:467
#define p_Test(p, r)
Definition: p_polys.h:159
static poly pLast(poly a, int &length)
returns the length of a polynomial (numbers of monomials) respect syzComp
Definition: polys.h:405
void PrintS(const char *s)
Definition: reporter.cc:284
void PrintLn()
Definition: reporter.cc:310
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:226
static int sign(int x)
Definition: ring.cc:3427
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:400