#!/usr/bin/env python
# (C) 2000 Huaiyu Zhu <hzhu@users.sourceforge.net>. Licence: GPL
# $Id: test_transpose.py,v 1.2 2000/07/26 20:58:27 hzhu Exp $
"""
Test transpose, diag, flipud, fliplr
"""
from MatPy.Matrix import rand, Diag, diag, flipud, fliplr
a = rand((3,3))
print "-"*44,"\n", a
b = diag(a)
print "-"*44,"\n", b
print "-"*44,"\n", Diag(b)
print "-"*44,"\n", Diag(b.T)
print "-"*44,"\n", flipud(a)
print "-"*44,"\n", fliplr(a)
Result obtained with
>>> from MatPy.tests import test_transpose
--------------------------------------------
[ 0.828 0.489 0.89
0.0371 0.59 0.979
0.383 0.201 0.554 ]
--------------------------------------------
[ 0.828 0.59 0.554 ]
--------------------------------------------
[ 0.828 0 0
0 0.59 0
0 0 0.554 ]
--------------------------------------------
[ 0.828 0 0
0 0.59 0
0 0 0.554 ]
--------------------------------------------
[ 0.383 0.201 0.554
0.0371 0.59 0.979
0.828 0.489 0.89 ]
--------------------------------------------
[ 0.89 0.489 0.828
0.979 0.59 0.0371
0.554 0.201 0.383 ]