BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
OutputDataReadWriteNumpyTXT.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/InputOutput/OutputDataReadWriteNumpyTXT.h
6 //! @brief Defines OutputDataReadWriteNumpyTXT
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITENUMPYTXT_H
21 #define BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITENUMPYTXT_H
22 
23 #include <istream>
24 
25 template <class T> class OutputData;
26 
27 //! Class for reading and writing OutputData from simple ASCII file with the layout as in
28 //! numpy.savetxt.
29 //! @ingroup input_output_internal
30 
32 public:
33  OutputData<double>* readOutputData(std::istream& input_stream);
34  void writeOutputData(const OutputData<double>& data, std::ostream& output_stream);
35 
36 private:
37  static void write1DRepresentation(const OutputData<double>& data, std::ostream& output_stream);
38  static void write2DRepresentation(const OutputData<double>& data, std::ostream& output_stream);
39  static double ignoreDenormalized(double value);
40 };
41 
42 #endif // BORNAGAIN_DEVICE_INPUTOUTPUT_OUTPUTDATAREADWRITENUMPYTXT_H
43 #endif // USER_API
Class for reading and writing OutputData from simple ASCII file with the layout as in numpy....
static double ignoreDenormalized(double value)
static void write2DRepresentation(const OutputData< double > &data, std::ostream &output_stream)
void writeOutputData(const OutputData< double > &data, std::ostream &output_stream)
static void write1DRepresentation(const OutputData< double > &data, std::ostream &output_stream)
OutputData< double > * readOutputData(std::istream &input_stream)
Templated class to store data of type double or CumulativeValue in multi-dimensional space.
Definition: OutputData.h:32