Commit e9a7821b05145a1b6c019b4c9faa288044eba3e5

Authored by David Mayerich
1 parent ab01c2d7

Code should now compile, but still needs the determinant lines replaced

Showing 1 changed file with 7 additions and 13 deletions   Show diff stats
@@ -154,11 +154,14 @@ void gpuComputeEignS( size_t g, size_t fea){ @@ -154,11 +154,14 @@ void gpuComputeEignS( size_t g, size_t fea){
154 } 154 }
155 155
156 ///DETERMINANT CURRENTLY REQUIRES OPENCV 156 ///DETERMINANT CURRENTLY REQUIRES OPENCV
157 - cv::Mat newSw = cv::Mat((int)r, (int)r, CV_32FC1, nSw); //within scatter of gnome g in the population  
158 - cv::Mat newSb = cv::Mat((int)r, (int)r, CV_32FC1, nSb); //within scatter of gnome g in the population 157 + std::cout<<"ERROR: This code requires a fix to remove an OpenCV dependence."<<std::endl;
  158 + exit(1);
  159 + //FIX BY REPLACING THE FOLLOWING THREE LINES OF CODE USING LAPACK
  160 + //cv::Mat newSw = cv::Mat((int)r, (int)r, CV_32FC1, nSw); //within scatter of gnome g in the population
  161 + //cv::Mat newSb = cv::Mat((int)r, (int)r, CV_32FC1, nSb); //within scatter of gnome g in the population
159 162
160 //fisher's ratio from ratio of projected sb and sw 163 //fisher's ratio from ratio of projected sb and sw
161 - float fisherRatio = cv::determinant(newSb) /cv::determinant(newSw); 164 + float fisherRatio = 0;// = cv::determinant(newSb) /cv::determinant(newSw);
162 gnom.S[g] = 1/fisherRatio; 165 gnom.S[g] = 1/fisherRatio;
163 if (debug) { 166 if (debug) {
164 std::cout<<"Score["<<g<<"]: "<< gnom.S[g]<<std::endl; 167 std::cout<<"Score["<<g<<"]: "<< gnom.S[g]<<std::endl;
@@ -190,17 +193,8 @@ void fitnessFunction( float* sb, float* sw, float* lda, float* M, float* cM, siz @@ -190,17 +193,8 @@ void fitnessFunction( float* sb, float* sw, float* lda, float* M, float* cM, siz
190 size_t nC = nP.size(); //total number of classes 193 size_t nC = nP.size(); //total number of classes
191 194
192 //--------------Compute between class scatter 195 //--------------Compute between class scatter
193 - // ga.cpu_computeSbSw(sb, sw, M, cM, nC, tP, nP, gen);  
194 - //  
195 - //if(debug){  
196 - // std::cout<<"cpu results of Sb sn Sw"<<std::endl;  
197 - // displayS(sb, ga.f); //display Sb  
198 - // displayS(sw, ga.f); //display Sw  
199 - // }  
200 -  
201 - //ga.callingGpuComputeSbSw(sb, sw, nC, tP, nP, props, gen); 196 +
202 ga.gpu_computeSbSw(sb, sw, nC, tP, props, gen, debug, profilefile); 197 ga.gpu_computeSbSw(sb, sw, nC, tP, props, gen, debug, profilefile);
203 - //ga.cpu_computeSbSw(sb, sw, M, cM, nC, tP, nP);  
204 198
205 if(debug){ 199 if(debug){
206 std::cout<<"From fitness function: gpu results of Sb sn Sw"<<std::endl; 200 std::cout<<"From fitness function: gpu results of Sb sn Sw"<<std::endl;