Skip to content
Snippets Groups Projects
  • Elias Pipping's avatar
    9a1b9ee4
    Merge branch 'feature/box-constraints-as-intervals' into 'master' · 9a1b9ee4
    Elias Pipping authored
    Expose box constraints as intervals
    
    As the changes to obstacletnnmgstep.hh illustrate, this allows us to replace code like
    
    ```c++
    {
        if (coarseCorrection_[i][j] < defectConstraint.lower(j))
            coarseCorrection_[i][j] = defectConstraint.lower(j);
        if (coarseCorrection_[i][j] > defectConstraint.upper(j))
            coarseCorrection_[i][j] = defectConstraint.upper(j);
    }
    ```
    with
    ```c++
        coarseCorrection_[i][j]
            = defectConstraint[j].projectIn(coarseCorrection_[i][j]);
    ```
    which is no less efficient yes far easier to read.
    
    I have no removed any functionality. The set of features that a `BoxConstraint` currently comes with is quite odd, though. It ha an `operator-=` but no `operator+=` e.g.
    
    See merge request !6
    9a1b9ee4
    History
    Merge branch 'feature/box-constraints-as-intervals' into 'master'
    Elias Pipping authored
    Expose box constraints as intervals
    
    As the changes to obstacletnnmgstep.hh illustrate, this allows us to replace code like
    
    ```c++
    {
        if (coarseCorrection_[i][j] < defectConstraint.lower(j))
            coarseCorrection_[i][j] = defectConstraint.lower(j);
        if (coarseCorrection_[i][j] > defectConstraint.upper(j))
            coarseCorrection_[i][j] = defectConstraint.upper(j);
    }
    ```
    with
    ```c++
        coarseCorrection_[i][j]
            = defectConstraint[j].projectIn(coarseCorrection_[i][j]);
    ```
    which is no less efficient yes far easier to read.
    
    I have no removed any functionality. The set of features that a `BoxConstraint` currently comes with is quite odd, though. It ha an `operator-=` but no `operator+=` e.g.
    
    See merge request !6
Code owners
Assign users and groups as approvers for specific file changes. Learn more.