leerho commented on a change in pull request #369: URL: https://github.com/apache/datasketches-java/pull/369#discussion_r741554232
########## File path: src/test/java/org/apache/datasketches/theta/CornerCaseThetaSetOperationsTest.java ########## @@ -0,0 +1,558 @@ +/* + * 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.datasketches.theta; + +import org.testng.annotations.Test; + +public class CornerCaseThetaSetOperationsTest { + + /* Hash Values + * 9223372036854775807 Theta = 1.0 + * + * 6730918654704304314 hash(3L)[0] >>> 1 GT_MIDP + * 4611686018427387904 Theta for p = 0.5f = MIDP + * 2206043092153046979 hash(2L)[0] >>> 1 LT_MIDP_V + * 1498732507761423037 hash(5L)[0] >>> 1 LTLT_MIDP_V + * + * 1206007004353599230 hash(6L)[0] >>> 1 GT_LOWP_V + * 922337217429372928 Theta for p = 0.1f = LOWP + * 593872385995628096 hash(4L)[0] >>> 1 LT_LOWP_V + * 405753591161026837 hash(1L)[0] >>> 1 LTLT_LOWP_V + */ + + private static final long GT_MIDP_V = 3L; + private static final float MIDP = 0.5f; + private static final long LT_MIDP_V = 2L; + + private static final long GT_LOWP_V = 6L; + private static final float LOWP = 0.1f; + private static final long LT_LOWP_V = 4L; + + private static final double MIDP_THETA = MIDP; + private static final double LOWP_THETA = LOWP; + + private enum SkType { + NEW, //{ 1.0, 0, T} Bin: 101 Oct: 05 + EXACT, //{ 1.0, >0, F} Bin: 111 Oct: 07, specify only value + ESTIMATION, //{<1.0, >0, F} Bin: 010 Oct: 02, specify only value + NEW_DEGEN, //{<1.0, 0, T} Bin: 001 Oct: 01, specify only p + RESULT_DEGEN //{<1.0, 0, F} Bin: 000 Oct: 0, specify p, value + } Review comment: Oops the line number is 53 (not 63). But my comment still stands. -- 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. To unsubscribe, e-mail: commits-unsubscr...@datasketches.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@datasketches.apache.org For additional commands, e-mail: commits-h...@datasketches.apache.org