use crate::cell::{cel_is_overlap, cel_layer_is_overlap, AperiodicAxis};
use crate::debug;
use crate::mathfunc::{
Mat3, Mat3I, Vec3, mat_cast_matrix_3i_to_3d, mat_check_identity_matrix_i3,
mat_dmod1, mat_get_determinant_i3, mat_get_similar_matrix_d3, mat_multiply_matrix_d3,
mat_multiply_matrix_vector_d3, mat_multiply_matrix_vector_id3,
};
use crate::spg_database::{Centering, spgdb_get_operation_index, spgdb_get_operation_by_index};
use crate::symmetry::Symmetry;
static M_RC_INV: [[f64; 3]; 3] = [
[0.6666666666666666, -0.3333333333333333, -0.3333333333333333],
[0.3333333333333333, 0.3333333333333333, -0.6666666666666666],
[0.3333333333333333, 0.3333333333333333, 0.3333333333333333]];
static M_CC_INV: [[f64; 3]; 3] = [
[0.5, 0.5, 0.0],
[-0.5, 0.5, 0.0],
[0.0, 0.0, 1.0]];
static M_BC_INV: [[f64; 3]; 3] = [
[0.5, 0.0, -0.5],
[0.0, 1.0, 0.0],
[0.5, 0.0, 0.5]];
static M_AC_INV: [[f64; 3]; 3] = [
[1.0, 0.0, 0.0],
[0.0, 0.5, -0.5],
[0.0, 0.5, 0.5]];
static M_FCC_INV: [[f64; 3]; 3] = [
[0.0, 0.5, 0.5],
[0.5, 0.0, 0.5],
[0.5, 0.5, 0.0]];
static M_BCC_INV: [[f64; 3]; 3] = [
[-0.5, 0.5, 0.5],
[0.5, -0.5, 0.5],
[0.5, 0.5, -0.5]];
static M_RC: [[i32; 3]; 3] = [
[1, 0, 1],
[-1, 1, 1],
[0, -1, 1]];
static M_CC: [[i32; 3]; 3] = [
[1, -1, 0],
[1, 1, 0],
[0, 0, 1]];
static M_BC: [[i32; 3]; 3] = [
[1, 0, 1],
[0, 1, 0],
[-1, 0, 1]];
static M_AC: [[i32; 3]; 3] = [
[1, 0, 0],
[0, 1, 1],
[0, -1, 1]];
static M_FCC: [[i32; 3]; 3] = [
[-1, 1, 1],
[1, -1, 1],
[1, 1, -1]];
static M_BCC: [[i32; 3]; 3] =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
0,
-1],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
-1,
0,
1,
0,
0,
0,
0,
1],
[
1,
0,
0,
0,
-1,
0,
0,
0,
-1],
[
-1,
0,
0,
0,
-1,
0,
0,
0,
-1]]];
static TRIGO_VSPU: [[[f64; 9]; 3]; 13] = [
[
[
-0.6666666666666666,
0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
-0.3333333333333333,
-0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
0.0,
0.3333333333333333,
0.0,
-0.6666666666666666,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
-0.3333333333333333,
0.0,
-0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
-0.5,
0.0,
0.0,
0.0]],
[
[
0.0,
-1.0,
0.0,
-2.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
-1.0,
0.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
-0.5,
0.0,
0.0,
0.0]],
[
[
0.0,
-1.0,
0.0,
-2.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
-1.0,
0.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
0.0,
0.3333333333333333,
0.0,
-0.6666666666666666,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
-0.3333333333333333,
0.0,
-0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
0.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
1.0,
-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1,
0,
1,
0,
1,
0,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
-1,
0,
0,
0,
-1,
0,
0,
0,
-1],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
0,
0,
-1,
0,
-1,
0,
-1,
0,
0],
[
-1,
0,
0,
0,
-1,
0,
0,
0,
-1]]];
static HEXA_VSPU: [[[f64; 9]; 3]; 8] = [
[
[
-1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
1.0,
0.0,
0.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
-0.5,
0.0,
0.0,
0.0]],
[
[
-1.0,
0.0,
0.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
-1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
-0.3333333333333333,
-0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.3333333333333333,
-0.6666666666666666,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
-0.5,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0]],
[
[
-0.3333333333333333,
0.0,
0.0,
-0.3333333333333333,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.3333333333333333,
0.0,
0.0,
-0.6666666666666666,
0.0,
0.0,
0.0,
0.0,
0.0],
[
0.0,
0.0,
-0.5,
0.0,
0.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
0,
0,
0,
-1,
0,
0,
0,
1],
[
0,
0,
-1,
-1,
0,
0,
0,
-1,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
1,
0,
-1,
0,
0,
0,
0,
-1],
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
1,
0,
-1,
0,
0,
0,
0,
-1],
[
0,
0,
-1,
-1,
0,
0,
0,
-1,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
1,
0,
0,
0,
1,
0,
0,
0,
-1],
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
1,
0,
0,
0,
1,
0,
0,
0,
-1],
[
0,
0,
-1,
-1,
0,
0,
0,
-1,
0],
[
0,
0,
0,
0,
0,
0,
0,
0,
0]],
[
[
0,
-1,
0,
1,
0,
0,
0,
0,
1],
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
-1,
0,
0,
0,
-1,
0,
0,
0,
-1]],
[
[
-1,
0,
0,
0,
-1,
0,
0,
0,
1],
[
0,
0,
1,
1,
0,
0,
0,
1,
0],
[
-1,
0,
0,
0,
-1,
0,
0,
0,
-1]]];
pub fn hal_match_hall_symbol_db(
origin_shift: &mut Vec3,
bravais_lattice: &Mat3,
hall_number: i32,
centering: Centering,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
find_hall_symbol(
origin_shift,
bravais_lattice,
hall_number,
centering,
symmetry,
symprec,
)
}
fn find_hall_symbol(
origin_shift: &mut Vec3,
bravais_lattice: &Mat3,
hall_number: i32,
centering: Centering,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
let mut primitive_lattice = [[0.0; 3]; 3];
match centering {
Centering::Primitive => primitive_lattice = *bravais_lattice,
Centering::Body => primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_BCC_INV),
Centering::Face => primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_FCC_INV),
Centering::AFace => primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_AC_INV),
Centering::BFace => primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_BC_INV),
Centering::CFace => primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_CC_INV),
Centering::RCenter => {
primitive_lattice = mat_multiply_matrix_d3(bravais_lattice, &M_RC_INV)
}
_ => {}
}
let mut found = false;
if (489..=530).contains(&hall_number) {
if is_hall_symbol_cubic(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
centering,
symprec,
) {
found = true;
}
} else if (462..=488).contains(&hall_number) || (-116..=-109).contains(&hall_number) {
if is_hall_symbol_hexa(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
symprec,
) {
found = true;
}
} else if (430..=461).contains(&hall_number) || (-108..=-101).contains(&hall_number) {
if matches!(
hall_number,
433 | 434 | 436 | 437 | 444 | 445 | 450 | 451 | 452 | 453 | 458 | 459 | 460 | 461
) {
if is_hall_symbol_rhombo(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
symprec,
) {
found = true;
}
} else {
if is_hall_symbol_trigonal(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
symprec,
) {
found = true;
}
}
} else if (349..=429).contains(&hall_number) || (-100..=-82).contains(&hall_number) {
if is_hall_symbol_tetra(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
centering,
symprec,
) {
found = true;
}
} else if (108..=348).contains(&hall_number) || (-81..=-34).contains(&hall_number) {
if is_hall_symbol_ortho(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
centering,
symprec,
) {
found = true;
}
} else if (3..=107).contains(&hall_number) || (-33..=-3).contains(&hall_number) {
if is_hall_symbol_monocli(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
centering,
symprec,
) {
found = true;
}
} else if (-2..=2).contains(&hall_number) && hall_number != 0 {
if is_hall_symbol_tricli(
origin_shift,
hall_number,
&primitive_lattice,
symmetry,
symprec,
) {
found = true;
}
}
if found {
match centering {
Centering::Primitive => {}
Centering::Body => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_BCC_INV, origin_shift)
}
Centering::Face => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_FCC_INV, origin_shift)
}
Centering::AFace => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_AC_INV, origin_shift)
}
Centering::BFace => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_BC_INV, origin_shift)
}
Centering::CFace => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_CC_INV, origin_shift)
}
Centering::RCenter => {
*origin_shift = mat_multiply_matrix_vector_d3(&M_RC_INV, origin_shift)
}
_ => {}
}
return true;
}
false
}
fn is_hall_symbol_cubic(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
centering: Centering,
symprec: f64,
) -> bool {
for i in 0..10 {
let (generators, vspu) = match centering {
Centering::Primitive => (&CUBIC_GENERATORS[i], &CUBIC_VSPU[i]),
Centering::Body => (&CUBIC_GENERATORS[i], &CUBIC_I_VSPU[i]),
Centering::Face => (&CUBIC_GENERATORS[i], &CUBIC_F_VSPU[i]),
_ => continue,
};
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
centering,
generators,
vspu,
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_hexa(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
for i in 0..8 {
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
Centering::Primitive,
&HEXA_GENERATORS[i],
&HEXA_VSPU[i],
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_trigonal(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
for i in 0..13 {
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
Centering::Primitive,
&TRIGO_GENERATORS[i],
&TRIGO_VSPU[i],
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_rhombo(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
if matches!(hall_number, 433 | 436 | 444 | 450 | 452 | 458 | 460) {
for i in 0..8 {
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
Centering::RCenter,
&RHOMBO_H_GENERATORS[i],
&RHOMBO_H_VSPU[i],
symprec,
) {
return true;
}
}
} else {
for i in 0..8 {
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
Centering::Primitive,
&RHOMBO_P_GENERATORS[i],
&RHOMBO_P_VSPU[i],
symprec,
) {
return true;
}
}
}
false
}
fn is_hall_symbol_tetra(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
centering: Centering,
symprec: f64,
) -> bool {
for i in 0..8 {
let (generators, vspu) = match centering {
Centering::Primitive => (&TETRA_GENERATORS[i], &TETRA_VSPU[i]),
Centering::Body => (&TETRA_GENERATORS[i], &TETRA_I_VSPU[i]),
_ => continue,
};
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
centering,
generators,
vspu,
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_ortho(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
centering: Centering,
symprec: f64,
) -> bool {
for i in 0..5 {
let (generators, vspu) = match centering {
Centering::Primitive => (&ORTHO_GENERATORS[i], &ORTHO_VSPU[i]),
Centering::Body => (&ORTHO_GENERATORS[i], &ORTHO_I_VSPU[i]),
Centering::Face => (&ORTHO_GENERATORS[i], &ORTHO_F_VSPU[i]),
Centering::AFace => (&ORTHO_GENERATORS[i], &ORTHO_A_VSPU[i]),
Centering::BFace => (&ORTHO_GENERATORS[i], &ORTHO_B_VSPU[i]),
Centering::CFace => (&ORTHO_GENERATORS[i], &ORTHO_C_VSPU[i]),
_ => continue,
};
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
centering,
generators,
vspu,
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_monocli(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
centering: Centering,
symprec: f64,
) -> bool {
for i in 0..9 {
let (generators, vspu) = match centering {
Centering::Primitive => (&MONOCLI_GENERATORS[i], &MONOCLI_VSPU[i]),
Centering::AFace => (&MONOCLI_GENERATORS[i], &MONOCLI_A_VSPU[i]),
Centering::BFace => (&MONOCLI_GENERATORS[i], &MONOCLI_B_VSPU[i]),
Centering::CFace => (&MONOCLI_GENERATORS[i], &MONOCLI_C_VSPU[i]),
Centering::Body => (&MONOCLI_GENERATORS[i], &MONOCLI_I_VSPU[i]),
_ => continue,
};
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
centering,
generators,
vspu,
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol_tricli(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
for i in 0..2 {
if is_hall_symbol(
shift,
hall_number,
primitive_lattice,
symmetry,
Centering::Primitive,
&TRICLI_GENERATORS[i],
&TRICLI_VSPU[i],
symprec,
) {
return true;
}
}
false
}
fn is_hall_symbol(
shift: &mut Vec3,
hall_number: i32,
primitive_lattice: &Mat3,
symmetry: &Symmetry,
centering: Centering,
generators: &[[i32; 9]; 3],
vspu: &[[f64; 9]; 3],
_symprec: f64,
) -> bool {
let (op_count, _op_start) = spgdb_get_operation_index(hall_number as usize);
if op_count == 0 {
return false;
}
let op_count_i32 = op_count as i32;
if op_count != symmetry.size {
return false;
}
let trace = hall_number == 497;
if trace { eprintln!(" is_hall_symbol(hall={}): op_count={}, symmetry.size={}", hall_number, op_count_i32, symmetry.size); }
let mut rot = [[[0; 3]; 3]; 3];
rot = unpack_generators(generators);
if trace { eprintln!(" is_hall_symbol: generators unpacked, rot[0]={:?}, rot[1]={:?}, rot[2]={:?}", rot[0], rot[1], rot[2]); }
let mut trans = [[0.0; 3]; 3];
if !get_translations(&mut trans, symmetry, &rot) {
if trace { eprintln!(" is_hall_symbol: get_translations failed"); }
return false;
}
if trace { eprintln!(" is_hall_symbol: trans = {:?}", trans); }
if get_origin_shift(shift, hall_number, &rot, &trans, centering, vspu) {
if trace { eprintln!(" is_hall_symbol: get_origin_shift succeeded, shift={:?}", shift); }
if is_match_database(
hall_number,
shift,
primitive_lattice,
centering,
symmetry,
_symprec,
) {
if trace { eprintln!(" is_hall_symbol: is_match_database succeeded!"); }
return true;
} else {
if trace { eprintln!(" is_hall_symbol: is_match_database failed"); }
}
} else {
if trace { eprintln!(" is_hall_symbol: get_origin_shift failed"); }
}
false
}
fn unpack_generators(generators: &[[i32; 9]; 3]) -> [[[i32; 3]; 3]; 3] {
let mut rot = [[[0; 3]; 3]; 3];
for i in 0..3 {
for j in 0..3 {
for k in 0..3 {
rot[i][j][k] = generators[i][j * 3 + k];
}
}
}
rot
}
fn get_translations(
trans: &mut [[f64; 3]; 3],
symmetry: &Symmetry,
rot: &[[[i32; 3]; 3]; 3],
) -> bool {
let zero = [[0; 3]; 3];
for i in 0..3 {
trans[i] = [0.0; 3];
}
for i in 0..3 {
if mat_check_identity_matrix_i3(&rot[i], &zero) {
continue;
}
let mut is_found = false;
for j in 0..symmetry.size {
if mat_check_identity_matrix_i3(&symmetry.rot[j], &rot[i]) {
trans[i] = symmetry.trans[j];
is_found = true;
break;
}
}
if !is_found {
return false;
}
}
true
}
fn get_origin_shift(
shift: &mut Vec3,
hall_number: i32,
rot: &[[[i32; 3]; 3]; 3],
trans: &[[f64; 3]; 3],
centering: Centering,
vspu: &[[f64; 9]; 3],
) -> bool {
let (count, start_index) = spgdb_get_operation_index(hall_number as usize);
if count == 0 {
return false;
}
let mut dw = [0.0; 9];
for i in 0..3 {
if mat_get_determinant_i3(&rot[i]) == 0 {
for j in 0..3 {
dw[i * 3 + j] = 0.0;
}
} else {
let mut tmp_dw = [0.0; 3];
if set_dw(
&mut tmp_dw,
count,
start_index,
&rot[i],
&trans[i],
centering,
) {
dw[i * 3] = mat_dmod1(tmp_dw[0]);
dw[i * 3 + 1] = mat_dmod1(tmp_dw[1]);
dw[i * 3 + 2] = if hall_number > 0 {
mat_dmod1(tmp_dw[2])
} else {
tmp_dw[2]
};
} else {
return false;
}
}
}
for i in 0..3 {
shift[i] = 0.0;
for j in 0..9 {
shift[i] += vspu[i][j] * dw[j];
}
}
shift[0] = mat_dmod1(shift[0]);
shift[1] = mat_dmod1(shift[1]);
shift[2] = if hall_number > 0 {
mat_dmod1(shift[2])
} else {
shift[2]
};
true
}
fn set_dw(
dw: &mut Vec3,
count: usize,
start_index: usize,
rot: &Mat3I,
trans: &Vec3,
centering: Centering,
) -> bool {
let mut trans_prim = [0.0; 3];
trans_prim = transform_translation(centering, trans);
for i in 0..count {
if let Some((rot_db, trans_db)) = spgdb_get_operation_by_index(start_index + i) {
let mut trans_db_prim = [0.0; 3];
trans_db_prim = transform_translation(centering, &trans_db);
if mat_check_identity_matrix_i3(&rot_db, rot) {
for j in 0..3 {
dw[j] = trans_prim[j] - trans_db_prim[j];
}
return true;
}
}
}
false
}
fn transform_translation(centering: Centering, trans: &Vec3) -> Vec3 {
match centering {
Centering::Primitive => *trans,
Centering::Body => mat_multiply_matrix_vector_id3(&M_BCC, trans),
Centering::Face => mat_multiply_matrix_vector_id3(&M_FCC, trans),
Centering::AFace => mat_multiply_matrix_vector_id3(&M_AC, trans),
Centering::BFace => mat_multiply_matrix_vector_id3(&M_BC, trans),
Centering::CFace => mat_multiply_matrix_vector_id3(&M_CC, trans),
Centering::RCenter => mat_multiply_matrix_vector_id3(&M_RC, trans),
_ => *trans,
}
}
fn transform_rotation(centering: Centering, rot: &Mat3I) -> Mat3 {
let rot_d3 = mat_cast_matrix_3i_to_3d(rot);
if centering != Centering::Primitive {
let inv_matrix = match centering {
Centering::Body => Some(&M_BCC_INV),
Centering::Face => Some(&M_FCC_INV),
Centering::AFace => Some(&M_AC_INV),
Centering::BFace => Some(&M_BC_INV),
Centering::CFace => Some(&M_CC_INV),
Centering::RCenter => Some(&M_RC_INV),
_ => None,
};
if let Some(m_inv) = inv_matrix {
if let Ok(res) = mat_get_similar_matrix_d3(&rot_d3, m_inv, 0.0) {
return res;
}
}
}
rot_d3
}
fn is_match_database(
hall_number: i32,
origin_shift: &Vec3,
primitive_lattice: &Mat3,
centering: Centering,
symmetry: &Symmetry,
symprec: f64,
) -> bool {
let (count, start_index) = spgdb_get_operation_index(hall_number as usize);
if count == 0 {
return false;
}
let mut found_list = vec![false; count];
let aperiodic = AperiodicAxis::Z;
for i in 0..symmetry.size {
let mut is_found = false;
for j in 0..count {
if let Some((rot_db, trans_db)) = spgdb_get_operation_by_index(start_index + j) {
if mat_check_identity_matrix_i3(&symmetry.rot[i], &rot_db) {
let mut trans_db_prim = [0.0; 3];
trans_db_prim = transform_translation(centering, &trans_db);
let mut trans_prim = [0.0; 3];
trans_prim = transform_translation(centering, &symmetry.trans[i]);
let mut rot_prim = [[0.0; 3]; 3];
rot_prim = transform_rotation(centering, &rot_db);
let mut diff = [0.0; 3];
for k in 0..3 {
diff[k] = trans_prim[k] - trans_db_prim[k] + origin_shift[k];
}
let shift_rot = mat_multiply_matrix_vector_d3(&rot_prim, origin_shift);
let overlap = if hall_number > 0 {
cel_is_overlap(&diff, &shift_rot, primitive_lattice, symprec)
} else {
cel_layer_is_overlap(
&diff,
&shift_rot,
primitive_lattice,
aperiodic,
symprec,
)
};
if overlap {
if !found_list[j] {
found_list[j] = true;
is_found = true;
break;
}
}
}
}
}
if !is_found {
return false;
}
}
true
}