45 #ifndef CLIPPER_FFTMAP 46 #define CLIPPER_FFTMAP 57 typedef float ffttype;
67 enum FFTtype { Default, Measure, Estimate };
92 void init(
const Grid_sampling& grid_sam,
const FFTtype type = Default );
101 bool uniq_reci(
const Coord_grid& c )
const {
return ( (c.
w()>0 && c.
w()<grid_half_.nw()) || (c.
w()<=grid_half_.nw() && ( (c.
v()>0 && c.
v()<grid_half_.nv()) || (c.
v()<=grid_half_.nv() && c.
u()<=grid_half_.nu()) ) ) ); }
104 void fft_h_to_x(
const ftype& scale );
106 void fft_x_to_h(
const ftype& scale );
109 std::complex<ffttype> get_hkl(
const HKL& hkl )
const;
111 void set_hkl(
const HKL& hkl,
const std::complex<ffttype>& f );
114 {
return data_c[ grid_reci_.index( c ) ]; }
117 {
return data_c[ grid_reci_.index( c ) ]; }
120 {
return data_r[ grid_real_.index( c ) ]; }
123 {
return data_r[ grid_real_.index( c ) ]; }
133 enum FFTmode { NONE, RECI, REAL, OTHER };
194 template<
class T>
void get_real_data(
const Coord_grid& c, T& datum )
const;
196 template<
class T>
void set_real_data(
const Coord_grid& c,
const T& datum );
202 {
return real_data(c.
unit(grid_real())); }
205 template<
class H,
class X>
void fft_rfl_to_map(
const H& h, X& x );
207 template<
class H,
class X>
void fft_map_to_rfl(
const X& x, H& h );
238 typename H::HKL_reference_index ih;
239 for ( ih = h.first_data(); !ih.last(); h.next_data( ih ) )
240 set_recip_data( ih.hkl(), h[ih] );
246 typename X::Map_reference_index ix;
247 for ( ix = x.first(); !ix.last(); ix.next() )
248 get_real_data( ix.coord(), x[ix] );
270 typename X::Map_reference_index ix;
271 for ( ix = x.first(); !ix.last(); ix.next() )
272 set_real_data( ix.coord(), x[ix] );
278 typename H::HKL_reference_index ih;
279 for ( ih = h.first(); !ih.last(); ih.next() )
280 get_recip_data( ih.hkl(), h[ih] );
bool uniq_reci(const Coord_grid &c) const
Test whether a coordinate is in the valid part of the recip. grid.
Definition: fftmap.h:101
FFTmap: P1 map with symmetry used for calculating FFTs.
Definition: fftmap.h:165
const ffttype & get_real_data(const Coord_grid &c) const
get real space data (No error checking)
Definition: fftmap.h:201
static Mutex mutex
Thread safety.
Definition: fftmap.h:69
static FFTtype & default_type()
set/get default optimisation type
Definition: fftmap.h:126
Spacegroup spacegroup_
spacegroup
Definition: fftmap.h:213
const ffttype & real_data(const Coord_grid &c) const
get real space data
Definition: fftmap.h:119
Grid coordinate.
Definition: coords.h:236
FFTtype type_
optimisation options
Definition: fftmap.h:136
ffttype & real_data(const Coord_grid &c)
set real space data
Definition: fftmap.h:122
FFTmap_p1: low level P1 map used for calculating FFTs.
Definition: fftmap.h:80
ffttype * data_r
pointer to real data
Definition: fftmap.h:146
generic grid
Definition: coords.h:479
const std::complex< ffttype > & cplx_data(const Coord_grid &c) const
get reciprocal space data
Definition: fftmap.h:113
const Grid_sampling & grid_real() const
Return real space grid.
Definition: fftmap.h:97
Grid_sampling grid_sam_
unit cell grid
Definition: fftmap.h:137
ftype64 ftype
ftype definition for floating point representation
Definition: clipper_precision.h:58
Cell object.
Definition: cell.h:121
Grid grid_real_
real space grid
Definition: fftmap.h:139
Spacegroup object.
Definition: spacegroup.h:172
void fft_rfl_to_map(const H &h, X &x)
calculate map-like object from reflection-like object
Definition: fftmap.h:232
Grid grid_reci_
reciprocal space grid
Definition: fftmap.h:138
Cell cell_
unit cell
Definition: fftmap.h:212
const Grid_sampling & grid_sampling() const
get the cell grid
Definition: fftmap.h:182
void fft_map_to_rfl(const X &x, H &h)
calculate reflection-like object from map-like object
Definition: fftmap.h:264
FFTmap_p1(const FFTmap_p1 &other)
Copy constructor.
Definition: fftmap.h:86
Coord_grid unit(const Grid_sampling &g) const
reduce to unit box: (0..nu-1, 0..nv-1, 0..nw-1)
Definition: coords.h:744
const Grid & grid_reci() const
Return reciprocal space grid (i.e. half real grid + 1 section).
Definition: fftmap.h:99
const Cell & cell() const
get the cell
Definition: fftmap.h:178
std::vector< ffttype > datavec
vector for the data
Definition: fftmap.h:145
Reflection data type: F + phi model or map coeff (e.g. Fcalc, Fbest)
Definition: fftmap.h:61
const int & v() const
get v
Definition: coords.h:249
Mutex class: used for locking and unlocking shared resources.
Definition: clipper_thread.h:64
Grid sampling of a unit cell.
Definition: coords.h:515
static FFTtype default_type_
default optimisation options
Definition: fftmap.h:149
const Spacegroup & spacegroup() const
get the spacegroup
Definition: fftmap.h:180
std::vector< char > req_u
real section lookup
Definition: fftmap.h:143
std::complex< ffttype > * data_c
pointer to complex data
Definition: fftmap.h:147
const int & w() const
get w
Definition: coords.h:250
Matrix< char > req_uv
reci section lookup
Definition: fftmap.h:142
std::complex< ffttype > & cplx_data(const Coord_grid &c)
set reciprocal space data
Definition: fftmap.h:116
std::vector< Isymop > isymop
Integerised symops.
Definition: fftmap.h:214
FFTmode mode
real or reciprocal space?
Definition: fftmap.h:135
const int & u() const
get u
Definition: coords.h:248
reflection 'Miller' index
Definition: coords.h:145
Grid grid_half_
half grid (for marking unique)
Definition: fftmap.h:140