Package gnu.trove

Examples of gnu.trove.TObjectIntHashMap


   * Creates an empty assignment.
   */
  public Assignment ()
  {
    super (new HashVarSet ());
    var2idx = new TObjectIntHashMap ();
    values = new ArrayList();
  }
View Full Code Here


  /**
   * Creates an assignemnt for the given variables.
   */
  public Assignment (Variable[] vars, int[] outcomes)
  {
    var2idx = new TObjectIntHashMap (vars.length);
    values = new ArrayList ();
    addRow (vars, outcomes);
  }
View Full Code Here

  /**
   * Creates an assignemnt for the given variables.
   */
  public Assignment (Variable[] vars, double[] outcomes)
  {
    var2idx = new TObjectIntHashMap (vars.length);
    values = new ArrayList ();
    addRow (vars, outcomes);
  }
View Full Code Here

  /**
   * Creates an assignemnt for the given variables.
   */
  public Assignment (List vars, int[] outcomes)
  {
    var2idx = new TObjectIntHashMap (vars.size ());
    values = new ArrayList ();
    addRow ((Variable[]) vars.toArray (new Variable[0]), outcomes);
  }
View Full Code Here

   * The assignment will assign outcomes[i] to the variable
   * <tt>mdl.get(i)</tt>
   */
  public Assignment (FactorGraph mdl, int[] outcomes)
  {
    var2idx = new TObjectIntHashMap (mdl.numVariables ());
    values = new ArrayList ();
    Variable[] vars = new Variable [mdl.numVariables ()];
    for (int i = 0; i < vars.length; i++) vars[i] = mdl.get (i);
    addRow (vars, outcomes);
  }
View Full Code Here

  {
//    in.defaultReadObject ();
    int version = in.readInt ()// version

    int numVariables = in.readInt ();
    var2idx = new TObjectIntHashMap (numVariables);
    for (int vi = 0; vi < numVariables; vi++) {
      Variable var = (Variable) in.readObject ();
      var2idx.put (var, vi);
    }
View Full Code Here

  public StringEditFeatureVectorSequence(FeatureVector[] featureVectors, String s1, String s2, char delimiter, HashMap lexic)
  {
    super (featureVectors);
    this.delim = delimiter;
   
    this.lexicon = new TObjectIntHashMap();
    if (lexic != null) {
      Set keys = lexic.keySet();
      java.util.Iterator iter = keys.iterator();
      while (iter.hasNext())
        this.lexicon.put((String) iter.next(), 1);
    }

    this.string1 = s1;
    this.string2 = s2;
    this.string1Length = s1.length() + 2;
    this.string2Length = s2.length() + 2;
    string1Blocks = string1.split("" + delim);
    string2Blocks = string2.split("" + delim);
    string1Present = new TObjectIntHashMap();
    string2Present = new TObjectIntHashMap();
    block1Indices = new int[string1Length];
    if (string1Blocks.length > 0) {
      int whichBlock = 0;
      block1Indices[0] = whichBlock++;
      for (int i = 0; i < string1Blocks.length; i++)
View Full Code Here

      for (int i = 0; i<size; i++) {
        string2Blocks[i] = (String) in.readObject();
      }
    }

    TObjectIntHashMap string1Present = (TObjectIntHashMap) in.readObject();
    TObjectIntHashMap string2Present = (TObjectIntHashMap) in.readObject();
    TObjectIntHashMap lexicon = (TObjectIntHashMap) in.readObject();

    size = in.readInt();
    if (size == NULL_INTEGER) {
      block1Indices = null;
    }
View Full Code Here

public class Tamperer {
 
  public static GISModel tamperModel(GISModel model, Set<String> featuresToRemove, List<String> prefixesToRemove) {
    Object [] modelData = model.getDataStructures();
    TObjectIntHashMap map = (TObjectIntHashMap)modelData[1];
    Context [] params = (Context []) modelData[0];
    //map.
    List<Context> newParams = new ArrayList<Context>();
    List<String> newPredNames = new ArrayList<String>();
   
    TObjectIntIterator iterator = map.iterator();
    while(iterator.hasNext()) {
      iterator.advance();
      String predName = (String)iterator.key();
      int index = map.get(predName);
      Context context = params[index];
      boolean goodPredName = true;
      if(featuresToRemove != null && featuresToRemove.contains(predName)) goodPredName = false;
      for(String prefix : prefixesToRemove) {
        if(predName.startsWith(prefix)) goodPredName = false;
View Full Code Here

        // same order so we have
        // to sort the method list before computation.
        // @TODO: filter init/clinit/prefixed methods
        final List sortedMethods = Arrays.asList(methods);
        Collections.sort(sortedMethods, JavassistMethodComparator.getInstance());
        final TObjectIntHashMap methodSequences = new TObjectIntHashMap();
        final List sortedMethodTuples = new ArrayList(sortedMethods.size());
        for (Iterator methodsIt = sortedMethods.iterator(); methodsIt.hasNext();) {
            CtMethod method = (CtMethod) methodsIt.next();
            MethodInfo methodInfo = JavassistMethodInfo.getMethodInfo(method, context.getLoader());
            int sequence = 1;
            if (methodSequences.containsKey(method.getName())) {
                sequence = methodSequences.get(method.getName());
                methodSequences.remove(method.getName());
                sequence++;
            }
            methodSequences.put(method.getName(), sequence);
            ExpressionContext ctx = new ExpressionContext(PointcutType.EXECUTION, methodInfo, methodInfo);
            MethodSequenceTuple tuple = new MethodSequenceTuple(method, sequence);
            int status = methodFilter(definitions, ctx, method);
            tuple.setStatus(status);
View Full Code Here

TOP

Related Classes of gnu.trove.TObjectIntHashMap

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.