Loading...
Searching...
No Matches
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.

{
simplex * LP;
int i;
int /*n,*/totverts,idelem;
ideal idr;
// n= (currRing->N);
idelem= IDELEMS(id); // should be n+1
totverts = 0;
for( i=0; i < idelem; i++) totverts += pLength( (id->m)[i] );
LP = new simplex( idelem+totverts*2+5, totverts+5 ); // rows, cols
// evaluate convex hull for supports of id
convexHull chnp( LP );
idr = chnp.newtonPolytopesI( id );
delete LP;
return idr;
}
i
int i
Definition cfEzgcd.cc:132
convexHull
Definition mpr_base.cc:250
simplex
Linear Programming / Linear Optimization using Simplex - Algorithm.
Definition mpr_numeric.h:195
pLength
static int pLength(poly a)
Definition p_polys.h:190
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## monomAt()

poly monomAt | ( | poly | p,
|  | int | i )

Definition at line 720 of file mpr_base.cc.

{
assume( i > 0 );
poly iter= p;
for ( int j= 1; (j < i) && (iter!=NULL); j++ ) pIter(iter);
return iter;
}
p
int p
Definition cfModGcd.cc:4086
iter
CFFListIterator iter
Definition facAbsBiFact.cc:54
j
int j
Definition facHensel.cc:110
assume
#define assume(x)
Definition mod2.h:389
pIter
#define pIter(p)
Definition monomials.h:37
NULL
#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.

{ // (d+n)! / ( d! n! )
mpz_t res;
mpz_init(res);
mpz_t m,md,mn;
mpz_init(m);mpz_set_ui(m,1);
mpz_init(md);mpz_set_ui(md,1);
mpz_init(mn);mpz_set_ui(mn,1);
mpz_fac_ui(m,n+d);
mpz_fac_ui(md,d);
mpz_fac_ui(mn,n);
mpz_mul(res,md,mn);
mpz_tdiv_q(res,m,res);
mpz_clear(m);mpz_clear(md);mpz_clear(mn);
unsigned long result = mpz_get_ui(res);
mpz_clear(res);
return result;
}
m
int m
Definition cfEzgcd.cc:128
result
return result
Definition facAbsBiFact.cc:76
res
CanonicalForm res
Definition facAbsFact.cc:60