rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
identity.__doc__ = projection_func_identity.__doc__
def identity(self): """ Returns the identity projection.
346f358354c345210a872f113663df4917187850 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/346f358354c345210a872f113663df4917187850/polyhedra.py
if any([type(arg).__module__ == 'numpy' for arg in args]):
if any([type(arg).__module__ == 'numpy' and type(arg).__name__ == "ndarray" for arg in args]):
def _call_element_(self, _the_element, *args, **kwds): """ Calling a callable symbolic expression returns a symbolic expression with the appropriate arguments substituted.
d713a2ee3a2614cc5cb1f9d9a674fd9ca17ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/d713a2ee3a2614cc5cb1f9d9a674fd9ca17ae722/callable.py
sage: GenericDeclaration(x, 'rational').contradicts(y==pi) False sage: GenericDeclaration(x, 'rational').contradicts(y==pi)
sage: GenericDeclaration(x, 'rational').contradicts(x==pi) True sage: GenericDeclaration(x, 'irrational').contradicts(x!=pi)
def contradicts(self, soln): """ Returns ``True`` if this assumption is violated by the given variable assignment(s).
7859ba5387ed2155213c43c9144c48a6b39642f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7859ba5387ed2155213c43c9144c48a6b39642f4/assumptions.py
sage: F = e.formal_group().group_law(5); F t1 + O(t1^5) + (1 - 2*t1^4 + O(t1^5))*t2 + (-4*t1^3 + O(t1^5))*t2^2 + (-4*t1^2 - 30*t1^4 + O(t1^5))*t2^3 + (-2*t1 - 30*t1^3 + O(t1^5))*t2^4 + O(t2^5) sage: i = e.formal_group().inverse(5)
sage: e.formal_group().group_law(5) t1 + O(t1^5) + (1 - 2*t1^4 + O(t1^5))*t2 + (-4*t1^3 + O(t1^5))*t2^2 + (-4*t1^2 - 30*t1^4 + O(t1^5))*t2^3 + (-2*t1 - 30*t1^3 + O(t1^5))*t2^4 + O(t2^5) sage: e = EllipticCurve('14a1') sage: ehat = e.formal() sage: ehat.group_law(3) t1 + O(t1^3) + (1 - t1 - 4*t1^2 + O(t1^3))*t2 + (-4*t1 + O(t1^3))*t2^2 + O(t2^3) sage: ehat.group_law(5) t1 + O(t1^5) + (1 - t1 - 2*t1^3 - 32*t1^4 + O(t1^5))*t2 + (-3*t1^2 - 59*t1^3 - 120*t1^4 + O(t1^5))*t2^2 + (-2*t1 - 59*t1^2 - 141*t1^3 - 347*t1^4 + O(t1^5))*t2^3 + (-32*t1 - 120*t1^2 - 347*t1^3 - 951*t1^4 + O(t1^5))*t2^4 + O(t2^5) sage: e = EllipticCurve(GF(7),[3,4]) sage: ehat = e.formal() sage: ehat.group_law(3) t1 + O(t1^3) + (1 + O(t1^3))*t2 + O(t2^3) sage: F = ehat.group_law(7); F t1 + O(t1^7) + (1 + t1^4 + 2*t1^6 + O(t1^7))*t2 + (2*t1^3 + 6*t1^5 + O(t1^7))*t2^2 + (2*t1^2 + 3*t1^4 + 2*t1^6 + O(t1^7))*t2^3 + (t1 + 3*t1^3 + 4*t1^5 + O(t1^7))*t2^4 + (6*t1^2 + 4*t1^4 + O(t1^7))*t2^5 + (2*t1 + 2*t1^3 + O(t1^7))*t2^6 + O(t2^7) TESTS:: sage: i = e.formal_group().inverse(7)
def group_law(self, prec=10): r""" The formal group law.
c7aa7eea76be1d79ce9507df05215e78b7733f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/c7aa7eea76be1d79ce9507df05215e78b7733f00/formal_group.py
O(t^5)
O(t^7)
def group_law(self, prec=10): r""" The formal group law.
c7aa7eea76be1d79ce9507df05215e78b7733f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/c7aa7eea76be1d79ce9507df05215e78b7733f00/formal_group.py
t1 + O(t1^4) + (1 + O(t1^4))*t2 + (-4*t1^3 + O(t1^4))*t2^2 + (-4*t1^2 + O(t1^4))*t2^3 + O(t2^4)
t1 + O(t1^4) + (1 + O(t1^4))*t2 + (2*t1^3 + O(t1^4))*t2^2 + (2*t1^2 + O(t1^4))*t2^3 + O(t2^4) Test for trac ticket 9646:: sage: P.<a1, a2, a3, a4, a6> = PolynomialRing(ZZ, 5) sage: E = EllipticCurve(list(P.gens())) sage: F = E.formal().group_law(prec = 4) sage: t2 = F.parent().gen() sage: t1 = F.parent().base_ring().gen() sage: F(t1, 0) t1 sage: F(0, t2) t2 sage: F[2][1] -a2
def group_law(self, prec=10): r""" The formal group law.
c7aa7eea76be1d79ce9507df05215e78b7733f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/c7aa7eea76be1d79ce9507df05215e78b7733f00/formal_group.py
w = self.w(prec)
w = self.w(prec+1)
def group_law(self, prec=10): r""" The formal group law.
c7aa7eea76be1d79ce9507df05215e78b7733f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/c7aa7eea76be1d79ce9507df05215e78b7733f00/formal_group.py
lam = sum([tsum(n)*w[n] for n in range(3,prec)]) w1 = R1(w, prec)
lam = sum([tsum(n)*w[n] for n in range(3,prec+1)]) w1 = R1(w, prec+1)
def group_law(self, prec=10): r""" The formal group law.
c7aa7eea76be1d79ce9507df05215e78b7733f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/c7aa7eea76be1d79ce9507df05215e78b7733f00/formal_group.py
**NOTE: precision loss if P,Q in the infinite disc INPUT: - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) OUTPUT: the Coleman integrals \int_P^Q w_i for w_i basis elements EXAMPLES: sage: K = pAdicField(11, 5) sage: x = polygen(K) sage: C = HyperellipticCurve(x^5 + 33/16*x^4 + 3/4*x^3 + 3/8*x^2 - 1/4*x + 1/16) sage: P = C.lift_x(2) sage: Q = C.lift_x(3) sage: C.coleman_integrals_on_basis(P, Q) (9*11 + 11^2 + 11^3 + 5*11^4 + O(11^5), 2*11 + 7*11^2 + 4*11^3 + 8*11^4 + O(11^5), 6 + 9*11 + 8*11^3 + 9*11^4 + O(11^5), 6 + 2*11 + 10*11^2 + 8*11^4 + O(11^5)) sage: C.coleman_integrals_on_basis(P, Q, algorithm='teichmuller') (9*11 + 11^2 + 11^3 + 5*11^4 + O(11^5), 2*11 + 7*11^2 + 4*11^3 + 8*11^4 + O(11^5), 6 + 9*11 + 8*11^3 + 9*11^4 + O(11^5), 6 + 2*11 + 10*11^2 + 8*11^4 + O(11^5))
Computes the Coleman integrals on basis differentials INPUT: - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) OUTPUT: the Coleman integrals \int_P^Q w_i for w_i basis elements EXAMPLES: sage: K = pAdicField(11, 5) sage: x = polygen(K) sage: C = HyperellipticCurve(x^5 + 33/16*x^4 + 3/4*x^3 + 3/8*x^2 - 1/4*x + 1/16) sage: P = C.lift_x(2) sage: Q = C.lift_x(3) sage: C.coleman_integrals_on_basis(P, Q) (9*11 + 11^2 + 11^3 + 5*11^4 + O(11^5), 2*11 + 7*11^2 + 4*11^3 + 8*11^4 + O(11^5), 6 + 9*11 + 8*11^3 + 9*11^4 + O(11^5), 6 + 2*11 + 10*11^2 + 8*11^4 + O(11^5)) sage: C.coleman_integrals_on_basis(P, Q, algorithm='teichmuller') (9*11 + 11^2 + 11^3 + 5*11^4 + O(11^5), 2*11 + 7*11^2 + 4*11^3 + 8*11^4 + O(11^5), 6 + 9*11 + 8*11^3 + 9*11^4 + O(11^5), 6 + 2*11 + 10*11^2 + 8*11^4 + O(11^5))
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
dim = 2*self.genus()
prec = K.precision_cap() g = self.genus() dim = 2*g
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
return self.tiny_integrals_on_basis(P,Q)
return self.tiny_integrals_on_basis(P,Q)
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
L = [f(R(PP[0]), R(PP[1])) for f in forms]
L = [f(PP[0], PP[1]) for f in forms]
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
- w differential (if one of P,Q is Weierstrass, w must be odd)
- w differential (if one of P,Q is Weierstrass, w must be odd)
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points)
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
A simple example, integrating dx::
A simple example, integrating dx:
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points)
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
Yet another example::
Yet another example:
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points)
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
sage: HK.coleman_integral(w*x^3,S,P) 2*5^2 + 4*5^3 + 5^6 + 2*5^7 + O(5^8) sage: negP = HK(0,-3) sage: HK.coleman_integral(w, P,negP, algorithm='teichmuller') 2*5^2 + 3*5^3 + 2*5^6 + 4*5^8 + O(5^9) sage: HK.coleman_integral(w, P, negP) 2*5^2 + 3*5^3 + 2*5^6 + 4*5^8 + O(5^9) AUTHORS:
sage: HK.coleman_integral(w*x^3,S,P) 2*5^2 + 4*5^3 + 5^6 + 2*5^7 + O(5^8) sage: negP = HK(0,-3) sage: HK.coleman_integral(w, P,negP, algorithm='teichmuller') 2*5^2 + 3*5^3 + 2*5^6 + 4*5^8 + O(5^9) sage: HK.coleman_integral(w, P, negP) 2*5^2 + 3*5^3 + 2*5^6 + 4*5^8 + O(5^9) AUTHORS:
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points)
aeeebfda8d78e5e3ab59577b4a6c5022a19143dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/aeeebfda8d78e5e3ab59577b4a6c5022a19143dd/hyperelliptic_padic_field.py
The log function also works in finite fields as long as the base is generator of the multiplicative group::
The log function also works in finite fields as long as the argument lies in the multiplicative group generated by the base::
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024, 2); RDF(log(1024, 2)) 10 10.0 sage: log(10, 4); RDF(log(10, 4)) log(10)/log(4) 1.66096404744 :: sage: log(10, 2) log(10)/log(2) sage: n(log(10, 2)) 3.32192809488736 sage: log(10, e) log(10) sage: n(log(10, e)) 2.30258509299405 The log function works for negative numbers, complex numbers, and symbolic numbers too, picking the branch with angle between `-pi` and `pi`:: sage: log(-1+0*I) I*pi sage: log(CC(-1)) 3.14159265358979*I sage: log(-1.0) 3.14159265358979*I For input zero, the following behavior occurs:: sage: log(0) -Infinity sage: log(CC(0)) -infinity sage: log(0.0) -infinity The log function also works in finite fields as long as the base is generator of the multiplicative group:: sage: F = GF(13); g = F.multiplicative_generator(); g 2 sage: a = F(8) sage: log(a,g); g^log(a,g) 3 8 sage: log(a,3) Traceback (most recent call last): ... ValueError: base (=3) for discrete log must generate multiplicative group The log function also works for p-adics (see documentation for p-adics for more information):: sage: R = Zp(5); R 5-adic Ring with capped relative precision 20 sage: a = R(16); a 1 + 3*5 + O(5^20) sage: log(a) 3*5 + 3*5^2 + 3*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 2*5^8 + 5^9 + 5^11 + 2*5^12 + 5^13 + 3*5^15 + 2*5^16 + 4*5^17 + 3*5^18 + 3*5^19 + O(5^20) """ if base is None: try: return x.log() except AttributeError: return ln(x) else: try: return x.log(base) except (AttributeError, TypeError): return log(x) / log(base)
db3f4166fbbf82872c09eda0cb3c4b1d11c95dcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/db3f4166fbbf82872c09eda0cb3c4b1d11c95dcf/log.py
ValueError: base (=3) for discrete log must generate multiplicative group
ValueError: No discrete log of 8 found to base 3 sage: log(F(9), 3) 2
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024, 2); RDF(log(1024, 2)) 10 10.0 sage: log(10, 4); RDF(log(10, 4)) log(10)/log(4) 1.66096404744 :: sage: log(10, 2) log(10)/log(2) sage: n(log(10, 2)) 3.32192809488736 sage: log(10, e) log(10) sage: n(log(10, e)) 2.30258509299405 The log function works for negative numbers, complex numbers, and symbolic numbers too, picking the branch with angle between `-pi` and `pi`:: sage: log(-1+0*I) I*pi sage: log(CC(-1)) 3.14159265358979*I sage: log(-1.0) 3.14159265358979*I For input zero, the following behavior occurs:: sage: log(0) -Infinity sage: log(CC(0)) -infinity sage: log(0.0) -infinity The log function also works in finite fields as long as the base is generator of the multiplicative group:: sage: F = GF(13); g = F.multiplicative_generator(); g 2 sage: a = F(8) sage: log(a,g); g^log(a,g) 3 8 sage: log(a,3) Traceback (most recent call last): ... ValueError: base (=3) for discrete log must generate multiplicative group The log function also works for p-adics (see documentation for p-adics for more information):: sage: R = Zp(5); R 5-adic Ring with capped relative precision 20 sage: a = R(16); a 1 + 3*5 + O(5^20) sage: log(a) 3*5 + 3*5^2 + 3*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 2*5^8 + 5^9 + 5^11 + 2*5^12 + 5^13 + 3*5^15 + 2*5^16 + 4*5^17 + 3*5^18 + 3*5^19 + O(5^20) """ if base is None: try: return x.log() except AttributeError: return ln(x) else: try: return x.log(base) except (AttributeError, TypeError): return log(x) / log(base)
db3f4166fbbf82872c09eda0cb3c4b1d11c95dcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/db3f4166fbbf82872c09eda0cb3c4b1d11c95dcf/log.py
Returns the tableau object corresponding to t.
Returns the tableau object corresponding to t. A tableau in sage is a finite list of lists, whose lengths are weakly decreasing, or an empty list, representing the empty tableau. The entries of a tableau can be any sage object.
def Tableau(t): """ Returns the tableau object corresponding to t. Note that Sage uses the English convention for partitions and tableaux. EXAMPLES:: sage: t = Tableau([[1,2,3],[4,5]]); t [[1, 2, 3], [4, 5]] sage: t.shape() [3, 2] sage: t.is_standard() True """ if isinstance(t, Tableau_class): return t elif t in Tableaux_all(): return Tableau_class(t) raise ValueError, "invalid tableau"
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
self that are filled with a number less than
self that are filled with a number less than `n`.
def anti_restrict(self, n): """ Returns the skew tableau formed by removing all of the cells from self that are filled with a number less than
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
adding a cell. EXAMPLES::
adding a cell. EXAMPLES::
def up(self): """ An iterator for all the tableaux that can be obtained from self by adding a cell. EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
then it returns the combinatorial class of all tableaux of size n.
then it returns the combinatorial class of all tableaux of size n. A tableau in sage is a finite list of lists, whose lengths are weakly decreasing. The entries can be anything at all.
def Tableaux(n=None): """ Returns the combinatorial class of tableaux. If n is specified, then it returns the combinatorial class of all tableaux of size n. EXAMPLES:: sage: T = Tableaux(); T Tableaux sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T True sage: [1,2,3] in T False :: sage: T = Tableaux(4); T Tableaux of size 4 sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T False sage: [1,2,3] in T False """ if n == None: return Tableaux_all() else: return Tableaux_n(n)
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
sage: [1,2,3] in T False
def Tableaux(n=None): """ Returns the combinatorial class of tableaux. If n is specified, then it returns the combinatorial class of all tableaux of size n. EXAMPLES:: sage: T = Tableaux(); T Tableaux sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T True sage: [1,2,3] in T False :: sage: T = Tableaux(4); T Tableaux of size 4 sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T False sage: [1,2,3] in T False """ if n == None: return Tableaux_all() else: return Tableaux_n(n)
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def SemistandardTableaux(p=None, mu=None):
def SemistandardTableaux(p=None, mu=None, max_entry=None):
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
semistandard tableaux of shape p (and max entry sum(p))
semistandard tableaux of shape p.
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
If mu is also specified, then it returns the class of semistandard
If mu is specified, then it returns the class of semistandard
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
Semistandard tableaux of shape [2, 1]
Semistandard tableaux of shape [2, 1] and maximum entry 3
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
::
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
Semistandard tableaux of size 3
Semistandard tableaux of size 3 and maximum entry 3
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
if p == None: return SemistandardTableaux_all()
is_inf = max_entry is PlusInfinity() if max_entry is not None and not is_inf: if not isinstance(max_entry, (int, Integer)): raise ValueError, "max_entry must be an integer" elif max_entry < 0: raise ValueError, "max_entry must be non-negative" if p is None: if mu is None: return SemistandardTableaux_all(max_entry) else: return SemistandardTableaux_nmu(sum(mu), mu)
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
if mu == None: return SemistandardTableaux_p(p)
if mu is None: if is_inf: if sum(p) != 0: return SemistandardTableaux_p_inf(p) else: return SemistandardTableaux_p(p) else: return SemistandardTableaux_p(p, max_entry)
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
if mu == None: return SemistandardTableaux_n(p)
if p >= 0: if mu is None: if is_inf: if p != 0: return SemistandardTableaux_n_inf(p) else: return SemistandardTableaux_n(p) else: return SemistandardTableaux_n(p, max_entry) else: if p != sum(mu): raise ValueError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu)
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
if p != sum(mu): raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu)
raise ValueError, "p must be non-negative"
def SemistandardTableaux(p=None, mu=None): """ Returns the combinatorial class of semistandard tableaux. If p is specified and is a partition, then it returns the class of semistandard tableaux of shape p (and max entry sum(p)) If p is specified and is an integer, it returns the class of semistandard tableaux of size p. If mu is also specified, then it returns the class of semistandard tableaux with evaluation/content mu. EXAMPLES:: sage: SST = SemistandardTableaux([2,1]); SST Semistandard tableaux of shape [2, 1] sage: SST.list() [[[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]]] :: sage: SST = SemistandardTableaux(3); SST Semistandard tableaux of size 3 sage: SST.list() [[[1, 1, 1]], [[1, 1, 2]], [[1, 1, 3]], [[1, 2, 2]], [[1, 2, 3]], [[1, 3, 3]], [[2, 2, 2]], [[2, 2, 3]], [[2, 3, 3]], [[3, 3, 3]], [[1, 1], [2]], [[1, 1], [3]], [[1, 2], [2]], [[1, 2], [3]], [[1, 3], [2]], [[1, 3], [3]], [[2, 2], [3]], [[2, 3], [3]], [[1], [2], [3]]] """ if p == None: return SemistandardTableaux_all() elif p in partition.Partitions(): if mu == None: return SemistandardTableaux_p(p) else: if sum(p) != sum(mu): #Error size mismatch raise TypeError, "p and mu must be of the same size" else: return SemistandardTableaux_pmu(p, mu) elif isinstance(p, (int, Integer)): if mu == None: return SemistandardTableaux_n(p) else: if p != sum(mu): #Error size mismatch raise TypeError, "mu must be of size p (= %s)"%p else: return SemistandardTableaux_nmu(p, mu) else: raise ValueError
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __init__(self):
def __init__(self, max_entry=None):
def __init__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
"""
sage: SST = SemistandardTableaux(max_entry=5) sage: SST == loads(dumps(SST)) True """ self.max_entry = None if max_entry is not PlusInfinity(): self.max_entry = max_entry def _repr_(self): """ TESTS:: sage: SST = SemistandardTableaux() sage: SST Semistandard tableaux sage: SemistandardTableaux(max_entry=3) Semistandard tableaux with maximum entry 3 """ if self.max_entry is not None: return "Semistandard tableaux with maximum entry %s"%str(self.max_entry) return "Semistandard tableaux"
def __init__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
sage: [[1,1],[2]] in SemistandardTableaux() True """
sage: [[1,1],[5]] in SemistandardTableaux(max_entry=4) False """
def __contains__(self, x): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
for row in t: for i in row: if not isinstance(i, (int, Integer)):
for i, row in enumerate(t): for j, entry in enumerate(row): if not isinstance(entry, (int, Integer)):
def __contains__(self, x): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
for row in t: for i in range(1, len(row)): if row[i] < row[i-1]:
if j > 0 and entry < row[j-1]:
def __contains__(self, x): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
conj = t.conjugate() for row in conj: for i in range(1, len(row)): if row[i] <= row[i-1]:
if i > 0 and entry <= t[i-1][j]:
def __contains__(self, x): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __init__(self, n):
def __init__(self, n, max_entry=None):
def __init__(self, n): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
self.max_entry = None if max_entry is None: self.max_entry = n else: self.max_entry = max_entry def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
'Semistandard tableaux of size 3' """ return "Semistandard tableaux of size %s"%str(self.n)
'Semistandard tableaux of size 3 and maximum entry 3' sage: repr(SemistandardTableaux(3, max_entry=6)) 'Semistandard tableaux of size 3 and maximum entry 6' """ return "Semistandard tableaux of size %s and maximum entry %s"%(str(self.n), str(self.max_entry))
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
return x in SemistandardTableaux() and sum(map(len, x)) == self.n
return x in SemistandardTableaux_all(self.max_entry) and sum(map(len, x)) == self.n
def __contains__(self, x): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
c += SemistandardTableaux(part).cardinality()
c += SemistandardTableaux_p(part, self.max_entry).cardinality()
def cardinality(self): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
for sst in SemistandardTableaux(part):
for sst in SemistandardTableaux_p(part, self.max_entry):
def __iter__(self): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
def _repr_(self):
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
if not x in SemistandardTableaux(self.p):
if x not in SemistandardTableaux_p(self.p, self.max_entry):
def __contains__(self, x): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __init__(self, p):
def __init__(self, p, max_entry=None):
def __init__(self, p): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
""" return x in SemistandardTableaux_all() and map(len, x) == self.p def __repr__(self):
sage: SST = SemistandardTableaux([2,1], max_entry=4) sage: all([sst in SST for sst in SST]) True sage: SST.cardinality() 20 """ return x in SemistandardTableaux_all(self.max_entry) and map(len, x) == self.p def _repr_(self):
def __contains__(self, x): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
'Semistandard tableaux of shape [2, 1]' """ return "Semistandard tableaux of shape %s" % str(self.p)
'Semistandard tableaux of shape [2, 1] and maximum entry 3' sage: repr(SemistandardTableaux([2,1], max_entry=5)) 'Semistandard tableaux of shape [2, 1] and maximum entry 5' """ return "Semistandard tableaux of shape %s and maximum entry %s" %(str(self.p), str(self.max_entry))
def __repr__(self): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
for comp in IntegerVectors(sum(self.p), sum(self.p)):
for comp in IntegerVectors(sum(self.p), self.max_entry):
def cardinality(self): """ EXAMPLES::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
""" for c in IntegerVectors(sum(self.p), sum(self.p)): for sst in SemistandardTableaux(self.p, c):
sage: [ t for t in SemistandardTableaux([1,1,1], max_entry=4) ] [[[1], [2], [3]], [[1], [2], [4]], [[1], [3], [4]], [[2], [3], [4]]] """ for c in IntegerVectors(sum(self.p), self.max_entry): for sst in SemistandardTableaux_pmu(self.p, c):
def __iter__(self): """ An iterator for the semistandard partitions of shape p.
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def __repr__(self):
self.max_entry = len(mu) def _repr_(self):
def __init__(self, n, mu): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
return x in SemistandardTableaux_all() and x in SemistandardTableaux(map(len, x), self.mu)
return x in SemistandardTableaux_pmu(map(len, x), self.mu)
def __contains__(self, x): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
def _limit_latex_(*args):
def _limit_latex_(self, f, x, a):
def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-15) """ # Read f,x,a from arguments f = args[0] x = args[1] a = args[2] return "\\lim_{%s \\to %s}\\, %s"%(latex(x), latex(a), latex(f))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a)
sage: f = function('f',x) sage: _limit_latex_(0, f, x, a)
def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-15) """ # Read f,x,a from arguments f = args[0] x = args[1] a = args[2] return "\\lim_{%s \\to %s}\\, %s"%(latex(x), latex(a), latex(f))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
f = args[0] x = args[1] a = args[2]
def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-15) """ # Read f,x,a from arguments f = args[0] x = args[1] a = args[2] return "\\lim_{%s \\to %s}\\, %s"%(latex(x), latex(a), latex(f))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
def _integrate_latex_(*args):
def _integrate_latex_(self, f, x, *args):
def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f(x),x,a,b) '\\int_{a}^{b} f\\left(x\\right)\\,{d x}' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ f = args[0] x = args[1] # Check whether its a definite integral if len(args) == 4: a = args[2] b = args[3] return "\\int_{%s}^{%s} %s\\,{d %s}"%(latex(a), latex(b), latex(f), latex(x)) # Typeset as indefinite integral return "\\int %s\\,{d %s}"%(latex(f), latex(x))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x)
sage: f = function('f',x) sage: _integrate_latex_(0,f,x)
def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f(x),x,a,b) '\\int_{a}^{b} f\\left(x\\right)\\,{d x}' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ f = args[0] x = args[1] # Check whether its a definite integral if len(args) == 4: a = args[2] b = args[3] return "\\int_{%s}^{%s} %s\\,{d %s}"%(latex(a), latex(b), latex(f), latex(x)) # Typeset as indefinite integral return "\\int %s\\,{d %s}"%(latex(f), latex(x))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
sage: _integrate_latex_(f(x),x,a,b)
sage: _integrate_latex_(0,f,x,a,b)
def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f(x),x,a,b) '\\int_{a}^{b} f\\left(x\\right)\\,{d x}' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ f = args[0] x = args[1] # Check whether its a definite integral if len(args) == 4: a = args[2] b = args[3] return "\\int_{%s}^{%s} %s\\,{d %s}"%(latex(a), latex(b), latex(f), latex(x)) # Typeset as indefinite integral return "\\int %s\\,{d %s}"%(latex(f), latex(x))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
f = args[0] x = args[1]
def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f(x),x,a,b) '\\int_{a}^{b} f\\left(x\\right)\\,{d x}' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ f = args[0] x = args[1] # Check whether its a definite integral if len(args) == 4: a = args[2] b = args[3] return "\\int_{%s}^{%s} %s\\,{d %s}"%(latex(a), latex(b), latex(f), latex(x)) # Typeset as indefinite integral return "\\int %s\\,{d %s}"%(latex(f), latex(x))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
if len(args) == 4: a = args[2] b = args[3]
if len(args) == 2: a, b = args
def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f(x),x,a,b) '\\int_{a}^{b} f\\left(x\\right)\\,{d x}' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ f = args[0] x = args[1] # Check whether its a definite integral if len(args) == 4: a = args[2] b = args[3] return "\\int_{%s}^{%s} %s\\,{d %s}"%(latex(a), latex(b), latex(f), latex(x)) # Typeset as indefinite integral return "\\int %s\\,{d %s}"%(latex(f), latex(x))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
def _laplace_latex_(*args):
def _laplace_latex_(self, *args):
def _laplace_latex_(*args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ return "\\mathcal{L}\\left(%s\\right)"%(', '.join([latex(x) for x in args]))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s)
sage: f = function('f',t) sage: _laplace_latex_(0,f,t,s)
def _laplace_latex_(*args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ return "\\mathcal{L}\\left(%s\\right)"%(', '.join([latex(x) for x in args]))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
def _inverse_laplace_latex_(*args):
def _inverse_laplace_latex_(self, *args):
def _inverse_laplace_latex_(*args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t) '\\mathcal{L}^{-1}\\left(F\\left(s\\right), s, t\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ return "\\mathcal{L}^{-1}\\left(%s\\right)"%(', '.join([latex(x) for x in args]))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t)
sage: F = function('F',s) sage: _inverse_laplace_latex_(0,F,s,t)
def _inverse_laplace_latex_(*args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t) '\\mathcal{L}^{-1}\\left(F\\left(s\\right), s, t\\right)' AUTHORS: - Golam Mortuza Hossain (2009-06-22) """ return "\\mathcal{L}^{-1}\\left(%s\\right)"%(', '.join([latex(x) for x in args]))
acf862616c491eaa6eff0382681451ce96478191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/acf862616c491eaa6eff0382681451ce96478191/calculus.py
"""
Multi-edged and looped graphs are partially supported:: sage: G = Graph({0:[1,1]}, multiedges=True) sage: G.is_planar() True sage: G.is_planar(on_embedding={}) Traceback (most recent call last): ... NotImplementedError: Cannot compute with embeddings of multiple-edged or looped graphs. sage: G.is_planar(set_pos=True) Traceback (most recent call last): ... NotImplementedError: Cannot compute with embeddings of multiple-edged or looped graphs. sage: G.is_planar(set_embedding=True) Traceback (most recent call last): ... NotImplementedError: Cannot compute with embeddings of multiple-edged or looped graphs. sage: G.is_planar(kuratowski=True) (True, None) :: sage: G = graphs.CompleteGraph(5) sage: G = Graph(G, multiedges=True) sage: G.add_edge(0,1) sage: G.is_planar() False sage: b,k = G.is_planar(kuratowski=True) sage: b False sage: k.vertices() [0, 1, 2, 3, 4] """ if self.has_multiple_edges() or self.has_loops(): if set_embedding or (on_embedding is not None) or set_pos: raise NotImplementedError("Cannot compute with embeddings of multiple-edged or looped graphs.") else: return self.to_simple().is_planar(kuratowski=kuratowski)
def is_planar(self, on_embedding=None, kuratowski=False, set_embedding=False, set_pos=False): """ Returns True if the graph is planar, and False otherwise. This wraps the reference implementation provided by John Boyer of the linear time planarity algorithm by edge addition due to Boyer Myrvold. (See reference code in graphs.planarity).
7d54da166da182a6a30e6d3b7f13d48ae6572ca8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7d54da166da182a6a30e6d3b7f13d48ae6572ca8/generic_graph.py
bound = ZZ(floor(bound))
bound = ZZ(floor(max(bound, 0)))
def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all vectors of length i. Reference: This is a slightly modified version of Cohn's Algorithm 2.7.5 in "A Course in Computational Number Theory", with the increment step moved around and slightly re-indexed to allow clean looping. Note: We could speed this up for very skew matrices by using LLL first, and then changing coordinates back, but for our purposes the simpler method is efficient enough. =) EXAMPLES: sage: Q = DiagonalQuadraticForm(ZZ, [1,1]) sage: Q.vectors_by_length(5) [[[0, 0]], [[0, -1], [-1, 0]], [[-1, -1], [1, -1]], [], [[0, -2], [-2, 0]], [[-1, -2], [1, -2], [-2, -1], [2, -1]]] sage: Q1 = DiagonalQuadraticForm(ZZ, [1,3,5,7]) sage: Q1.vectors_by_length(5) [[[0, 0, 0, 0]], [[-1, 0, 0, 0]], [], [[0, -1, 0, 0]], [[-1, -1, 0, 0], [1, -1, 0, 0], [-2, 0, 0, 0]], [[0, 0, -1, 0]]] sage: Q = QuadraticForm(ZZ, 4, [1,1,1,1, 1,0,0, 1,0, 1]) sage: map(len, Q.vectors_by_length(2)) [1, 12, 12] """ # pari uses eps = 1e-6 ; nothing bad should happen if eps is too big # but if eps is too small, roundoff errors may knock off some # vectors of norm = bound (see #7100) eps = RDF(1e-6) bound = ZZ(floor(bound)) Theta_Precision = bound + eps n = self.dim() ## Make the vector of vectors which have a given value ## (So theta_vec[i] will have all vectors v with Q(v) = i.) theta_vec = [[] for i in range(bound + 1)] ## Initialize Q with zeros and Copy the Cholesky array into Q Q = self.cholesky_decomposition() ## 1. Initialize T = n * [RDF(0)] ## Note: We index the entries as 0 --> n-1 U = n * [RDF(0)] i = n-1 T[i] = RDF(Theta_Precision) U[i] = RDF(0) L = n * [0] x = n * [0] Z = RDF(0) ## 2. Compute bounds Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() done_flag = False Q_val_double = RDF(0) Q_val = 0 ## WARNING: Still need a good way of checking overflow for this value... ## Big loop which runs through all vectors while not done_flag: ## 3b. Main loop -- try to generate a complete vector x (when i=0) while (i > 0): #print " i = ", i #print " T[i] = ", T[i] #print " Q[i][i] = ", Q[i][i] #print " x[i] = ", x[i] #print " U[i] = ", U[i] #print " x[i] + U[i] = ", (x[i] + U[i]) #print " T[i-1] = ", T[i-1] T[i-1] = T[i] - Q[i][i] * (x[i] + U[i]) * (x[i] + U[i]) #print " T[i-1] = ", T[i-1] #print " x = ", x #print i = i - 1 U[i] = 0 for j in range(i+1, n): U[i] = U[i] + Q[i][j] * x[j] ## Now go back and compute the bounds... ## 2. Compute bounds Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() ## 4. Solution found (This happens when i = 0) #print "-- Solution found! --" #print " x = ", x #print " Q_val = Q(x) = ", Q_val Q_val_double = Theta_Precision - T[0] + Q[0][0] * (x[0] + U[0]) * (x[0] + U[0]) Q_val = Q_val_double.round() ## SANITY CHECK: Roundoff Error is < 0.001 if abs(Q_val_double - Q_val) > 0.001: print " x = ", x print " Float = ", Q_val_double, " Long = ", Q_val raise RuntimeError, "The roundoff error is bigger than 0.001, so we should use more precision somewhere..." #print " Float = ", Q_val_double, " Long = ", Q_val, " XX " #print " The float value is ", Q_val_double #print " The associated long value is ", Q_val if (Q_val <= bound): #print " Have vector ", x, " with value ", Q_val theta_vec[Q_val].append(deepcopy(x)) ## 5. Check if x = 0, for exit condition. =) j = 0 done_flag = True while (j < n): if (x[j] != 0): done_flag = False j += 1 ## 3a. Increment (and carry if we go out of bounds) x[i] += 1 while (x[i] > L[i]) and (i < n-1): i += 1 x[i] += 1 #print " Leaving ThetaVectors()" return theta_vec
8105e1955b7912deb007395dadc8507d188eae9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/8105e1955b7912deb007395dadc8507d188eae9f/quadratic_form__split_local_covering.py
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
def dimension(self): r""" Returns the dimension of this code.
4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py
Returns the Duursama data `v` and `m` of this formally s.d. code `C`
Returns the Duursma data `v` and `m` of this formally s.d. code `C`
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd.
4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py
- Pair ``(v, m)`` as in Duursama [D]_
- Pair ``(v, m)`` as in Duursma [D]_
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd.
4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py
- [D] - I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
.. [D] I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd.
4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursma [D]_
def sd_duursma_q(C,i,d0): r""" INPUT:
4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py
return (self._sublattice_polytope.facet_constant(i) - self.facet_normal(i) * self._shift_vector)
return (self._sublattice_polytope.facet_constant(i) * self._dual_embedding_scale - self.facet_normal(i) * self._shift_vector )
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope.
932bd35ad838991f126bbb2abc2f2cbab4ee40bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/932bd35ad838991f126bbb2abc2f2cbab4ee40bd/lattice_polytope.py
return (self._embedding_matrix * self._sublattice_polytope.facet_normal(i))
return ( self._sublattice_polytope.facet_normal(i) * self._dual_embedding_matrix )
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope.
932bd35ad838991f126bbb2abc2f2cbab4ee40bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/932bd35ad838991f126bbb2abc2f2cbab4ee40bd/lattice_polytope.py
def _compute_dim(self, compute_vertices): r""" Compute the dimension of this polytope and its vertices, if necessary.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
basis = matrix( M.columns() + M.integer_kernel().basis() ).transpose() self._dual_embedding_scale = basis.det()
basis = M.columns() + M.integer_kernel().basis() basis = matrix(basis).transpose() self._dual_embedding_scale = abs(basis.det())
def _compute_dim(self, compute_vertices): r""" Compute the dimension of this polytope and its vertices, if necessary.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
A lattice polytope of strictly smaller dimension (=2) than the ambient dimension(=4):: sage: LatticePolytope(matrix([(1, -1, 0), (-1, -1, 0), (1, 1, 0), (3, 3, 0)]))
This is a 2-dimensional lattice polytope in a 4-dimensional space:: sage: m = matrix([(1,-1,1,3), (-1,-1,1,3), (0,0,0,0)]) sage: p = LatticePolytope(m.transpose()) sage: p
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
sage: lp = LatticePolytope(matrix([(1, -1, 0), (-1, -1, 0), (1, 1, 0), (3, 3, 0)])) sage: lp.vertices()
sage: p.vertices()
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
sage: matrix([[ lp.facet_normal(i)*lp.vertex(j) + lp.facet_constant(i) for i in range(0,3)] for j in range(0,3)]) [-22 0 0] [ 0 -22 0] [ 0 0 -11]
sage: fns = [p.facet_normal(i) for i in range(p.nfacets())] sage: fns [(11, -1, 1, 3), (-11, -1, 1, 3), (0, 1, -1, -3)] sage: fcs = [p.facet_constant(i) for i in range(p.nfacets())] sage: fcs [0, 0, 11] Now we manually compute the distance matrix of this polytope. Since it is a triangle, each line (corresponding to a facet) should have two zeros (vertices of the corresponding facet) and one positive number (since our normals are inner):: sage: matrix([[fns[i] * p.vertex(j) + fcs[i] ... for j in range(p.nvertices())] ... for i in range(p.nfacets())]) [22 0 0] [ 0 22 0] [ 0 0 11]
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
return (self._sublattice_polytope.facet_constant(i) * self._dual_embedding_scale - self.facet_normal(i) * self._shift_vector )
return (self._sublattice_polytope.facet_constant(i) * self._dual_embedding_scale - self.facet_normal(i) * self._shift_vector)
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
parallel to the affine subspace spanned by this polytope.
orthogonal to the integer kernel of the affine subspace spanned by this polytope.
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
Here is an example of a 3-dimensional polytope in 4d:: sage: lp = LatticePolytope(matrix([[1,1,-1,0],[1,-1,-1,0],[1,1,1,0],[3,3,3,0]])) sage: lp.vertices() [ 1 1 -1 0] [ 1 -1 -1 0] [ 1 1 1 0] [ 3 3 3 0] sage: ker = lp.vertices().integer_kernel().matrix()
Here is an example of a 3-dimensional polytope in a 4-dimensional space:: sage: m = matrix([(0,0,0,0), (1,1,1,3), (1,-1,1,3), (-1,-1,1,3)]) sage: p = LatticePolytope(m.transpose()) sage: p.vertices() [ 0 1 1 -1] [ 0 1 -1 -1] [ 0 1 1 1] [ 0 3 3 3] sage: ker = p.vertices().integer_kernel().matrix()
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
sage: [ ker * lp.facet_normal(i) for i in range(0,4) ]
sage: [ker * p.facet_normal(i) for i in range(p.nfacets())]
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
sage: matrix([lp.facet_normal(i) for i in range(0,4)]) * lp.vertices() [ 0 0 -20 0] [ 0 -20 0 0] [ 10 10 10 0] [-20 0 0 0] sage: matrix([[ lp.facet_normal(i)*lp.vertex(j) + lp.facet_constant(i) for i in range(0,4)] for j in range(0,4)]) [ 0 0 0 -20] [ 0 -20 0 0] [-20 0 0 0] [ 0 0 -10 0]
Now we manually compute the distance matrix of this polytope. Since it is a simplex, each line (corresponding to a facet) should consist of zeros (indicating generating vertices of the corresponding facet) and a single positive number (since our normals are inner):: sage: matrix([[p.facet_normal(i) * p.vertex(j) ... + p.facet_constant(i) ... for j in range(p.nvertices())] ... for i in range(p.nfacets())]) [ 0 0 0 20] [ 0 0 20 0] [ 0 20 0 0] [10 0 0 0]
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope.
296def7a4013d5610bd3a89a42f5337a6a660682 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/296def7a4013d5610bd3a89a42f5337a6a660682/lattice_polytope.py
A decorator which renames keyword arguments and optionally deprecates the new keyword.
A decorator which renames keyword arguments and optionally deprecates the new keyword.
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword.
4fefd74f08c023b33b21807df9c72a06181743ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4fefd74f08c023b33b21807df9c72a06181743ed/misc.py
- ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyword arguments in the form ``renamed_option='existing_option'``. This will have the effect of renaming ``renamed_option`` so that the function only sees ``existing_option``. If both ``renamed_option`` and ``existing_option`` are passed to the function, ``existing_option``
- ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyword arguments in the form ``renamed_option='existing_option'``. This will have the effect of renaming ``renamed_option`` so that the function only sees ``existing_option``. If both ``renamed_option`` and ``existing_option`` are passed to the function, ``existing_option``
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword.
4fefd74f08c023b33b21807df9c72a06181743ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4fefd74f08c023b33b21807df9c72a06181743ed/misc.py
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword.
4fefd74f08c023b33b21807df9c72a06181743ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4fefd74f08c023b33b21807df9c72a06181743ed/misc.py
""" Theta_Precision = bound
sage: Q = QuadraticForm(ZZ, 4, [1,1,1,1, 1,0,0, 1,0, 1]) sage: map(len, Q.vectors_by_length(2)) [1, 12, 12] """ eps = RDF(1e-6) bound = ZZ(floor(bound)) Theta_Precision = bound + eps
def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all vectors of length i. Reference: This is a slightly modified version of Cohn's Algorithm 2.7.5 in "A Course in Computational Number Theory", with the increment step moved around and slightly re-indexed to allow clean looping. Note: We could speed this up for very skew matrices by using LLL first, and then changing coordinates back, but for our purposes the simpler method is efficient enough. =) EXAMPLES: sage: Q = DiagonalQuadraticForm(ZZ, [1,1]) sage: Q.vectors_by_length(5) [[[0, 0]], [[0, -1], [-1, 0]], [[-1, -1], [1, -1]], [], [[0, -2], [-2, 0]], [[-1, -2], [1, -2], [-2, -1], [2, -1]]] sage: Q1 = DiagonalQuadraticForm(ZZ, [1,3,5,7]) sage: Q1.vectors_by_length(5) [[[0, 0, 0, 0]], [[-1, 0, 0, 0]], [], [[0, -1, 0, 0]], [[-1, -1, 0, 0], [1, -1, 0, 0], [-2, 0, 0, 0]], [[0, 0, -1, 0]]] """ Theta_Precision = bound ## Unsigned long n = self.dim() ## Make the vector of vectors which have a given value ## (So theta_vec[i] will have all vectors v with Q(v) = i.) empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)] ## Initialize Q with zeros and Copy the Cholesky array into Q Q = self.cholesky_decomposition() ## 1. Initialize T = n * [RDF(0)] ## Note: We index the entries as 0 --> n-1 U = n * [RDF(0)] i = n-1 T[i] = RDF(Theta_Precision) U[i] = RDF(0) L = n * [0] x = n * [0] Z = RDF(0) ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) done_flag = False Q_val_double = RDF(0) Q_val = 0 ## WARNING: Still need a good way of checking overflow for this value... ## Big loop which runs through all vectors while not done_flag: ## 3b. Main loop -- try to generate a complete vector x (when i=0) while (i > 0): #print " i = ", i #print " T[i] = ", T[i] #print " Q[i][i] = ", Q[i][i] #print " x[i] = ", x[i] #print " U[i] = ", U[i] #print " x[i] + U[i] = ", (x[i] + U[i]) #print " T[i-1] = ", T[i-1] T[i-1] = T[i] - Q[i][i] * (x[i] + U[i]) * (x[i] + U[i]) #print " T[i-1] = ", T[i-1] #print " x = ", x #print i = i - 1 U[i] = 0 for j in range(i+1, n): U[i] = U[i] + Q[i][j] * x[j] ## Now go back and compute the bounds... ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) ## 4. Solution found (This happens when i = 0) #print "-- Solution found! --" #print " x = ", x #print " Q_val = Q(x) = ", Q_val Q_val_double = Theta_Precision - T[0] + Q[0][0] * (x[0] + U[0]) * (x[0] + U[0]) Q_val = ZZ(floor(round(Q_val_double))) ## SANITY CHECK: Roundoff Error is < 0.001 if abs(Q_val_double - Q_val) > 0.001: print " x = ", x print " Float = ", Q_val_double, " Long = ", Q_val raise RuntimeError, "The roundoff error is bigger than 0.001, so we should use more precision somewhere..." #print " Float = ", Q_val_double, " Long = ", Q_val, " XX " #print " The float value is ", Q_val_double #print " The associated long value is ", Q_val if (Q_val <= Theta_Precision): #print " Have vector ", x, " with value ", Q_val theta_vec[Q_val].append(deepcopy(x)) ## 5. Check if x = 0, for exit condition. =) j = 0 done_flag = True while (j < n): if (x[j] != 0): done_flag = False j += 1 ## 3a. Increment (and carry if we go out of bounds) x[i] += 1 while (x[i] > L[i]) and (i < n-1): i += 1 x[i] += 1 #print " Leaving ThetaVectors()" return theta_vec
0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5/quadratic_form__split_local_covering.py
empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)]
theta_vec = [[] for i in range(bound + 1)]
def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all vectors of length i. Reference: This is a slightly modified version of Cohn's Algorithm 2.7.5 in "A Course in Computational Number Theory", with the increment step moved around and slightly re-indexed to allow clean looping. Note: We could speed this up for very skew matrices by using LLL first, and then changing coordinates back, but for our purposes the simpler method is efficient enough. =) EXAMPLES: sage: Q = DiagonalQuadraticForm(ZZ, [1,1]) sage: Q.vectors_by_length(5) [[[0, 0]], [[0, -1], [-1, 0]], [[-1, -1], [1, -1]], [], [[0, -2], [-2, 0]], [[-1, -2], [1, -2], [-2, -1], [2, -1]]] sage: Q1 = DiagonalQuadraticForm(ZZ, [1,3,5,7]) sage: Q1.vectors_by_length(5) [[[0, 0, 0, 0]], [[-1, 0, 0, 0]], [], [[0, -1, 0, 0]], [[-1, -1, 0, 0], [1, -1, 0, 0], [-2, 0, 0, 0]], [[0, 0, -1, 0]]] """ Theta_Precision = bound ## Unsigned long n = self.dim() ## Make the vector of vectors which have a given value ## (So theta_vec[i] will have all vectors v with Q(v) = i.) empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)] ## Initialize Q with zeros and Copy the Cholesky array into Q Q = self.cholesky_decomposition() ## 1. Initialize T = n * [RDF(0)] ## Note: We index the entries as 0 --> n-1 U = n * [RDF(0)] i = n-1 T[i] = RDF(Theta_Precision) U[i] = RDF(0) L = n * [0] x = n * [0] Z = RDF(0) ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) done_flag = False Q_val_double = RDF(0) Q_val = 0 ## WARNING: Still need a good way of checking overflow for this value... ## Big loop which runs through all vectors while not done_flag: ## 3b. Main loop -- try to generate a complete vector x (when i=0) while (i > 0): #print " i = ", i #print " T[i] = ", T[i] #print " Q[i][i] = ", Q[i][i] #print " x[i] = ", x[i] #print " U[i] = ", U[i] #print " x[i] + U[i] = ", (x[i] + U[i]) #print " T[i-1] = ", T[i-1] T[i-1] = T[i] - Q[i][i] * (x[i] + U[i]) * (x[i] + U[i]) #print " T[i-1] = ", T[i-1] #print " x = ", x #print i = i - 1 U[i] = 0 for j in range(i+1, n): U[i] = U[i] + Q[i][j] * x[j] ## Now go back and compute the bounds... ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) ## 4. Solution found (This happens when i = 0) #print "-- Solution found! --" #print " x = ", x #print " Q_val = Q(x) = ", Q_val Q_val_double = Theta_Precision - T[0] + Q[0][0] * (x[0] + U[0]) * (x[0] + U[0]) Q_val = ZZ(floor(round(Q_val_double))) ## SANITY CHECK: Roundoff Error is < 0.001 if abs(Q_val_double - Q_val) > 0.001: print " x = ", x print " Float = ", Q_val_double, " Long = ", Q_val raise RuntimeError, "The roundoff error is bigger than 0.001, so we should use more precision somewhere..." #print " Float = ", Q_val_double, " Long = ", Q_val, " XX " #print " The float value is ", Q_val_double #print " The associated long value is ", Q_val if (Q_val <= Theta_Precision): #print " Have vector ", x, " with value ", Q_val theta_vec[Q_val].append(deepcopy(x)) ## 5. Check if x = 0, for exit condition. =) j = 0 done_flag = True while (j < n): if (x[j] != 0): done_flag = False j += 1 ## 3a. Increment (and carry if we go out of bounds) x[i] += 1 while (x[i] > L[i]) and (i < n-1): i += 1 x[i] += 1 #print " Leaving ThetaVectors()" return theta_vec
0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5/quadratic_form__split_local_covering.py