summaryrefslogtreecommitdiff
path: root/lib/vector.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-26 01:17:53 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-26 01:17:53 -0400
commit94f7d887981f0626f166f5645fa98115d4f9a478 (patch)
treeb5653f58f288a9619dc82d3ac5867dfd5c89ad45 /lib/vector.h
parentd3b3e39a525d0c3aa9663f824ba96e0c429a8313 (diff)
downloadc++-94f7d887981f0626f166f5645fa98115d4f9a478.tar.gz
c++-94f7d887981f0626f166f5645fa98115d4f9a478.tar.bz2
c++-94f7d887981f0626f166f5645fa98115d4f9a478.zip
everything compiles now, and fixed a major bug in the graph code
Diffstat (limited to 'lib/vector.h')
-rw-r--r--lib/vector.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vector.h b/lib/vector.h
index d5ced03..beee1a7 100644
--- a/lib/vector.h
+++ b/lib/vector.h
@@ -81,10 +81,10 @@ class vector_t : public std::array<T, q> {
};
-template<q_t q>
-double norm_squared(vector_t<q, double> v) {
+template<q_t q, class T>
+double norm_squared(vector_t<q, T> v) {
double tmp = 0;
- for (double &x : v) {
+ for (T &x : v) {
tmp += pow(x, 2);
}