Closed
Merge Request #3 · created by Jiaming Guo


new netmets

add mapping in netmets


From JACK into master

Closed by Jiaming Guo

Changes were not merged into target branch

2 participants

main.cu
... ... @@ -122,15 +122,15 @@ void glut_render_modelview(){
122 122 //draws the network(s)
123 123 void glut_render(void) {
124 124  
125   - if(ind == 0){
126   - if(num_nets == 1){ //if a single network is loaded
  125 + if (ind == 0) {
  126 + if (num_nets == 1) { //if a single network is loaded
127 127 glut_render_single_projection(); //fill the entire viewport
128 128 glut_render_modelview(); //set up the modelview matrix with camera details
129 129 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
130 130 GT.glCenterline0(); //render the GT network (the only one loaded)
131 131 }
132 132  
133   - if(num_nets == 2){ //if two networks are loaded
  133 + if (num_nets == 2) { //if two networks are loaded
134 134  
135 135 glut_render_left_projection(); //set up a projection for the left half of the window
136 136 glut_render_modelview(); //set up the modelview matrix using camera details
... ... @@ -140,20 +140,20 @@ void glut_render(void) {
140 140 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
141 141 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map
142 142  
143   - GT.glCenterline(GT.nmags() - 1); //render the GT network
  143 + GT.glCenterline(); //render the GT network
144 144  
145 145 glut_render_right_projection(); //set up a projection for the right half of the window
146 146 glut_render_modelview(); //set up the modelview matrix using camera details
147   - T.glCenterline(T.nmags() - 1); //render the T network
  147 + T.glCenterline(); //render the T network
148 148 }
149 149 }
150   - else{
151   - if(num_nets == 1){ //if a single network is loaded
  150 + else {
  151 + if (num_nets == 1) { //if a single network is loaded
152 152 std::cout << "You should have at least two networks to do mapping." << std::endl; //exit program because there isn't enough network
153 153 exit(1);
154 154 }
155   - if(num_nets == 2){ //if two networks are loaded
156   - if(compareMode){
  155 + if (num_nets == 2) { //if two networks are loaded
  156 + if (compareMode) {
157 157 glut_render_left_projection(); //set up a projection for the left half of the window
158 158 glut_render_modelview(); //set up the modelview matrix using camera details
159 159 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
... ... @@ -162,14 +162,14 @@ void glut_render(void) {
162 162 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
163 163 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map
164 164  
165   - _GT.glCenterline(_GT.nmags() - 1); //render the GT network
  165 + _GT.glCenterline(); //render the GT network
166 166  
167 167 glut_render_right_projection(); //set up a projection for the right half of the window
168 168 glut_render_modelview(); //set up the modelview matrix using camera details
169   - _T.glCenterline(_T.nmags() - 1); //render the T network
  169 + _T.glCenterline(); //render the T network
170 170  
171 171 }
172   - else{
  172 + else {
173 173 glut_render_left_projection(); //set up a projection for the left half of the window
174 174 glut_render_modelview(); //set up the modelview matrix using camera details
175 175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
... ... @@ -183,7 +183,7 @@ void glut_render(void) {
183 183 }
184 184 }
185 185  
186   - if(num_nets == 2){
  186 + if (num_nets == 2) {
187 187 std::ostringstream ss;
188 188 if (mappingMode) // if it is in mapping mode
189 189 ss << "Mapping Mode";
... ... @@ -204,8 +204,8 @@ void glut_render(void) {
204 204 glPushMatrix();
205 205 glLoadIdentity();
206 206  
207   - glRasterPos2f(0, 5); //print text in the bottom left corner
208   - glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, (const unsigned char*)(ss.str().c_str()));
  207 + glRasterPos2f(0, 5); //print text in the bottom left corner
  208 + glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, (const unsigned char*)(ss.str().c_str()));
209 209  
210 210 glPopMatrix();
211 211 glMatrixMode(GL_PROJECTION);
... ... @@ -375,8 +375,8 @@ void compare(float sigma, int device){
375 375 T = T.compare(GT, sigma, device); //compare the test case to the ground truth - store errors in T
376 376  
377 377 //calculate the metrics
378   - float FPR = GT.average(0); //calculate the metrics
379   - float FNR = T.average(0);
  378 + float FPR = GT.average(); //calculate the metrics
  379 + float FNR = T.average();
380 380  
381 381 std::cout << "FNR: " << FPR << std::endl; //print false alarms and misses
382 382 std::cout << "FPR: " << FNR << std::endl;
... ...
main_dep.cu renamed to main_dep.old