Skip to content

Commit

Permalink
a few rst fixes in pyx files
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Aug 6, 2022
1 parent cd1e2b1 commit 32403e9
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/sage/coding/codecan/codecan.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ cdef class InnerGroup:
return self.transporter
def __repr__(self):
"""
r"""
EXAMPLES::
sage: from sage.coding.codecan.codecan import InnerGroup
Expand All @@ -378,7 +378,7 @@ cdef class InnerGroup:
frobenius power = 1 and partition = 0 -> 0 1 -> 1 2 -> 2 3 -> 3 4 -> 4 5 -> 5
6 -> 6 7 -> 7 8 -> 8 9 -> 9
"""
return "Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \
return r"Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \
"with rank = %s, frobenius power = %s and partition =%s" % (self.rank,
self.frob_pow, OP_string(self.row_partition))
Expand Down Expand Up @@ -741,7 +741,7 @@ cdef class PartitionRefinementLinearCode(PartitionRefinement_generic):
return self._inner_group_stabilizer_order
cdef _init_point_hyperplane_incidence(self):
"""
r"""
Compute a set of codewords `W` of `C` (generated by self) which is compatible
with the group action, i.e. if we start with some other code `(g,\pi)C`
the result should be `(g,\pi)W`.
Expand Down
5 changes: 3 additions & 2 deletions src/sage/graphs/distances_all_pairs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ def wiener_index(G):
################

cdef uint64_t c_szeged_index_low_memory(short_digraph sd):
"""
r"""
Return the Szeged index of the graph.
Let `G = (V, E)` be a connected simple graph, and for any `uv\in E`, let
Expand Down Expand Up @@ -2185,8 +2185,9 @@ cdef uint64_t c_szeged_index_low_memory(short_digraph sd):

return s


cdef uint64_t c_szeged_index_high_memory(short_digraph sd):
"""
r"""
Return the Szeged index of the graph.
Let `G = (V, E)` be a connected graph, and for any `uv\in E`, let `N_u(uv) =
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph_decompositions/vertex_separation.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def linear_ordering_to_path_decomposition(G, L):

def pathwidth(self, k=None, certificate=False, algorithm="BAB", verbose=False,
max_prefix_length=20, max_prefix_number=10**6):
"""
r"""
Compute the pathwidth of ``self`` (and provides a decomposition)
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/matchpoly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ x = polygen(ZZ, 'x')


def matching_polynomial(G, complement=True, name=None):
"""
r"""
Computes the matching polynomial of the graph `G`.
If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges)
Expand Down
5 changes: 3 additions & 2 deletions src/sage/groups/perm_gps/partn_ref/data_structures.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,12 @@ cdef SC_print_level(StabilizerChain *SC, int level):
print('| labels {}'.format([SC.labels [level][i] for i from 0 <= i < n]))
print('|')
print('| generators {}'.format([[SC.generators [level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
print('\ inverses {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
print(r'\ inverses {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
else:
print('/ level {}'.format(level))
print('|')
print('\ base_size {}'.format(SC.base_size))
print(r'\ base_size {}'.format(SC.base_size))


cdef StabilizerChain *SC_new_base(StabilizerChain *SC, int *base, int base_len):
"""
Expand Down
28 changes: 17 additions & 11 deletions src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ cdef int ith_word_nonlinear(BinaryCodeStruct self, int i, bitset_s *word):
return 0

cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_refine_by, int ctrb_len):
"""
r"""
Refines the input partition by checking degrees of vertices to the given
cells in the associated bipartite graph (vertices split into columns and
words).
Expand Down Expand Up @@ -731,11 +731,14 @@ cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_ref
return invariant

cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree):
"""
r"""
Compare gamma_1(S1) and gamma_2(S2).
Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2),
1 if gamma_1(S1) > gamma_2(S2). (Just like the python \code{cmp}) function.
This returns:
- -1 if gamma_1(S1) < gamma_2(S2),
- 0 if gamma_1(S1) == gamma_2(S2),
- 1 if gamma_1(S1) > gamma_2(S2).
Abstractly, what this function does is relabel the basis of B by gamma_1 and
gamma_2, run a row reduction on each, and verify that the matrices are the
Expand All @@ -745,9 +748,9 @@ cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, in
code has a 1 in the entry in which they differ is reported as larger.
INPUT:
gamma_1, gamma_2 -- list permutations (inverse)
S1, S2 -- binary code struct objects
- gamma_1, gamma_2 -- list permutations (inverse)
- S1, S2 -- binary code struct objects
"""
cdef int i, piv_loc_1, piv_loc_2, cur_col, cur_row=0
cdef bint is_pivot_1, is_pivot_2
Expand Down Expand Up @@ -804,16 +807,19 @@ cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, in
return 0

cdef int compare_nonlinear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree):
"""
r"""
Compare gamma_1(S1) and gamma_2(S2).
Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2),
1 if gamma_1(S1) > gamma_2(S2). (Just like the python \code{cmp}) function.
This returns:
- -1 if gamma_1(S1) < gamma_2(S2),
- 0 if gamma_1(S1) == gamma_2(S2),
- 1 if gamma_1(S1) > gamma_2(S2).
INPUT:
gamma_1, gamma_2 -- list permutations (inverse)
S1, S2 -- a binary code struct object
- gamma_1, gamma_2 -- list permutations (inverse)
- S1, S2 -- a binary code struct object
"""
cdef int side=0, i, start, end, n_one_1, n_one_2, cur_col
cdef int where_0, where_1
Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ cdef class PartitionRefinement_generic:
"\\begin{tikzpicture}\n" +
"\\tikzset{level distance=3cm, edge from parent/.style=" +
"{draw, edge from parent path={(\\tikzparentnode.south) -- (\\tikzchildnode.north)}}}\n" +
"\Tree")
"\\Tree")
self._latex_debug_string += "[."
self._latex_act_node()

Expand Down
12 changes: 6 additions & 6 deletions src/sage/groups/perm_gps/permgroup_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
return result

cpdef _act_on_(self, x, bint self_on_left):
"""
r"""
Return the result of the action of ``self`` on ``x``.
For example, if ``x=f(z)`` is a polynomial, then this function returns
Expand Down Expand Up @@ -1619,7 +1619,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
return ~self

def sign(self):
"""
r"""
Returns the sign of self, which is `(-1)^{s}`, where
`s` is the number of swaps.
Expand Down Expand Up @@ -1857,12 +1857,12 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
return _Partitions(cycle_type)

def has_descent(self, i, side = "right", positive = False):
"""
r"""
INPUT:
- ``i``: an element of the index set
- ``side``: "left" or "right" (default: "right")
- ``positive``: a boolean (default: False)
- ``i`` -- an element of the index set
- ``side`` -- "left" or "right" (default: "right")
- ``positive`` -- a boolean (default: False)
Returns whether ``self`` has a left (resp. right) descent at
position ``i``. If ``positive`` is True, then test for a non
Expand Down

0 comments on commit 32403e9

Please sign in to comment.