diff --git a/src/solver/hydro/daily2/h2o2_j_apply_costs.cpp b/src/solver/hydro/daily2/h2o2_j_apply_costs.cpp index 0789e4e880..4cb47e8867 100644 --- a/src/solver/hydro/daily2/h2o2_j_apply_costs.cpp +++ b/src/solver/hydro/daily2/h2o2_j_apply_costs.cpp @@ -31,10 +31,7 @@ void H2O2_J_apply_costs(const Hydro_problem_costs& h2o2_costs, DONNEES_MENSUELLES_ETENDUES& problem) { - int NombreDeProblemes; - int NbPdt; - - NombreDeProblemes = problem.ProblemeHydrauliqueEtendu->NombreDeProblemes; + int NombreDeProblemes = problem.ProblemeHydrauliqueEtendu->NombreDeProblemes; auto& ProblemeLineaireEtenduPartieFixe = problem.ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieFixe; auto& CorrespondanceDesVariables = problem.ProblemeHydrauliqueEtendu->CorrespondanceDesVariables; @@ -42,7 +39,7 @@ void H2O2_J_apply_costs(const Hydro_problem_costs& h2o2_costs, DONNEES_MENSUELLE for (int pb_num = 0; pb_num < NombreDeProblemes; pb_num++) { - NbPdt = NbJoursDUnProbleme[pb_num]; + int NbPdt = NbJoursDUnProbleme[pb_num]; for (int var = 0; var < ProblemeLineaireEtenduPartieFixe[pb_num].NombreDeVariables; var++) ProblemeLineaireEtenduPartieFixe[pb_num].CoutLineaire[var] = 0.0; diff --git a/src/solver/hydro/daily2/h2o2_j_construire_les_contraintes.cpp b/src/solver/hydro/daily2/h2o2_j_construire_les_contraintes.cpp index 4dc70b2fd5..57cdddd6af 100644 --- a/src/solver/hydro/daily2/h2o2_j_construire_les_contraintes.cpp +++ b/src/solver/hydro/daily2/h2o2_j_construire_les_contraintes.cpp @@ -37,12 +37,8 @@ void H2O2_J_ConstruireLesContraintes( std::vector& IndicesColonnes, CORRESPONDANCE_DES_VARIABLES_PB_ETENDU& CorrespondanceDesVariables) { - int NombreDeContraintes; - int il; - int Pdt; - - NombreDeContraintes = 0; - il = 0; + int NombreDeContraintes = 0; + int il = 0; IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -61,7 +57,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeContraintes++; - for (Pdt = 1; Pdt < NbPdt; Pdt++) + for (int Pdt = 1; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -88,7 +84,7 @@ void H2O2_J_ConstruireLesContraintes( IndicesDebutDeLigne[NombreDeContraintes] = il; - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CoefficientsDeLaMatriceDesContraintes[il] = 1.0; IndicesColonnes[il] = CorrespondanceDesVariables.NumeroVar_Turbine[Pdt]; @@ -103,7 +99,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeTermesDesLignes[NombreDeContraintes] = NbPdt + 1; NombreDeContraintes++; - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -120,7 +116,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeContraintes++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -137,7 +133,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeContraintes++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -154,7 +150,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeContraintes++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; @@ -171,7 +167,7 @@ void H2O2_J_ConstruireLesContraintes( NombreDeContraintes++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { IndicesDebutDeLigne[NombreDeContraintes] = il; diff --git a/src/solver/hydro/daily2/h2o2_j_construire_les_variables.cpp b/src/solver/hydro/daily2/h2o2_j_construire_les_variables.cpp index 9594d87ce9..6b86259e9a 100644 --- a/src/solver/hydro/daily2/h2o2_j_construire_les_variables.cpp +++ b/src/solver/hydro/daily2/h2o2_j_construire_les_variables.cpp @@ -47,12 +47,9 @@ void H2O2_j_ConstruireLesVariables( std::vector& AdresseOuPlacerLaValeurDesVariablesOptimisees, CORRESPONDANCE_DES_VARIABLES_PB_ETENDU& CorrespondanceDesVariables) { - int Var; - int Pdt; + int Var = 0; - Var = 0; - - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CorrespondanceDesVariables.NumeroVar_Turbine[Pdt] = Var; Xmin[Var] = 0.0; @@ -63,7 +60,7 @@ void H2O2_j_ConstruireLesVariables( Var++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CorrespondanceDesVariables.NumeroVar_niveauxFinJours[Pdt] = Var; Xmin[Var] = 0.0; @@ -81,7 +78,7 @@ void H2O2_j_ConstruireLesVariables( AdresseOuPlacerLaValeurDesVariablesOptimisees[Var] = &(DonneesMensuellesEtendues->waste); Var++; - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CorrespondanceDesVariables.NumeroVar_overflow[Pdt] = Var; Xmin[Var] = 0.0; @@ -92,7 +89,7 @@ void H2O2_j_ConstruireLesVariables( Var++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CorrespondanceDesVariables.NumeroVar_deviations[Pdt] = Var; Xmin[Var] = 0.0; @@ -103,7 +100,7 @@ void H2O2_j_ConstruireLesVariables( Var++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { CorrespondanceDesVariables.NumeroVar_violations[Pdt] = Var; Xmin[Var] = 0.0; diff --git a/src/solver/hydro/daily2/h2o2_j_free.cpp b/src/solver/hydro/daily2/h2o2_j_free.cpp index bdddb51953..8aa1d05afe 100644 --- a/src/solver/hydro/daily2/h2o2_j_free.cpp +++ b/src/solver/hydro/daily2/h2o2_j_free.cpp @@ -42,15 +42,10 @@ extern "C" void H2O2_J_Free(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles) { - int i; - int NombreDeProblemes; + PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; + int NombreDeProblemes = ProblemeHydrauliqueEtendu->NombreDeProblemes; - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; - - ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; - NombreDeProblemes = ProblemeHydrauliqueEtendu->NombreDeProblemes; - - for (i = 0; i < NombreDeProblemes; i++) + for (int i = 0; i < NombreDeProblemes; i++) { PROBLEME_SPX* ProbSpx = (PROBLEME_SPX*)ProblemeHydrauliqueEtendu->ProblemeSpx[i]; if (ProbSpx) diff --git a/src/solver/hydro/daily2/h2o2_j_initialiser_les_bornes_des_variables.cpp b/src/solver/hydro/daily2/h2o2_j_initialiser_les_bornes_des_variables.cpp index 9eec54016e..d0772ddf12 100644 --- a/src/solver/hydro/daily2/h2o2_j_initialiser_les_bornes_des_variables.cpp +++ b/src/solver/hydro/daily2/h2o2_j_initialiser_les_bornes_des_variables.cpp @@ -30,18 +30,12 @@ void H2O2_J_InitialiserLesBornesdesVariables(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles, int NumeroDeProbleme) { - int Pdt; - int NbPdt; - int Var; - const auto& TurbineMax = DonneesMensuelles->TurbineMax; const auto& TurbineMin = DonneesMensuelles->TurbineMin; - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; - - ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; + PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; - NbPdt = ProblemeHydrauliqueEtendu->NbJoursDUnProbleme[NumeroDeProbleme]; + int NbPdt = ProblemeHydrauliqueEtendu->NbJoursDUnProbleme[NumeroDeProbleme]; auto& CorrespondanceDesVariables = ProblemeHydrauliqueEtendu->CorrespondanceDesVariables[NumeroDeProbleme]; @@ -52,9 +46,9 @@ void H2O2_J_InitialiserLesBornesdesVariables(DONNEES_MENSUELLES_ETENDUES* Donnee auto& Xmax = ProblemeLineaireEtenduPartieVariable.Xmax; auto& Xmin = ProblemeLineaireEtenduPartieVariable.Xmin; - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { - Var = NumeroVar_Turbine[Pdt]; + int Var = NumeroVar_Turbine[Pdt]; Xmax[Var] = TurbineMax[Pdt]; Xmin[Var] = TurbineMin[Pdt]; } diff --git a/src/solver/hydro/daily2/h2o2_j_initialiser_les_second_membre.cpp b/src/solver/hydro/daily2/h2o2_j_initialiser_les_second_membre.cpp index d75ced316a..a31b185618 100644 --- a/src/solver/hydro/daily2/h2o2_j_initialiser_les_second_membre.cpp +++ b/src/solver/hydro/daily2/h2o2_j_initialiser_les_second_membre.cpp @@ -30,23 +30,19 @@ void H2O2_J_InitialiserLeSecondMembre(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles, int NumeroDeProbleme) { - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; + PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; - ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; auto& ProblemeLineairePartieVariable = ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieVariable[NumeroDeProbleme]; auto& SecondMembre = ProblemeLineairePartieVariable.SecondMembre; - int NbPdt, Pdt, Cnt; - - NbPdt = ProblemeHydrauliqueEtendu->NbJoursDUnProbleme[NumeroDeProbleme]; - - Cnt = 0; + int NbPdt = ProblemeHydrauliqueEtendu->NbJoursDUnProbleme[NumeroDeProbleme]; + int Cnt = 0; SecondMembre[Cnt] = DonneesMensuelles->NiveauInitialDuMois + DonneesMensuelles->apports[0]; Cnt++; - for (Pdt = 1; Pdt < NbPdt; Pdt++) + for (int Pdt = 1; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = DonneesMensuelles->apports[Pdt]; Cnt++; @@ -55,31 +51,31 @@ void H2O2_J_InitialiserLeSecondMembre(DONNEES_MENSUELLES_ETENDUES* DonneesMensue SecondMembre[Cnt] = DonneesMensuelles->TurbineDuMois; Cnt++; - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = DonneesMensuelles->TurbineCible[Pdt]; Cnt++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = DonneesMensuelles->TurbineCible[Pdt]; Cnt++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = 0.; Cnt++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = DonneesMensuelles->niveauBas[Pdt]; Cnt++; } - for (Pdt = 0; Pdt < NbPdt; Pdt++) + for (int Pdt = 0; Pdt < NbPdt; Pdt++) { SecondMembre[Cnt] = 0.; Cnt++; diff --git a/src/solver/hydro/daily2/h2o2_j_instanciation.cpp b/src/solver/hydro/daily2/h2o2_j_instanciation.cpp index 1e84c3a98d..39ca5497c1 100644 --- a/src/solver/hydro/daily2/h2o2_j_instanciation.cpp +++ b/src/solver/hydro/daily2/h2o2_j_instanciation.cpp @@ -30,22 +30,13 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() { - int i; - int NombreDeProblemes; - int NbPdt; - int j; - int NombreDeVariables; - int NombreDeContraintes; - int NombreDeTermesAlloues; DONNEES_MENSUELLES_ETENDUES* DonneesMensuellesEtendues = new DONNEES_MENSUELLES_ETENDUES; - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; - if (DonneesMensuellesEtendues == NULL) return (NULL); DonneesMensuellesEtendues->ProblemeHydrauliqueEtendu = new PROBLEME_HYDRAULIQUE_ETENDU; - ProblemeHydrauliqueEtendu = DonneesMensuellesEtendues->ProblemeHydrauliqueEtendu; + auto ProblemeHydrauliqueEtendu = DonneesMensuellesEtendues->ProblemeHydrauliqueEtendu; ProblemeHydrauliqueEtendu->NombreDeProblemes = 4; @@ -70,7 +61,7 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() DonneesMensuellesEtendues->deviations.assign(NbJoursDUnProbleme[3], 0.); DonneesMensuellesEtendues->violations.assign(NbJoursDUnProbleme[3], 0.); - NombreDeProblemes = ProblemeHydrauliqueEtendu->NombreDeProblemes; + int NombreDeProblemes = ProblemeHydrauliqueEtendu->NombreDeProblemes; ProblemeHydrauliqueEtendu->CorrespondanceDesVariables.resize(NombreDeProblemes); ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieFixe.resize(NombreDeProblemes); @@ -85,9 +76,9 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() auto& ProblemeLineaireEtenduPartieVariable = ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieVariable; - for (i = 0; i < NombreDeProblemes; i++) + for (int i = 0; i < NombreDeProblemes; i++) { - NbPdt = NbJoursDUnProbleme[i]; + int NbPdt = NbJoursDUnProbleme[i]; auto& CorrVar = CorrespondanceDesVariables[i]; @@ -99,7 +90,7 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() auto& PlFixe = ProblemeLineaireEtenduPartieFixe[i]; - NombreDeVariables = 0; + int NombreDeVariables = 0; NombreDeVariables += NbPdt; NombreDeVariables += NbPdt; @@ -116,7 +107,7 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() PlFixe.TypeDeVariable.assign(NombreDeVariables, 0); - NombreDeContraintes = 0; + int NombreDeContraintes = 0; NombreDeContraintes += NbPdt; NombreDeContraintes += 1; @@ -132,7 +123,7 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() PlFixe.IndicesDebutDeLigne.assign(NombreDeContraintes, 0.); PlFixe.NombreDeTermesDesLignes.assign(NombreDeContraintes, 0.); - NombreDeTermesAlloues = 0; + int NombreDeTermesAlloues = 0; NombreDeTermesAlloues += 3; NombreDeTermesAlloues += 4 * (NbPdt - 1); NombreDeTermesAlloues += 1; @@ -164,7 +155,7 @@ DONNEES_MENSUELLES_ETENDUES* H2O2_J_Instanciation() PlVariable.CoutsMarginauxDesContraintes.assign(NombreDeContraintes, 0.); } - for (i = 0; i < NombreDeProblemes; i++) + for (int i = 0; i < NombreDeProblemes; i++) { H2O2_j_ConstruireLesVariables( NbJoursDUnProbleme[i], diff --git a/src/solver/hydro/daily2/h2o2_j_optimiser_un_mois.cpp b/src/solver/hydro/daily2/h2o2_j_optimiser_un_mois.cpp index e41a0ff52f..62675613d4 100644 --- a/src/solver/hydro/daily2/h2o2_j_optimiser_un_mois.cpp +++ b/src/solver/hydro/daily2/h2o2_j_optimiser_un_mois.cpp @@ -30,9 +30,7 @@ void H2O2_J_OptimiserUnMois(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles) { - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; - - ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; + auto ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; int NumeroDeProbleme = -1; for (int i = 0; i < ProblemeHydrauliqueEtendu->NombreDeProblemes; i++) @@ -54,9 +52,7 @@ void H2O2_J_OptimiserUnMois(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles) DonneesMensuelles->ResultatsValides = NON; H2O2_J_InitialiserLeSecondMembre(DonneesMensuelles, NumeroDeProbleme); - H2O2_J_InitialiserLesBornesdesVariables(DonneesMensuelles, NumeroDeProbleme); - H2O2_J_ResoudreLeProblemeLineaire(DonneesMensuelles, NumeroDeProbleme); return; diff --git a/src/solver/hydro/daily2/h2o2_j_resoudre_le_probleme_lineaire.cpp b/src/solver/hydro/daily2/h2o2_j_resoudre_le_probleme_lineaire.cpp index 3160f5bff7..a5c85d2280 100644 --- a/src/solver/hydro/daily2/h2o2_j_resoudre_le_probleme_lineaire.cpp +++ b/src/solver/hydro/daily2/h2o2_j_resoudre_le_probleme_lineaire.cpp @@ -49,31 +49,19 @@ extern "C" void H2O2_J_ResoudreLeProblemeLineaire(DONNEES_MENSUELLES_ETENDUES* DonneesMensuelles, int NumeroDeProbleme) { - int Var; - double* pt; - char PremierPassage; - - PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu; - - PROBLEME_SIMPLEXE* Probleme; - PROBLEME_SPX* ProbSpx; - - PremierPassage = OUI; - - ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; + PROBLEME_HYDRAULIQUE_ETENDU* ProblemeHydrauliqueEtendu = DonneesMensuelles->ProblemeHydrauliqueEtendu; auto& ProblemeLineaireEtenduPartieVariable = ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieVariable[NumeroDeProbleme]; auto& ProblemeLineaireEtenduPartieFixe = ProblemeHydrauliqueEtendu->ProblemeLineaireEtenduPartieFixe[NumeroDeProbleme]; - ProbSpx = (PROBLEME_SPX*)ProblemeHydrauliqueEtendu->ProblemeSpx[NumeroDeProbleme]; - - Probleme = (PROBLEME_SIMPLEXE*)ProblemeHydrauliqueEtendu->Probleme; - if (Probleme == NULL) + PROBLEME_SPX* ProbSpx = (PROBLEME_SPX*)ProblemeHydrauliqueEtendu->ProblemeSpx[NumeroDeProbleme]; + PROBLEME_SIMPLEXE* Probleme = (PROBLEME_SIMPLEXE*)ProblemeHydrauliqueEtendu->Probleme; + if (!Probleme) { Probleme = (PROBLEME_SIMPLEXE*)malloc(sizeof(PROBLEME_SIMPLEXE)); - if (Probleme == NULL) + if (!Probleme) { DonneesMensuelles->ResultatsValides = EMERGENCY_SHUT_DOWN; return; @@ -81,9 +69,11 @@ void H2O2_J_ResoudreLeProblemeLineaire(DONNEES_MENSUELLES_ETENDUES* DonneesMensu ProblemeHydrauliqueEtendu->Probleme = (void*)Probleme; } + bool premierPassage = true; + RESOLUTION: - if (ProbSpx == NULL) + if (!ProbSpx) { Probleme->Contexte = SIMPLEXE_SEUL; Probleme->BaseDeDepartFournie = NON_SPX; @@ -139,7 +129,7 @@ void H2O2_J_ResoudreLeProblemeLineaire(DONNEES_MENSUELLES_ETENDUES* DonneesMensu Probleme->CoutsReduits = ProblemeLineaireEtenduPartieVariable.CoutsReduits.data(); #ifndef NDEBUG - if (PremierPassage == OUI) + if (premierPassage) Probleme->AffichageDesTraces = NON_SPX; else Probleme->AffichageDesTraces = OUI_SPX; @@ -151,22 +141,20 @@ void H2O2_J_ResoudreLeProblemeLineaire(DONNEES_MENSUELLES_ETENDUES* DonneesMensu ProbSpx = SPX_Simplexe(Probleme, ProbSpx); - if (ProbSpx != NULL) - { + if (ProbSpx) ProblemeHydrauliqueEtendu->ProblemeSpx[NumeroDeProbleme] = (void*)ProbSpx; - } ProblemeLineaireEtenduPartieVariable.ExistenceDUneSolution = Probleme->ExistenceDUneSolution; if (ProblemeLineaireEtenduPartieVariable.ExistenceDUneSolution != OUI_SPX - && PremierPassage == OUI && ProbSpx != NULL) + && premierPassage && ProbSpx) { if (ProblemeLineaireEtenduPartieVariable.ExistenceDUneSolution != SPX_ERREUR_INTERNE) { SPX_LibererProbleme(ProbSpx); ProbSpx = NULL; - PremierPassage = NON; + premierPassage = false; goto RESOLUTION; } else @@ -179,19 +167,17 @@ void H2O2_J_ResoudreLeProblemeLineaire(DONNEES_MENSUELLES_ETENDUES* DonneesMensu if (ProblemeLineaireEtenduPartieVariable.ExistenceDUneSolution == OUI_SPX) { DonneesMensuelles->CoutSolution = 0.0; - for (Var = 0; Var < Probleme->NombreDeVariables; Var++) + for (int Var = 0; Var < Probleme->NombreDeVariables; Var++) DonneesMensuelles->CoutSolution += Probleme->CoutLineaire[Var] * Probleme->X[Var]; DonneesMensuelles->ResultatsValides = OUI; - for (Var = 0; Var < ProblemeLineaireEtenduPartieFixe.NombreDeVariables; Var++) + for (int Var = 0; Var < ProblemeLineaireEtenduPartieFixe.NombreDeVariables; Var++) { - pt = ProblemeLineaireEtenduPartieVariable + double* pt = ProblemeLineaireEtenduPartieVariable .AdresseOuPlacerLaValeurDesVariablesOptimisees[Var]; - if (pt != NULL) - { + if (pt) *pt = ProblemeLineaireEtenduPartieVariable.X[Var]; - } } } else