diff --git a/src_main/math/pimathcomplex.h b/src_main/math/pimathcomplex.h index b615797a..254c25b2 100644 --- a/src_main/math/pimathcomplex.h +++ b/src_main/math/pimathcomplex.h @@ -107,4 +107,13 @@ inline PIVector abs(const PIVector & v) { return result; } + +inline PIVector2D abs(const PIVector2D & v) { + PIVector2D result(v.rows(), v.cols()); + for (uint i = 0; i < v.rows(); i++) + for (uint j = 0; j < v.cols(); j++) + result[i][j] = abs(v.element(i,j)); + return result; +} + #endif // PIMATHCOMPLEX_H