Dear all,
I am trying to understand how it works the SKS format. Since I am obtaining incorrect results, I tried first to create a normal NxN sparse matrix, and then convert it to sks format. However, I am still getting incongruous results. Here is the piece of code (C#) that I am using for testing:
alglib.sparsematrix ss = new alglib.sparsematrix(); int nndof = 3; alglib.sparsecreate(nndof, nndof,out ss); alglib.sparseset(ss, 0, 0, 1.0); alglib.sparseset(ss, 1, 1, 20.0); alglib.sparseset(ss, 2, 2, 10.0); alglib.sparseset(ss, 1, 2, -10.0); alglib.sparseset(ss, 2, 1, -10.0); alglib.sparsesolverreport report2 = new alglib.sparsesolverreport(); double[] force2 = new double[nndof]; force2[2] = -10.0; double[] disp2 = new double[nndof]; alglib.sparsesolve(ss, force2, out disp2, out report2); double[] disp3 = new double[nndof]; alglib.sparseconverttosks(ss); alglib.sparsespdcholeskysolve(ss, true, force2, out disp3, out report2);
Results: Disp2 = [0, -1, -2] (Correct) Disp3 = [0, -0.05, -0.1] (Incorrect)
Can you please help me to understand what I am doing wrong? Many thanks.
Best regards, Gabbia
|