sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.43k stars 478 forks source link

Fix random simplicial complexes #13590

Closed jhpalmieri closed 12 years ago

jhpalmieri commented 12 years ago

Random simplicial complexes don't have the right number of vertices. From the doctests:

            sage: simplicial_complexes.RandomComplex(6, 2)
            Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6) and 15 facets
            sage: simplicial_complexes.RandomComplex(6,12)
            Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and facets {(0, 1, 2, 3, 4, 5, 6, 7)}

In both cases, these should have 6 vertices, but they have 7 and 8 instead. Thus this method gives mathematically incorrect answers. The attached patch fixes the problems.

Depends on #13244

Component: algebraic topology

Keywords: simplicial complex

Author: John Palmieri

Reviewer: Travis Scrimshaw

Merged: sage-5.5.beta0

Issue created by migration from https://trac.sagemath.org/ticket/13590

jhpalmieri commented 12 years ago

Description changed:

--- 
+++ 
@@ -1,8 +1,9 @@
 Random simplicial complexes don't have the right number of vertices. From the doctests:

+```
             sage: simplicial_complexes.RandomComplex(6, 2)
             Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6) and 15 facets
             sage: simplicial_complexes.RandomComplex(6,12)
             Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and facets {(0, 1, 2, 3, 4, 5, 6, 7)}
-
+```
 In both cases, these should have 6 vertices, but they have 7 and 8 instead. Thus this method gives mathematically incorrect answers. The attached patch fixes the problems.
tscrim commented 12 years ago
comment:3

Looks good to me.

tscrim commented 12 years ago

Reviewer: Travis Scrimshaw

jdemeyer commented 12 years ago
comment:4

This conflicts with #13244 and should be rebased.

jdemeyer commented 12 years ago

Dependencies: #13244

jhpalmieri commented 12 years ago
comment:5

Okay, rebased now.

jhpalmieri commented 12 years ago

Attachment: trac_13590-random-complex.patch.gz

jdemeyer commented 12 years ago

Merged: sage-5.5.beta0