1

I have a matrix consisting of row vectors, where each element per vector is the same, except for the one which is on the diagonal of the matrix, so $$ \begin{bmatrix} a_1 & b_1 & b_1 & ... & b_1 \\ b_2 & a_2 & b_2 & ... & b_2 \\ b_3 & b_3 & a_3 & ... & b_3 \\ ... & ... & ... & ... & ... \\ b_n & b_n & b_n & ... & a_n \end{bmatrix} $$

I wonder if it is possible to calculate the matrix faster than $O(n^3)$ by using any properties of this matrix. If that isn't possible, maybe an efficient approximation is possible? Is there a name for matrices with this pattern?

  • 4
    This is a rank-one update of a diagonal matrix. If you write the matrix as $D+uv^T$ where $D$ is a diagonal matrix, its determinant is $\det(D)+v^T\operatorname{adj}(D)u=\prod_{i=1}^nd_i+\sum_{i=1}^n\left(u_iv_i\prod_{j\ne i}d_j\right)$. – user1551 Aug 13 '22 at 18:56

0 Answers0