A Graph's diagonal Degree matrix, $D$ is typically defined as
$$ D_{ii} = \sum_{j} A_{ij} $$
i.e., each i-th diagonal of the Degree matrix is the sum of the i-th row of matrix $A$ (the Adjacency matrix).
I am wondering if it is possible to write a vectorized form for $D$, using $A$ and possibly some other constant matrix.
The only thing I can come up with is
$$D_{ii} = A_{i\cdot} * \boldsymbol{1}$$
Where A_{i\cdot} is a row vector, the i-th row of $A$, and $\boldsymbol{1}$ is a column vector of 1's. I can't figure out how to generalize the expression for $D$ sucintly, and I'm not sure if it possible. Any hints?
You can simply define $D$ as $D = \text{diag}\left(A \boldsymbol{1}\right)$ where $\boldsymbol{1} $ is a column vector of 1s.