home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_01 / 9n01127b < prev    next >
Text File  |  1990-03-26  |  787b  |  29 lines

  1. //matrix package
  2.  
  3. #include "cvector.hpp"
  4.  
  5. class Cmatrix  {
  6.  
  7. private:
  8.    void init(int row=1,int col=1,int b=0);
  9. public:
  10.    complex** m;
  11.    int rowkt,colkt,base;
  12.  
  13.    Cmatrix(int rowkt,int colkt,int b) 
  14.       { init( rowkt, colkt, b);} //constructor
  15.    Cmatrix() {init();}      //  "
  16.    Cmatrix( Cmatrix&);      // init
  17.         ~Cmatrix();         // destructor
  18.    void operator=(Cmatrix& );
  19.    inline complex& elemnt(int i,int j)
  20.       {return m[i-base][j-base];}
  21.    void check(int,int);
  22.    complex& element(int,int);
  23.    inline void setelemnt(int i,int j,complex value)
  24.       {m[i][j]=value;   }
  25.    void setelement(int,int, complex);
  26.    friend Cmatrix operator*(Cmatrix&,Cmatrix&); //Mat*Mat   
  27.    friend Cvector operator*(Cmatrix&,Cvector&); //Mat*Vector
  28. };
  29.