22 {{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
24 {{1, -1, 1}, {1, 1, -1}, {-1, 1, 1}},
25 {{1, -1, 0}, {-1, 0, 1}, {-1, -1, -1}},
26 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
27 {{1, -1, 0}, {-1, 0, 1}, {-1, -1, -1}},
28 {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}},
30 {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}},
31 {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}},
32 {{-1, -1, 0}, {-1, 0, -1}, {0, -1, -1}},
33 {{1, 0, 0}, {-1, 1, 0}, {-1, -1, 3}},
34 {{1, 1, 0}, {1, -1, 0}, {0, 0, -1}},
36 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
37 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
38 {{1, 1, 0}, {-1, 1, 0}, {0, 0, 1}},
39 {{1, 1, 0}, {-1, 1, 0}, {0, 0, 1}},
40 {{1, 0, 0}, {0, 1, 0}, {1, 1, 2}},
42 {{-1, -1, 0}, {1, -1, 0}, {1, 1, 2}},
43 {{-1, 0, -1}, {-1, -1, 0}, {0, 1, 1}},
44 {{0, -1, 1}, {1, -1, -1}, {1, 0, 0}},
45 {{-1, 0, 0}, {0, -1, 1}, {-1, 1, 1}},
46 {{0, 1, 1}, {0, 1, -1}, {-1, 0, 0}},
48 {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}},
49 {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}},
50 {{0, 1, 1}, {0, -1, 1}, {1, 0, 0}},
51 {{1, 2, 1}, {0, -1, 1}, {1, 0, 0}},
52 {{0, 1, 1}, {0, -1, 1}, {1, 0, 0}},
54 {{1, 0, 0}, {-1, 2, 0}, {-1, 0, 2}},
55 {{0, -1, 1}, {-1, 0, 0}, {1, -1, -1}},
56 {{-1, 0, 0}, {-1, 0, 2}, {0, 1, 0}},
57 {{1, 0, 0}, {1, -2, 0}, {0, 0, -1}},
58 {{0, 1, 0}, {0, 1, -2}, {-1, 0, 0}},
60 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
61 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
62 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
63 {{-1, 0, 0}, {0, 0, -1}, {0, -1, 0}},
64 {{0, -1, 0}, {-1, 0, 0}, {0, 0, -1}},
66 {{1, 0, 0}, {-1, 0, -2}, {0, 1, 0}},
67 {{1, 0, 2}, {1, 0, 0}, {0, 1, 0}},
68 {{-1, 0, 0}, {1, 2, 0}, {0, 0, -1}},
69 {{-1, -2, 0}, {-1, 0, 0}, {0, 0, -1}},
70 {{0, -1, 0}, {0, 1, 2}, {-1, 0, 0}},
72 {{0, -1, -2}, {0, -1, 0}, {-1, 0, 0}},
73 {{-1, 0, 0}, {0, -1, 0}, {1, 1, 2}},
74 {{-1, 0, 0}, {-1, -1, -2}, {0, -1, 0}},
75 {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}};
82 {{-1, 0, -1}, {0, 1, 0}, {1, 0, 0}}};
221 if (a <= 0 || b <= 0 || c <= 0) {
222 throw std::invalid_argument(
"ReducedCell(): a, b, c, must be positive");
224 if (alpha <= 0 || alpha >= 180 || beta <= 0 || beta >= 180 || gamma <= 0 || gamma >= 180) {
225 throw std::invalid_argument(
"ReducedCell(): alpha, beta, gamma, must be between 0 and 180 degrees");
228 alpha = alpha * M_PI / 180;
229 beta = beta * M_PI / 180;
230 gamma = gamma * M_PI / 180;
232 init(
form_num, a * a, b * b, c * c, b * c * cos(alpha), a * c * cos(beta), a * b * cos(gamma));
242void ReducedCell::init(
size_t f_num,
double a_a,
double b_b,
double c_c,
double b_c,
double a_c,
double a_b) {
244 throw std::invalid_argument(
"Reduced form number must be no more than 44");
259 for (
size_t row = 0; row < 3; row++)
260 for (
size_t col = 0; col < 3; col++) {
421 scalars[3] = -(b_b - a_a / 3) / 2;
538 if (a_a < 4 *
fabs(a_c))
549 if (b_b < 4 *
fabs(b_c))
560 if (c_c < 4 *
fabs(b_c))
571 if (3 * a_a < c_c + 2 *
fabs(a_c))
582 if (3 * b_b < c_c + 2 *
fabs(b_c))
595 for (
size_t row = 0; row < 3; row++)
596 for (
size_t col = 0; col < 3; col++) {
632 std::vector<double> vals_1 =
norm_vals(*
this);
633 std::vector<double> vals_2 =
norm_vals(other);
637 for (
size_t i = 0; i < vals_1.size(); i++) {
638 double difference =
fabs(vals_1[i] - vals_2[i]);
639 if (difference > max)
653 std::vector<double> vals;
656 double a = sqrt(info.
scalars[0]);
657 double b = sqrt(info.
scalars[1]);
658 double c = sqrt(info.
scalars[2]);
667 vals[3] = sqrt((b * b + c * c - 2 * info.
scalars[3]));
668 vals[4] = sqrt((a * a + c * c - 2 * info.
scalars[4]));
669 vals[5] = sqrt((a * a + b * b - 2 * info.
scalars[5]));
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
Instances of this class represent information about reduced cell types including the transformation r...
std::string GetCellType() const
Get the cell type of this form.
void init(size_t f_num, double a_a, double b_b, double c_c, double b_c, double a_c, double a_b)
Initialize all private data to represent one row of Table 2, for the row specified by the form number...
void foot_note_b(double a_a, double a_c)
Adjust tranform and centering according to foot note b of the paper.
static const std::string HEXAGONAL()
Kernel::DblMatrix GetTransformation()
Return the transformation to map the reduced cell to the conventional cell, as listed in Table 2,...
Kernel::DblMatrix transform
double WeightedDistance(const ReducedCell &other) const
Get the maximum absolute weighted difference between the scalars for the specifed ReducedCellInfo obj...
void foot_note_f(double b_b, double c_c, double b_c)
Adjust tranform and centering according to foot note f of the paper.
static const std::string MONOCLINIC()
static const std::string RHOMBOHEDRAL()
void foot_note_c(double b_b, double b_c)
Adjust tranform and centering according to foot note c of the paper.
static const std::string CUBIC()
static const std::string F_CENTERED()
static const std::string TRICLINIC()
std::vector< double > norm_vals(const ReducedCell &info) const
Get list of six values, related to the six scalars, but adjusted so that changes in these values repr...
static const std::string NONE()
static const std::string R_CENTERED()
ReducedCell(size_t form_num=0, double a=1, double b=1, double c=1, double alpha=90, double beta=90, double gamma=90)
Construct a ReducedCell object representing the specified row of Table 2 for a reduced cell with the ...
std::string GetCentering() const
Get centering assigned to this form.
void foot_note_d(double c_c, double b_c)
Adjust tranform and centering according to foot note d of the paper.
void premultiply(size_t index)
Adjust the tranformation for this reduced cell by premultiplying by modification transform 0 or 1.
void foot_note_e(double a_a, double c_c, double a_c)
Adjust tranform and centering according to foot note e of the paper.
static const std::string TETRAGONAL()
static const std::string ORTHORHOMBIC()
size_t GetFormNum() const
Get the form number used to construct this form.
static const std::string P_CENTERED()
static const std::string I_CENTERED()
static const std::string C_CENTERED()
static const std::string center_types[ReducedCell::NUM_CELL_TYPES+1]
Array of Strings specifying the centering for reduced cells for rows 1 to 44 of Table 2.
static const double transform_modifier[2][3][3]
These transforms pre-multiply the basic transforms in certain cases, as listed in the footnotes to Ta...
static const double transforms[ReducedCell::NUM_CELL_TYPES+1][3][3]
Array of basic transformations from reduced cell to conventional cell for rows 1 to 44 of Table 2.
static const std::string lattice_types[ReducedCell::NUM_CELL_TYPES+1]
Array of Strings specifying the cell type for reduced cells for rows 1 to 44 of Table 2.
Mantid::Kernel::Matrix< double > DblMatrix