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

spielwiese
Last change on this file since d6a97c3 was d6a97c3, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: the rest of NC-related stuff can be compiled in now
  • Property mode set to 100644
File size: 3.1 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 = 0, // commutative
22  _ncSA_Mxy0x0y0 = 1, // anti-commutative
23  _ncSA_Qxy0x0y0 = 2, // quasi-commutative
24  _ncSA_1xyAx0y0 = 10, // shift 1
25  _ncSA_1xy0xBy0 = 20, // shift 2
26  _ncSA_1xy0x0yG = 30 // Weyl 
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
77    static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
78    static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
79       
80   
81
82    // Higher level abstraction for keeping track of all the pair types!
83    poly Multiply( int i, int j, const int n, const int m);
84
85  private: // no copy constuctors!
86    CFormulaPowerMultiplier();
87    CFormulaPowerMultiplier(const CFormulaPowerMultiplier&);
88    CFormulaPowerMultiplier& operator=(const CFormulaPowerMultiplier&);
89
90
91};
92
93
94static inline CFormulaPowerMultiplier* GetFormulaPowerMultiplier(const ring r)
95{
96  return r->GetNC()->GetFormulaPowerMultiplier();
97}
98
99
100
101
102#endif // HAVE_PLURAL :(
103#endif //
Note: See TracBrowser for help on using the repository browser.