Skip to content

Commit

Permalink
improve code for optimization based on (updated )static analysis, tha…
Browse files Browse the repository at this point in the history
…nks Martin

 


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19820 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Mar 27, 2014
1 parent 3af86b8 commit eccb8eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions SimulationRuntime/c/optimization/constraints/evalfG.c
Expand Up @@ -277,12 +277,12 @@ int diff_symColoredODE(double *v, double t, IPOPT_DATA_ *iData, double **J)
{
DATA * data = iData->data;
const int index = 2;
double*x,*u;
/* double*x,*u;*/

int i,j,l,ii,nx;
int *cC,*lindex;

x = v;
/*x = v;*/
/*u = x + iData->nx;*/

nx = data->simulationInfo.analyticJacobians[index].sizeCols;
Expand Down Expand Up @@ -417,7 +417,6 @@ static int printMaxError(IPOPT_DATA_ *iData, double *g,double t, double * max_er
double tmp;
int j;

tmp = -1;
for(j = 0; j<(int)iData->nx; ++j){
tmp = fabs(g[j]);
//printf("\n time %g vs. %g | %g vs. %g",t,*tt,tmp,*max_err);
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/optimization/goal/evalF.c
Expand Up @@ -268,7 +268,7 @@ int num_diff_symColoredObject(IPOPT_DATA_ *iData, double *dF, int this_it)
{
DATA * data = iData->data;
const int index = 2;
double*x/*,*u*/;
/*double*x,*u*/;
SIMULATION_DATA *sData = (SIMULATION_DATA*)iData->data->localData[0];
int i,j,l,ii,nx,k;
/*int *cC,*lindex;*/
Expand All @@ -277,7 +277,7 @@ int num_diff_symColoredObject(IPOPT_DATA_ *iData, double *dF, int this_it)
double t = (double)sData->timeValue;

v = iData->cv;
x = v;
/*x = v;*/
/*u = x + iData->nx;*/

nx = data->simulationInfo.analyticJacobians[index].sizeCols;
Expand Down

0 comments on commit eccb8eb

Please sign in to comment.