Baunsgaard commented on a change in pull request #1060:
URL: https://github.com/apache/systemds/pull/1060#discussion_r494840774



##########
File path: 
src/main/java/org/apache/sysds/runtime/privacy/finegrained/FineGrainedPrivacyList.java
##########
@@ -35,11 +35,61 @@
 
        private ArrayList<Map.Entry<DataRange, PrivacyLevel>> 
constraintCollection = new ArrayList<>();

Review comment:
       sounds reasonable, but maybe add a JIRA task to remember it later

##########
File path: 
src/main/java/org/apache/sysds/runtime/privacy/finegrained/FineGrainedPrivacyList.java
##########
@@ -35,11 +35,61 @@
 
        private ArrayList<Map.Entry<DataRange, PrivacyLevel>> 
constraintCollection = new ArrayList<>();
 
+       @Override
+       public PrivacyLevel[] getRowPrivacy(int numRows, int numCols) {
+               PrivacyLevel[] privacyLevels = new PrivacyLevel[numRows];
+               for (int i = 0; i < numRows; i++) {
+                       long[] beginRange1 = new long[] {i, 0};
+                       long[] endRange1 = new long[] {i, numCols};
+                       privacyLevels[i] = getStrictestPrivacyLevel(new 
DataRange(beginRange1, endRange1));
+               }
+               return privacyLevels;
+       }
+
+       @Override
+       public PrivacyLevel[] getColPrivacy(int numRows, int numCols) {
+               PrivacyLevel[] privacyLevels = new PrivacyLevel[numCols];
+               for (int i = 0; i < numCols; i++) {
+                       long[] beginRange = new long[] {0, i};
+                       long[] endRange = new long[] {numRows, i};
+                       privacyLevels[i] = getStrictestPrivacyLevel(new 
DataRange(beginRange, endRange));
+               }
+               return privacyLevels;
+       }
+
+       private PrivacyLevel getStrictestPrivacyLevel(DataRange searchRange){
+               PrivacyLevel strictestLevel = PrivacyLevel.None;
+               for ( Map.Entry<DataRange, PrivacyLevel> constraint : 
constraintCollection ) {

Review comment:
       same jira task as mentioned above

##########
File path: 
src/main/java/org/apache/sysds/runtime/privacy/finegrained/FineGrainedPrivacyMap.java
##########
@@ -40,6 +40,18 @@ public void put(DataRange dataRange, PrivacyLevel 
privacyLevel) {
                constraintCollection.put(dataRange, privacyLevel);
        }
 
+       @Override public void putRow(int rowIndex, int rowLength, PrivacyLevel 
privacyLevel) {

Review comment:
       if it is not used, delete it :+1: 

##########
File path: 
src/main/java/org/apache/sysds/runtime/privacy/propagation/OperatorType.java
##########
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sysds.runtime.privacy.propagation;
+
+public enum OperatorType {

Review comment:
       okay, i do the same in compression. It was just if they matched up 
completely, then they could be reused, and furthermore used as a TODO list, for 
what is not supported.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to