35 throw std::runtime_error(
36 "Invalid assignment of SymGroupRep. Sizes are incompatible.\n");
38 resize(RHS.size(), NULL);
39 for (
Index i = 0; i < RHS.size(); i++) {
40 if (RHS[i])
set_rep(i, *RHS[i]);
51 throw std::runtime_error(std::string(
52 "SymGroupRep::set_master_group() attempted to assign SymGroupRepID "
53 "that does not match the current SymGroupRep!\n"));
57 std::vector<SymOpRepresentation *>::resize(master.size());
58 else if (size() == master.size()) {
59 for (
Index i = 0; i < size(); i++) {
60 if (at(i)) at(i)->set_identifiers(master,
m_rep_ID, i);
63 throw std::runtime_error(
64 std::string(
"SymGroupRep::set_master_group() passed new master whose "
65 "size is incompatible with the size\n") +
66 "of the current representation.\n");
75 err_log() <<
"CRITICAL ERROR: In SymGroupRep::set_rep(), you are trying to "
76 "assign the representation of a SymOp whose factor_group is "
93 err_log() <<
"CRITICAL ERROR: In SymGroupRep::set_rep(), you are trying to "
94 "assign the representation of a SymOpRepresentation whose "
95 "factor_group is not specified!\n"
103 err_log() <<
"CRITICAL ERROR: In SymGroupRep::set_rep(), you are trying to "
104 "assign the representation of a SymOpRepresentation whose "
105 "index is not specified!\n"
115 assert(
valid_index(op_index) && op_index < size() &&
116 "In SymGroupRep::set_rep(), reference representation is improperly "
119 err_log() <<
"CRITICAL ERROR: In SymGroupRep::set_rep(), representation "
120 "already exists for operation "
138 for (
Index i = 0; i < size(); i++)
delete at(i);
139 std::vector<SymOpRepresentation *>::clear();
145 return at(i)->MatrixXd();
152 return at(op.
index())->MatrixXd();
158 return at(i)->permutation();
165 return at(op.
index())->permutation();
178 if (!_rep.size())
return new_rep;
179 if (_rep[0] && !(_rep.
MatrixXd(0))) {
180 err_log() <<
"CRITICAL ERROR: Trying to perform matrix transformation on a "
181 "non-matrix SymRep. Exiting...\n";
187 trans_mat.transpose()
188 .jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV)
192 for (
Index i = 0; i < _rep.size(); i++) {
193 if (!_rep[i])
continue;
SymGroupRep const & representation(SymGroupRepID i) const
Const access of alternate Representations of a SymGroup.
SymGroupRep is an alternative representation of a SymGroup for something other than real space....
SymGroupRep & operator=(const SymGroupRep &RHS)
explicit assignment operator Necessary because SymGroupRep directly manages heap-allocated SymOpRepre...
const MasterSymGroup & master_group() const
Reference to MasterSymGroup for which this SymGroupRep is a group representation If a MasterSymGroup ...
~SymGroupRep()
explicit destructor Necessary because SymGroupRep directly manages heap-allocated SymOpRepresentation...
void set_rep(Index op_index, const SymOpRepresentation &new_rep)
Sets the representation of operation at entry 'op_index' of this group representation Throws if this ...
SymGroupRepID m_rep_ID
rep_ID is unique identifier of a specific SymGroupRep instantiation
bool has_valid_master() const
Returns true if this SymGroupRep has valid pointer to a MasterSymGroup.
Eigen::MatrixXd const * MatrixXd(Index i) const
pointer to MatrixXd corresponding to SymOpRepresentation at entry 'i' of this SymGroupRep Returns nul...
Permutation const * permutation(Index i) const
pointer to Permutation corresponding to SymOpRepresentation at entry 'i' of this SymGroupRep Returns ...
void set_master_group(const MasterSymGroup &master, const SymGroupRepID &_rep_ID)
Assign ma.
MasterSymGroup const * m_master_group
Pointer to the home_group that generated this SymGroupRep.
Type-safe ID object for communicating and accessing Symmetry representation info.
bool empty() const
Returns true if SymGroupRepID has not been initialized with valid group_index or rep_index.
Generalized symmetry matrix representation for arbitrary dimension Can be used to describe applicatio...
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
SymOpRepresentation is the base class for anything describes a symmetry operation.
virtual SymOpRepresentation * copy() const =0
Make copy of Derived object through Base-class interface.
void set_identifiers(const MasterSymGroup &new_group, SymGroupRepID new_rep_ID)
Change m_master_group and determine op_index.
IdentitySymRepBuilder Identity()
SymGroupRep coord_transformed_copy(SymGroupRep const &_rep, const Eigen::MatrixXd &trans_mat)
Make a copy of representation on vector space 'V' that is transformed into a representation on vector...
bool valid_index(Index i)
INDEX_TYPE Index
For long integer indexing: