CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Modules | Functions
BLAS2 -- Matrix/Vector operations
Collaboration diagram for BLAS2 -- Matrix/Vector operations:

Modules

 Reductions from matrix to row or column

Functions

template<class V , class M >
void cuv::spmv (tensor< V, M > &dst, const dia_matrix< V, M > &A, const tensor< V, M > &v, char transA='n', const float &factAv=1.f, const float &factC=0.f)
 Calculates product of a sparse matrix and a vector.
template<class V , class V2 , class M , class L >
void cuv::matrix_op_vec (tensor< V, M, L > &Dst, const tensor< V, M, L > &Src, const tensor< V2, M > &v, int axis, BinaryFunctor bf, float factNew=1.f, float factOld=0.f, int n_params=0, float param0=0.f, float param1=0.f)
 Apply a binary functor on one axis of a tensor and a n-1-dimensional tensor.
template<class V , class M , class L >
void cuv::matrix_plus_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Add a vector to each column of a matrix A.
template<class V , class M , class L >
void cuv::matrix_times_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Multiply each column of a matrix A pointwise with a vector v.
template<class V , class M , class L >
void cuv::matrix_divide_col (tensor< V, M, L > &A, const tensor< V, M > &v)
 Devide each column of a matrix A pointwise by a vector v.
template<class V , class M , class L >
void cuv::matrix_plus_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Add a vector to each row of a matrix A.
template<class V , class M , class L >
void cuv::matrix_times_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Multiply each row of a matrix A pointwise with a vector v.
template<class V , class M , class L >
void cuv::matrix_divide_row (tensor< V, M, L > &A, const tensor< V, M > &v)
 Devide each row of a matrix A pointwise by a vector v.

Detailed Description

Function Documentation

template<class V , class M , class L >
void cuv::matrix_divide_col ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Devide each column of a matrix A pointwise by a vector v.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class M , class L >
void cuv::matrix_divide_row ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Devide each row of a matrix A pointwise by a vector v.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class V2 , class M , class L >
void cuv::matrix_op_vec ( tensor< V, M, L > &  Dst,
const tensor< V, M, L > &  Src,
const tensor< V2, M > &  v,
int  axis,
BinaryFunctor  bf,
float  factNew = 1.f,
float  factOld = 0.f,
int  n_params = 0,
float  param0 = 0.f,
float  param1 = 0.f 
)

Apply a binary functor on one axis of a tensor and a n-1-dimensional tensor.

Parameters
DstDestination matrix, same shape as Src
SrcSource matrix
vvector, v.size()=Src.size()/Src.shape(axis)
axisaxis of Src to work on. 0: v is row vector, 1: v is column vector, ...
bfa binary functor applied to elements of a column of Src and v
n_paramsnumber of optional params following
factNewmultiplier of op(Src,v)
factOldmultiplier of Dst
param0first optional parameter
param1second optional parameter
template<class V , class M , class L >
void cuv::matrix_plus_col ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Add a vector to each column of a matrix A.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class M , class L >
void cuv::matrix_plus_row ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Add a vector to each row of a matrix A.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class M , class L >
void cuv::matrix_times_col ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Multiply each column of a matrix A pointwise with a vector v.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class M , class L >
void cuv::matrix_times_row ( tensor< V, M, L > &  A,
const tensor< V, M > &  v 
)

Multiply each row of a matrix A pointwise with a vector v.

Parameters
ADestination matrix
vVector, v.size()=A.h()
Deprecated:
template<class V , class M >
void cuv::spmv ( tensor< V, M > &  dst,
const dia_matrix< V, M > &  A,
const tensor< V, M > &  v,
char  transA = 'n',
const float &  factAv = 1.f,
const float &  factC = 0.f 
)

Calculates product of a sparse matrix and a vector.

Parameters
dstDestination vector
ASparse matrix
vInput vector
transAWether to transpose A before calculating the matrix product
factAvScalar factor for product of A and v
factCScalar factor for former value of C.
    Calculates:
dst = factC * dst + factAv*(transA(A)*v)

Here transA(A) is the transpose of A if transA = 't' and transA(A) is A if transA = 'n'. transA(A)*v is the matrix-vector product and all other operations are pointwise.