Package mikera.indexz

Examples of mikera.indexz.Index.unsafeGet()


    if (length==0) throw new IllegalArgumentException("Can't create a length 0 SparseIndexedVector");
    Index ixs=source.nonSparseIndex();
    int n=ixs.length();
    double[] vals=new double[n];
    for (int i=0; i<n; i++) {
      vals[i]=source.unsafeGet(ixs.unsafeGet(i));
    }
    return wrap(length,ixs,vals);
  }
 
  public static SparseIndexedVector create(SparseHashedVector source) {
View Full Code Here


    if (length==0) throw new IllegalArgumentException("Can't create a length 0 SparseIndexedVector");
    Index ixs=source.nonSparseIndex();
    int n=ixs.length();
    double[] vals=new double[n];
    for (int i=0; i<n; i++) {
      vals[i]=source.unsafeGet(ixs.unsafeGet(i));
    }
    return wrap(length,ixs,vals);
  }
 
  /** Creates a SparseIndexedVector from a row of an existing matrix */
 
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.