<div dir="ltr"><div><div><div>You have rows of 0.0 ... I think that is causing issues. I'm sure some 'math-whiz' could answer but I attached a simple test code that reads your data (thx for providing). It calculates the inverse and the identity matrix. Note that NCL is using a direct call to the documented LAPACK routines.<br><br>===<br></div>TEST1: duplicates your findings<br><br></div>TEST 2: create a bogus 20x20 array of random numbers. No row consists of all constants. Identity matrix is successfully calculated.<br><br></div>TEST 3: wherever the original array had a row of all 0.0, substitute random numbers. The identity matrix is successfully calculated.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 1:57 PM, Walter Hannah <span dir="ltr"><<a href="mailto:whannah@atmos.colostate.edu" target="_blank">whannah@atmos.colostate.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I'm trying to use the "inverse_matrix" function. The matrix doesn't
have any missing values, but I still get this error message:<br>
<blockquote><tt>Variable: M</tt><tt><br>
</tt><tt>Type: float</tt><tt><br>
</tt><tt>Total Size: 1600 bytes</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â Â Â Â 400 values</tt><tt><br>
</tt><tt>Number of Dimensions: 2</tt><tt><br>
</tt><tt>Dimensions and sizes:Â Â Â [pertlev | 20] x [tendlev | 20]</tt><tt><br>
</tt><tt>Coordinates:</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â Â Â Â pertlev: [50..1950]</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â Â Â Â tendlev: [50..1950]</tt><tt><br>
</tt><tt>Number Of Attributes: 2</tt><tt><br>
</tt><tt>Â missing_value :Â Â Â 9.96921e+36</tt><tt><br>
</tt><tt>Â _FillValue :Â Â Â 9.96921e+36</tt><tt><br>
</tt><tt>(0)Â Â Â
----------------------------------------------------------------------------</tt><tt><br>
</tt><tt><br>
</tt><tt>Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â
0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â
0.00Â Â 0.00Â Â 0.00Â Â 0.00<br>
  0.00 -0.31 -0.06  0.15 -0.27 -0.56 -1.21 -1.38Â
-1.36Â Â 1.49Â Â 0.00Â Â 0.00Â Â 4.65Â Â 0.37Â Â 0.46Â Â 0.47Â Â 0.52Â Â
0.55Â Â 0.77Â Â 2.49<br>
  0.00  0.26 -0.35 -0.29 -0.65 -1.13 -2.24 -2.45Â
-2.47Â Â 2.91Â Â 0.00Â Â 0.00Â Â 4.07Â Â 2.45Â Â 0.95Â Â 0.87Â Â 0.90Â Â
1.05Â Â 1.55Â Â 4.81<br>
  0.00 -0.11  1.43 -0.91 -1.69 -1.52 -2.63 -2.81Â
-2.69Â Â 3.17Â Â 0.00Â Â 0.00Â -2.35Â Â 2.61Â Â 1.49Â Â 1.01Â Â 1.00Â Â
1.18Â Â 1.78Â Â 5.32<br>
  0.00 -0.02  0.55  1.08 -1.74 -2.04 -2.59 -2.71Â
-2.39Â Â 2.63Â Â 0.00Â Â 0.00Â -0.75Â -1.10Â Â 1.35Â Â 1.02Â Â 0.89Â Â
1.00Â Â 1.57Â Â 4.87<br>
  0.00 -0.06  0.16  0.52  0.72 -1.86 -2.88 -2.74Â
-2.29Â Â 2.31Â Â 0.00Â Â 0.00Â Â 0.31Â -1.30Â -0.26Â Â 0.87Â Â 0.75Â Â
0.82Â Â 1.27Â Â 4.50<br>
  0.00 -0.13 -0.07  0.20  0.54  0.27 -2.74 -3.10Â
-2.27Â Â 2.04Â Â 0.00Â Â 0.00Â Â 0.08Â -0.49Â -0.47Â Â 0.14Â Â 0.72Â Â
0.69Â Â 1.13Â Â 4.24<br>
  0.00 -0.15 -0.06  0.20 -0.17  0.02 -0.77 -3.87Â
-3.13Â Â 2.39Â Â 0.00Â Â 0.00Â Â 0.69Â -0.08Â Â 0.09Â Â 0.03Â Â 0.36Â Â
0.90Â Â 1.29Â Â 4.59<br>
  0.00 -0.14  0.05  0.09 -0.17 -0.29 -0.14 -0.66Â
-5.36Â Â 2.00Â Â 0.00Â Â 0.00Â Â 0.39Â Â 0.17Â Â 0.14Â Â 0.07Â -0.01Â Â
0.22Â Â 1.00Â Â 4.05<br>
  0.00  0.02 -0.07 -0.01  0.00  0.02  0.43  0.94  0.77Â
-2.90Â Â 0.00Â Â 0.00Â -0.09Â Â 0.09Â -0.04Â -0.07Â -0.17Â -0.26Â
-0.49Â Â 0.54<br>
  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 Â
0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â
0.00Â Â 0.00Â Â 0.00<br>
  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 Â
0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â
0.00Â Â 0.00Â Â 0.00<br>
  0.00 -0.01 -0.04  0.12 -0.02 -0.01 -0.03 -0.05Â
-0.05Â Â 0.04Â Â 0.00Â Â 0.00Â -2.17Â -0.25Â -0.14Â Â 0.01Â Â 0.02Â Â
0.02Â Â 0.02Â Â 0.12<br>
  0.00  0.00 -0.19  0.11  0.28  0.06  0.11  0.06  0.07Â
-0.13Â Â 0.00Â Â 0.00Â Â 2.75Â -1.97Â -0.04Â -0.12Â -0.05Â -0.05Â
-0.08Â -0.10<br>
  0.00 -0.02 -0.14 -0.08  0.31  0.21  0.13  0.08  0.06Â
-0.08Â Â 0.00Â Â 0.00Â Â 0.48Â Â 1.11Â -1.09Â -0.13Â -0.10Â -0.06Â
-0.09Â -0.12<br>
  0.00 -0.01 -0.03 -0.11 -0.07  0.32  0.27  0.12  0.18Â
-0.17Â Â 0.00Â Â 0.00Â Â 0.02Â Â 0.63Â Â 0.52Â -0.94Â -0.02Â -0.15Â
-0.08Â -0.25<br>
  0.00  0.02  0.08 -0.06 -0.24  0.10  0.43  0.26  0.16Â
-0.17Â Â 0.00Â Â 0.00Â Â 0.07Â Â 0.31Â Â 0.35Â Â 0.40Â -1.06Â -0.06Â
-0.20Â -0.26<br>
  0.00  0.06  0.03 -0.10  0.07  0.11  1.03  1.38  0.53Â
-1.10Â Â 0.00Â Â 0.00Â -0.44Â Â 0.14Â -0.03Â Â 0.08Â Â 0.19Â -1.61Â
-0.76Â -1.16<br>
  0.00  0.11 -0.03 -0.08  0.07  0.16  0.46  1.28  1.65Â
-1.21Â Â 0.00Â Â 0.00Â -0.25Â Â 0.07Â -0.06Â Â 0.00Â Â 0.14Â Â 0.41Â
-3.04Â -0.66<br>
  0.00  0.12 -0.30 -0.15  0.80  1.58  2.86  3.62  5.02Â
-3.15Â Â 0.00Â Â 0.00Â -1.23Â -0.91Â -0.80Â -0.94Â -0.85Â -0.66Â Â
0.21 -10.64<br>
<br>
(0)Â Â Â
----------------------------------------------------------------------------<br>
(0)Â Â Â # missing values: 0<br>
(0)Â Â Â # values = 0.0Â : 111</tt><tt><br>
</tt><tt>warning:inverse_matrix: info = 1; missing values not
allowed</tt><br>
</blockquote>
<br>
I thought it might have something to do with those zero values, but
if I replace them with non-zero values I get a similar, but not
identical, result:<br>
<blockquote><tt>...<br>
(0)Â Â Â
----------------------------------------------------------------------------</tt><tt><br>
</tt><tt>(0)Â Â Â # missing values: 0</tt><tt><br>
</tt><tt>(0)Â Â Â # values = 0.0Â : 0</tt><tt><br>
</tt><tt>warning:inverse_matrix: info = 20; missing values not
allowed</tt><br>
</blockquote>
<br>
<br>
Thanks,<br>
Walter
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>