Exemplo n.º 1
0
func PlanDft3d(in, out [][][]complex128, dir Direction, flag Flag) *Plan {
	// TODO: check that in and out have the same dimensions
	fftw_in := (*C.fftw_complex)((unsafe.Pointer)(&in[0][0][0]))
	fftw_out := (*C.fftw_complex)((unsafe.Pointer)(&out[0][0][0]))
	p := C.fftw_plan_dft_3d((C.int)(len(in)), (C.int)(len(in[0])), (C.int)(len(in[0][0])), fftw_in, fftw_out, C.int(dir), C.uint(flag))
	return newPlan(p)
}
Exemplo n.º 2
0
func NewPlan3(in, out *Array3, dir Direction, flag Flag) *Plan {
	// TODO: check that in and out have the same dimensions
	n0, n1, n2 := in.Dims()
	var (
		n0_   = C.int(n0)
		n1_   = C.int(n1)
		n2_   = C.int(n2)
		in_   = (*C.fftw_complex)(unsafe.Pointer(in.ptr()))
		out_  = (*C.fftw_complex)(unsafe.Pointer(out.ptr()))
		dir_  = C.int(dir)
		flag_ = C.uint(flag)
	)
	p := C.fftw_plan_dft_3d(n0_, n1_, n2_, in_, out_, dir_, flag_)
	return &Plan{p}
}