Commit 505b3ab6 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'integration_operator' of gitlab.mpcdf.mpg.de:ift/nifty into integration_operator

parents 40a9d52f cba6ac90
Pipeline #75197 passed with stages
in 25 minutes and 10 seconds
......@@ -24,25 +24,25 @@ from ..common import setup_function, teardown_function
def test_integration_operator():
x1 = ift.RGSpace((9,), distances= 2.) # FIXME: it works for distances = 1
#x2 = ift.RGSpace((2, 12), distances=(0.3,))
x1 = ift.RGSpace((9,), distances= 2.)
x2 = ift.RGSpace((2, 12), distances=(0.3,))
dom1 = ift.makeDomain(x1)
#dom2 = ift.makeDomain((x1, x2))
dom2 = ift.makeDomain((x1, x2))
f1 = ift.from_random('normal', dom1)
#f2 = ift.from_random('normal', dom2)
f2 = ift.from_random('normal', dom2)
op1 = ift.ScalingOperator(dom1, 1)
#op2 = ift.ScalingOperator(dom2, 1)
op2 = ift.ScalingOperator(dom2, 1)
res1 = f1.integrate()
res2 = op1.integrate()(f1)
assert_allclose(res1.val, res2.val)
# res3 = f2.integrate()
# res4 = op2.integrate()(f2)
# assert_allclose(res3.val, res4.val)
# res5 = f2.integrate(spaces=1)
# res6 = op2.integrate(spaces=1)(f)
# assert_allclose(res5.val, res6.val)
# for op in [op1, op2]:
# ift.extra.consistency_check(op, domain_dtype=np.float64,
# target_dtype=np.float64)
# ift.extra.consistency_check(op, domain_dtype=np.complex128,
# target_dtype=np.compley128)
res3 = f2.integrate()
res4 = op2.integrate()(f2)
assert_allclose(res3.val, res4.val)
res5 = f2.integrate(spaces=1)
res6 = op2.integrate(spaces=1)(f2)
assert_allclose(res5.val, res6.val)
for op in [op1, op2]:
ift.extra.consistency_check(op, domain_dtype=np.float64,
target_dtype=np.float64)
ift.extra.consistency_check(op, domain_dtype=np.complex128,
target_dtype=np.complex128)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment