source: git/kernel/mpr_base.h @ e7c6b22

spielwiese
Last change on this file since e7c6b22 was 9ee256, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes: syntax git-svn-id: file:///usr/local/Singular/svn/trunk@8466 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.0 KB
Line 
1#ifndef MPR_BASE_H
2#define MPR_BASE_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: mpr_base.h,v 1.2 2005-07-28 09:56:58 Singular Exp $ */
7
8/*
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 */
23class resMatrixBase
24{
25public:
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
40  virtual const long getDetDeg() const { return totDeg; }
41
42  virtual const IStateType initState() const { return istate; }
43
44protected:
45  IStateType istate;
46
47  ideal gls;
48  int linPolyS;
49  ring sourceRing;
50
51  int totDeg;
52
53private:
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 */
63class uResultant
64{
65public:
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
79  resMatrixBase * accessResMat() { return resMat; }
80
81private:
82  /* deactivated copy constructor */
83  uResultant( const uResultant & );
84
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//<-
96uResultant::resMatType determineMType( int imtype );
97enum mprState
98{
99    mprOk,
100    mprWrongRType,
101    mprHasOne,
102    mprInfNumOfVars,
103    mprNotReduced,
104    mprNotZeroDim,
105    mprNotHomog,
106    mprUnSupField
107};
108
109mprState mprIdealCheck( const ideal theIdeal,
110                        const char * name,
111                        uResultant::resMatType mtype,
112                        BOOLEAN rmatrix= false );
113
114ideal loNewtonPolytope( const ideal id );
115
116extern size_t gmp_output_digits;
117//%e
118#endif /*MPR_BASE_H*/
119
120// local Variables: ***
121// folded-file: t ***
122// compile-command-2: "make install" ***
123// compile-command: "make installg" ***
124// End: ***
Note: See TracBrowser for help on using the repository browser.