(self)
return C
Algorithm for numeric Cholesky factorization of a sparse matrix.
Algorithm for numeric Cholesky factorization of a sparse matrix.
Algorithm for numeric Cholesky factorization of a sparse matrix .
def _cholesky_sparse(self):
        """Algorithm for numeric Cholesky factorization of a sparse matrix."""
        Crowstruc = self.row_structure_symbolic_cholesky()
        C = self.zeros(self.rows)
        for i in range(len(Crowstruc)):
            for j in Crowstruc[i]:
                if i != j:
                    C[i, j] = self[i, j]
                    summ = 0
                    for p1 in Crowstruc[i]:
                        if p1 < j:
                            for p2 in Crowstruc[j]:
                                if p2 < j:
                                    if p1 == p2:
                                        summ += C[i, p1]*C[j, p1]
                                else:
                                    break
                            else:
                                break
                    C[i, j] -= summ
                    C[i, j] /= C[j, j]
                else:
                    C[j, j] = self[j, j]
                    summ = 0
                    for k in Crowstruc[j]:
                        if k < j:
                            summ += C[j, k]**2
                        else:
                            break
                    C[j, j] -= summ
                    C[j, j] = sqrt(C[j, j])

        return C
def _cholesky_sparse ( self ) : Crowstruc = self . row_structure_symbolic_cholesky ( ) C = self . zeros ( self . rows ) for i in range ( len ( Crowstruc ) ) : for j in Crowstruc [ i ] : if i != j : C [ i , j ] = self [ i , j ] summ = 0 for p1 in Crowstruc [ i ] : if p1 < j : for p2 in Crowstruc [ j ] : if p2 < j : if p1 == p2 : summ += C [ i , p1 ] * C [ j , p1 ] else : break else : break C [ i , j ] -= summ C [ i , j ] /= C [ j , j ] else : C [ j , j ] = self [ j , j ] summ = 0 for k in Crowstruc [ j ] : if k < j : summ += C [ j , k ] ** 2 else : break C [ j , j ] -= summ C [ j , j ] = sqrt ( C [ j , j ] ) return C