Examples of IntPair


Examples of edu.stanford.nlp.util.IntPair

  public Index<IntPair> createIndex() {
    Index<IntPair> index = new HashIndex<IntPair>();
    for (int x = 0; x < px.length; x++) {
      int numberY = numY(x);
      for (int y = 0; y < numberY; y++) {
        index.add(new IntPair(x, y));
      }
    }
    return index;
  }
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

          double val = Double.parseDouble(line.substring(0, indSp));

          if (indSp < line.length()) {
            line = line.substring(indSp + 1);
          }
          arrIndexes[current] = instanceIndex.indexOf(new IntPair(x, y));
          arrValues[current] = val;
          current++;
        }
        int[] indValues = new int[current];
        double[] values = new double[current];
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

    domain = e;
  }


  int indexOf(int x, int y) {
    IntPair iP = new IntPair(x, y);
    return instanceIndex.indexOf(iP);
  }
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

  IntPair getPair(int index) {
    return instanceIndex.get(index);
  }

  int getXInstance(int index) {
    IntPair iP = getPair(index);
    return iP.get(0);
  }
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

    IntPair iP = getPair(index);
    return iP.get(0);
  }

  int getYInstance(int index) {
    IntPair iP = getPair(index);
    return iP.get(1);
  }
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

  }

  public void print(PrintStream pf) {
    for (int i = 0; i < indexedValues.length; i++) {
      IntPair iP = getPair(indexedValues[i]);
      int x = iP.get(0);
      int y = iP.get(1);
      // int y=indexedValues[i]-x*domain.ySize;
      pf.println(x + ", " + y + ' ' + valuesI[i]);
    }
  }
View Full Code Here

Examples of edu.stanford.nlp.util.IntPair

      // lexical leaves do not add any Constituents
      // but increment position
      // System.err.println("In bracketing trees leaf is " + label());

      CyclicCoreLabel l = (CyclicCoreLabel) label();
      l.set(SpanAnnotation.class, new IntPair(left, left));
      return (left + 1);
    }
    int position = left;

    // System.err.println("In bracketing trees left is " + left);
    // System.err.println("  label is " + label() +
    //                       "; num daughters: " + children().length);
    // enumerate through daughter trees
    Tree[] kids = children();
    for (int i = 0; i < kids.length; i++) {
      // compute bracketings for daughter tree
      // update position to end of daughter tree
      position = kids[i].constituentsNodes(position);
      // System.err.println("  position went to " + position);
    }
    // need to wait until result position is known in order to
    // calculate span of whole tree
    CyclicCoreLabel l = (CyclicCoreLabel) label();
    l.set(SpanAnnotation.class, new IntPair(left, position - 1));

    return position;
  }
View Full Code Here

Examples of edu.ucla.sspace.util.primitive.IntPair

        // ||x - y||^2, which is the square of the distance between the two
        // points.  However, since we use the simiarlity (which is conceptually
        // the inverse of distance), we use the inverse similarity so that
        // elements that are more similarity (i.e., larger values) have smaller
        // probabilities.
  IntPair firstTwoCenters =
            pickFirstTwo(dataPoints, simFunc, weights, inverseSimilarities);
        selected.add(firstTwoCenters.x);
        selected.add(firstTwoCenters.y);

        // For the remaining k-2 points to select, pick a random point, x, with
View Full Code Here

Examples of edu.ucla.sspace.util.primitive.IntPair

            sim1 = invertSim(sim1);
            double sim2 = simFunc.sim(v, z); // center 2
            sim2 = invertSim(sim2);
            inverseSimilarities[i] = Math.min(sim1, sim2);
        }
        return new IntPair(c1, c2);
    }
View Full Code Here

Examples of edu.ucla.sspace.util.primitive.IntPair

                        System.out.println("Bad graph? : " + g);
                        throw npe;
                    }
                    int size = edges.size();
                    if (size > 0)
                        connected.add(new IntPair(i, j));
                    if (size > 1)
                        isSimpleAlready = false;
                }
            }
            // If the subgraph was already a simple graph, then just append it
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.