This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SparseLU solver in dll

Tags: None
(comma "," separated)
cschulz
Registered Member
Posts
2
Karma
0

SparseLU solver in dll

Thu May 29, 2014 10:22 pm
Hi,
i'm trying to use the sparse lu solver in a class that's part of a dll. Right after the successful initialization of the solver i test it with a random rhs vector and it works. But calling methods from outside the solver fails. Thanks for any suggestion what i might done wrong.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: SparseLU solver in dll

Sat May 31, 2014 10:46 am
What do you mean by "calling methods from outside the solver"?
cschulz
Registered Member
Posts
2
Karma
0

Re: SparseLU solver in dll

Tue Jun 03, 2014 9:40 pm
Hi,
thank you for your help,
my class looks like this:

Code: Select all
class myStuff
{
  void initSolver();
  void testSolver();
  SparseLU<SparseMatrix<double, ColMajor, int>, COLAMDOrdering<int>> m_solver;
}


the initSolver() method sets up the m_solver variable, i.e.

Code: Select all
void myStuff::initSolver()
{
  // for some matrix A SparseMatrix<double, ColMajor, int>
  A.makeCompressed();

  m_solver.isSymmetric(true);
  m_solver.analyzePattern(A);
  m_solver.factorize(A);

  testSolver(); // works
}


and calls testsolver. This is just solving for a constant vector. Then it works.
But if i try it outside, that is:

Code: Select all

  myStuff.testSolver();



it fails.
Thank you again for reading it.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: SparseLU solver in dll

Wed Jun 04, 2014 12:34 pm
m_solver keeps a const reference to the matrix A which must still be valid when calling testSolver.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: SparseLU solver in dll

Wed Jun 04, 2014 12:37 pm
hm, no that does not seems to the case, but you can still try to keep it as a member of your class for debugging purpose.

BTW, how does it fail?


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]