Numerical Python Question
Uwe Schmitt
uwe at rocksport.de
Tue Dec 4 07:53:43 EST 2001
Well, i fixed it: I have to use Matrix() in order to construct a
Matrix whith appropriate __mult__()-method. Now I encountered another
problem:
from Numeric import *
from Matrix import *
from LinearAlgebra import *
n=5
A=Matrix(zeros((n,n),Float))
for i in range(n):
for j in range(n):
A[i,j]=1.0/(i+j+1)
x=Matrix(ones((n,1),Float))
b=A*x
x = solve_linear_equations(A, b)
print "x=", x
print
print "x'*x=", transpose(x)*x
print
print "x*x'=", x*transpose(x)
print
This program should output a vektor, then a scalar and finally a matrix.
But it outputs a vektor and two matrices.
I think this is a bug.
Greetings, Uwe.
--
Dr. rer. nat. Uwe Schmitt Uwe.Schmitt at num.uni-sb.de
Universitaet des Saarlandes Angewandte Mathematik
Building 36.1 Room 4.17 PO-Box 151150 D-66041 Saarbruecken
Mobile:0177/6806587 Fax:+49(0)681/302-4435 Office:+49(0)681/302-2468
More information about the Python-list
mailing list