source: git/libpolys/polys/nc/ncSAFormula.h @ 4e654a2

spielwiese
Last change on this file since 4e654a2 was 1f5565d, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
added HWeyl add: experimental handling of homogenized Weyl algebras (formulas/detection and related)
  • Property mode set to 100644
File size: 3.2 KB
Line 
1#ifndef GRING_SA_MULT_FORMULA_H
2#define GRING_SA_MULT_FORMULA_H
3/*****************************************
4 *  Computer Algebra System SINGULAR     *
5 *****************************************/
6/* $Id$ */
7#ifdef HAVE_PLURAL
8
9// #include <ncSAFormula.h> // for CFormulaPowerMultiplier and enum Enum_ncSAType
10
11// //////////////////////////////////////////////////////////////////////// //
12
13#include <polys/monomials/ring.h>
14#include <polys/nc/nc.h>
15
16bool ncInitSpecialPowersMultiplication(ring r);
17
18enum Enum_ncSAType
19{
20  _ncSA_notImplemented = -1,
21  _ncSA_1xy0x0y0 = 0x00, // commutative
22  _ncSA_Mxy0x0y0 = 0x01, // anti-commutative
23  _ncSA_Qxy0x0y0 = 0x02, // quasi-commutative
24  _ncSA_1xyAx0y0 = 0x10, // shift 1
25  _ncSA_1xy0xBy0 = 0x20, // shift 2
26  _ncSA_1xy0x0yG = 0x30, // Weyl 
27  _ncSA_1xy0x0yT2 = 0x100 // homogenized Weyl algebra?
28};
29
30class CFormulaPowerMultiplier
31{
32  private:
33    Enum_ncSAType* m_SAPairTypes; // upper triangular submatrix of pairs 1 <= i < j <= N of a N x N matrix.
34   
35    const int m_NVars;
36    const ring m_BaseRing;
37
38   
39
40  public:
41    inline const int NVars() const { return m_NVars; }
42    inline const ring GetBasering() const { return m_BaseRing; }
43
44    CFormulaPowerMultiplier(ring r);
45    virtual ~CFormulaPowerMultiplier();
46
47    inline Enum_ncSAType GetPair(int i, int j) const
48    {
49      assume( m_SAPairTypes != NULL );
50      assume( i > 0 );
51      assume( i < j );
52      assume( j <= NVars() );
53
54      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
55    }
56
57    inline Enum_ncSAType& GetPair(int i, int j)
58    {
59      assume( m_SAPairTypes != NULL );
60      assume( i > 0 );
61      assume( i < j );
62      assume( j <= NVars() );
63
64      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
65    }
66
67    // Lowest level routines!
68    static Enum_ncSAType AnalyzePair(const ring r, int i, int j);
69    static poly Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r);
70
71    static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r);
72    static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r);
73   
74    static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r);
75
76    static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r); 
77    static poly ncSA_1xy0x0yT2(const int i, const int j, const int n, const int m, const int k, const ring r); 
78
79    static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
80    static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
81       
82   
83
84    // Higher level abstraction for keeping track of all the pair types!
85    poly Multiply( int i, int j, const int n, const int m);
86
87  private: // no copy constuctors!
88    CFormulaPowerMultiplier();
89    CFormulaPowerMultiplier(const CFormulaPowerMultiplier&);
90    CFormulaPowerMultiplier& operator=(const CFormulaPowerMultiplier&);
91
92
93};
94
95
96static inline CFormulaPowerMultiplier* GetFormulaPowerMultiplier(const ring r)
97{
98  return r->GetNC()->GetFormulaPowerMultiplier();
99}
100
101
102
103
104#endif // HAVE_PLURAL :(
105#endif //
Note: See TracBrowser for help on using the repository browser.