Mantid
Loading...
Searching...
No Matches
NDArrayToVector.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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#pragma once
8
11#include <vector>
12
13namespace Mantid {
14namespace PythonInterface {
15namespace Converters {
20template <typename DestElementType> struct DLLExport NDArrayToVector {
21 // Alias definitions
22 using TypedVector = std::vector<DestElementType>;
23 using TypedVectorIterator = typename std::vector<DestElementType>::iterator;
24
28 TypedVector operator()();
30 void copyTo(TypedVector &dest) const;
31
32private:
33 void throwIfSizeMismatched(const TypedVector &dest) const;
34
35 // reference to the held array
37};
38} // namespace Converters
39} // namespace PythonInterface
40} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
Thin object wrapper around a numpy array.
Definition: NDArray.h:31
Helper class which provides the Collimation Length for SANS instruments.
Converter taking an input numpy array and converting it to a std::vector.
typename std::vector< DestElementType >::iterator TypedVectorIterator