source: git/numeric/mpr_base.h @ 6caad65

spielwiese
Last change on this file since 6caad65 was 6caad65, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
warnings elimination chg: uninitialized fake variables chg: "'const' type qualifier on return type has no effect" for numeric/ chg: more minor warnings elimination
  • Property mode set to 100644
File size: 2.9 KB
Line 
1#ifndef MPR_BASE_H
2#define MPR_BASE_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6
7/*
8* ABSTRACT - multipolynomial resultants - resultant matrices
9*            ( sparse, dense, u-resultant solver )
10*/
11
12#include <numeric/mpr_numeric.h>
13
14#define SNONE -1
15#define SFREE -2
16
17//%s
18//-> class resMatrixBase
19/**
20 * Base class for sparse and dense u-Resultant computation
21 */
22class resMatrixBase
23{
24public:
25  /* state of the resultant */
26  enum IStateType { none, ready, notInit, fatalError, sparseError };
27
28  resMatrixBase() : istate(notInit), totDeg(0) {}
29  virtual ~resMatrixBase() {}
30
31  virtual ideal getMatrix() { return NULL; }
32  virtual ideal getSubMatrix() { return NULL; }
33
34  virtual poly getUDet( const number* evpoint ) { return NULL; }
35
36  virtual number getDetAt( const number* evpoint ) { return NULL; }
37  virtual number getSubDet() { return NULL; }
38
39  virtual long getDetDeg() { return totDeg; }
40
41  virtual IStateType initState() const { return istate; }
42
43protected:
44  IStateType istate;
45
46  ideal gls;
47  int linPolyS;
48  ring sourceRing;
49
50  int totDeg;
51
52private:
53  /* disables the copy constructor */
54  resMatrixBase( const resMatrixBase & );
55};
56//<-
57
58//-> class uResultant
59/**
60 * Base class for solving 0-dim poly systems using u-resultant
61 */
62class uResultant
63{
64public:
65  enum resMatType { none, sparseResMat, denseResMat };
66
67  uResultant( const ideal _gls, const resMatType _rmt= sparseResMat, BOOLEAN extIdeal= true );
68  ~uResultant();
69
70  poly interpolateDense( const number subDetVal= NULL );
71
72  /* Interpolates n+1 determinat polys for coeff specializations. */
73  rootContainer ** interpolateDenseSP( BOOLEAN matchUp= false, const number subDetVal= NULL );
74
75  /* Uses Bareiss */
76  rootContainer ** specializeInU( BOOLEAN matchUp= false, const number subDetVal= NULL );
77
78  resMatrixBase * accessResMat() { return resMat; }
79
80private:
81  /* deactivated copy constructor */
82  uResultant( const uResultant & );
83
84  ideal extendIdeal( const ideal gls, poly linPoly, const resMatType rmt );
85  poly linearPoly( const resMatType rmt );
86  int nextPrime( const int p );
87
88  ideal gls;
89  int n;
90
91  resMatType rmt;        // sparse or dense resultant matrix ?
92  resMatrixBase *resMat; // pointer to base resultant matrix class
93};
94//<-
95uResultant::resMatType determineMType( int imtype );
96enum mprState
97{
98    mprOk,
99    mprWrongRType,
100    mprHasOne,
101    mprInfNumOfVars,
102    mprNotReduced,
103    mprNotZeroDim,
104    mprNotHomog,
105    mprUnSupField
106};
107
108mprState mprIdealCheck( const ideal theIdeal,
109                        const char * name,
110                        uResultant::resMatType mtype,
111                        BOOLEAN rmatrix= false );
112
113ideal loNewtonPolytope( const ideal id );
114
115extern size_t gmp_output_digits;
116//%e
117#endif /*MPR_BASE_H*/
118
119// local Variables: ***
120// folded-file: t ***
121// compile-command-2: "make install" ***
122// compile-command: "make installg" ***
123// End: ***
Note: See TracBrowser for help on using the repository browser.