Skip to content

Commit

Permalink
Removed useless operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Nov 17, 2017
1 parent 38b3f45 commit dac5dd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
3 changes: 1 addition & 2 deletions alm/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,7 @@ void Constraint::constraint_from_symmetry(std::vector<ConstraintClass> *const_ou

// Generate temporary list of parameters
list_found.clear();
for (std::vector<FcProperty>::iterator p = fcs->fc_set[order].begin();
p != fcs->fc_set[order].end(); ++p) {
for (auto p = fcs->fc_set[order].begin(); p != fcs->fc_set[order].end(); ++p) {
for (i = 0; i < order + 2; ++i) index_tmp[i] = (*p).elems[i];
list_found.insert(FcProperty(order + 2, (*p).coef,
index_tmp, (*p).mother));
Expand Down
36 changes: 9 additions & 27 deletions alm/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,42 +538,17 @@ void Symmetry::find_crystal_symmetry(int nat,
void Symmetry::symop_in_cart(double lavec[3][3], double rlavec[3][3])
{
int i, j;

#ifdef _USE_EIGEN
Eigen::Matrix3d aa, bb, sym_tmp;
Eigen::Matrix3d sym_crt;

for (i = 0; i < 3; ++i) {
for (j = 0; j < 3; ++j) {
aa(i, j) = lavec[i][j];
bb(i, j) = rlavec[i][j];
}
}

#else
double sym_tmp[3][3], sym_crt[3][3];
double tmp[3][3];
#endif

for (int isym = 0; isym < nsym; ++isym) {

for (i = 0; i < 3; ++i) {
for (j = 0; j < 3; ++j) {
#ifdef _USE_EIGEN
sym_tmp(i, j) = static_cast<double>(symrel_int[isym][i][j]);
#else
sym_tmp[i][j] = static_cast<double>(symrel_int[isym][i][j]);
#endif
}
}
#ifdef _USE_EIGEN
sym_crt = (aa * (sym_tmp * bb)) / (2.0 * pi);
for (i = 0; i < 3; ++i) {
for (j = 0; j < 3; ++j) {
symrel[isym][i][j] = sym_crt(i, j);
}
}
#else

matmul3(tmp, sym_tmp, rlavec);
matmul3(sym_crt, lavec, tmp);

Expand All @@ -582,7 +557,6 @@ void Symmetry::symop_in_cart(double lavec[3][3], double rlavec[3][3])
symrel[isym][i][j] = sym_crt[i][j] / (2.0 * pi);
}
}
#endif
}

#ifdef _DEBUG
Expand Down Expand Up @@ -750,6 +724,14 @@ void Symmetry::symop_availability_check(double ***rot,

for (i = 0; i < nsym; ++i) {

std::cout << "Sym. No. : " << std::setw(3) << i + 1 << std::endl;
for (j = 0; j < 3; ++j) {
for (k = 0; k < 3; ++k) {
std::cout << std::setw(15) << rot[i][j][k];
}
std::cout << std::endl;
}
std::cout << std::endl;
nfinite = 0;
for (j = 0; j < 3; ++j) {
for (k = 0; k < 3; ++k) {
Expand Down

0 comments on commit dac5dd7

Please sign in to comment.