Thomas algorithm can be used to solve a tridiagonal matrix:$$\begin{bmatrix}   {b_ 1} & {c_ 1} & {   } & {   } & { 0 } \\   {a_ 2} & {b_ 2} & {c_ 2} & {   } & {   } \\   {   } & {a_ 3} & {b_ 3} & \ddots & {   } \\   {   } & {   } & \ddots & \ddots & {c_{n-1}}\\   { 0 } & {   } & {   } & {a_n} & {b_n}\\\end{bmatrix}\cdot\begin{bmatrix}   {x_ 1 }  \\   {x_ 2 }  \\   {x_ 3 }  \\   \vdots   \\   {x_n }  \\\end{bmatrix}=\begin{bmatrix}   {d_ 1 }  \\   {d_ 2 }  \\   {d_ 3 }  \\   \vdots   \\   {d_n }  \\\end{bmatrix}$$The solution can be get by $$c'_i=\begin{cases}\begin{array}{lcl}  \cfrac{c_i}{b_i}                  &&; i = 1 \\  \cfrac{c_i}{b_i - c'_{i - 1} a_i} &&; i = 2, 3, \\dots, n-1 \\\end{array}\end{cases}$$$$d'_i=\begin{cases}\begin{array}{lcl}  \cfrac{d_i}{b_i}                  &&; i = 1 \\  \cfrac{d_i - d'_{i - 1} a_i}{b_i - c'_{i - 1} a_i} &&; i = 2, 3, \dots, n. \\\end{array}\end{cases}$$$$\begin{array}{lcl}x_n&=&d'_n\\x_i&=&d'_i-c'_ix_{i+1}\end{array}$$How to generalize this algorithm to block tridiagonal matrix, ie. both a,b,c are small square matrix itself. Do I just replace times by dot and divide by dot inverse in the above formula, and everything is OK?
How to solve block tridiagonal matrix using Thomas algorithm
algorithms;linear solver;sparse
I think it will be too much time consuming, if I try to give you answer and to correct superscripts,subscripts,capital and small letters of your query. Instead of that you can refer a detailed description of Thomas Algorithm from a book Computational Fluid Dynamics by John Anderson. You can directly refer page number 534 for it (Publisher: McGraw-Hill Science/Engineering/Math; 1st edition (February 1, 1995)). Its very easy to understand and implement it from there. All the best.