From 44d3754905aa755229a29e3404c9b8fe8aa64eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Mon, 9 Sep 2019 12:21:21 +0000 Subject: [PATCH] add abs for PIVector2D git-svn-id: svn://db.shs.com.ru/pip@853 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/math/pimathcomplex.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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