Changeset 452 for inundation/ga/storm_surge/pyvolution/least_squares.py
- Timestamp:
- Oct 26, 2004, 11:55:00 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/least_squares.py
r441 r452 27 27 from Numeric import zeros, array, Float, Int, dot, transpose 28 28 from LinearAlgebra import solve_linear_equations 29 from scipy import sparse 29 #from scipy import sparse 30 from sparse import Sparse 30 31 from cg_solve import conjugate_gradient, VectorShapeError 31 32 … … 210 211 211 212 #self.A = zeros((n,m), Float) 212 self.A = sparse.dok_matrix() 213 self.AtA = sparse.dok_matrix() 213 self.A = Sparse(n,m) 214 215 #print 'n by m ',self.A 216 self.AtA = Sparse(m,m) 214 217 215 218 #Compute matrix elements … … 265 268 266 269 267 self.A = (self.A).tocsc()268 self.AtA = (self.AtA).tocsc()269 self.At = self.A.transp()270 ## self.A = (self.A).tocsc() 271 ## self.AtA = (self.AtA).tocsc() 272 ## self.At = self.A.transp() 270 273 271 274 def get_A(self): … … 314 317 315 318 #self.D = zeros((m,m), Float) 316 self.D = sparse.dok_matrix()319 self.D = Sparse(m,m) 317 320 318 321 #For each triangle compute contributions to D = D1+D2 … … 360 363 self.D[v0,v2] += e20 361 364 362 self.D = (self.D).tocsc()365 #self.D = (self.D).tocsc() 363 366 364 367 def fit(self, z): … … 383 386 384 387 #Compute right hand side based on data 385 Atz = self.At * z 386 388 Atz = self.A.trans_mult(z) 389 390 391 #print 'fit: Atz',Atz 392 387 393 #Check sanity 388 394 n, m = self.A.shape … … 485 491 """ 486 492 import os, sys 487 usage = "usage: %s mesh_input.tsh point.xya mesh_output.tsh alpha" % 493 usage = "usage: %s mesh_input.tsh point.xya mesh_output.tsh alpha" % os.path.basename(sys.argv[0]) 488 494 489 495 if len(sys.argv) < 4:
Note: See TracChangeset
for help on using the changeset viewer.