예제 #1
0
func PlanDft1d(in, out []complex128, dir Direction, flag Flag) *Plan {
	// TODO: check that len(in) == len(out)
	fftw_in := (*C.fftw_complex)((unsafe.Pointer)(&in[0]))
	fftw_out := (*C.fftw_complex)((unsafe.Pointer)(&out[0]))
	p := C.fftw_plan_dft_1d((C.int)(len(in)), fftw_in, fftw_out, C.int(dir), C.uint(flag))
	return newPlan(p)
}
예제 #2
0
파일: plan.go 프로젝트: jvlmdr/go-fftw
func NewPlan(in, out *Array, dir Direction, flag Flag) *Plan {
	// TODO: check that len(in) == len(out)
	n := in.Len()
	var (
		n_    = C.int(n)
		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_1d(n_, in_, out_, dir_, flag_)
	return &Plan{p}
}