00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _matrix3d_h
00009 #define _matrix3d_h
00010
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013
00014
00015
00016 #include <iostream>
00017 using namespace std;
00018 #include <fstream>
00019 #include <string>
00020
00021
00022 #include "MatrixDouble.h"
00023
00024
00025 class matrix3d
00026 { protected:
00027
00028 MatrixDouble* mat3d;
00029 int numZ;
00030 int numR;
00031 int numC;
00032
00033
00034 public:
00035
00036 void initializeEmpty();
00037
00038
00039
00040 void allocate(int numZin, int rowIn, int colIn);
00041 void allocate(int numZin);
00042 void deallocate();
00043
00044
00045 matrix3d& operator+= (matrix3d& matrix2);
00046 matrix3d& operator-= (matrix3d& matrix2);
00047 matrix3d& operator= (matrix3d& m3d2);
00048
00049 matrix3d& operator*= (matrix3d& matrix2);
00050 matrix3d& operator*= (double fact);
00051
00052
00053 int rows() const;
00054 int cols() const;
00055 int layers() const;
00056
00057
00058
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
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
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