planner (Fast-Fourier Transform)


Import

#include <archr/fft/fft.h>
#include <archr/fft/fft.hpp>
use archr_fft
import archr.fft
atomsLoads('archr')

Synopsis

typedef enum {
  archr_fft_planner_direction_Forward,
  archr_fft_planner_direction_Reverse,
} archr_fft_planner_direction_t;
(1)
typedef struct { void* data; } archr_fft_planner_f32_t;
(2)
typedef struct { void* data; } archr_fft_planner_r2c_f32_t;
(3)
typedef struct { void* data; } archr_fft_planner_r2c_2d_f32_t;
(4)
typedef struct { void* data; } archr_fft_planner_r2c_3d_f32_t;
(5)
typedef struct { void* data; } archr_fft_planner_c2r_f32_t;
(6)
typedef struct { void* data; } archr_fft_planner_f64_t;
(7)
typedef struct { void* data; } archr_fft_planner_r2c_f64_t;
(8)
typedef struct { void* data; } archr_fft_planner_r2c_2d_f64_t;
(9)
typedef struct { void* data; } archr_fft_planner_r2c_3d_f64_t;
(10)
typedef struct { void* data; } archr_fft_planner_c2r_f64_t;
(11)
typedef struct { void* data; } archr_fft_planner_2d_f32_t;
(12)
typedef struct { void* data; } archr_fft_planner_3d_f32_t;
(13)
typedef struct { void* data; } archr_fft_planner_2d_f64_t;
(14)
typedef struct { void* data; } archr_fft_planner_3d_f64_t;
(15)
typedef struct { void* data; } archr_fft_planner_zf32_t;
(16)
typedef struct { void* data; } archr_fft_planner_zf64_t;
(17)
typedef struct { void* data; } archr_fft_planner_2d_zf32_t;
(18)
typedef struct { void* data; } archr_fft_planner_3d_zf32_t;
(19)
typedef struct { void* data; } archr_fft_planner_2d_zf64_t;
(20)
typedef struct { void* data; } archr_fft_planner_3d_zf64_t;
(21)
int archr_fft_init_planner_f32(archr_fft_planner_f32_t *p, size_t n, archr_fft_planner_direction_t d);
(22)
int archr_fft_init_planner_f64(archr_fft_planner_f64_t *p, size_t n, archr_fft_planner_direction_t d);
(23)
int archr_fft_init_planner_r2c_f32(archr_fft_planner_r2c_f32_t *p, size_t n, archr_fft_planner_direction_t d);
(24)
int archr_fft_init_planner_r2c_f64(archr_fft_planner_r2c_f64_t *p, size_t n, archr_fft_planner_direction_t d);
(25)
int archr_fft_init_planner_r2c_2d_f32(archr_fft_planner_r2c_2d_f32_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(26)
int archr_fft_init_planner_r2c_2d_f64(archr_fft_planner_r2c_2d_f64_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(27)
int archr_fft_init_planner_r2c_3d_f32(archr_fft_planner_r2c_3d_f32_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(28)
int archr_fft_init_planner_r2c_3d_f64(archr_fft_planner_r2c_3d_f64_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(29)
int archr_fft_init_planner_c2r_f32(archr_fft_planner_c2r_f32_t *p, size_t n, archr_fft_planner_direction_t d);
(30)
int archr_fft_init_planner_c2r_f64(archr_fft_planner_c2r_f64_t *p, size_t n, archr_fft_planner_direction_t d);
(31)
int archr_fft_init_planner_f32_2d(archr_fft_planner_2d_f32_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(32)
int archr_fft_init_planner_f64_2d(archr_fft_planner_2d_f64_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(33)
int archr_fft_init_planner_zf32_2d(archr_fft_planner_2d_zf32_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(34)
int archr_fft_init_planner_zf64_2d(archr_fft_planner_2d_zf64_t *p, size_t height, size_t width, archr_fft_planner_direction_t d);
(35)
int archr_fft_init_planner_f32_3d(archr_fft_planner_3d_f32_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(36)
int archr_fft_init_planner_f64_3d(archr_fft_planner_3d_f64_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(37)
int archr_fft_init_planner_zf32_3d(archr_fft_planner_3d_zf32_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(38)
int archr_fft_init_planner_zf64_3d(archr_fft_planner_3d_zf64_t *p, size_t height, size_t width, size_t depth, archr_fft_planner_direction_t d);
(39)
int archr_fft_init_planner_zf32(archr_fft_planner_zf32_t *p, size_t n, archr_fft_planner_direction_t d);
(40)
int archr_fft_init_planner_zf64(archr_fft_planner_zf64_t *p, size_t n, archr_fft_planner_direction_t d);
(41)
int archr_fft_destroy_planner_f32(archr_fft_planner_f32_t *p);
(42)
int archr_fft_destroy_planner_f64(archr_fft_planner_f64_t *p);
(43)
int archr_fft_destroy_planner_zf32(archr_fft_planner_zf32_t *p);
(44)
int archr_fft_destroy_planner_zf64(archr_fft_planner_zf64_t *p);
(45)
int archr_fft_destroy_planner_r2c_f32(archr_fft_planner_r2c_f32_t *p);
(46)
int archr_fft_destroy_planner_r2c_f64(archr_fft_planner_r2c_f64_t *p);
(47)
int archr_fft_destroy_planner_c2r_f32(archr_fft_planner_c2r_f32_t *p);
(48)
int archr_fft_destroy_planner_c2r_f64(archr_fft_planner_c2r_f64_t *p);
(49)
int archr_fft_destroy_planner_2d_f32(archr_fft_planner_2d_f32_t *p);
(50)
int archr_fft_destroy_planner_2d_f64(archr_fft_planner_2d_f64_t *p);
(51)
int archr_fft_destroy_planner_2d_zf32(archr_fft_planner_2d_zf32_t *p);
(52)
int archr_fft_destroy_planner_2d_zf64(archr_fft_planner_2d_zf64_t *p);
(53)
int archr_fft_destroy_planner_2d_r2c_f32(archr_fft_planner_2d_zf32_t *p);
(54)
int archr_fft_destroy_planner_2d_r2c_f64(archr_fft_planner_2d_zf64_t *p);
(55)
int archr_fft_destroy_planner_r2c_2d_f32(archr_fft_planner_r2c_2d_f32_t *p);
(56)
int archr_fft_destroy_planner_r2c_2d_f64(archr_fft_planner_r2c_2d_f64_t *p);
(57)
int archr_fft_destroy_planner_3d_f32(archr_fft_planner_3d_f32_t *p);
(58)
int archr_fft_destroy_planner_3d_f64(archr_fft_planner_3d_f64_t *p);
(59)
int archr_fft_destroy_planner_3d_zf32(archr_fft_planner_3d_zf32_t *p);
(60)
int archr_fft_destroy_planner_3d_zf64(archr_fft_planner_3d_zf64_t *p);
(61)
int archr_fft_destroy_planner_r2c_3d_f32(archr_fft_planner_r2c_3d_f32_t *p);
(62)
int archr_fft_destroy_planner_r2c_3d_f64(archr_fft_planner_r2c_3d_f64_t *p);
(63)
int archr_fft_destroy_planner_zf32(archr_fft_planner_zf32_t *p);
(64)
int archr_fft_destroy_planner_zf64(archr_fft_planner_zf64_t *p);
(65)
namespace archr {
enum planner_direction_t {
  Forward,
  Reverse,
};
(1)
template <typename T>
class planner {
  public:
  void* data;

  public:
  planner(size_t n, planner_direction_t);
  ~planner();

  private:
  planner(planner const&);
};
(2)
template <typename T>
class planner_2d {
  public:
  void* data;

  public:
  planner_2d(size_t h, size_t w, planner_direction_t);
  ~planner_2d();

  private:
  planner_2d(planner_2d const&);
};
(3)
template <typename T>
class planner_3d {
  public:
  void* data;

  public:
  planner_3d(size_t h, size_t w, size_t d, planner_direction_t);
  ~planner_3d();

  private:
  planner_3d(planner_3d const&);
};
(4)
template <typename T>
class r2c_planner {
  public:
  void* data;

  public:
  r2c_planner(size_t n, planner_direction_t);
  ~r2c_planner();

  private:
  r2c_planner(r2c_planner const&);
};
(5)
template <typename T>
class r2c_planner_2d {
  public:
  void* data;

  public:
  r2c_planner_2d(size_t height, size_t width, planner_direction_t);
  ~r2c_planner_2d();

  private:
  r2c_planner_2d(r2c_planner_2d const&);
};
(6)
template <typename T>
class r2c_planner_3d {
  public:
  void* data;

  public:
  r2c_planner_3d(size_t height, size_t width, size_t depth, planner_direction_t);
  ~r2c_planner_3d();

  private:
  r2c_planner_3d(r2c_planner_3d const&);
};
(7)
template <typename T>
class c2r_planner {
  public:
  void* data;

  public:
  c2r_planner(size_t n, planner_direction_t);
  ~c2r_planner();

  private:
  c2r_planner(c2r_planner const&);
};
(8)
}
subroutine archr_fft_init_planner_f32(type(archr_fft_planner_f32) :: plan, integer(8) size, integer(8) direction)
(1)
subroutine archr_fft_init_planner_f64(type(archr_fft_planner_f64) :: plan, integer(8) size, integer(8) direction)
(2)
subroutine archr_fft_init_planner_2d_f32(type(archr_fft_planner_2d_f32) :: plan, integer(8) height, integer(8) width, integer(8) direction)
(3)
subroutine archr_fft_init_planner_2d_f64(type(archr_fft_planner_2d_f64) :: plan, integer(8) height, integer(8) width, integer(8) direction)
(4)
subroutine archr_fft_init_planner_3d_f32(type(archr_fft_planner_3d_f32) :: plan, integer(8) height, integer(8) width, integer(8) depth, integer(8) direction)
(5)
subroutine archr_fft_init_planner_3d_f64(type(archr_fft_planner_3d_f64) :: plan, integer(8) height, integer(8) width, integer(8) depth, integer(8) direction)
(6)
subroutine archr_fft_destroy_planner_f32(type(archr_fft_planner_f32) :: plan)
(7)
subroutine archr_fft_destroy_planner_f64(type(archr_fft_planner_f64) :: plan)
(8)
subroutine archr_fft_destroy_planner_2d_f32(type(archr_fft_planner_2d_f32) :: plan)
(9)
subroutine archr_fft_destroy_planner_2d_f64(type(archr_fft_planner_2d_f64) :: plan)
(10)
module archr_fft
    type archr_fft_planner_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_c2r_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_c2r_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_zf32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_zf64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_2d_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_2d_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_2d_zf32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_2d_zf64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_2d_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_2d_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_3d_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_3d_f64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_3d_zf32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_3d_zf64
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_3d_f32
        integer(8) :: ptr;
    end type

    type archr_fft_planner_r2c_3d_f64
        integer(8) :: ptr;
    end type

    integer :: archr_fft_planner_direction_Forward = 0;
    integer :: archr_fft_planner_direction_Reverse = 1;
end module
(11)
function p = archr_fft_planner2_zf64(h, w)
(1)
function p = archr_fft_planner_zf64(sz)
(2)

Description

The first step in using Arch-R FFT is to create a plan. A plan is an object containing all of the data required to calculate an fft or an inverse fft. Once the plan has been created, it may be used as many times as required on different data for forward or inverse transforms of the same size.

When the plan is no longer required, it should be de-allocated using the destroy function. This prevents a memory leak.