Closed
Description
This suggestion came up some time ago but I can't put my hands on exactly where the discussion originated. Methods for scale!
for an Array and a scalar are defined in linalg/generic.jl
and linalg/dense.jl
. The effect of the diagmm method for a matrix and a vector can be regarded as scaling the rows or columns of the matrix (rows if the first argument is the vector, columns if the first arg is the matrix). The suggestion is to rename diagmm!
as scale!
and diagmm
as scale
.
Part of my motivation for this suggestion is from the CHOLMOD module. The C function cholmod_scale has the capability of
- scaling a sparse matrix by a scalar constant
- scaling the rows of a sparse matrix
- scaling the columns of a sparse matrix
- scaling the rows and columns of a symmetric sparse matrix (the logical equivalent of D_A_D where A is the symmetric matrix and D is the diagonal matrix corresponding to the scaling vector).
and it makes sense to me to use multiple dispatch in Julia for a similar purpose.