# Ticket #13742: trac_13742_reviewer1.patch

File trac_13742_reviewer1.patch, 3.2 KB (added by ncohen, 10 years ago)

removing some of check_input=False

• ## sage/combinat/integer_vector_weighted.py

# HG changeset patch
# User Dmitrii Pasechnik <dimpase@gmail.com>
# Date 1353745800 -28800
# Node ID 35e9dc53b31834bf5b2e9aef81c8906b56d667e3
# Parent  d31813c790585c745100c8bf7723d2e628004f2a
fixes for WeightedIntegerVector etc

diff --git a/sage/combinat/integer_vector_weighted.py b/sage/combinat/integer_vector_weighted.py
 a .. WARNING:: This file uses the :class:Permutation_class class with the flag check_input = False. It should not. Do not trust the results. See :trac:13742. The list(self) function in this file used the :class:Permutation_class class improperly, returning the list of, generally speaking, invalid permutations (repeated entries, including 0). """ #***************************************************************************** #       Copyright (C) 2007 Mike Hansen , def WeightedIntegerVectors(n, weight): """ Returns the combinatorial class of integer vectors of n weighted by weight. weight, that is, the nonnegative integer vectors (v_1,\\dots,v_{length(weight)}) satisfying \\sum_i v_i weight[i]==n. EXAMPLES:: perm = Word(self.weight).standard_permutation() l = [x for x in sorted(self.weight)] return [perm._left_to_right_multiply_on_right(Permutation_class(x, check_input = False)) for x in self._recfun(self.n,l)] return [perm.action(_) for _ in self._recfun(self.n,l)]
• ## sage/combinat/permutation.py

diff --git a/sage/combinat/permutation.py b/sage/combinat/permutation.py
 a :trac:13742). This is dangerous. In particular, the :meth:Permutation_class._left_to_right_multiply_on_right method (which can be called trough multiplication) disables the input checks (see :method:Permutation). This should not happen. Do not trust the results. :meth:Permutation). This should not happen. Do not trust the results. AUTHORS: #different sizes new_rp = rp[:] + [i+1 for i in range(len(rp), len(self))] new_p1 = self[:] + [i+1 for i in range(len(self), len(rp))] return Permutation([ new_rp[i-1] for i in new_p1 ], check_input = False) return Permutation([ new_rp[i-1] for i in new_p1 ]) def __call__(self, i): r""" Returns the pair of standard tableaux obtained by running the Robinson-Schensted Algorithm on self. .. WARNING:: The following examples do not check their input. This is wrong. See :trac:13742. EXAMPLES:: sage: Permutation([6,2,3,1,7,5,4], check_input = False).robinson_schensted() sage: Permutation([6,2,3,1,7,5,4]).robinson_schensted() [[[1, 3, 4], [2, 5], [6, 7]], [[1, 3, 5], [2, 6], [4, 7]]] The following example does not check their input. This is wrong. See :trac:13742. It also works in the case of repeated letters. In this case only the second tableau is standard::