[PYTHON MATRIX-SIG] New pretty printer
Paul. Dubois
dubois1@llnl.gov
Mon, 05 Feb 1996 14:16:04 -0800
I suggest a default size of 79 (or 77 as suggested by Guido). Exactly 80
causes wrap in some display vehicles.
I didn't look yet at how you did it but perhaps a user-settable
precision could be managed. I have done that in both Basis and
EiffelMath. Guido is right about the timing too; if there are enough
components that you have to worry about the timing to print it, nobody
is going to print it anyway or look at it if they do.
One thing I did in Basis was an optional "compression" that compressed
identical rows (or strings of identical elements in 1-D).
Basis> ones(10000)
ones(10000) shape: (10000)
1: 9976 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1
9977: - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Basis> shape([1,2,3]//ones(10000)//[5,6],2001,5)
shape([1,2,3]//ones(10000)//[5,6],2001,5) shape: (2001,5)
row col = 1 2 3 4 5
1: - 1 1 1 1 1
2: - 2 1 1 1 1
3: - 3 1 1 1 1
4:1999 - 1 1 1 1 1
2000: - 1 1 1 1 5
2001: - 1 1 1 1 6
Basis>
This has proven useful.
--
Paul F. Dubois, L-472 (510)-422-5426
Lawrence Livermore National Laboratory FAX (510)-423-9969
Livermore, CA 94550 dubois1@llnl.gov
Consulting: PaulDubois@aol.com
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================