Skip to content

Commit

Permalink
Merge pull request #34 from fchapoton/many_typos_fixed
Browse files Browse the repository at this point in the history
fix many typos
  • Loading branch information
mkoeppe authored Nov 30, 2022
2 parents 6dbf7f0 + 983db64 commit 64ebde8
Show file tree
Hide file tree
Showing 43 changed files with 326 additions and 336 deletions.
252 changes: 123 additions & 129 deletions ChangeLog

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions EXAMPLES/cubes/makeCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ struct QuickFraction

/**
* Makes a cube, [0, scale]^n, as a latte facet file.
* @parm filename: output file name
* @parm dim: dim = n from above.
* @parm scale: we scale the unit cube.
* @param filename: output file name
* @param dim: dim = n from above.
* @param scale: we scale the unit cube.
*/
void makeCubeFile(const char *fileName, const long &dim, const QuickFraction& scale)
{
Expand Down
2 changes: 1 addition & 1 deletion README-mpl-files
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ code/maple/m-knapsack.mpl: top knapsack Maple code

--- was the same as $PISA_PAPERS/knapsack/moreKnapsacks/knapsackwithdualdec.14.04.2012.mpl

done: Now replaced by the better verion from https://www.math.ucdavis.edu/~latte/software/packages/m-knapsack.mpl
done: Now replaced by the better version from https://www.math.ucdavis.edu/~latte/software/packages/m-knapsack.mpl

code/latte/top-ehrhart/TopEhrhart_lib.mpl: the SL method for finding top Ehrhart coefficients

Expand Down
4 changes: 2 additions & 2 deletions code/latte/ConeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ ConeInfo::ConeInfo (vec_ZZ *cost, listCone *listCone_pointer, int numOfVars)
Coefficient *= -1;

S_Values[i] *= -1;
// sign is the sign of the orginal dot product
// sign is the sign of the original dot product
signs[i] = 1;

}
Expand Down Expand Up @@ -1374,7 +1374,7 @@ int ConeInfo::Calculate_Integral_Point (vec_ZZ &Temp_Vector)
{
for(int j = 0; j < Number_of_Variables; j++)
{
// sign[] is the sign of the orginal dot product with the cost
// sign[] is the sign of the original dot product with the cost
Temp_Vector[j] -= signs[i] * temp->first[j] * temp_coefficients[i];
}
temp = temp->rest;
Expand Down
2 changes: 1 addition & 1 deletion code/latte/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ConvertCDDextToLatte_LDADD = $(LDADD)


#Run ./valuation/test/integrateHyperrectangleTest.sh
# to start a maple script that will test integration of polynomials over rectangles in many dimentions.
# to start a maple script that will test integration of polynomials over rectangles in many dimensions.
check_PROGRAMS += test-hyperrectangle-integration
test_hyperrectangle_integration_SOURCES = valuation/test/testIntegrationHyperrectanglesDriver.cpp

Expand Down
2 changes: 1 addition & 1 deletion code/latte/buildPolytopes/BuildPolytope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void BuildPolytope::addPoint(vector<mpq_class> onePoint)
* The center command keeps important properties like vertices and facets, but some are
* lost like SIMPLE and SIMPLICIAL.
*
* The origional un-centered polytope is lost. Also, we do not automatically re-read vertex and facet information.
* The original un-centered polytope is lost. Also, we do not automatically re-read vertex and facet information.
*/
void BuildPolytope::centerPolytope()
{
Expand Down
12 changes: 6 additions & 6 deletions code/latte/integration/benchmark.mpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ read("integration/createLinear.mpl"):
# A linear forms is called alpha, it is represented by a vector in Q^d.
# A monomial m is a list of d integers
# A polynomial represented in a sparse way;
# Exemple x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# Example x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# Thus a sparse polynomial is represented as a list of lists.
#
# .
#
# Simplex and multiplicities.
#
# INPUT: d an integer, S list of d+1 lists of lenght d, alpha: list of lenght d .
# INPUT: d an integer, S list of d+1 lists of length d, alpha: list of length d .
# OUTPUT: set of lists {[a_S], [m_S]}
# MATH: S a simplex of dimension d+1, alpha a linear form, m_S is the list of the number of vertices S where <\alpha,S> = a_S.
#
Expand Down Expand Up @@ -136,7 +136,7 @@ L:=[seq([j],j=0..m[1])];fi;
newL;
end:
# INPUT: m a list of integers, coe a number
# OUTPUT: a list of lists of lenght nops(m)
# OUTPUT: a list of lists of length nops(m)
# MATH: The list $m$ represents the monomial x^m=x_1^{m[1]}x_2^{m[2]}\cdots x_d^{m[d].
# The output is a list of lists. Each element in the list represents a linear form ([1,2]=x+2y). The output exausts all the linear form with exponents M=m[1]+..+m[d] which appear when expressing x^m as linear combinations of linear form with exponent M. The first element is the coefficient multiplied by coe;
list_and_coeff_for_monome:=proc(m,coe) local M,L,out:
Expand All @@ -157,9 +157,9 @@ out;
end:
##integral_monome_via_waring([[0,0],[0,1],[1,0]],2,[9,2]);
# Integral of a polynomial via Waring.
# We give a polynomial in a sparse way; Exemple x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# We give a polynomial in a sparse way; Example x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# We start by cleaning the sets for example we replace [[1,[1,2]],[1,[1,2]] by [2,[1,2]];
# Input L; a list of lists [[a,alpha],[b,beta],...]. here a is a number, alpha is a list. The ouptput is
# Input L; a list of lists [[a,alpha],[b,beta],...]. here a is a number, alpha is a list. The output is
# a set of lists.
# If alpha=beta, we replace by [a+b,alpha]; if a=0 we skip;
# The input is a list L of lists [a,\alpha] where a is a number. The output is of the same kind.
Expand Down Expand Up @@ -187,7 +187,7 @@ od;
Y;
end:
# The input is a simplex S, d the dimension, sparse_poly a sparse polynomial.
# The ouput is a number; the integral over S of the polynomial.
# The output is a number; the integral over S of the polynomial.
integral_via_waring:=proc(S,d,sparse_poly) local output,i, L ;output:=0;
L:=list_integral_via_waring(sparse_poly);
for i from 1 to nops(L) do
Expand Down
2 changes: 1 addition & 1 deletion code/latte/integration/burstTrie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,6 @@ class BurstTrie

friend class BTrieIterator<T, S> ;
private:
S* range; //S can be a class or a primitve
S* range; //S can be a class or a primitive
trieElem *firstElem; //first element in the trie
}; //BurstTrie
12 changes: 6 additions & 6 deletions code/latte/integration/integrationTestsLib.mpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ read("integration/createLinear.mpl"):
# A linear forms is called alpha, it is represented by a vector in Q^d.
# A monomial m is a list of d integers
# A polynomial represented in a sparse way;
# Exemple x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# Example x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# Thus a sparse polynomial is represented as a list of lists.
#
# .
#
# Simplex and multiplicities.
#
# INPUT: d an integer, S list of d+1 lists of lenght d, alpha: list of lenght d .
# INPUT: d an integer, S list of d+1 lists of length d, alpha: list of length d .
# OUTPUT: set of lists {[a_S], [m_S]}
# MATH: S a simplex of dimension d+1, alpha a linear form, m_S is the list of the number of vertices S where <\alpha,S> = a_S.
#
Expand Down Expand Up @@ -154,7 +154,7 @@ L:=[seq([j],j=0..m[1])];fi;
newL;
end:
# INPUT: m a list of integers, coe a number
# OUTPUT: a list of lists of lenght nops(m)
# OUTPUT: a list of lists of length nops(m)
# MATH: The list $m$ represents the monomial x^m=x_1^{m[1]}x_2^{m[2]}\cdots x_d^{m[d].
# The output is a list of lists. Each element in the list represents a linear form ([1,2]=x+2y). The output exausts all the linear form with exponents M=m[1]+..+m[d] which appear when expressing x^m as linear combinations of linear form with exponent M. The first element is the coefficient multiplied by coe;
list_and_coeff_for_monome:=proc(m,coe) local M,L,out:
Expand All @@ -175,9 +175,9 @@ out;
end:
##integral_monome_via_waring([[0,0],[0,1],[1,0]],2,[9,2]);
# Integral of a polynomial via Waring.
# We give a polynomial in a sparse way; Exemple x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# We give a polynomial in a sparse way; Example x*y^2+2*x^2 with be given as a list of lists [[1,[1,2]],[2,[2,0]]. Each list represents a monomial with his coefficients.
# We start by cleaning the sets for example we replace [[1,[1,2]],[1,[1,2]] by [2,[1,2]];
# Input L; a list of lists [[a,alpha],[b,beta],...]. here a is a number, alpha is a list. The ouptput is
# Input L; a list of lists [[a,alpha],[b,beta],...]. here a is a number, alpha is a list. The output is
# a set of lists.
# If alpha=beta, we replace by [a+b,alpha]; if a=0 we skip;
# The input is a list L of lists [a,\alpha] where a is a number. The output is of the same kind.
Expand Down Expand Up @@ -205,7 +205,7 @@ od;
Y;
end:
# The input is a simplex S, d the dimension, sparse_poly a sparse polynomial.
# The ouput is a number; the integral over S of the polynomial.
# The output is a number; the integral over S of the polynomial.
integral_via_waring:=proc(S,d,sparse_poly) local output,i, L ;output:=0;
L:=list_integral_via_waring(sparse_poly);
for i from 1 to nops(L) do
Expand Down
6 changes: 3 additions & 3 deletions code/latte/integration/newIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void convertToSimplex(simplexZZ &mySimplex, string line)
/**
* Integrate a simplex over a linear form.
*
* @parm a, b: ouput parameters, we return a/b += integration answer.
* @parm a, b: output parameters, we return a/b += integration answer.
* @parm l: a linear form.
* @parm mySimplex: integer simplex
* @parm m: the power the linear form is raised to
Expand Down Expand Up @@ -340,7 +340,7 @@ RationalNTL integrateLinFormProducts(PolyIterator<RationalNTL, ZZ>* it, const si
++i;
lenM += temp->degree; //add the power

coef *= temp->coef; // M1! M2! ... MD! * (coefficents ^ powers)
coef *= temp->coef; // M1! M2! ... MD! * (coefficients ^ powers)

monomialCount *= (temp->degree+1); //monomialCount = number of monomials (m1, ..., md) <= (deg1, ..., degD).
}
Expand All @@ -364,7 +364,7 @@ RationalNTL integrateLinFormProducts(PolyIterator<RationalNTL, ZZ>* it, const si
//ok, now we just need to find the coeff of M in the polynomial expansion.


vec_ZZ tVector; //the coefficent vector of ( 1- a_1t_1 - ... - a_Dt_D) (we don't save the leading 1)
vec_ZZ tVector; //the coefficient vector of ( 1- a_1t_1 - ... - a_Dt_D) (we don't save the leading 1)
int* counter; //current power n
tVector.SetLength(productCount);
counter = new int[productCount];
Expand Down
2 changes: 1 addition & 1 deletion code/latte/integration/residue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void computeResidueLawrence(const int d, const int M, const LinearLawrenceIntegr
continue; //really, at this point, the power should not be zero. It could be negative if this term is a repeat or positive.
if (coneTerm.rayDotProducts[i].epsilon == 0)
{
//cout << "factored anoter term: " << coneTerm.rayDotProducts[i].constant << "^" << coneTerm.rayDotProducts[i].power << endl;
//cout << "factored another term: " << coneTerm.rayDotProducts[i].constant << "^" << coneTerm.rayDotProducts[i].power << endl;
de *= Power_ZZ(coneTerm.rayDotProducts[i].constant, coneTerm.rayDotProducts[i].power);
continue;
}//factor the constant out: (a + 0*e)^power.
Expand Down
6 changes: 3 additions & 3 deletions code/latte/interpolation/PolynomialInterpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PolynomialInterpolation::PolynomialInterpolation(unsigned int degree):

//A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

//sets matrix(toRow,:) = matirx(toRow,:) - value * matrix(fromRow, :) (matlab syntax)
//sets matrix(toRow,:) = matrix(toRow,:) - value * matrix(fromRow, :) (matlab syntax)
void PolynomialInterpolation::addMultRows(mpq_class &value, int fromRow, int toRow)
{
value.canonicalize();
Expand Down Expand Up @@ -130,11 +130,11 @@ void PolynomialInterpolation::GE()

if(matrix[perfectRow][currentColumn] == 0 )
{
cerr << "GE:assert matirx[perfectRow][currentColumn] != 0" << endl;
cerr << "GE:assert matrix[perfectRow][currentColumn] != 0" << endl;
//cout << "perfectRow = " << perfectRow << ", curCol=" << currentColumn << endl;
//cout << "row, col size=" << rowSize << ", " << colSize << endl;
//printMatrix();
//cout << "origional matirx\n";
//cout << "original matrix\n";
//copy.printMatrix();
exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions code/latte/interpolation/testDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ bool isReduced(mpq_class r)
}//isReduced


/* Randomly generate polynomials, and create the coefficient matirx. Then solves the matrix and
* makes sure the returnd answer is the same as the polynomial we randomly generated.
/* Randomly generate polynomials, and create the coefficient matrix. Then solves the matrix and
* makes sure the returned answer is the same as the polynomial we randomly generated.
*
* The polynomials have a max degree of MAXDEG and each coefficient is negative with prob. PNEG..
* and coefficients are limited by MAXCOEF.
Expand All @@ -114,7 +114,7 @@ void test1Poly()
;

PolynomialInterpolation p(degree);
PolynomialInterpolation pCopy(degree); //pCopy is printed as the origional matrix if there is an error.
PolynomialInterpolation pCopy(degree); //pCopy is printed as the original matrix if there is an error.
vector<mpq_class> allX(degree); //keep track of points added so far.

//insert degree+1 many unique points (x, f(x)).
Expand Down
Loading

0 comments on commit 64ebde8

Please sign in to comment.