Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

matrix3d.h

Go to the documentation of this file.
00001 /* Dies ist die header-Datei einer Matrix-Klasse fr Operationen
00002    von Matrizen mit identischen Dimensionen.
00003 
00004    Im Unterschied zu fuzznum.h handelt es sich hier um eine
00005    Matrix der Dimension (z_anzahl * s_zahl) und nicht (... * 2).
00006 */
00007 
00008 #ifndef _matrix3d_h
00009 #define _matrix3d_h
00010 
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 
00014 //Arnold2006_10
00015 // Libraries C++
00016 #include <iostream>
00017 using namespace std; // fuer C++-Compiler, damit cin nicht als std::cin eingelesen werden muss
00018 #include <fstream>   // new 2005
00019 #include <string>    // new 2005
00020 
00021 
00022 #include "MatrixDouble.h"
00023 //class matrix3d;
00024 
00025 class matrix3d
00026 {       protected:     //public
00027 
00028         MatrixDouble* mat3d;
00029         int numZ;     // number of 2D-Matrixes stacked
00030         int numR;     // Number of rows
00031         int numC;     // Number of columns in 2D-Matrix
00032 
00033 
00034 public:
00035 
00036     void initializeEmpty();
00037     
00038     
00039         //Declaraiton of functions
00040         void allocate(int numZin, int rowIn, int colIn);
00041     void allocate(int numZin);
00042         void deallocate();
00043 
00044    //Operators
00045         matrix3d& operator+= (matrix3d& matrix2);
00046         matrix3d& operator-= (matrix3d& matrix2);
00047         matrix3d& operator= (matrix3d& m3d2);
00048 
00049         matrix3d& operator*= (matrix3d& matrix2); // Elemennt-wise
00050         matrix3d& operator*= (double fact); // scalar multiplication
00051 
00052    //Return dimensions
00053    int rows() const;
00054    int cols() const;
00055    int layers() const;
00056 
00057 
00058    // Access functions
00059    void   setValue(int z, int r, int c, double val);
00060    double getValue(int z, int r, int c);
00061    void   setLayer(int z, MatrixDouble& mat);
00062    void   setAllValues(double val);
00063    
00064    
00065    int getLayers()  { return numZ;}
00066    
00067    //Creates Copy of a layer
00068    virtual void extractLayer(int z, MatrixDouble& newM);
00069 
00070         void printSize();
00071         virtual void printToScreen(int z);
00072         virtual void printToScreen();
00073     
00074     virtual void printToScreen_compact(int z);
00075     virtual void printToScreen_compact();
00076 
00077     virtual void printToScreen(int z, int rlu, int clu, int rdr, int cdr);    
00078         
00079 #ifdef DO_TDT
00080    virtual void sendViaTDT(char* configFile);
00081    virtual void receiveViaTDT(char* configFile);
00082 #endif
00083 
00085     
00086     // Constructors
00087     matrix3d();
00088     matrix3d(int numZ);
00089     matrix3d(int numZin, int rowIn, int colIn);
00090     
00091     
00092     ~matrix3d()
00093     { deallocate();
00094     }
00095 
00096 
00097 };
00098 
00099 #endif

Generated on Thu Aug 28 12:38:45 2008 for MPMAS by  doxygen 1.3.9.1