diff --git a/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization - Answer.ipynb b/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization - Answer.ipynb index 8f3d856..89fcb30 100644 --- a/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization - Answer.ipynb +++ b/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization - Answer.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "" + "name": "", + "signature": "sha256:7f169ffa2b84ca3f9ed0b601f473c5f4a8931da522172eb74c531a4efb9ce838" }, "nbformat": 3, "nbformat_minor": 0, @@ -28,12 +29,16 @@ "Here is a list of laff routines that you might want to use in this notebook:\n", "\n", "\n", - "These three methods were added to the laff library after the course started. If you're having problems with git and are manually downloading the notebooks, check the wiki page for notebooks for help on getting updated laff routines as well.\n", - "\n", "\n", "And last but not least, __*copy and paste your method from 6.3 Solving A x b via LU factorization and triangular solves into the box below.*__ We'll be using it during this notebook. Recall that it overwrites $A$ with $L$ in the strictly lower triangular part and $U$ in the upper triangular part.\n", " Make sure you call the routine LU_unb_var5 \n", @@ -175,8 +180,8 @@ " #------------------------------------------------------------#\n", "\n", " LU_unb_var5( A11 )\n", - " laff.trsm( 'Lower triangular', 'No transpose', 'Unit diagonal', A11, A12 )\n", - " laff.trsm( 'Upper triangular', 'Transpose', 'Nonunit diagonal', A11, A21 )\n", + " laff.trsm( 'Left', 'Lower triangular', 'No transpose', 'Unit diagonal', A11, A12 )\n", + " laff.trsm( 'Right', 'Upper triangular', 'Transpose', 'Nonunit diagonal', A11, A21 )\n", " laff.gemm( -1.0, A21, A12, 1.0, A22 )\n", "\n", " #------------------------------------------------------------#\n", diff --git a/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization.ipynb b/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization.ipynb index 6810c11..5916f49 100644 --- a/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization.ipynb +++ b/week08/08.4.0 - (Optional Enrichment) Blocked LU Factorization.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "" + "name": "", + "signature": "sha256:7af5e8baef6f66b125b53267c12a3b0349f3261c788d063348cf353dd557cf7a" }, "nbformat": 3, "nbformat_minor": 0, @@ -28,12 +29,16 @@ "Here is a list of laff routines that you might want to use in this notebook:\n", "\n", "\n", - "These three methods were added to the laff library after the course started. If you're having problems with git and are manually downloading the notebooks, check the wiki page for notebooks for help on getting updated laff routines as well.\n", - "\n", "\n", "And last but not least, __*copy and paste your method from 6.3 Solving A x b via LU factorization and triangular solves into the box below.*__ We'll be using it during this notebook. Recall that it overwrites $A$ with $L$ in the strictly lower triangular part and $U$ in the upper triangular part.\n", " Make sure you call the routine LU_unb_var5 \n", @@ -44,8 +49,8 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Insert your code for LU_unb_var5 from\n", - "# 6.3 Solving A x b via LU factorization and triangular solves" + "# Copy routine here\n", + "\n" ], "language": "python", "metadata": {}, @@ -123,7 +128,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Insert code here" + "# insert code\n", + "\n", + "\n" ], "language": "python", "metadata": {}, @@ -218,10 +225,8 @@ "cell_type": "code", "collapsed": false, "input": [ - "def Solve( A, b ):\n", - " \n", - " # insert appropriate calls to routines you have written here!\n", - " # remember the variable nb holds our block size" + "# insert code here\n", + "\n" ], "language": "python", "metadata": {}, @@ -279,9 +284,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# insert appropriate calls here\n", + "# insert appropriate calls here.\n", + "\n", + "laff.trsv( 'Lower triangular', 'No transpose', 'Unit diagonal', A, b2 )\n", + "laff.trsv( 'Upper triangular', 'No transpose', 'Nonunit diagonal', A, b2 )\n", "\n", - "# Test your calls\n", "print( '2-Norm of updated b2 - original x2' )\n", "print( np.linalg.norm(b2 - x2) )" ],