#NEWLINE# def test_lower_real( self ) : #NEWLINE# #INDENT# a = array ( [ [ 4.0 , 1.0 , 0.0 , 0.0 ] , [ 1.0 , 4.0 , 0.5 , 0.0 ] , [ 0.0 , 0.5 , 4.0 , 0.2 ] , [ 0.0 , 0.0 , 0.2 , 4.0 ] ] ) #NEWLINE# ab = array ( [ [ 4.0 , 4.0 , 4.0 , 4.0 ] , [ 1.0 , 0.5 , 0.2 , ( - 1.0 ) ] ] ) #NEWLINE# c = cholesky_banded ( ab , lower = True ) #NEWLINE# lfac = zeros_like ( a ) #NEWLINE# lfac [ ( list ( range ( 4 ) ) , list ( range ( 4 ) ) ) ] = c [ 0 ] #NEWLINE# lfac [ ( ( 1 , 2 , 3 ) , ( 0 , 1 , 2 ) ) ] = c [ 1 , : 3 ] #NEWLINE# assert_array_almost_equal ( a , dot ( lfac , lfac . T ) ) #NEWLINE# b = array ( [ 0.0 , 0.5 , 4.2 , 4.2 ] ) #NEWLINE# x = cho_solve_banded ( ( c , True ) , b ) #NEWLINE# assert_array_almost_equal ( x , [ 0.0 , 0.0 , 1.0 , 1.0 ] )