Commit b65aa46d by Maarten L. Hekkelman

better symop table

parent faef95a8
......@@ -50,21 +50,21 @@ extern const std::size_t kNrOfSpaceGroups;
struct SymopData
{
constexpr SymopData(const std::array<int,15>& data)
: m_packed((static_cast<uint64_t>(data[ 0]) & 0x03) << 34 bitor
(static_cast<uint64_t>(data[ 1]) & 0x03) << 32 bitor
(static_cast<uint64_t>(data[ 2]) & 0x03) << 30 bitor
(static_cast<uint64_t>(data[ 3]) & 0x03) << 28 bitor
(static_cast<uint64_t>(data[ 4]) & 0x03) << 26 bitor
(static_cast<uint64_t>(data[ 5]) & 0x03) << 24 bitor
(static_cast<uint64_t>(data[ 6]) & 0x03) << 22 bitor
(static_cast<uint64_t>(data[ 7]) & 0x03) << 20 bitor
(static_cast<uint64_t>(data[ 8]) & 0x03) << 18 bitor
(static_cast<uint64_t>(data[ 9]) & 0x07) << 15 bitor
(static_cast<uint64_t>(data[10]) & 0x07) << 12 bitor
(static_cast<uint64_t>(data[11]) & 0x07) << 9 bitor
(static_cast<uint64_t>(data[12]) & 0x07) << 6 bitor
(static_cast<uint64_t>(data[13]) & 0x07) << 3 bitor
(static_cast<uint64_t>(data[14]) & 0x07) << 0)
: m_packed((data[ 0] & 0x03ULL) << 34 bitor
(data[ 1] & 0x03ULL) << 32 bitor
(data[ 2] & 0x03ULL) << 30 bitor
(data[ 3] & 0x03ULL) << 28 bitor
(data[ 4] & 0x03ULL) << 26 bitor
(data[ 5] & 0x03ULL) << 24 bitor
(data[ 6] & 0x03ULL) << 22 bitor
(data[ 7] & 0x03ULL) << 20 bitor
(data[ 8] & 0x03ULL) << 18 bitor
(data[ 9] & 0x07ULL) << 15 bitor
(data[10] & 0x07ULL) << 12 bitor
(data[11] & 0x07ULL) << 9 bitor
(data[12] & 0x07ULL) << 6 bitor
(data[13] & 0x07ULL) << 3 bitor
(data[14] & 0x07ULL) << 0)
{
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -225,6 +225,8 @@ int main()
SymInfoBlock cur = {};
std::vector<array<int,15>> symops, cenops;
while (getline(file, line))
{
switch (state)
......@@ -264,13 +266,32 @@ int main()
else if (line.compare(0, 6, "symop ") == 0)
{
SymopParser p;
data.emplace_back(cur.nr, symopnr, p.parse(line.substr(6)));
++symopnr;
symops.emplace_back(p.parse(line.substr(6)));
}
else if (line.compare(0, 6, "cenop ") == 0)
{
SymopParser p;
cenops.emplace_back(p.parse(line.substr(6)));
}
else if (line == "end_spacegroup")
{
for (auto& cenop: cenops)
{
for (auto symop: symops)
{
for (size_t i = 9; i < 15; ++i)
symop[i] += cenop[i];
data.emplace_back(cur.nr, symopnr, symop);
++symopnr;
}
}
symInfo.emplace(cur.nr, cur);
state = State::skip;
symops.clear();
cenops.clear();
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment