 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
void | gitfan::mergeFacets (facets &F, const facets &newFacets) |
|
static gfan::ZCone | subcone (const lists &cones, const gfan::ZVector &point) |
|
static gitfan::facets | interiorFacets (const gfan::ZCone &zc, const gfan::ZCone &bound) |
|
BOOLEAN | refineCones (leftv res, leftv args) |
|
static int | binomial (int n, int k) |
|
intvec * | intToAface (unsigned int v0, int n, int k) |
|
BOOLEAN | listOfAfacesToCheck (leftv res, leftv args) |
|
BOOLEAN | nextAfaceToCheck (leftv res, leftv args) |
|
BOOLEAN | checkSigns (leftv res, leftv args) |
|
BOOLEAN | binaryToBigint (leftv res, leftv args) |
|
BOOLEAN | composeIntvecs (leftv res, leftv args) |
|
BOOLEAN | findPlaceToInsert (leftv res, leftv args) |
|
void | subset (std::vector< int > &arr, int size, int left, int index, std::vector< int > &l, std::vector< std::vector< int > > &L) |
|
BOOLEAN | subsets (leftv res, leftv args) |
|
int SI_MOD_INIT() | gitfan (SModulFunctions *p) |
|
◆ binaryToBigint()
Definition at line 417 of file gitfan.cc.
427 for (
int i=1;
i<
l;
i++)
429 number endResultCache;
435 endResult = endResultCache;
436 endResultCache =
NULL;
440 res->data = (
void*) endResult;
443 WerrorS(
"binaryToBigint: unexpected parameter");
◆ binomial()
static int binomial |
( |
int |
n, |
|
|
int |
k |
|
) |
| |
|
static |
Definition at line 262 of file gitfan.cc.
266 gfan::Integer
num = 1;
267 gfan::Integer
den = 1;
268 for (
int i=1;
i<=
k;
i++)
270 for (
int j=n-
k+1;
j<=n;
j++)
272 gfan::Integer bin =
num/
den;
◆ checkSigns()
Definition at line 368 of file gitfan.cc.
390 res->data = (
void*) (
long) 0;
400 res->data = (
void*) (
long) 0;
406 res->data = (
void*) (
long) 1;
408 delete interiorPoint;
412 WerrorS(
"checkSigns: unexpected parameter");
◆ composeIntvecs()
Definition at line 448 of file gitfan.cc.
460 for (
int i=0;
i<
k;
i++)
461 (*composedIntvec)[
i] = (*iv1)[(*iv2)[
i]-1];
463 res->data = (
void*) composedIntvec;
467 WerrorS(
"composeIntvecs: unexpected parameter");
◆ findPlaceToInsert()
Definition at line 472 of file gitfan.cc.
481 number numberToInsert = (number)
v->Data();
483 int upperBound =
lSize(listOfNumbers);
487 res->data = (
void*) (
long) (lowerBound+1);
491 number lowerNumber = (number) listOfNumbers->
m[lowerBound].
Data();
495 res->data = (
void*) (
long) (-1);
501 res->data = (
void*) (
long) (lowerBound+1);
505 number upperNumber = (number) listOfNumbers->
m[upperBound].
Data();
509 res->data = (
void*) (
long) (-1);
515 res->data = (
void*) (
long) (upperBound+2);
519 while (lowerBound+1<upperBound)
521 int middle = lowerBound + (upperBound-lowerBound) / 2;
522 number lowerNumber = (number) listOfNumbers->
m[lowerBound].
Data();
523 number upperNumber = (number) listOfNumbers->
m[upperBound].
Data();
524 number middleNumber = (number) listOfNumbers->
m[middle].
Data();
530 res->data = (
void*) (
long) -1;
540 res->data = (
void*) (
long) (upperBound+1);
544 WerrorS(
"findPlaceToInsert: unexpected parameter");
◆ gitfan()
Definition at line 608 of file gitfan.cc.
610 gfan::initializeCddlibIfRequired();
◆ interiorFacets()
Definition at line 104 of file gitfan.cc.
107 gfan::ZMatrix
equations = zc.getImpliedEquations();
121 gfan::ZMatrix newInequalities =
inequalities.submatrix(1,0,r,c);
124 gfan::ZCone eta = gfan::ZCone(newInequalities,newEquations);
126 gfan::ZVector
v = eta.getRelativeInteriorPoint();
129 if (
bound.containsRelatively(
v))
133 for (
int i=1;
i<r-1;
i++)
139 eta = gfan::ZCone(newInequalities,newEquations);
141 v = eta.getRelativeInteriorPoint();
143 if (
bound.containsRelatively(
v))
151 eta = gfan::ZCone(newInequalities,newEquations);
154 v = eta.getRelativeInteriorPoint();
156 if (
bound.containsRelatively(
v))
◆ intToAface()
intvec* intToAface |
( |
unsigned int |
v0, |
|
|
int |
n, |
|
|
int |
k |
|
) |
| |
◆ listOfAfacesToCheck()
Definition at line 290 of file gitfan.cc.
298 int n = (int)(
long) u->
Data();
299 int k = (int)(
long)
v->Data();
301 for (
int i=0;
i<
k;
i++)
307 while (!(
v & (1<<n)))
316 v = (t + 1) | (((~t & -~t) - 1) >> (__builtin_ctz(
v) + 1));
319 res->data = (
void*) L;
323 WerrorS(
"listOfAfacesToCheck: unexpected parameter");
◆ nextAfaceToCheck()
Definition at line 328 of file gitfan.cc.
345 af |= 1<<((*aface)[
i]-1);
347 unsigned int t = af | (af - 1);
348 af = (t + 1) | (((~t & -~t) - 1) >> (__builtin_ctz(af) + 1));
363 WerrorS(
"nextAfaceToCheck: unexpected parameter");
◆ refineCones()
Definition at line 162 of file gitfan.cc.
173 gfan::ZCone support = gfan::ZCone::givenByRays(*zm, gfan::ZMatrix(0, zm->getWidth()));
184 gfan::ZCone
lambda; gfan::ZVector point;
191 int iterationNumber = 1;
192 std::cout <<
"cones found: " << iterationNumber++ << std::endl;
195 gfan::ZFan* Sigma =
new gfan::ZFan(
lambda.ambientDimension());
201 res->data = (
void*) Sigma;
208 gfan::ZVector interiorPoint;
209 gfan::ZVector facetNormal;
218 interiorPoint =
f.getInteriorPoint();
219 facetNormal =
f.getFacetNormal();
226 point =
mu * interiorPoint - facetNormal;
227 while (!support.containsRelatively(point))
230 point =
mu * interiorPoint - facetNormal;
234 while ((
lambda.dimension() <
lambda.ambientDimension()) && !(
lambda.contains(interiorPoint)))
237 point =
mu * interiorPoint - facetNormal;
240 std::cout <<
"cones found: " << iterationNumber++ << std::endl;
253 res->data = (
void*) Sigma;
257 WerrorS(
"refineCones: unexpected parameters");
◆ subcone()
static gfan::ZCone subcone |
( |
const lists & |
cones, |
|
|
const gfan::ZVector & |
point |
|
) |
| |
|
static |
Definition at line 91 of file gitfan.cc.
93 gfan::ZCone sigma = gfan::ZCone(gfan::ZMatrix(1,point.size()), gfan::ZMatrix(1,point.size()));
95 for (
int i=0;
i<=cones->
nr;
i++)
97 zc = (gfan::ZCone*) cones->
m[
i].
Data();
98 if (zc->contains(point))
99 sigma = gfan::intersection(sigma,*zc);
◆ subset()
void subset |
( |
std::vector< int > & |
arr, |
|
|
int |
size, |
|
|
int |
left, |
|
|
int |
index, |
|
|
std::vector< int > & |
l, |
|
|
std::vector< std::vector< int > > & |
L |
|
) |
| |
◆ subsets()
Definition at line 565 of file gitfan.cc.
573 int n = (int)(
long) u->
Data();
574 int k = (int)(
long)
v->Data();
575 std::vector<int> array(n);
576 for (
int i=0;
i<n;
i++)
578 std::vector<int> ltemp;
579 std::vector<std::vector<int> > lt;
584 for (
int i=0;
i<lt.size();
i++)
586 std::vector<int> lti = lt[
i];
589 for(
int j=0;
j<lti.size();
j++)
592 Lti->
m[
j].
data = (
void*)(
long)lti[
j];
595 Lt->
m[
i].
data = (
void*) Lti;
599 res->data = (
void*) Lt;
603 WerrorS(
"subsets: unexpected parameter");
BOOLEAN checkSigns(leftv res, leftv args)
BOOLEAN listOfAfacesToCheck(leftv res, leftv args)
void mergeFacets(facets &F, const facets &newFacets)
static gitfan::facets interiorFacets(const gfan::ZCone &zc, const gfan::ZCone &bound)
intvec * intToAface(unsigned int v0, int n, int k)
static int binomial(int n, int k)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
coeffs basecoeffs() const
BOOLEAN binaryToBigint(leftv res, leftv args)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
Class used for (list of) interpreter objects.
void mu(int **points, int sizePoints)
BOOLEAN composeIntvecs(leftv res, leftv args)
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
BOOLEAN findPlaceToInsert(leftv res, leftv args)
gfan::ZVector randomPoint(const gfan::ZCone *zc)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
BOOLEAN inequalities(leftv res, leftv args)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
std::set< facet, facet_compare > facets
BOOLEAN subsets(leftv res, leftv args)
BOOLEAN dimension(leftv res, leftv args)
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
void lambda(int **points, int sizePoints)
static CanonicalForm bound(const CFMatrix &M)
BOOLEAN nextAfaceToCheck(leftv res, leftv args)
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void WerrorS(const char *s)
BOOLEAN refineCones(leftv res, leftv args)
BOOLEAN equations(leftv res, leftv args)
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
const Variable & v
< [in] a sqrfree bivariate poly
INLINE_THIS void Init(int l=0)
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
BOOLEAN ambientDimension(leftv res, leftv args)
int status int void size_t count
void subset(std::vector< int > &arr, int size, int left, int index, std::vector< int > &l, std::vector< std::vector< int > > &L)
static gfan::ZCone subcone(const lists &cones, const gfan::ZVector &point)
bigintmat * iv2bim(intvec *b, const coeffs C)
static int index(p_Length length, p_Ord ord)