Package com.google.uzaygezen.core

Examples of com.google.uzaygezen.core.MultiDimensionalSpec


     * We choose not to store the coordinates themselves, since storing the
     * Hilbert index is sufficient to recover the coordinate values. So let's
     * use a dummy column.
     */
    final byte[][] qualifiers = {"NICE".getBytes(Charsets.ISO_8859_1),};
    MultiDimensionalSpec spec = new MultiDimensionalSpec(Ints.asList(30, 10, 25));
    // Add some data.
    Random rnd = new Random(TestUtils.SEED);
    int[][] data = generateData(spec, 1 << 16, rnd);
    SpaceFillingCurve sfc = new CompactHilbertCurve(spec);
    logger.log(Level.INFO, "Populating table with up to {0} rows.", data.length);
    populateTable(family, qualifiers, spec, data, sfc, table);
    int cacheSize = 1 << 8;
    logger.log(Level.INFO, "Building cache of size {0}.", cacheSize);
    // The cache is optional.
    Map<Pow2LengthBitSetRange, NodeValue<BigIntegerContent>> rolledupMap = createRolledupCache(
      table, spec, sfc, cacheSize);
    logger.log(Level.INFO, "Constructed cache of actual size {0}.", rolledupMap.size());
    for (int trial = 0; trial < 1; ++trial) {
      logger.log(Level.INFO, "trial={0}", trial);
      int[] maxLengthPerDimension = new int[spec.getBitsPerDimension().size()];
      for (boolean useCache : new boolean[] {false, true}) {
        int m = useCache ? 256 : 32;
        /*
         * For testing purposes limit the range size to m values for each
         * dimension to speed up query computation. In practice, query volume
View Full Code Here


    Map<Pow2LengthBitSetRange, NodeValue<BigIntegerContent>> rolledupMap = factory.apply(rolledupTree);
    return rolledupMap;
  }

  public List<int[]> fullScanQuery(int[][] data, SpaceFillingCurve sfc, int[][] ranges) {
    MultiDimensionalSpec spec = sfc.getSpec();
    List<Integer> filtered = filter(data, ranges);
    List<Pair<BitVector, Integer>> pairs = new ArrayList<>(filtered.size());
    BitVector[] point = new BitVector[spec.getBitsPerDimension().size()];
    for (int j = 0; j < spec.getBitsPerDimension().size(); ++j) {
      point[j] = BitVectorFactories.OPTIMAL.apply(spec.getBitsPerDimension().get(j));
    }
    for (int i : filtered) {
      BitVector index = BitVectorFactories.OPTIMAL.apply(spec.sumBitsPerDimension());
      // int has 32 bits, which fits in each dimensions.
      for (int j = 0; j < spec.getBitsPerDimension().size(); ++j) {
        point[j].copyFrom(data[i][j]);
      }
      sfc.index(point, 0, index);
      pairs.add(Pair.of(index.clone(), i));
    }
View Full Code Here

      bitsPerDimension.add(bitsOfPrecision);
      totalPrecision += bitsOfPrecision;
    }

    final CompactHilbertCurve compactHilbertCurve = new CompactHilbertCurve(
        new MultiDimensionalSpec(
            bitsPerDimension));
    final PrimitiveHilbertSFCOperations testOperations = new PrimitiveHilbertSFCOperations();

    // assume the unbounded SFC is the true results, regardless they should
    // both produce the same results
View Full Code Here

      bitsPerDimension.add(bitsOfPrecision);
    }

    final CompactHilbertCurve compactHilbertCurve = new CompactHilbertCurve(
        new MultiDimensionalSpec(
            bitsPerDimension));
    final PrimitiveHilbertSFCOperations testOperations = new PrimitiveHilbertSFCOperations();

    // assume the unbounded SFC is the true results, regardless they should
    // both produce the same results
View Full Code Here

      bitsPerDimension.add(dimension.getBitsOfPrecision());
      totalPrecision += dimension.getBitsOfPrecision();
    }

    compactHilbertCurve = new CompactHilbertCurve(
        new MultiDimensionalSpec(
            bitsPerDimension));

    dimensionDefinitions = dimensionDefs;
    setOptimalOperations(
        totalPrecision,
View Full Code Here

TOP

Related Classes of com.google.uzaygezen.core.MultiDimensionalSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.