Added pow.

This commit is contained in:
James Goppert
2016-02-26 03:39:04 -05:00
parent 95e3d7d6ce
commit 15865897d5
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -7,6 +7,9 @@
*/
#pragma once
#include <cmath>
#include "math.hpp"
namespace matrix
@@ -67,6 +70,14 @@ public:
(*this) /= norm();
}
Vector pow(Type v) const {
const Vector &a(*this);
Vector r;
for (size_t i = 0; i<M; i++) {
r(i) = Type(::pow(a(i), v));
}
return r;
}
};
} // namespace matrix