#7163: right kernel does not respect sparse=True
-----------------------+----------------------------------------------------
   Reporter:  mhansen  |       Owner:  tbd       
       Type:  defect   |      Status:  new       
   Priority:  major    |   Milestone:  sage-4.1.3
  Component:  algebra  |    Keywords:            
Work_issues:           |      Author:            
   Reviewer:           |      Merged:            
-----------------------+----------------------------------------------------

Comment(by was):

 {{{
 The "sparse=True" option you are passing to right_kernel isn't
 implemented at all.

 In fact, the way right_kernel is implemented you can make up an
 options you want and they will be silently ignored:


 sage: ker=m.right_kernel(foobar=True, stand_on_your_head=True,
 use_the_force=True, super_sparse=True, dumb=False)

 In the meantime you can get a sparse matrix as follows:

 sage: ker=m.right_kernel().basis_matrix().sparse_matrix()
 sage: type(ker)
 <type 'sage.matrix.matrix_rational_sparse.Matrix_rational_sparse'>
 sage: ker.row_module()
 Sparse vector space of degree 100 and dimension 99 over Rational Field
 Basis matrix:
 99 x 100 sparse matrix over Rational Field

 Here's the relevant code for "right_kernel", which as you can see does
 nothing with sparseness...

 Obviously it would be desirable for somebody to fix the right_kernel
 command so one gets errors for all unused options, and all options
 that should be supported are supported.


        if R.is_field():
            E = self.echelon_form(*args, **kwds)
            pivots = E.pivots()
            pivots_set = set(pivots)
            basis = []
            V = R ** self.ncols()
            ONE = R(1)
            for i in xrange(self._ncols):
                if not (i in pivots_set):
                    v = V(0)
                    v[i] = ONE
                    for r in range(len(pivots)):
                        v[pivots[r]] = -E[r,i]
                    basis.append(v)
            W = V.submodule(basis)
            if W.dimension() != len(basis):
                raise RuntimeError, "bug in right_kernel function in
 matrix2.pyx -- basis from echelon form is not a basis."
            self.cache('right_kernel', W)
            return W
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7163#comment:1>
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