00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _CMGRAPHS_MORSECON_H_
00034 #define _CMGRAPHS_MORSECON_H_
00035
00036
00037
00038 #include "chomp/system/config.h"
00039 #include "chomp/struct/multitab.h"
00040
00041
00042 #include "config.h"
00043 #include "typedefs.h"
00044 #include "morsedec.h"
00045
00046
00047
00048
00049
00050
00051
00052
00053 class TConnTable
00054 {
00055 public:
00056
00057 TConnTable (int _n, chomp::homology::multitable
00058 <chomp::homology::multitable<int> > &_connections,
00059 chomp::homology::multitable<int> &_conncount,
00060 const int *_numTranslate);
00061
00062
00063 void operator () (int source, int target, int v);
00064
00065 private:
00066
00067 int n;
00068
00069
00070
00071 chomp::homology::multitable <chomp::homology::multitable<int> >
00072 &connections;
00073
00074
00075 chomp::homology::multitable<int> &conncount;
00076
00077
00078 const int *numTranslate;
00079
00080 };
00081
00082 inline TConnTable::TConnTable (int _n,
00083 chomp::homology::multitable<chomp::homology::multitable<int> >
00084 &_connections, chomp::homology::multitable<int> &_conncount,
00085 const int *_numTranslate):
00086 n (_n), connections (_connections), conncount (_conncount),
00087 numTranslate (_numTranslate)
00088 {
00089 int maxcount = n * n;
00090 for (int i = 0; i < maxcount; ++ i)
00091 conncount [i] = 0;
00092 return;
00093 }
00094
00095 inline void TConnTable::operator () (int source, int target, int v)
00096 {
00097 int pos = n * source + target;
00098 connections [pos] [conncount [pos] ++] = numTranslate [v];
00099 return;
00100 }
00101
00102
00103
00104
00105
00106 class TConnMorse
00107 {
00108 public:
00109
00110 TConnMorse (theMorseDecompositionType &_morseDec,
00111 const spcCubes &_X, const int *_numTranslate);
00112
00113
00114 void operator () (int source, int target, int v);
00115
00116 private:
00117
00118 theMorseDecompositionType &morseDec;
00119
00120
00121 const spcCubes &X;
00122
00123
00124 const int *numTranslate;
00125
00126 };
00127
00128 inline TConnMorse::TConnMorse (theMorseDecompositionType &_morseDec,
00129 const spcCubes &_X, const int *_numTranslate):
00130 morseDec (_morseDec), X (_X), numTranslate (_numTranslate)
00131 {
00132 return;
00133 }
00134
00135 inline void TConnMorse::operator () (int source, int target, int v)
00136 {
00137 morseDec. addconn (source, target, X [numTranslate [v]]);
00138 return;
00139 }
00140
00141
00142 #endif // _CMGRAPHS_MORSECON_H_
00143