Changeset 1525
 Timestamp:
 Jan 1, 2010 9:30:24 AM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

stable/1.1/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp
r1524 r1525 808 808 warmstart_ = NULL; 809 809 810 double * of_current = new double[numsolve];810 double * of_current = (numsolve > 0) ? new double[numsolve]: NULL; 811 811 int num_failed, num_infeas; 812 812 double mean, std_dev, var_coeff; … … 892 892 <<CoinMessageEol; 893 893 894 895 if(isProvenOptimal()) 896 { 897 of_current[f] = getObjValue(); 898 mean=mean+of_current[f]; 899 if (of_current[f] < min) 900 min = of_current[f]; 901 else if (of_current[f] > max) 902 max = of_current[f]; 903 } 904 else 905 { 906 of_current[f] = 0; 907 } 908 909 } 910 911 912 //calculate the mean 913 mean=mean/(numsolvenum_failednum_infeas); 914 915 std_dev = 0; 916 917 //calculate the std deviation 918 for(int i=0; i<numsolve; i++) 919 { 920 if(of_current[i]!=0) 921 std_dev=std_dev+pow(of_current[i]mean,2); 922 } 923 std_dev=pow((std_dev/(numsolvenum_failednum_infeas)),0.5); 924 925 //calculate coeff of variation 926 var_coeff=std_dev/mean; 927 894 if(of_current != NULL){ 895 if(isProvenOptimal()) 896 { 897 of_current[f] = getObjValue(); 898 mean=mean+of_current[f]; 899 if (of_current[f] < min) 900 min = of_current[f]; 901 else if (of_current[f] > max) 902 max = of_current[f]; 903 } 904 else 905 { 906 of_current[f] = 0; 907 } 908 } 909 } 910 911 912 if(of_current != NULL){ 913 //calculate the mean 914 mean=mean/(numsolvenum_failednum_infeas); 915 916 std_dev = 0; 917 918 //calculate the std deviation 919 for(int i=0; i<numsolve; i++) 920 { 921 if(of_current[i]!=0) 922 std_dev=std_dev+pow(of_current[i]mean,2); 923 } 924 std_dev=pow((std_dev/(numsolvenum_failednum_infeas)),0.5); 925 926 //calculate coeff of variation 927 var_coeff=std_dev/mean; 928 } 928 929 929 930
Note: See TracChangeset
for help on using the changeset viewer.