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

@@ -122,15 +122,15 @@ void glut_render_modelview(){ @@ -122,15 +122,15 @@ void glut_render_modelview(){
122 //draws the network(s) 122 //draws the network(s)
123 void glut_render(void) { 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 glut_render_single_projection(); //fill the entire viewport 127 glut_render_single_projection(); //fill the entire viewport
128 glut_render_modelview(); //set up the modelview matrix with camera details 128 glut_render_modelview(); //set up the modelview matrix with camera details
129 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen 129 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
130 GT.glCenterline0(); //render the GT network (the only one loaded) 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 glut_render_left_projection(); //set up a projection for the left half of the window 135 glut_render_left_projection(); //set up a projection for the left half of the window
136 glut_render_modelview(); //set up the modelview matrix using camera details 136 glut_render_modelview(); //set up the modelview matrix using camera details
@@ -140,20 +140,20 @@ void glut_render(void) { @@ -140,20 +140,20 @@ void glut_render(void) {
140 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color 140 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
141 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map 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 glut_render_right_projection(); //set up a projection for the right half of the window 145 glut_render_right_projection(); //set up a projection for the right half of the window
146 glut_render_modelview(); //set up the modelview matrix using camera details 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 std::cout << "You should have at least two networks to do mapping." << std::endl; //exit program because there isn't enough network 152 std::cout << "You should have at least two networks to do mapping." << std::endl; //exit program because there isn't enough network
153 exit(1); 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 glut_render_left_projection(); //set up a projection for the left half of the window 157 glut_render_left_projection(); //set up a projection for the left half of the window
158 glut_render_modelview(); //set up the modelview matrix using camera details 158 glut_render_modelview(); //set up the modelview matrix using camera details
159 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen 159 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
@@ -162,14 +162,14 @@ void glut_render(void) { @@ -162,14 +162,14 @@ void glut_render(void) {
162 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color 162 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
163 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map 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 glut_render_right_projection(); //set up a projection for the right half of the window 167 glut_render_right_projection(); //set up a projection for the right half of the window
168 glut_render_modelview(); //set up the modelview matrix using camera details 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 glut_render_left_projection(); //set up a projection for the left half of the window 173 glut_render_left_projection(); //set up a projection for the left half of the window
174 glut_render_modelview(); //set up the modelview matrix using camera details 174 glut_render_modelview(); //set up the modelview matrix using camera details
175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen 175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
@@ -183,7 +183,7 @@ void glut_render(void) { @@ -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 std::ostringstream ss; 187 std::ostringstream ss;
188 if (mappingMode) // if it is in mapping mode 188 if (mappingMode) // if it is in mapping mode
189 ss << "Mapping Mode"; 189 ss << "Mapping Mode";
@@ -204,8 +204,8 @@ void glut_render(void) { @@ -204,8 +204,8 @@ void glut_render(void) {
204 glPushMatrix(); 204 glPushMatrix();
205 glLoadIdentity(); 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 glPopMatrix(); 210 glPopMatrix();
211 glMatrixMode(GL_PROJECTION); 211 glMatrixMode(GL_PROJECTION);
@@ -375,8 +375,8 @@ void compare(float sigma, int device){ @@ -375,8 +375,8 @@ void compare(float sigma, int device){
375 T = T.compare(GT, sigma, device); //compare the test case to the ground truth - store errors in T 375 T = T.compare(GT, sigma, device); //compare the test case to the ground truth - store errors in T
376 376
377 //calculate the metrics 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 std::cout << "FNR: " << FPR << std::endl; //print false alarms and misses 381 std::cout << "FNR: " << FPR << std::endl; //print false alarms and misses
382 std::cout << "FPR: " << FNR << std::endl; 382 std::cout << "FPR: " << FNR << std::endl;
main_dep.cu renamed to main_dep.old