Data Structures | Macros | Typedefs | Functions
mpr_base.cc File Reference
#include <kernel/mod2.h>
#include <misc/auxiliary.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

struct setID

Definition at line 136 of file mpr_base.cc.

Data Fields
int pnt
int set
struct onePoint

Definition at line 142 of file mpr_base.cc.

Data Fields
Coord_t * point
setID rc
struct onePoint * rcPnt
struct _entry

Definition at line 152 of file mpr_base.cc.

Data Fields
int col
struct _entry * next
number num

Macro Definition Documentation

#define LIFT_COOR   50000

Definition at line 53 of file mpr_base.cc.

#define MAXEVPOINT   1000000

Definition at line 2653 of file mpr_base.cc.

#define MAXINITELEMS   256

Definition at line 52 of file mpr_base.cc.

#define MAXPOINTS   10000

Definition at line 51 of file mpr_base.cc.

#define MAXRVVAL   50000

Definition at line 57 of file mpr_base.cc.

#define MAXVARS   100

Definition at line 58 of file mpr_base.cc.

#define MINVDIST   0.0

Definition at line 55 of file mpr_base.cc.

#define RVMULT   0.0001

Definition at line 56 of file mpr_base.cc.

#define SCALEDOWN   100.0

Definition at line 54 of file mpr_base.cc.

Typedef Documentation

typedef unsigned int Coord_t

Definition at line 134 of file mpr_base.cc.

Function Documentation

ideal loNewtonPolytope ( const ideal  id)

Definition at line 3192 of file mpr_base.cc.

3193 {
3194  simplex * LP;
3195  int i;
3196  int /*n,*/totverts,idelem;
3197  ideal idr;
3198 
3199  // n= (currRing->N);
3200  idelem= IDELEMS(id); // should be n+1
3201 
3202  totverts = 0;
3203  for( i=0; i < idelem; i++) totverts += pLength( (id->m)[i] );
3204 
3205  LP = new simplex( idelem+totverts*2+5, totverts+5 ); // rows, cols
3206 
3207  // evaluate convex hull for supports of id
3208  convexHull chnp( LP );
3209  idr = chnp.newtonPolytopesI( id );
3210 
3211  delete LP;
3212 
3213  return idr;
3214 }
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
poly monomAt ( poly  p,
int  i 
)

Definition at line 723 of file mpr_base.cc.

724 {
725  assume( i > 0 );
726  poly iter= p;
727  for ( int j= 1; (j < i) && (iter!=NULL); j++ ) pIter(iter);
728  return iter;
729 }
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:405
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
unsigned long over ( const unsigned long  n,
const unsigned long  d 
)

Definition at line 2659 of file mpr_base.cc.

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