35 std::vector<double> lat_par;
38 ReducedCell form_0 =
ReducedCell(0, lat_par[0], lat_par[1], lat_par[2], lat_par[3], lat_par[4], lat_par[5]);
39 ReducedCell form_i =
ReducedCell(form_num, lat_par[0], lat_par[1], lat_par[2], lat_par[3], lat_par[4], lat_par[5]);
40 init(UB, form_0, form_i, allowPermutations);
102 std::vector<double> lat_par;
104 return lat_par[0] + lat_par[1] + lat_par[2];
115 sprintf(buffer, std::string(
"Form #%2d").c_str(),
GetFormNum());
116 std::string message(buffer);
118 sprintf(buffer, std::string(
" Error:%7.4f").c_str(),
GetError());
119 message += std::string(buffer);
121 sprintf(buffer, std::string(
" %-12s").c_str(),
GetCellType().c_str());
122 message += std::string(buffer);
124 sprintf(buffer, std::string(
" %1s ").c_str(),
GetCentering().c_str());
125 message += std::string(buffer);
144 const bool allowPermutations) {
156 if (allowPermutations) {
176 std::vector<V3D> edges(3,
V3D());
216 if (a_c_diff <= a_b_diff && a_c_diff <= b_c_diff) {
218 }
else if (b_c_diff <= a_b_diff && b_c_diff <= a_c_diff) {
238 double alpha = b.
angle(c) * 180.0 / M_PI;
239 double beta = c.
angle(a) * 180.0 / M_PI;
242 if (
fabs(alpha - 90) > 20) {
244 }
else if (
fabs(beta - 90) > 20) {
251 double gamma = a.
angle(b) * 180.0 / M_PI;
252 if (
fabs(gamma - 60) < 10) {
void init(const Kernel::DblMatrix &UB, const ReducedCell &form_0, ReducedCell &form_i, const bool allowPermutations)
Initialize the fields of this ConventionalCell object, using a specified matrix and two forms.
std::string GetDescription() const
get string listing form number, error, cell type and centering
void StandardizeTetragonal(Kernel::DblMatrix &UB)
Change UB to a new matrix corresponding to a unit cell with the first two sides approximately equal i...
std::string GetCellType() const
get the cell type name, as named in the ReducedCell class
Kernel::DblMatrix GetNewUB() const
get the transformed orientation matrix for the conventional cell
Kernel::DblMatrix original_UB
Kernel::DblMatrix hkl_tran
ConventionalCell(const Kernel::DblMatrix &UB, size_t form_num=0, bool allowPermutations=false)
Construct a ConventionalCell for the specified UB and form number.
Kernel::DblMatrix GetOriginalUB() const
get the original orientation matrix as passed in to the constructor
Kernel::DblMatrix adjusted_UB
std::string GetCentering() const
get the centering type name, as named in the ReducedCell class
Kernel::DblMatrix GetHKL_Tran() const
get the transform to change HKL to new conventional cell HKL
void SetSidesIncreasing(Kernel::DblMatrix &UB)
Change UB to a new matrix corresponding to a unit cell with the sides in increasing order of magnitud...
size_t GetFormNum() const
get the form number for this conventional cell
double GetError() const
get the error in the scalars for this form
double GetSumOfSides() const
get the sum of the sides of the conventional unit cell
void StandardizeHexagonal(Kernel::DblMatrix &UB)
Change UB to a new matrix corresponding to a hexagonal unit cell with angles approximately 90,...
static bool GetLatticeParameters(const Kernel::DblMatrix &UB, std::vector< double > &lattice_par)
Get the lattice parameters for the specified orientation matrix.
static bool GetABC(const Kernel::DblMatrix &UB, Kernel::V3D &a_dir, Kernel::V3D &b_dir, Kernel::V3D &c_dir)
Get the real space edge vectors a, b, c corresponding to the UB matrix.
static bool GetUB(Kernel::DblMatrix &UB, const Kernel::V3D &a_dir, const Kernel::V3D &b_dir, const Kernel::V3D &c_dir)
Get the UB matix corresponding to the real space edge vectors a, b, c.
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.
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,...
double WeightedDistance(const ReducedCell &other) const
Get the maximum absolute weighted difference between the scalars for the specifed ReducedCellInfo obj...
static const std::string RHOMBOHEDRAL()
std::string GetCentering() const
Get centering assigned to this form.
static const std::string TETRAGONAL()
T Invert()
LU inversion routine.
static bool compareMagnitude(const Kernel::V3D &v1, const Kernel::V3D &v2)
Convenience method for sorting list of V3D objects based on magnitude.
constexpr double scalar_prod(const V3D &v) const noexcept
Calculates the cross product.
constexpr V3D cross_prod(const V3D &v) const noexcept
Cross product (this * argument)
double angle(const V3D &) const
Angle between this and another vector.
double norm() const noexcept
Mantid::Kernel::Matrix< double > DblMatrix