Beispiel #1
0
def function2():
    a = numpy.random.rand(100, 200)
    covmat = numpy.dot(a, a.T) / 100 ** 2
    a = sqrtm(covmat)
    b = invsqrtm(covmat)
    c = expm(covmat)
    d = logm(covmat)
    e = powm(covmat, 2)
Beispiel #2
0
def function2():
    a = numpy.random.rand(100, 200)
    covmat = numpy.dot(a, a.T) / 100**2
    a = sqrtm(covmat)
    b = invsqrtm(covmat)
    c = expm(covmat)
    d = logm(covmat)
    e = powm(covmat, 2)
Beispiel #3
0
def test_invsqrtm():
    numpy_array = numpy.array([[2, 1, 0], [1, 2, 0], [0, 0, 3]])
    if (CovMat(numpy_array).invsqrtm -
            CovMat(invsqrtm(numpy_array))).norm() < 1e-10:
        print("invsqrtm: PASS")
        return True
    else:
        print("invsqrtm: FAIL")
        return False