From f083566ece0159312b375b91d6d48a73bbdcec25 Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Tue, 22 Oct 2024 01:54:41 +0200 Subject: [PATCH] should be --- .../runtime/frame/data/columns/Array.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java index 8f653ddad13..4fd72742029 100644 --- a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java +++ b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Objects; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -936,12 +937,19 @@ public double[] minMax(int l, int u) { public void setM(Map map, AMapToData m, int i){ m.set(i, map.get(get(i)).intValue() - 1); } - + public void setM(Map map, int si, AMapToData m, int i) { - final T v = get(i); - if(v != null) - m.set(i, map.get(v).intValue() - 1); - else - m.set(i, si); + try{ + + final T v = get(i); + if(v != null) + m.set(i, map.get(v).intValue() - 1); + else + m.set(i, si); + } + catch(Exception e) { + String error = "expected: " + get(i) + " to be in map: " + map; + throw new RuntimeException(error, e); + } } }