Skip to content

Commit

Permalink
fix(pzvec_extras): complex norm had a compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandini committed Jun 4, 2024
1 parent cc75e1e commit 957e69c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Util/pzvec_extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@ RType(T) Norm(const TPZVec< T > &one) {
RType(T) res = 0.;
int size = one.NElements();
if constexpr (is_complex<T>::value){
T cres{0};
for (int i = 0; i < size; i++) {
res += (RType(T)) one[i] * std::conj(one[i]);
cres += one[i] * std::conj(one[i]);
}
res = cres.real();
}else{
for (int i = 0; i < size; i++) {
res += one[i]*one[i];
Expand Down

0 comments on commit 957e69c

Please sign in to comment.