BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PyArrayImportUtils.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Instrument/PyArrayImportUtils.cpp
6 //! @brief Implements 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 
17 
19 {
20  return ArrayUtils::createData(vec).release();
21 }
22 
24 PyArrayImport::importArrayToOutputData(const std::vector<std::vector<double>>& vec)
25 {
26  return ArrayUtils::createData(vec).release();
27 }
Defines various functions to interact from numpy on Python side.
Declares functions in namespace PyArrayImport.
CreateDataImpl::ReturnType< T > createData(const T &vec)
Creates OutputData array from input vector.
Definition: ArrayUtils.h:61
OutputData< double > * importArrayToOutputData(const std::vector< double > &vec)
for importing 1D array of doubles from python into OutputData