BandeMatrix Class Reference

#include <band_matrix.h>

Inheritance diagram for BandeMatrix:

Inheritance graph
[legend]
Collaboration diagram for BandeMatrix:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BandeMatrix (int taille, int kl, int ku)
int FactoLU ()
 perform LU facotrization
double & operator() (int i, int j)
 access to the coordinate i,j
int PrintCompressed (char *f)
int Solve (Vector *r)
 solve the system Ax=b where b is residu parameter and A is current class.
int zero ()
 ~BandeMatrix ()

Private Attributes

int dim
int kl
int ku
double nulle

Detailed Description

Class that implements a band matrix as a higher layer of Lapack

Definition at line 56 of file band_matrix.h.


Constructor & Destructor Documentation

BandeMatrix::BandeMatrix ( int  taille,
int  kl,
int  ku 
) [inline]

Definition at line 60 of file band_matrix.h.

References dim, MyMatrix< BandeMatrix >::matrix, nulle, and zero().

00060                                        :MyMatrix<BandeMatrix>(taille,taille){
00061     this->kl = kl;
00062     this->ku = ku;
00063     dim = 2*kl+ku+1;
00064     matrix = new double[taille*dim];
00065     zero();
00066     nulle=0;
00067   };

Here is the call graph for this function:

BandeMatrix::~BandeMatrix (  )  [inline]

Definition at line 68 of file band_matrix.h.

00068 {};


Member Function Documentation

int BandeMatrix::FactoLU (  )  [inline]

perform LU facotrization

Reimplemented from MyMatrix< BandeMatrix >.

Definition at line 82 of file band_matrix.h.

References MyMatrix< BandeMatrix >::_m, factoLUBand(), kl, ku, MyMatrix< BandeMatrix >::matrix, and MyMatrix< BandeMatrix >::pivot.

00082                {
00083     pivot = factoLUBand(matrix,kl,ku,_m);
00084     if (pivot==0)
00085       return -1;
00086     else 
00087       return 0;
00088   }

Here is the call graph for this function:

double& BandeMatrix::operator() ( int  i,
int  j 
) [inline]

access to the coordinate i,j

Reimplemented from MyMatrix< BandeMatrix >.

Reimplemented in DiagMatrix.

Definition at line 70 of file band_matrix.h.

References dim, kl, ku, MyMatrix< BandeMatrix >::matrix, and nulle.

00070                                  {
00071     int k = j-i;
00072 
00073     // diagonale supérieure
00074     if (k>ku || k < -kl){
00075       nulle = 0;
00076       return nulle;
00077     }
00078     
00079     return matrix[kl+ku-k+j*dim];
00080   }

int BandeMatrix::PrintCompressed ( char *  f  )  [inline]

Definition at line 100 of file band_matrix.h.

References MyMatrix< BandeMatrix >::_m, dim, file, and MyMatrix< BandeMatrix >::matrix.

00100                                {
00101     FILE * file = fopen(f,"wb+");    
00102 
00103     for (int i=0;i< dim;++i)
00104       for (int j=0;j< _m;++j)
00105         {
00106           fprintf(file,"%d\t%d\t%.15e\n",i+1,j+1,matrix[i+dim*j]);
00107         }
00108 
00109     fclose(file);
00110     return 0;
00111   }

int BandeMatrix::Solve ( Vector residu  )  [inline]

solve the system Ax=b where b is residu parameter and A is current class.

Reimplemented from MyMatrix< BandeMatrix >.

Definition at line 90 of file band_matrix.h.

References MyMatrix< BandeMatrix >::_m, Vector::GetVector(), kl, ku, MyMatrix< BandeMatrix >::matrix, MyMatrix< BandeMatrix >::pivot, and solveBandMatrix().

00090                        {
00091     solveBandMatrix(matrix,r->GetVector(),kl,ku,_m,pivot);
00092     return 0;
00093   }

Here is the call graph for this function:

int BandeMatrix::zero (  )  [inline]

Definition at line 95 of file band_matrix.h.

References MyMatrix< BandeMatrix >::_m, dim, and MyMatrix< BandeMatrix >::matrix.

Referenced by BandeMatrix().

00095             {
00096     memset(matrix,0,_m*dim*sizeof(double)); // mise a zero  
00097     return 0;
00098   }


Member Data Documentation

int BandeMatrix::dim [private]

Definition at line 115 of file band_matrix.h.

Referenced by BandeMatrix(), operator()(), PrintCompressed(), and zero().

int BandeMatrix::kl [private]

Definition at line 115 of file band_matrix.h.

Referenced by FactoLU(), operator()(), and Solve().

int BandeMatrix::ku [private]

Definition at line 115 of file band_matrix.h.

Referenced by FactoLU(), operator()(), and Solve().

double BandeMatrix::nulle [private]

Definition at line 116 of file band_matrix.h.

Referenced by BandeMatrix(), and operator()().


The documentation for this class was generated from the following file:
Generated on Fri Sep 7 13:13:02 2007 for LibMultiScale by  doxygen 1.5.2