EntrywiseMap

Replace each entry of the passed in matrix with a specified function of the existing entry.

C++ API

void EntrywiseMap(Matrix<T> &A, std::function<T(T)> func)
void EntrywiseMap(AbstractDistMatrix<T> &A, std::function<T(T)> func)
void EntrywiseMap(SparseMatrix<T> &A, std::function<T(T)> func)
void EntrywiseMap(DistSparseMatrix<T> &A, std::function<T(T)> func)
void EntrywiseMap(DistMultiVec<T> &A, std::function<T(T)> func)
void EntrywiseMap(const Matrix<S> &A, Matrix<T> &B, std::function<T(S)> func)
void EntrywiseMap(const AbstractDistMatrix<S> &A, AbstractDistMatrix<T> &B, std::function<T(S)> func)
void EntrywiseMap(const SparseMatrix<S> &A, SparseMatrix<T> &B, std::function<T(S)> func)
void EntrywiseMap(const DistSparseMatrix<S> &A, DistSparseMatrix<T> &B, std::function<T(S)> func)
void EntrywiseMap(const DistMultiVec<S> &A, DistMultiVec<T> &B, std::function<T(S)> func)

C API

ElError ElEntrywiseMap_i(ElMatrix_i A, ElInt (*func)(ElInt))
ElError ElEntrywiseMap_s(ElMatrix_s A, float (*func)(float))
ElError ElEntrywiseMap_d(ElMatrix_d A, double (*func)(double))
ElError ElEntrywiseMap_c(ElMatrix_c A, complex_float (*func)(complex_float))
ElError ElEntrywiseMap_z(ElMatrix_z A, complex_double (*func)(complex_double))
ElError ElEntrywiseMapDist_i(ElDistMatrix_i A, ElInt (*func)(ElInt))
ElError ElEntrywiseMapDist_s(ElDistMatrix_s A, float (*func)(float))
ElError ElEntrywiseMapDist_d(ElDistMatrix_d A, double (*func)(double))
ElError ElEntrywiseMapDist_c(ElDistMatrix_c A, complex_float (*func)(complex_float))
ElError ElEntrywiseMapDist_z(ElDistMatrix_z A, complex_double (*func)(complex_double))
ElError ElEntrywiseMapSparse_i(ElSparseMatrix_i A, ElInt (*func)(ElInt))
ElError ElEntrywiseMapSparse_s(ElSparseMatrix_s A, float (*func)(float))
ElError ElEntrywiseMapSparse_d(ElSparseMatrix_d A, double (*func)(double))
ElError ElEntrywiseMapSparse_c(ElSparseMatrix_c A, complex_float (*func)(complex_float))
ElError ElEntrywiseMapSparse_z(ElSparseMatrix_z A, complex_double (*func)(complex_double))
ElError ElEntrywiseMapDistSparse_i(ElDistSparseMatrix_i A, ElInt (*func)(ElInt))
ElError ElEntrywiseMapDistSparse_s(ElDistSparseMatrix_s A, float (*func)(float))
ElError ElEntrywiseMapDistSparse_d(ElDistSparseMatrix_d A, double (*func)(double))
ElError ElEntrywiseMapDistSparse_c(ElDistSparseMatrix_c A, complex_float (*func)(complex_float))
ElError ElEntrywiseMapDistSparse_z(ElDistSparseMatrix_z A, complex_double (*func)(complex_double))
ElError ElEntrywiseMapDistMultiVec_i(ElDistMultiVec_i A, ElInt (*func)(ElInt))
ElError ElEntrywiseMapDistMultiVec_s(ElDistMultiVec_s A, float (*func)(float))
ElError ElEntrywiseMapDistMultiVec_d(ElDistMultiVec_d A, double (*func)(double))
ElError ElEntrywiseMapDistMultiVec_c(ElDistMultiVec_c A, complex_float (*func)(complex_float))
ElError ElEntrywiseMapDistMultiVec_z(ElDistMultiVec_z A, complex_double (*func)(complex_double))

Python API

EntrywiseMap(A, func)