retn, mcf = lal.swig_lal_test_copyinout_gsl_matrix_complex_float(mcf) assert (retn) assert ((mcf.data == 3 * mcfdat).all()) mcf = mcfdat retn, mcf = lal.swig_lal_test_copyinout_gsl_matrix_complex_float(mcf) assert (retn) assert ((mcf == 3 * mcfdat).all()) del mcf del mcfout del mcfdat lal.CheckMemoryLeaks() mcd = lal.gsl_matrix_complex(mcddat.shape[0], mcddat.shape[1]) mcd.data = mcddat mcdout = lal.gsl_matrix_complex(mcddat.shape[0], mcddat.shape[1]) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert (lal.swig_lal_test_viewin_gsl_matrix_complex(mcdout, mcd)) assert ((mcdout.data == mcd.data).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert (lal.swig_lal_test_viewin_gsl_matrix_complex(mcdout, mcddat)) assert ((mcdout.data == mcddat).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert (lal.swig_lal_test_viewinout_gsl_matrix_complex(mcdout, mcd)) assert ((2 * mcdout.data == mcd.data).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert (lal.swig_lal_test_viewinout_gsl_matrix_complex(mcdout, mcddat)) assert ((2 * mcdout.data == mcddat).all()) mcd.data = mcddat assert (lal.swig_lal_test_copyinout_gsl_matrix_complex(mcd)) assert ((mcd.data == 3 * mcddat).all()) mcd.data = mcddat retn, mcd = lal.swig_lal_test_copyinout_gsl_matrix_complex(mcd)
assert((mcfout.data == mcfdat).all()) mcfout.data = numpy.zeros(numpy.shape(mcfdat), dtype=mcfdat.dtype) assert(lal.swig_lal_test_viewinout_gsl_matrix_complex_float(mcfout, mcf)) assert((2 * mcfout.data == mcf.data).all()) mcfout.data = numpy.zeros(numpy.shape(mcfdat), dtype=mcfdat.dtype) assert(lal.swig_lal_test_viewinout_gsl_matrix_complex_float(mcfout, mcfdat)) assert((2 * mcfout.data == mcfdat).all()) del mcf del mcfout del mcfdat lal.CheckMemoryLeaks() mcd = lal.gsl_matrix_complex(mcddat.shape[0], mcddat.shape[1]) mcd.data = mcddat mcdout = lal.gsl_matrix_complex(mcddat.shape[0], mcddat.shape[1]) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert(lal.swig_lal_test_viewin_gsl_matrix_complex(mcdout, mcd)) assert((mcdout.data == mcd.data).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert(lal.swig_lal_test_viewin_gsl_matrix_complex(mcdout, mcddat)) assert((mcdout.data == mcddat).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert(lal.swig_lal_test_viewinout_gsl_matrix_complex(mcdout, mcd)) assert((2 * mcdout.data == mcd.data).all()) mcdout.data = numpy.zeros(numpy.shape(mcddat), dtype=mcddat.dtype) assert(lal.swig_lal_test_viewinout_gsl_matrix_complex(mcdout, mcddat)) assert((2 * mcdout.data == mcddat).all()) del mcd del mcdout del mcddat lal.CheckMemoryLeaks() print("PASSED input views of array structs (GSL)")