Examples of OpenIntIntHashMap


Examples of cern.colt.map.OpenIntIntHashMap

          }
        }
        break;
      case "testInt_ColtPrimitiveHashMap":
        int_colt_primitive_map =
          new OpenIntIntHashMap( Constants.INTS.length );
        if ( fill_maps ) {
          for( int i : Constants.INTS ) {
            int_colt_primitive_map.put( i, i );
          }
        }
View Full Code Here

Examples of cern.colt.map.OpenIntIntHashMap

    private int elementsHash;
   
    public SimplePermutation()
    {
        permutation = new IntArrayList();
        permutationHash = new OpenIntIntHashMap();
        positionHash = new OpenIntIntHashMap();
        elementsHashDirty = true;
    }
View Full Code Here

Examples of cern.colt.map.OpenIntIntHashMap

        BufferedReader reader = new BufferedReader(new InputStreamReader(input, "ascii"));
       
        readMetadata(reader);
       
        // internal var name -> original var name
        OpenIntIntHashMap internalToOriginalMap = new OpenIntIntHashMap();
        // original var name -> internal var name
        OpenIntIntHashMap sourceIndices = new OpenIntIntHashMap();
        IntArrayList sourceValues = readSourceValues(reader, sourceIndices);
       
        for (int originalVarName : sourceIndices.keys().elements())
        {
            internalToOriginalMap.put(sourceIndices.get(originalVarName), originalVarName);
        }
       
        IntArrayList values = new IntArrayList();

        for (int i = 0; i < sourceValues.size(); i++)
        {
            int sourceVar = sourceValues.get(i);
            if (sourceVar != 0)
            {
                int sign = sourceVar > 0 ? 1 : -1;
                int var = sign * sourceIndices.get(Math.abs(sourceVar));
                values.add(var);
            }
            else
            {
                if(!values.isEmpty())
View Full Code Here

Examples of cern.colt.map.OpenIntIntHashMap

    private IntArrayList readSourceValues(BufferedReader reader, OpenIntIntHashMap sourceIndices)
            throws IOException
    {
        IntArrayList sourceValues = new IntArrayList();
        OpenIntIntHashMap originalVarNames = new OpenIntIntHashMap();
       
        int sign = 1;
        int r = 0;
        int ch;
        while ((ch = reader.read()) != -1)
        {
            if (Character.isWhitespace(ch))
            {
                if (r != 0)
                {
                    originalVarNames.put(r, r);
                    r = r * sign;
                    sourceValues.add(r);
                   
                    r = 0;
                    sign = 1;
                }
                continue;
            }
            if (ch == '0' && r == 0)
            {
                sourceValues.add(0);
                continue;
            }
            if (ch == '-')
            {
                sign = -1;
            }

            if ('0' <= ch && ch < '0' + 10)
            {
                r = r * 10 + ch - '0';
            }
        }
       
        IntArrayList sortedVarNames = originalVarNames.keys();
        sortedVarNames.sort();
        for (int i = 0; i < sortedVarNames.size(); i++)
        {
            sourceIndices.put(sortedVarNames.get(i), i + 1);
        }
View Full Code Here

Examples of cern.colt.map.OpenIntIntHashMap

                    formula.unionOrAdd(tier);
                }
            }
        }
       
        OpenIntIntHashMap varMappings = new OpenIntIntHashMap();
       
        for (int i = 1; i <= formula.getVarCount(); i++)
        {
            varMappings.put(i, i);
        }
       
        formula.setVarMappings(varMappings);
       
        return formula;
View Full Code Here

Examples of org.apache.mahout.math.map.OpenIntIntHashMap

   
    for (int i = 0; i < tree.getHeaderTableCount(); i++) {
      int currentAttribute = tree.getAttributeAtIndex(i);
      int nextNode = tree.getHeaderNext(currentAttribute);
     
      OpenIntIntHashMap prevNode = new OpenIntIntHashMap();
      int justPrevNode = -1;
      while (nextNode != -1) {
       
        int parent = tree.parent(nextNode);
       
        if (prevNode.containsKey(parent) == false) {
          prevNode.put(parent, nextNode);
        } else {
          int prevNodeId = prevNode.get(parent);
          if (1 >= tree.childCount(prevNodeId)
              && 1 >= tree.childCount(nextNode)) {
            tree.addCount(prevNodeId, tree.count(nextNode));
            if (tree.childCount(nextNode) == 1) {
              tree.addChild(prevNodeId, tree.childAtIndex(nextNode, 0));
View Full Code Here

Examples of org.apache.mahout.math.map.OpenIntIntHashMap

  }

  private void initCaches() {
    this.caches = new OpenIntIntHashMap[getProbes()];
    for (int ii = 0; ii < getProbes(); ii++) {
      caches[ii] = new OpenIntIntHashMap();
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.map.OpenIntIntHashMap

  }

  private void initCaches() {
    this.caches = new OpenIntIntHashMap[getProbes()];
    for (int ii = 0; ii < getProbes(); ii++) {
      caches[ii] = new OpenIntIntHashMap();
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.map.OpenIntIntHashMap

    protected void setup(Context ctx) throws IOException, InterruptedException {
      Configuration conf = ctx.getConfiguration();
      numVertices = Integer.parseInt(conf.get(NUM_VERTICES_PARAM));
      symmetric = conf.getBoolean(SYMMETRIC_PARAM, false);
      Path vertexIndexPath = new Path(conf.get(VERTEX_INDEX_PARAM));
      vertexIDsToIndex = new OpenIntIntHashMap(numVertices);
      for (Pair<IntWritable,IntWritable> indexAndVertexID :
          new SequenceFileIterable<IntWritable,IntWritable>(vertexIndexPath, true, conf)) {
        vertexIDsToIndex.put(indexAndVertexID.getSecond().get(), indexAndVertexID.getFirst().get());
      }
    }
View Full Code Here

Examples of org.apache.mahout.math.map.OpenIntIntHashMap

    for (int i = 0; i < tree.getHeaderTableCount(); i++) {
      int currentAttribute = tree.getAttributeAtIndex(i);
      int nextNode = tree.getHeaderNext(currentAttribute);

      OpenIntIntHashMap prevNode = new OpenIntIntHashMap();
      int justPrevNode = -1;
      while (nextNode != -1) {

        int parent = tree.parent(nextNode);

        if (!prevNode.containsKey(parent)) {
          prevNode.put(parent, nextNode);
        } else {
          int prevNodeId = prevNode.get(parent);
          if (tree.childCount(prevNodeId) <= 1 && tree.childCount(nextNode) <= 1) {
            tree.addCount(prevNodeId, tree.count(nextNode));
            if (tree.childCount(nextNode) == 1) {
              tree.addChild(prevNodeId, tree.childAtIndex(nextNode, 0));
              tree.setParent(tree.childAtIndex(nextNode, 0), prevNodeId);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.