#6391: libGAP!  -- create a Cython library interface to gap
---------------------------+------------------------------------------------
   Reporter:  was          |       Owner:  was       
       Type:  enhancement  |      Status:  needs_work
   Priority:  major        |   Milestone:  sage-4.7  
  Component:  interfaces   |    Keywords:            
     Author:               |    Upstream:  N/A       
   Reviewer:               |      Merged:            
Work_issues:               |  
---------------------------+------------------------------------------------

Comment(by vbraun):

 Replying to [comment:45 dimpase]:
 > This sounds  great! What about matrices?

 If a dense matrix is good enough for you then you can just convert it to a
 List of Lists in Gap and then use the `.sage()` method which recurses
 through the lists and can convert numbers:
 {{{
 sage: from sage.libs.gap.libgap import libgap
 sage: M = libgap('BlockMatrix([[1,1,[[1, 2],[ 3, 4]]],
 [1,2,[[9,10],[11,12]]], [2,2,[[5, 6],[ 7, 8]]]],2,2)')
 sage: M
 <block matrix of dimensions (2*2)x(2*2)>
 sage: M.List().sage()
 [[1, 2, 9, 10], [3, 4, 11, 12], [0, 0, 5, 6], [0, 0, 7, 8]]
 sage: matrix(ZZ,_)
 [ 1  2  9 10]
 [ 3  4 11 12]
 [ 0  0  5  6]
 [ 0  0  7  8]
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6391#comment:47>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to