Package cern.colt.map

Examples of cern.colt.map.OpenLongObjectHashMap


    public SimpleFormula()
    {
        permutation = new SimplePermutation();
        tiers = new ObjectArrayList();
        tiersHash1 = new OpenIntObjectHashMap();
        tiersHash2 = new OpenLongObjectHashMap();
        tiersHash3 = new OpenLongObjectHashMap();
    }
View Full Code Here


   
    public SimpleFormula(IPermutation permutation)
    {
        this.permutation = permutation;
        tiers = new ObjectArrayList();
        tiersHash3 = new OpenLongObjectHashMap();
    }
View Full Code Here

        this.permutation = formula.permutation;
        int tiersCount = formula.tiers.size();
       
        this.tiers = new ObjectArrayList(tiersCount);
        this.tiersHash3 = fillTiersHash3
                        ? new OpenLongObjectHashMap(tiersCount)
                        : null;
                       
        Object[] tiersElements = formula.tiers.elements();
        for (int i = 0; i < tiersCount; i++)
        {
View Full Code Here

  private volatile long version = Long.MIN_VALUE;

  public ColtHashSet(
    int initialCapacity, double minLoadFactor, double maxLoadFactor
  ) {
    map = new OpenLongObjectHashMap(
      initialCapacity, minLoadFactor, maxLoadFactor
    );
  }
View Full Code Here

      initialCapacity, minLoadFactor, maxLoadFactor
    );
  }

  public ColtHashSet(int initialCapacity) {
    map = new OpenLongObjectHashMap(initialCapacity);
  }
View Full Code Here

  ColtLongHashSet(OpenLongObjectHashMap map) {
    this.map = map;
  }

  public ColtLongHashSet(int initialCapacity) {
    this.map = new OpenLongObjectHashMap(initialCapacity);
  }
View Full Code Here

    }
  }

  @Override
  public SnapshotableSet<Long> makeSnapshot() {
    OpenLongObjectHashMap mapCopy = (OpenLongObjectHashMap) map.clone();
    ColtLongHashSet thisCopy = new ColtLongHashSet(mapCopy);

    return thisCopy;
  }
View Full Code Here

      return new ColtIntegerHashSet(
        new OpenIntObjectHashMap(initialValue, minLoadFactor, maxLoadFactor)
      );
    } else if (numberType == NumberType.LONG) {
      return new ColtLongHashSet(
        new OpenLongObjectHashMap(initialValue, minLoadFactor, maxLoadFactor)
      );
    } else {
      throw new IllegalStateException(String.format("unknown type %s", numberType));
    }
  }
View Full Code Here

        time = System.currentTimeMillis() - time;
        return time;
    }

    private static long testByte() {
        AbstractLongObjectMap tx = new OpenLongObjectHashMap(NUM);
        for (int i = 0; i < NUM; i++) {
            tx.put(i, new ConcurrentSkipListSet<ByteEntry>());
        }
        for (int i = 0; i < NUM; i++) {
            for (int j = 0; j < NUM; j++) {
                if (i == j) continue;
                if (Math.random() < FRACTION) {
                    ByteBuffer key = ByteBuffer.allocate(16);
                    key.putLong(5).putLong(j).flip();
                    ByteBuffer value = ByteBuffer.allocate(4);
                    value.putInt(random.nextInt(ROUNDSIZE)).flip();
                    ((ConcurrentSkipListSet<ByteEntry>) tx.get(i)).add(new ByteEntry(key, value));
                }
            }
        }
        long time = System.currentTimeMillis();
        long sum = 0;
View Full Code Here

        System.out.println(Runtime.getRuntime().freeMemory() / 1024);
        long memBefore = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
        System.out.println(memBefore / 1024);
        size = 10000000;
        final int modulo = 7;
        final AbstractLongObjectMap map = new OpenLongObjectHashMap(size);
        for (int i = 1; i <= size; i++) {
            map.put(size, "O" + i);
        }
        time = System.currentTimeMillis();
        map.forEachPair(new LongObjectProcedure() {
            @Override
            public boolean apply(long l, Object o) {
                if (l % modulo == 0) {
                    map.put(l, "T" + l);
                }
                return true;
            }
        });
        System.out.println("Time: " + (System.currentTimeMillis() - time));
View Full Code Here

TOP

Related Classes of cern.colt.map.OpenLongObjectHashMap

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.