My Project
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
mpr_base.cc File Reference
#include "kernel/mod2.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 <cmath>

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 133 of file mpr_base.cc.

Data Fields
int pnt
int set

◆ onePoint

struct onePoint

Definition at line 139 of file mpr_base.cc.

Data Fields
Coord_t * point
setID rc
struct onePoint * rcPnt

◆ _entry

struct _entry

Definition at line 149 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 50 of file mpr_base.cc.

◆ MAXEVPOINT

#define MAXEVPOINT   1000000

Definition at line 2653 of file mpr_base.cc.

◆ MAXINITELEMS

#define MAXINITELEMS   256

Definition at line 49 of file mpr_base.cc.

◆ MAXPOINTS

#define MAXPOINTS   10000

Definition at line 48 of file mpr_base.cc.

◆ MAXRVVAL

#define MAXRVVAL   50000

Definition at line 54 of file mpr_base.cc.

◆ MAXVARS

#define MAXVARS   100

Definition at line 55 of file mpr_base.cc.

◆ MINVDIST

#define MINVDIST   0.0

Definition at line 52 of file mpr_base.cc.

◆ RVMULT

#define RVMULT   0.0001

Definition at line 53 of file mpr_base.cc.

◆ SCALEDOWN

#define SCALEDOWN   100.0

Definition at line 51 of file mpr_base.cc.

Typedef Documentation

◆ Coord_t

typedef unsigned int Coord_t

Definition at line 131 of file mpr_base.cc.

Function Documentation

◆ loNewtonPolytope()

ideal loNewtonPolytope ( const ideal  id)

Definition at line 3191 of file mpr_base.cc.

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

◆ monomAt()

poly monomAt ( poly  p,
int  i 
)

Definition at line 720 of file mpr_base.cc.

721{
722 assume( i > 0 );
723 poly iter= p;
724 for ( int j= 1; (j < i) && (iter!=NULL); j++ ) pIter(iter);
725 return iter;
726}
int p
Definition: cfModGcd.cc:4078
CFFListIterator iter
Definition: facAbsBiFact.cc:53
int j
Definition: facHensel.cc:110
#define assume(x)
Definition: mod2.h:389
#define pIter(p)
Definition: monomials.h:37
#define NULL
Definition: omList.c:12

◆ over()

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}
int m
Definition: cfEzgcd.cc:128
return result
Definition: facAbsBiFact.cc:75
CanonicalForm res
Definition: facAbsFact.cc:60