On 10/08/15 09:40, Jori Mäntysalo wrote:
On Mon, 10 Aug 2015, Vincent Delecroix wrote:

Sounds reasonable. However, it seems to optimize only numbers from 0 to
9. Here is a test code:

No. You are wrong. You can just have a look to the code publicly
available. It is the class CGraphBackend in the file
src/sage/graphs/base/c_graph.pyx that manage the labels.

??? For example I got

[<type 'int'>, <type 'sage.rings.integer.Integer'>]

from

g = Graph()
g.add_vertex(9)
g.add_vertex(10)
[type(x) for x in g.vertices()]

But

sage: G = Graph()
sage: G.add_vertices(range(100))
sage: set(type(x) for x in G.vertices())
{<type 'int'>}

>
> and this seems quite unexpected.
>

True. The number 10 is just the size of the initial allocated memory.

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to