linalg.tests.test_decomp

Test functions for linalg.decomp module

Module Contents

Functions

assert_dtype_equal(act,des)
symrand(dim_or_eigv) Return a random symmetric (Hermitian) matrix.
random_rot(dim) Return a random rotation matrix, drawn from the Haar distribution
test_eigh()
test_eigh_of_sparse()
_complex_symrand(dim,dtype)
eigenhproblem_standard(desc,dim,dtype,overwrite,lower,turbo,eigenvalues) Solve a standard eigenvalue problem.
eigenhproblem_general(desc,dim,dtype,overwrite,lower,turbo,eigenvalues) Solve a generalized eigenvalue problem.
test_eigh_integer()
_make_pos(X)
test_aligned_mem_float() Check linalg works with non-aligned memory
test_aligned_mem() Check linalg works with non-aligned memory
test_aligned_mem_complex() Check that complex objects don’t need to be completely aligned
check_lapack_misaligned(func,args,kwargs)
test_lapack_misaligned()
_check_orth(n)
test_orth_memory_efficiency()
test_orth()
test_subspace_angles()
assert_dtype_equal(act, des)
symrand(dim_or_eigv)

Return a random symmetric (Hermitian) matrix.

If ‘dim_or_eigv’ is an integer N, return a NxN matrix, with eigenvalues
uniformly distributed on (-1,1).
If ‘dim_or_eigv’ is 1-D real array ‘a’, return a matrix whose
eigenvalues are ‘a’.
random_rot(dim)

Return a random rotation matrix, drawn from the Haar distribution (the only uniform distribution on SO(n)). The algorithm is described in the paper Stewart, G.W., ‘The efficient generation of random orthogonal matrices with an application to condition estimators’, SIAM Journal on Numerical Analysis, 17(3), pp. 403-409, 1980. For more information see http://en.wikipedia.org/wiki/Orthogonal_matrix#Randomization

class TestEigVals
test_simple()
test_simple_tr()
test_simple_complex()
test_finite()
class TestEig
test_simple()
test_simple_complex_eig()
test_simple_complex()
test_gh_3054()
_check_gen_eig(A, B)
test_singular()
test_falker()
test_bad_geneig()
test_make_eigvals()
test_check_finite()
test_not_square_error()

Check that passing a non-square array raises a ValueError.

test_shape_mismatch()

Check that passing arrays of with different shapes raises a ValueError.

class TestEigBanded
setup_method()
create_bandmat()

Create the full matrix self.fullmat and the corresponding band matrix self.bandmat.

test_dsbev()

Compare dsbev eigenvalues and eigenvectors with the result of linalg.eig.

test_dsbevd()

Compare dsbevd eigenvalues and eigenvectors with the result of linalg.eig.

test_dsbevx()

Compare dsbevx eigenvalues and eigenvectors with the result of linalg.eig.

test_zhbevd()

Compare zhbevd eigenvalues and eigenvectors with the result of linalg.eig.

test_zhbevx()

Compare zhbevx eigenvalues and eigenvectors with the result of linalg.eig.

test_eigvals_banded()

Compare eigenvalues of eigvals_banded with those of linalg.eig.

test_eig_banded()

Compare eigenvalues and eigenvectors of eig_banded with those of linalg.eig.

test_dgbtrf()

Compare dgbtrf LU factorisation with the LU factorisation result of linalg.lu.

test_zgbtrf()

Compare zgbtrf LU factorisation with the LU factorisation result of linalg.lu.

test_dgbtrs()

Compare dgbtrs solutions for linear equation system A*x = b with solutions of linalg.solve.

test_zgbtrs()

Compare zgbtrs solutions for linear equation system A*x = b with solutions of linalg.solve.

class TestEigTridiagonal
setup_method()
create_trimat()

Create the full matrix self.fullmat, self.d, and self.e.

test_degenerate()

Test error conditions.

test_eigvalsh_tridiagonal()

Compare eigenvalues of eigvalsh_tridiagonal with those of eig.

test_eigh_tridiagonal()

Compare eigenvalues and eigenvectors of eigh_tridiagonal with those of eig.

test_eigh()
test_eigh_of_sparse()
_complex_symrand(dim, dtype)
eigenhproblem_standard(desc, dim, dtype, overwrite, lower, turbo, eigenvalues)

Solve a standard eigenvalue problem.

eigenhproblem_general(desc, dim, dtype, overwrite, lower, turbo, eigenvalues)

Solve a generalized eigenvalue problem.

test_eigh_integer()
class TestLU
setup_method()
_test_common(data)
test_simple()
test_simple_complex()
test_simple2()
test_simple2_complex()
test_hrectangular()
test_vrectangular()
test_hrectangular_complex()
test_vrectangular_complex()
test_medium1()

Check lu decomposition on medium size, rectangular matrix.

test_medium1_complex()

Check lu decomposition on medium size, rectangular matrix.

test_check_finite()
test_simple_known()
class TestLUSingle

LU testers for single precision, real and double

setup_method()
class TestLUSolve
setup_method()
test_lu()
test_check_finite()
class TestSVD_GESDD
setup_method()
test_degenerate()
test_simple()
test_simple_singular()
test_simple_underdet()
test_simple_overdet()
test_random()
test_simple_complex()
test_random_complex()
test_crash_1580()
test_check_finite()
test_gh_5039()
class TestSVD_GESVD
setup_method()
class TestSVDVals
test_empty()
test_simple()
test_simple_underdet()
test_simple_overdet()
test_simple_complex()
test_simple_underdet_complex()
test_simple_overdet_complex()
test_check_finite()
test_crash_2609()
class TestDiagSVD
test_simple()
class TestQR
setup_method()
test_simple()
test_simple_left()
test_simple_right()
test_simple_pivoting()
test_simple_left_pivoting()
test_simple_right_pivoting()
test_simple_trap()
test_simple_trap_pivoting()
test_simple_tall()
test_simple_tall_pivoting()
test_simple_tall_e()
test_simple_tall_e_pivoting()
test_simple_tall_left()
test_simple_tall_left_pivoting()
test_simple_tall_right()
test_simple_tall_right_pivoting()
test_simple_fat()
test_simple_fat_pivoting()
test_simple_fat_e()
test_simple_fat_e_pivoting()
test_simple_fat_left()
test_simple_fat_left_pivoting()
test_simple_fat_right()
test_simple_fat_right_pivoting()
test_simple_complex()
test_simple_complex_left()
test_simple_complex_right()
test_simple_tall_complex_left()
test_simple_complex_left_conjugate()
test_simple_complex_tall_left_conjugate()
test_simple_complex_right_conjugate()
test_simple_complex_pivoting()
test_simple_complex_left_pivoting()
test_simple_complex_right_pivoting()
test_random()
test_random_left()
test_random_right()
test_random_pivoting()
test_random_tall()
test_random_tall_left()
test_random_tall_right()
test_random_tall_pivoting()
test_random_tall_e()
test_random_tall_e_pivoting()
test_random_trap()
test_random_trap_pivoting()
test_random_complex()
test_random_complex_left()
test_random_complex_right()
test_random_complex_pivoting()
test_check_finite()
test_lwork()
class TestRQ
setup_method()
test_simple()
test_r()
test_random()
test_simple_trap()
test_simple_tall()
test_simple_fat()
test_simple_complex()
test_random_tall()
test_random_trap()
test_random_trap_economic()
test_random_complex()
test_random_complex_economic()
test_check_finite()
class TestSchur
test_simple()
test_sort()
test_sort_errors()
test_check_finite()
class TestHessenberg
test_simple()
test_simple_complex()
test_simple2()
test_simple3()
test_random()
test_random_complex()
test_check_finite()
test_2x2()
class TestQZ
setup_method()
test_qz_single()
test_qz_double()
test_qz_complex()
test_qz_complex64()
test_qz_double_complex()
test_qz_double_sort()
test_check_finite()
_make_pos(X)
class TestOrdQZ
setup_class()
qz_decomp(sort)
check(A, B, sort, AA, BB, alpha, beta, Q, Z)
check_all(sort)
test_lhp()
test_rhp()
test_iuc()
test_ouc()
test_ref()
test_cef()
test_diff_input_types()
test_sort_explicit()
class TestOrdQZWorkspaceSize
setup_method()
test_decompose()
test_decompose_ouc()
class TestDatacopied
test_datacopied()
test_aligned_mem_float()

Check linalg works with non-aligned memory

test_aligned_mem()

Check linalg works with non-aligned memory

test_aligned_mem_complex()

Check that complex objects don’t need to be completely aligned

check_lapack_misaligned(func, args, kwargs)
test_lapack_misaligned()
class TestOverwrite
test_eig()
test_eigh()
test_eig_banded()
test_eigvals()
test_eigvalsh()
test_eigvals_banded()
test_hessenberg()
test_lu_factor()
test_lu_solve()
test_lu()
test_qr()
test_rq()
test_schur()
test_schur_complex()
test_svd()
test_svdvals()
_check_orth(n)
test_orth_memory_efficiency()
test_orth()
test_subspace_angles()