(* 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[ 23569, 769] NotebookOptionsPosition[ 20768, 675] NotebookOutlinePosition[ 21205, 692] CellTagsIndexPosition[ 21162, 689] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Haar Transform 2D", "Title"], Cell["\<\ Wavelet Workshop June 2-5, 2009 University of South Florida\ \>", "Subtitle", CellChangeTimes->{{3.421426484890625*^9, 3.42142648821875*^9}, { 3.45281572096875*^9, 3.452815730953125*^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, 200, 6, 96, "Subtitle"], Cell[830, 33, 158, 6, 89, "Subsubtitle"], Cell[CellGroupData[{ Cell[1013, 43, 28, 0, 75, "Section"], Cell[1044, 45, 112, 3, 29, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[1193, 53, 30, 0, 75, "Section"], Cell[1226, 55, 1259, 28, 101, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2522, 88, 82, 1, 75, "Section"], Cell[2607, 91, 283, 4, 41, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2927, 100, 66, 0, 75, "Section"], Cell[2996, 102, 546, 14, 65, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3579, 121, 147, 2, 75, "Section"], Cell[3729, 125, 360, 10, 45, "Text"], Cell[4092, 137, 267, 6, 39, "Input"], Cell[4362, 145, 226, 6, 28, "Text"], Cell[4591, 153, 224, 5, 39, "Input"], Cell[4818, 160, 407, 10, 62, "Text"], Cell[5228, 172, 450, 12, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[5715, 189, 110, 1, 75, "Section"], Cell[5828, 192, 205, 4, 45, "Text"], Cell[6036, 198, 481, 13, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6554, 216, 72, 1, 75, "Section"], Cell[6629, 219, 226, 4, 45, "Text"], Cell[6858, 225, 953, 32, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[7848, 262, 71, 1, 75, "Section"], Cell[7922, 265, 89, 2, 28, "Text"], Cell[8014, 269, 1603, 56, 111, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[9654, 330, 40, 0, 75, "Section"], Cell[9697, 332, 651, 14, 113, "Text"], Cell[10351, 348, 308, 5, 39, "Input"], Cell[10662, 355, 156, 3, 28, "Text"], Cell[10821, 360, 1144, 37, 75, "Input"], Cell[11968, 399, 193, 4, 28, "Text"], Cell[12164, 405, 572, 16, 39, "Input"], Cell[12739, 423, 134, 1, 28, "Text"], Cell[12876, 426, 546, 15, 57, "Input"], Cell[13425, 443, 98, 1, 28, "Text"], Cell[13526, 446, 515, 15, 39, "Input"], Cell[14044, 463, 44, 0, 28, "Text"], Cell[14091, 465, 686, 21, 75, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[14814, 491, 116, 1, 75, "Section"], Cell[14933, 494, 1242, 30, 232, "Text"], Cell[16178, 526, 507, 13, 75, "Input"], Cell[CellGroupData[{ Cell[16710, 543, 102, 1, 36, "Subsection"], Cell[16815, 546, 114, 1, 28, "Text"], Cell[16932, 549, 1158, 34, 129, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[18139, 589, 143, 2, 75, "Section"], Cell[18285, 593, 496, 18, 45, "Text"], Cell[18784, 613, 503, 13, 75, "Input"], Cell[CellGroupData[{ Cell[19312, 630, 106, 1, 36, "Subsection"], Cell[19421, 633, 114, 1, 28, "Text"], Cell[19538, 636, 1190, 34, 129, "Input"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)