def invert(self,nz,A,C):
X = [<NUM_LIT:0> for i in range(nz)]<EOL>for i in reversed(range(nz-<NUM_LIT:1>)):<EOL><INDENT>C[i] = C[i] - A[i][<NUM_LIT:2>] * C[i+<NUM_LIT:1>]/A[i+<NUM_LIT:1>][<NUM_LIT:1>]<EOL>A[i][<NUM_LIT:1>] = A[i][<NUM_LIT:1>] - A[i][<NUM_LIT:2>] * A[i+<NUM_LIT:1>][<NUM_LIT:0>]/A[i+<NUM_LIT:1>][<NUM_LIT:1>]<EOL><DEDENT>for i in  range(<NUM_LIT:1>,nz,<NUM_LIT:1>):<EOL><INDENT>C[i] = C[i] - A[i][<NUM_LIT:0>] * C[i-<NUM_LIT:1>]/A[i-<NUM_LIT:1>][<NUM_LIT:1>]<EOL><DEDENT>for i in range(nz):<EOL><INDENT>X[i] = C[i]/A[i][<NUM_LIT:1>]<EOL><DEDENT>return X<EOL>
Inversion and resolution of a tridiagonal matrix
         A X = C
Input:
 nz number of layers
 a(*,1) lower diagonal (Ai,i-1)
 a(*,2) principal diagonal (Ai,i)
 a(*,3) upper diagonal (Ai,i+1)
 c
Output
 x     results