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) {