reading ldoor matrix and incomplete factorization?

I tried to read in the ldoor matrix and attempted the LLT factorization but it gives me: "parseLdoor[55178:5595352] Factored does not hold a completed matrix factorization. (lldb)"

Because the ldoor matrix is large I have not been able to discover the issue. I am unsure if the matrix data was converted correctly via the SparseConvertFromCoordinate function. Otoh, I was able to use the same code to get the correct answers for the simple 4x4 example used in the Sparse Solver documentation. Any help would be appreciated.

Accepted Reply

I re-tested on the 4x4 example given in Apple documentation on Creating a Sparse Matrix from Coordinate Format Arrays. Adjusted all the coordinates up by 1 and ran with the code with the - 1 to reduce the coordinate rows and columns coordinates just to be sure. Everything works (answers are correct). So, I just have to remember when downloading to check the coordinates to see where they start, and adjust if need be.

Replies

I am more than dumb ... but may I be excused for being such an amateur? Not! Haha.

So, I thought I could use the Ldoor matrix directly after stripping off the headers. That part I got right. But I failed to realize in order to use the SparseConvertFromCoordinate I was required to adjust the coordinate format row and column number from 1, 1 to 0, 0 , and, of course, for all subsequent coordinate format rows and columns.

I updated the original code with this part of code which reduces coordinate numbers by 1. And everything ran! Well, at least I got some answers and exit code 0.

// assign forced unwrapping for casting to appropriate arrays

for index in 0...rowcountm1 {

rows32[index] = Int32(rows![index] - 1 )

cols32[index] = Int32(cols![index] - 1 )

datsdouble[index] = Double(dats![index])

}

I re-tested on the 4x4 example given in Apple documentation on Creating a Sparse Matrix from Coordinate Format Arrays. Adjusted all the coordinates up by 1 and ran with the code with the - 1 to reduce the coordinate rows and columns coordinates just to be sure. Everything works (answers are correct). So, I just have to remember when downloading to check the coordinates to see where they start, and adjust if need be.