26 #ifndef GRALE_DEFLECTIONMATRIX_H
28 #define GRALE_DEFLECTIONMATRIX_H
30 #include "graleconfig.h"
32 #include <errut/errorbase.h>
39 class GravitationalLens;
41 class GRALE_IMPORTEXPORT DeflectionMatrix :
public errut::ErrorBase
48 int addDeflectionPoint(Vector2D<double> point);
49 int addDerivativePoint(Vector2D<double> point);
50 int addPotentialPoint(Vector2D<double> point);
51 bool endInit(
const std::vector<std::pair<GravitationalLens *, Vector2D<double> > > &basisLenses);
53 bool calculateBasisMatrixProducts(
const std::vector<float> &basisWeights,
bool calcDeflection,
bool calcDerivatives,
bool calcPotential);
55 double getAngularScale()
const {
return m_angularScale; }
57 Vector2D<float> getDeflectionAngle(
int index)
const {
return m_deflectionAngles[index]; }
58 void getDeflectionDerivatives(
int index,
float *pAxx,
float *pAyy,
float *pAxy)
const { *pAxx = m_derivatives[0][index]; *pAyy = m_derivatives[1][index]; *pAxy = m_derivatives[2][index]; }
59 float getPotential(
int index)
const {
return m_potentialValues[index]; }
61 void calculateAngularScale();
70 std::map<Vector2D<double>,
int> m_deflectionPointSet;
71 std::map<Vector2D<double>,
int> m_derivativePointSet;
72 std::map<Vector2D<double>,
int> m_potentialPointSet;
77 std::vector<Vector2D<double> > m_deflectionPoints;
78 std::vector<Vector2D<double> > m_derivativePoints;
79 std::vector<Vector2D<double> > m_potentialPoints;
81 double m_angularScale;
82 int m_numBasisFunctions;
84 std::vector<std::vector<float > > m_deflectionMatrix[2];
85 std::vector<std::vector<float> > m_derivativeMatrices[3];
86 std::vector<std::vector<float> > m_potentialMatrix;
88 std::vector<Vector2D<float> > m_deflectionAngles;
89 std::vector<float> m_derivatives[3];
90 std::vector<float> m_potentialValues;
95 #endif // GRALE_DEFLECTIONMATRIX_H