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
10#include <vector>
11
12namespace Mantid {
13namespace PythonInterface {
14namespace Converters {
19template <typename DestElementType> struct DLLExport NDArrayToVector {
20 // Alias definitions
21 using TypedVector = std::vector<DestElementType>;
22 using TypedVectorIterator = typename std::vector<DestElementType>::iterator;
23
27 TypedVector operator()();
29 void copyTo(TypedVector &dest) const;
30
31private:
32 void throwIfSizeMismatched(const TypedVector &dest) const;
33
34 // reference to the held array
36};
37} // namespace Converters
38} // namespace PythonInterface
39} // 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:37
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