Closed LindleyLentati closed 11 years ago
Thanks for reporting this issue! If the sparse matrix K has stype==0, then it is considered as unsymmetric matrix. From CHOLMOD manual: "In the symmetric case, A or A(p,p) is analyzed, where p is the fill-reducing ordering. In the unsymmetric case, A_A’ or A(p,:)_A(p,:)’ is analyzed." Thus, your code computes the inverse of K*K'. To fix your code, it should sufficient to have a line K->stype = 1; // Use upper triangular part at some point between cholmod_dense_to_sparse and cholmod_analyze. I'll fix the similar code in the test function to set the stype to a positive (non-zero) value as well. Thanks!
There's also issue1.c in Source folder (and compiled by Makefile to Build folder), which should behave correctly.
Hi there,
I'm trying to use your code to calculate the inverse of a matrix in combination with Cholmod, i have the following:
int main(void) { int N = 10 ; int i, j, n ; //Int _I, J ; //double X ; int nz = 0; double Ax ; double x, error ; cholmod_dense A, invK, spinvK, I ; cholmod_sparse K, V ; cholmod_factor L ; cholmod_common Common,_cm ; clock_t start, end; double cpu_time_used; cm=&Common; // Start using CHOLMOD cholmod_start(cm) ; cm->print=5; /* SPARSE COVARIANCE MATRIX CONSTRUCTION */
}
I.e. just a diagonal matrix, with 5 along the diagonal, which should give me 1/5, but it gives me 1/5^2 and I have no idea why! Have you come across this kind of issue before? Am i just doing something stupid.
Cheers Lindley