Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
core
inc
MantidPythonInterface
core
Converters
CArrayToNDArray.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2012 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
9
#include "MantidPythonInterface/core/Converters/WrapWithNumpy.h"
10
11
namespace
Mantid
{
12
namespace
PythonInterface {
13
namespace
Converters
{
14
//-----------------------------------------------------------------------
15
// Converter implementation
16
//-----------------------------------------------------------------------
24
template
<
typename
ElementType,
typename
ConversionPolicy>
struct
CArrayToNDArray
{
25
inline
PyObject *
operator()
(
const
ElementType *carray,
const
int
ndims, Py_intptr_t *dims)
const
{
26
// Round about way of calling the wrapNDArray template function that is
27
// defined
28
// in the cpp file
29
using
policy =
typename
ConversionPolicy::template apply<ElementType>;
30
return
policy::createFromArray(carray, ndims, dims);
31
}
32
};
33
}
// namespace Converters
34
}
// namespace PythonInterface
35
}
// namespace Mantid
Mantid::PythonInterface::Converters
Definition
CArrayToNDArray.h:13
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition
AbsorptionCorrection.h:18
Mantid::PythonInterface::Converters::CArrayToNDArray
Converter that takes a c array and its size then converts/wraps it into a numpy array.
Definition
CArrayToNDArray.h:24
Mantid::PythonInterface::Converters::CArrayToNDArray::operator()
PyObject * operator()(const ElementType *carray, const int ndims, Py_intptr_t *dims) const
Definition
CArrayToNDArray.h:25
Generated by
1.9.8