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*t...
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()....
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 =...
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...
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...
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...
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 Tab...
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 Tabl...
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 Tabl...
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...
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...
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...
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...
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...
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...
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) el...
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...
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...
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...
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...
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) Semista...
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 (20...
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 (20...
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 (20...
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...
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...
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...
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...
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...
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:...
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:...
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\\le...
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\\le...
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)...
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 ...
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 v...
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 ...
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 ...
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) ... ...
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 s...
- ``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...
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 v...
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 v...
0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5/quadratic_form__split_local_covering.py