Develop and Download Open Source Software

Browse Subversion Repository

Diff of /EBSDConograph/src/marquardt_codes/levenberg_marquardt/stopx.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by rtomiyasu, Wed Mar 11 04:28:52 2020 UTC revision 8 by rtomiyasu, Tue Mar 31 07:55:06 2020 UTC
# Line 48  int putInterruptionSignal() Line 48  int putInterruptionSignal()
48  {  {
49          return interrupted;          return interrupted;
50  }  }
   
 // for GUI  
 #include <sstream>  
 #include <iomanip>  
 #include <cmath>  
 using namespace std;  
 namespace  
 {  
         const char *functionName = "";  
         int         progIndiv    = 0;  
         int         progTotal    = 0;  
 }  
 void  interruptCansel() { interrupted = 2; }  
 void  interruptSkip  () { interrupted = 1; }  
 void  interruptClear () { interrupted = 0; }  
 string getProgress()  
 {  
         ostringstream oss;  
         oss <<setw(3)<< ::progTotal <<setw(4)<< ::progIndiv <<"%: "<< ::functionName;  
         return oss.str();  
 }  
 void setProgress(const int indiv, const int total, const int span, const char *funcName)  
 {  
         ::progIndiv    = indiv==0 ? 0 : max(::progIndiv, indiv);  
         ::progTotal    = total + ::progIndiv * span/100;  
         ::functionName = funcName;  
 }  
 bool IS_CANSELED()  
 {  
         return interrupted == 2;  
 }  
 void CHECK_INTERRUPTION() throw(const char*)  
 {  
         if(IS_CANSELED()) { throw("abort"); }  
 }  

Legend:
Removed from v.7  
changed lines
  Added in v.8

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26