ALGLIB forum
It is currently Fri Mar 24, 2023 11:16 pm

All times are UTC

Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: SKS solver
PostPosted: Mon Mar 20, 2023 9:55 am 

Joined: Mon Mar 20, 2023 9:44 am
Posts: 1
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.sparsespdcholeskysolve(ss, true, force2, out disp3, out report2);

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,

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group