Skip to content

Commit 8e2e8ad

Browse files
authored
Fixed bugs in scipy test and notebook (#185)
1 parent 1b2ad28 commit 8e2e8ad

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

library_scipy.ipynb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,16 @@
12881288
"source": [
12891289
"### 4.8. Exercise: $LU$ decomposition 🌶️\n",
12901290
"\n",
1291-
"For matrices $P, L,$ and $U$ defined in [§4.5](#45-matrix-decomposition-decomposition), express the matrix in [Exercise 4.8.](#48-exercise-eigenvalue-problem) as a product of matrices $P, L, U$."
1291+
"For matrices $P, L,$ and $U$ defined in [§4.5](#45-matrix-decomposition-decomposition), express the following matrix as a product of matrices $P, L, U$.\n",
1292+
"$$\n",
1293+
"\\left[\n",
1294+
"\\begin{array}{ccc}\n",
1295+
"9 & 3 & 3 \\\\\n",
1296+
"3 & 2 & 2 \\\\\n",
1297+
"3 & 4 & 2\n",
1298+
"\\end{array}\n",
1299+
"\\right]\n",
1300+
"$$"
12921301
]
12931302
},
12941303
{

tutorial/tests/test_library_scipy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def reference_minimize():
55
from scipy.optimize import minimize
66

77
def f(x):
8-
return 3 * x**2 - 4 * x - 4
8+
return 3 * x**2 - 5 * x - 4
99

1010
return minimize(f, 0)
1111

@@ -22,7 +22,7 @@ def f(x):
2222
return x**3 - 6 * x**2 + 4 * x + 12
2323

2424
# 2. TODO: call the root function here:
25-
sol1, sol2, sol3 = root(f, -1.0), root(f, 2.5), root(f, 4.5)
25+
sol1, sol2, sol3 = root(f, -1.0).x, root(f, 2.5).x, root(f, 4.5).x
2626
return sol1, sol2, sol3
2727

2828

0 commit comments

Comments
 (0)