BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PyArrayImportUtils.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Instrument/PyArrayImportUtils.h
6 //! @brief Declares functions in namespace PyArrayImport.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_INSTRUMENT_PYARRAYIMPORTUTILS_H
16 #define BORNAGAIN_CORE_INSTRUMENT_PYARRAYIMPORTUTILS_H
17 
18 #include <vector>
19 
20 template <class T> class OutputData;
21 
22 //! Functions for numpy array import to OutputData.
23 //! Required solely as a shortcut to produce OutputData from numpy arrays of doubles.
24 
25 namespace PyArrayImport
26 {
27 
28 //! for importing 1D array of doubles from python into OutputData
29 OutputData<double>* importArrayToOutputData(const std::vector<double>& vec);
30 //! for importing 2D array of doubles from python into OutputData
31 OutputData<double>* importArrayToOutputData(const std::vector<std::vector<double>>& vec);
32 
33 } // namespace PyArrayImport
34 
35 #endif // BORNAGAIN_CORE_INSTRUMENT_PYARRAYIMPORTUTILS_H
Template class to store data of any type in multi-dimensional space.
Definition: OutputData.h:33
Functions for numpy array import to OutputData.
OutputData< double > * importArrayToOutputData(const std::vector< double > &vec)
for importing 1D array of doubles from python into OutputData