Skip to content
Snippets Groups Projects
Commit 16e6b232 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

VDouble.h split off from Types.h; using size_t removed from Types.h

parent 9ce208d2
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#include "BornAgainNamespace.h"
#include "Exceptions.h"
#include "Numeric.h"
#include "Types.h"
#include <Eigen/LU>
using namespace BornAgain;
......@@ -81,10 +82,9 @@ Eigen::Matrix2cd Beam::calculatePolarization(const kvector_t bloch_vector) const
double x = bloch_vector.x();
double y = bloch_vector.y();
double z = bloch_vector.z();
complex_t im(0.0, 1.0);
result(0, 0) = (1.0 + z) / 2.0;
result(0, 1) = (x - im * y) / 2.0;
result(1, 0) = (x + im * y) / 2.0;
result(0, 1) = complex_t(x, -y) / 2.0;
result(1, 0) = complex_t(x, y) / 2.0;
result(1, 1) = (1.0 - z) / 2.0;
return result;
}
......
......@@ -18,9 +18,7 @@
#include "BasicVector3D.h"
typedef std::complex<double> complex_t;
typedef Geometry::BasicVector3D<double> kvector_t;
typedef Geometry::BasicVector3D<complex_t> cvector_t;
typedef Geometry::BasicVector3D<std::complex<double>> cvector_t;
#endif // VECTORS3D_H
......@@ -19,6 +19,7 @@
#include "IInterferenceFunction.h"
#include "Lattice2DParameters.h"
#include "FTDistributions.h"
#include "Types.h"
#include <iostream>
#include <memory>
......
......@@ -18,6 +18,7 @@
#include "IInterferenceFunction.h"
#include "FTDistributions.h"
#include "Types.h"
#include <memory>
......@@ -87,5 +88,3 @@ private:
};
#endif /* INTERFERENCEFUNCTIONRADIALPARACRYSTAL_H_ */
......@@ -20,6 +20,8 @@
#include "Exceptions.h"
#include <vector>
using std::size_t;
//! @class IAxis
//! @ingroup tools_internal
//! @brief Interface for one-dimensional axes
......
......@@ -23,7 +23,6 @@ typedef _object PyObject;
#endif
#endif
#include "Types.h"
#include "FixedBinAxis.h"
#include "LLData.h"
#include "OutputDataIterator.h"
......@@ -32,6 +31,7 @@ typedef _object PyObject;
#include <sstream>
#include <cassert>
using std::size_t;
//! @class OutputData
//! @ingroup tools
......@@ -730,5 +730,3 @@ template<> PyObject *OutputData<double>::getArray() const;
#endif
#endif // OUTPUTDATA_H
......@@ -3,7 +3,7 @@
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Tools/Types.h
//! @brief Declares size_t, complex_t, and the array types vdouble1d_t, vdouble2d_t.
//! @brief Declares complex_t, and the array types vdouble1d_t, vdouble2d_t.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
......@@ -17,13 +17,7 @@
#define TYPES_H
#include <complex>
#include <vector>
using std::size_t;
typedef std::complex<double> complex_t;
typedef std::vector<double> vdouble1d_t;
typedef std::vector<vdouble1d_t> vdouble2d_t;
#endif // TYPES_H
......@@ -17,7 +17,7 @@
#define UTILS_H
#include "WinDllMacros.h"
#include "Types.h"
#include "VDouble.h"
#include "Exceptions.h"
#include <boost/unordered_map.hpp>
#include <map>
......
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Tools/VDouble.h
//! @brief Declares the array types vdouble1d_t, vdouble2d_t.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef VDOUBLE_H
#define VDOUBLE_H
#include <vector>
typedef std::vector<double> vdouble1d_t;
typedef std::vector<vdouble1d_t> vdouble2d_t;
#endif // VDOUBLE_H
......@@ -16,9 +16,10 @@
#ifndef VARIABLEBINAXIS_H
#define VARIABLEBINAXIS_H
#include "IAxis.h"
using std::size_t;
//! @class VariableBinAxis
//! @ingroup tools
//! @brief Axis with variable bin size.
......@@ -50,9 +51,9 @@ public:
size_t findClosestIndex(double value) const;
std::vector<double > getBinCenters() const;
std::vector<double> getBinCenters() const;
std::vector<double > getBinBoundaries() const;
std::vector<double> getBinBoundaries() const;
VariableBinAxis *createClippedAxis(double left, double right) const;
......
......@@ -3,6 +3,7 @@
#include "Vectors3D.h"
#include "EigenCore.h"
#include "Types.h"
class CVectorTest : public ::testing::Test
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment