Invert Matrix

From: Julia Campa Romero <Julia.Campa_at_ciemat.es>
Date: Wed, 5 Aug 2009 13:01:02 +0200


Hi,

I want to invert a 39x39 symetric matrix. But I have some difficulties. First, I fill the upper diagonal elements and then I complete it. The programa to fill the Matrix is:


   TMatrixD h(39,39);
   //CON are the values of the elements
   for (Int_t i=0;i<39;i++){

     for (Int_t j=i;j<39;j++){
     h[i][j]=CON[i][j];

 }   

   //completed the low diagonal elements    for (Int_t j=0;j<i;j++){
     h[i][j]=CON[j][i];     

    }    

   }



--Then to check whether the matrix is singular before attempting to
invert it I write:
       TDecompLU lu(h);
       TMatrixD p;
       if (!lu.Decompose()) {
       cout << "Decomposition failed, matrix singular ?" << endl;
      } else {
      lu.Invert(p);
       }


 And it gives me the following error:

 >>Error in <TDecompLU::Invert(TMatrixD &>: Input matrix has wrong shape

--Then when I made

  >TMatrixD hi=h.Invert();
It is gives me:
 >>Error in <TDecompLU::InvertLU>: matrix is singular, 1 diag elements < tolerance of 2.2204e-16

Could you explain me what it is happening?

Julia Campa



Confidencialidad:
Este mensaje y sus ficheros adjuntos se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente respondiendo al mensaje y proceda a su destrucción.

Disclaimer:
This message and its attached files is intended exclusively for its recipients and may contain confidential information. If you received this e-mail in error you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited and may be unlawful. In this case, please notify us by a reply and delete this email and its contents immediately.


Received on Wed Aug 05 2009 - 13:01:11 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 05 2009 - 17:50:02 CEST