matrix with row sums equal to column sums where its inverse also have such property I am looking at a class of invertible square matrices where the row sums equal to the column sums. So if
$$
\begin{equation*}
M_{n,n} = 
\begin{pmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots  & \vdots  & \ddots & \vdots  \\
a_{n,1} & a_{n,2} & \cdots & a_{n,n} 
\end{pmatrix}
\end{equation*}
$$
then we have for any $1 \leq i \leq n$, $$ \sum_k M_{i,k} = \sum_k M_{k,i}$$
In addition, I also require that
$$ \sum_k M^{-1}_{i,k} = \sum_k M^{-1}_{k,i}$$
Obviously, taking inverse of an arbitrary matrix doesn't guarantee you that. But if $M$ is symmetric, then $M^{-1}$ is also symmetric and thus symmetric matrices satisfy the above criteria. But are symmetric matrices the only kind of matrices that satisfy such a criteria? So far, I am unable to think of a counterexample. If there are other matrices, are there properties these matrices will have to satisfy?
Edit:
I am rephrasing Eric Wofsey's answer a bit here.
For all $1 \leq i \leq n$, we have
$$\sum_k M^{-1}_{i,k} \sum_j M_{k,j} = \sum_k \sum_j M^{-1}_{i,k} M_{k,j} = \sum_j \sum_k M^{-1}_{i,k} M_{k,j} = \sum_{j} I_{i,j} = 1$$
if row sums of $M$ are some constant $c$ (i.e, $\sum_j M_{k,j} = c$ for each $j$), then we must have sum of each column of $M^{-1}$, $\sum_k M^{-1}_{i,k} = \frac{1}{c}$ for all $i$.
Similarly, we also have
$$\sum_k M^{-1}_{k,i} \sum_j M_{j,k} = \sum_{j} I_{j,i} = 1$$
Again, if all column sums of $M$ equal to the same constant $c$, then we have the row sums of $M^{-1}$ equal to $\frac{1}{c}$, which satisfies the criteria I was looking for.
I am working on a matrix optimization problem, where I know either the lower triangular part of the upper triangular, possibly excluding the diagonal elements, is fix. Now, it doesn't looks like both classes of matrices are useful to me since I need some freedom to fiddle with matrix entries as much as possible so that I can have some more control over individual column/row sum rather than having them all equal to a same constant. Likewise, symmetric matrices aren't too useful for me either since all matrix entries are determined by either lower or upper triangular half of the matrix, which is given by the problem.
Thus, it seems in order to find matrices that satisfy my criteria but are neither symmetric nor having constant row/column sums, I will "at least" have to do something like the following:
from the above two equations we have
$$\sum_k A_{i,k} \sum_j B_{k,j} = 1 $$
$$\sum_k A_{k,i} \sum_j B_{j,k} = 1 $$
we can let $x_j = \sum_k B_{k,j} = \sum_k B_{j,k}$, then we have a system of linear equations we need to solve. (I said "at least" here because there is a potential issue: the above 2 equations do not necessarily imply $A$ and $B$ are inverse of each other)
My question is, is there another matrix class out there that does not require complicated computation (or at least not as computationally expensive as solving a system of linear equations)? Sorry that I am not super confident about my linear algebra language, but hopefully my question is clear.
edit 2:
What if I don't require $M$ to have equal row sums and column sums, would it have the problem any easier?
 A: One simple class of non-symmetric matrices with this property is permutation matrices (or slightly more generally, scalar multiples of permutation matrices).  In a permutation matrix, every row sum and every column sum is equal to $1$, and the inverse matrix is also a permutation matrix and so has the same property.  A permutation matrix is symmetric iff the corresponding permutation has order at most 2 (i.e., all its cycles have length at most 2).
More generally, suppose a matrix $M$ has the property that all of its column sums have the same constant value $c$.  This means that for any vector $v$, the sum of the entries of $Mv$ is $c$ times the sum of the entries of $v$.  So, if $M$ is invertible, the sum of the entries of $M^{-1}v$ must be $c^{-1}$ times the sum of the entries of $v$.  This means the column sums of $M^{-1}$ are all equal to $c^{-1}$.
So now suppose $M$ has the property that both its row sums and its column sums are all equal to $c$.  As above, if $M$ is invertible, it follows that $M^{-1}$ has all its row sums and column sums equal to $c^{-1}$.  So, both $M$ and $M^{-1}$ have row sums equal to the corresponding column sums.  That is, any invertible matrix whose row and column sums all have the same constant value has the property you are looking for.
