Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFTW preset, fftwf_iodim and fftwf_iodim64 missing array allocators #523

Closed
hageldave opened this issue Feb 7, 2018 · 4 comments
Closed
Labels

Comments

@hageldave
Copy link

Hello, I previously reported missing definitions of fftw_iodim struct in #466 which was already fixed.
Now I just noticed that the float version of this class does not provide the same interface.

Here is the definition of fftw_iodim:

@Name("fftw_iodim_do_not_use_me") public static class fftw_iodim extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public fftw_iodim() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public fftw_iodim(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public fftw_iodim(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public fftw_iodim position(long position) {
        return (fftw_iodim)super.position(position);
    }

     public native int n(); public native fftw_iodim n(int n);                     /* dimension size */
     public native int is(); public native fftw_iodim is(int is);			/* input stride */
     public native int os(); public native fftw_iodim os(int os);			/* output stride */
}

and here the definition of fftwf_iodim:

@Opaque public static class fftwf_iodim extends Pointer {
    /** Empty constructor. Calls {@code super((Pointer)null)}. */
    public fftwf_iodim() { super((Pointer)null); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public fftwf_iodim(Pointer p) { super(p); }
}

I think there's something missing but I could be wrong and maybe there is another way of using the fftwf_iodim class to allocate an array of it and set n, is, os.

@saudet saudet added the bug label Feb 7, 2018
@saudet
Copy link
Member

saudet commented Feb 7, 2018

Yes, they are missing, but they are just typedefs of the same struct. I'll make the necessary changes later today. Thanks for reporting!

@saudet
Copy link
Member

saudet commented Feb 7, 2018

For now, we can do something like this:

fftw_iodim dims = new fftw_iodim(n);
// ...
fftwf_iodim fdims = new fftwf_iodim(dims);

@hageldave
Copy link
Author

nice, pretty fast support on here :)

@saudet
Copy link
Member

saudet commented Apr 9, 2018

FYI, released with version 1.4.1. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants