(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 23515, 768] NotebookOptionsPosition[ 20717, 674] NotebookOutlinePosition[ 21154, 691] CellTagsIndexPosition[ 21111, 688] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Haar Transform 2D", "Title"], Cell["\<\ Wavelet Workshop June 4-7, 2008 University of St. Thomas\ \>", "Subtitle", CellChangeTimes->{{3.421426484890625*^9, 3.42142648821875*^9}}], Cell["\<\ Catherine Beneteau Caroline Haddad David Ruch Patrick Van Fleet\ \>", "Subsubtitle", CellChangeTimes->{{3.42144927371875*^9, 3.42144928703125*^9}}], Cell[CellGroupData[{ Cell["Objective", "Section"], Cell["\<\ In this notebook, we will explore the two-dimensional discrete Haar wavelet \ transform.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Conventions", "Section"], Cell[TextData[{ "This notebook uses the package ", StyleBox["DiscreteWavelets", FontColor->RGBColor[1, 0, 0]], " (written by Patrick Van Fleet). All commands from the ", StyleBox["DiscreteWavelets", FontColor->RGBColor[1, 0, 0]], " library will be denoted in ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], ". Help is available for every command in ", StyleBox["the package", FontColor->GrayLevel[0]], ". Click on Help and then Documentation Center. At the bottom-right of the \ page is a link for Installed AddOns. Click this link and one of the options \ is DiscreteWavelets. Click this link to go to the Help Browser. Like all ", StyleBox["Mathematica", FontSlant->"Italic"], " help screens, the help is \"live\" - you can either execute the commands \ in the help to see the effects of the command or cut and paste them into your \ own notebook.\n\nComments are useful within cells of code. Any code enclosed \ by (* *) is a comment and ignored by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel." }], "Text", CellChangeTimes->{{3.4085631561875*^9, 3.408563201375*^9}, { 3.4085632433125*^9, 3.408563315796875*^9}, {3.40856339940625*^9, 3.4085634034375*^9}, {3.408565167890625*^9, 3.40856516825*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Load DiscreteWavelets", "Section", CellChangeTimes->{3.408563584328125*^9}], Cell[BoxData[ RowBox[{"<<", "DiscreteWavelets`DiscreteWavelets`"}]], "Input", CellChangeTimes->{{3.408563455078125*^9, 3.408563467234375*^9}, { 3.408565207546875*^9, 3.40856520834375*^9}, {3.4085675625625*^9, 3.408567562828125*^9}, {3.421627792546875*^9, 3.4216277926875*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Two-Dimensional Discrete Haar Transform Modules", "Section"], Cell[TextData[{ "\nWe will use the 2D modules from ", StyleBox["DiscreteWavelets", FontColor->RGBColor[1, 0, 0]], " to compute Haar Transforms of matrices. The modules are ", StyleBox["HWT2D", FontColor->RGBColor[1, 0, 0]], " and ", StyleBox["IHWT2D", FontColor->RGBColor[1, 0, 0]], ". Both modules require two arguments. The first is the input matrix. The \ second argument is the number of iterations." }], "Text", CellChangeTimes->{{3.40856574871875*^9, 3.40856575571875*^9}, { 3.408565790390625*^9, 3.408565821390625*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Available Images", "Section", CellChangeTimes->{{3.408566424859375*^9, 3.40856642509375*^9}, { 3.40856666034375*^9, 3.40856666378125*^9}}], Cell[TextData[{ "The ", StyleBox["DiscreteWavelets", FontColor->RGBColor[1, 0, 0]], " packages comes with 18 grayscale images. You can see information about \ these images (name, size, etc.) by issuing the command ", StyleBox["ImageList", FontColor->RGBColor[1, 0, 0]], "." }], "Text", CellChangeTimes->{{3.40856643015625*^9, 3.408566482328125*^9}}], Cell[BoxData[ RowBox[{ StyleBox["ImageList", FontColor->RGBColor[1, 0, 0]], "[", RowBox[{"ImageType", "\[Rule]", "GrayScale"}], "]"}]], "Input", CellChangeTimes->{{3.408566491578125*^9, 3.40856650215625*^9}, { 3.408567558484375*^9, 3.408567558796875*^9}}], Cell[TextData[{ "You can also get a look at these images by using the command ", StyleBox["ShowThumbnails", FontColor->RGBColor[1, 0, 0]], ". " }], "Text", CellChangeTimes->{{3.408635831734375*^9, 3.40863590271875*^9}}], Cell[BoxData[ RowBox[{ StyleBox["ShowThumbnails", FontColor->RGBColor[1, 0, 0]], "[", RowBox[{"ImageType", "\[Rule]", "GrayScale"}], "]"}]], "Input", CellChangeTimes->{{3.408635905203125*^9, 3.408635912609375*^9}}], Cell[TextData[{ "No matter where you installed the ", StyleBox["DiscreteWavelets", FontColor->RGBColor[1, 0, 0]], " package on your computer, you can retrieve the absolute path and file name \ for each included image. The command ", StyleBox["ImageNames", FontColor->RGBColor[1, 0, 0]], " produces a list of file names." }], "Text", CellChangeTimes->{{3.40856651390625*^9, 3.408566597796875*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"gray", "=", RowBox[{ StyleBox["ImageNames", FontColor->RGBColor[1, 0, 0]], "[", RowBox[{"ImageType", "\[Rule]", "GrayScale"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"gray", "[", RowBox[{"[", "1", "]"}], "]"}]}], "Input", CellChangeTimes->{{3.40856660190625*^9, 3.40856662253125*^9}, { 3.408567556296875*^9, 3.4085675565625*^9}, {3.42162778909375*^9, 3.421627789203125*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Loading and Plotting Images", "Section", CellChangeTimes->{{3.40856667084375*^9, 3.40856669671875*^9}}], Cell["\<\ Once you have the list of file names, it is very easy to load and plot \ images. Let's load the first image in the list.\ \>", "Text", CellChangeTimes->{{3.408566678375*^9, 3.408566710125*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{ StyleBox["ImageRead", FontColor->RGBColor[1, 0, 0]], "[", RowBox[{"gray", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ StyleBox["ImagePlot", FontColor->RGBColor[1, 0, 0]], "[", "A", "]"}]}], "Input", CellChangeTimes->{{3.408566701640625*^9, 3.408566736734375*^9}, { 3.408567553625*^9, 3.408567553875*^9}, {3.421627787171875*^9, 3.42162778728125*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Using HWT2D", "Section", CellChangeTimes->{3.408662937296875*^9}], Cell["\<\ In the cell below, we compute and plot the two-dimensional HWT of image A. \ We compute the transform of N[A] to speed up the computation.\ \>", "Text", CellChangeTimes->{{3.408566859109375*^9, 3.408566871125*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ StyleBox["B", FontColor->GrayLevel[0]], " ", "=", " ", RowBox[{ StyleBox["HWT2D", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{ RowBox[{"N", "[", "A", "]"}], ",", RowBox[{"NumIterations", "\[Rule]", "1"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], StyleBox[";", FontColor->GrayLevel[0]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "1"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], "Input", CellChangeTimes->{{3.408566878234375*^9, 3.40856691609375*^9}, { 3.408567550921875*^9, 3.40856755121875*^9}, {3.42162778540625*^9, 3.421627785515625*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Using IHWT2D", "Section", CellChangeTimes->{3.4086629409375*^9}], Cell["\<\ In the cell below, we compute the inverse transform of the image.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"B", " ", "=", " ", RowBox[{ StyleBox["HWT2D", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{ RowBox[{"N", "[", "A", "]"}], ",", RowBox[{"NumIterations", "\[Rule]", "1"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], StyleBox[";", FontColor->GrayLevel[0]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "1"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"origA", " ", "=", " ", RowBox[{ StyleBox["IHWT2D", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "1"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], StyleBox[";", FontColor->GrayLevel[0]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["ImagePlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox["origA", FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], "Input", CellChangeTimes->{{3.408566943140625*^9, 3.408567037125*^9}, { 3.4085675475*^9, 3.408567547765625*^9}, {3.421627783671875*^9, 3.421627783796875*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Iterating the Process", "Section"], Cell[TextData[{ "Just as with the one-dimensional HWT, we can iterate the two-dimensional \ HWT. In this case, the ", StyleBox["HWT2D", FontColor->RGBColor[1, 0, 0]], " is applied the approximation (blur) portion of the transform.\n\n", StyleBox["Warning: ", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], " Make sure to know the maximum amount of iterations you can compute before \ proceeding!! You can use ImageList to display the maximum number of \ iterations that can be performed on each of the included images." }], "Text", CellChangeTimes->{{3.4085670735*^9, 3.408567136625*^9}, {3.40856718575*^9, 3.408567207765625*^9}}], Cell[BoxData[ RowBox[{"ImageList", "[", RowBox[{"ImageType", "\[Rule]", "GrayScale"}], "]"}]], "Input", CellChangeTimes->{{3.408567143453125*^9, 3.4085671571875*^9}, { 3.408567211015625*^9, 3.40856721875*^9}, {3.40856754371875*^9, 3.408567544046875*^9}, {3.4216277814375*^9, 3.421627781578125*^9}}], Cell["\<\ Here we compute four iterations of the Haar wavelet transformation.\ \>", "Text", CellChangeTimes->{{3.408567230140625*^9, 3.40856724346875*^9}}], Cell[BoxData[{ StyleBox[ RowBox[{ RowBox[{"its", "=", "4"}], ";"}], FontColor->GrayLevel[0]], "\[IndentingNewLine]", RowBox[{ RowBox[{"B", " ", "=", StyleBox[" ", FontColor->RGBColor[0.501961, 0, 0]], RowBox[{ StyleBox["HWT2D", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{ RowBox[{"N", "[", "A", "]"}], ",", RowBox[{"NumIterations", "\[Rule]", "its"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], StyleBox[";", FontColor->GrayLevel[0]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "its"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], "Input", CellChangeTimes->{ 3.40856730640625*^9, {3.40856747234375*^9, 3.40856747884375*^9}, { 3.408567541140625*^9, 3.40856754146875*^9}, {3.40866311125*^9, 3.408663112921875*^9}, {3.421626920125*^9, 3.42162692234375*^9}}], Cell["\<\ You can plot various portions of the transform. Here is the vertical portion \ of the third iteration.\ \>", "Text", CellChangeTimes->{{3.408567350859375*^9, 3.408567360421875*^9}}], Cell[BoxData[ RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "its"}], ",", RowBox[{"Iteration", "\[Rule]", "3"}], ",", RowBox[{"Region", "\[Rule]", "Vertical"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]], "Input", CellChangeTimes->{{3.408567320671875*^9, 3.40856736390625*^9}, { 3.408567539078125*^9, 3.40856753934375*^9}, {3.42162777884375*^9, 3.421627779015625*^9}}], Cell["Here is the horizontal portion of the first iteration.", "Text", CellChangeTimes->{{3.40856736571875*^9, 3.40856737515625*^9}}], Cell[BoxData[ RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "its"}], ",", RowBox[{"Iteration", "\[Rule]", "1"}], ",", RowBox[{"Region", "\[Rule]", "Horizontal"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]], "Input", CellChangeTimes->{{3.408567320671875*^9, 3.40856736390625*^9}, 3.408567398203125*^9, {3.408567536875*^9, 3.40856753715625*^9}}], Cell["Here is the blur.", "Text", CellChangeTimes->{{3.40856740109375*^9, 3.408567403453125*^9}}], Cell[BoxData[ RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "its"}], ",", RowBox[{"Region", "\[Rule]", "Blur"}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]], "Input", CellChangeTimes->{{3.408567320671875*^9, 3.40856736390625*^9}, { 3.408567398203125*^9, 3.40856741353125*^9}, {3.4085675345625*^9, 3.408567534875*^9}}], Cell["We can \"blow up\" the blur.", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"rows", ",", "cols"}], "}"}], "=", RowBox[{"Dimensions", "[", "A", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ StyleBox["WaveletDensityPlot", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"B", ",", RowBox[{"NumIterations", "\[Rule]", "its"}], ",", RowBox[{"Region", "\[Rule]", "Blur"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"rows", "/", "2"}]}]}], FontColor->GrayLevel[0]], StyleBox["]", FontColor->GrayLevel[0]]}]}], "Input", CellChangeTimes->{{3.40856751325*^9, 3.40856753228125*^9}, 3.408663273203125*^9}] }, Open ]], Cell[CellGroupData[{ Cell["Writing Your Own Modules - MyHWT2D1", "Section", CellChangeTimes->{{3.421626969328125*^9, 3.42162698775*^9}}], Cell[TextData[{ "Let' s write a module to compute one iteration of the two - dimensional \ Haar wavelet transformation. We will call the routine ", StyleBox["MyHWT2D1", FontWeight->"Bold"], ". This module will use the module", StyleBox[" MyHWT1D1", FontWeight->"Bold"], " or ", StyleBox["HWT1D1", FontWeight->"Bold"], ". In the case of the former, make sure you have it loaded before you \ proceed.\n\nOur goal is to compute B = W A W^T. The routine ", StyleBox["MyHWT1D1", FontWeight->"Bold"], " computes W v where v is a vector. So to compute WA, we apply ", StyleBox["MyHWT1D1", FontWeight->"Bold"], " to each column of A. The Map command (see the Documentation Center) is \ very helpful for this task. Map takes a function f and a list s and applies \ f to each element in s. You can think of A (or better yet A^T) as a list of \ lists.\n\nOnce you have C = WA, all you need is B = C W^T. But B^T = W C^T. \ Can you use the Map function again in conjunction with ", StyleBox["MyHWT1D1", FontWeight->"Bold"], " to complete the task?\n\nPut your module for ", StyleBox["MyHWT2D1", FontWeight->"Bold"], " in the cell below." }], "Text", CellChangeTimes->{{3.421627001234375*^9, 3.421627359734375*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"MyHWT2D1", "[", "a_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", " ", RowBox[{"(*", " ", RowBox[{"put", " ", "local", " ", "variables", " ", "here"}], " ", "*)"}], "}"}], ","}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Put", " ", "commands", " ", "here"}], " ", "*)"}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.42162737278125*^9, 3.42162740209375*^9}}], Cell[CellGroupData[{ Cell["Test the module", "Subsection", CellChangeTimes->{{3.42162741390625*^9, 3.421627415890625*^9}}], Cell["Here is some code to test your module :", "Text", CellChangeTimes->{{3.42162742175*^9, 3.421627427625*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"gray", "=", RowBox[{"ImageNames", "[", RowBox[{ RowBox[{"ImageType", "\[Rule]", "GrayScale"}], ",", RowBox[{"ListThumbnails", "\[Rule]", "True"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"A", "=", RowBox[{"ImageRead", "[", RowBox[{"gray", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"B1", "=", RowBox[{"HWT2D1", "[", RowBox[{"N", "[", "A", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"B2", "=", RowBox[{"MyHWT2D1", "[", RowBox[{"N", "[", "A", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "=", RowBox[{"Max", "[", RowBox[{"Abs", "[", RowBox[{"B2", "-", "B1"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"x", "\[Equal]", "0"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.421627434359375*^9, 3.4216275781875*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Writing Your Own Modules - MyIHWT2D1", "Section", CellChangeTimes->{{3.421626969328125*^9, 3.42162698775*^9}, 3.421627598234375*^9}], Cell[TextData[{ "Writing a module for ", StyleBox["MyIHWT2D1", FontWeight->"Bold"], " uses the same ideas as ", StyleBox["MyHWT2D1", FontWeight->"Bold"], ". The only thing that is different is that we use ", StyleBox["MyIHWT1D1", FontWeight->"Bold"], " instead of ", StyleBox["MyHWT1D1", FontWeight->"Bold"], ". Put your code for ", StyleBox["MyIHWT2D1", FontWeight->"Bold"], " in the cell below." }], "Text", CellChangeTimes->{{3.42162760203125*^9, 3.42162766834375*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"MyIHWT2D1", "[", "a_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"(*", " ", RowBox[{"Put", " ", "local", " ", "variables", " ", "here"}], " ", "*)"}], "}"}], ","}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Put", " ", "commands", " ", "here"}], " ", "*)"}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.42162768865625*^9, 3.42162771171875*^9}}], Cell[CellGroupData[{ Cell["Testing the Module", "Subsection", CellChangeTimes->{{3.421627715734375*^9, 3.421627728484375*^9}}], Cell["Here is some code to test your module :", "Text", CellChangeTimes->{{3.42162742175*^9, 3.421627427625*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"gray", "=", RowBox[{"ImageNames", "[", RowBox[{ RowBox[{"ImageType", "\[Rule]", "GrayScale"}], ",", RowBox[{"ListThumbnails", "\[Rule]", "True"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"A", "=", RowBox[{"ImageRead", "[", RowBox[{"gray", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"B", "=", RowBox[{"MyHWT2D1", "[", RowBox[{"N", "[", "A", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"newA", " ", "=", " ", RowBox[{"MyIHWT2D1", "[", "B", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "=", RowBox[{"Max", "[", RowBox[{"Abs", "[", RowBox[{"A", "-", "newA"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"x", "\[Equal]", "0"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}], ";"}]}], "Input", CellChangeTimes->{{3.421627434359375*^9, 3.4216275781875*^9}, { 3.421627746046875*^9, 3.4216277710625*^9}}] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{1272, 683}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->1., FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (April 20, 2007)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "WindowsANSI"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 34, 0, 73, "Title"], Cell[627, 25, 149, 5, 96, "Subtitle"], Cell[779, 32, 158, 6, 89, "Subsubtitle"], Cell[CellGroupData[{ Cell[962, 42, 28, 0, 75, "Section"], Cell[993, 44, 112, 3, 29, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[1142, 52, 30, 0, 75, "Section"], Cell[1175, 54, 1259, 28, 119, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2471, 87, 82, 1, 75, "Section"], Cell[2556, 90, 283, 4, 41, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2876, 99, 66, 0, 75, "Section"], Cell[2945, 101, 546, 14, 79, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3528, 120, 147, 2, 75, "Section"], Cell[3678, 124, 360, 10, 45, "Text"], Cell[4041, 136, 267, 6, 39, "Input"], Cell[4311, 144, 226, 6, 28, "Text"], Cell[4540, 152, 224, 5, 39, "Input"], Cell[4767, 159, 407, 10, 62, "Text"], Cell[5177, 171, 450, 12, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[5664, 188, 110, 1, 75, "Section"], Cell[5777, 191, 205, 4, 45, "Text"], Cell[5985, 197, 481, 13, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6503, 215, 72, 1, 75, "Section"], Cell[6578, 218, 226, 4, 45, "Text"], Cell[6807, 224, 953, 32, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[7797, 261, 71, 1, 75, "Section"], Cell[7871, 264, 89, 2, 28, "Text"], Cell[7963, 268, 1603, 56, 111, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[9603, 329, 40, 0, 75, "Section"], Cell[9646, 331, 651, 14, 113, "Text"], Cell[10300, 347, 308, 5, 39, "Input"], Cell[10611, 354, 156, 3, 28, "Text"], Cell[10770, 359, 1144, 37, 75, "Input"], Cell[11917, 398, 193, 4, 28, "Text"], Cell[12113, 404, 572, 16, 39, "Input"], Cell[12688, 422, 134, 1, 28, "Text"], Cell[12825, 425, 546, 15, 57, "Input"], Cell[13374, 442, 98, 1, 28, "Text"], Cell[13475, 445, 515, 15, 39, "Input"], Cell[13993, 462, 44, 0, 28, "Text"], Cell[14040, 464, 686, 21, 75, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[14763, 490, 116, 1, 75, "Section"], Cell[14882, 493, 1242, 30, 232, "Text"], Cell[16127, 525, 507, 13, 75, "Input"], Cell[CellGroupData[{ Cell[16659, 542, 102, 1, 36, "Subsection"], Cell[16764, 545, 114, 1, 28, "Text"], Cell[16881, 548, 1158, 34, 129, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[18088, 588, 143, 2, 75, "Section"], Cell[18234, 592, 496, 18, 45, "Text"], Cell[18733, 612, 503, 13, 75, "Input"], Cell[CellGroupData[{ Cell[19261, 629, 106, 1, 36, "Subsection"], Cell[19370, 632, 114, 1, 28, "Text"], Cell[19487, 635, 1190, 34, 129, "Input"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)