Package org.fnlp.ml.types

Examples of org.fnlp.ml.types.LinearSparseVector


    for(int i=0;i<len;i++){
      w[i]=(float) i/100.0f;
    }
   
    HashSparseVector sv1 = new HashSparseVector();
    LinearSparseVector sv2 = new LinearSparseVector();
   
   
    long stime;
    long etime;
   
    stime = System.currentTimeMillis();
    for(int i=0;i<len;i++){
      sv1.put(i, w[i]);
    }
    etime = System.currentTimeMillis();   
    System.out.println("time:" + (etime-stime));
   
    stime = System.currentTimeMillis();
    for(int i=0;i<len;i++){
      sv2.put(i, w[i]);
    }
    etime = System.currentTimeMillis();   
    System.out.println("time:" + (etime-stime));
   
    stime = System.currentTimeMillis();
    for(int i=0;i<len;i++){
      sv1.get(i);
    }
    etime = System.currentTimeMillis();   
    System.out.println("time:" + (etime-stime));
   
    stime = System.currentTimeMillis();
    for(int i=0;i<len;i++){
      sv2.get(i);
    }
    etime = System.currentTimeMillis();   
    System.out.println("time:" + (etime-stime));

  }
View Full Code Here

TOP

Related Classes of org.fnlp.ml.types.LinearSparseVector

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.