source: git/libpolys/polys/nc/ncSAFormula.h @ e43dc3

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