45 #ifndef CLIPPER_HKL_DATA
46 #define CLIPPER_HKL_DATA
61 Key(
const Spgr_descr& spgr_descr,
const Cell& cell_descr,
const HKL_sampling& hkl_sam ) : spgr_descr_(spgr_descr), cell_descr_(cell_descr), hkl_sampling_(hkl_sam) {}
62 const Spgr_descr& spgr_descr()
const {
return spgr_descr_; }
63 const Cell_descr& cell_descr()
const {
return cell_descr_; }
64 const HKL_sampling& hkl_sampling()
const {
return hkl_sampling_; }
72 bool matches(
const Key& hkl_data_cachekey )
const;
180 virtual void update() = 0;
184 virtual bool missing(
const int& index)
const = 0;
186 virtual void set_null(
const int& index) = 0;
209 const Cell* parent_cell;
210 bool cell_matches_parent;
259 bool missing(
const int& index)
const {
return list[index].missing(); }
260 void set_null(
const int& index) { list[index].set_null(); }
264 { T datum;
get_data( hkl, datum ); datum.data_export( array ); }
266 { T datum; datum.data_import( array );
set_data( hkl, datum ); }
272 {
return list[i.index()]; }
275 {
return list[i.index()]; }
287 const T&
operator[] (
const int& index)
const {
return list[index]; }
355 init( hkl_info, cell );
364 init( spacegroup, cell, hkl_sampling );
408 if ( parent_hkl_info != NULL ) {
409 T null; null.set_null();
410 list.resize( parent_hkl_info->num_reflections(), null );
420 T null; null.set_null();
421 for (
int i = 0; i < list.size(); i++ )
422 if ( mask.
missing(i) ) list[i] = null;
432 if ( ih.index() < 0 ) { T null; null.set_null();
return null; }
433 T data = list[ih.index()];
434 if ( ih.
friedel() ) data.friedel();
447 if ( ih.index() < 0 ) { data.set_null();
return false; }
448 data = list[ih.index()];
449 if ( ih.
friedel() ) data.friedel();
462 if ( ih.index() < 0 )
return false;
463 T& ldata = list[ih.index()];
466 if ( ih.
friedel() ) ldata.friedel();
477 int index, sym;
bool friedel;
479 index = parent_hkl_info->index_of( parent_hkl_info->
481 if ( index < 0 ) { T null; null.set_null();
return null; }
482 T data = list[index];
483 if (friedel) data.friedel();
484 data.shift_phase( -hkl.
sym_phase_shift( parent_hkl_info->spacegroup().symop(sym) ) );
496 int index, sym;
bool friedel;
498 index = parent_hkl_info->index_of( parent_hkl_info->
500 if ( index < 0 ) { data.set_null();
return false; }
502 if (friedel) data.friedel();
503 data.shift_phase( -hkl.
sym_phase_shift(parent_hkl_info->spacegroup().symop(sym)) );
515 int index, sym;
bool friedel;
516 index = parent_hkl_info->index_of( parent_hkl_info->
518 if ( index < 0 ) {
return false; }
519 T& ldata = list[index];
521 ldata.shift_phase( hkl.
sym_phase_shift(parent_hkl_info->spacegroup().symop(sym)) );
522 if (friedel) ldata.friedel();
536 if ( parent_hkl_info == NULL ) {
539 if ( parent_hkl_info != other.parent_hkl_info )
551 for (
int i = 0; i < list.size(); i++ ) list[i] = value;
558 HKL_data_base::debug();
559 std::cout <<
"Size " << list.size() <<
"\n";