Skip to content

Commit

Permalink
trac 8539 -- some additional slight referee improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Mar 27, 2010
1 parent 60d40d0 commit 7accc10
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/sage/matrix/matrix_integer_sparse.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ cdef class Matrix_integer_sparse(matrix_sparse.Matrix_sparse):

cpdef ModuleElement _lmul_(self, RingElement right):
"""
EXAMPLES:
sage: a = matrix(QQ,2,range(6))
sage: (3/4) * a
[ 0 3/4 3/2]
[ 9/4 3 15/4]
EXAMPLES::
sage: a = matrix(ZZ,2,range(6), sparse=True)
sage: 3 * a
[ 0 3 6]
[ 9 12 15]
"""
cdef Py_ssize_t i, j
cdef Py_ssize_t i
cdef mpz_vector* self_row, *M_row
cdef Matrix_integer_sparse M
cdef Integer _x
Expand All @@ -192,9 +193,6 @@ cdef class Matrix_integer_sparse(matrix_sparse.Matrix_sparse):
self_row = &self._matrix[i]
M_row = &M._matrix[i]
mpz_vector_scalar_multiply(M_row, self_row, _x.value)
#for j from 0 <= j < self._matrix[i].num_nonzero:
# mpz_vector_set_entry(M_row, self_row.positions[j], self_row.entries[j])
# mpz_mul(M_row.entries[j], M_row.entries[j], _x.value)
return M

cpdef ModuleElement _add_(self, ModuleElement right):
Expand Down

0 comments on commit 7accc10

Please sign in to comment.