Skip to content

Commit

Permalink
[MathLib] Added a comment to PETSC::VecPointwiseDivide, which is call…
Browse files Browse the repository at this point in the history
…ed by

componentwiseDivide
  • Loading branch information
wenqing committed Jan 9, 2024
1 parent da24d16 commit 2d6b4db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MathLib/LinAlg/LinAlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ void axpby(PETScVector& y, PetscScalar const a, PetscScalar const b,

// Explicit specialization
// Computes w = x/y componentwise.
// \note that VecPointwiseDivide avoids to divide by values that are
// identically zero such as
// for (int i=0; i<n; i++)
// {
// w[i] = y[i] == 0.0 ? 0.0 : x[i] / y[i];
// }
//
template <>
void componentwiseDivide(PETScVector& w, PETScVector const& x,
PETScVector const& y)
Expand Down

0 comments on commit 2d6b4db

Please sign in to comment.