assert ((c16 == 3 * c16dat).all()) del c16 del c16out del c16dat lal.CheckMemoryLeaks() r4dat = numpy.array([[1.2, 2.3, 3.4], [4.5, 5.6, 6.7]], dtype=numpy.float32) r8dat = numpy.array([[3.4, 4.5], [5.6, 6.7], [7.8, 8.9]], dtype=numpy.float64) c8dat = numpy.array(numpy.vectorize(complex)(r4dat, 8 + r4dat), dtype=numpy.complex64) c16dat = numpy.array(numpy.vectorize(complex)(r8dat, 16 + r8dat), dtype=numpy.complex128) r4 = lal.CreateREAL4VectorSequence(r4dat.shape[0], r4dat.shape[1]) r4.data = r4dat r4out = lal.CreateREAL4VectorSequence(r4dat.shape[0], r4dat.shape[1]) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert (lal.swig_lal_test_viewin_REAL4VectorSequence(r4out, r4)) assert ((r4out.data == r4.data).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert (lal.swig_lal_test_viewin_REAL4VectorSequence(r4out, r4dat)) assert ((r4out.data == r4dat).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert (lal.swig_lal_test_viewinout_REAL4VectorSequence(r4out, r4)) assert ((2 * r4out.data == r4.data).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert (lal.swig_lal_test_viewinout_REAL4VectorSequence(r4out, r4dat)) assert ((2 * r4out.data == r4dat).all()) r4.data = r4dat assert (lal.swig_lal_test_copyinout_REAL4VectorSequence(r4)) assert ((r4.data == 3 * r4dat).all()) r4.data = r4dat retn, r4 = lal.swig_lal_test_copyinout_REAL4VectorSequence(r4)
c16out.data = numpy.zeros(numpy.shape(c16dat), dtype=c16dat.dtype) assert(lal.swig_lal_test_viewinout_COMPLEX16Vector(c16out, c16dat)) assert((2 * c16out.data == c16dat).all()) del c16 del c16out del c16dat lal.CheckMemoryLeaks() r4dat = numpy.array([[1.2, 2.3, 3.4], [4.5, 5.6, 6.7]], dtype=numpy.float32) r8dat = numpy.array([[3.4, 4.5], [5.6, 6.7], [7.8, 8.9]], dtype=numpy.float64) c8dat = numpy.array(numpy.vectorize(complex)(r4dat, 8 + r4dat), dtype=numpy.complex64) c16dat = numpy.array(numpy.vectorize(complex)(r8dat, 16 + r8dat), dtype=numpy.complex128) r4 = lal.CreateREAL4VectorSequence(r4dat.shape[0], r4dat.shape[1]) r4.data = r4dat r4out = lal.CreateREAL4VectorSequence(r4dat.shape[0], r4dat.shape[1]) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert(lal.swig_lal_test_viewin_REAL4VectorSequence(r4out, r4)) assert((r4out.data == r4.data).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert(lal.swig_lal_test_viewin_REAL4VectorSequence(r4out, r4dat)) assert((r4out.data == r4dat).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert(lal.swig_lal_test_viewinout_REAL4VectorSequence(r4out, r4)) assert((2 * r4out.data == r4.data).all()) r4out.data = numpy.zeros(numpy.shape(r4dat), dtype=r4dat.dtype) assert(lal.swig_lal_test_viewinout_REAL4VectorSequence(r4out, r4dat)) assert((2 * r4out.data == r4dat).all()) del r4 del r4out del r4dat lal.CheckMemoryLeaks() r8 = lal.CreateREAL8VectorSequence(r8dat.shape[0], r8dat.shape[1])