Changeset 2267 in Sophya for trunk/SophyaLib/TArray/tmatrix.cc


Ignore:
Timestamp:
Nov 15, 2002, 10:35:44 AM (23 years ago)
Author:
ansari
Message:

MAJ documentation + methode Read/WriteASCII() en virtuelle pure ds BaseArray - Reza 15/11/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/tmatrix.cc

    r1624 r2267  
    1 // $Id: tmatrix.cc,v 1.22 2001-08-06 22:48:43 cmv Exp $
     1// $Id: tmatrix.cc,v 1.23 2002-11-15 09:35:44 ansari Exp $
    22//                         C.Magneville          04/99
    33#include "machdefs.h"
     
    1010  \class SOPHYA::TMatrix
    1111  \ingroup TArray
    12   Class of matrixes
    13   \sa TArray
     12 
     13  The TMatrix class specializes the TArray class for representing
     14  two dimensional arrays as matrices. Matrix and vector operations,
     15  such as matrix multiplication or transposition is implemented.
     16  \b Matrix is a typedef for double precision floating point matrix ( TMatrix<r_8> ).
     17
     18  \sa SOPHYA::TArray  SOPHYA::TVector
     19  \sa SOPHYA::Range  \sa SOPHYA::Sequence
     20  \sa SOPHYA::MathArray  \sa SOPHYA::SimpleMatrixOperation
     21
     22  The following sample code illustrates vector-matrix multiplication
     23  and matrix inversion, using simple gauss inversion.
     24  \code
     25  #include "array.h"
     26  // ....
     27  int n = 5;      // Size of matrix and vectors here
     28  Matrix a(n,n); 
     29  a = RandomSequence(RandomSequence::Gaussian, 0., 2.5);
     30  Vector x(n);
     31  x = RegularSequence(1.,3.);
     32  Vector b = a*x;
     33  cout << " ----- Vector x = \n " << x << endl;
     34  cout << " ----- Vector b = a*x = \n " << b << endl;
     35  SimpleMatrixOperation<r_8> smo;
     36  Matrix inva = smo.Inverse(a);
     37  cout << " ----- Matrix Inverse(a) = \n " << inva << endl;
     38  cout << " ----- Matrix a*Inverse(a) = \n " << inva*a << endl;
     39  cout << " ----- Matrix Inverse(a)*b (=Inv(a)*a*x) = \n " << inva*b << endl;
     40  cout << " ----- Matrix x-Inverse(a)*b = (=0 ?)\n " << x-inva*b << endl; 
     41  \endcode
     42 
    1443 */
    1544
Note: See TracChangeset for help on using the changeset viewer.