source: git/kernel/ncSAFormula.h @ 06662e

spielwiese
Last change on this file since 06662e was 835d83, checked in by Hans Schönemann <hannes@…>, 14 years ago
move stuff from structs.h git-svn-id: file:///usr/local/Singular/svn/trunk@12398 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$ */
7#ifdef HAVE_PLURAL
8
9// #include <ncSAFormula.h> // for CFormulaPowerMultiplier and enum Enum_ncSAType
10
11// //////////////////////////////////////////////////////////////////////// //
12
13#include <structs.h>
14#include <ring.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
29
30inline CFormulaPowerMultiplier* GetFormulaPowerMultiplier(const ring r = currRing)
31{
32  return r->GetNC()->GetFormulaPowerMultiplier();
33}
34
35class CFormulaPowerMultiplier
36{
37  private:
38    Enum_ncSAType* m_SAPairTypes; // upper triangular submatrix of pairs 1 <= i < j <= N of a N x N matrix.
39   
40    const int m_NVars;
41    const ring m_BaseRing;
42
43   
44
45  public:
46    inline const int NVars() const { return m_NVars; }
47    inline const ring GetBasering() const { return m_BaseRing; }
48
49    CFormulaPowerMultiplier(ring r);
50    virtual ~CFormulaPowerMultiplier();
51
52    inline Enum_ncSAType GetPair(int i, int j) const
53    {
54      assume( m_SAPairTypes != NULL );
55      assume( i > 0 );
56      assume( i < j );
57      assume( j <= NVars() );
58
59      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
60    }
61
62    inline Enum_ncSAType& GetPair(int i, int j)
63    {
64      assume( m_SAPairTypes != NULL );
65      assume( i > 0 );
66      assume( i < j );
67      assume( j <= NVars() );
68
69      return m_SAPairTypes[( (NVars() * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1) - (i) )];
70    }
71
72    // Lowest level routines!
73    static Enum_ncSAType AnalyzePair(const ring r, int i, int j);
74    static poly Multiply( Enum_ncSAType type, const int i, const int j, const int n, const int m, const ring r);
75
76    static poly ncSA_1xy0x0y0(const int i, const int j, const int n, const int m, const ring r);
77    static poly ncSA_Mxy0x0y0(const int i, const int j, const int n, const int m, const ring r);
78   
79    static poly ncSA_Qxy0x0y0(const int i, const int j, const int n, const int m, const number m_q, const ring r);
80
81    static poly ncSA_1xy0x0yG(const int i, const int j, const int n, const int m, const number m_g, const ring r); 
82
83    static poly ncSA_1xyAx0y0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
84    static poly ncSA_1xy0xBy0(const int i, const int j, const int n, const int m, const number m_shiftCoef, const ring r);
85       
86   
87
88    // Higher level abstraction for keeping track of all the pair types!
89    poly Multiply( int i, int j, const int n, const int m);
90
91  private: // no copy constuctors!
92    CFormulaPowerMultiplier();
93    CFormulaPowerMultiplier(const CFormulaPowerMultiplier&);
94    CFormulaPowerMultiplier& operator=(const CFormulaPowerMultiplier&);
95
96
97};
98
99
100
101
102
103#endif // HAVE_PLURAL :(
104#endif //
Note: See TracBrowser for help on using the repository browser.