source: git/kernel/ncSAFormula.h @ 61944d0

spielwiese
Last change on this file since 61944d0 was a7fbdd, checked in by Motsak Oleksandr <motsak@…>, 16 years ago
*motsak: Formula for special cases git-svn-id: file:///usr/local/Singular/svn/trunk@10899 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • 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: ncSAFormula.h,v 1.1 2008-07-23 07:09:45 motsak Exp $ */
7#ifdef HAVE_PLURAL
8
9// #include <ncSAFormula.h> // for CFormulaPowerMultiplier and enum Enum_ncSAType
10
11// //////////////////////////////////////////////////////////////////////// //
12
13#include <structs.h>
14
15bool ncInitSpecialPowersMultiplication(ring r);
16
17enum Enum_ncSAType
18{
19  _ncSA_notImplemented = -1,
20  _ncSA_1xy0x0y0 = 0, // commutative
21  _ncSA_Mxy0x0y0 = 1, // anti-commutative
22  _ncSA_Qxy0x0y0 = 2, // quasi-commutative
23  _ncSA_1xyAx0y0 = 10, // shift 1
24  _ncSA_1xy0xBy0 = 20, // shift 2
25  _ncSA_1xy0x0yG = 30 // Weyl 
26};
27
28
29inline CFormulaPowerMultiplier* GetFormulaPowerMultiplier(const ring r = currRing)
30{
31  return r->GetNC()->GetFormulaPowerMultiplier();
32}
33
34class CFormulaPowerMultiplier
35{
36  private:
37    Enum_ncSAType* m_SAPairTypes; // upper triangular submatrix of pairs 1 <= i < j <= N of a N x N matrix.
38   
39    const int m_NVars;
40    const ring m_BaseRing;
41
42   
43
44  public:
45    inline const int NVars() const { return m_NVars; }
46    inline const ring GetBasering() const { return m_BaseRing; }
47
48    CFormulaPowerMultiplier(ring r);
49    virtual ~CFormulaPowerMultiplier();
50
51    inline Enum_ncSAType GetPair(int i, int j) const
52    {
53      assume( m_SAPairTypes != NULL );
54      assume( i > 0 );
55      assume( i < j );
56      assume( j <= NVars() );
57
58      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
59    }
60
61    inline Enum_ncSAType& GetPair(int i, int j)
62    {
63      assume( m_SAPairTypes != NULL );
64      assume( i > 0 );
65      assume( i < j );
66      assume( j <= NVars() );
67
68      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
69    }
70
71    // Lowest level routines!
72    static Enum_ncSAType AnalyzePair(const ring r, int i, int j);
73    static poly Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r);
74
75    static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r);
76    static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r);
77   
78    static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r);
79
80    static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r); 
81
82    static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
83    static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
84       
85   
86
87    // Higher level abstraction for keeping track of all the pair types!
88    poly Multiply( int i, int j, const int n, const int m);
89
90  private: // no copy constuctors!
91    CFormulaPowerMultiplier();
92    CFormulaPowerMultiplier(const CFormulaPowerMultiplier&);
93    CFormulaPowerMultiplier& operator=(const CFormulaPowerMultiplier&);
94
95
96};
97
98
99
100
101
102#endif // HAVE_PLURAL :(
103#endif //
Note: See TracBrowser for help on using the repository browser.