Package org.apache.spark.ml.linalg
Class BLAS
Object
org.apache.spark.ml.linalg.BLAS
BLAS routines for MLlib's vectors and matrices.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidy += a * xstatic voidy = xstatic doubledot(x, y)static voiddspmv(int n, double alpha, DenseVector A, DenseVector x, double beta, DenseVector y) y := alpha*A*x + beta*ystatic voidgemm(double alpha, Matrix A, DenseMatrix B, double beta, double[] CValues) CValues[0: A.numRows * B.numCols] := alpha * A * B + beta * CValues[0: A.numRows * B.numCols]static voidgemm(double alpha, Matrix A, DenseMatrix B, double beta, DenseMatrix C) C := alpha * A * B + beta * Cstatic voidy[0: A.numRows] := alpha * A * x[0: A.numCols] + beta * y[0: A.numRows]static voidgemv(double alpha, Matrix A, Vector x, double beta, DenseVector y) y := alpha * A * x + beta * ystatic voidx = a * xstatic voidAdds alpha * v * v.t to a matrix in-place.static voidspr(double alpha, Vector v, DenseVector U) Adds alpha * x * x.t to a matrix in-place.static voidsyr(double alpha, Vector x, DenseMatrix A) A := alpha * x * x^T^ + A
- 
Constructor Details- 
BLASpublic BLAS()
 
- 
- 
Method Details- 
axpyy += a * x- Parameters:
- a- (undocumented)
- x- (undocumented)
- y- (undocumented)
 
- 
dotdot(x, y)- Parameters:
- x- (undocumented)
- y- (undocumented)
- Returns:
- (undocumented)
 
- 
copyy = x- Parameters:
- x- (undocumented)
- y- (undocumented)
 
- 
scalx = a * x- Parameters:
- a- (undocumented)
- x- (undocumented)
 
- 
sprAdds alpha * x * x.t to a matrix in-place. This is the same as BLAS's ?SPR.- Parameters:
- U- the upper triangular part of the matrix in a- DenseVector(column major)
- alpha- (undocumented)
- v- (undocumented)
 
- 
dspmvpublic static void dspmv(int n, double alpha, DenseVector A, DenseVector x, double beta, DenseVector y) y := alpha*A*x + beta*y- Parameters:
- n- The order of the n by n matrix A.
- A- The upper triangular part of A in a- DenseVector(column major).
- x- The- DenseVectortransformed by A.
- y- The- DenseVectorto be modified in place.
- alpha- (undocumented)
- beta- (undocumented)
 
- 
sprAdds alpha * v * v.t to a matrix in-place. This is the same as BLAS's ?SPR.- Parameters:
- U- the upper triangular part of the matrix packed in an array (column major)
- alpha- (undocumented)
- v- (undocumented)
 
- 
syrA := alpha * x * x^T^ + A- Parameters:
- alpha- a real scalar that will be multiplied to x * x^T^.
- x- the vector x that contains the n elements.
- A- the symmetric matrix A. Size of n x n.
 
- 
gemmC := alpha * A * B + beta * C- Parameters:
- alpha- a scalar to scale the multiplication A * B.
- A- the matrix A that will be left multiplied to B. Size of m x k.
- B- the matrix B that will be left multiplied by A. Size of k x n.
- beta- a scalar that can be used to scale matrix C.
- C- the resulting matrix C. Size of m x n. C.isTransposed must be false.
 
- 
gemmCValues[0: A.numRows * B.numCols] := alpha * A * B + beta * CValues[0: A.numRows * B.numCols]- Parameters:
- alpha- a scalar to scale the multiplication A * B.
- A- the matrix A that will be left multiplied to B. Size of m x k.
- B- the matrix B that will be left multiplied by A. Size of k x n.
- beta- a scalar that can be used to scale matrix C.
- CValues- the values of matrix C. C.isTransposed is supposed to be false.
 
- 
gemvy[0: A.numRows] := alpha * A * x[0: A.numCols] + beta * y[0: A.numRows]- Parameters:
- alpha- (undocumented)
- A- (undocumented)
- x- (undocumented)
- beta- (undocumented)
- y- (undocumented)
 
- 
gemvy := alpha * A * x + beta * y- Parameters:
- alpha- a scalar to scale the multiplication A * x.
- A- the matrix A that will be left multiplied to x. Size of m x n.
- x- the vector x that will be left multiplied by A. Size of n x 1.
- beta- a scalar that can be used to scale vector y.
- y- the resulting vector y. Size of m x 1.
 
 
-