Skip to content

Commit

Permalink
Update types (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
acodcha authored May 15, 2024
1 parent bacc8e5 commit 43e0684
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
14 changes: 7 additions & 7 deletions include/PhQ/Dimensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ template <>
struct hash<PhQ::Dimensions> {
inline size_t operator()(const PhQ::Dimensions& dimensions) const {
size_t result{17};
result = 31 * result + dimensions.Time().Value();
result = 31 * result + dimensions.Length().Value();
result = 31 * result + dimensions.Mass().Value();
result = 31 * result + dimensions.ElectricCurrent().Value();
result = 31 * result + dimensions.Temperature().Value();
result = 31 * result + dimensions.SubstanceAmount().Value();
result = 31 * result + dimensions.LuminousIntensity().Value();
result = static_cast<size_t>(31) * result + dimensions.Time().Value();
result = static_cast<size_t>(31) * result + dimensions.Length().Value();
result = static_cast<size_t>(31) * result + dimensions.Mass().Value();
result = static_cast<size_t>(31) * result + dimensions.ElectricCurrent().Value();
result = static_cast<size_t>(31) * result + dimensions.Temperature().Value();
result = static_cast<size_t>(31) * result + dimensions.SubstanceAmount().Value();
result = static_cast<size_t>(31) * result + dimensions.LuminousIntensity().Value();
return result;
}
};
Expand Down
18 changes: 9 additions & 9 deletions include/PhQ/Dyad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,15 +687,15 @@ template <typename Number>
struct hash<PhQ::Dyad<Number>> {
inline size_t operator()(const PhQ::Dyad<Number>& dyad) const {
size_t result{17};
result = 31 * result + hash<Number>()(dyad.xx());
result = 31 * result + hash<Number>()(dyad.xy());
result = 31 * result + hash<Number>()(dyad.xz());
result = 31 * result + hash<Number>()(dyad.yx());
result = 31 * result + hash<Number>()(dyad.yy());
result = 31 * result + hash<Number>()(dyad.yz());
result = 31 * result + hash<Number>()(dyad.zx());
result = 31 * result + hash<Number>()(dyad.zy());
result = 31 * result + hash<Number>()(dyad.zz());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.xx());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.xy());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.xz());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.yx());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.yy());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.yz());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.zx());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.zy());
result = static_cast<size_t>(31) * result + hash<Number>()(dyad.zz());
return result;
}
};
Expand Down
14 changes: 6 additions & 8 deletions include/PhQ/SymmetricDyad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ class SymmetricDyad {
private:
// Cartesian components of this three-dimensional symmetric dyadic tensor.
std::array<Number, 6> xx_xy_xz_yy_yz_zz_;

friend class Dyad<Number>;
};

template <typename Number>
Expand Down Expand Up @@ -574,12 +572,12 @@ template <typename Number>
struct hash<PhQ::SymmetricDyad<Number>> {
inline size_t operator()(const PhQ::SymmetricDyad<Number>& symmetric) const {
size_t result{17};
result = 31 * result + hash<Number>()(symmetric.xx());
result = 31 * result + hash<Number>()(symmetric.xy());
result = 31 * result + hash<Number>()(symmetric.xz());
result = 31 * result + hash<Number>()(symmetric.yy());
result = 31 * result + hash<Number>()(symmetric.yz());
result = 31 * result + hash<Number>()(symmetric.zz());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.xx());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.xy());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.xz());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.yy());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.yz());
result = static_cast<size_t>(31) * result + hash<Number>()(symmetric.zz());
return result;
}
};
Expand Down
6 changes: 3 additions & 3 deletions include/PhQ/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ template <typename Number>
struct hash<PhQ::Vector<Number>> {
inline size_t operator()(const PhQ::Vector<Number>& vector) const {
size_t result{17};
result = 31 * result + hash<Number>()(vector.x());
result = 31 * result + hash<Number>()(vector.y());
result = 31 * result + hash<Number>()(vector.z());
result = static_cast<size_t>(31) * result + hash<Number>()(vector.x());
result = static_cast<size_t>(31) * result + hash<Number>()(vector.y());
result = static_cast<size_t>(31) * result + hash<Number>()(vector.z());
return result;
}
};
Expand Down

0 comments on commit 43e0684

Please sign in to comment.