Matrix Inversion no solver

Hello everyone,

I want to solve a linear system. I have a vandermonde matrix in a linear system. I figured out i should solve it with real[int] sol = A^-1 * b as suggested in the documentation, but i get the following error :

MATERROR 1 : VirtualMatrix:: no solver ?????
  current line = 90
 call interpolation  at  line 95
Exec error : MATERROR
   -- number :1
Exec error : MATERROR
   -- number :1
 err code 8 ,  mpirank 0

Why do i have to specify a solver, i thought this is regular matrix inversion (gauss-jordan?). How should i specify the solver ?

Here is the code :

func real[int] interpolation(real[int] A, real[int] B, real pente) {
  matrix vandermonde =
      [[A [0] ^ 3, A [0] ^ 2, A [0], 1], [B [0] ^ 3, B [0] ^ 2, B [0], 1],
       [3 * A [0] ^ 2, 2 * A [0], 1, 0], [3 * B [0] ^ 2, 2 * B [0], 1, 0]];
  real[int] sndmembre = [ A[1], B[1], 0, pente ];
  real[int] sol = vandermonde ^ -1 * sndmembre;
  return sol;
}

real[int] p10 = p1 + departChauffe;
real[int] coeffs = interpolation(p1, p10, pente);

Thank you for your help :slight_smile:

What if you do set(vandermonde, solver = sparse solver); before the call to ^-1?

1 Like

it worked, i used sparsesolver in one word, thank you :slight_smile:

Sorry for the small error on behalf of my auto-correct.