| 27 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 28 |
# include <omp.h> |
# include <omp.h> |
| 29 |
#endif |
#endif |
|
#include "utility_data_structure/index_set.hh" |
|
| 30 |
#include "utility_func/chToDouble.hh" |
#include "utility_func/chToDouble.hh" |
| 31 |
#include "utility_func/transform_sym_matrix.hh" |
#include "utility_func/transform_sym_matrix.hh" |
| 32 |
#include "utility_lattice_reduction/super_basis3.hh" |
#include "utility_lattice_reduction/put_Selling_reduced_lattice.hh" |
| 33 |
#include "lattice_symmetry/LatticeFigureOfMeritToCheckSymmetry.hh" |
#include "lattice_symmetry/VCLatticeFigureOfMeritToCheckSymmetry.hh" |
|
#include "lattice_symmetry/ReducedLatticeToCheckBravais.hh" |
|
| 34 |
#include "lattice_symmetry/ReducedLatticeToCheckEquiv.hh" |
#include "lattice_symmetry/ReducedLatticeToCheckEquiv.hh" |
|
#include "p_out_indexing.hh" |
|
| 35 |
#include "zerror_type/error_out.hh" |
#include "zerror_type/error_out.hh" |
| 36 |
#include "zlog/zlog.hh" |
#include "zlog/zlog.hh" |
| 37 |
#include "ControlParam.hh" |
#include "ControlParam.hh" |
|
#include "SortingLattice.hh" |
|
| 38 |
#include "utility_func/stopx.hh" |
#include "utility_func/stopx.hh" |
| 39 |
|
#include "SortingLattice.hh" |
| 40 |
|
|
| 41 |
const bool SortingLattice::m_DoesPrudentSymSearch = false; |
const bool SortingLattice::m_DoesPrudentSymSearch = false; |
| 42 |
const Double SortingLattice::m_cv2 = 0.5; |
const Double SortingLattice::m_cv2 = 0.5; |
| 43 |
|
|
| 44 |
SortingLattice::SortingLattice() |
SortingLattice::SortingLattice() |
| 45 |
{ |
{ |
| 46 |
for(ArrayIndex i=0; i<NUM_LS; i++) |
for(Int4 i=0; i<NUM_LS; i++) |
| 47 |
{ |
{ |
| 48 |
OutputSymmetry[i] = false; |
OutputSymmetry[i] = false; |
| 49 |
JudgeSymmetry[i] = false; |
JudgeSymmetry[i] = false; |
| 50 |
} |
} |
| 51 |
|
|
| 52 |
m_resol2 = 0.0; |
m_resol = 0.0; |
| 53 |
m_num_ref_figure_of_merit = 20; |
m_num_ref_figure_of_merit = 20; |
| 54 |
m_etype_peak_shift = kPeakShiftFunction_Type0; |
m_etype_peak_shift = kPeakShiftFunction_Type0; |
| 55 |
m_WlengthX = 1.54056; |
m_WlengthX = 1.54056; |
| 62 |
|
|
| 63 |
|
|
| 64 |
// Set the member variables. |
// Set the member variables. |
| 65 |
void SortingLattice::setParam(const ControlParam& cont) |
void SortingLattice::setParam(const ControlParam& cont) |
| 66 |
{ |
{ |
| 67 |
OutputSymmetry[(Int4)Triclinic] = cont.putOutputSymmetry(Triclinic); |
OutputSymmetry[(size_t)Triclinic] = cont.putOutputSymmetry(Triclinic); |
| 68 |
JudgeSymmetry[(Int4)Triclinic] = false; |
JudgeSymmetry[(size_t)Triclinic] = false; |
| 69 |
for(ArrayIndex i=1; i<NUM_LS; i++) |
for(Int4 i=1; i<NUM_LS; i++) |
| 70 |
{ |
{ |
| 71 |
OutputSymmetry[i] = cont.putOutputSymmetry(eCrystalSystem(i)); |
OutputSymmetry[i] = cont.putOutputSymmetry(eBravaisType(i)); |
| 72 |
JudgeSymmetry[i] = cont.putOutputSymmetry(eCrystalSystem(i)); |
JudgeSymmetry[i] = cont.putOutputSymmetry(eBravaisType(i)); |
| 73 |
} |
} |
| 74 |
|
|
| 75 |
if( JudgeSymmetry[(Int4)Cubic_P] ) |
if( JudgeSymmetry[(size_t)Cubic_P] ) |
| 76 |
{ |
{ |
| 77 |
JudgeSymmetry[(Int4)Tetragonal_P] = true; |
JudgeSymmetry[(size_t)Tetragonal_P] = true; |
| 78 |
} |
} |
| 79 |
if( JudgeSymmetry[(Int4)Hexagonal] ) |
if( JudgeSymmetry[(size_t)Hexagonal] ) |
| 80 |
{ |
{ |
| 81 |
JudgeSymmetry[(Int4)Monoclinic_P] = true; |
JudgeSymmetry[(size_t)Monoclinic_P] = true; |
| 82 |
} |
} |
| 83 |
if( JudgeSymmetry[(Int4)Tetragonal_P] ) |
if( JudgeSymmetry[(size_t)Tetragonal_P] ) |
| 84 |
{ |
{ |
| 85 |
JudgeSymmetry[(Int4)Orthorhombic_P] = true; |
JudgeSymmetry[(size_t)Orthorhombic_P] = true; |
| 86 |
} |
} |
| 87 |
if( JudgeSymmetry[(Int4)Orthorhombic_P] ) |
if( JudgeSymmetry[(size_t)Orthorhombic_P] ) |
| 88 |
{ |
{ |
| 89 |
JudgeSymmetry[(Int4)Monoclinic_P] = true; |
JudgeSymmetry[(size_t)Monoclinic_P] = true; |
| 90 |
} |
} |
| 91 |
|
|
| 92 |
if( JudgeSymmetry[(Int4)Orthorhombic_C] ) |
if( JudgeSymmetry[(size_t)Orthorhombic_C] ) |
| 93 |
{ |
{ |
| 94 |
JudgeSymmetry[(Int4)Monoclinic_B] = true; |
JudgeSymmetry[(size_t)Monoclinic_B] = true; |
| 95 |
} |
} |
| 96 |
|
|
| 97 |
if( JudgeSymmetry[(Int4)Cubic_I] ) |
if( JudgeSymmetry[(size_t)Cubic_I] ) |
| 98 |
{ |
{ |
| 99 |
JudgeSymmetry[(Int4)Tetragonal_I] = true; |
JudgeSymmetry[(size_t)Tetragonal_I] = true; |
| 100 |
} |
} |
| 101 |
if( JudgeSymmetry[(Int4)Tetragonal_I] ) |
if( JudgeSymmetry[(size_t)Tetragonal_I] ) |
| 102 |
{ |
{ |
| 103 |
JudgeSymmetry[(Int4)Orthorhombic_I] = true; |
JudgeSymmetry[(size_t)Orthorhombic_I] = true; |
| 104 |
} |
} |
| 105 |
|
|
| 106 |
if( JudgeSymmetry[(Int4)Cubic_F] ) |
if( JudgeSymmetry[(size_t)Cubic_F] ) |
| 107 |
{ |
{ |
| 108 |
JudgeSymmetry[(Int4)Orthorhombic_F] = true; |
JudgeSymmetry[(size_t)Orthorhombic_F] = true; |
| 109 |
} |
} |
| 110 |
|
|
| 111 |
m_resol2 = cont.putResolution() * 2.0; |
m_resol = cont.putResolution(); |
| 112 |
m_num_ref_figure_of_merit = cont.putNumberOfReflectionsForFigureOfMerit(); |
m_num_ref_figure_of_merit = cont.putNumberOfReflectionsForFigureOfMerit(); |
| 113 |
m_etype_peak_shift = cont.putPeakShiftFunctionType(); |
m_etype_peak_shift = cont.putPeakShiftFunctionType(); |
| 114 |
m_WlengthX = cont.putWaveLength(); |
m_WlengthX = cont.putWaveLength(); |
| 126 |
} |
} |
| 127 |
|
|
| 128 |
|
|
|
void SortingLattice::putLatticeFigureOfMerit(const LatticeFigureOfMeritToCheckSymmetry& lattice_original, |
|
|
const ePointGroup& epg, const Double& cv2, |
|
|
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result) const |
|
|
{ |
|
|
lattice_result.clear(); |
|
|
map< SymMat<VCData>, NRMat<Int4> > S_red_tray; |
|
|
if( !lattice_original.checkLatticeSymmetry(epg, cv2, S_red_tray) ) return; |
|
|
|
|
|
const BravaisType& ebrat_original = lattice_original.putLatticeFigureOfMerit().putBravaisType(); |
|
|
const eBravaisLattice eblat = (ebrat_original.enumCrystalSystem()==Monoclinic_B? |
|
|
(epg==D31d_rho?Prim:(epg==D3d_1_hex?Rhom_hex:BaseZ)):ebrat_original.enumBravaisLattice()); |
|
|
|
|
|
const NRMat<Int4> matrix_min_to_sell = lattice_original.putInitialForm().second; |
|
|
|
|
|
SymMat<Double> S_super(4); |
|
|
Int4 itnum; |
|
|
NRMat<Int4> trans_mat(4,3); |
|
|
|
|
|
for(map< SymMat<VCData>, NRMat<Int4> >::const_iterator it=S_red_tray.begin(); it!=S_red_tray.end(); it++) |
|
|
{ |
|
|
// S_super = it->second * it->first * Transpose(it->second) is close to |
|
|
// Delone-reduced form of the original lattice. |
|
|
S_super = transform_sym_matrix(it->second, chToDouble(it->first) ); |
|
|
|
|
|
trans_mat = identity_matrix<Int4>(4); |
|
|
|
|
|
// S_super = trans_mat * it->second * it->first * Transpose(trans_mat * it->second). |
|
|
put_super_Gram_matrix_obtuse_angle< Double, SymMat<Double> >(trans_mat, S_super, itnum); |
|
|
moveSmallerDiagonalLeftUpper< Double, SymMat<Double> >(S_super, trans_mat); |
|
|
|
|
|
lattice_result.push_back( LatticeFigureOfMeritToCheckSymmetry( BravaisType( pair<eBravaisLattice, ePointGroup>(eblat, epg) ), |
|
|
SymMat43_VCData(it->first, mprod(trans_mat, it->second) ), |
|
|
lattice_original.putLatticeFigureOfMerit().putPeakShiftFunctionType(), |
|
|
lattice_original.putLatticeFigureOfMerit().putWaveLength(), |
|
|
lattice_original.putLatticeFigureOfMerit().putPeakShiftParamRadian() ) ); |
|
|
} |
|
|
} |
|
| 129 |
|
|
| 130 |
|
|
| 131 |
void SortingLattice::putBravaisLatticeFigureOfMerit(const ReducedLatticeToCheckBravais& RLCB, |
void SortingLattice::putCentringTypes(const ReducedVCLatticeToCheckBravais& RLCB, |
| 132 |
const LatticeFigureOfMeritToCheckSymmetry& lattice_original, |
const VCLatticeFigureOfMeritToCheckSymmetry& lattice_original, |
| 133 |
const BravaisType& brat, |
const BravaisType& brat, |
| 134 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result) const |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result) const |
| 135 |
{ |
{ |
| 136 |
lattice_result.clear(); |
lattice_result.clear(); |
| 137 |
|
|
| 138 |
const map< SymMat<VCData>, NRMat<Int4> >& S_red_tray = RLCB.checkBravaisLatticeType(brat); |
const map< SymMat<VCData>, NRMat<Int4> >& S_red_tray = RLCB.checkCentringType(brat); |
| 139 |
if( S_red_tray.empty() ) return; |
if( S_red_tray.empty() ) return; |
| 140 |
|
|
| 141 |
// The lattice of RLCB has at least the symmetry given by eblat. |
// The lattice of RLCB has at least the symmetry given by eblat. |
| 142 |
SymMat<VCData> S_super_obtuse(4); |
SymMat<VCData> S_super(4); |
|
Int4 itnum; |
|
| 143 |
NRMat<Int4> trans_mat(4,3); |
NRMat<Int4> trans_mat(4,3); |
| 144 |
|
|
| 145 |
for(map< SymMat<VCData>, NRMat<Int4> >::const_iterator it=S_red_tray.begin(); it!=S_red_tray.end(); it++) |
for(map< SymMat<VCData>, NRMat<Int4> >::const_iterator it=S_red_tray.begin(); it!=S_red_tray.end(); it++) |
| 146 |
{ |
{ |
| 147 |
S_super_obtuse = transform_sym_matrix(it->second, it->first); |
S_super = transform_sym_matrix(it->second, it->first); |
| 148 |
trans_mat = identity_matrix<Int4>(4); |
trans_mat = identity_matrix<Int4>(4); |
| 149 |
|
|
| 150 |
// S_super = trans_mat * it->second * it->first * Transpose(trans_mat * it->second) is Delone reduced. |
// S_super = trans_mat * it->second * it->first * Transpose(trans_mat * it->second) is Delone reduced. |
| 151 |
if( !put_super_Gram_matrix_obtuse_angle< VCData, SymMat<VCData> >(trans_mat, S_super_obtuse, itnum) ) |
if( !put_Selling_reduced_dim_less_than_4(S_super, trans_mat) ) |
| 152 |
{ |
{ |
| 153 |
assert( false ); |
assert( false ); |
| 154 |
} |
} |
| 155 |
moveSmallerDiagonalLeftUpper< VCData, SymMat<VCData> >(S_super_obtuse, trans_mat); |
moveSmallerDiagonalLeftUpper(S_super, trans_mat); |
| 156 |
lattice_result.push_back( LatticeFigureOfMeritToCheckSymmetry( brat, SymMat43_VCData(it->first, mprod(trans_mat, it->second) ), |
|
| 157 |
|
lattice_result.push_back( VCLatticeFigureOfMeritToCheckSymmetry( brat, SymMat43_VCData(it->first, mprod(trans_mat, it->second) ), |
| 158 |
lattice_original.putLatticeFigureOfMerit().putPeakShiftFunctionType(), |
lattice_original.putLatticeFigureOfMerit().putPeakShiftFunctionType(), |
| 159 |
lattice_original.putLatticeFigureOfMerit().putWaveLength(), |
lattice_original.putLatticeFigureOfMerit().putWaveLength(), |
| 160 |
lattice_original.putLatticeFigureOfMerit().putPeakShiftParamRadian() ) ); |
lattice_original.putLatticeFigureOfMerit().putPeakShiftParamRadian() ) ); |
| 169 |
void SortingLattice::putLatticeCandidatesForTriclinic(const vector<SymMat43_VCData>& S_super, |
void SortingLattice::putLatticeCandidatesForTriclinic(const vector<SymMat43_VCData>& S_super, |
| 170 |
const Double& MIN_NormM, |
const Double& MIN_NormM, |
| 171 |
const Double& MIN_RevM, |
const Double& MIN_RevM, |
| 172 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri) const |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri) const |
| 173 |
{ |
{ |
| 174 |
const Int4 num_topo = S_super.size(); |
const Int4 num_topo = S_super.size(); |
| 175 |
lattice_result_tri.clear(); |
lattice_result_tri.clear(); |
| 183 |
{ |
{ |
| 184 |
vector< VecDat3<Int4> > closest_hkl_tray; |
vector< VecDat3<Int4> > closest_hkl_tray; |
| 185 |
vector<bool> is_cal_Q_observed_tray; |
vector<bool> is_cal_Q_observed_tray; |
| 186 |
vector<LatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
vector<VCLatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
| 187 |
|
|
| 188 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 189 |
#pragma omp for |
#pragma omp for |
| 194 |
SET_PROGRESS(100*(LOOP_COUNTER++)/num_topo, 65, 1); // critical, but works |
SET_PROGRESS(100*(LOOP_COUNTER++)/num_topo, 65, 1); // critical, but works |
| 195 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 196 |
|
|
| 197 |
LatticeFigureOfMeritToCheckSymmetry latFOM(BravaisType( pair<eBravaisLattice, ePointGroup>(Prim, Ci) ), S_super[n], |
VCLatticeFigureOfMeritToCheckSymmetry latFOM(BravaisType( pair<eCentringType, ePointGroup>(Prim, Ci) ), S_super[n], |
| 198 |
m_etype_peak_shift, m_WlengthX, m_peak_shift_param_rad); |
m_etype_peak_shift, m_WlengthX, m_peak_shift_param_rad); |
| 199 |
|
|
| 200 |
latFOM.setFigureOfMerit(m_num_ref_figure_of_merit, |
latFOM.setFigureOfMerit(m_num_ref_figure_of_merit, |
| 216 |
latFOM.setLatticeFigureOfMerit(latFOM2); |
latFOM.setLatticeFigureOfMerit(latFOM2); |
| 217 |
} |
} |
| 218 |
} |
} |
| 219 |
const SetOfFigureOfMerit& setFOM = latFOM.putLatticeFigureOfMerit().putFiguresOfMerit(); |
const LatticeFigureOfMerit::SetOfFigureOfMerit& setFOM = latFOM.putLatticeFigureOfMerit().putFiguresOfMerit(); |
| 220 |
if( setFOM.putFigureOfMeritWu() < MIN_NormM ) continue; |
if( setFOM.putFigureOfMeritWu() < MIN_NormM ) continue; |
| 221 |
if( setFOM.putReversedFigureOfMerit() < MIN_RevM ) continue; |
if( setFOM.putReversedFigureOfMerit() < MIN_RevM ) continue; |
| 222 |
|
|
| 239 |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes( |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes( |
| 240 |
const Double& MIN_NormM, |
const Double& MIN_NormM, |
| 241 |
const Double& MIN_RevM, |
const Double& MIN_RevM, |
| 242 |
const size_t& MAX_SIZE, |
const Int4& MAX_SIZE, |
| 243 |
const eABCaxis& abc_axis, |
const eABCaxis& abc_axis, |
| 244 |
const eRHaxis& rh_axis, |
const eRHaxis& rh_axis, |
| 245 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
vector<VCLatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 246 |
{ |
{ |
| 247 |
try{ |
try{ |
| 248 |
|
|
| 249 |
for(ArrayIndex i=1; i<NUM_LS; i++) |
for(Int4 i=1; i<NUM_LS; i++) |
| 250 |
{ |
{ |
| 251 |
lattice_result[i].clear(); |
lattice_result[i].clear(); |
| 252 |
} |
} |
| 253 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri = lattice_result[(ArrayIndex)Triclinic]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri = lattice_result[(size_t)Triclinic]; |
| 254 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_mono_P = lattice_result[(ArrayIndex)Monoclinic_P]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_mono_P = lattice_result[(size_t)Monoclinic_P]; |
| 255 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_mono_B = lattice_result[(ArrayIndex)Monoclinic_B]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_mono_B = lattice_result[(size_t)Monoclinic_B]; |
| 256 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_P = lattice_result[(ArrayIndex)Orthorhombic_P]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_P = lattice_result[(size_t)Orthorhombic_P]; |
| 257 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_B = lattice_result[(ArrayIndex)Orthorhombic_C]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_B = lattice_result[(size_t)Orthorhombic_C]; |
| 258 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_I = lattice_result[(ArrayIndex)Orthorhombic_I]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_I = lattice_result[(size_t)Orthorhombic_I]; |
| 259 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_F = lattice_result[(ArrayIndex)Orthorhombic_F]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_ortho_F = lattice_result[(size_t)Orthorhombic_F]; |
| 260 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_tetra_P = lattice_result[(ArrayIndex)Tetragonal_P]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_tetra_P = lattice_result[(size_t)Tetragonal_P]; |
| 261 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_tetra_I = lattice_result[(ArrayIndex)Tetragonal_I]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_tetra_I = lattice_result[(size_t)Tetragonal_I]; |
| 262 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_rhom = lattice_result[(ArrayIndex)Rhombohedral]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_rhom = lattice_result[(size_t)Rhombohedral]; |
| 263 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_hex = lattice_result[(ArrayIndex)Hexagonal]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_hex = lattice_result[(size_t)Hexagonal]; |
| 264 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_P = lattice_result[(ArrayIndex)Cubic_P]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_P = lattice_result[(size_t)Cubic_P]; |
| 265 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_I = lattice_result[(ArrayIndex)Cubic_I]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_I = lattice_result[(size_t)Cubic_I]; |
| 266 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_F = lattice_result[(ArrayIndex)Cubic_F]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_cubic_F = lattice_result[(size_t)Cubic_F]; |
| 267 |
|
|
| 268 |
const Int4 num_tri = lattice_result_tri.size(); |
const Int4 num_tri = lattice_result_tri.size(); |
| 269 |
|
|
| 274 |
#pragma omp parallel |
#pragma omp parallel |
| 275 |
#endif |
#endif |
| 276 |
{ |
{ |
| 277 |
vector<LatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
vector<VCLatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
| 278 |
|
|
| 279 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 280 |
#pragma omp for |
#pragma omp for |
| 285 |
SET_PROGRESS(99*(LOOP_COUNTER++)/num_tri, 66, 30); // critical, but works |
SET_PROGRESS(99*(LOOP_COUNTER++)/num_tri, 66, 30); // critical, but works |
| 286 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 287 |
|
|
| 288 |
LatticeFigureOfMeritToCheckSymmetry& latFOM = lattice_result_tri[n]; |
VCLatticeFigureOfMeritToCheckSymmetry& latFOM = lattice_result_tri[n]; |
| 289 |
const SymMat43_VCData& S_red = latFOM.putInitialForm(); |
latFOM.setLabel(n+1); |
| 290 |
|
|
| 291 |
// Calculate figures of merit as triclinic |
// Calculate figures of merit as triclinic |
| 292 |
const ReducedLatticeToCheckBravais RLCB(abc_axis, rh_axis, m_DoesPrudentSymSearch, m_cv2, S_red); |
const ReducedVCLatticeToCheckBravais RLCB(abc_axis, rh_axis, m_DoesPrudentSymSearch, m_cv2, latFOM.putInitialSellingReducedForm() ); |
| 293 |
|
|
| 294 |
if( JudgeSymmetry[Monoclinic_B] ) |
if( JudgeSymmetry[Monoclinic_B] ) |
| 295 |
{ |
{ |
| 296 |
putBravaisLatticeFigureOfMerit(RLCB, latFOM, BravaisType( put_monoclinic_b_type(abc_axis) ), latFOM_tray); |
putCentringTypes(RLCB, latFOM, BravaisType( put_monoclinic_b_type(abc_axis) ), latFOM_tray); |
| 297 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 298 |
#pragma omp critical(monoB) |
#pragma omp critical(monoB) |
| 299 |
#endif |
#endif |
| 303 |
} |
} |
| 304 |
if( JudgeSymmetry[Orthorhombic_I] ) |
if( JudgeSymmetry[Orthorhombic_I] ) |
| 305 |
{ |
{ |
| 306 |
putBravaisLatticeFigureOfMerit(RLCB, latFOM, BravaisType( pair<eBravaisLattice, ePointGroup>(Inner, D2h) ), latFOM_tray); |
putCentringTypes(RLCB, latFOM, BravaisType( pair<eCentringType, ePointGroup>(Inner, D2h) ), latFOM_tray); |
| 307 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 308 |
#pragma omp critical(orthoI) |
#pragma omp critical(orthoI) |
| 309 |
#endif |
#endif |
| 313 |
} |
} |
| 314 |
if( JudgeSymmetry[Orthorhombic_F] ) |
if( JudgeSymmetry[Orthorhombic_F] ) |
| 315 |
{ |
{ |
| 316 |
putBravaisLatticeFigureOfMerit(RLCB, latFOM, BravaisType( pair<eBravaisLattice, ePointGroup>(Face, D2h) ), latFOM_tray); |
putCentringTypes(RLCB, latFOM, BravaisType( pair<eCentringType, ePointGroup>(Face, D2h) ), latFOM_tray); |
| 317 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 318 |
#pragma omp critical(orthoF) |
#pragma omp critical(orthoF) |
| 319 |
#endif |
#endif |
| 323 |
} |
} |
| 324 |
if( JudgeSymmetry[Rhombohedral] ) |
if( JudgeSymmetry[Rhombohedral] ) |
| 325 |
{ |
{ |
| 326 |
putBravaisLatticeFigureOfMerit(RLCB, latFOM, BravaisType( put_rhombohedral_type(rh_axis) ), latFOM_tray); |
putCentringTypes(RLCB, latFOM, BravaisType( put_rhombohedral_type(rh_axis) ), latFOM_tray); |
| 327 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 328 |
#pragma omp critical(rhom) |
#pragma omp critical(rhom) |
| 329 |
#endif |
#endif |
| 334 |
|
|
| 335 |
if( JudgeSymmetry[Monoclinic_P] ) |
if( JudgeSymmetry[Monoclinic_P] ) |
| 336 |
{ |
{ |
| 337 |
putLatticeFigureOfMerit(latFOM, put_monoclinic_p_type(abc_axis), m_cv2, latFOM_tray); |
latFOM.putLatticesOfHigherSymmetry(put_monoclinic_p_type(abc_axis), m_cv2, latFOM_tray); |
| 338 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 339 |
#pragma omp critical(monoP) |
#pragma omp critical(monoP) |
| 340 |
#endif |
#endif |
| 344 |
} |
} |
| 345 |
if( JudgeSymmetry[Orthorhombic_P] ) |
if( JudgeSymmetry[Orthorhombic_P] ) |
| 346 |
{ |
{ |
| 347 |
putLatticeFigureOfMerit(latFOM, D2h, m_cv2, latFOM_tray); |
latFOM.putLatticesOfHigherSymmetry(D2h, m_cv2, latFOM_tray); |
| 348 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 349 |
#pragma omp critical (ortho_P) |
#pragma omp critical (ortho_P) |
| 350 |
#endif |
#endif |
| 355 |
} |
} |
| 356 |
} |
} |
| 357 |
|
|
| 358 |
sort( lattice_result_tri.begin(), lattice_result_tri.end(), LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
sort( lattice_result_tri.begin(), lattice_result_tri.end(), VCLatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
| 359 |
if( MAX_SIZE < lattice_result_tri.size() ) |
if( MAX_SIZE < (Int4)lattice_result_tri.size() ) |
| 360 |
{ |
{ |
| 361 |
lattice_result_tri.erase( lattice_result_tri.begin() + MAX_SIZE, lattice_result_tri.end() ); |
lattice_result_tri.erase( lattice_result_tri.begin() + MAX_SIZE, lattice_result_tri.end() ); |
| 362 |
} |
} |
| 379 |
Int4 SUM = 0; |
Int4 SUM = 0; |
| 380 |
for(Int4 i=0; i<NUM_LS; i++) { SUM += lattice_result[i].size(); } |
for(Int4 i=0; i<NUM_LS; i++) { SUM += lattice_result[i].size(); } |
| 381 |
|
|
| 382 |
for(ArrayIndex i=1; i<NUM_LS; i++) |
for(Int4 i=1; i<NUM_LS; i++) |
| 383 |
{ |
{ |
| 384 |
if( !JudgeSymmetry[i] ) continue; |
if( !JudgeSymmetry[i] ) continue; |
| 385 |
// sort( lattice_result[i].begin(), lattice_result[i].end() ); |
// sort( lattice_result[i].begin(), lattice_result[i].end() ); |
| 392 |
{ |
{ |
| 393 |
vector< VecDat3<Int4> > closest_hkl_tray; |
vector< VecDat3<Int4> > closest_hkl_tray; |
| 394 |
vector<bool> is_cal_Q_observed_tray; |
vector<bool> is_cal_Q_observed_tray; |
| 395 |
vector<LatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
vector<VCLatticeFigureOfMeritToCheckSymmetry> latFOM_tray; |
| 396 |
|
|
| 397 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 398 |
#pragma omp for |
#pragma omp for |
| 403 |
SET_PROGRESS(99+1*(LOOP_COUNTER++)/SUM, 66, 30); // critical, but works |
SET_PROGRESS(99+1*(LOOP_COUNTER++)/SUM, 66, 30); // critical, but works |
| 404 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 405 |
|
|
| 406 |
LatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
VCLatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
| 407 |
|
latFOM0.setLabel(index+1); |
| 408 |
|
|
| 409 |
latFOM0.setFigureOfMerit(m_num_ref_figure_of_merit, |
latFOM0.setFigureOfMerit(m_num_ref_figure_of_merit, |
| 410 |
VCData::putPeakQData(), |
VCData::putPeakQData(), |
| 411 |
closest_hkl_tray, is_cal_Q_observed_tray); |
closest_hkl_tray, is_cal_Q_observed_tray); |
| 425 |
} |
} |
| 426 |
} |
} |
| 427 |
|
|
| 428 |
const SetOfFigureOfMerit& setFOM = latFOM0.putLatticeFigureOfMerit().putFiguresOfMerit(); |
const LatticeFigureOfMerit::SetOfFigureOfMerit& setFOM = latFOM0.putLatticeFigureOfMerit().putFiguresOfMerit(); |
| 429 |
if( setFOM.putFigureOfMeritWu() < MIN_NormM ) continue; |
if( setFOM.putFigureOfMeritWu() < MIN_NormM ) continue; |
| 430 |
if( setFOM.putReversedFigureOfMerit() < MIN_RevM ) continue; |
if( setFOM.putReversedFigureOfMerit() < MIN_RevM ) continue; |
| 431 |
|
|
| 432 |
if( eCrystalSystem(i) == Monoclinic_P ) |
if( eBravaisType(i) == Monoclinic_P ) |
| 433 |
{ |
{ |
| 434 |
if( JudgeSymmetry[Hexagonal] ) |
if( JudgeSymmetry[Hexagonal] ) |
| 435 |
{ |
{ |
| 436 |
putLatticeFigureOfMerit(latFOM0, D6h, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(D6h, m_cv2, latFOM_tray); |
| 437 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 438 |
#pragma omp critical (hex) |
#pragma omp critical (hex) |
| 439 |
#endif |
#endif |
| 442 |
} |
} |
| 443 |
} |
} |
| 444 |
} |
} |
| 445 |
else if( eCrystalSystem(i) == Monoclinic_B ) |
else if( eBravaisType(i) == Monoclinic_B ) |
| 446 |
{ |
{ |
| 447 |
if( JudgeSymmetry[Orthorhombic_C] ) |
if( JudgeSymmetry[Orthorhombic_C] ) |
| 448 |
{ |
{ |
| 449 |
putLatticeFigureOfMerit(latFOM0, D2h, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(D2h, m_cv2, latFOM_tray); |
| 450 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 451 |
#pragma omp critical (ortho_B) |
#pragma omp critical (ortho_B) |
| 452 |
#endif |
#endif |
| 455 |
} |
} |
| 456 |
} |
} |
| 457 |
} |
} |
| 458 |
else if( eCrystalSystem(i) == Orthorhombic_P ) |
else if( eBravaisType(i) == Orthorhombic_P ) |
| 459 |
{ |
{ |
| 460 |
if( JudgeSymmetry[Tetragonal_P] ) |
if( JudgeSymmetry[Tetragonal_P] ) |
| 461 |
{ |
{ |
| 462 |
putLatticeFigureOfMerit(latFOM0, D4h_Z, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(D4h_Z, m_cv2, latFOM_tray); |
| 463 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 464 |
#pragma omp critical (tetra_P) |
#pragma omp critical (tetra_P) |
| 465 |
#endif |
#endif |
| 469 |
} |
} |
| 470 |
if( JudgeSymmetry[Cubic_P] ) |
if( JudgeSymmetry[Cubic_P] ) |
| 471 |
{ |
{ |
| 472 |
putLatticeFigureOfMerit(latFOM0, Oh, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(Oh, m_cv2, latFOM_tray); |
| 473 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 474 |
#pragma omp critical (cubic_P) |
#pragma omp critical (cubic_P) |
| 475 |
#endif |
#endif |
| 478 |
} |
} |
| 479 |
} |
} |
| 480 |
} |
} |
| 481 |
else if( eCrystalSystem(i) == Orthorhombic_I ) |
else if( eBravaisType(i) == Orthorhombic_I ) |
| 482 |
{ |
{ |
| 483 |
if( JudgeSymmetry[Tetragonal_I] ) |
if( JudgeSymmetry[Tetragonal_I] ) |
| 484 |
{ |
{ |
| 485 |
putLatticeFigureOfMerit(latFOM0, D4h_Z, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(D4h_Z, m_cv2, latFOM_tray); |
| 486 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 487 |
#pragma omp critical (tetra_I) |
#pragma omp critical (tetra_I) |
| 488 |
#endif |
#endif |
| 492 |
} |
} |
| 493 |
if( JudgeSymmetry[Cubic_I] ) |
if( JudgeSymmetry[Cubic_I] ) |
| 494 |
{ |
{ |
| 495 |
putLatticeFigureOfMerit(latFOM0, Oh, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(Oh, m_cv2, latFOM_tray); |
| 496 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 497 |
#pragma omp critical (cubic_I) |
#pragma omp critical (cubic_I) |
| 498 |
#endif |
#endif |
| 501 |
} |
} |
| 502 |
} |
} |
| 503 |
} |
} |
| 504 |
else if( eCrystalSystem(i) == Orthorhombic_F ) |
else if( eBravaisType(i) == Orthorhombic_F ) |
| 505 |
{ |
{ |
| 506 |
if( JudgeSymmetry[Cubic_F] ) |
if( JudgeSymmetry[Cubic_F] ) |
| 507 |
{ |
{ |
| 508 |
putLatticeFigureOfMerit(latFOM0, Oh, m_cv2, latFOM_tray); |
latFOM0.putLatticesOfHigherSymmetry(Oh, m_cv2, latFOM_tray); |
| 509 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 510 |
#pragma omp critical (cubic_F) |
#pragma omp critical (cubic_F) |
| 511 |
#endif |
#endif |
| 519 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 520 |
CHECK_INTERRUPTION(); |
CHECK_INTERRUPTION(); |
| 521 |
|
|
| 522 |
sort( lattice_result[i].begin(), lattice_result[i].end(), LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
sort( lattice_result[i].begin(), lattice_result[i].end(), VCLatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
| 523 |
if( MAX_SIZE < lattice_result[i].size() ) |
if( MAX_SIZE < (Int4)lattice_result[i].size() ) |
| 524 |
{ |
{ |
| 525 |
lattice_result[i].erase( lattice_result[i].begin() + MAX_SIZE, lattice_result[i].end() ); |
lattice_result[i].erase( lattice_result[i].begin() + MAX_SIZE, lattice_result[i].end() ); |
| 526 |
} |
} |
| 531 |
lattice_result[i][n].setLabel(n+1); |
lattice_result[i][n].setLabel(n+1); |
| 532 |
} |
} |
| 533 |
|
|
| 534 |
ZLOG_INFO( "(" + num2str( i+1 ) + ") The number of candidates for " + put_cs_name(eCrystalSystem(i), abc_axis) |
ZLOG_INFO( "(" + num2str( i+1 ) + ") The number of candidates for " + put_bravais_type_name(eBravaisType(i), abc_axis) |
| 535 |
+ " : " + num2str<Int4>( lattice_result[i].size() ) + "\n" ); |
+ " : " + num2str<Int4>( lattice_result[i].size() ) + "\n" ); |
| 536 |
} |
} |
| 537 |
ZLOG_INFO( "\n" ); |
ZLOG_INFO( "\n" ); |
| 546 |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes(const vector<SymMat43_VCData>& S_super, |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes(const vector<SymMat43_VCData>& S_super, |
| 547 |
const Double& MIN_NormM, |
const Double& MIN_NormM, |
| 548 |
const Double& MIN_RevM, |
const Double& MIN_RevM, |
| 549 |
const size_t& MAX_SIZE, |
const Int4& MAX_SIZE, |
| 550 |
const eABCaxis& abc_axis, |
const eABCaxis& abc_axis, |
| 551 |
const eRHaxis& rh_axis, |
const eRHaxis& rh_axis, |
| 552 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
vector<VCLatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 553 |
{ |
{ |
| 554 |
vector<LatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri = lattice_result[(Int4)Triclinic]; |
vector<VCLatticeFigureOfMeritToCheckSymmetry>& lattice_result_tri = lattice_result[(size_t)Triclinic]; |
| 555 |
putLatticeCandidatesForTriclinic(S_super, MIN_NormM, MIN_RevM, lattice_result_tri); |
putLatticeCandidatesForTriclinic(S_super, MIN_NormM, MIN_RevM, lattice_result_tri); |
| 556 |
|
|
| 557 |
ZLOG_INFO( "Determination of the Bravais type is being carried out...\n(Solutions with " + putLabel(SCWuM) + " less than " + num2str(MIN_NormM) |
ZLOG_INFO( "Determination of the Bravais type is being carried out...\n(Solutions with " + putLabel(SCWuM) + " less than " + num2str(MIN_NormM) |
| 568 |
|
|
| 569 |
|
|
| 570 |
void SortingLattice::setNumberOfNeighbors(const eABCaxis& baxis_flag, |
void SortingLattice::setNumberOfNeighbors(const eABCaxis& baxis_flag, |
| 571 |
bool (*CmpFunc)(const LatticeFigureOfMeritToCheckSymmetry&, const LatticeFigureOfMeritToCheckSymmetry&), |
bool (*CmpFunc)(const VCLatticeFigureOfMeritToCheckSymmetry&, const VCLatticeFigureOfMeritToCheckSymmetry&), |
| 572 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
vector<VCLatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 573 |
{ |
{ |
| 574 |
|
|
| 575 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 576 |
#pragma omp for |
#pragma omp for |
| 577 |
#endif |
#endif |
| 578 |
for(ArrayIndex i=0; i<NUM_LS; i++) |
for(Int4 i=0; i<NUM_LS; i++) |
| 579 |
{ |
{ |
| 580 |
if( !OutputSymmetry[i] ) continue; |
if( !OutputSymmetry[(size_t)i] ) continue; |
| 581 |
|
|
| 582 |
stable_sort( lattice_result[i].begin(), lattice_result[i].end() ); // Sort by the unit-cell volume. |
stable_sort( lattice_result[i].begin(), lattice_result[i].end() ); // Sort by the unit-cell volume. |
| 583 |
for(vector<LatticeFigureOfMeritToCheckSymmetry>::iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
for(vector<VCLatticeFigureOfMeritToCheckSymmetry>::iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
| 584 |
{ |
{ |
| 585 |
it->putNumberOfLatticesInNeighborhood() = 0; |
it->putNumberOfLatticesInNeighborhood() = 0; |
| 586 |
} |
} |
| 587 |
} |
} |
| 588 |
|
|
| 589 |
const Double coef_lower = 1.0 - sqrt(3.0)*m_resol2; |
const Double coef_lower = 1.0 - m_resol*3.0; |
| 590 |
const Double coef_upper = 1.0 + sqrt(3.0)*m_resol2; |
const Double coef_upper = 1.0 + m_resol*3.0; |
| 591 |
|
|
| 592 |
Vec_INT index_tray(put_cs_num()); |
Vec_INT index_tray(put_number_of_bravais_types(), 0); |
| 593 |
|
|
| 594 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 595 |
Int4 SUM=0, LOOP_COUNTER=0; |
Int4 SUM=0, LOOP_COUNTER=0; |
| 596 |
for(Int4 i=0; i<NUM_LS; i++ ) { SUM += lattice_result[i].size(); } |
for(Int4 i=0; i<NUM_LS; i++ ) { SUM += lattice_result[(size_t)i].size(); } |
| 597 |
|
|
| 598 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 599 |
#pragma omp for |
#pragma omp for |
| 600 |
#endif |
#endif |
| 601 |
for(ArrayIndex i=0; i<NUM_LS; i++) |
for(Int4 i=0; i<NUM_LS; i++) |
| 602 |
{ |
{ |
| 603 |
if( !OutputSymmetry[i] ) continue; |
if( !OutputSymmetry[(size_t)i] ) continue; |
| 604 |
|
|
| 605 |
const Int4 num_lattice = lattice_result[i].size(); |
const size_t num_lattice = lattice_result[i].size(); |
| 606 |
|
|
| 607 |
for(Int4 index=0; index<num_lattice; index++) |
for(size_t index=0; index<num_lattice; index++) |
| 608 |
{ |
{ |
| 609 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 610 |
SET_PROGRESS(100*(LOOP_COUNTER++)/SUM, 97, 1); // critical, but works |
SET_PROGRESS(100*(LOOP_COUNTER++)/SUM, 97, 1); // critical, but works |
| 611 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 612 |
|
|
| 613 |
LatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
VCLatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
| 614 |
const LatticeFigureOfMerit& latFOM0_prim = latFOM0.putLatticeFigureOfMerit(); |
const LatticeFigureOfMerit& latFOM0_prim = latFOM0.putLatticeFigureOfMerit(); |
| 615 |
if( latFOM0.putNumberOfLatticesInNeighborhood() < 0 ) continue; |
if( latFOM0.putNumberOfLatticesInNeighborhood() < 0 ) continue; |
| 616 |
|
|
| 617 |
const Double& detS = latFOM0_prim.putDeterminantOfGramMatrix(); |
const Double& detS = latFOM0_prim.putDeterminantOfGramMatrix(); |
| 618 |
const Int4 ibegin = distance( lattice_result[i].begin(), lower_bound( lattice_result[i].begin(), lattice_result[i].end(), detS*coef_lower ) ); |
const size_t ibegin = distance( lattice_result[i].begin(), lower_bound( lattice_result[i].begin(), lattice_result[i].end(), detS*coef_lower ) ); |
| 619 |
const Int4 iend = distance( lattice_result[i].begin(), upper_bound( lattice_result[i].begin(), lattice_result[i].end(), detS*coef_upper ) ); |
const size_t iend = distance( lattice_result[i].begin(), upper_bound( lattice_result[i].begin()+ibegin, lattice_result[i].end(), detS*coef_upper ) ); |
| 620 |
|
|
| 621 |
Int4 count=0; |
Int4 count=0; |
| 622 |
if( i == (Int4)Triclinic ) |
if( i == (size_t)Triclinic ) |
| 623 |
{ |
{ |
| 624 |
const ReducedLatticeToCheckEquiv RLCS(m_resol2, latFOM0_prim.putOptimizedForm()); |
const ReducedLatticeToCheckEquiv RLCS(m_resol, latFOM0_prim.putSellingReducedForm()); |
| 625 |
for(Int4 index2=ibegin; index2<iend; index2++) |
for(size_t index2=ibegin; index2<iend; index2++) |
| 626 |
{ |
{ |
| 627 |
if( index2 == index ) continue; |
if( index2 == index ) continue; |
| 628 |
|
|
| 629 |
LatticeFigureOfMeritToCheckSymmetry& latFOM2 = lattice_result[i][index2]; |
VCLatticeFigureOfMeritToCheckSymmetry& latFOM2 = lattice_result[i][index2]; |
| 630 |
const LatticeFigureOfMerit& latFOM2_prim = latFOM2.putLatticeFigureOfMerit(); |
const LatticeFigureOfMerit& latFOM2_prim = latFOM2.putLatticeFigureOfMerit(); |
| 631 |
|
|
| 632 |
// lattice_result_tri[index2] equals trans_mat * RLCB.m_S_super_obtuse * Transpose(trans_mat) |
// lattice_result_tri[index2] equals trans_mat * RLCB.m_S_super_obtuse * Transpose(trans_mat) |
| 637 |
{ |
{ |
| 638 |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
| 639 |
{ |
{ |
| 640 |
|
latFOM2.putNumberOfLatticesInNeighborhood() += 1; |
| 641 |
count = -1; |
count = -1; |
| 642 |
break; |
break; |
| 643 |
} |
} |
| 652 |
} |
} |
| 653 |
else |
else |
| 654 |
{ |
{ |
| 655 |
for(Int4 index2=ibegin; index2<iend; index2++) |
for(size_t index2=ibegin; index2<iend; index2++) |
| 656 |
{ |
{ |
| 657 |
if( index2 == index ) continue; |
if( index2 == index ) continue; |
| 658 |
|
|
| 659 |
LatticeFigureOfMeritToCheckSymmetry& latFOM2 = lattice_result[i][index2]; |
VCLatticeFigureOfMeritToCheckSymmetry& latFOM2 = lattice_result[i][index2]; |
| 660 |
const LatticeFigureOfMerit& latFOM2_prim = latFOM2.putLatticeFigureOfMerit(); |
const LatticeFigureOfMerit& latFOM2_prim = latFOM2.putLatticeFigureOfMerit(); |
| 661 |
|
|
| 662 |
// *it2 equals trans_mat * RLCS.m_S_super_obtuse * Transpose(trans_mat) |
// *it2 equals trans_mat * RLCS.m_S_super_obtuse * Transpose(trans_mat) |
| 663 |
if( check_equiv_m( latFOM0_prim.putInverseOfMinkowskiReducedForm(), latFOM2_prim.putInverseOfMinkowskiReducedForm(), m_resol2 ) ) |
if( check_equiv_m( latFOM0_prim.putInverseOfBuergerReducedForm(), latFOM2_prim.putInverseOfBuergerReducedForm(), m_resol ) ) |
| 664 |
{ |
{ |
| 665 |
// Compare the figures of merit. |
// Compare the figures of merit. |
| 666 |
if( CmpFunc( latFOM2, latFOM0 ) ) |
if( CmpFunc( latFOM2, latFOM0 ) ) |
| 667 |
{ |
{ |
| 668 |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
| 669 |
{ |
{ |
| 670 |
|
latFOM2.putNumberOfLatticesInNeighborhood() += 1; |
| 671 |
count = -1; |
count = -1; |
| 672 |
break; |
break; |
| 673 |
} |
} |
| 686 |
|
|
| 687 |
Int4& index = index_tray[i]; |
Int4& index = index_tray[i]; |
| 688 |
index = 0; |
index = 0; |
| 689 |
for(vector<LatticeFigureOfMeritToCheckSymmetry>::const_iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
for(vector<VCLatticeFigureOfMeritToCheckSymmetry>::const_iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
| 690 |
{ |
{ |
| 691 |
if( it->putNumberOfLatticesInNeighborhood() >= 0 ) index++; |
if( it->putNumberOfLatticesInNeighborhood() >= 0 ) index++; |
| 692 |
} |
} |
| 695 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 696 |
CHECK_INTERRUPTION(); |
CHECK_INTERRUPTION(); |
| 697 |
|
|
| 698 |
for(ArrayIndex i=0; i<NUM_LS; i++) |
for(Int4 i=0; i<NUM_LS; i++) |
| 699 |
{ |
{ |
| 700 |
if( !OutputSymmetry[i] ) continue; |
if( !OutputSymmetry[(size_t)i] ) continue; |
| 701 |
ZLOG_INFO( "(" + num2str( i+1 ) + ") The number of candidates for " + put_cs_name(eCrystalSystem(i), baxis_flag) |
ZLOG_INFO( "(" + num2str( i+1 ) + ") The number of candidates for " + put_bravais_type_name(eBravaisType(i), baxis_flag) |
| 702 |
+ " : " + num2str( lattice_result[i].size() ) + " -> " + num2str( index_tray[i] ) + "\n" ); |
+ " : " + num2str( lattice_result[i].size() ) + " -> " + num2str( index_tray[i] ) + "\n" ); |
| 703 |
} |
} |
| 704 |
ZLOG_INFO( "\n" ); |
ZLOG_INFO( "\n" ); |