cern.colt.matrix.tfloat.algo
Class SmpFloatBlas
- java.lang.Object
-
- cern.colt.matrix.tfloat.algo.SmpFloatBlas
-
- All Implemented Interfaces:
- FloatBlas
public class SmpFloatBlas extends java.lang.Object implements FloatBlas
Parallel implementation of the Basic Linear Algebra System for symmetric multi processing boxes. In all cases, no or only marginal speedup is seen for small problem sizes; they are detected and the sequential algorithm is used.
-
-
Constructor Summary
Constructors Constructor and Description SmpFloatBlas()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidassign(FloatMatrix2D A, FloatFunction function)Assigns the result of a function to each cell; x[row,col] = function(x[row,col]).voidassign(FloatMatrix2D A, FloatMatrix2D B, FloatFloatFunction function)Assigns the result of a function to each cell; x[row,col] = function(x[row,col],y[row,col]).floatdasum(FloatMatrix1D x)Returns the sum of absolute values; |x[0]| + |x[1]| + ...voiddaxpy(float alpha, FloatMatrix1D x, FloatMatrix1D y)Combined vector scaling; y = y + alpha*x.voiddaxpy(float alpha, FloatMatrix2D A, FloatMatrix2D B)Combined matrix scaling; B = B + alpha*A.voiddcopy(FloatMatrix1D x, FloatMatrix1D y)Vector assignment (copying); y = x.voiddcopy(FloatMatrix2D A, FloatMatrix2D B)Matrix assignment (copying); B = A.floatddot(FloatMatrix1D x, FloatMatrix1D y)Returns the dot product of two vectors x and y, which is Sum(x[i]*y[i]).voiddgemm(boolean transposeA, boolean transposeB, float alpha, FloatMatrix2D A, FloatMatrix2D B, float beta, FloatMatrix2D C)Generalized linear algebraic matrix-matrix multiply; C = alpha*A*B + beta*C.voiddgemv(boolean transposeA, float alpha, FloatMatrix2D A, FloatMatrix1D x, float beta, FloatMatrix1D y)Generalized linear algebraic matrix-vector multiply; y = alpha*A*x + beta*y.voiddger(float alpha, FloatMatrix1D x, FloatMatrix1D y, FloatMatrix2D A)Performs a rank 1 update; A = A + alpha*x*y'.floatdnrm2(FloatMatrix1D x)Return the 2-norm; sqrt(x[0]^2 + x[1]^2 + ...).voiddrot(FloatMatrix1D x, FloatMatrix1D y, float c, float s)Applies a givens plane rotation to (x,y); x = c*x + s*y; y = c*y - s*x.voiddrotg(float a, float b, float[] rotvec)Constructs a Givens plane rotation for (a,b).voiddscal(float alpha, FloatMatrix1D x)Vector scaling; x = alpha*x.voiddscal(float alpha, FloatMatrix2D A)Matrix scaling; A = alpha*A.voiddswap(FloatMatrix1D x, FloatMatrix1D y)Swaps the elements of two vectors; y <==> x.voiddswap(FloatMatrix2D A, FloatMatrix2D B)Swaps the elements of two matrices; B <==> A.voiddsymv(boolean isUpperTriangular, float alpha, FloatMatrix2D A, FloatMatrix1D x, float beta, FloatMatrix1D y)Symmetric matrix-vector multiplication; y = alpha*A*x + beta*y.voiddtrmv(boolean isUpperTriangular, boolean transposeA, boolean isUnitTriangular, FloatMatrix2D A, FloatMatrix1D x)Triangular matrix-vector multiplication; x = A*x or x = A'*x.intidamax(FloatMatrix1D x)Returns the index of largest absolute value; i such that |x[i]| == max(|x[0]|,|x[1]|,...)..
-
-
-
Method Detail
-
assign
public void assign(FloatMatrix2D A, FloatFunction function)
Description copied from interface:FloatBlasAssigns the result of a function to each cell; x[row,col] = function(x[row,col]).- Specified by:
assignin interfaceFloatBlas- Parameters:
A- the matrix to modify.function- a function object taking as argument the current cell's value.- See Also:
FloatFunctions
-
assign
public void assign(FloatMatrix2D A, FloatMatrix2D B, FloatFloatFunction function)
Description copied from interface:FloatBlasAssigns the result of a function to each cell; x[row,col] = function(x[row,col],y[row,col]).- Specified by:
assignin interfaceFloatBlas- Parameters:
A- the matrix to modify.B- the secondary matrix to operate on.function- a function object taking as first argument the current cell's value of this, and as second argument the current cell's value of y,- See Also:
FloatFunctions
-
dasum
public float dasum(FloatMatrix1D x)
Description copied from interface:FloatBlasReturns the sum of absolute values; |x[0]| + |x[1]| + ... . In fact equivalent to x.aggregate(cern.jet.math.Functions.plus, cern.jet.math.Functions.abs) .
-
daxpy
public void daxpy(float alpha, FloatMatrix1D x, FloatMatrix1D y)Description copied from interface:FloatBlasCombined vector scaling; y = y + alpha*x. In fact equivalent to y.assign(x,cern.jet.math.Functions.plusMult(alpha)).
-
daxpy
public void daxpy(float alpha, FloatMatrix2D A, FloatMatrix2D B)Description copied from interface:FloatBlasCombined matrix scaling; B = B + alpha*A. In fact equivalent to B.assign(A,cern.jet.math.Functions.plusMult(alpha)).
-
dcopy
public void dcopy(FloatMatrix1D x, FloatMatrix1D y)
Description copied from interface:FloatBlasVector assignment (copying); y = x. In fact equivalent to y.assign(x).
-
dcopy
public void dcopy(FloatMatrix2D A, FloatMatrix2D B)
Description copied from interface:FloatBlasMatrix assignment (copying); B = A. In fact equivalent to B.assign(A).
-
ddot
public float ddot(FloatMatrix1D x, FloatMatrix1D y)
Description copied from interface:FloatBlasReturns the dot product of two vectors x and y, which is Sum(x[i]*y[i]). In fact equivalent to x.zDotProduct(y).
-
dgemm
public void dgemm(boolean transposeA, boolean transposeB, float alpha, FloatMatrix2D A, FloatMatrix2D B, float beta, FloatMatrix2D C)Description copied from interface:FloatBlasGeneralized linear algebraic matrix-matrix multiply; C = alpha*A*B + beta*C. In fact equivalent to A.zMult(B,C,alpha,beta,transposeA,transposeB). Note: Matrix shape conformance is checked after potential transpositions.- Specified by:
dgemmin interfaceFloatBlas- Parameters:
transposeA- set this flag to indicate that the multiplication shall be performed on A'.transposeB- set this flag to indicate that the multiplication shall be performed on B'.alpha- a scale factor.A- the first source matrix.B- the second source matrix.beta- a scale factor.C- the third source matrix, this is also the matrix where results are stored.
-
dgemv
public void dgemv(boolean transposeA, float alpha, FloatMatrix2D A, FloatMatrix1D x, float beta, FloatMatrix1D y)Description copied from interface:FloatBlasGeneralized linear algebraic matrix-vector multiply; y = alpha*A*x + beta*y. In fact equivalent to A.zMult(x,y,alpha,beta,transposeA). Note: Matrix shape conformance is checked after potential transpositions.- Specified by:
dgemvin interfaceFloatBlas- Parameters:
transposeA- set this flag to indicate that the multiplication shall be performed on A'.alpha- a scale factor.A- the source matrix.x- the first source vector.beta- a scale factor.y- the second source vector, this is also the vector where results are stored.
-
dger
public void dger(float alpha, FloatMatrix1D x, FloatMatrix1D y, FloatMatrix2D A)Description copied from interface:FloatBlasPerforms a rank 1 update; A = A + alpha*x*y'. Example:A = { {6,5}, {7,6} }, x = {1,2}, y = {3,4}, alpha = 1 --> A = { {9,9}, {13,14} }
-
dnrm2
public float dnrm2(FloatMatrix1D x)
Description copied from interface:FloatBlasReturn the 2-norm; sqrt(x[0]^2 + x[1]^2 + ...). In fact equivalent to (float)Math.sqrt(Algebra.DEFAULT.norm2(x)).
-
drot
public void drot(FloatMatrix1D x, FloatMatrix1D y, float c, float s)
Description copied from interface:FloatBlasApplies a givens plane rotation to (x,y); x = c*x + s*y; y = c*y - s*x.
-
drotg
public void drotg(float a, float b, float[] rotvec)Description copied from interface:FloatBlasConstructs a Givens plane rotation for (a,b). Taken from the LINPACK translation from FORTRAN to Java, interface slightly modified. In the LINPACK listing DROTG is attributed to Jack Dongarra
-
dscal
public void dscal(float alpha, FloatMatrix1D x)Description copied from interface:FloatBlasVector scaling; x = alpha*x. In fact equivalent to x.assign(cern.jet.math.Functions.mult(alpha)).
-
dscal
public void dscal(float alpha, FloatMatrix2D A)Description copied from interface:FloatBlasMatrix scaling; A = alpha*A. In fact equivalent to A.assign(cern.jet.math.Functions.mult(alpha)).
-
dswap
public void dswap(FloatMatrix1D x, FloatMatrix1D y)
Description copied from interface:FloatBlasSwaps the elements of two vectors; y <==> x. In fact equivalent to y.swap(x).
-
dswap
public void dswap(FloatMatrix2D A, FloatMatrix2D B)
Description copied from interface:FloatBlasSwaps the elements of two matrices; B <==> A.
-
dsymv
public void dsymv(boolean isUpperTriangular, float alpha, FloatMatrix2D A, FloatMatrix1D x, float beta, FloatMatrix1D y)Description copied from interface:FloatBlasSymmetric matrix-vector multiplication; y = alpha*A*x + beta*y. Where alpha and beta are scalars, x and y are n element vectors and A is an n by n symmetric matrix. A can be in upper or lower triangular format.
-
dtrmv
public void dtrmv(boolean isUpperTriangular, boolean transposeA, boolean isUnitTriangular, FloatMatrix2D A, FloatMatrix1D x)Description copied from interface:FloatBlasTriangular matrix-vector multiplication; x = A*x or x = A'*x. Where x is an n element vector and A is an n by n unit, or non-unit, upper or lower triangular matrix.- Specified by:
dtrmvin interfaceFloatBlas- Parameters:
isUpperTriangular- is A upper triangular or lower triangular?transposeA- set this flag to indicate that the multiplication shall be performed on A'.isUnitTriangular- true --> A is assumed to be unit triangular; false --> A is not assumed to be unit triangularA- the source matrix.x- the vector holding source and destination.
-
idamax
public int idamax(FloatMatrix1D x)
Description copied from interface:FloatBlasReturns the index of largest absolute value; i such that |x[i]| == max(|x[0]|,|x[1]|,...)..
-
-
DMelt 3.0 © DataMelt by jWork.ORG