134 #include "type_parite.h" 184 Matrice (
int size1,
int size2 ) ;
277 double&
set(
int j,
int i) {
278 assert (
etat == ETATQCQ) ;
279 assert ((i>=0) && (i<std->dim.dim[0])) ;
280 assert( (j>=0) && (j<std->dim.dim[1]) ) ;
282 return std->t[
std->dim.dim[0] * j + i] ;
291 assert(
etat != ETATNONDEF) ;
292 assert( (i>=0) && (i<std->dim.dim[0]) ) ;
293 assert( (j>=0) && (j<std->dim.dim[1]) ) ;
294 if (
etat == ETATZERO) {
298 else return std->t[
std->dim.dim[0] * j + i] ;
309 void set_band (
int up,
int low)
const ;
373 ostream& operator<<(ostream& ,
const Matrice& ) ;
380 Matrice
operator+ (
const Matrice&,
const Matrice& ) ;
381 Matrice
operator- (
const Matrice&,
const Matrice& ) ;
382 Matrice
operator* (
const Matrice&,
double ) ;
383 Matrice
operator* (
double,
const Matrice& ) ;
384 Matrice
operator* (
const Matrice&,
const Matrice& ) ;
385 Matrice
operator/ (
const Matrice&,
double ) ;
Tbl * lu
Pointer on the first array of the LU-representation.
void operator/=(double)
Division of this by a double.
friend ostream & operator<<(ostream &, const Matrice &)
Display.
Tbl get_array() const
Returns the array of matrix elements.
void set_lu() const
Calculate the LU-representation, assuming the band-storage has been done.
Tbl inverse(const Tbl &sec_membre) const
Solves the linear system represented by the matrix.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int get_etat() const
Returns the logical state.
Basic integer array class.
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Tbl * band
Pointer on the array of the band representation of a square matrix.
friend Matrice operator*(const Matrice &, double)
Matrice * double
void operator-=(const Matrice &)
Subtraction of a Matrice to this.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int ku
Number of upper-diagonals in the band representation.
friend Matrice operator/(const Matrice &, double)
Matrice / double
void operator+=(const Matrice &)
Addition of a Matrice to this.
double operator()(int j, int i) const
Read-only of a particuliar element.
Tbl val_propre() const
Returns the eigenvalues of the matrix, calculated using LAPACK.
Cmp operator+(const Cmp &)
double determinant() const
Computes the determinant of the matrix, using LAPACK and the standard decomposition.
int kl
Number of lower-diagonals in the band representation.
void operator*=(double)
Multiplication of this by a double.
Itbl * permute
Pointer on the second array of the LU-representation.
void annule_hard()
Sets the logical state to ETATQCQ (undefined state).
friend Matrice operator-(const Matrice &, const Matrice &)
Matrice - Matrice
int get_dim(int i) const
Returns the dimension of the matrix.
Matrice transpose() const
Computes the transpose matrix.
Tbl * std
Pointer on the array of the standard representation.
void set_band(int up, int low) const
Calculate the band storage of *std.
void del_deriv()
Deletes the (mutable) derived members: band, lu, permute.
void operator=(double x)
Sets all the element of *std to x.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int etat
logical state (ETATZERO, ETATQCQ or ETATNONDEF)
Cmp operator-(const Cmp &)
- Cmp
Matrice(int size1, int size2)
Standard constructor.
friend Matrice operator+(const Matrice &, const Matrice &)
Matrice + Matrice
Matrice vect_propre() const
Returns the eigenvectors of the matrix, calculated using LAPACK.
void del_t()
Logical destructor : dellocates the memory of the various used representations.