Go to the documentation of this file.
81 int main( int argc, char **arg)
90 unsigned int n,k,nBoxes;
94 double *cost,minCost,maxCost;
96 unsigned int nMin,nMax;
98 boolean log_cost,scale_cost;
107 for(k=1;k<( unsigned int)argc-2;k++)
109 if (strcasecmp(arg[k], "scale")==0)
111 if (strcasecmp(arg[k], "log")==0)
113 if (strcasecmp(arg[k], "noscale")==0)
115 if (strcasecmp(arg[k], "nolog")==0)
133 fprintf(stderr, "Reading solution file : %s\n", GetFileFullName(&fsols));
137 Error( "Empty solution file in cuikenergy");
143 NEW(cost,nBoxes, double);
163 fprintf(stderr, "%u -> %g (%g)\n",k,cost[k],e);
167 minCost=cost[k]; nMin=k;
168 maxCost=cost[k]; nMax=k;
173 { maxCost=cost[k]; nMax=k; }
177 { minCost=cost[k]; nMin=k; }
183 fprintf(stderr, "Extreme energies : %g (%u) -- %g (%u)\n",minCost,nMin,maxCost,nMax);
184 fprintf(stderr, "Parameters: ");
186 fprintf(stderr, "log,");
188 fprintf(stderr, "nolog,");
190 fprintf(stderr, "scale\n");
192 fprintf(stderr, "noscale\n");
201 Error( "Output file for costs can not be opened");
203 for(k=0;k<nBoxes;k++)
207 e=((cost[k]-minCost)/(maxCost-minCost))*(1-1e-3)+1e-3;
208 fprintf(fout, "%g\n",e);
211 fprintf(fout, "%g\n",cost[k]);
233 fprintf(stderr, " Wrong number of parameters.\n");
234 fprintf(stderr, " Use:\n");
235 fprintf(stderr, " cuikenergy [log|nolog, scale|noscale] <problem_name>.pdb <sol_name>\n");
236 fprintf(stderr, " where:\n");
237 fprintf(stderr, " <log|nolog> [optional] Applies (or not) the log to the energy (default: nolog).\n");
238 fprintf(stderr, " <scale|noscale> [optional] Scales (or not) the energy to the range [0,1] (default: scale).\n");
239 fprintf(stderr, " <problem_name> the input molecular information file (pdb).\n");
240 fprintf(stderr, " <sol_name> Configurations to evaluate.\n");
241 fprintf(stderr, " The extension (e.g., '.pdb') is required\n");
242 fprintf(stderr, " All the extensions managed by OpenBabel can be used\n");
243 fprintf(stderr, " The ouput file is <sol_name>.cost\n");
246 return(EXIT_SUCCESS);
|
Follow us!