| 1 |
/* |
/* |
| 2 |
* The MIT License |
* The MIT License |
| 3 |
|
|
| 4 |
Conograph (powder auto-indexing program) |
BLDConograph (Bravais lattice determination module in Conograph) |
| 5 |
|
|
| 6 |
Copyright (c) <2012> <Ryoko Oishi-Tomiyasu, KEK> |
Copyright (c) <2012> <Ryoko Oishi-Tomiyasu, KEK> |
| 7 |
|
|
| 24 |
THE SOFTWARE. |
THE SOFTWARE. |
| 25 |
* |
* |
| 26 |
*/ |
*/ |
| 27 |
#ifdef _OPENMP |
#include <limits> |
| 28 |
# include <omp.h> |
#include "check_equiv.hh" |
|
#endif |
|
|
|
|
|
#include "lattice_symmetry.hh" |
|
| 29 |
#include "ReducedLatticeToCheckBravais.hh" |
#include "ReducedLatticeToCheckBravais.hh" |
| 30 |
#include "../utility_lattice_reduction/put_Minkowski_reduced_lattice.hh" |
#include "../utility_lattice_reduction/put_Buerger_reduced_lattice.hh" |
| 31 |
#include "../utility_lattice_reduction/super_basis3.hh" |
#include "../utility_lattice_reduction/put_Selling_reduced_lattice.hh" |
|
#include "../utility_func/lattice_constant.hh" |
|
| 32 |
#include "../utility_func/zmath.hh" |
#include "../utility_func/zmath.hh" |
| 33 |
#include "../utility_data_structure/FracMat.hh" |
#include "../utility_data_structure/FracMat.hh" |
|
#include "../utility_data_structure/Node3.hh" |
|
|
#include "../utility_data_structure/FracMat.hh" |
|
|
|
|
|
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
static void put_transform_matrix_from_sell_to_neighbor_base(vector< NRMat<Int4> >& arg, |
static void put_transform_matrix_from_sell_to_neighbor_base(vector< NRMat<Int4> >& arg, |
| 266 |
} |
} |
| 267 |
|
|
| 268 |
|
|
|
//static void put_transform_matrix_face_body(vector< NRMat<Int4> >& arg) |
|
|
//{ |
|
|
// static const Int4 ISIZE = 1; |
|
|
// static const Int4 mat_tray[ISIZE][3][3] |
|
|
// = { |
|
|
// { { 1, 0, 0}, // i : 1 0 0 |
|
|
// { 0, 1, 0}, // A = j : 0 1 0 |
|
|
// { 0, 0, 1} } // k : 0 0 1 |
|
|
// }; |
|
|
// |
|
|
// arg.clear(); |
|
|
// arg.resize(ISIZE, NRMat<Int4>(4,3)); |
|
|
// for(Int4 i=0; i<ISIZE; i++) |
|
|
// { |
|
|
// NRMat<Int4>& arg_ref = arg[i]; |
|
|
// const Int4 (*mat)[3] = mat_tray[i]; |
|
|
// for(Int4 i2=0; i2<3; i2++) |
|
|
// { |
|
|
// for(Int4 j2=0; j2<3; j2++) |
|
|
// { |
|
|
// arg_ref[i2][j2] = mat[i2][j2]; |
|
|
// } |
|
|
// } |
|
|
// for(Int4 j2=0; j2<3; j2++) |
|
|
// { |
|
|
// arg_ref[3][j2] = -(mat[0][j2]+mat[1][j2]+mat[2][j2]); |
|
|
// } |
|
|
// } |
|
|
//} |
|
|
|
|
|
|
|
| 269 |
static void put_transform_matrix_from_sell_to_neighbor_rhom(vector< NRMat<Int4> >& arg, |
static void put_transform_matrix_from_sell_to_neighbor_rhom(vector< NRMat<Int4> >& arg, |
| 270 |
const bool& does_prudent_search) |
const bool& does_prudent_search) |
| 271 |
{ |
{ |
| 494 |
static const NRMat<Int4> tmat_prim_to_Ccell1 = transpose( BravaisType::putTransformMatrixFromPrimitiveToBase(BaseC_Axis) ); |
static const NRMat<Int4> tmat_prim_to_Ccell1 = transpose( BravaisType::putTransformMatrixFromPrimitiveToBase(BaseC_Axis) ); |
| 495 |
|
|
| 496 |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(6); |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(6); |
| 497 |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_qck = S_min_to_sell[(ArrayIndex)BaseA_Axis*2]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_qck = S_min_to_sell[(size_t)BaseA_Axis*2]; |
| 498 |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_prd = S_min_to_sell[(ArrayIndex)BaseA_Axis*2+1]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minA_to_sell_prd = S_min_to_sell[(size_t)BaseA_Axis*2+1]; |
| 499 |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_qck = S_min_to_sell[(ArrayIndex)BaseB_Axis*2]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_qck = S_min_to_sell[(size_t)BaseB_Axis*2]; |
| 500 |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_prd = S_min_to_sell[(ArrayIndex)BaseB_Axis*2+1]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minB_to_sell_prd = S_min_to_sell[(size_t)BaseB_Axis*2+1]; |
| 501 |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_qck = S_min_to_sell[(ArrayIndex)BaseC_Axis*2]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_qck = S_min_to_sell[(size_t)BaseC_Axis*2]; |
| 502 |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_prd = S_min_to_sell[(ArrayIndex)BaseC_Axis*2+1]; |
vector< pair< NRMat<Int4>, FracMat > >& S_minC_to_sell_prd = S_min_to_sell[(size_t)BaseC_Axis*2+1]; |
| 503 |
|
|
| 504 |
vector< NRMat<Int4> > mat_tray; |
vector< NRMat<Int4> > mat_tray; |
| 505 |
NRMat<Int4> mat(3,3); |
NRMat<Int4> mat(3,3); |
| 541 |
NRMat<Int4> mat = mprod(put_matrix_XYZ(), tmat_prim_to_face); |
NRMat<Int4> mat = mprod(put_matrix_XYZ(), tmat_prim_to_face); |
| 542 |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 543 |
|
|
| 544 |
mat = mprod(put_matrix_XZY(), tmat_prim_to_face); |
mat = mprod(put_matrix_ZXY(), tmat_prim_to_face); |
| 545 |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
S_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 546 |
|
|
| 547 |
mat = mprod(put_matrix_YZX(), tmat_prim_to_face); |
mat = mprod(put_matrix_YZX(), tmat_prim_to_face); |
| 561 |
NRMat<Int4> mat = mprod(put_matrix_XYZ(), tmat_prim_to_body); |
NRMat<Int4> mat = mprod(put_matrix_XYZ(), tmat_prim_to_body); |
| 562 |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 563 |
|
|
| 564 |
mat = mprod(put_matrix_XZY(), tmat_prim_to_body); |
mat = mprod(put_matrix_ZXY(), tmat_prim_to_body); |
| 565 |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
InvS_min_to_sell.push_back( pair< NRMat<Int4>, FracMat >( mat, FInverse3( mat ) ) ); |
| 566 |
|
|
| 567 |
mat = mprod(put_matrix_YZX(), tmat_prim_to_body); |
mat = mprod(put_matrix_YZX(), tmat_prim_to_body); |
| 577 |
static const NRMat<Int4> tmat_prim_to_rhomhex = transpose( BravaisType::putTransformMatrixFromPrimitiveToRhomHex() ); |
static const NRMat<Int4> tmat_prim_to_rhomhex = transpose( BravaisType::putTransformMatrixFromPrimitiveToRhomHex() ); |
| 578 |
|
|
| 579 |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(4); |
vector< vector< pair< NRMat<Int4>, FracMat > > > S_min_to_sell(4); |
| 580 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_qck = S_min_to_sell[(ArrayIndex)Rho_Axis*2]; |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_qck = S_min_to_sell[(size_t)Rho_Axis*2]; |
| 581 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_prd = S_min_to_sell[(ArrayIndex)Rho_Axis*2+1]; |
vector< pair< NRMat<Int4>, FracMat > >& S_min_rho_to_sell_prd = S_min_to_sell[(size_t)Rho_Axis*2+1]; |
| 582 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_qck = S_min_to_sell[(ArrayIndex)Hex_Axis*2]; |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_qck = S_min_to_sell[(size_t)Hex_Axis*2]; |
| 583 |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_prd = S_min_to_sell[(ArrayIndex)Hex_Axis*2+1]; |
vector< pair< NRMat<Int4>, FracMat > >& S_min_hex_to_sell_prd = S_min_to_sell[(size_t)Hex_Axis*2+1]; |
| 584 |
|
|
| 585 |
vector< NRMat<Int4> > mat_tray; |
vector< NRMat<Int4> > mat_tray; |
| 586 |
NRMat<Int4> mat(3,3); |
NRMat<Int4> mat(3,3); |
| 613 |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_rhom = put_Transform_Matrix_rhom(); |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_rhom = put_Transform_Matrix_rhom(); |
| 614 |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_base = put_Transform_Matrix_base(); |
const vector< vector< pair< NRMat<Int4>, FracMat > > > ReducedLatticeToCheckBravais::m_trans_mat_red_base = put_Transform_Matrix_base(); |
| 615 |
|
|
| 616 |
|
|
| 617 |
|
static bool operator<(const SymMat<Double>& lhs, const SymMat<Double>& rhs) |
| 618 |
|
{ |
| 619 |
|
static const Double EPS_1 = 1.0+sqrt( numeric_limits<double>::epsilon() ); |
| 620 |
|
assert( lhs.size() == 3 ); |
| 621 |
|
assert( rhs.size() == 3 ); |
| 622 |
|
|
| 623 |
|
static const Int4 ISIZE = 3; |
| 624 |
|
for(Int4 i=0; i<ISIZE; i++) |
| 625 |
|
{ |
| 626 |
|
if( lhs(i,i)*EPS_1 < rhs(i,i) ) return true; |
| 627 |
|
if( rhs(i,i)*EPS_1 < lhs(i,i) ) return false; |
| 628 |
|
|
| 629 |
|
for(Int4 j=0; j<i; j++) |
| 630 |
|
{ |
| 631 |
|
const Double lhs_ij = lhs(i,i)+lhs(j,j)+lhs(i,j)*2.0; |
| 632 |
|
const Double rhs_ij = rhs(i,i)+rhs(j,j)+rhs(i,j)*2.0; |
| 633 |
|
|
| 634 |
|
if( lhs_ij*EPS_1 < rhs_ij ) return true; |
| 635 |
|
if( rhs_ij*EPS_1 < lhs_ij ) return false; |
| 636 |
|
} |
| 637 |
|
} |
| 638 |
|
|
| 639 |
|
return false; |
| 640 |
|
} |
| 641 |
|
|
| 642 |
|
|
| 643 |
|
|
| 644 |
ReducedLatticeToCheckBravais::ReducedLatticeToCheckBravais( |
ReducedLatticeToCheckBravais::ReducedLatticeToCheckBravais( |
| 645 |
const eABCaxis& axis1, |
const eABCaxis& axis1, |
| 646 |
const eRHaxis& axis2, |
const eRHaxis& axis2, |
| 647 |
const bool& does_prudent_sym_search, |
const bool& does_prudent_sym_search, |
| 648 |
const Double& resol2, const SymMat43_VCData & S_red) |
const Double& resol, const SymMat<Double>& S_super) |
| 649 |
: m_monoclinic_b_type(put_monoclinic_b_type(axis1)), |
: m_monoclinic_b_type(put_monoclinic_b_type(axis1)), |
| 650 |
m_rhombohedral_type(put_rhombohedral_type(axis2)), |
m_rhombohedral_type(put_rhombohedral_type(axis2)), |
| 651 |
m_S_red( S_red ), |
m_S_super_obtuse( S_super ) |
|
m_S_super_obtuse( transform_sym_matrix(m_S_red.second, m_S_red.first) ) |
|
| 652 |
{ |
{ |
| 653 |
put_S_Minkowski_reduced_IF(resol2, m_S_super_obtuse, m_S_red_body, false); |
put_S_Buerger_reduced_IF(resol, m_S_super_obtuse, m_S_red_body, false); |
| 654 |
put_S_Minkowski_reduced_base(m_monoclinic_b_type, does_prudent_sym_search, resol2, m_S_super_obtuse, m_S_red_base); |
put_S_Buerger_reduced_base(m_monoclinic_b_type, does_prudent_sym_search, resol, m_S_super_obtuse, m_S_red_base); |
| 655 |
put_S_Minkowski_reduced_rhom(m_rhombohedral_type, does_prudent_sym_search, resol2, m_S_super_obtuse, m_S_red_rhom); |
put_S_Buerger_reduced_rhom(m_rhombohedral_type, does_prudent_sym_search, resol, m_S_super_obtuse, m_S_red_rhom); |
| 656 |
|
|
| 657 |
const SymMat<VCData> S_super_obtuse3( put_sym_matrix_size4to3(m_S_super_obtuse) ); |
const SymMat<Double> S_super_obtuse3( put_sym_matrix_sizeNplus1toN(m_S_super_obtuse) ); |
| 658 |
const SymMat<Double> inv_S( Inverse3( chToDouble( S_super_obtuse3 ) ) ); |
const SymMat<Double> inv_S( Inverse3( S_super_obtuse3 ) ); |
| 659 |
|
|
| 660 |
// Calculate the inverse of m_S_red. |
// Calculate the inverse of m_S_red. |
| 661 |
SymMat<Double> inv_S_super_obtuse(4); |
SymMat<Double> inv_S_super_obtuse(4); |
| 662 |
NRMat<Int4> tmat_inv_S_super_obtuse(4,3); |
NRMat<Int4> tmat_inv_S_super_obtuse(4,3); |
| 663 |
|
|
| 664 |
// inv_S_super_obtuse = transpose( tmat_inv_S_super_obtuse) * inverse(S_super_obtuse3) * tmat_inv_S_super_obtuse. |
// inv_S_super_obtuse = transpose( tmat_inv_S_super_obtuse) * inverse(S_super_obtuse3) * tmat_inv_S_super_obtuse. |
| 665 |
put_super_Gram_matrix_obtuse_angle<Double, SymMat<Double> >(inv_S, inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
put_Selling_reduced_dim_less_than_4(inv_S, inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
| 666 |
moveSmallerDiagonalLeftUpper<Double, SymMat<Double> >(inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
moveSmallerDiagonalLeftUpper(inv_S_super_obtuse, tmat_inv_S_super_obtuse); |
| 667 |
tmat_inv_S_super_obtuse = put_transform_matrix_row4to3(tmat_inv_S_super_obtuse); |
tmat_inv_S_super_obtuse = put_transform_matrix_row4to3(tmat_inv_S_super_obtuse); |
| 668 |
transpose_square_matrix(tmat_inv_S_super_obtuse); |
transpose_square_matrix(tmat_inv_S_super_obtuse); |
| 669 |
|
|
| 670 |
const SymMat<VCData> S_inv_super_obtuse |
const SymMat<Double> S_inv_super_obtuse |
| 671 |
= put_sym_matrix_size3to4( transform_sym_matrix( Inverse3(tmat_inv_S_super_obtuse), S_super_obtuse3 ) ); |
= put_sym_matrix_sizeNtoNplus1( transform_sym_matrix( Inverse3(tmat_inv_S_super_obtuse), S_super_obtuse3 ) ); |
| 672 |
|
|
| 673 |
put_S_Minkowski_reduced_IF(resol2, S_inv_super_obtuse, m_S_red_face, true); |
put_S_Buerger_reduced_IF(resol, S_inv_super_obtuse, m_S_red_face, true); |
| 674 |
|
|
| 675 |
for(map< SymMat<VCData>, NRMat<Int4> >::iterator it=m_S_red_face.begin(); it!=m_S_red_face.end(); it++) |
for(map< SymMat<Double>, NRMat<Int4> >::iterator it=m_S_red_face.begin(); it!=m_S_red_face.end(); it++) |
| 676 |
{ |
{ |
| 677 |
it->second = put_transform_matrix_row3to4( mprod(tmat_inv_S_super_obtuse, put_transform_matrix_row4to3(it->second) ) ); |
it->second = put_transform_matrix_row3to4( mprod(tmat_inv_S_super_obtuse, put_transform_matrix_row4to3(it->second) ) ); |
| 678 |
} |
} |
| 686 |
|
|
| 687 |
// On input, inv_flag = false indicates that S_super_obtuse_equiv is Selling-reduced, |
// On input, inv_flag = false indicates that S_super_obtuse_equiv is Selling-reduced, |
| 688 |
// and inv_flag = true indicates that Inverse(S_super_obtuse_equiv) is Selling-reduced. |
// and inv_flag = true indicates that Inverse(S_super_obtuse_equiv) is Selling-reduced. |
| 689 |
// In the former case, on output, S_red_body are symmetric matrices having a body-centered and Minkowski-reduced inverse. |
// In the former case, on output, S_red_body are symmetric matrices having a body-centered and Buerger-reduced inverse. |
| 690 |
// In the latter case, on output, S_red_IF are symmetric matrices having a face-centered and Minkowski-reduced inverse. |
// In the latter case, on output, S_red_IF are symmetric matrices having a face-centered and Buerger-reduced inverse. |
| 691 |
void ReducedLatticeToCheckBravais::put_S_Minkowski_reduced_IF( |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_IF( |
| 692 |
const Double& cv2, const SymMat<VCData>& S_super_obtuse, |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 693 |
map< SymMat<VCData>, NRMat<Int4> >& S_red_IF, |
map< SymMat<Double>, NRMat<Int4> >& S_red_IF, |
| 694 |
const bool& inv_flag) |
const bool& inv_flag) |
| 695 |
{ |
{ |
| 696 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_IF = (inv_flag?m_trans_mat_red_F:m_trans_mat_red_I); |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_IF = (inv_flag?m_trans_mat_red_F:m_trans_mat_red_I); |
| 697 |
S_red_IF.clear(); |
S_red_IF.clear(); |
| 698 |
|
|
| 699 |
NRMat<Int4> tmat; |
NRMat<Int4> tmat; |
| 700 |
SymMat<VCData> S2_red0(3), S2_red(3); |
SymMat<Double> S2_red0(3), S2_red(3); |
| 701 |
|
|
| 702 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_IF.begin(); it!=tmat_red_IF.end(); it++) |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_IF.begin(); it!=tmat_red_IF.end(); it++) |
| 703 |
{ |
{ |
| 704 |
const FracMat& inv_mat = it->second; |
const FracMat& inv_mat = it->second; |
| 705 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_size4to3(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 706 |
S2_red = S2_red0; |
S2_red = S2_red0; |
| 707 |
|
|
| 708 |
cal_average_crystal_system(D2h, S2_red); |
cal_average_crystal_system(D2h, S2_red); |
| 709 |
if( !check_equiv_m(S2_red0, S2_red, cv2) ) continue; |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 710 |
|
|
| 711 |
tmat = identity_matrix<Int4>(3); |
tmat = identity_matrix<Int4>(3); |
| 712 |
moveLargerDiagonalLeftUpper< VCData, SymMat<VCData> >(S2_red, tmat); |
moveLargerDiagonalLeftUpper(S2_red, tmat); |
| 713 |
tmat = mprod( put_transform_matrix_row3to4(it->first), transpose(tmat) ); // inverse(tmat) = transpose(tmat). |
tmat = mprod( put_transform_matrix_row3to4(it->first), transpose(tmat) ); // inverse(tmat) = transpose(tmat). |
| 714 |
|
|
| 715 |
S_red_IF.insert( SymMat43_VCData(S2_red, tmat) ); |
S_red_IF.insert( SymMat43_Double(S2_red, tmat) ); |
| 716 |
} |
} |
| 717 |
} |
} |
| 718 |
|
|
| 719 |
void ReducedLatticeToCheckBravais::put_S_Minkowski_reduced_rhom( |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_rhom( |
| 720 |
const BravaisType& rhombohedral_type, |
const BravaisType& rhombohedral_type, |
| 721 |
const bool& does_prudent_sym_search, |
const bool& does_prudent_sym_search, |
| 722 |
const Double& cv2, const SymMat<VCData>& S_super_obtuse, |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 723 |
map< SymMat<VCData>, NRMat<Int4> >& S_red_rhomhex) |
map< SymMat<Double>, NRMat<Int4> >& S_red_rhomhex) |
| 724 |
{ |
{ |
| 725 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_rhom = m_trans_mat_red_rhom[(ArrayIndex)rhombohedral_type.enumRHaxis()*2+(does_prudent_sym_search?1:0)]; |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_rhom = m_trans_mat_red_rhom[(size_t)rhombohedral_type.enumRHaxis()*2+(does_prudent_sym_search?1:0)]; |
| 726 |
S_red_rhomhex.clear(); |
S_red_rhomhex.clear(); |
| 727 |
|
|
| 728 |
NRMat<Int4> tmat; |
NRMat<Int4> tmat; |
| 729 |
SymMat<VCData> S2_red0(3), S2_red(3); |
SymMat<Double> S2_red0(3), S2_red(3); |
| 730 |
|
|
| 731 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_rhom.begin(); it!=tmat_red_rhom.end(); it++) |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_rhom.begin(); it!=tmat_red_rhom.end(); it++) |
| 732 |
{ |
{ |
| 733 |
const FracMat& inv_mat = it->second; |
const FracMat& inv_mat = it->second; |
| 734 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_size4to3(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 735 |
S2_red = S2_red0; |
S2_red = S2_red0; |
| 736 |
|
|
| 737 |
cal_average_crystal_system(rhombohedral_type.enumLaueGroup(), S2_red); |
cal_average_crystal_system(rhombohedral_type.enumLaueGroup(), S2_red); |
| 738 |
if( !check_equiv_m(S2_red0, S2_red, cv2) ) continue; |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 739 |
|
|
| 740 |
tmat = put_transform_matrix_row3to4(it->first); |
tmat = put_transform_matrix_row3to4(it->first); |
| 741 |
|
|
| 742 |
S_red_rhomhex.insert( SymMat43_VCData(S2_red, tmat) ); |
S_red_rhomhex.insert( SymMat43_Double(S2_red, tmat) ); |
| 743 |
} |
} |
| 744 |
} |
} |
| 745 |
|
|
| 746 |
|
|
| 747 |
// On input, S_red is Minkowski-reduced and S_super_obtuse_equiv is Selling-reduced. |
// On input, S_red is Buerger-reduced and S_super_obtuse_equiv is Selling-reduced. |
| 748 |
// On output, S_red_base are symmetric matrices having a base-centered and Minkowski-reduced inverse. |
// On output, S_red_base are symmetric matrices having a base-centered and Buerger-reduced inverse. |
| 749 |
void ReducedLatticeToCheckBravais::put_S_Minkowski_reduced_base( |
void ReducedLatticeToCheckBravais::put_S_Buerger_reduced_base( |
| 750 |
const BravaisType& monoclinic_b_type, |
const BravaisType& monoclinic_b_type, |
| 751 |
const bool& does_prudent_sym_search, |
const bool& does_prudent_sym_search, |
| 752 |
const Double& cv2, const SymMat<VCData>& S_super_obtuse, |
const Double& resol, const SymMat<Double>& S_super_obtuse, |
| 753 |
map< SymMat<VCData>, NRMat<Int4> >& S_red_base) |
map< SymMat<Double>, NRMat<Int4> >& S_red_base) |
| 754 |
{ |
{ |
| 755 |
const ArrayIndex ibase_axis = monoclinic_b_type.enumBASEaxis(); |
const eBASEaxis ibase_axis = monoclinic_b_type.enumBASEaxis(); |
| 756 |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_base = m_trans_mat_red_base[(ArrayIndex)ibase_axis*2+(does_prudent_sym_search?1:0)]; |
const vector< pair< NRMat<Int4>, FracMat > >& tmat_red_base = m_trans_mat_red_base[(size_t)ibase_axis*2+(does_prudent_sym_search?1:0)]; |
| 757 |
|
|
| 758 |
S_red_base.clear(); |
S_red_base.clear(); |
| 759 |
|
|
| 760 |
NRMat<Int4> tmat; |
NRMat<Int4> tmat; |
| 761 |
SymMat<VCData> S2_red0(3), S2_red(3); |
SymMat<Double> S2_red0(3), S2_red(3); |
| 762 |
|
|
| 763 |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_base.begin(); it!=tmat_red_base.end(); it++) |
for(vector< pair< NRMat<Int4>, FracMat > >::const_iterator it=tmat_red_base.begin(); it!=tmat_red_base.end(); it++) |
| 764 |
{ |
{ |
| 765 |
const FracMat& inv_mat = it->second; |
const FracMat& inv_mat = it->second; |
| 766 |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_size4to3(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
S2_red0 = transform_sym_matrix(inv_mat.mat, put_sym_matrix_sizeNplus1toN(S_super_obtuse) ) / (inv_mat.denom*inv_mat.denom); |
| 767 |
S2_red = S2_red0; |
S2_red = S2_red0; |
| 768 |
|
|
| 769 |
cal_average_crystal_system(monoclinic_b_type.enumLaueGroup(), S2_red); |
cal_average_crystal_system(monoclinic_b_type.enumLaueGroup(), S2_red); |
| 770 |
|
|
| 771 |
if( !check_equiv_m(S2_red0, S2_red, cv2) ) continue; |
if( !check_equiv_m(S2_red0, S2_red, resol) ) continue; |
| 772 |
|
|
| 773 |
tmat = put_transform_matrix_row3to4(it->first); |
tmat = put_transform_matrix_row3to4(it->first); |
| 774 |
putMinkowskiReducedMonoclinicB(monoclinic_b_type, S2_red, tmat); |
putBuergerReducedMonoclinicB(monoclinic_b_type, S2_red, tmat); |
| 775 |
|
|
| 776 |
S_red_base.insert( SymMat43_VCData(S2_red, tmat) ); |
S_red_base.insert( SymMat43_Double(S2_red, tmat) ); |
| 777 |
} |
} |
| 778 |
} |
} |
| 779 |
|
|
| 780 |
|
|
| 781 |
const map< SymMat<VCData>, NRMat<Int4> >& ReducedLatticeToCheckBravais::checkBravaisLatticeType(const BravaisType& brat) const |
const map< SymMat<Double>, NRMat<Int4> >& ReducedLatticeToCheckBravais::checkCentringType(const BravaisType& brat) const |
| 782 |
{ |
{ |
| 783 |
if( brat == m_monoclinic_b_type ) |
if( brat == m_monoclinic_b_type ) |
| 784 |
{ |
{ |
| 785 |
return m_S_red_base; |
return m_S_red_base; |
| 786 |
} |
} |
| 787 |
else if( brat.enumBravaisLattice() == Face ) |
else if( brat.enumCentringType() == Face ) |
| 788 |
{ |
{ |
| 789 |
return m_S_red_face; |
return m_S_red_face; |
| 790 |
} |
} |
| 791 |
else if( brat.enumBravaisLattice() == Inner ) |
else if( brat.enumCentringType() == Inner ) |
| 792 |
{ |
{ |
| 793 |
return m_S_red_body; |
return m_S_red_body; |
| 794 |
} |
} |