On Wednesday, 2 November 2016 20:08:20 UTC+11, Dima Pasechnik wrote:
>
> I must say I don't know why these libgap.set_global and get_global are 
> needed.
>
>>
>>
I used them to get my large matrices into libgap as globals. Trying to pass 
them through a text based interface does not work.


Following is a toy example, starting with a graph lg on 16 vertices. 
sage: lg=c[1].linear_graph_class_list[0]
sage: mlg=lg.adjacency_matrix()
sage: libgap.set_global('MLG',mlg)
sage: MLG=libgap.get_global('MLG')
sage: type(MLG)
<type 'sage.libs.gap.element.GapElement_List'>
sage: libgap.eval('MLG')
[ [ 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0 ], [ 1, 0, 0, 1, 0, 1, 
1, 0, 0, 1, 0, 1, 0, 0, 0, 0 ], [ 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 
0, 0 ], [ 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0 ], [ 1, 0, 1, 0, 
0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0 ], [ 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 
0, 1, 0, 0 ], [ 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0 ], [ 0, 0, 
1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0 ], [ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 
0, 0, 0, 1, 1, 0 ], [ 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1 ], [ 
1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1 ], [ 0, 1, 0, 1, 0, 1, 0, 0, 
0, 0, 1, 0, 0, 0, 1, 1 ], [ 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1 
], [ 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1 ], [ 0, 0, 0, 0, 0, 0, 
1, 1, 1, 0, 1, 1, 0, 0, 0, 1 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 
1, 0 ] ]

The actual adjacency matrices that I want to use in my test are 256x256. 

sage: c, reclassification, cayley_graph_classes = 
load_boolean_dimension_graph_classifications(8,9)
sage: lg=c[9].linear_graph_class_list[0]
sage: mlg=lg.adjacency_matrix()
sage: mlg.dimensions()
(256, 256)
sage: libgap.set_global('MLG',mlg)
sage: MLG=libgap.get_global('MLG')
sage: HH=libgap.eval('HH := Graph( G, [1..16], OnPoints, function(x,y) 
return MLG[x][y] = 1; end,true );')
sage: cg=c[9].cayley_graph_class_list[0]
sage: mcg=cg.adjacency_matrix()
sage: mcg.dimensions()
(256, 256)
sage: libgap.set_global('MCG',mcg)
sage: GG=libgap.eval('GG := Graph( G, [1..16], OnPoints, function(x,y) 
return MCG[x][y] = 1; end,true );')

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

Reply via email to