Example #1
0
def test_eigh_Z():
    ## Test the Cholesky decomposition of a double precision complex matrix (use the
    ## non-default, lower half)

    ns = 342

    gA = np.random.standard_normal((ns, ns)).astype(np.float64)
    gA = gA + 1.0J * np.random.standard_normal((ns, ns)).astype(np.float64)
    gA = np.dot(gA, gA.T.conj())  # Make positive definite
    gA = np.asfortranarray(gA)

    dA = core.DistributedMatrix.from_global_array(gA, rank=0)

    dU = rt.cholesky(dA, lower=True)
    gUd = dU.to_global_array(rank=0)

    if rank == 0:
        gUn = la.cholesky(gA, lower=True)

        assert allclose(gUn, gUd)
Example #2
0
def test_cholesky_D():
    ## Test the Cholesky decomposition of a double precision matrix (use the
    ## default, upper half)
    ns = 317

    gA = np.random.standard_normal((ns, ns)).astype(np.float64)
    gA = np.dot(gA, gA.T)  # Make positive definite
    gA = np.asfortranarray(gA)

    dA = core.DistributedMatrix.from_global_array(gA, rank=0)

    dU = rt.cholesky(dA)
    gUd = dU.to_global_array(rank=0)

    if rank == 0:
        gUn = la.cholesky(gA)

        print(gUn)
        print(gUd)
        assert allclose(gUn, gUd)