assert ((c8 == 3 * c8dat).all()) del c8 del c8out del c8dat lal.CheckMemoryLeaks() c16 = lal.CreateCOMPLEX16VectorSequence(c16dat.shape[0], c16dat.shape[1]) c16.data = c16dat c16out = lal.CreateCOMPLEX16VectorSequence(c16dat.shape[0], c16dat.shape[1]) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert (lal.swig_lal_test_viewin_COMPLEX16VectorSequence(c16out, c16)) assert ((c16out.data == c16.data).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert (lal.swig_lal_test_viewin_COMPLEX16VectorSequence(c16out, c16dat)) assert ((c16out.data == c16dat).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert (lal.swig_lal_test_viewinout_COMPLEX16VectorSequence(c16out, c16)) assert ((2 * c16out.data == c16.data).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert (lal.swig_lal_test_viewinout_COMPLEX16VectorSequence(c16out, c16dat)) assert ((2 * c16out.data == c16dat).all()) c16.data = c16dat assert (lal.swig_lal_test_copyinout_COMPLEX16VectorSequence(c16)) assert ((c16.data == 3 * c16dat).all()) c16.data = c16dat retn, c16 = lal.swig_lal_test_copyinout_COMPLEX16VectorSequence(c16) assert (retn) assert ((c16.data == 3 * c16dat).all()) c16 = c16dat retn, c16 = lal.swig_lal_test_copyinout_COMPLEX16VectorSequence(c16) assert (retn) assert ((c16 == 3 * c16dat).all())
assert((2 * c8out.data == c8dat).all()) del c8 del c8out del c8dat lal.CheckMemoryLeaks() c16 = lal.CreateCOMPLEX16VectorSequence(c16dat.shape[0], c16dat.shape[1]) c16.data = c16dat c16out = lal.CreateCOMPLEX16VectorSequence(c16dat.shape[0], c16dat.shape[1]) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert(lal.swig_lal_test_viewin_COMPLEX16VectorSequence(c16out, c16)) assert((c16out.data == c16.data).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert(lal.swig_lal_test_viewin_COMPLEX16VectorSequence(c16out, c16dat)) assert((c16out.data == c16dat).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert(lal.swig_lal_test_viewinout_COMPLEX16VectorSequence(c16out, c16)) assert((2 * c16out.data == c16.data).all()) c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert(lal.swig_lal_test_viewinout_COMPLEX16VectorSequence(c16out, c16dat)) assert((2 * c16out.data == c16dat).all()) del c16 del c16out del c16dat lal.CheckMemoryLeaks() print("PASSED input views of array structs (LAL)") vfdat = numpy.array([1.2, 2.3, 3.4, 4.5, 5.6], dtype=numpy.float32) vddat = numpy.array([3.4, 4.5, 5.6, 6.7, 7.8, 8.9], dtype=numpy.float64) vcfdat = numpy.array(numpy.vectorize(complex)(vfdat, 8 + vfdat), dtype=numpy.complex64) vcddat = numpy.array(numpy.vectorize(complex)(vddat, 16 + vddat), dtype=numpy.complex128) vf = lal.gsl_vector_float(len(vfdat)) vf.data = vfdat