Skip to content

Commit 5253e27

Browse files
author
counterclocker
committed
cleaning before refactoring of proxies into SparseMatix
1 parent 43538ef commit 5253e27

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

cysparse/sparse/s_mat.pyx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ cdef class SparseMatrix:
268268
#########################
269269
# Printing
270270
#########################
271-
def to_string(self, mode='M', implicit_zero = ' ', cell_width=11, number_width=9, precision=6, **kwargs):
271+
def to_string(self, **kwargs):
272272
"""
273273
Return a string representing the **content** of matrix.
274274
@@ -324,15 +324,22 @@ cdef MakeMatrixString(SparseMatrix A, char mode='M', full=False):
324324
s += "%s " % A.at_to_string(A.nrow - max_height + i, A.ncol - max_width + j)
325325
s += '\n'
326326
s += '\n'
327-
else:
327+
else: # full matrix
328328
for i from 0 <= i < A.nrow:
329329
for j from 0 <= j < A.ncol:
330330
s += "%s " % A.at_to_string(i, j)
331331
s += '\n'
332332
s += '\n'
333333

334334
elif mode == 'T':
335-
pass
335+
if not full and (A.nrow > MAX_MATRIX_HEIGHT or A.ncol > MAX_MATRIX_WIDTH):
336+
pass
337+
else: # full matrix
338+
for j from 0 <= j < A.ncol:
339+
for i from 0 <= i < A.nrow:
340+
s += "%s " % A.at_to_string(j, i)
341+
s += '\n'
342+
s += '\n'
336343
elif mode == 'H':
337344
pass
338345
elif mode == 'C':

0 commit comments

Comments
 (0)