Exemplo n.º 1
0
 /**
  * Parses {@link DenseVector} from the given CSV string.
  *
  * @param csv the CSV string representing a vector
  * @return a parsed vector
  */
 public static DenseVector fromCSV(String csv) {
   return Vector.fromCSV(csv).to(Vectors.DENSE);
 }
Exemplo n.º 2
0
 /**
  * Creates new {@link DenseVector} from index-value map
  *
  * @param map index-value map
  * @param length vector length
  * @return created vector
  */
 public static DenseVector fromMap(Map<Integer, ? extends Number> map, int length) {
   return Vector.fromMap(map, length).to(Vectors.DENSE);
 }
Exemplo n.º 3
0
 @Override
 public <T> T apply(VectorVectorOperation<T> operation, Vector that) {
   return that.apply(operation.partiallyApply(this));
 }
Exemplo n.º 4
0
 /**
  * Parses {@link DenseVector} from the given Matrix Market string.
  *
  * @param mm the string in Matrix Market format
  * @return a parsed vector
  */
 public static DenseVector fromMatrixMarket(String mm) {
   return Vector.fromMatrixMarket(mm).to(Vectors.DENSE);
 }