Determinant of a particular $3\times 3$ block matrix Let $m\geq 0,n\geq 1$ be fixed integers. I want to compute the determinant of the $(2n+m)\times (2n+m)$ matrix given by
$$a_{ij}=\left\{\begin{array}{cl}n+m &amp; \text{if }i=j\leq 2n,\\
2n&amp; \text{if }i=j&gt; 2n,\\
0 &amp; \text{if $i\neq j$ and $i,j\leq n$, $n&lt; i, j\leq2n$ or $2n&lt;i,j$,}\\
-1 &amp;\text{otherwise.}\end{array}\right.$$
So, it's the sum of a matrix with diagonal blocks $0$ and every other block $-1$, and a diagonal matrix with the first $2n$ elements being $n+m$ and the rest $2n$.

Or just:
$$\begin{bmatrix}D_n({n+m}) &amp; -1 &amp; -1\\
-1 &amp; D_{n}(n+m) &amp; -1\\
-1 &amp; -1 &amp; D_m({2n})
\end{bmatrix}$$ 

where $D_r(s)$ denotes the diagonal $r\times r$ matrix with diagonal $s$.

I'd like to use something like this, but here the blocks have different sizes and there are some rectangular ones, too.

For the context, I was trying to compute the number of spanning trees of the tripartite graph $K_{n,n,m}$ using the Matrix-Tree Theorem and ended up with that. 

One detail is that in the problem I have to remove a row and a column corresponding to one vertex, which I choose to be the last one, but the resulting matrix is still with the same form. Also, for the case of $m=0$ ($m=1$ in the problem) this can be easily solved by this (or any) method since there are only 4 blocks, all of which have the same size, commute and are very simple.
If you're using the matrix tree theorem, then you've forgotten to delete one row and one column; the determinant of your current matrix is $0$, because the all-ones vector is in the null space.

But in general, we can compute the determinant of an $(m+n+p)\times (m+n+p)$ matrix of the form
$$
  \begin{bmatrix}aI_m &amp; -1 &amp; -1 \\ -1 &amp; bI_n &amp; -1 \\ -1 &amp; -1 &amp; cI_p\end{bmatrix}
$$
by looking at the eigenvalues.

First of all, $a$, $b$, and $c$ are each eigenvalues with multiplicity $m-1,n-1,p-1$ respectively. (Or, if $a=b$ as in this case, we add the multiplicities.) To see this, just subtract the appropriate multiple of the identity matrix and look at the rank.

The remaining three eigenvalues come from the block structure. The block matrix acts on a vector of the form $(x,x,\dots,x, y,y,\dots, y,z,z,\dots,z)$ in exactly the same way that the $3\times 3$ matrix 
$$
   \begin{bmatrix}
       a &amp; -n &amp; - p \\ -m &amp; b &amp; -p \\ -m &amp; -n &amp; c
   \end{bmatrix}
$$
acts on the vector $(x,y,z)$. So just compute the determinant of this $3\times 3$ matrix, multiply by $a^{m-1}b^{n-1}c^{p-1}$, and you get the determinant of the original block matrix.
Your matrix is Laplacian. In particular, all row/column sums of your $A$ are zero. Hence $\det(A)=0$.