Skip to content

Commit

Permalink
make V3D size
Browse files Browse the repository at this point in the history
  • Loading branch information
rboston628 committed Oct 16, 2024
1 parent 734a62f commit c79a13f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Framework/Kernel/inc/MantidKernel/V3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ class MANTID_KERNEL_DLL V3D final {
// explicit conversion into vector
operator std::vector<double>() const { return std::vector<double>(m_pt.cbegin(), m_pt.cend()); }

/**
Number of components in V3D
@return 3
*/
std::size_t size() const noexcept { return m_pt.size(); }

/**
Addtion operator
@param v :: Vector to add
Expand Down
1 change: 1 addition & 0 deletions Framework/Kernel/test/V3DTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class V3DTest : public CxxTest::TestSuite {
Mantid::Kernel::V3D a, b, c, d;

public:
void testSize() { TS_ASSERT_EQUALS(a.size(), 3); }
void testEmptyConstructor() {
// very important as a MD geometry rely on it later
TS_ASSERT_EQUALS(a.X(), 0.0);
Expand Down

0 comments on commit c79a13f

Please sign in to comment.