From 4cef74d116731c9d6b88cfe82e3c5e29e1540090 Mon Sep 17 00:00:00 2001 From: Andrew Lawson Date: Mon, 1 Dec 2014 13:38:12 -0500 Subject: [PATCH] Removed memoization of ordinary sums - results unused. --- README.md | 4 +++- geometric_separators.pde | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2102fe1..aa173bf 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,6 @@ geometric_separators Geometric separators project for CSE 4095 (Computational Geometry). -Click anywhere to create a circle. The left button will reset the workspace / input. The right button does nothing... for now :) +###About: + + diff --git a/geometric_separators.pde b/geometric_separators.pde index add7705..fa0526c 100644 --- a/geometric_separators.pde +++ b/geometric_separators.pde @@ -227,7 +227,6 @@ ReturnTriple calcLastSum(int i, PVector currentPoint, PVector nextPoint, ArrayLi // Get sums and sums of squares of distances for an input HashMap getSums(ArrayList input, boolean isY) { // Memoization hash tables - HashMap sumMemoize = new HashMap(); HashMap sumSquaresMemoize = new HashMap(); ReturnTriple returnTriple = new ReturnTriple(0, 0, null); PVector currentPoint, nextPoint; @@ -235,10 +234,6 @@ HashMap getSums(ArrayList input, boolean isY) { for (int i = 0; i < input.size() - 1; i++) { currentPoint = input.get(i); nextPoint = input.get(i + 1); - // Calculate sum - returnTriple = calcLastSum(i, currentPoint, nextPoint, input, sumMemoize, isY); - sumMemoize = returnTriple.memoize; - sumMemoize.put(nextPoint, returnTriple.sum + (i * returnTriple.dist)); // Calculate sum of squares returnTriple = calcLastSum(i, currentPoint, nextPoint, input, sumSquaresMemoize, isY); sumSquaresMemoize = returnTriple.memoize;