Skip to content

Commit

Permalink
Simplify for loop a bit (#2003)
Browse files Browse the repository at this point in the history
```diff
1c1
< CorrespondanceDesVariables.NumeroDeVariableVolume[0] = Var;
---
> CorrespondanceDesVariables.NumeroDeVariableVolume[Pdt] = Var;
6c6
<   = &(DonneesAnnuelles.Volume[0]);
---
>   = &(DonneesAnnuelles.Volume[Pdt]);
```
  • Loading branch information
flomnes authored Mar 21, 2024
1 parent a70badc commit 06fce45
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/solver/hydro/monthly/h2o_m_construire_les_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ void H2O_M_ConstruireLesVariables(DONNEES_ANNUELLES& DonneesAnnuelles)
const int NbPdt = DonneesAnnuelles.NombreDePasDeTemps;
int Var = 0;

CorrespondanceDesVariables.NumeroDeVariableVolume[0] = Var;
ProblemeLineairePartieVariable.Xmin[Var] = 0.0;
ProblemeLineairePartieVariable.Xmax[Var] = 1.0;
ProblemeLineairePartieFixe.TypeDeVariable[Var] = VARIABLE_BORNEE_DES_DEUX_COTES;
ProblemeLineairePartieVariable.AdresseOuPlacerLaValeurDesVariablesOptimisees[Var]
= &(DonneesAnnuelles.Volume[0]);
Var++;

for (int Pdt = 1; Pdt < NbPdt; Pdt++)
for (int Pdt = 0; Pdt < NbPdt; Pdt++)
{
CorrespondanceDesVariables.NumeroDeVariableVolume[Pdt] = Var;
ProblemeLineairePartieVariable.Xmin[Var] = 0.0;
Expand Down

0 comments on commit 06fce45

Please sign in to comment.