Mantid
Loading...
Searching...
No Matches
LatticeDomain.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#include <utility>
8
11namespace Mantid::API {
12
13LatticeDomain::LatticeDomain(std::vector<Kernel::V3D> hkls) : m_hkls(std::move(hkls)) {}
14
15size_t LatticeDomain::size() const { return m_hkls.size(); }
16
17const Kernel::V3D &LatticeDomain::operator[](size_t i) const {
18 if (i >= m_hkls.size()) {
19 throw Kernel::Exception::IndexError(i, m_hkls.size() - 1, "Index exceeds size of LatticeDomain.");
20 }
21 return m_hkls[i];
22}
23
24} // namespace Mantid::API
size_t size() const override
Return the number of points in the domain.
LatticeDomain(std::vector< Kernel::V3D > hkls)
const Kernel::V3D & operator[](size_t i) const
std::vector< Kernel::V3D > m_hkls
Definition: LatticeDomain.h:33
Exception for index errors.
Definition: Exception.h:284
Class for 3D vectors.
Definition: V3D.h:34
STL namespace.