Package com.carrotsearch.hppc

Examples of com.carrotsearch.hppc.IntArrayList


    Random rand = new Random(5);
   
    final int N = space.getInstanceSize();
    final int D = space.getFeatureSize();
   
    IntArrayList        ys = space.getYs();
    ArrayList<int[]>    xs = space.getXs();
    ArrayList<double[]> vs = space.getVs();
   
    double[] alpha  = new double[N];
    double[] weight = new double[D];
View Full Code Here


   
    final int N = space.getInstanceSize();
    final int D = space.getFeatureSize();
    final double INNER_MIN = Math.min(1e-8, d_eps);
   
    IntArrayList        ys = space.getYs();
    ArrayList<int[]>    xs = space.getXs();
    ArrayList<double[]> vs = space.getVs();
   
    double[] alpha  = new double[2*N];
    double[] weight = new double[D];
View Full Code Here

    final int D  = space.getFeatureSize();
    final int L  = space.getLabelSize();
    final int N  = space.getInstanceSize();
    final int WS = D * L;
   
    IntArrayList        ys = space.getYs();
    ArrayList<int[]>    xs = space.getXs();
    ArrayList<double[]> vs = space.getVs();
   
    AbstractModel model = space.getModel();
    double[] cWeights = new double[WS];
    double[] aWeights = average ? new double[WS] : null;
    double[] gs       = new double[WS];
   
    double stdev, prevScore, currScore = 0;
    int[] indices = UTArray.range(N);
    int i, j, correct, count = 1;
   
    int      yi;
    int[]    xi;
    double[] vi = null;
   
    for (i=0; i<MAX_ITER; i++)
    {
      UTArray.shuffle(new Random(5), indices, N);
      prevScore = currScore;
      Arrays.fill(gs, 0);
      correct = 0;
     
      for (j=0; j<N; j++)
      {
        yi = ys.get(indices[j]);
        xi = xs.get(indices[j]);
        if (space.hasWeight())  vi = vs.get(indices[j]);
       
        if (average)
        {
View Full Code Here

    buildLabels(labelCutoff);
    buildFeatures(featureCutoff);
   
    l_instances = Lists.newArrayList();
    r_shuffle = new Random(randomSeed);
    l_indices = new IntArrayList();
   
    while ((instance = i_collector.pollInstance()) != null)
    {
      if ((label = getLabelIndex(instance.getLabel())) < 0)
        continue;
View Full Code Here

  }
 
  void measureTime()
  {
    int i, j, len = 10, size = 1000000;
    IntArrayList list;
    IntDeque deque;
    long st, et;
   
    st = System.currentTimeMillis();
   
    for (i=0; i<size; i++)
    {
      list = new IntArrayList();
     
      for (j=0; j<len; j++)
        list.add(j);
     
      list.remove(list.size()-1);
    }
   
    et = System.currentTimeMillis();
    System.out.println(et-st);
   
View Full Code Here

  /* (non-Javadoc)
   * @see edu.colorado.clear.classification.vector.AbstractFeatureVector#init()
   */
  protected void init()
  {
    i_indices = new IntArrayList();
  }
View Full Code Here

  }
 
  void measureTime()
  {
    int i, j, len = 10, size = 1000000;
    IntArrayList list;
    IntDeque deque;
    long st, et;
   
    st = System.currentTimeMillis();
   
    for (i=0; i<size; i++)
    {
      list = new IntArrayList();
     
      for (j=0; j<len; j++)
        list.add(j);
     
      list.remove(list.size()-1);
    }
   
    et = System.currentTimeMillis();
    System.out.println(et-st);
   
View Full Code Here

 
  // --------------------------------- projectivize ---------------------------------
 
  public void projectivize()
  {
    IntArrayList ids = new IntArrayList();
    int i, size = size();
    DEPNode nonProj;
   
    for (i=1; i<size; i++)
      ids.add(i);
   
    while ((nonProj = getSmallestNonProjectiveArc(ids)) != null)
      nonProj.setHead(nonProj.getHead().getHead(), DEPLib.DEP_NON_PROJ);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see edu.colorado.clear.classification.vector.AbstractFeatureVector#init()
   */
  protected void init()
  {
    i_indices = new IntArrayList();
  }
View Full Code Here

public class IteratingOverLists
{
    IntArrayList prepare(int size)
    {
        final IntArrayList list = new IntArrayList(size);
        for (int i = 0; i < size; i++)
        {
            list.add(size - i);
        }
        return list;
    }
View Full Code Here

TOP

Related Classes of com.carrotsearch.hppc.IntArrayList

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.