diff --git a/notebooks/julia_async.ipynb b/notebooks/julia_async.ipynb index 6ba7813..197f258 100644 --- a/notebooks/julia_async.ipynb +++ b/notebooks/julia_async.ipynb @@ -758,7 +758,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -766,7 +766,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/notebooks/julia_basics.ipynb b/notebooks/julia_basics.ipynb index 61fdb37..3df942e 100644 --- a/notebooks/julia_basics.ipynb +++ b/notebooks/julia_basics.ipynb @@ -1589,7 +1589,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -1597,7 +1597,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/notebooks/julia_distributed.ipynb b/notebooks/julia_distributed.ipynb index 1699025..4acebe8 100644 --- a/notebooks/julia_distributed.ipynb +++ b/notebooks/julia_distributed.ipynb @@ -1295,19 +1295,11 @@ "\n", "We have seen the basics of distributed computing in Julia. The programming model is essentially an extension of tasks and channels to parallel computations on multiple machines. The low-level functions are `remotecall` and `RemoteChannel`, but there are other functions and macros like `pmap` and `@distributed` that simplify the implementation of parallel algorithms." ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "49d094e4", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -1315,7 +1307,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/notebooks/matrix_matrix.ipynb b/notebooks/matrix_matrix.ipynb index f42a34b..77512dc 100644 --- a/notebooks/matrix_matrix.ipynb +++ b/notebooks/matrix_matrix.ipynb @@ -1108,14 +1108,6 @@ "println(\"Optimal speedup = \", P)\n", "println(\"Efficiency = \", 100*(T1/TP)/P, \"%\")" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cd31d955", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/notebooks/solutions.ipynb b/notebooks/solutions.ipynb index e94e8a9..7cd0179 100644 --- a/notebooks/solutions.ipynb +++ b/notebooks/solutions.ipynb @@ -1,13 +1,90 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "f48b9a60", + "metadata": {}, + "source": [ + "# Solutions to Notebook Exercises\n", + "\n", + "## Julia Basics: Exercise 1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a06fd02a", + "metadata": {}, + "outputs": [], + "source": [ + "function ex1(a)\n", + " j = 1\n", + " m = a[j]\n", + " for (i,ai) in enumerate(a)\n", + " if m < ai\n", + " m = ai\n", + " j = i\n", + " end\n", + " end\n", + " (m,j)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "175b6c35", + "metadata": {}, + "source": [ + "## Julia Basics: Exercise 2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb289acd", + "metadata": {}, + "outputs": [], + "source": [ + "ex2(f,g) = x -> f(x) + g(x) " + ] + }, + { + "cell_type": "markdown", + "id": "86250e27", + "metadata": {}, + "source": [ + "## Julia Basics: Exercise 3" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41b537ab", + "metadata": {}, + "outputs": [], + "source": [ + "function compute_values(n,max_iters)\n", + " x = LinRange(-1.7,0.7,n)\n", + " y = LinRange(-1.2,1.2,n)\n", + " values = zeros(Int,n,n)\n", + " for j in 1:n\n", + " for i in 1:n\n", + " values[i,j] = mandel(x[i],y[j],max_iters)\n", + " end\n", + " end\n", + " values\n", + "end\n", + "values = compute_values(1000,10)\n", + "using GLMakie\n", + "heatmap(x,y,values)" + ] + }, { "cell_type": "markdown", "id": "d6d12733", "metadata": {}, "source": [ - "# Solutions to Notebook Exercises\n", - "\n", - "## Matrix Multiplication : Implementation of Algorithm 3" + "## Matrix Multiplication : Exercise 1" ] }, {