| 251 |
latFOM2.setFigureOfMerit(latFOM.putLatticeFigureOfMerit().putFiguresOfMerit().putNumberOfReflectionsForFigureOfMerit(), |
latFOM2.setFigureOfMerit(latFOM.putLatticeFigureOfMerit().putFiguresOfMerit().putNumberOfReflectionsForFigureOfMerit(), |
| 252 |
VCData::putPeakQData(), |
VCData::putPeakQData(), |
| 253 |
closest_hkl_tray, is_cal_Q_observed_tray); |
closest_hkl_tray, is_cal_Q_observed_tray); |
| 254 |
if( LatticeFigureOfMerit::cmpFOMdeWolff( latFOM2, latFOM.putLatticeFigureOfMerit() ) ) |
if( LatticeFigureOfMerit::cmpFOMWu( latFOM2, latFOM.putLatticeFigureOfMerit() ) ) |
| 255 |
{ |
{ |
| 256 |
latFOM.setLatticeFigureOfMerit(latFOM2); |
latFOM.setLatticeFigureOfMerit(latFOM2); |
| 257 |
} |
} |
| 272 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 273 |
CHECK_INTERRUPTION(); |
CHECK_INTERRUPTION(); |
| 274 |
|
|
| 275 |
sort( lattice_result_tri.begin(), lattice_result_tri.end() ); |
// sort( lattice_result_tri.begin(), lattice_result_tri.end() ); |
| 276 |
} |
} |
| 277 |
|
|
| 278 |
|
|
| 279 |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes( |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes( |
| 280 |
const Double& MIN_NormM, |
const Double& MIN_NormM, |
| 281 |
const Double& MIN_RevM, |
const Double& MIN_RevM, |
| 282 |
|
const size_t& MAX_SIZE, |
| 283 |
const eABCaxis& abc_axis, |
const eABCaxis& abc_axis, |
| 284 |
const eRHaxis& rh_axis, |
const eRHaxis& rh_axis, |
| 285 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 286 |
{ |
{ |
| 287 |
try{ |
try{ |
| 288 |
|
|
| 289 |
for(ArrayIndex i=1; i<NUM_LS; i++) |
for(ArrayIndex i=1; i<NUM_LS; i++) |
| 290 |
{ |
{ |
| 291 |
lattice_result[i].clear(); |
lattice_result[i].clear(); |
| 292 |
} |
} |
| 326 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 327 |
|
|
| 328 |
LatticeFigureOfMeritToCheckSymmetry& latFOM = lattice_result_tri[n]; |
LatticeFigureOfMeritToCheckSymmetry& latFOM = lattice_result_tri[n]; |
|
latFOM.setLabel(n+1); |
|
| 329 |
const SymMat43_VCData& S_red = latFOM.putInitialForm(); |
const SymMat43_VCData& S_red = latFOM.putInitialForm(); |
| 330 |
|
|
| 331 |
// Calculate figures of merit as triclinic |
// Calculate figures of merit as triclinic |
| 395 |
} |
} |
| 396 |
} |
} |
| 397 |
|
|
| 398 |
|
sort( lattice_result_tri.begin(), lattice_result_tri.end(), LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
| 399 |
|
if( MAX_SIZE < lattice_result_tri.size() ) |
| 400 |
|
{ |
| 401 |
|
lattice_result_tri.erase( lattice_result_tri.begin() + MAX_SIZE, lattice_result_tri.end() ); |
| 402 |
|
} |
| 403 |
|
|
| 404 |
|
const size_t num_tri2 = lattice_result_tri.size(); |
| 405 |
|
for(size_t n=0; n<num_tri2; n++) |
| 406 |
|
{ |
| 407 |
|
lattice_result_tri[n].setLabel(n+1); |
| 408 |
|
} |
| 409 |
|
|
| 410 |
|
ZLOG_INFO( "The program has selected " + num2str<Int4>( lattice_result_tri.size() ) |
| 411 |
|
+ " triclinic solutions using the Wu figure of merit.\n\n" ); |
| 412 |
|
|
| 413 |
|
|
| 414 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 415 |
CHECK_INTERRUPTION(); |
CHECK_INTERRUPTION(); |
| 416 |
|
|
|
ZLOG_INFO( "All the lattice constants are being optimized by linear least squares...\n" ); |
|
|
|
|
| 417 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 418 |
LOOP_COUNTER = 0; |
LOOP_COUNTER = 0; |
| 419 |
Int4 SUM = 0; |
Int4 SUM = 0; |
| 422 |
for(ArrayIndex i=1; i<NUM_LS; i++) |
for(ArrayIndex i=1; i<NUM_LS; i++) |
| 423 |
{ |
{ |
| 424 |
if( !JudgeSymmetry[i] ) continue; |
if( !JudgeSymmetry[i] ) continue; |
| 425 |
sort( lattice_result[i].begin(), lattice_result[i].end() ); |
// sort( lattice_result[i].begin(), lattice_result[i].end() ); |
| 426 |
|
|
| 427 |
const Int4 num_lattice = lattice_result[i].size(); |
const Int4 num_lattice = lattice_result[i].size(); |
| 428 |
|
|
| 444 |
if(IS_CANSELED()) continue; |
if(IS_CANSELED()) continue; |
| 445 |
|
|
| 446 |
LatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
LatticeFigureOfMeritToCheckSymmetry& latFOM0 = lattice_result[i][index]; |
|
latFOM0.setLabel(index+1); |
|
|
|
|
| 447 |
latFOM0.setFigureOfMerit(m_num_ref_figure_of_merit, |
latFOM0.setFigureOfMerit(m_num_ref_figure_of_merit, |
| 448 |
VCData::putPeakQData(), |
VCData::putPeakQData(), |
| 449 |
closest_hkl_tray, is_cal_Q_observed_tray); |
closest_hkl_tray, is_cal_Q_observed_tray); |
| 457 |
latFOM2.setFigureOfMerit(latFOM0.putLatticeFigureOfMerit().putFiguresOfMerit().putNumberOfReflectionsForFigureOfMerit(), |
latFOM2.setFigureOfMerit(latFOM0.putLatticeFigureOfMerit().putFiguresOfMerit().putNumberOfReflectionsForFigureOfMerit(), |
| 458 |
VCData::putPeakQData(), |
VCData::putPeakQData(), |
| 459 |
closest_hkl_tray, is_cal_Q_observed_tray); |
closest_hkl_tray, is_cal_Q_observed_tray); |
| 460 |
if( LatticeFigureOfMerit::cmpFOMdeWolff( latFOM2, latFOM0.putLatticeFigureOfMerit() ) ) |
if( LatticeFigureOfMerit::cmpFOMWu( latFOM2, latFOM0.putLatticeFigureOfMerit() ) ) |
| 461 |
{ |
{ |
| 462 |
latFOM0.setLatticeFigureOfMerit(latFOM2); |
latFOM0.setLatticeFigureOfMerit(latFOM2); |
| 463 |
} |
} |
| 557 |
/* 2011.10.19 VIC Tamura */ |
/* 2011.10.19 VIC Tamura */ |
| 558 |
CHECK_INTERRUPTION(); |
CHECK_INTERRUPTION(); |
| 559 |
|
|
| 560 |
|
sort( lattice_result[i].begin(), lattice_result[i].end(), LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff ); |
| 561 |
|
if( MAX_SIZE < lattice_result[i].size() ) |
| 562 |
|
{ |
| 563 |
|
lattice_result[i].erase( lattice_result[i].begin() + MAX_SIZE, lattice_result[i].end() ); |
| 564 |
|
} |
| 565 |
|
|
| 566 |
|
const size_t num_lattice2 = lattice_result[i].size(); |
| 567 |
|
for(size_t n=0; n<num_lattice2; n++) |
| 568 |
|
{ |
| 569 |
|
lattice_result[i][n].setLabel(n+1); |
| 570 |
|
} |
| 571 |
|
|
| 572 |
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_cs_name(eCrystalSystem(i), abc_axis) |
| 573 |
+ " : " + num2str<Int4>( lattice_result[i].size() ) + "\n" ); |
+ " : " + num2str<Int4>( lattice_result[i].size() ) + "\n" ); |
| 574 |
} |
} |
| 584 |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes(const vector<SymMat43_VCData>& S_super, |
void SortingLattice::putLatticeCandidatesForEachBravaisTypes(const vector<SymMat43_VCData>& S_super, |
| 585 |
const Double& MIN_NormM, |
const Double& MIN_NormM, |
| 586 |
const Double& MIN_RevM, |
const Double& MIN_RevM, |
| 587 |
|
const size_t& MAX_SIZE, |
| 588 |
const eABCaxis& abc_axis, |
const eABCaxis& abc_axis, |
| 589 |
const eRHaxis& rh_axis, |
const eRHaxis& rh_axis, |
| 590 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 594 |
|
|
| 595 |
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) |
| 596 |
+ " or " + putLabel(SCRevM) + " less than " + num2str(MIN_RevM) |
+ " or " + putLabel(SCRevM) + " less than " + num2str(MIN_RevM) |
| 597 |
+ " are automatically removed).\n\n" ); |
+ " are automatically removed).\n" ); |
| 598 |
|
ZLOG_INFO( "All the unit-cell parameters are being optimized by linear least squares...\n" ); |
| 599 |
|
|
| 600 |
ZLOG_INFO( "The program has removed " + num2str<Int4>( S_super.size() - lattice_result_tri.size() ) |
//ZLOG_INFO( "The program has removed " + num2str<Int4>( S_super.size() - lattice_result_tri.size() ) |
| 601 |
+ " solutions because their " + putLabel(SCWuM) + " is less than " + num2str(MIN_NormM) |
// + " triclinic solutions because their " + putLabel(SCWuM) + " is less than " + num2str(MIN_NormM) |
| 602 |
+ " or their " + putLabel(SCRevM) + " is less than " + num2str(MIN_RevM) + ".\n\n" ); |
// + " or their " + putLabel(SCRevM) + " is less than " + num2str(MIN_RevM) + ".\n\n" ); |
| 603 |
ZLOG_INFO( "Determination of the Bravais type is being carried out...\n" ); |
//ZLOG_INFO( "Determination of the Bravais type is being carried out...\n" ); |
| 604 |
putLatticeCandidatesForEachBravaisTypes(MIN_NormM, MIN_RevM, abc_axis, rh_axis, lattice_result); |
putLatticeCandidatesForEachBravaisTypes(MIN_NormM, MIN_RevM, MAX_SIZE, abc_axis, rh_axis, lattice_result); |
| 605 |
} |
} |
| 606 |
|
|
| 607 |
|
|
| 608 |
void SortingLattice::setNumberOfNeighbors(const eABCaxis& baxis_flag, |
void SortingLattice::setNumberOfNeighbors(const eABCaxis& baxis_flag, |
| 609 |
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
bool (*CmpFunc)(const LatticeFigureOfMeritToCheckSymmetry&, const LatticeFigureOfMeritToCheckSymmetry&), |
| 610 |
|
vector<LatticeFigureOfMeritToCheckSymmetry> lattice_result[NUM_LS]) const |
| 611 |
{ |
{ |
| 612 |
|
|
| 613 |
#ifdef _OPENMP |
#ifdef _OPENMP |
| 671 |
if( RLCS.equiv( latFOM2_prim.putSellingReducedForm() ) ) |
if( RLCS.equiv( latFOM2_prim.putSellingReducedForm() ) ) |
| 672 |
{ |
{ |
| 673 |
// Compare the figures of merit. |
// Compare the figures of merit. |
| 674 |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 |
if( CmpFunc( latFOM2, latFOM0 ) ) |
|
&& LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff( latFOM2, latFOM0 ) ) |
|
| 675 |
{ |
{ |
| 676 |
count = -1; |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
| 677 |
break; |
{ |
| 678 |
|
count = -1; |
| 679 |
|
break; |
| 680 |
|
} |
| 681 |
} |
} |
| 682 |
else |
else |
| 683 |
{ |
{ |
| 700 |
if( check_equiv_m( latFOM0_prim.putInverseOfMinkowskiReducedForm(), latFOM2_prim.putInverseOfMinkowskiReducedForm(), m_resol2 ) ) |
if( check_equiv_m( latFOM0_prim.putInverseOfMinkowskiReducedForm(), latFOM2_prim.putInverseOfMinkowskiReducedForm(), m_resol2 ) ) |
| 701 |
{ |
{ |
| 702 |
// Compare the figures of merit. |
// Compare the figures of merit. |
| 703 |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 |
if( CmpFunc( latFOM2, latFOM0 ) ) |
|
&& LatticeFigureOfMeritToCheckSymmetry::cmpFOMdeWolff( latFOM2, latFOM0 ) ) |
|
| 704 |
{ |
{ |
| 705 |
count = -1; |
if( latFOM2.putNumberOfLatticesInNeighborhood() >= 0 ) |
| 706 |
break; |
{ |
| 707 |
|
count = -1; |
| 708 |
|
break; |
| 709 |
|
} |
| 710 |
} |
} |
| 711 |
else |
else |
| 712 |
{ |
{ |
| 721 |
} |
} |
| 722 |
|
|
| 723 |
Int4& index = index_tray[i]; |
Int4& index = index_tray[i]; |
| 724 |
|
index = 0; |
| 725 |
for(vector<LatticeFigureOfMeritToCheckSymmetry>::const_iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
for(vector<LatticeFigureOfMeritToCheckSymmetry>::const_iterator it=lattice_result[i].begin(); it<lattice_result[i].end(); it++) |
| 726 |
{ |
{ |
| 727 |
if( it->putNumberOfLatticesInNeighborhood() >= 0 ) index++; |
if( it->putNumberOfLatticesInNeighborhood() >= 0 ) index++; |