## M.FARAG

I have downloaded a library from this site that deals with Matrix and Complex........Does it do this correctly???
http://www.zenautics.com/matrixdoc/index.html
if so I want to use this library to get the inverse matrix of of a matrix consists of a complex elements
how can I do this???
If it is a wrong one
can any one help me to get a library do this function please

## M.FARAG

yes u can
It works well with real elements but for complex there is a problem that the output is wrong..
maybe I'm using wrong way

## Shinedevil 8

It works well with real elements but for complex there is a problem that the output is wrong..
maybe I'm using wrong way

Can you send us some of the code that you used? That would help me deciepher if there is a problem with the library, or your code :P. XD

## M.FARAG

see this

``````case ('C'):     //Generating G matrix
{  double Value=(w*A[i].Value);
complex<double> C1(0,Value) ;
for(j=0 ; j<No_Nodes ; j++ )
for( k=0 ; k<No_Nodes ; k++ )
{
if(((N1==(j+1))||(N2==(k+1)))&&(j==k))
G(j,k) += C1 ;
if((j!=k)&&((N1==(j+1))&&(N2==(k+1)))||((N1==(k+1))&&(N2==(j+1))))
G(j,k) -= C1 ;
}

Matrix Gin=G.Inverse();
cout<<endl<<"G matrix = \n"<<endl;
G.PrintStdout();
Gin.PrintStdout();  here is the problem the output of Gin is wrong``````

## firstPerson 761

>> I have downloaded a library from this site that deals with Matrix and Complex

You do realize that C++ has its own complex class. Why don't you