Skip to content

Commit

Permalink
- attempt to fix testsuite on Windows and Linux CLANG
Browse files Browse the repository at this point in the history
SimulationRuntime/c/simulation/solver/initialization_data.c
- fix the wrong call to leastSquareWithLambda
- include initialization.h for definition of leastSquareWithLambda
- include <math.h> for fabs.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11968 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jun 1, 2012
1 parent 55104a4 commit f2a8133
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SimulationRuntime/c/simulation/solver/initialization_data.c
Expand Up @@ -32,6 +32,8 @@
*/

#include "initialization_data.h"
#include "initialization.h" /* adrpo: for leastSquareWithLambda */
#include <math.h>

/*! \fn initializeInitData
*
Expand Down Expand Up @@ -261,7 +263,7 @@ void computeInitialResidualScalingCoefficients(DATA *data, INIT_DATA *initData)
initData->startValueResidualScalingCoefficients[i] = 1.0;

/* lambda = 1.0 */
leastSquareWithLambda(data, initData, NULL, 1.0);
leastSquareWithLambda(data, initData, 1.0);
for(i=0; i<initData->nInitResiduals; ++i)
tmpResidual1[i] = initData->initialResiduals[i];

Expand All @@ -280,7 +282,7 @@ void computeInitialResidualScalingCoefficients(DATA *data, INIT_DATA *initData)
initData->z[i] += h;
updateZScaled(initData);

leastSquareWithLambda(data, initData, NULL, 1.0);
leastSquareWithLambda(data, initData, 1.0);
for(j=0; j<initData->nInitResiduals; ++j)
tmpResidual2[j] = initData->initialResiduals[j];

Expand Down

0 comments on commit f2a8133

Please sign in to comment.