Data Structures | Macros | Typedefs | Functions
mpr_base.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/mylimits.h>
#include <misc/options.h>
#include <misc/intvec.h>
#include <misc/sirandom.h>
#include <coeffs/numbers.h>
#include <coeffs/mpr_global.h>
#include <polys/matpol.h>
#include <polys/sparsmat.h>
#include <polys/clapsing.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include "mpr_base.h"
#include "mpr_numeric.h"
#include <math.h>

Go to the source code of this file.

Data Structures

class  resMatrixSparse
 
struct  setID
 
struct  onePointP
 
struct  entry
 
class  pointSet
 
class  convexHull
 
class  mayanPyramidAlg
 
class  resMatrixDense
 
struct  resVector
 

Macros

#define MAXPOINTS   10000
 
#define MAXINITELEMS   256
 
#define LIFT_COOR   50000
 
#define SCALEDOWN   100.0
 
#define MINVDIST   0.0
 
#define RVMULT   0.0001
 
#define MAXRVVAL   50000
 
#define MAXVARS   100
 
#define MAXEVPOINT   1000000
 

Typedefs

typedef unsigned int Coord_t
 

Functions

poly monomAt (poly p, int i)
 
unsigned long over (const unsigned long n, const unsigned long d)
 
ideal loNewtonPolytope (const ideal id)
 

Data Structure Documentation

§ setID

struct setID

Definition at line 135 of file mpr_base.cc.

Data Fields
int pnt
int set

§ onePoint

struct onePoint

Definition at line 141 of file mpr_base.cc.

Data Fields
Coord_t * point
setID rc
struct onePoint * rcPnt

§ _entry

struct _entry

Definition at line 151 of file mpr_base.cc.

Data Fields
int col
struct _entry * next
number num

Macro Definition Documentation

§ LIFT_COOR

#define LIFT_COOR   50000

Definition at line 52 of file mpr_base.cc.

§ MAXEVPOINT

#define MAXEVPOINT   1000000

Definition at line 2652 of file mpr_base.cc.

§ MAXINITELEMS

#define MAXINITELEMS   256

Definition at line 51 of file mpr_base.cc.

§ MAXPOINTS

#define MAXPOINTS   10000

Definition at line 50 of file mpr_base.cc.

§ MAXRVVAL

#define MAXRVVAL   50000

Definition at line 56 of file mpr_base.cc.

§ MAXVARS

#define MAXVARS   100

Definition at line 57 of file mpr_base.cc.

§ MINVDIST

#define MINVDIST   0.0

Definition at line 54 of file mpr_base.cc.

§ RVMULT

#define RVMULT   0.0001

Definition at line 55 of file mpr_base.cc.

§ SCALEDOWN

#define SCALEDOWN   100.0

Definition at line 53 of file mpr_base.cc.

Typedef Documentation

§ Coord_t

typedef unsigned int Coord_t

Definition at line 133 of file mpr_base.cc.

Function Documentation

§ loNewtonPolytope()

ideal loNewtonPolytope ( const ideal  id)

Definition at line 3190 of file mpr_base.cc.

3191 {
3192  simplex * LP;
3193  int i;
3194  int /*n,*/totverts,idelem;
3195  ideal idr;
3196 
3197  // n= (currRing->N);
3198  idelem= IDELEMS(id); // should be n+1
3199 
3200  totverts = 0;
3201  for( i=0; i < idelem; i++) totverts += pLength( (id->m)[i] );
3202 
3203  LP = new simplex( idelem+totverts*2+5, totverts+5 ); // rows, cols
3204 
3205  // evaluate convex hull for supports of id
3206  convexHull chnp( LP );
3207  idr = chnp.newtonPolytopesI( id );
3208 
3209  delete LP;
3210 
3211  return idr;
3212 }
Linear Programming / Linear Optimization using Simplex - Algorithm.
Definition: mpr_numeric.h:194
static int pLength(poly a)
Definition: p_polys.h:189
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24

§ monomAt()

poly monomAt ( poly  p,
int  i 
)

Definition at line 722 of file mpr_base.cc.

723 {
724  assume( i > 0 );
725  poly iter= p;
726  for ( int j= 1; (j < i) && (iter!=NULL); j++ ) pIter(iter);
727  return iter;
728 }
return P p
Definition: myNF.cc:203
CFFListIterator iter
Definition: facAbsBiFact.cc:54
#define pIter(p)
Definition: monomials.h:44
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

§ over()

unsigned long over ( const unsigned long  n,
const unsigned long  d 
)

Definition at line 2658 of file mpr_base.cc.

2659 { // (d+n)! / ( d! n! )
2660  mpz_t res;
2661  mpz_init(res);
2662  mpz_t m,md,mn;
2663  mpz_init(m);mpz_set_ui(m,1);
2664  mpz_init(md);mpz_set_ui(md,1);
2665  mpz_init(mn);mpz_set_ui(mn,1);
2666 
2667  mpz_fac_ui(m,n+d);
2668  mpz_fac_ui(md,d);
2669  mpz_fac_ui(mn,n);
2670 
2671  mpz_mul(res,md,mn);
2672  mpz_tdiv_q(res,m,res);
2673 
2674  mpz_clear(m);mpz_clear(md);mpz_clear(mn);
2675 
2676  unsigned long result = mpz_get_ui(res);
2677  mpz_clear(res);
2678 
2679  return result;
2680 }
poly res
Definition: myNF.cc:322
int m
Definition: cfEzgcd.cc:119
return result
Definition: facAbsBiFact.cc:76