Package cern.colt.map

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


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

        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

    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

                    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

TOP

Related Classes of cern.colt.map.OpenIntIntHashMap

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.