From 3649aa3bd0ea7e7b5c620484aeb567892c1d0e91 Mon Sep 17 00:00:00 2001 From: Alberto Villena Guerras Date: Thu, 26 Sep 2013 16:19:48 +0200 Subject: [PATCH 1/3] Script implementing the dot_product --- dot_product.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 dot_product.js diff --git a/dot_product.js b/dot_product.js new file mode 100644 index 0000000..d4b0939 --- /dev/null +++ b/dot_product.js @@ -0,0 +1,12 @@ +var f = function (a1, a2) { + var i=0; + var result = 0; + if (a1.length !== a2.length) { + console.log("Input error - Vectors must be of the same length"); + return; + } + for (i; i Date: Thu, 26 Sep 2013 16:33:01 +0200 Subject: [PATCH 2/3] Adding dot_product feature --- scripts/dot_product.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/dot_product.js diff --git a/scripts/dot_product.js b/scripts/dot_product.js new file mode 100644 index 0000000..d4b0939 --- /dev/null +++ b/scripts/dot_product.js @@ -0,0 +1,12 @@ +var f = function (a1, a2) { + var i=0; + var result = 0; + if (a1.length !== a2.length) { + console.log("Input error - Vectors must be of the same length"); + return; + } + for (i; i Date: Thu, 26 Sep 2013 16:41:57 +0200 Subject: [PATCH 3/3] Deleted extra script out of scripts directory --- dot_product.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 dot_product.js diff --git a/dot_product.js b/dot_product.js deleted file mode 100644 index d4b0939..0000000 --- a/dot_product.js +++ /dev/null @@ -1,12 +0,0 @@ -var f = function (a1, a2) { - var i=0; - var result = 0; - if (a1.length !== a2.length) { - console.log("Input error - Vectors must be of the same length"); - return; - } - for (i; i