My question is somewhat related to Sum of all elements in a matrix
Consider a matrix A, is there any class of matrices, C, such that:
$$grandsum(CA) = grandsum(A)$$, or
$$ e^TCAe = e^TAe $$
That is all the operations where sum of matrix is conserved. What are such C called?
Background: My friend asked me recently regarding a way to represent all arbitrary volume that a chunk of fluid can take in space. His representation includes a square matrix with matrix elements representing solid angles. Deformation of such fluid will conserve volume, which he is representing as sum of individual elements. so while they can change, their sum cannot.