コード例 #1
0
ファイル: test_decomp.py プロジェクト: mbentz80/jzigbeercp
    def check_zgbtrf(self):
        """Compare zgbtrf  LU factorisation with the LU factorisation result
           of linalg.lu."""
        M,N = shape(self.comp_mat)        
        lu_symm_band, ipiv, info = zgbtrf(self.bandmat_comp, self.KL, self.KU)

        # extract matrix u from lu_symm_band
        u = diag(lu_symm_band[2*self.KL,:])
        for i in xrange(self.KL + self.KU):
            u += diag(lu_symm_band[2*self.KL-1-i,i+1:N], i+1)

        p_lin, l_lin, u_lin =lu(self.comp_mat, permute_l=0)
        assert_array_almost_equal(u, u_lin)
コード例 #2
0
ファイル: test_decomp.py プロジェクト: mbentz80/jzigbeercp
 def _test_common(self, data):
     p,l,u = lu(data)
     assert_array_almost_equal(dot(dot(p,l),u),data)
     pl,u = lu(data,permute_l=1)
     assert_array_almost_equal(dot(pl,u),data)