Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _OCS_BIT_STRING_HH_
00015 #define _OCS_BIT_STRING_HH_
00016
00017 enum typeBitString { ALL_ZEROS = 0, ALL_ONES = 1, SINGLE_ONE = 2,
00018 RANDOM_SIMPLE = 3, RANDOM_EQUAL_ZEROS_ONES = 4,
00019 PSEUDO_RANDOM = 5, USER_DEFINED = 6 };
00020
00021
00022 #ifndef _OCS_SYSTEM_HDRS_
00023 #define _OCS_SYSTEM_HDRS_
00024
00025 #include <iostream.h>
00026 #include <string.h>
00027 #include <math.h>
00028 #include <fstream.h>
00029 #include <complex.h>
00030 #include <stdlib.h>
00031 #include <stdio.h>
00032 #include <strstream>
00033
00034 #include <string>
00035 using namespace std;
00036
00037
00038 #endif
00039
00040 #include "ocsConst.hh"
00041 #include "ocsTools.hh"
00042 #include "ocsReadWriteTools.hh"
00043 #include "ocsRanNumGen.hh"
00044
00045
00046 #include "StatisticsOfArray.hh"
00047
00048 #include <string>
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 class BitString
00071 {
00072
00073
00074
00075 public:
00076
00077
00078 BitString(ifstream * InFile, RanNumGen *RNG2);
00079
00080
00081 BitString(BitString & oBitString);
00082
00083 BitString(BitString & BitString1,BitString & BitString2,RanNumGen *RNG3);
00084
00085
00086 friend void AddBitStrings(BitString * BitString1,
00087 BitString * BitString2,
00088 BitString * BitString3);
00089
00090
00091 BitString & operator=(BitString & RHS_BitString);
00092
00093
00094 ~BitString();
00095
00096 void DeleteMemory(void);
00097 void ReallocateMemory(void);
00098
00099 string WriteTypeBitString(void);
00100
00101
00102 int GetStringLength(void) {return StringLength;};
00103 int GetNumChannels(void) {return NumChannels;};
00104 void SetNumChannels(int value) {NumChannels = value;};
00105
00106
00107 int GetChannelPhysicalIndex(int ChannelArrayIndex);
00108 int GetChannelArrayIndex(int ChannelPhysicalIndex);
00109
00110 void SetBit(int ChannelArrayIndex, int BitSlot, int BitValue);
00111 int GetBit(int ChannelArrayIndex, int BitSlot);
00112
00113 void WriteBitString(void);
00114
00115 string WriteBitString(int ChannelArrayIndex);
00116
00117
00118
00119
00120
00121
00122 void GetRandomString();
00123
00124 void SetAllZeros(int ChannelArrayIndex);
00125 void SetAllOnes(int ChannelArrayIndex);
00126 void SetSingleOne(int ChannelArrayIndex);
00127
00128 void SetStringToSingleMarkPerChannel(void);
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 void ReduceToSingleChannelBitString(int ChannelArrayIndex);
00141 void ReduceToSingleChannelBitString(BitString * SCBitString);
00142
00145 void AddBitStringBM(BitString & BitString2);
00146
00147
00148
00149
00150 string ReadString(string ParameterName, ifstream * InFile);
00151
00152 void SetRandomString(int ChannelArrayIndex);
00153 void SetPseudoRandomString(int ChannelArrayIndex);
00154 void SetUserDefined(ifstream * InFile);
00155
00156
00157
00158
00159 void AllocateBitStringArray(int NumChannels2);
00160 void ReleaseBitStringArray(void)
00161 { delete [] BitStringArray;};
00162
00163
00164
00165 private:
00166
00167 typeBitString TypeBitString;
00168
00169 int NumChannels;
00170 int StringLength;
00171 int * BitStringArray;
00172
00173
00174
00175
00176 RanNumGen *RNG;
00177
00178 int DebugLevel;
00179
00180
00181
00182 };
00183
00184 #endif
00185
00186
00187
00188
00189
00190
00191
00192
00193