Skip to content

Commit f91703c

Browse files
committed
Make pyamg example run
1 parent f47cbcc commit f91703c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

advanced/scipy_sparse/examples/pyamg_with_lobpcg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Dirichlet boundary conditions.
88
"""
99

10+
import numpy as np
1011
import scipy as sp
1112
import matplotlib.pyplot as plt
1213

@@ -21,7 +22,7 @@
2122
ml = smoothed_aggregation_solver(A)
2223

2324
# initial approximation to the K eigenvectors
24-
X = sp.rand(A.shape[0], K)
25+
X = np.random.random((A.shape[0], K))
2526

2627
# preconditioner based on ml
2728
M = ml.aspreconditioner()

0 commit comments

Comments
 (0)