Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23006 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Oct 28, 2014
1 parent f2f0c0c commit a7bb0f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions SimulationRuntime/c/optimization/eval_all/EvalG.c
Expand Up @@ -89,7 +89,7 @@ Bool evalfG(Index n, double * vopt, Bool new_x, int m, Number *g, void * useData
double * vv[np+1];
int i, j, k, shift;


if(new_x){
optData2ModelData(optData, vopt, 1);
}
Expand Down Expand Up @@ -707,14 +707,14 @@ static inline void printMaxError(Number *g, const int m, const int nx, const int
gmax = tmp;
}
}

if(kk>-1){
if(kk < nx){
printf("\nmax error is %g for the approximation of the state %s(time = %g)\n",
gmax, data->modelData.realVarsData[kk].info.name, (double)t[ii][jj]);
}else if(kk < nJ){
const int ll = kk - nx + optData->dim.index_con;
printf("\nmax violation is %g for the constraint %s(time = %g)\n",
printf("\nmax violation is %g for the constraint %s(time = %g)\n",
gmax, data->modelData.realVarsData[ll].info.name, (double)t[ii][jj]);
}else{
const int ll = kk - nx + optData->dim.index_con;
Expand All @@ -737,20 +737,20 @@ static inline void debugeJac(OptData * optData){
const int np = optData->dim.np;
const int npv = np*nv;
double **J;

FILE *pFile;
char buffer[4096];

sprintf(buffer, "jac_ana_step_%i.csv", optData->iter_);
pFile = fopen(buffer, "wt");

fprintf(pFile,"name;time;");
for(j = 0; j < nx; ++j)
fprintf(pFile,"%s;",optData->data->modelData.realVarsData[j].info.name);
for(j = 0; j < nu; ++j)
fprintf(pFile, "%s;", optData->dim.inputName[j]);
fprintf(pFile,"\n");

for(i=0;i < nsi; ++i){
for(j = 0; j < nJ; ++j){
J = optData->J[i][j];
Expand All @@ -762,6 +762,6 @@ static inline void debugeJac(OptData * optData){
}
}
}
fclose(pFile);

fclose(pFile);
}
4 changes: 2 additions & 2 deletions SimulationRuntime/c/optimization/optimizer_main.c
Expand Up @@ -101,7 +101,7 @@ static inline void optimizationWithIpopt(OptData*optData){
/*tol */
AddIpoptNumOption(nlp, "tol", optData->data->simulationInfo.tolerance);
AddIpoptStrOption(nlp, "evaluate_orig_obj_at_resto_trial", "yes");

/* print level */
if(ACTIVE_STREAM(LOG_IPOPT_FULL)){
AddIpoptIntOption(nlp, "print_level", 7);
Expand Down Expand Up @@ -145,7 +145,7 @@ static inline void optimizationWithIpopt(OptData*optData){
if(cflags)
AddIpoptStrOption(nlp, "linear_solver", cflags);
AddIpoptNumOption(nlp,"mumps_pivtolmax",1e-5);


/* max iter */
cflags = (char*)omc_flagValue[FLAG_IPOPT_MAX_ITER];
Expand Down

0 comments on commit a7bb0f2

Please sign in to comment.