commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r857590 [15/48] - in /websites/production/commons/content/proper/commons-math/xref-test: ./ org/apache/commons/math3/ org/apache/commons/math3/analysis/ org/apache/commons/math3/analysis/differentiation/ org/apache/commons/math3/analysis/fu...
Date Sun, 07 Apr 2013 07:52:13 GMT
Modified: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/linear/Array2DRowRealMatrixTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/linear/Array2DRowRealMatrixTest.html (original)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/linear/Array2DRowRealMatrixTest.html Sun Apr  7 07:52:05 2013
@@ -42,7 +42,7 @@
 <a class="jxr_linenumber" name="32" href="#32">32</a>  <em class="jxr_javadoccomment">/**</em>
 <a class="jxr_linenumber" name="33" href="#33">33</a>  <em class="jxr_javadoccomment"> * Test cases for the {@link Array2DRowRealMatrix} class.</em>
 <a class="jxr_linenumber" name="34" href="#34">34</a>  <em class="jxr_javadoccomment"> *</em>
-<a class="jxr_linenumber" name="35" href="#35">35</a>  <em class="jxr_javadoccomment"> * @version $Id: Array2DRowRealMatrixTest.java 1364030 2012-07-21 01:10:04Z erans $</em>
+<a class="jxr_linenumber" name="35" href="#35">35</a>  <em class="jxr_javadoccomment"> * @version $Id: Array2DRowRealMatrixTest.java 1459534 2013-03-21 21:24:45Z tn $</em>
 <a class="jxr_linenumber" name="36" href="#36">36</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="37" href="#37">37</a>  
 <a class="jxr_linenumber" name="38" href="#38">38</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/commons/math3/linear/Array2DRowRealMatrixTest.html">Array2DRowRealMatrixTest</a> {
@@ -547,621 +547,640 @@
 <a class="jxr_linenumber" name="537" href="#537">537</a>         checkCopy(m, <strong class="jxr_keyword">null</strong>,  1, 0, 2, 4, <strong class="jxr_keyword">true</strong>);
 <a class="jxr_linenumber" name="538" href="#538">538</a>         checkCopy(m, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {},    <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 0 }, <strong class="jxr_keyword">true</strong>);
 <a class="jxr_linenumber" name="539" href="#539">539</a>         checkCopy(m, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 0 }, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 4 }, <strong class="jxr_keyword">true</strong>);
-<a class="jxr_linenumber" name="540" href="#540">540</a>     }
-<a class="jxr_linenumber" name="541" href="#541">541</a> 
-<a class="jxr_linenumber" name="542" href="#542">542</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> checkCopy(RealMatrix m, <strong class="jxr_keyword">double</strong>[][] reference,
-<a class="jxr_linenumber" name="543" href="#543">543</a>                            <strong class="jxr_keyword">int</strong> startRow, <strong class="jxr_keyword">int</strong> endRow, <strong class="jxr_keyword">int</strong> startColumn, <strong class="jxr_keyword">int</strong> endColumn,
-<a class="jxr_linenumber" name="544" href="#544">544</a>                            <strong class="jxr_keyword">boolean</strong> mustFail) {
-<a class="jxr_linenumber" name="545" href="#545">545</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="546" href="#546">546</a>             <strong class="jxr_keyword">double</strong>[][] sub = (reference == <strong class="jxr_keyword">null</strong>) ?
-<a class="jxr_linenumber" name="547" href="#547">547</a>                              <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[1][1] :
-<a class="jxr_linenumber" name="548" href="#548">548</a>                              <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[reference.length][reference[0].length];
-<a class="jxr_linenumber" name="549" href="#549">549</a>             m.copySubMatrix(startRow, endRow, startColumn, endColumn, sub);
-<a class="jxr_linenumber" name="550" href="#550">550</a>             Assert.assertEquals(<strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(reference), <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(sub));
-<a class="jxr_linenumber" name="551" href="#551">551</a>             <strong class="jxr_keyword">if</strong> (mustFail) {
-<a class="jxr_linenumber" name="552" href="#552">552</a>                 Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException"</span>);
-<a class="jxr_linenumber" name="553" href="#553">553</a>             }
-<a class="jxr_linenumber" name="554" href="#554">554</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
-<a class="jxr_linenumber" name="555" href="#555">555</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
-<a class="jxr_linenumber" name="556" href="#556">556</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="540" href="#540">540</a>         
+<a class="jxr_linenumber" name="541" href="#541">541</a>         <em class="jxr_comment">// rectangular check</em>
+<a class="jxr_linenumber" name="542" href="#542">542</a>         <strong class="jxr_keyword">double</strong>[][] copy = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] { { 0, 0, 0 }, { 0, 0 } };
+<a class="jxr_linenumber" name="543" href="#543">543</a>         checkCopy(m, copy, 0, 1, 0, 2, <strong class="jxr_keyword">true</strong>);
+<a class="jxr_linenumber" name="544" href="#544">544</a>         checkCopy(m, copy, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 0, 1 }, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 0, 1, 2 }, <strong class="jxr_keyword">true</strong>);
+<a class="jxr_linenumber" name="545" href="#545">545</a>     }
+<a class="jxr_linenumber" name="546" href="#546">546</a> 
+<a class="jxr_linenumber" name="547" href="#547">547</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> checkCopy(RealMatrix m, <strong class="jxr_keyword">double</strong>[][] reference,
+<a class="jxr_linenumber" name="548" href="#548">548</a>                            <strong class="jxr_keyword">int</strong> startRow, <strong class="jxr_keyword">int</strong> endRow, <strong class="jxr_keyword">int</strong> startColumn, <strong class="jxr_keyword">int</strong> endColumn,
+<a class="jxr_linenumber" name="549" href="#549">549</a>                            <strong class="jxr_keyword">boolean</strong> mustFail) {
+<a class="jxr_linenumber" name="550" href="#550">550</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="551" href="#551">551</a>             <strong class="jxr_keyword">double</strong>[][] sub = (reference == <strong class="jxr_keyword">null</strong>) ?
+<a class="jxr_linenumber" name="552" href="#552">552</a>                              <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[1][1] : createIdenticalCopy(reference);
+<a class="jxr_linenumber" name="553" href="#553">553</a>             m.copySubMatrix(startRow, endRow, startColumn, endColumn, sub);
+<a class="jxr_linenumber" name="554" href="#554">554</a>             Assert.assertEquals(<strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(reference), <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(sub));
+<a class="jxr_linenumber" name="555" href="#555">555</a>             <strong class="jxr_keyword">if</strong> (mustFail) {
+<a class="jxr_linenumber" name="556" href="#556">556</a>                 Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException"</span>);
 <a class="jxr_linenumber" name="557" href="#557">557</a>             }
-<a class="jxr_linenumber" name="558" href="#558">558</a>         } <strong class="jxr_keyword">catch</strong> (NumberIsTooSmallException e) {
+<a class="jxr_linenumber" name="558" href="#558">558</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
 <a class="jxr_linenumber" name="559" href="#559">559</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
 <a class="jxr_linenumber" name="560" href="#560">560</a>                 <strong class="jxr_keyword">throw</strong> e;
 <a class="jxr_linenumber" name="561" href="#561">561</a>             }
-<a class="jxr_linenumber" name="562" href="#562">562</a>         } <strong class="jxr_keyword">catch</strong> (NoDataException e) {
+<a class="jxr_linenumber" name="562" href="#562">562</a>         } <strong class="jxr_keyword">catch</strong> (NumberIsTooSmallException e) {
 <a class="jxr_linenumber" name="563" href="#563">563</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
 <a class="jxr_linenumber" name="564" href="#564">564</a>                 <strong class="jxr_keyword">throw</strong> e;
 <a class="jxr_linenumber" name="565" href="#565">565</a>             }
-<a class="jxr_linenumber" name="566" href="#566">566</a>         }
-<a class="jxr_linenumber" name="567" href="#567">567</a>     }
-<a class="jxr_linenumber" name="568" href="#568">568</a> 
-<a class="jxr_linenumber" name="569" href="#569">569</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> checkCopy(RealMatrix m, <strong class="jxr_keyword">double</strong>[][] reference,
-<a class="jxr_linenumber" name="570" href="#570">570</a>                            <strong class="jxr_keyword">int</strong>[] selectedRows, <strong class="jxr_keyword">int</strong>[] selectedColumns,
-<a class="jxr_linenumber" name="571" href="#571">571</a>                            <strong class="jxr_keyword">boolean</strong> mustFail) {
-<a class="jxr_linenumber" name="572" href="#572">572</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="573" href="#573">573</a>             <strong class="jxr_keyword">double</strong>[][] sub = (reference == <strong class="jxr_keyword">null</strong>) ?
-<a class="jxr_linenumber" name="574" href="#574">574</a>                     <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[1][1] :
-<a class="jxr_linenumber" name="575" href="#575">575</a>                     <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[reference.length][reference[0].length];
-<a class="jxr_linenumber" name="576" href="#576">576</a>             m.copySubMatrix(selectedRows, selectedColumns, sub);
-<a class="jxr_linenumber" name="577" href="#577">577</a>             Assert.assertEquals(<strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(reference), <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(sub));
-<a class="jxr_linenumber" name="578" href="#578">578</a>             <strong class="jxr_keyword">if</strong> (mustFail) {
-<a class="jxr_linenumber" name="579" href="#579">579</a>                 Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException"</span>);
-<a class="jxr_linenumber" name="580" href="#580">580</a>             }
-<a class="jxr_linenumber" name="581" href="#581">581</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
-<a class="jxr_linenumber" name="582" href="#582">582</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
-<a class="jxr_linenumber" name="583" href="#583">583</a>                 <strong class="jxr_keyword">throw</strong> e;
-<a class="jxr_linenumber" name="584" href="#584">584</a>             }
-<a class="jxr_linenumber" name="585" href="#585">585</a>         } <strong class="jxr_keyword">catch</strong> (NumberIsTooSmallException e) {
-<a class="jxr_linenumber" name="586" href="#586">586</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
-<a class="jxr_linenumber" name="587" href="#587">587</a>                 <strong class="jxr_keyword">throw</strong> e;
-<a class="jxr_linenumber" name="588" href="#588">588</a>             }
-<a class="jxr_linenumber" name="589" href="#589">589</a>         } <strong class="jxr_keyword">catch</strong> (NoDataException e) {
-<a class="jxr_linenumber" name="590" href="#590">590</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
-<a class="jxr_linenumber" name="591" href="#591">591</a>                 <strong class="jxr_keyword">throw</strong> e;
-<a class="jxr_linenumber" name="592" href="#592">592</a>             }
-<a class="jxr_linenumber" name="593" href="#593">593</a>         }
-<a class="jxr_linenumber" name="594" href="#594">594</a>     }
-<a class="jxr_linenumber" name="595" href="#595">595</a> 
-<a class="jxr_linenumber" name="596" href="#596">596</a>     @Test
-<a class="jxr_linenumber" name="597" href="#597">597</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRowMatrix() {
-<a class="jxr_linenumber" name="598" href="#598">598</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="599" href="#599">599</a>         RealMatrix mRow0 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow0);
-<a class="jxr_linenumber" name="600" href="#600">600</a>         RealMatrix mRow3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow3);
-<a class="jxr_linenumber" name="601" href="#601">601</a>         Assert.assertEquals(<span class="jxr_string">"Row0"</span>, mRow0,
-<a class="jxr_linenumber" name="602" href="#602">602</a>                 m.getRowMatrix(0));
-<a class="jxr_linenumber" name="603" href="#603">603</a>         Assert.assertEquals(<span class="jxr_string">"Row3"</span>, mRow3,
-<a class="jxr_linenumber" name="604" href="#604">604</a>                 m.getRowMatrix(3));
-<a class="jxr_linenumber" name="605" href="#605">605</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="606" href="#606">606</a>             m.getRowMatrix(-1);
-<a class="jxr_linenumber" name="607" href="#607">607</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="608" href="#608">608</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="609" href="#609">609</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="610" href="#610">610</a>         }
-<a class="jxr_linenumber" name="611" href="#611">611</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="612" href="#612">612</a>             m.getRowMatrix(4);
-<a class="jxr_linenumber" name="613" href="#613">613</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="614" href="#614">614</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="615" href="#615">615</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="616" href="#616">616</a>         }
-<a class="jxr_linenumber" name="617" href="#617">617</a>     }
-<a class="jxr_linenumber" name="618" href="#618">618</a> 
-<a class="jxr_linenumber" name="619" href="#619">619</a>     @Test
-<a class="jxr_linenumber" name="620" href="#620">620</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetRowMatrix() {
-<a class="jxr_linenumber" name="621" href="#621">621</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="622" href="#622">622</a>         RealMatrix mRow3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow3);
-<a class="jxr_linenumber" name="623" href="#623">623</a>         Assert.assertNotSame(mRow3, m.getRowMatrix(0));
-<a class="jxr_linenumber" name="624" href="#624">624</a>         m.setRowMatrix(0, mRow3);
-<a class="jxr_linenumber" name="625" href="#625">625</a>         Assert.assertEquals(mRow3, m.getRowMatrix(0));
-<a class="jxr_linenumber" name="626" href="#626">626</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="627" href="#627">627</a>             m.setRowMatrix(-1, mRow3);
-<a class="jxr_linenumber" name="628" href="#628">628</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="629" href="#629">629</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="630" href="#630">630</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="631" href="#631">631</a>         }
-<a class="jxr_linenumber" name="632" href="#632">632</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="633" href="#633">633</a>             m.setRowMatrix(0, m);
-<a class="jxr_linenumber" name="634" href="#634">634</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="635" href="#635">635</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="636" href="#636">636</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="637" href="#637">637</a>         }
-<a class="jxr_linenumber" name="638" href="#638">638</a>     }
-<a class="jxr_linenumber" name="639" href="#639">639</a> 
-<a class="jxr_linenumber" name="640" href="#640">640</a>     @Test
-<a class="jxr_linenumber" name="641" href="#641">641</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetColumnMatrix() {
-<a class="jxr_linenumber" name="642" href="#642">642</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="643" href="#643">643</a>         RealMatrix mColumn1 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn1);
-<a class="jxr_linenumber" name="644" href="#644">644</a>         RealMatrix mColumn3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn3);
-<a class="jxr_linenumber" name="645" href="#645">645</a>         Assert.assertEquals(<span class="jxr_string">"Column1"</span>, mColumn1,
-<a class="jxr_linenumber" name="646" href="#646">646</a>                 m.getColumnMatrix(1));
-<a class="jxr_linenumber" name="647" href="#647">647</a>         Assert.assertEquals(<span class="jxr_string">"Column3"</span>, mColumn3,
-<a class="jxr_linenumber" name="648" href="#648">648</a>                 m.getColumnMatrix(3));
-<a class="jxr_linenumber" name="649" href="#649">649</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="650" href="#650">650</a>             m.getColumnMatrix(-1);
-<a class="jxr_linenumber" name="651" href="#651">651</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="652" href="#652">652</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="653" href="#653">653</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="654" href="#654">654</a>         }
-<a class="jxr_linenumber" name="655" href="#655">655</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="656" href="#656">656</a>             m.getColumnMatrix(4);
-<a class="jxr_linenumber" name="657" href="#657">657</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="658" href="#658">658</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="659" href="#659">659</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="660" href="#660">660</a>         }
-<a class="jxr_linenumber" name="661" href="#661">661</a>     }
-<a class="jxr_linenumber" name="662" href="#662">662</a> 
-<a class="jxr_linenumber" name="663" href="#663">663</a>     @Test
-<a class="jxr_linenumber" name="664" href="#664">664</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetColumnMatrix() {
-<a class="jxr_linenumber" name="665" href="#665">665</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="666" href="#666">666</a>         RealMatrix mColumn3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn3);
-<a class="jxr_linenumber" name="667" href="#667">667</a>         Assert.assertNotSame(mColumn3, m.getColumnMatrix(1));
-<a class="jxr_linenumber" name="668" href="#668">668</a>         m.setColumnMatrix(1, mColumn3);
-<a class="jxr_linenumber" name="669" href="#669">669</a>         Assert.assertEquals(mColumn3, m.getColumnMatrix(1));
-<a class="jxr_linenumber" name="670" href="#670">670</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="671" href="#671">671</a>             m.setColumnMatrix(-1, mColumn3);
-<a class="jxr_linenumber" name="672" href="#672">672</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="673" href="#673">673</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="674" href="#674">674</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="675" href="#675">675</a>         }
-<a class="jxr_linenumber" name="676" href="#676">676</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="677" href="#677">677</a>             m.setColumnMatrix(0, m);
-<a class="jxr_linenumber" name="678" href="#678">678</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="679" href="#679">679</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="680" href="#680">680</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="681" href="#681">681</a>         }
-<a class="jxr_linenumber" name="682" href="#682">682</a>     }
-<a class="jxr_linenumber" name="683" href="#683">683</a> 
-<a class="jxr_linenumber" name="684" href="#684">684</a>     @Test
-<a class="jxr_linenumber" name="685" href="#685">685</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRowVector() {
-<a class="jxr_linenumber" name="686" href="#686">686</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="687" href="#687">687</a>         RealVector mRow0 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow0[0]);
-<a class="jxr_linenumber" name="688" href="#688">688</a>         RealVector mRow3 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow3[0]);
-<a class="jxr_linenumber" name="689" href="#689">689</a>         Assert.assertEquals(<span class="jxr_string">"Row0"</span>, mRow0, m.getRowVector(0));
-<a class="jxr_linenumber" name="690" href="#690">690</a>         Assert.assertEquals(<span class="jxr_string">"Row3"</span>, mRow3, m.getRowVector(3));
-<a class="jxr_linenumber" name="691" href="#691">691</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="692" href="#692">692</a>             m.getRowVector(-1);
-<a class="jxr_linenumber" name="693" href="#693">693</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="694" href="#694">694</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="695" href="#695">695</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="696" href="#696">696</a>         }
-<a class="jxr_linenumber" name="697" href="#697">697</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="698" href="#698">698</a>             m.getRowVector(4);
-<a class="jxr_linenumber" name="699" href="#699">699</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="700" href="#700">700</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="701" href="#701">701</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="702" href="#702">702</a>         }
-<a class="jxr_linenumber" name="703" href="#703">703</a>     }
-<a class="jxr_linenumber" name="704" href="#704">704</a> 
-<a class="jxr_linenumber" name="705" href="#705">705</a>     @Test
-<a class="jxr_linenumber" name="706" href="#706">706</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetRowVector() {
-<a class="jxr_linenumber" name="707" href="#707">707</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="708" href="#708">708</a>         RealVector mRow3 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow3[0]);
-<a class="jxr_linenumber" name="709" href="#709">709</a>         Assert.assertNotSame(mRow3, m.getRowMatrix(0));
-<a class="jxr_linenumber" name="710" href="#710">710</a>         m.setRowVector(0, mRow3);
-<a class="jxr_linenumber" name="711" href="#711">711</a>         Assert.assertEquals(mRow3, m.getRowVector(0));
-<a class="jxr_linenumber" name="712" href="#712">712</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="713" href="#713">713</a>             m.setRowVector(-1, mRow3);
-<a class="jxr_linenumber" name="714" href="#714">714</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="715" href="#715">715</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="716" href="#716">716</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="717" href="#717">717</a>         }
-<a class="jxr_linenumber" name="718" href="#718">718</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="719" href="#719">719</a>             m.setRowVector(0, <strong class="jxr_keyword">new</strong> ArrayRealVector(5));
-<a class="jxr_linenumber" name="720" href="#720">720</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="721" href="#721">721</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="722" href="#722">722</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="723" href="#723">723</a>         }
-<a class="jxr_linenumber" name="724" href="#724">724</a>     }
-<a class="jxr_linenumber" name="725" href="#725">725</a> 
-<a class="jxr_linenumber" name="726" href="#726">726</a>     @Test
-<a class="jxr_linenumber" name="727" href="#727">727</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetColumnVector() {
-<a class="jxr_linenumber" name="728" href="#728">728</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="729" href="#729">729</a>         RealVector mColumn1 = columnToVector(subColumn1);
-<a class="jxr_linenumber" name="730" href="#730">730</a>         RealVector mColumn3 = columnToVector(subColumn3);
-<a class="jxr_linenumber" name="731" href="#731">731</a>         Assert.assertEquals(<span class="jxr_string">"Column1"</span>, mColumn1, m.getColumnVector(1));
-<a class="jxr_linenumber" name="732" href="#732">732</a>         Assert.assertEquals(<span class="jxr_string">"Column3"</span>, mColumn3, m.getColumnVector(3));
-<a class="jxr_linenumber" name="733" href="#733">733</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="734" href="#734">734</a>             m.getColumnVector(-1);
-<a class="jxr_linenumber" name="735" href="#735">735</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="736" href="#736">736</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="737" href="#737">737</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="738" href="#738">738</a>         }
-<a class="jxr_linenumber" name="739" href="#739">739</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="740" href="#740">740</a>             m.getColumnVector(4);
-<a class="jxr_linenumber" name="741" href="#741">741</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="742" href="#742">742</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="743" href="#743">743</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="744" href="#744">744</a>         }
-<a class="jxr_linenumber" name="745" href="#745">745</a>     }
-<a class="jxr_linenumber" name="746" href="#746">746</a> 
-<a class="jxr_linenumber" name="747" href="#747">747</a>     @Test
-<a class="jxr_linenumber" name="748" href="#748">748</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetColumnVector() {
-<a class="jxr_linenumber" name="749" href="#749">749</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="750" href="#750">750</a>         RealVector mColumn3 = columnToVector(subColumn3);
-<a class="jxr_linenumber" name="751" href="#751">751</a>         Assert.assertNotSame(mColumn3, m.getColumnVector(1));
-<a class="jxr_linenumber" name="752" href="#752">752</a>         m.setColumnVector(1, mColumn3);
-<a class="jxr_linenumber" name="753" href="#753">753</a>         Assert.assertEquals(mColumn3, m.getColumnVector(1));
-<a class="jxr_linenumber" name="754" href="#754">754</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="755" href="#755">755</a>             m.setColumnVector(-1, mColumn3);
-<a class="jxr_linenumber" name="756" href="#756">756</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="757" href="#757">757</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="758" href="#758">758</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="759" href="#759">759</a>         }
-<a class="jxr_linenumber" name="760" href="#760">760</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="761" href="#761">761</a>             m.setColumnVector(0, <strong class="jxr_keyword">new</strong> ArrayRealVector(5));
-<a class="jxr_linenumber" name="762" href="#762">762</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="763" href="#763">763</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="764" href="#764">764</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="765" href="#765">765</a>         }
-<a class="jxr_linenumber" name="766" href="#766">766</a>     }
-<a class="jxr_linenumber" name="767" href="#767">767</a> 
-<a class="jxr_linenumber" name="768" href="#768">768</a>     <strong class="jxr_keyword">private</strong> RealVector columnToVector(<strong class="jxr_keyword">double</strong>[][] column) {
-<a class="jxr_linenumber" name="769" href="#769">769</a>         <strong class="jxr_keyword">double</strong>[] data = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[column.length];
-<a class="jxr_linenumber" name="770" href="#770">770</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; data.length; ++i) {
-<a class="jxr_linenumber" name="771" href="#771">771</a>             data[i] = column[i][0];
-<a class="jxr_linenumber" name="772" href="#772">772</a>         }
-<a class="jxr_linenumber" name="773" href="#773">773</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> ArrayRealVector(data, false);
-<a class="jxr_linenumber" name="774" href="#774">774</a>     }
-<a class="jxr_linenumber" name="775" href="#775">775</a> 
-<a class="jxr_linenumber" name="776" href="#776">776</a>     @Test
-<a class="jxr_linenumber" name="777" href="#777">777</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRow() {
-<a class="jxr_linenumber" name="778" href="#778">778</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="779" href="#779">779</a>         checkArrays(subRow0[0], m.getRow(0));
-<a class="jxr_linenumber" name="780" href="#780">780</a>         checkArrays(subRow3[0], m.getRow(3));
-<a class="jxr_linenumber" name="781" href="#781">781</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="782" href="#782">782</a>             m.getRow(-1);
-<a class="jxr_linenumber" name="783" href="#783">783</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="784" href="#784">784</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="785" href="#785">785</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="786" href="#786">786</a>         }
-<a class="jxr_linenumber" name="787" href="#787">787</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="788" href="#788">788</a>             m.getRow(4);
-<a class="jxr_linenumber" name="789" href="#789">789</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="790" href="#790">790</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="791" href="#791">791</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="792" href="#792">792</a>         }
+<a class="jxr_linenumber" name="566" href="#566">566</a>         } <strong class="jxr_keyword">catch</strong> (NoDataException e) {
+<a class="jxr_linenumber" name="567" href="#567">567</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="568" href="#568">568</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="569" href="#569">569</a>             }
+<a class="jxr_linenumber" name="570" href="#570">570</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException e) {
+<a class="jxr_linenumber" name="571" href="#571">571</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="572" href="#572">572</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="573" href="#573">573</a>             }
+<a class="jxr_linenumber" name="574" href="#574">574</a>         }
+<a class="jxr_linenumber" name="575" href="#575">575</a>     }
+<a class="jxr_linenumber" name="576" href="#576">576</a> 
+<a class="jxr_linenumber" name="577" href="#577">577</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> checkCopy(RealMatrix m, <strong class="jxr_keyword">double</strong>[][] reference,
+<a class="jxr_linenumber" name="578" href="#578">578</a>                            <strong class="jxr_keyword">int</strong>[] selectedRows, <strong class="jxr_keyword">int</strong>[] selectedColumns,
+<a class="jxr_linenumber" name="579" href="#579">579</a>                            <strong class="jxr_keyword">boolean</strong> mustFail) {
+<a class="jxr_linenumber" name="580" href="#580">580</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="581" href="#581">581</a>             <strong class="jxr_keyword">double</strong>[][] sub = (reference == <strong class="jxr_keyword">null</strong>) ?
+<a class="jxr_linenumber" name="582" href="#582">582</a>                     <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[1][1] : createIdenticalCopy(reference);
+<a class="jxr_linenumber" name="583" href="#583">583</a>             m.copySubMatrix(selectedRows, selectedColumns, sub);
+<a class="jxr_linenumber" name="584" href="#584">584</a>             Assert.assertEquals(<strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(reference), <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(sub));
+<a class="jxr_linenumber" name="585" href="#585">585</a>             <strong class="jxr_keyword">if</strong> (mustFail) {
+<a class="jxr_linenumber" name="586" href="#586">586</a>                 Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException"</span>);
+<a class="jxr_linenumber" name="587" href="#587">587</a>             }
+<a class="jxr_linenumber" name="588" href="#588">588</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
+<a class="jxr_linenumber" name="589" href="#589">589</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="590" href="#590">590</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="591" href="#591">591</a>             }
+<a class="jxr_linenumber" name="592" href="#592">592</a>         } <strong class="jxr_keyword">catch</strong> (NumberIsTooSmallException e) {
+<a class="jxr_linenumber" name="593" href="#593">593</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="594" href="#594">594</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="595" href="#595">595</a>             }
+<a class="jxr_linenumber" name="596" href="#596">596</a>         } <strong class="jxr_keyword">catch</strong> (NoDataException e) {
+<a class="jxr_linenumber" name="597" href="#597">597</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="598" href="#598">598</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="599" href="#599">599</a>             }
+<a class="jxr_linenumber" name="600" href="#600">600</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException e) {
+<a class="jxr_linenumber" name="601" href="#601">601</a>             <strong class="jxr_keyword">if</strong> (!mustFail) {
+<a class="jxr_linenumber" name="602" href="#602">602</a>                 <strong class="jxr_keyword">throw</strong> e;
+<a class="jxr_linenumber" name="603" href="#603">603</a>             }
+<a class="jxr_linenumber" name="604" href="#604">604</a>         }
+<a class="jxr_linenumber" name="605" href="#605">605</a>     }
+<a class="jxr_linenumber" name="606" href="#606">606</a> 
+<a class="jxr_linenumber" name="607" href="#607">607</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>[][] createIdenticalCopy(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[][] matrix) {
+<a class="jxr_linenumber" name="608" href="#608">608</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[][] matrixCopy = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[matrix.length][];
+<a class="jxr_linenumber" name="609" href="#609">609</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; matrixCopy.length; i++) {
+<a class="jxr_linenumber" name="610" href="#610">610</a>             matrixCopy[i] = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[matrix[i].length];
+<a class="jxr_linenumber" name="611" href="#611">611</a>         }
+<a class="jxr_linenumber" name="612" href="#612">612</a>         <strong class="jxr_keyword">return</strong> matrixCopy;
+<a class="jxr_linenumber" name="613" href="#613">613</a>     }
+<a class="jxr_linenumber" name="614" href="#614">614</a> 
+<a class="jxr_linenumber" name="615" href="#615">615</a>     @Test
+<a class="jxr_linenumber" name="616" href="#616">616</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRowMatrix() {
+<a class="jxr_linenumber" name="617" href="#617">617</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="618" href="#618">618</a>         RealMatrix mRow0 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow0);
+<a class="jxr_linenumber" name="619" href="#619">619</a>         RealMatrix mRow3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow3);
+<a class="jxr_linenumber" name="620" href="#620">620</a>         Assert.assertEquals(<span class="jxr_string">"Row0"</span>, mRow0,
+<a class="jxr_linenumber" name="621" href="#621">621</a>                 m.getRowMatrix(0));
+<a class="jxr_linenumber" name="622" href="#622">622</a>         Assert.assertEquals(<span class="jxr_string">"Row3"</span>, mRow3,
+<a class="jxr_linenumber" name="623" href="#623">623</a>                 m.getRowMatrix(3));
+<a class="jxr_linenumber" name="624" href="#624">624</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="625" href="#625">625</a>             m.getRowMatrix(-1);
+<a class="jxr_linenumber" name="626" href="#626">626</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="627" href="#627">627</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="628" href="#628">628</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="629" href="#629">629</a>         }
+<a class="jxr_linenumber" name="630" href="#630">630</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="631" href="#631">631</a>             m.getRowMatrix(4);
+<a class="jxr_linenumber" name="632" href="#632">632</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="633" href="#633">633</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="634" href="#634">634</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="635" href="#635">635</a>         }
+<a class="jxr_linenumber" name="636" href="#636">636</a>     }
+<a class="jxr_linenumber" name="637" href="#637">637</a> 
+<a class="jxr_linenumber" name="638" href="#638">638</a>     @Test
+<a class="jxr_linenumber" name="639" href="#639">639</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetRowMatrix() {
+<a class="jxr_linenumber" name="640" href="#640">640</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="641" href="#641">641</a>         RealMatrix mRow3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subRow3);
+<a class="jxr_linenumber" name="642" href="#642">642</a>         Assert.assertNotSame(mRow3, m.getRowMatrix(0));
+<a class="jxr_linenumber" name="643" href="#643">643</a>         m.setRowMatrix(0, mRow3);
+<a class="jxr_linenumber" name="644" href="#644">644</a>         Assert.assertEquals(mRow3, m.getRowMatrix(0));
+<a class="jxr_linenumber" name="645" href="#645">645</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="646" href="#646">646</a>             m.setRowMatrix(-1, mRow3);
+<a class="jxr_linenumber" name="647" href="#647">647</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="648" href="#648">648</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="649" href="#649">649</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="650" href="#650">650</a>         }
+<a class="jxr_linenumber" name="651" href="#651">651</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="652" href="#652">652</a>             m.setRowMatrix(0, m);
+<a class="jxr_linenumber" name="653" href="#653">653</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
+<a class="jxr_linenumber" name="654" href="#654">654</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
+<a class="jxr_linenumber" name="655" href="#655">655</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="656" href="#656">656</a>         }
+<a class="jxr_linenumber" name="657" href="#657">657</a>     }
+<a class="jxr_linenumber" name="658" href="#658">658</a> 
+<a class="jxr_linenumber" name="659" href="#659">659</a>     @Test
+<a class="jxr_linenumber" name="660" href="#660">660</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetColumnMatrix() {
+<a class="jxr_linenumber" name="661" href="#661">661</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="662" href="#662">662</a>         RealMatrix mColumn1 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn1);
+<a class="jxr_linenumber" name="663" href="#663">663</a>         RealMatrix mColumn3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn3);
+<a class="jxr_linenumber" name="664" href="#664">664</a>         Assert.assertEquals(<span class="jxr_string">"Column1"</span>, mColumn1,
+<a class="jxr_linenumber" name="665" href="#665">665</a>                 m.getColumnMatrix(1));
+<a class="jxr_linenumber" name="666" href="#666">666</a>         Assert.assertEquals(<span class="jxr_string">"Column3"</span>, mColumn3,
+<a class="jxr_linenumber" name="667" href="#667">667</a>                 m.getColumnMatrix(3));
+<a class="jxr_linenumber" name="668" href="#668">668</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="669" href="#669">669</a>             m.getColumnMatrix(-1);
+<a class="jxr_linenumber" name="670" href="#670">670</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="671" href="#671">671</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="672" href="#672">672</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="673" href="#673">673</a>         }
+<a class="jxr_linenumber" name="674" href="#674">674</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="675" href="#675">675</a>             m.getColumnMatrix(4);
+<a class="jxr_linenumber" name="676" href="#676">676</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="677" href="#677">677</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="678" href="#678">678</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="679" href="#679">679</a>         }
+<a class="jxr_linenumber" name="680" href="#680">680</a>     }
+<a class="jxr_linenumber" name="681" href="#681">681</a> 
+<a class="jxr_linenumber" name="682" href="#682">682</a>     @Test
+<a class="jxr_linenumber" name="683" href="#683">683</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetColumnMatrix() {
+<a class="jxr_linenumber" name="684" href="#684">684</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="685" href="#685">685</a>         RealMatrix mColumn3 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subColumn3);
+<a class="jxr_linenumber" name="686" href="#686">686</a>         Assert.assertNotSame(mColumn3, m.getColumnMatrix(1));
+<a class="jxr_linenumber" name="687" href="#687">687</a>         m.setColumnMatrix(1, mColumn3);
+<a class="jxr_linenumber" name="688" href="#688">688</a>         Assert.assertEquals(mColumn3, m.getColumnMatrix(1));
+<a class="jxr_linenumber" name="689" href="#689">689</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="690" href="#690">690</a>             m.setColumnMatrix(-1, mColumn3);
+<a class="jxr_linenumber" name="691" href="#691">691</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="692" href="#692">692</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="693" href="#693">693</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="694" href="#694">694</a>         }
+<a class="jxr_linenumber" name="695" href="#695">695</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="696" href="#696">696</a>             m.setColumnMatrix(0, m);
+<a class="jxr_linenumber" name="697" href="#697">697</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
+<a class="jxr_linenumber" name="698" href="#698">698</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
+<a class="jxr_linenumber" name="699" href="#699">699</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="700" href="#700">700</a>         }
+<a class="jxr_linenumber" name="701" href="#701">701</a>     }
+<a class="jxr_linenumber" name="702" href="#702">702</a> 
+<a class="jxr_linenumber" name="703" href="#703">703</a>     @Test
+<a class="jxr_linenumber" name="704" href="#704">704</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRowVector() {
+<a class="jxr_linenumber" name="705" href="#705">705</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="706" href="#706">706</a>         RealVector mRow0 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow0[0]);
+<a class="jxr_linenumber" name="707" href="#707">707</a>         RealVector mRow3 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow3[0]);
+<a class="jxr_linenumber" name="708" href="#708">708</a>         Assert.assertEquals(<span class="jxr_string">"Row0"</span>, mRow0, m.getRowVector(0));
+<a class="jxr_linenumber" name="709" href="#709">709</a>         Assert.assertEquals(<span class="jxr_string">"Row3"</span>, mRow3, m.getRowVector(3));
+<a class="jxr_linenumber" name="710" href="#710">710</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="711" href="#711">711</a>             m.getRowVector(-1);
+<a class="jxr_linenumber" name="712" href="#712">712</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="713" href="#713">713</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="714" href="#714">714</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="715" href="#715">715</a>         }
+<a class="jxr_linenumber" name="716" href="#716">716</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="717" href="#717">717</a>             m.getRowVector(4);
+<a class="jxr_linenumber" name="718" href="#718">718</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="719" href="#719">719</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="720" href="#720">720</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="721" href="#721">721</a>         }
+<a class="jxr_linenumber" name="722" href="#722">722</a>     }
+<a class="jxr_linenumber" name="723" href="#723">723</a> 
+<a class="jxr_linenumber" name="724" href="#724">724</a>     @Test
+<a class="jxr_linenumber" name="725" href="#725">725</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetRowVector() {
+<a class="jxr_linenumber" name="726" href="#726">726</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="727" href="#727">727</a>         RealVector mRow3 = <strong class="jxr_keyword">new</strong> ArrayRealVector(subRow3[0]);
+<a class="jxr_linenumber" name="728" href="#728">728</a>         Assert.assertNotSame(mRow3, m.getRowMatrix(0));
+<a class="jxr_linenumber" name="729" href="#729">729</a>         m.setRowVector(0, mRow3);
+<a class="jxr_linenumber" name="730" href="#730">730</a>         Assert.assertEquals(mRow3, m.getRowVector(0));
+<a class="jxr_linenumber" name="731" href="#731">731</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="732" href="#732">732</a>             m.setRowVector(-1, mRow3);
+<a class="jxr_linenumber" name="733" href="#733">733</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="734" href="#734">734</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="735" href="#735">735</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="736" href="#736">736</a>         }
+<a class="jxr_linenumber" name="737" href="#737">737</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="738" href="#738">738</a>             m.setRowVector(0, <strong class="jxr_keyword">new</strong> ArrayRealVector(5));
+<a class="jxr_linenumber" name="739" href="#739">739</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
+<a class="jxr_linenumber" name="740" href="#740">740</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
+<a class="jxr_linenumber" name="741" href="#741">741</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="742" href="#742">742</a>         }
+<a class="jxr_linenumber" name="743" href="#743">743</a>     }
+<a class="jxr_linenumber" name="744" href="#744">744</a> 
+<a class="jxr_linenumber" name="745" href="#745">745</a>     @Test
+<a class="jxr_linenumber" name="746" href="#746">746</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetColumnVector() {
+<a class="jxr_linenumber" name="747" href="#747">747</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="748" href="#748">748</a>         RealVector mColumn1 = columnToVector(subColumn1);
+<a class="jxr_linenumber" name="749" href="#749">749</a>         RealVector mColumn3 = columnToVector(subColumn3);
+<a class="jxr_linenumber" name="750" href="#750">750</a>         Assert.assertEquals(<span class="jxr_string">"Column1"</span>, mColumn1, m.getColumnVector(1));
+<a class="jxr_linenumber" name="751" href="#751">751</a>         Assert.assertEquals(<span class="jxr_string">"Column3"</span>, mColumn3, m.getColumnVector(3));
+<a class="jxr_linenumber" name="752" href="#752">752</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="753" href="#753">753</a>             m.getColumnVector(-1);
+<a class="jxr_linenumber" name="754" href="#754">754</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="755" href="#755">755</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="756" href="#756">756</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="757" href="#757">757</a>         }
+<a class="jxr_linenumber" name="758" href="#758">758</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="759" href="#759">759</a>             m.getColumnVector(4);
+<a class="jxr_linenumber" name="760" href="#760">760</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="761" href="#761">761</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="762" href="#762">762</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="763" href="#763">763</a>         }
+<a class="jxr_linenumber" name="764" href="#764">764</a>     }
+<a class="jxr_linenumber" name="765" href="#765">765</a> 
+<a class="jxr_linenumber" name="766" href="#766">766</a>     @Test
+<a class="jxr_linenumber" name="767" href="#767">767</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetColumnVector() {
+<a class="jxr_linenumber" name="768" href="#768">768</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
+<a class="jxr_linenumber" name="769" href="#769">769</a>         RealVector mColumn3 = columnToVector(subColumn3);
+<a class="jxr_linenumber" name="770" href="#770">770</a>         Assert.assertNotSame(mColumn3, m.getColumnVector(1));
+<a class="jxr_linenumber" name="771" href="#771">771</a>         m.setColumnVector(1, mColumn3);
+<a class="jxr_linenumber" name="772" href="#772">772</a>         Assert.assertEquals(mColumn3, m.getColumnVector(1));
+<a class="jxr_linenumber" name="773" href="#773">773</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="774" href="#774">774</a>             m.setColumnVector(-1, mColumn3);
+<a class="jxr_linenumber" name="775" href="#775">775</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
+<a class="jxr_linenumber" name="776" href="#776">776</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
+<a class="jxr_linenumber" name="777" href="#777">777</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="778" href="#778">778</a>         }
+<a class="jxr_linenumber" name="779" href="#779">779</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="780" href="#780">780</a>             m.setColumnVector(0, <strong class="jxr_keyword">new</strong> ArrayRealVector(5));
+<a class="jxr_linenumber" name="781" href="#781">781</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
+<a class="jxr_linenumber" name="782" href="#782">782</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
+<a class="jxr_linenumber" name="783" href="#783">783</a>             <em class="jxr_comment">// expected</em>
+<a class="jxr_linenumber" name="784" href="#784">784</a>         }
+<a class="jxr_linenumber" name="785" href="#785">785</a>     }
+<a class="jxr_linenumber" name="786" href="#786">786</a> 
+<a class="jxr_linenumber" name="787" href="#787">787</a>     <strong class="jxr_keyword">private</strong> RealVector columnToVector(<strong class="jxr_keyword">double</strong>[][] column) {
+<a class="jxr_linenumber" name="788" href="#788">788</a>         <strong class="jxr_keyword">double</strong>[] data = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[column.length];
+<a class="jxr_linenumber" name="789" href="#789">789</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; data.length; ++i) {
+<a class="jxr_linenumber" name="790" href="#790">790</a>             data[i] = column[i][0];
+<a class="jxr_linenumber" name="791" href="#791">791</a>         }
+<a class="jxr_linenumber" name="792" href="#792">792</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> ArrayRealVector(data, false);
 <a class="jxr_linenumber" name="793" href="#793">793</a>     }
 <a class="jxr_linenumber" name="794" href="#794">794</a> 
 <a class="jxr_linenumber" name="795" href="#795">795</a>     @Test
-<a class="jxr_linenumber" name="796" href="#796">796</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetRow() {
+<a class="jxr_linenumber" name="796" href="#796">796</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetRow() {
 <a class="jxr_linenumber" name="797" href="#797">797</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="798" href="#798">798</a>         Assert.assertTrue(subRow3[0][0] != m.getRow(0)[0]);
-<a class="jxr_linenumber" name="799" href="#799">799</a>         m.setRow(0, subRow3[0]);
-<a class="jxr_linenumber" name="800" href="#800">800</a>         checkArrays(subRow3[0], m.getRow(0));
-<a class="jxr_linenumber" name="801" href="#801">801</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="802" href="#802">802</a>             m.setRow(-1, subRow3[0]);
-<a class="jxr_linenumber" name="803" href="#803">803</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="804" href="#804">804</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="805" href="#805">805</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="806" href="#806">806</a>         }
-<a class="jxr_linenumber" name="807" href="#807">807</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="808" href="#808">808</a>             m.setRow(0, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[5]);
-<a class="jxr_linenumber" name="809" href="#809">809</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="810" href="#810">810</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="811" href="#811">811</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="812" href="#812">812</a>         }
-<a class="jxr_linenumber" name="813" href="#813">813</a>     }
-<a class="jxr_linenumber" name="814" href="#814">814</a> 
-<a class="jxr_linenumber" name="815" href="#815">815</a>     @Test
-<a class="jxr_linenumber" name="816" href="#816">816</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetColumn() {
-<a class="jxr_linenumber" name="817" href="#817">817</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="818" href="#818">818</a>         <strong class="jxr_keyword">double</strong>[] mColumn1 = columnToArray(subColumn1);
-<a class="jxr_linenumber" name="819" href="#819">819</a>         <strong class="jxr_keyword">double</strong>[] mColumn3 = columnToArray(subColumn3);
-<a class="jxr_linenumber" name="820" href="#820">820</a>         checkArrays(mColumn1, m.getColumn(1));
-<a class="jxr_linenumber" name="821" href="#821">821</a>         checkArrays(mColumn3, m.getColumn(3));
-<a class="jxr_linenumber" name="822" href="#822">822</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="823" href="#823">823</a>             m.getColumn(-1);
-<a class="jxr_linenumber" name="824" href="#824">824</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="825" href="#825">825</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="826" href="#826">826</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="827" href="#827">827</a>         }
-<a class="jxr_linenumber" name="828" href="#828">828</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="829" href="#829">829</a>             m.getColumn(4);
-<a class="jxr_linenumber" name="830" href="#830">830</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="831" href="#831">831</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="832" href="#832">832</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="833" href="#833">833</a>         }
-<a class="jxr_linenumber" name="834" href="#834">834</a>     }
-<a class="jxr_linenumber" name="835" href="#835">835</a> 
-<a class="jxr_linenumber" name="836" href="#836">836</a>     @Test
-<a class="jxr_linenumber" name="837" href="#837">837</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetColumn() {
-<a class="jxr_linenumber" name="838" href="#838">838</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(subTestData);
-<a class="jxr_linenumber" name="839" href="#839">839</a>         <strong class="jxr_keyword">double</strong>[] mColumn3 = columnToArray(subColumn3);
-<a class="jxr_linenumber" name="840" href="#840">840</a>         Assert.assertTrue(mColumn3[0] != m.getColumn(1)[0]);
-<a class="jxr_linenumber" name="841" href="#841">841</a>         m.setColumn(1, mColumn3);
-<a class="jxr_linenumber" name="842" href="#842">842</a>         checkArrays(mColumn3, m.getColumn(1));
-<a class="jxr_linenumber" name="843" href="#843">843</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="844" href="#844">844</a>             m.setColumn(-1, mColumn3);
-<a class="jxr_linenumber" name="845" href="#845">845</a>             Assert.fail(<span class="jxr_string">"Expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="846" href="#846">846</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException ex) {
-<a class="jxr_linenumber" name="847" href="#847">847</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="848" href="#848">848</a>         }
-<a class="jxr_linenumber" name="849" href="#849">849</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="850" href="#850">850</a>             m.setColumn(0, <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[5]);
-<a class="jxr_linenumber" name="851" href="#851">851</a>             Assert.fail(<span class="jxr_string">"Expecting MatrixDimensionMismatchException"</span>);
-<a class="jxr_linenumber" name="852" href="#852">852</a>         } <strong class="jxr_keyword">catch</strong> (MatrixDimensionMismatchException ex) {
-<a class="jxr_linenumber" name="853" href="#853">853</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="854" href="#854">854</a>         }
-<a class="jxr_linenumber" name="855" href="#855">855</a>     }
-<a class="jxr_linenumber" name="856" href="#856">856</a> 
-<a class="jxr_linenumber" name="857" href="#857">857</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>[] columnToArray(<strong class="jxr_keyword">double</strong>[][] column) {
-<a class="jxr_linenumber" name="858" href="#858">858</a>         <strong class="jxr_keyword">double</strong>[] data = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[column.length];
-<a class="jxr_linenumber" name="859" href="#859">859</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; data.length; ++i) {
-<a class="jxr_linenumber" name="860" href="#860">860</a>             data[i] = column[i][0];
-<a class="jxr_linenumber" name="861" href="#861">861</a>         }
-<a class="jxr_linenumber" name="862" href="#862">862</a>         <strong class="jxr_keyword">return</strong> data;
-<a class="jxr_linenumber" name="863" href="#863">863</a>     }
-<a class="jxr_linenumber" name="864" href="#864">864</a> 
-<a class="jxr_linenumber" name="865" href="#865">865</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> checkArrays(<strong class="jxr_keyword">double</strong>[] expected, <strong class="jxr_keyword">double</strong>[] actual) {
-<a class="jxr_linenumber" name="866" href="#866">866</a>         Assert.assertEquals(expected.length, actual.length);
-<a class="jxr_linenumber" name="867" href="#867">867</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; expected.length; ++i) {
-<a class="jxr_linenumber" name="868" href="#868">868</a>             Assert.assertEquals(expected[i], actual[i], 0);
-<a class="jxr_linenumber" name="869" href="#869">869</a>         }
-<a class="jxr_linenumber" name="870" href="#870">870</a>     }
-<a class="jxr_linenumber" name="871" href="#871">871</a> 
-<a class="jxr_linenumber" name="872" href="#872">872</a>     @Test
-<a class="jxr_linenumber" name="873" href="#873">873</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testEqualsAndHashCode() {
-<a class="jxr_linenumber" name="874" href="#874">874</a>         Array2DRowRealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(testData);
-<a class="jxr_linenumber" name="875" href="#875">875</a>         Array2DRowRealMatrix m1 = (Array2DRowRealMatrix) m.copy();
-<a class="jxr_linenumber" name="876" href="#876">876</a>         Array2DRowRealMatrix mt = (Array2DRowRealMatrix) m.transpose();
-<a class="jxr_linenumber" name="877" href="#877">877</a>         Assert.assertTrue(m.hashCode() != mt.hashCode());
-<a class="jxr_linenumber" name="878" href="#878">878</a>         Assert.assertEquals(m.hashCode(), m1.hashCode());
-<a class="jxr_linenumber" name="879" href="#879">879</a>         Assert.assertEquals(m, m);
-<a class="jxr_linenumber" name="880" href="#880">880</a>         Assert.assertEquals(m, m1);
-<a class="jxr_linenumber" name="881" href="#881">881</a>         Assert.assertFalse(m.equals(<strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="882" href="#882">882</a>         Assert.assertFalse(m.equals(mt));
-<a class="jxr_linenumber" name="883" href="#883">883</a>         Assert.assertFalse(m.equals(<strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(bigSingular)));
-<a class="jxr_linenumber" name="884" href="#884">884</a>     }
-<a class="jxr_linenumber" name="885" href="#885">885</a> 
-<a class="jxr_linenumber" name="886" href="#886">886</a>     @Test
-<a class="jxr_linenumber" name="887" href="#887">887</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testToString() {
-<a class="jxr_linenumber" name="888" href="#888">888</a>         Array2DRowRealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(testData);
-<a class="jxr_linenumber" name="889" href="#889">889</a>         Assert.assertEquals(<span class="jxr_string">"Array2DRowRealMatrix{{1.0,2.0,3.0},{2.0,5.0,3.0},{1.0,0.0,8.0}}"</span>,
-<a class="jxr_linenumber" name="890" href="#890">890</a>                 m.toString());
-<a class="jxr_linenumber" name="891" href="#891">891</a>         m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix();
-<a class="jxr_linenumber" name="892" href="#892">892</a>         Assert.assertEquals(<span class="jxr_string">"Array2DRowRealMatrix{}"</span>,
-<a class="jxr_linenumber" name="893" href="#893">893</a>                 m.toString());
-<a class="jxr_linenumber" name="894" href="#894">894</a>     }
-<a class="jxr_linenumber" name="895" href="#895">895</a> 
-<a class="jxr_linenumber" name="896" href="#896">896</a>     @Test
-<a class="jxr_linenumber" name="897" href="#897">897</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSetSubMatrix() {
-<a class="jxr_linenumber" name="898" href="#898">898</a>         Array2DRowRealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(testData);
-<a class="jxr_linenumber" name="899" href="#899">899</a>         m.setSubMatrix(detData2,1,1);
-<a class="jxr_linenumber" name="900" href="#900">900</a>         RealMatrix expected = MatrixUtils.createRealMatrix
-<a class="jxr_linenumber" name="901" href="#901">901</a>             (<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] {{1.0,2.0,3.0},{2.0,1.0,3.0},{1.0,2.0,4.0}});
-<a class="jxr_linenumber" name="902" href="#902">902</a>         Assert.assertEquals(expected, m);
-<a class="jxr_linenumber" name="903" href="#903">903</a> 
-<a class="jxr_linenumber" name="904" href="#904">904</a>         m.setSubMatrix(detData2,0,0);
-<a class="jxr_linenumber" name="905" href="#905">905</a>         expected = MatrixUtils.createRealMatrix
-<a class="jxr_linenumber" name="906" href="#906">906</a>             (<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] {{1.0,3.0,3.0},{2.0,4.0,3.0},{1.0,2.0,4.0}});
-<a class="jxr_linenumber" name="907" href="#907">907</a>         Assert.assertEquals(expected, m);
-<a class="jxr_linenumber" name="908" href="#908">908</a> 
-<a class="jxr_linenumber" name="909" href="#909">909</a>         m.setSubMatrix(testDataPlus2,0,0);
-<a class="jxr_linenumber" name="910" href="#910">910</a>         expected = MatrixUtils.createRealMatrix
-<a class="jxr_linenumber" name="911" href="#911">911</a>             (<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] {{3.0,4.0,5.0},{4.0,7.0,5.0},{3.0,2.0,10.0}});
-<a class="jxr_linenumber" name="912" href="#912">912</a>         Assert.assertEquals(expected, m);
-<a class="jxr_linenumber" name="913" href="#913">913</a> 
-<a class="jxr_linenumber" name="914" href="#914">914</a>         <em class="jxr_comment">// dimension overflow</em>
-<a class="jxr_linenumber" name="915" href="#915">915</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="916" href="#916">916</a>             m.setSubMatrix(testData,1,1);
-<a class="jxr_linenumber" name="917" href="#917">917</a>             Assert.fail(<span class="jxr_string">"expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="918" href="#918">918</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
-<a class="jxr_linenumber" name="919" href="#919">919</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="920" href="#920">920</a>         }
-<a class="jxr_linenumber" name="921" href="#921">921</a>         <em class="jxr_comment">// dimension underflow</em>
-<a class="jxr_linenumber" name="922" href="#922">922</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="923" href="#923">923</a>             m.setSubMatrix(testData,-1,1);
-<a class="jxr_linenumber" name="924" href="#924">924</a>             Assert.fail(<span class="jxr_string">"expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="925" href="#925">925</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
-<a class="jxr_linenumber" name="926" href="#926">926</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="927" href="#927">927</a>         }
-<a class="jxr_linenumber" name="928" href="#928">928</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="929" href="#929">929</a>             m.setSubMatrix(testData,1,-1);
-<a class="jxr_linenumber" name="930" href="#930">930</a>             Assert.fail(<span class="jxr_string">"expecting OutOfRangeException"</span>);
-<a class="jxr_linenumber" name="931" href="#931">931</a>         } <strong class="jxr_keyword">catch</strong> (OutOfRangeException e) {
-<a class="jxr_linenumber" name="932" href="#932">932</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="933" href="#933">933</a>         }
-<a class="jxr_linenumber" name="934" href="#934">934</a> 
-<a class="jxr_linenumber" name="935" href="#935">935</a>         <em class="jxr_comment">// null</em>
-<a class="jxr_linenumber" name="936" href="#936">936</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="937" href="#937">937</a>             m.setSubMatrix(<strong class="jxr_keyword">null</strong>,1,1);
-<a class="jxr_linenumber" name="938" href="#938">938</a>             Assert.fail(<span class="jxr_string">"expecting NullArgumentException"</span>);
-<a class="jxr_linenumber" name="939" href="#939">939</a>         } <strong class="jxr_keyword">catch</strong> (NullArgumentException e) {
-<a class="jxr_linenumber" name="940" href="#940">940</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="941" href="#941">941</a>         }
-<a class="jxr_linenumber" name="942" href="#942">942</a>         Array2DRowRealMatrix m2 = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix();
-<a class="jxr_linenumber" name="943" href="#943">943</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="944" href="#944">944</a>             m2.setSubMatrix(testData,0,1);
-<a class="jxr_linenumber" name="945" href="#945">945</a>             Assert.fail(<span class="jxr_string">"expecting MathIllegalStateException"</span>);
-<a class="jxr_linenumber" name="946" href="#946">946</a>         } <strong class="jxr_keyword">catch</strong> (MathIllegalStateException e) {
-<a class="jxr_linenumber" name="947" href="#947">947</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="948" href="#948">948</a>         }
-<a class="jxr_linenumber" name="949" href="#949">949</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="950" href="#950">950</a>             m2.setSubMatrix(testData,1,0);
-<a class="jxr_linenumber" name="951" href="#951">951</a>             Assert.fail(<span class="jxr_string">"expecting MathIllegalStateException"</span>);
-<a class="jxr_linenumber" name="952" href="#952">952</a>         } <strong class="jxr_keyword">catch</strong> (MathIllegalStateException e) {
-<a class="jxr_linenumber" name="953" href="#953">953</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="954" href="#954">954</a>         }
-<a class="jxr_linenumber" name="955" href="#955">955</a> 
-<a class="jxr_linenumber" name="956" href="#956">956</a>         <em class="jxr_comment">// ragged</em>
-<a class="jxr_linenumber" name="957" href="#957">957</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="958" href="#958">958</a>             m.setSubMatrix(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] {{1}, {2, 3}}, 0, 0);
-<a class="jxr_linenumber" name="959" href="#959">959</a>             Assert.fail(<span class="jxr_string">"expecting MathIllegalArgumentException"</span>);
-<a class="jxr_linenumber" name="960" href="#960">960</a>         } <strong class="jxr_keyword">catch</strong> (MathIllegalArgumentException e) {
-<a class="jxr_linenumber" name="961" href="#961">961</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="962" href="#962">962</a>         }
-<a class="jxr_linenumber" name="963" href="#963">963</a> 
-<a class="jxr_linenumber" name="964" href="#964">964</a>         <em class="jxr_comment">// empty</em>
-<a class="jxr_linenumber" name="965" href="#965">965</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="966" href="#966">966</a>             m.setSubMatrix(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[][] {{}}, 0, 0);
-<a class="jxr_linenumber" name="967" href="#967">967</a>             Assert.fail(<span class="jxr_string">"expecting MathIllegalArgumentException"</span>);
-<a class="jxr_linenumber" name="968" href="#968">968</a>         } <strong class="jxr_keyword">catch</strong> (MathIllegalArgumentException e) {
-<a class="jxr_linenumber" name="969" href="#969">969</a>             <em class="jxr_comment">// expected</em>
-<a class="jxr_linenumber" name="970" href="#970">970</a>         }
-<a class="jxr_linenumber" name="971" href="#971">971</a>     }
-<a class="jxr_linenumber" name="972" href="#972">972</a> 
-<a class="jxr_linenumber" name="973" href="#973">973</a>     @Test
-<a class="jxr_linenumber" name="974" href="#974">974</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testWalk() {
-<a class="jxr_linenumber" name="975" href="#975">975</a>         <strong class="jxr_keyword">int</strong> rows    = 150;
-<a class="jxr_linenumber" name="976" href="#976">976</a>         <strong class="jxr_keyword">int</strong> columns = 75;
-<a class="jxr_linenumber" name="977" href="#977">977</a> 
-<a class="jxr_linenumber" name="978" href="#978">978</a>         RealMatrix m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(rows, columns);
-<a class="jxr_linenumber" name="979" href="#979">979</a>         m.walkInRowOrder(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">SetVisitor</a>());
-<a class="jxr_linenumber" name="980" href="#980">980</a>         <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">GetVisitor</a> getVisitor = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">GetVisitor</a>();
-<a class="jxr_linenumber" name="981" href="#981">981</a>         m.walkInOptimizedOrder(getVisitor);
-<a class="jxr_linenumber" name="982" href="#982">982</a>         Assert.assertEquals(rows * columns, getVisitor.getCount());
-<a class="jxr_linenumber" name="983" href="#983">983</a> 
-<a class="jxr_linenumber" name="984" href="#984">984</a>         m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(rows, columns);
-<a class="jxr_linenumber" name="985" href="#985">985</a>         m.walkInRowOrder(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">SetVisitor</a>(), 1, rows - 2, 1, columns - 2);
-<a class="jxr_linenumber" name="986" href="#986">986</a>         getVisitor = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">GetVisitor</a>();
-<a class="jxr_linenumber" name="987" href="#987">987</a>         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-<a class="jxr_linenumber" name="988" href="#988">988</a>         Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
-<a class="jxr_linenumber" name="989" href="#989">989</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; rows; ++i) {
-<a class="jxr_linenumber" name="990" href="#990">990</a>             Assert.assertEquals(0.0, m.getEntry(i, 0), 0);
-<a class="jxr_linenumber" name="991" href="#991">991</a>             Assert.assertEquals(0.0, m.getEntry(i, columns - 1), 0);
-<a class="jxr_linenumber" name="992" href="#992">992</a>         }
-<a class="jxr_linenumber" name="993" href="#993">993</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> j = 0; j &lt; columns; ++j) {
-<a class="jxr_linenumber" name="994" href="#994">994</a>             Assert.assertEquals(0.0, m.getEntry(0, j), 0);
-<a class="jxr_linenumber" name="995" href="#995">995</a>             Assert.assertEquals(0.0, m.getEntry(rows - 1, j), 0);
-<a class="jxr_linenumber" name="996" href="#996">996</a>         }
-<a class="jxr_linenumber" name="997" href="#997">997</a> 
-<a class="jxr_linenumber" name="998" href="#998">998</a>         m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(rows, columns);
-<a class="jxr_linenumber" name="999" href="#999">999</a>         m.walkInColumnOrder(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">SetVisitor</a>());
-<a class="jxr_linenumber" name="1000" href="#1000">1000</a>         getVisitor = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">GetVisitor</a>();
-<a class="jxr_linenumber" name="1001" href="#1001">1001</a>         m.walkInOptimizedOrder(getVisitor);
-<a class="jxr_linenumber" name="1002" href="#1002">1002</a>         Assert.assertEquals(rows * columns, getVisitor.getCount());
-<a class="jxr_linenumber" name="1003" href="#1003">1003</a> 
-<a class="jxr_linenumber" name="1004" href="#1004">1004</a>         m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(rows, columns);
-<a class="jxr_linenumber" name="1005" href="#1005">1005</a>         m.walkInColumnOrder(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">SetVisitor</a>(), 1, rows - 2, 1, columns - 2);
-<a class="jxr_linenumber" name="1006" href="#1006">1006</a>         getVisitor = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/math3/linear/BlockRealMatrixTest.html">GetVisitor</a>();
-<a class="jxr_linenumber" name="1007" href="#1007">1007</a>         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-<a class="jxr_linenumber" name="1008" href="#1008">1008</a>         Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
-<a class="jxr_linenumber" name="1009" href="#1009">1009</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; rows; ++i) {
-<a class="jxr_linenumber" name="1010" href="#1010">1010</a>             Assert.assertEquals(0.0, m.getEntry(i, 0), 0);
-<a class="jxr_linenumber" name="1011" href="#1011">1011</a>             Assert.assertEquals(0.0, m.getEntry(i, columns - 1), 0);
-<a class="jxr_linenumber" name="1012" href="#1012">1012</a>         }
-<a class="jxr_linenumber" name="1013" href="#1013">1013</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> j = 0; j &lt; columns; ++j) {
-<a class="jxr_linenumber" name="1014" href="#1014">1014</a>             Assert.assertEquals(0.0, m.getEntry(0, j), 0);
-<a class="jxr_linenumber" name="1015" href="#1015">1015</a>             Assert.assertEquals(0.0, m.getEntry(rows - 1, j), 0);
-<a class="jxr_linenumber" name="1016" href="#1016">1016</a>         }
-<a class="jxr_linenumber" name="1017" href="#1017">1017</a> 
-<a class="jxr_linenumber" name="1018" href="#1018">1018</a>         m = <strong class="jxr_keyword">new</strong> Array2DRowRealMatrix(rows, columns);

[... 514 lines stripped ...]


Mime
View raw message