(* 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[ 9819, 309] NotebookOptionsPosition[ 8712, 265] NotebookOutlinePosition[ 9207, 285] CellTagsIndexPosition[ 9164, 282] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["mPower:pointsToConnectionMatrix Example", FontSize->18]], "Title", CellChangeTimes->{{3.4044996507577972`*^9, 3.4044996589900513`*^9}}], Cell["19 Nov 07 - verified in M6", "Text", CellChangeTimes->{{3.404499625872044*^9, 3.4044996327441196`*^9}}], Cell[CellGroupData[{ Cell["\<\ \[Copyright]2006 (click to the right for licensing information and details)\ \>", "Subsubsection"], Cell[TextData[{ "\[Copyright]2006 California Institute of Technology.\nAll Rights Reserved.\n\ \n", StyleBox["This library is free software; you can redistribute it and/or \ modify it under the terms of the GNU Lesser Public License as published by \ the Free Software Foundation; either version 2.1 of the License, or any later \ version.\n\nThis library is distributed in the hope that it will be useful, \ but WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF \ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and \ documentation provided hereunder is on an \"as is\" basis, and the \ California Institute of Technology has no obligations to provide maintenance, \ support, updates, enhancements or modifications. In no event shall the \ California Institute of Technology be liable to any party for direct, \ indirect, special, incidental or consequential damages, including lost \ profits, arising out of the use of this software and its documentation, even \ if the California Institute of Technology have been advised of the \ possibility of such damage. See the GNU Lesser General Public License for \ more details.\n\nYou should have received a copy of the GNU Lesser General \ Public License along with this library; if not, write to the Free Software \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.\n\n \ The original code contained here was initially developed by:\n\n \tBruce E. \ Shapiro\n \tBiological Network Modeling Center\n \tDivision of Biology, Mail \ Code 139-74\n \tCalifornia Institute of Technology\n \tPasadena, CA, 91125, \ USA\n \tbshapiro at caltech dot edu", FontSize->12] }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["pointsToConnectionMatrix", "Section"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"points", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"6.8", ",", "7.4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3."}], ",", "9.6"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "9.3"}], ",", RowBox[{"-", "6.9"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.4"}], ",", RowBox[{"-", "7.3"}]}], "}"}], ",", RowBox[{"{", RowBox[{"10.9", ",", RowBox[{"-", "7.1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "10.6"}], ",", RowBox[{"-", "17.5"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1."}], ",", RowBox[{"-", "17.5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"10.2", ",", RowBox[{"-", "17.5"}]}], "}"}]}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"6.8`", ",", "7.4`"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3.`"}], ",", "9.6`"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "9.3`"}], ",", RowBox[{"-", "6.9`"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.4`"}], ",", RowBox[{"-", "7.3`"}]}], "}"}], ",", RowBox[{"{", RowBox[{"10.9`", ",", RowBox[{"-", "7.1`"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "10.6`"}], ",", RowBox[{"-", "17.5`"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.`"}], ",", RowBox[{"-", "17.5`"}]}], "}"}], ",", RowBox[{"{", RowBox[{"10.2`", ",", RowBox[{"-", "17.5`"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.404499610095643*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"pointsToConnectionMatrix", "[", "points", "]"}], "//", "MatrixForm"}]], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "1", "1", "1", "1", "0", "0", "0"}, {"1", "0", "1", "0", "0", "1", "0", "0", "0"}, {"1", "1", "0", "0", "0", "0", "0", "0", "0"}, {"1", "0", "0", "0", "1", "0", "1", "1", "0"}, {"1", "0", "0", "1", "0", "1", "0", "1", "1"}, {"1", "1", "0", "0", "1", "0", "0", "0", "1"}, {"0", "0", "0", "1", "0", "0", "0", "1", "0"}, {"0", "0", "0", "1", "1", "0", "1", "0", "1"}, {"0", "0", "0", "0", "1", "1", "0", "1", "0"} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.4044996126943483`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"dt", "=", RowBox[{"delaunayTriangulation", "[", "points", "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"edges", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "9"}], "}"}]}], "}"}]}], ",", RowBox[{"statistics", "\[Rule]", RowBox[{"{", RowBox[{ "11.48742936392689`", ",", "10.679419459877021`", ",", "2.560791288223172`"}], "}"}]}]}], "}"}]], "Output", CellChangeTimes->{3.4044996158654757`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"delaunayTriangulationToConnectionMatrix", "[", RowBox[{"edges", "/.", "dt"}], "]"}], "//", "MatrixForm"}]], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "1", "1", "1", "1", "0", "0", "0"}, {"1", "0", "1", "0", "0", "1", "0", "0", "0"}, {"1", "1", "0", "1", "0", "0", "0", "0", "0"}, {"1", "0", "1", "0", "1", "0", "1", "1", "0"}, {"1", "0", "0", "1", "0", "1", "0", "1", "1"}, {"1", "1", "0", "0", "1", "0", "0", "0", "1"}, {"0", "0", "0", "1", "0", "0", "0", "1", "0"}, {"0", "0", "0", "1", "1", "0", "1", "0", "1"}, {"0", "0", "0", "0", "1", "1", "0", "1", "0"} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.404499618286171*^9}] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{711, 820}, WindowMargins->{{Automatic, 442}, {Automatic, 143}}, DockedCells->(FrontEndExecute[{ FrontEnd`NotebookApply[ FrontEnd`InputNotebook[], #, Placeholder]}]& ), CellLabelAutoDelete->True, Magnification->1., FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 161, 2, 58, "Title"], Cell[754, 27, 110, 1, 26, "Text"], Cell[CellGroupData[{ Cell[889, 32, 108, 2, 25, "Subsubsection"], Cell[1000, 36, 1679, 25, 386, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[2716, 66, 43, 0, 37, "Section"], Cell[CellGroupData[{ Cell[2784, 70, 908, 32, 43, "Input"], Cell[3695, 104, 909, 32, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4641, 141, 118, 3, 27, "Input"], Cell[4762, 146, 1061, 25, 157, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5860, 176, 103, 2, 27, "Input"], Cell[5966, 180, 1452, 45, 58, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7455, 230, 155, 3, 27, "Input"], Cell[7613, 235, 1059, 25, 157, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)