コード例 #1
0
ファイル: Group.cpp プロジェクト: nimgould/mantid
/// Assigns symmetry operations, throws std::invalid_argument if vector is
/// empty.
void Group::setSymmetryOperations(
    const std::vector<SymmetryOperation> &symmetryOperations) {
  if (symmetryOperations.size() < 1) {
    throw std::invalid_argument("Group needs at least one element.");
  }

  m_operationSet = std::set<SymmetryOperation>(symmetryOperations.begin(),
                                               symmetryOperations.end());
  m_allOperations = std::vector<SymmetryOperation>(m_operationSet.begin(),
                                                   m_operationSet.end());
  m_axisSystem = getCoordinateSystemFromOperations(m_allOperations);
}
コード例 #2
0
ファイル: Group.cpp プロジェクト: mantidproject/mantid
/// Assigns symmetry operations, throws std::invalid_argument if vector is
/// empty.
void Group::setSymmetryOperations(
    const std::vector<SymmetryOperation> &symmetryOperations) {
  if (symmetryOperations.empty()) {
    throw std::invalid_argument("Group needs at least one element.");
  }

  m_operationSet.clear();
  std::transform(symmetryOperations.cbegin(), symmetryOperations.cend(),
                 std::inserter(m_operationSet, m_operationSet.begin()),
                 &getUnitCellIntervalOperation);

  m_allOperations = std::vector<SymmetryOperation>(m_operationSet.begin(),
                                                   m_operationSet.end());
  m_axisSystem = getCoordinateSystemFromOperations(m_allOperations);
}