[a5f15a] | 1 | #ifndef MPR_BASE_H |
---|
| 2 | #define MPR_BASE_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[c7f3b7] | 6 | /* $Id: mpr_base.h,v 1.5 1999-12-02 23:03:50 wenk Exp $ */ |
---|
[a5f15a] | 7 | |
---|
[e858e7] | 8 | /* |
---|
[a5f15a] | 9 | * ABSTRACT - multipolynomial resultants - resultant matrices |
---|
| 10 | * ( sparse, dense, u-resultant solver ) |
---|
| 11 | */ |
---|
| 12 | |
---|
| 13 | #include "mpr_numeric.h" |
---|
| 14 | |
---|
| 15 | #define SNONE -1 |
---|
| 16 | #define SFREE -2 |
---|
| 17 | |
---|
| 18 | //%s |
---|
| 19 | //-> class resMatrixBase |
---|
| 20 | /** |
---|
| 21 | * Base class for sparse and dense u-Resultant computation |
---|
| 22 | */ |
---|
[e858e7] | 23 | class resMatrixBase |
---|
| 24 | { |
---|
[a5f15a] | 25 | public: |
---|
| 26 | /* state of the resultant */ |
---|
| 27 | enum IStateType { none, ready, notInit, fatalError, sparseError }; |
---|
| 28 | |
---|
| 29 | resMatrixBase() : istate(notInit), totDeg(0) {} |
---|
| 30 | virtual ~resMatrixBase() {} |
---|
| 31 | |
---|
| 32 | virtual const ideal getMatrix() { return NULL; } |
---|
| 33 | virtual const ideal getSubMatrix() { return NULL; } |
---|
| 34 | |
---|
| 35 | virtual const poly getUDet( const number* evpoint ) { return NULL; } |
---|
| 36 | |
---|
| 37 | virtual const number getDetAt( const number* evpoint ) { return NULL; } |
---|
| 38 | virtual const number getSubDet() { return NULL; } |
---|
| 39 | |
---|
[e858e7] | 40 | virtual const long getDetDeg() const { return totDeg; } |
---|
[a5f15a] | 41 | |
---|
[e858e7] | 42 | virtual const IStateType initState() const { return istate; } |
---|
[a5f15a] | 43 | |
---|
| 44 | protected: |
---|
| 45 | IStateType istate; |
---|
| 46 | |
---|
| 47 | ideal gls; |
---|
| 48 | int linPolyS; |
---|
| 49 | ring sourceRing; |
---|
| 50 | |
---|
| 51 | int totDeg; |
---|
[e858e7] | 52 | |
---|
[a5f15a] | 53 | private: |
---|
| 54 | /* disables the copy constructor */ |
---|
| 55 | resMatrixBase( const resMatrixBase & ); |
---|
| 56 | }; |
---|
| 57 | //<- |
---|
| 58 | |
---|
| 59 | //-> class uResultant |
---|
| 60 | /** |
---|
| 61 | * Base class for solving 0-dim poly systems using u-resultant |
---|
| 62 | */ |
---|
[e858e7] | 63 | class uResultant |
---|
| 64 | { |
---|
[a5f15a] | 65 | public: |
---|
| 66 | enum resMatType { none, sparseResMat, denseResMat }; |
---|
| 67 | |
---|
| 68 | uResultant( const ideal _gls, const resMatType _rmt= sparseResMat, BOOLEAN extIdeal= true ); |
---|
| 69 | ~uResultant(); |
---|
| 70 | |
---|
| 71 | poly interpolateDense( const number subDetVal= NULL ); |
---|
| 72 | |
---|
| 73 | /* Interpolates n+1 determinat polys for coeff specializations. */ |
---|
| 74 | rootContainer ** interpolateDenseSP( BOOLEAN matchUp= false, const number subDetVal= NULL ); |
---|
| 75 | |
---|
| 76 | /* Uses Bareiss */ |
---|
| 77 | rootContainer ** specializeInU( BOOLEAN matchUp= false, const number subDetVal= NULL ); |
---|
| 78 | |
---|
[e858e7] | 79 | resMatrixBase * accessResMat() { return resMat; } |
---|
[a5f15a] | 80 | |
---|
| 81 | private: |
---|
| 82 | /* deactivated copy constructor */ |
---|
| 83 | uResultant( const uResultant & ); |
---|
[e858e7] | 84 | |
---|
[a5f15a] | 85 | ideal extendIdeal( const ideal gls, poly linPoly, const resMatType rmt ); |
---|
| 86 | poly linearPoly( const resMatType rmt ); |
---|
| 87 | int nextPrime( const int p ); |
---|
| 88 | |
---|
| 89 | ideal gls; |
---|
| 90 | int n; |
---|
| 91 | |
---|
| 92 | resMatType rmt; // sparse or dense resultant matrix ? |
---|
| 93 | resMatrixBase *resMat; // pointer to base resultant matrix class |
---|
| 94 | }; |
---|
| 95 | //<- |
---|
[c7f3b7] | 96 | |
---|
| 97 | ideal loNewtonPolytope( const ideal id ); |
---|
[a5f15a] | 98 | //%e |
---|
| 99 | #endif MPR_BASE_H |
---|
| 100 | |
---|
| 101 | // local Variables: *** |
---|
| 102 | // folded-file: t *** |
---|
| 103 | // compile-command-2: "make install" *** |
---|
| 104 | // compile-command: "make installg" *** |
---|
[e858e7] | 105 | // End: *** |
---|