Skip to content

Commit 5933190

Browse files
author
counterclocker
committed
umfpack continued
1 parent 8ec659a commit 5933190

6 files changed

Lines changed: 3978 additions & 1718 deletions

File tree

benchmarks/todo.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Benchmarks:
33
compare to:
44
- PySparse
55
- Scipy sparse matrices
6-
- utilisation BLAS
6+
- with the use of BLAS via Tokyo

examples/umfpack.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
from sparse_lib.sparse.ll_mat import MakeLLSparseMatrix
22
import sparse_lib.solvers.suitesparse.umfpack as umfpack
33

4-
matrix = MakeLLSparseMatrix(nrow=2, ncol=3, size_hint=10)
5-
print matrix
6-
matrix[0, 0] = 1
7-
matrix[0, 2] = 3.6
8-
matrix[1, 1] = 1
9-
matrix[1, 2] = -2
4+
import numpy
105

6+
A = MakeLLSparseMatrix(size=4)
117

12-
solver = umfpack.UmfpackSolver(matrix)
8+
A.put_triplet([1.0, 2.0, 6.0, 3.0, 5.0, 4.0], [0, 1, 1, 2, 3, 3], [0, 1, 2, 2, 0, 3])
9+
10+
solver = umfpack.UmfpackSolver(A)
1311

1412
print solver.UMFPACK_VERSION
1513

@@ -23,3 +21,21 @@
2321
solver.report_symbolic()
2422

2523
solver.report_numeric()
24+
25+
print "*" * 80
26+
27+
28+
b = numpy.array([1.0, 1.0, 1.0, 1.0])
29+
30+
sol = solver.solve(b)
31+
32+
print "Solution: ",
33+
print sol
34+
print "b: ",
35+
print b
36+
print "A*sol: ",
37+
print A * sol
38+
39+
print "&" * 80
40+
41+
print solver.get_lunz()

0 commit comments

Comments
 (0)