CUV
0.9.201304091348
|
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. |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
Dst | Destination matrix, same shape as Src |
Src | Source matrix |
v | vector, v.size()=Src.size()/Src.shape(axis) |
axis | axis of Src to work on. 0: v is row vector, 1: v is column vector, ... |
bf | a binary functor applied to elements of a column of Src and v |
n_params | number of optional params following |
factNew | multiplier of op(Src,v) |
factOld | multiplier of Dst |
param0 | first optional parameter |
param1 | second optional parameter |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
A | Destination matrix |
v | Vector, v.size()=A.h() |
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.
dst | Destination vector |
A | Sparse matrix |
v | Input vector |
transA | Wether to transpose A before calculating the matrix product |
factAv | Scalar factor for product of A and v |
factC | Scalar 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.