Inverting a matrix

Good Morning Root Users!
Today I stumbled upon the obnoxious problem of inverting a NxN matrix. #-o
The only decent piece of code that I have found on the web is @
bit.ly/299qjz1
However, when I try to use it, i get an error:

That’s strange because I did declare the function before the beginning of the root macro smearing2.C, just like the other functions (that work fine). In fact I’ve simply copied and pasted the whole code just below the other functions that I use in the macro… I don’t understand.
Thanks a lot in advance!

P.S.
This is the beginning of the macro:

void smearing2(){ using namespace std; double R[NBIN][NBIN]; double Rinv[NBIN][NBIN];

Hi,

you can start from here to learn how to invert matrices in ROOT: root.cern.ch/how/how-invert-matrix
The details about SMatrix can be found here: root.cern.ch/doc/master/classRO … 8cf6724b38

Cheers,
Danilo

Thank you! I am trying to use the SMatrix Package.
I thought that in order to include the library I had to code something like

[code]

include [/code]

But I get the error

Thanks!

You can root.cern.ch/doc/master/dir_af2 … a22e8.html have a look to:

#include "Math/SMatrix.h"

D

I did try that one as well, but i get

[quote]Error: cannot open file “Math/SMatrix.h” matrix.C:5:
*** Interpreter error recovered ***[/quote]

Is the file actually present on your system? What system do you have? How did you install root?

I used the ubuntu software center

I don’t know if that installs the entire ROOT.
Perhaps you can have a look to our installation instructions root.cern/content/release-60604

Cheers,
Danilo