Mantid
Loading...
Searching...
No Matches
NumpyFunctions.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
9#ifdef __GNUC__
10#pragma GCC system_header
11#endif
12
14#include <boost/python/detail/wrap_python.hpp>
15
16// Forward declare the numpy array types
17struct tagPyArrayObject;
18using PyArrayObject = tagPyArrayObject;
19struct _PyArray_Descr;
20using PyArray_Descr = _PyArray_Descr;
21
22/*
23 * The numpy API is a C api where pointers to functions and objects are the
24 * same size.
25 * This is not guaranteed by the C++ standard so macros in the numpy headers,
26 * such as PyArray_IterNew produces warnings when compiled with a C++ compiler.
27 *
28 * The only solution appears to be wrap the calls in our own functions and
29 * suppress the warnings.
30 */
31namespace Mantid {
32namespace PythonInterface {
33namespace Converters {
34namespace Impl {
38MANTID_PYTHONINTERFACE_CORE_DLL PyArrayObject *func_PyArray_NewFromDescr(int datatype, int ndims, Py_intptr_t *dims);
40 Py_intptr_t *dims);
41MANTID_PYTHONINTERFACE_CORE_DLL PyArray_Descr *func_PyArray_Descr(const char *datadescr);
42} // namespace Impl
43} // namespace Converters
44} // namespace PythonInterface
45} // namespace Mantid
tagPyArrayObject PyArrayObject
_PyArray_Descr PyArray_Descr
#define MANTID_PYTHONINTERFACE_CORE_DLL
Definition: DllConfig.h:17
MANTID_PYTHONINTERFACE_CORE_DLL PyArrayObject * func_PyArray_NewFromDescr(int datatype, int ndims, Py_intptr_t *dims)
equivalent to macro PyArray_NewFromDescr
MANTID_PYTHONINTERFACE_CORE_DLL PyObject * func_PyArray_IterNew(PyArrayObject *arr)
equivalent to macro PyArray_IterNew
Helper class which provides the Collimation Length for SANS instruments.