Mantid
Loading...
Searching...
No Matches
Framework
API
src
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
9
#include "
MantidAPI/LatticeDomain.h
"
10
#include "
MantidKernel/Exception.h
"
11
namespace
Mantid::API
{
12
13
LatticeDomain::LatticeDomain
(std::vector<Kernel::V3D> hkls) : m_hkls(
std
::move(hkls)) {}
14
15
size_t
LatticeDomain::size
()
const
{
return
m_hkls
.size(); }
16
17
const
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
Exception.h
LatticeDomain.h
Mantid::API::LatticeDomain::size
size_t size() const override
Return the number of points in the domain.
Definition:
LatticeDomain.cpp:15
Mantid::API::LatticeDomain::LatticeDomain
LatticeDomain(std::vector< Kernel::V3D > hkls)
Definition:
LatticeDomain.cpp:13
Mantid::API::LatticeDomain::operator[]
const Kernel::V3D & operator[](size_t i) const
Definition:
LatticeDomain.cpp:17
Mantid::API::LatticeDomain::m_hkls
std::vector< Kernel::V3D > m_hkls
Definition:
LatticeDomain.h:33
Mantid::Kernel::Exception::IndexError
Exception for index errors.
Definition:
Exception.h:284
Mantid::Kernel::V3D
Class for 3D vectors.
Definition:
V3D.h:34
Mantid::API
Definition:
AbsorptionCorrection.h:20
std
STL namespace.
Generated on Tue Jan 3 2023 11:57:23 for Mantid by
1.9.5