ProSHADE  0.7.6.2 (DEC 2021)
Protein Shape Detection
ProSHADE_maths.hpp
Go to the documentation of this file.
1 
23 //==================================================== ProSHADE
24 #include "ProSHADE_misc.hpp"
25 
26 //==================================================== almostEqual for comparing floating point numbers (BSD License, works on Windows as well as linux)
27 #include <almostEqual.hpp>
28 
29 //==================================================== Overinclusion protection
30 #ifndef PROSHADE_MATHS
31 #define PROSHADE_MATHS
32 
33 //==================================================== Declare LAPACK functions
34 extern "C"
35 {
36  // ... The real matrix singular value decomposition function from LAPACK
37  extern void dgesdd_ ( char* jobz, int* m, int* n, double* a, int* lda, double* s, double* u, int* ldu, double* vt, int* ldvt, double* work, int* lwork, double* rwork, int* iwork, int* info );
38  // ... The complex matrix singular value decomposition function from LAPACK
39  extern void zgesdd_ ( char* jobz, int* m, int* n, std::complex<double>* a, int* lda, double* s, std::complex<double>* u, int* ldu, std::complex<double>* vt, int* ldvt, std::complex<double>* work, int* lwork, double* rwork, int* iwork, int* info );
40  // ... The eigenvalue/eigenvector solver
41  extern void dgeev_ ( char* jobvl, char* jobvr, int* n, double* a, int* lda, double* wr, double* wi, double* vl, int* ldvl, double* vr, int* ldvr, double* work, int* lwork, int* info );
42 }
43 
44 //==================================================== ProSHADE_internal_spheres Namespace
45 // ... NOTE: The full namespace is defined in ProSHADE_spheres.h ; however, as forward declaration
46 // ... would not work here, the ProSHADE_rotFun_sphere class needs to be defined here, making the
47 // ... organisation a bit messier.
49 {
58  {
59  private:
60  proshade_double radius;
61  proshade_double radiusMax;
62  proshade_double radiusMin;
63  proshade_unsign angularDim;
64  proshade_double representedAngle;
65  proshade_unsign sphereNumber;
66 
67  proshade_double* axesValues;
68  std::vector< std::pair< proshade_unsign,proshade_unsign > > peaks;
69  public:
70  ProSHADE_rotFun_sphere ( proshade_double rad, proshade_double radRange, proshade_unsign dim, proshade_double repAng, proshade_unsign sphNo );
71  ~ProSHADE_rotFun_sphere ( void );
72 
73  public:
74  proshade_double getRadius ( void );
75  proshade_double getMaxRadius ( void );
76  proshade_double getMinRadius ( void );
77  proshade_unsign getAngularDim ( void );
78  proshade_double getRepresentedAngle ( void );
79  proshade_unsign getSphereNumber ( void );
80  std::vector<std::pair<proshade_unsign,proshade_unsign>> getPeaks ( void );
81  proshade_double getSphereLatLonPosition ( proshade_unsign lattitude, proshade_unsign longitude );
82  proshade_double getSphereLatLonLinearInterpolationPos ( proshade_double lattitude, proshade_double longitude );
83  std::vector< std::vector< proshade_double > > getCopyOfValues ( void );
84 
85 
86  public:
87  void interpolateSphereValues ( proshade_complex* rotFun );
88  void findAllPeaks ( proshade_signed noSmNeighbours, std::vector< proshade_double >* allHeights );
89  void removeSmallPeaks ( proshade_double peakThres );
90  };
91 }
92 
93 //==================================================== ProSHADE_internal_io Namespace
100 namespace ProSHADE_internal_maths
101 {
110  {
111  private:
112  proshade_double a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33;
113  proshade_double xStartIndex, xRange, yStartIndex, yRange;
114 
115  public:
123  BicubicInterpolator ( proshade_double** areaToInterpolate, proshade_double xStart, proshade_double yStart )
124  {
125  //======================================== Save the original non-unit square positions
126  this->xStartIndex = xStart;
127  this->yStartIndex = yStart;
128 
129  //======================================== Prepare variables for converting from original indices to unit square
130  this->xRange = 1.0;
131  this->yRange = 1.0;
132 
133  //======================================== Precompute interpolators
134  this->a00 = areaToInterpolate[1][1];
135  this->a01 = - ( 0.5 * areaToInterpolate[1][0] ) +
136  ( 0.5 * areaToInterpolate[1][2] );
137  this->a02 = areaToInterpolate[1][0] -
138  ( 2.5 * areaToInterpolate[1][1] ) +
139  ( 2.0 * areaToInterpolate[1][2] ) -
140  ( 0.5 * areaToInterpolate[1][3] );
141  this->a03 = - ( 0.5 * areaToInterpolate[1][0] ) +
142  ( 1.5 * areaToInterpolate[1][1] ) -
143  ( 1.5 * areaToInterpolate[1][2] ) +
144  ( 0.5 * areaToInterpolate[1][3] );
145  this->a10 = - ( 0.5 * areaToInterpolate[0][1] ) +
146  ( 0.5 * areaToInterpolate[2][1] );
147  this->a11 = ( 0.25 * areaToInterpolate[0][0] ) -
148  ( 0.25 * areaToInterpolate[0][2] ) -
149  ( 0.25 * areaToInterpolate[2][0] ) +
150  ( 0.25 * areaToInterpolate[2][2] );
151  this->a12 = - ( 0.5 * areaToInterpolate[0][0] ) +
152  ( 1.25 * areaToInterpolate[0][1] ) -
153  areaToInterpolate[0][2] +
154  ( 0.25 * areaToInterpolate[0][3] ) +
155  ( 0.5 * areaToInterpolate[2][0] ) -
156  ( 1.25 * areaToInterpolate[2][1] ) +
157  areaToInterpolate[2][2] -
158  ( 0.25 * areaToInterpolate[2][3] );
159  this->a13 = ( 0.25 * areaToInterpolate[0][0] ) -
160  ( 0.75 * areaToInterpolate[0][1] ) +
161  ( 0.75 * areaToInterpolate[0][2] ) -
162  ( 0.25 * areaToInterpolate[0][3] ) -
163  ( 0.25 * areaToInterpolate[2][0] ) +
164  ( 0.75 * areaToInterpolate[2][1] ) -
165  ( 0.75 * areaToInterpolate[2][2] ) +
166  ( 0.25 * areaToInterpolate[2][3] );
167  this->a20 = areaToInterpolate[0][1] -
168  ( 2.5 * areaToInterpolate[1][1] ) +
169  ( 2.0 * areaToInterpolate[2][1] ) -
170  ( 0.5 * areaToInterpolate[3][1] );
171  this->a21 = - ( 0.5 * areaToInterpolate[0][0] ) +
172  ( 0.5 * areaToInterpolate[0][2] ) +
173  ( 1.25 * areaToInterpolate[1][0] ) -
174  ( 1.25 * areaToInterpolate[1][2] ) -
175  areaToInterpolate[2][0] + areaToInterpolate[2][2] +
176  ( 0.25 * areaToInterpolate[3][0] ) -
177  ( 0.25 * areaToInterpolate[3][2] );
178  this->a22 = areaToInterpolate[0][0] -
179  ( 2.5 * areaToInterpolate[0][1] ) +
180  ( 2.0 * areaToInterpolate[0][2] ) -
181  ( 0.5 * areaToInterpolate[0][3] ) -
182  ( 2.5 * areaToInterpolate[1][0] ) +
183  ( 6.25 * areaToInterpolate[1][1] ) -
184  ( 5.0 * areaToInterpolate[1][2] ) +
185  ( 1.25 * areaToInterpolate[1][3] ) +
186  ( 2.0 * areaToInterpolate[2][0] ) -
187  ( 5.0 * areaToInterpolate[2][1] ) +
188  ( 4.0 * areaToInterpolate[2][2] ) -
189  areaToInterpolate[2][3] -
190  ( 0.5 * areaToInterpolate[3][0] ) +
191  ( 1.25 * areaToInterpolate[3][1] ) -
192  areaToInterpolate[3][2] +
193  ( 0.25 * areaToInterpolate[3][3] );
194  this->a23 = - ( 0.5 * areaToInterpolate[0][0] ) +
195  ( 1.5 * areaToInterpolate[0][1] ) -
196  ( 1.5 * areaToInterpolate[0][2] ) +
197  ( 0.5 * areaToInterpolate[0][3] ) +
198  ( 1.25 * areaToInterpolate[1][0] ) -
199  ( 3.75 * areaToInterpolate[1][1] ) +
200  ( 3.75 * areaToInterpolate[1][2] ) -
201  ( 1.25 * areaToInterpolate[1][3] ) -
202  areaToInterpolate[2][0] +
203  ( 3.0 * areaToInterpolate[2][1] ) -
204  ( 3.0 * areaToInterpolate[2][2] ) +
205  areaToInterpolate[2][3] +
206  ( 0.25 * areaToInterpolate[3][0] ) -
207  ( 0.75 * areaToInterpolate[3][1] ) +
208  ( 0.75 * areaToInterpolate[3][2] ) -
209  ( 0.25 * areaToInterpolate[3][3] );
210  this->a30 = - ( 0.5 * areaToInterpolate[0][1] ) +
211  ( 1.5 * areaToInterpolate[1][1] ) -
212  ( 1.5 * areaToInterpolate[2][1] ) +
213  ( 0.5*areaToInterpolate[3][1] );
214  this->a31 = ( 0.25 * areaToInterpolate[0][0] ) -
215  ( 0.25 * areaToInterpolate[0][2] ) -
216  ( 0.75 * areaToInterpolate[1][0] ) +
217  ( 0.75 * areaToInterpolate[1][2] ) +
218  ( 0.75 * areaToInterpolate[2][0] ) -
219  ( 0.75 * areaToInterpolate[2][2] ) -
220  ( 0.25 * areaToInterpolate[3][0] ) +
221  ( 0.25 * areaToInterpolate[3][2] );
222  this->a32 = - ( 0.5 * areaToInterpolate[0][0] ) +
223  ( 1.25 * areaToInterpolate[0][1] ) -
224  areaToInterpolate[0][2] +
225  ( 0.25 * areaToInterpolate[0][3] ) +
226  ( 1.5 * areaToInterpolate[1][0] ) -
227  ( 3.75 * areaToInterpolate[1][1] ) +
228  ( 3.0 * areaToInterpolate[1][2] ) -
229  ( 0.75 * areaToInterpolate[1][3] ) -
230  ( 1.5 * areaToInterpolate[2][0] ) +
231  ( 3.75 * areaToInterpolate[2][1] ) -
232  ( 3.0 * areaToInterpolate[2][2] ) +
233  ( 0.75 * areaToInterpolate[2][3] ) +
234  ( 0.5 * areaToInterpolate[3][0] ) -
235  ( 1.25 * areaToInterpolate[3][1] ) +
236  areaToInterpolate[3][2] -
237  ( 0.25 * areaToInterpolate[3][3] );
238  this->a33 = ( 0.25 * areaToInterpolate[0][0] ) -
239  ( 0.75 * areaToInterpolate[0][1] ) +
240  ( 0.75 * areaToInterpolate[0][2] ) -
241  ( 0.25 * areaToInterpolate[0][3] ) -
242  ( 0.75 * areaToInterpolate[1][0] ) +
243  ( 2.25 * areaToInterpolate[1][1] ) -
244  ( 2.25 * areaToInterpolate[1][2] ) +
245  ( 0.75 * areaToInterpolate[1][3] ) +
246  ( 0.75 * areaToInterpolate[2][0] ) -
247  ( 2.25 * areaToInterpolate[2][1] ) +
248  ( 2.25 * areaToInterpolate[2][2] ) -
249  ( 0.75 * areaToInterpolate[2][3] ) -
250  ( 0.25 * areaToInterpolate[3][0] ) +
251  ( 0.75 * areaToInterpolate[3][1] ) -
252  ( 0.75 * areaToInterpolate[3][2] ) +
253  ( 0.25 * areaToInterpolate[3][3] );
254  }
255 
260  ~BicubicInterpolator ( void ) { ; }
261 
271  proshade_double getValue ( proshade_double x, proshade_double y )
272  {
273  //======================================== Sanity check
274  if ( ( ( x < this->xStartIndex ) || ( x > ( this->xStartIndex + this->xRange ) ) ) ||
275  ( ( y < this->yStartIndex ) || ( y > ( this->yStartIndex + this->yRange ) ) ) )
276  {
277  if ( ( x < this->xStartIndex ) || ( x > ( this->xStartIndex + this->xRange ) ) ) { std::cout << "PROBLEM WITH LAT" << std::endl; }
278  if ( ( y < this->yStartIndex ) || ( y > ( this->yStartIndex + this->yRange ) ) ) { std::cout << "PROBLEM WITH LON" << std::endl; }
279 
280  throw ProSHADE_exception ( "Requested bicubic interpolation outside of pre-computed\n : square.", "ES00064", __FILE__, __LINE__, __func__, "The supplied x or y value(s) is outside of the range of\n : the bi-cubic interpolator's pre-computed square. Please\n : make sure the start values were correctly supplied when\n : the constructor was called or create a new interpolator\n : for these values." );
281  }
282 
283  //======================================== Convert x and y to unit square
284  proshade_double unitSquareX = ( x - this->xStartIndex ) / this->xRange;
285  proshade_double unitSquareY = ( y - this->yStartIndex ) / this->yRange;
286 
287  //======================================== Precompute powers
288  proshade_double x2 = std::pow ( unitSquareX, 2.0 );
289  proshade_double x3 = std::pow ( unitSquareX, 3.0 );
290  proshade_double y2 = std::pow ( unitSquareY, 2.0 );
291  proshade_double y3 = std::pow ( unitSquareY, 3.0 );
292 
293  //======================================== Done
294  return ( ( this->a00 + this->a01 * unitSquareY + this->a02 * y2 + this->a03 * y3 ) +
295  ( this->a10 + this->a11 * unitSquareY + this->a12 * y2 + this->a13 * y3 ) * unitSquareX +
296  ( this->a20 + this->a21 * unitSquareY + this->a22 * y2 + this->a23 * y3 ) * x2 +
297  ( this->a30 + this->a31 * unitSquareY + this->a32 * y2 + this->a33 * y3 ) * x3 );
298  }
299  };
300 
301  void complexMultiplication ( proshade_double* r1, proshade_double* i1, proshade_double* r2, proshade_double* i2,
302  proshade_double* retReal, proshade_double* retImag );
303  void complexMultiplicationConjug ( proshade_double* r1, proshade_double* i1, proshade_double* r2, proshade_double* i2,
304  proshade_double* retReal, proshade_double* retImag );
305  proshade_double complexMultiplicationRealOnly ( proshade_double* r1, proshade_double* i1, proshade_double* r2, proshade_double* i2 );
306  proshade_double complexMultiplicationConjugRealOnly ( proshade_double* r1, proshade_double* i1, proshade_double* r2, proshade_double* i2 );
307  void vectorMeanAndSD ( std::vector<proshade_double>* vec, proshade_double*& ret );
308  void vectorMedianAndIQR ( std::vector<proshade_double>* vec, proshade_double*& ret );
309  void arrayMedianAndIQR ( proshade_double* vec, proshade_unsign vecSize, proshade_double*& ret );
310  proshade_double pearsonCorrCoeff ( proshade_double* valSet1, proshade_double* valSet2, proshade_unsign length );
311  void getLegendreAbscAndWeights ( proshade_unsign order, proshade_double* abscissas, proshade_double* weights,
312  proshade_unsign taylorSeriesCap );
313  void getGLPolyAtZero ( proshade_unsign order, proshade_double *polyValue, proshade_double *deriValue );
314  void getGLFirstEvenRoot ( proshade_double polyAtZero, proshade_unsign order, proshade_double *abscAtZero,
315  proshade_double *weighAtZero, proshade_unsign taylorSeriesCap );
316  proshade_double evaluateGLSeries ( proshade_double *series, proshade_double target, proshade_unsign terms );
317  proshade_double advanceGLPolyValue ( proshade_double from, proshade_double to, proshade_double valAtFrom,
318  proshade_unsign noSteps, proshade_unsign taylorSeriesCap );
319  void completeLegendreSeries ( proshade_unsign order, proshade_double* abscissa, proshade_double* weights,
320  proshade_unsign taylorSeriesCap );
321  proshade_double gaussLegendreIntegrationReal ( proshade_double* vals, proshade_unsign valsSize, proshade_unsign order,
322  proshade_double* abscissas, proshade_double* weights, proshade_double integralOverRange,
323  proshade_double maxSphereDists );
324  void gaussLegendreIntegration ( proshade_complex* vals, proshade_unsign valsSize, proshade_unsign order,
325  proshade_double* abscissas, proshade_double* weights, proshade_double integralOverRange,
326  proshade_double maxSphereDists, proshade_double* retReal, proshade_double* retImag );
327  void complexMatrixSVDSigmasOnly ( proshade_complex** mat, int dim, double*& singularValues );
328  void realMatrixSVDUandVOnly ( proshade_double* mat, int dim, proshade_double* uAndV, bool fail = true );
329  void getEulerZXZFromSOFTPosition ( proshade_signed band, proshade_signed x, proshade_signed y, proshade_signed z, proshade_double* eulerAlpha,
330  proshade_double* eulerBeta, proshade_double* eulerGamma );
331  void getSOFTPositionFromEulerZXZ ( proshade_signed band, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma,
332  proshade_double* x, proshade_double* y, proshade_double* z );
333  void getRotationMatrixFromEulerZXZAngles ( proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double* matrix );
334  void getRotationMatrixFromEulerZXZAngles ( proshade_single eulerAlpha, proshade_single eulerBeta, proshade_single eulerGamma, proshade_single* matrix );
335  void getAxisAngleFromRotationMatrix ( proshade_double* rotMat, proshade_double* x, proshade_double* y, proshade_double* z, proshade_double* ang, proshade_signed verbose = 1 );
336  void getAxisAngleFromRotationMatrix ( std::vector< proshade_double >* rotMat, proshade_double* x, proshade_double* y, proshade_double* z, proshade_double* ang, proshade_signed verbose = 1 );
337  void getRotationMatrixFromAngleAxis ( proshade_double* rotMat, proshade_double x, proshade_double y, proshade_double z, proshade_double ang );
338  void getRotationMatrixFromAngleAxis ( proshade_single* rotMat, proshade_double x, proshade_double y, proshade_double z, proshade_double ang );
339  void getEulerZXZFromRotMatrix ( proshade_double* rotMat, proshade_double* eA, proshade_double* eB, proshade_double* eG );
340  void getEulerZXZFromAngleAxis ( proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, proshade_double* eA,
341  proshade_double* eB, proshade_double* eG );
342  void multiplyTwoSquareMatrices ( proshade_double* A, proshade_double* B, proshade_double* res, proshade_unsign dim = 3 );
343  std::vector < proshade_signed > primeFactorsDecomp ( proshade_signed number );
344  proshade_double normalDistributionValue ( proshade_double mean, proshade_double standardDev, proshade_double value );
345  proshade_double computeDotProduct ( proshade_double* x1, proshade_double* y1, proshade_double* z1, proshade_double* x2, proshade_double* y2,
346  proshade_double* z2 );
347  proshade_double computeDotProduct ( proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2,
348  proshade_double z2 );
349  proshade_double* computeCrossProduct ( proshade_double* x1, proshade_double* y1, proshade_double* z1, proshade_double* x2, proshade_double* y2,
350  proshade_double* z2 );
351  proshade_double* computeCrossProduct ( proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2,
352  proshade_double z2 );
353  proshade_double* compute3x3MatrixMultiplication ( proshade_double* mat1, proshade_double* mat2 );
354  proshade_double* compute3x3MatrixVectorMultiplication ( proshade_double* mat, proshade_double x, proshade_double y, proshade_double z );
355  proshade_single* compute3x3MatrixVectorMultiplication ( proshade_single* mat, proshade_single x, proshade_single y, proshade_single z );
356  proshade_double* compute3x3MatrixInverse ( proshade_double* mat );
357  void transpose3x3MatrixInPlace ( proshade_double* mat );
358  proshade_double* build3x3MatrixFromDiag ( proshade_double* diag );
359  proshade_double* build3x3MatrixFromXYZRotations ( proshade_double xRot, proshade_double yRot, proshade_double zRot );
360  proshade_double* findRotMatMatchingVectors ( proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2,
361  proshade_double z2 );
362  proshade_double* compute3x3MoorePenrosePseudoInverseOfIMinusMat ( std::vector < proshade_double >* rMat, proshade_signed verbose );
363  std::vector < proshade_double > findVectorFromTwoVAndTwoD ( proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2,
364  proshade_double z2, proshade_double dot1, proshade_double dot2 );
365  std::vector < proshade_double > findVectorFromThreeVAndThreeD ( proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2,
366  proshade_double z2, proshade_double x3, proshade_double y3, proshade_double z3, proshade_double dot1,
367  proshade_double dot2, proshade_double dot3 );
368  std::vector< proshade_double > multiplyGroupElementMatrices ( std::vector< proshade_double >* el1, std::vector< proshade_double >* el2 );
369  bool rotationMatrixSimilarity ( std::vector< proshade_double >* mat1, std::vector< proshade_double >* mat2, proshade_double tolerance = 0.1 );
370  bool vectorOrientationSimilarity ( proshade_double a1, proshade_double a2, proshade_double a3, proshade_double b1, proshade_double b2,
371  proshade_double b3, proshade_double tolerance = 0.1 );
372  bool vectorOrientationSimilaritySameDirection ( proshade_double a1, proshade_double a2, proshade_double a3, proshade_double b1, proshade_double b2,
373  proshade_double b3, proshade_double tolerance = 0.1 );
374  void optimiseAxisBiCubicInterpolation ( proshade_double* bestLattitude, proshade_double* bestLongitude, proshade_double* bestSum, std::vector<proshade_unsign>* sphereList,
375  std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*>* sphereMappedRotFun, proshade_double step = 0.05 );
376  void prepareBiCubicInterpolatorsMinusMinus ( proshade_double bestLattitude, proshade_double bestLongitude, std::vector<proshade_unsign>* sphereList,
377  std::vector<ProSHADE_internal_maths::BicubicInterpolator*>* interpols, std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*>* sphereMappedRotFun );
378  void prepareBiCubicInterpolatorsMinusPlus ( proshade_double bestLattitude, proshade_double bestLongitude, std::vector<proshade_unsign>* sphereList,
379  std::vector<ProSHADE_internal_maths::BicubicInterpolator*>* interpols, std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*>* sphereMappedRotFun );
380  void prepareBiCubicInterpolatorsPlusMinus ( proshade_double bestLattitude, proshade_double bestLongitude, std::vector<proshade_unsign>* sphereList,
381  std::vector<ProSHADE_internal_maths::BicubicInterpolator*>* interpols, std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*>* sphereMappedRotFun );
382  void prepareBiCubicInterpolatorsPlusPlus ( proshade_double bestLattitude, proshade_double bestLongitude, std::vector<proshade_unsign>* sphereList,
383  std::vector<ProSHADE_internal_maths::BicubicInterpolator*>* interpols, std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*>* sphereMappedRotFun );
384  bool isAxisUnique ( std::vector< proshade_double* >* CSymList, proshade_double* axis, proshade_double tolerance = 0.1, bool improve = false );
385  bool isAxisUnique ( std::vector< proshade_double* >* CSymList, proshade_double X, proshade_double Y, proshade_double Z, proshade_double fold, proshade_double tolerance );
386  std::vector< proshade_unsign > findAllPrimes ( proshade_unsign upTo );
387  proshade_double computeGaussian ( proshade_double val, proshade_double sigma );
388  std::vector < proshade_double > smoothen1D ( proshade_double step, proshade_signed windowSize, proshade_double sigma, std::vector< proshade_double > data );
389  proshade_single getResolutionOfReflection ( proshade_single h, proshade_single k, proshade_single l, proshade_single xDim, proshade_single yDim, proshade_single zDim );
390  void binReciprocalSpaceReflections ( proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_signed* noBin, proshade_signed*& binIndexing );
391  proshade_double computeFSC ( fftw_complex *fCoeffs1, fftw_complex *fCoeffs2, proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds,
392  proshade_signed noBins, proshade_signed* binIndexing, proshade_double**& binData, proshade_signed*& binCounts, proshade_double*& fscByBin );
393  void computeFSCWeightByBin ( proshade_double*& weights1, proshade_double*& weights2, proshade_signed* binIndexing, proshade_double* fscByBin, proshade_signed noBins,
394  proshade_signed xDim, proshade_signed yDim, proshade_signed zDim );
395  proshade_double computeTheFValue ( proshade_complex* fCoeffs, proshade_double* weights, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim );
396  void computeTrFunDerivatives ( proshade_complex* fCoeffs, proshade_double* weights1, proshade_double* weights2, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim,
397  proshade_double*& firstDers, proshade_double*& secondDers );
398  proshade_double* computeTrFunStep ( proshade_double* firstDers, proshade_double* secondDers );
399  std::vector< proshade_signed > findPeaks1D ( std::vector< proshade_double > data );
400  proshade_double findTopGroupSmooth ( std::vector< proshade_double* >* CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize, proshade_double maxLim = 0.9 );
401  proshade_double findTopGroupSmooth ( std::vector< std::vector< proshade_double > >* CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize,
402  proshade_double maxLim = 0.9 );
403  void combineFourierForTranslation ( fftw_complex* tmpOut1, fftw_complex* tmpOut2, fftw_complex*& resOut, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD );
404  void findHighestValueInMap ( fftw_complex* resIn, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD, proshade_double* trsX,
405  proshade_double* trsY, proshade_double* trsZ, proshade_double* mapPeak );
406 }
407 
408 #endif
ProSHADE_internal_maths::gaussLegendreIntegration
void gaussLegendreIntegration(proshade_complex *vals, proshade_unsign valsSize, proshade_unsign order, proshade_double *abscissas, proshade_double *weights, proshade_double integralOverRange, proshade_double maxSphereDists, proshade_double *retReal, proshade_double *retImag)
Function to compute the complete complex Gauss-Legendre integration over spherical harmonic values in...
Definition: ProSHADE_maths.cpp:711
ProSHADE_internal_maths::findVectorFromThreeVAndThreeD
std::vector< proshade_double > findVectorFromThreeVAndThreeD(proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2, proshade_double z2, proshade_double x3, proshade_double y3, proshade_double z3, proshade_double dot1, proshade_double dot2, proshade_double dot3)
Function for finding a vector which would have a given three dot products to three other vectors.
Definition: ProSHADE_maths.cpp:2455
ProSHADE_internal_maths::computeTrFunStep
proshade_double * computeTrFunStep(proshade_double *firstDers, proshade_double *secondDers)
This function computes the step sizes for translation function optimisation from the first and second...
Definition: ProSHADE_maths.cpp:3665
ProSHADE_internal_maths::gaussLegendreIntegrationReal
proshade_double gaussLegendreIntegrationReal(proshade_double *vals, proshade_unsign valsSize, proshade_unsign order, proshade_double *abscissas, proshade_double *weights, proshade_double integralOverRange, proshade_double maxSphereDists)
Function to compute real part of the Gauss-Legendre integration over spherical harmonic values in dif...
Definition: ProSHADE_maths.cpp:621
ProSHADE_internal_maths::vectorMeanAndSD
void vectorMeanAndSD(std::vector< proshade_double > *vec, proshade_double *&ret)
Function to get vector mean and standard deviation.
Definition: ProSHADE_maths.cpp:121
ProSHADE_internal_maths::prepareBiCubicInterpolatorsMinusPlus
void prepareBiCubicInterpolatorsMinusPlus(proshade_double bestLattitude, proshade_double bestLongitude, std::vector< proshade_unsign > *sphereList, std::vector< ProSHADE_internal_maths::BicubicInterpolator * > *interpols, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > *sphereMappedRotFun)
This function prepares the interpolation objects for the bi-cubic interpolation.
Definition: ProSHADE_maths.cpp:2809
ProSHADE_internal_maths::computeTheFValue
proshade_double computeTheFValue(proshade_complex *fCoeffs, proshade_double *weights, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function computes the real part of the sum of all coefficients except where the weight is less t...
Definition: ProSHADE_maths.cpp:3538
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getMinRadius
proshade_double getMinRadius(void)
Accessor function for the private variable minimal radius.
Definition: ProSHADE_spheres.cpp:713
ProSHADE_internal_maths::computeCrossProduct
proshade_double * computeCrossProduct(proshade_double *x1, proshade_double *y1, proshade_double *z1, proshade_double *x2, proshade_double *y2, proshade_double *z2)
Simple 3D vector cross product computation.
Definition: ProSHADE_maths.cpp:1820
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereNumber
proshade_unsign getSphereNumber(void)
Accessor function for the private variable sphere number.
Definition: ProSHADE_spheres.cpp:735
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere
This class contains all inputed data for the rotation function angle-axis converted spheres.
Definition: ProSHADE_maths.hpp:58
ProSHADE_internal_maths::getEulerZXZFromRotMatrix
void getEulerZXZFromRotMatrix(proshade_double *rotMat, proshade_double *eA, proshade_double *eB, proshade_double *eG)
This function converts rotation matrix to the Euler ZXZ angles representation.
Definition: ProSHADE_maths.cpp:1562
ProSHADE_exception
This class is the representation of ProSHADE exception.
Definition: ProSHADE_exceptions.hpp:37
ProSHADE_internal_maths::normalDistributionValue
proshade_double normalDistributionValue(proshade_double mean, proshade_double standardDev, proshade_double value)
Function to the heiht of normal distribution given by mean and standard deviation for a given value.
Definition: ProSHADE_maths.cpp:1771
ProSHADE_internal_maths::prepareBiCubicInterpolatorsPlusMinus
void prepareBiCubicInterpolatorsPlusMinus(proshade_double bestLattitude, proshade_double bestLongitude, std::vector< proshade_unsign > *sphereList, std::vector< ProSHADE_internal_maths::BicubicInterpolator * > *interpols, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > *sphereMappedRotFun)
This function prepares the interpolation objects for the bi-cubic interpolation.
Definition: ProSHADE_maths.cpp:2864
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::~ProSHADE_rotFun_sphere
~ProSHADE_rotFun_sphere(void)
Destructor for releasing memory from the ProSHADE_rotFun_sphere class.
Definition: ProSHADE_spheres.cpp:668
ProSHADE_internal_maths::evaluateGLSeries
proshade_double evaluateGLSeries(proshade_double *series, proshade_double target, proshade_unsign terms)
This function evaluates the Taylor expansion.
Definition: ProSHADE_maths.cpp:449
ProSHADE_internal_maths::build3x3MatrixFromDiag
proshade_double * build3x3MatrixFromDiag(proshade_double *diag)
Function for building a 3x3 matrix from diagonal (and assuming zero padding).
Definition: ProSHADE_maths.cpp:2004
ProSHADE_internal_maths::getSOFTPositionFromEulerZXZ
void getSOFTPositionFromEulerZXZ(proshade_signed band, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *x, proshade_double *y, proshade_double *z)
Function to find the index position in the inverse SOFT map from given Euler angles (ZXZ convention).
Definition: ProSHADE_maths.cpp:988
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getCopyOfValues
std::vector< std::vector< proshade_double > > getCopyOfValues(void)
Function for obtaining a copy of all sphere values.
Definition: ProSHADE_spheres.cpp:920
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getRepresentedAngle
proshade_double getRepresentedAngle(void)
Accessor function for the private variable represented angle.
Definition: ProSHADE_spheres.cpp:724
ProSHADE_internal_maths::BicubicInterpolator::getValue
proshade_double getValue(proshade_double x, proshade_double y)
This function allows accessing the interpolated value for a given position x and y.
Definition: ProSHADE_maths.hpp:271
ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles
void getRotationMatrixFromEulerZXZAngles(proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *matrix)
Function to find the rotation matrix from Euler angles (ZXZ convention).
Definition: ProSHADE_maths.cpp:1020
ProSHADE_misc.hpp
This header file declares all miscellaneous functions.
ProSHADE_internal_maths::complexMultiplication
void complexMultiplication(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2, proshade_double *retReal, proshade_double *retImag)
Function to multiply two complex numbers.
Definition: ProSHADE_maths.cpp:38
ProSHADE_internal_maths::BicubicInterpolator::~BicubicInterpolator
~BicubicInterpolator(void)
This is the destructor for the BicubicInterpolator class.
Definition: ProSHADE_maths.hpp:260
ProSHADE_internal_maths::getGLFirstEvenRoot
void getGLFirstEvenRoot(proshade_double polyAtZero, proshade_unsign order, proshade_double *abscAtZero, proshade_double *weighAtZero, proshade_unsign taylorSeriesCap)
This function finds the first root for Legendre polynomials of odd order.
Definition: ProSHADE_maths.cpp:386
ProSHADE_internal_maths::getEulerZXZFromAngleAxis
void getEulerZXZFromAngleAxis(proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, proshade_double *eA, proshade_double *eB, proshade_double *eG)
This function converts angle-axis representation to the Euler ZXZ angles representation.
Definition: ProSHADE_maths.cpp:1613
ProSHADE_internal_maths::optimiseAxisBiCubicInterpolation
void optimiseAxisBiCubicInterpolation(proshade_double *bestLattitude, proshade_double *bestLongitude, proshade_double *bestSum, std::vector< proshade_unsign > *sphereList, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > *sphereMappedRotFun, proshade_double step=0.05)
This function provides axis optimisation given starting lattitude and longitude indices.
Definition: ProSHADE_maths.cpp:2653
ProSHADE_internal_maths::vectorOrientationSimilarity
bool vectorOrientationSimilarity(proshade_double a1, proshade_double a2, proshade_double a3, proshade_double b1, proshade_double b2, proshade_double b3, proshade_double tolerance=0.1)
This function compares two vectors using cosine distance and decides if they are similar using tolera...
Definition: ProSHADE_maths.cpp:2589
ProSHADE_internal_maths::complexMatrixSVDSigmasOnly
void complexMatrixSVDSigmasOnly(proshade_complex **mat, int dim, double *&singularValues)
Function to compute the complete complex matrix SVD and return only the sigmas.
Definition: ProSHADE_maths.cpp:804
ProSHADE_internal_maths::prepareBiCubicInterpolatorsMinusMinus
void prepareBiCubicInterpolatorsMinusMinus(proshade_double bestLattitude, proshade_double bestLongitude, std::vector< proshade_unsign > *sphereList, std::vector< ProSHADE_internal_maths::BicubicInterpolator * > *interpols, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > *sphereMappedRotFun)
This function prepares the interpolation objects for the bi-cubic interpolation.
Definition: ProSHADE_maths.cpp:2754
ProSHADE_internal_maths::vectorOrientationSimilaritySameDirection
bool vectorOrientationSimilaritySameDirection(proshade_double a1, proshade_double a2, proshade_double a3, proshade_double b1, proshade_double b2, proshade_double b3, proshade_double tolerance=0.1)
This function compares two vectors using cosine distance and decides if they are similar using tolera...
Definition: ProSHADE_maths.cpp:2623
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getMaxRadius
proshade_double getMaxRadius(void)
Accessor function for the private variable maximum radius.
Definition: ProSHADE_spheres.cpp:691
ProSHADE_internal_maths::computeGaussian
proshade_double computeGaussian(proshade_double val, proshade_double sigma)
This function computes a Gaussian (normal) distribution value given distance from mean and sigma.
Definition: ProSHADE_maths.cpp:3103
ProSHADE_internal_maths::pearsonCorrCoeff
proshade_double pearsonCorrCoeff(proshade_double *valSet1, proshade_double *valSet2, proshade_unsign length)
Function for computing the Pearson's correlation coefficient.
Definition: ProSHADE_maths.cpp:246
ProSHADE_internal_maths::BicubicInterpolator::BicubicInterpolator
BicubicInterpolator(proshade_double **areaToInterpolate, proshade_double xStart, proshade_double yStart)
This is the constructor for the BicubicInterpolator class.
Definition: ProSHADE_maths.hpp:123
ProSHADE_internal_maths::computeDotProduct
proshade_double computeDotProduct(proshade_double *x1, proshade_double *y1, proshade_double *z1, proshade_double *x2, proshade_double *y2, proshade_double *z2)
Simple 3D vector dot product computation.
Definition: ProSHADE_maths.cpp:1788
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::findAllPeaks
void findAllPeaks(proshade_signed noSmNeighbours, std::vector< proshade_double > *allHeights)
Function for finding all peaks in the sampling grid.
Definition: ProSHADE_spheres.cpp:949
ProSHADE_internal_maths::findPeaks1D
std::vector< proshade_signed > findPeaks1D(std::vector< proshade_double > data)
This function simply finds all the peaks in a 1D data array.
Definition: ProSHADE_maths.cpp:3693
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::removeSmallPeaks
void removeSmallPeaks(proshade_double peakThres)
Function for removing peaks with too small height.
Definition: ProSHADE_spheres.cpp:1011
ProSHADE_internal_maths::complexMultiplicationConjugRealOnly
proshade_double complexMultiplicationConjugRealOnly(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2)
Function to conjuggate multiply two complex numbers and return the real part only.
Definition: ProSHADE_maths.cpp:103
ProSHADE_internal_maths::getRotationMatrixFromAngleAxis
void getRotationMatrixFromAngleAxis(proshade_double *rotMat, proshade_double x, proshade_double y, proshade_double z, proshade_double ang)
This function converts the axis-angle representation to the rotation matrix representation.
Definition: ProSHADE_maths.cpp:1459
ProSHADE_internal_maths::computeFSC
proshade_double computeFSC(fftw_complex *fCoeffs1, fftw_complex *fCoeffs2, proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&binData, proshade_signed *&binCounts, proshade_double *&fscByBin)
This function computes the FSC.
Definition: ProSHADE_maths.cpp:3347
ProSHADE_internal_maths::findHighestValueInMap
void findHighestValueInMap(fftw_complex *resIn, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD, proshade_double *trsX, proshade_double *trsY, proshade_double *trsZ, proshade_double *mapPeak)
This function simply finds the highest value in fftw_complex map and returns its position and value.
Definition: ProSHADE_maths.cpp:3912
ProSHADE_internal_maths::getAxisAngleFromRotationMatrix
void getAxisAngleFromRotationMatrix(proshade_double *rotMat, proshade_double *x, proshade_double *y, proshade_double *z, proshade_double *ang, proshade_signed verbose=1)
This function converts rotation matrix to the axis-angle representation.
Definition: ProSHADE_maths.cpp:1084
ProSHADE_internal_maths::build3x3MatrixFromXYZRotations
proshade_double * build3x3MatrixFromXYZRotations(proshade_double xRot, proshade_double yRot, proshade_double zRot)
Function for building a 3x3 rotation matrix from the x, y and z rotations in degrees.
Definition: ProSHADE_maths.cpp:2033
ProSHADE_internal_maths::binReciprocalSpaceReflections
void binReciprocalSpaceReflections(proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_signed *noBin, proshade_signed *&binIndexing)
This function does binning of the reciprocal space reflections.
Definition: ProSHADE_maths.cpp:3199
ProSHADE_internal_maths::realMatrixSVDUandVOnly
void realMatrixSVDUandVOnly(proshade_double *mat, int dim, proshade_double *uAndV, bool fail=true)
Function to compute the real matrix SVD and return the U and V matrices.
Definition: ProSHADE_maths.cpp:871
ProSHADE_internal_maths
This namespace contains the internal functions for common mathematical operations.
ProSHADE_internal_maths::combineFourierForTranslation
void combineFourierForTranslation(fftw_complex *tmpOut1, fftw_complex *tmpOut2, fftw_complex *&resOut, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD)
This function combines Fourier coefficients of two structures in a way, so that inverse Fourier of th...
Definition: ProSHADE_maths.cpp:3865
ProSHADE_internal_maths::smoothen1D
std::vector< proshade_double > smoothen1D(proshade_double step, proshade_signed windowSize, proshade_double sigma, std::vector< proshade_double > data)
This function takes a 1D vector and computes smoothened version based on the parameters.
Definition: ProSHADE_maths.cpp:3129
ProSHADE_internal_maths::BicubicInterpolator
Definition: ProSHADE_maths.hpp:110
ProSHADE_internal_maths::findTopGroupSmooth
proshade_double findTopGroupSmooth(std::vector< proshade_double * > *CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize, proshade_double maxLim=0.9)
This function finds a subgroup of axes with distinctly higher correlation value.
Definition: ProSHADE_maths.cpp:3743
ProSHADE_internal_maths::primeFactorsDecomp
std::vector< proshade_signed > primeFactorsDecomp(proshade_signed number)
Function to find prime factors of an integer.
Definition: ProSHADE_maths.cpp:1722
ProSHADE_internal_maths::getGLPolyAtZero
void getGLPolyAtZero(proshade_unsign order, proshade_double *polyValue, proshade_double *deriValue)
This function obtains the Legendre polynomial values and its derivative at zero for any positive inte...
Definition: ProSHADE_maths.cpp:349
ProSHADE_internal_maths::isAxisUnique
bool isAxisUnique(std::vector< proshade_double * > *CSymList, proshade_double *axis, proshade_double tolerance=0.1, bool improve=false)
This function checks if new axis is unique, or already detected.
Definition: ProSHADE_maths.cpp:2974
ProSHADE_internal_maths::getLegendreAbscAndWeights
void getLegendreAbscAndWeights(proshade_unsign order, proshade_double *abscissas, proshade_double *weights, proshade_unsign taylorSeriesCap)
Function to prepare abscissas and weights for Gauss-Legendre integration.
Definition: ProSHADE_maths.cpp:289
ProSHADE_internal_maths::advanceGLPolyValue
proshade_double advanceGLPolyValue(proshade_double from, proshade_double to, proshade_double valAtFrom, proshade_unsign noSteps, proshade_unsign taylorSeriesCap)
This function finds the next value of the polynomial.
Definition: ProSHADE_maths.cpp:479
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::ProSHADE_rotFun_sphere
ProSHADE_rotFun_sphere(proshade_double rad, proshade_double radRange, proshade_unsign dim, proshade_double repAng, proshade_unsign sphNo)
Constructor for getting empty ProSHADE_rotFun_sphere class.
Definition: ProSHADE_spheres.cpp:645
ProSHADE_internal_maths::findRotMatMatchingVectors
proshade_double * findRotMatMatchingVectors(proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2, proshade_double z2)
Computation of rotation matrix rotating one vector onto the other.
Definition: ProSHADE_maths.cpp:2095
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereLatLonPosition
proshade_double getSphereLatLonPosition(proshade_unsign lattitude, proshade_unsign longitude)
Accessor function for specific lattitude and longitude point of the sphere sampling grid.
Definition: ProSHADE_spheres.cpp:861
ProSHADE_internal_maths::compute3x3MatrixVectorMultiplication
proshade_double * compute3x3MatrixVectorMultiplication(proshade_double *mat, proshade_double x, proshade_double y, proshade_double z)
Function for computing a 3x3 matrix to 3x1 vector multiplication.
Definition: ProSHADE_maths.cpp:1898
ProSHADE_internal_spheres
This namespace contains the structure and functions required for storing internal map projections ont...
Definition: ProSHADE_maths.hpp:49
ProSHADE_internal_maths::compute3x3MoorePenrosePseudoInverseOfIMinusMat
proshade_double * compute3x3MoorePenrosePseudoInverseOfIMinusMat(std::vector< proshade_double > *rMat, proshade_signed verbose)
This function computes the Moore-Penrose pseudo-inverse of equation I - input matrix.
Definition: ProSHADE_maths.cpp:2162
ProSHADE_internal_maths::rotationMatrixSimilarity
bool rotationMatrixSimilarity(std::vector< proshade_double > *mat1, std::vector< proshade_double > *mat2, proshade_double tolerance=0.1)
This function compares the distance between two rotation matrices and decides if they are similar usi...
Definition: ProSHADE_maths.cpp:2552
ProSHADE_internal_maths::getEulerZXZFromSOFTPosition
void getEulerZXZFromSOFTPosition(proshade_signed band, proshade_signed x, proshade_signed y, proshade_signed z, proshade_double *eulerAlpha, proshade_double *eulerBeta, proshade_double *eulerGamma)
Function to find Euler angles (ZXZ convention) from index position in the inverse SOFT map.
Definition: ProSHADE_maths.cpp:963
ProSHADE_internal_maths::vectorMedianAndIQR
void vectorMedianAndIQR(std::vector< proshade_double > *vec, proshade_double *&ret)
Function to get vector median and inter-quartile range.
Definition: ProSHADE_maths.cpp:149
ProSHADE_internal_maths::computeTrFunDerivatives
void computeTrFunDerivatives(proshade_complex *fCoeffs, proshade_double *weights1, proshade_double *weights2, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_double *&firstDers, proshade_double *&secondDers)
This function computes the first and second derivatives of the translation function at coefficient [0...
Definition: ProSHADE_maths.cpp:3576
ProSHADE_internal_maths::complexMultiplicationConjug
void complexMultiplicationConjug(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2, proshade_double *retReal, proshade_double *retImag)
Function to multiply two complex numbers by using the second number's conjugate.
Definition: ProSHADE_maths.cpp:62
ProSHADE_internal_maths::transpose3x3MatrixInPlace
void transpose3x3MatrixInPlace(proshade_double *mat)
Transposes 3x3 matrix in place.
Definition: ProSHADE_maths.cpp:1976
ProSHADE_internal_maths::completeLegendreSeries
void completeLegendreSeries(proshade_unsign order, proshade_double *abscissa, proshade_double *weights, proshade_unsign taylorSeriesCap)
This function completes the Legendre polynomial series assuming you have obtained the first values.
Definition: ProSHADE_maths.cpp:523
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getRadius
proshade_double getRadius(void)
Accessor function for the private variable radius.
Definition: ProSHADE_spheres.cpp:681
ProSHADE_internal_maths::findVectorFromTwoVAndTwoD
std::vector< proshade_double > findVectorFromTwoVAndTwoD(proshade_double x1, proshade_double y1, proshade_double z1, proshade_double x2, proshade_double y2, proshade_double z2, proshade_double dot1, proshade_double dot2)
Function for finding a vector which would have a given two dot products to two other vectors.
Definition: ProSHADE_maths.cpp:2309
ProSHADE_internal_maths::prepareBiCubicInterpolatorsPlusPlus
void prepareBiCubicInterpolatorsPlusPlus(proshade_double bestLattitude, proshade_double bestLongitude, std::vector< proshade_unsign > *sphereList, std::vector< ProSHADE_internal_maths::BicubicInterpolator * > *interpols, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > *sphereMappedRotFun)
This function prepares the interpolation objects for the bi-cubic interpolation.
Definition: ProSHADE_maths.cpp:2919
ProSHADE_internal_maths::multiplyTwoSquareMatrices
void multiplyTwoSquareMatrices(proshade_double *A, proshade_double *B, proshade_double *res, proshade_unsign dim=3)
Function to compute matrix multiplication.
Definition: ProSHADE_maths.cpp:1696
ProSHADE_internal_maths::getResolutionOfReflection
proshade_single getResolutionOfReflection(proshade_single h, proshade_single k, proshade_single l, proshade_single xDim, proshade_single yDim, proshade_single zDim)
This function computes the resolution of a particular reflection.
Definition: ProSHADE_maths.cpp:3165
ProSHADE_internal_maths::computeFSCWeightByBin
void computeFSCWeightByBin(proshade_double *&weights1, proshade_double *&weights2, proshade_signed *binIndexing, proshade_double *fscByBin, proshade_signed noBins, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function computes the weights for each reflection using its bin belonging.
Definition: ProSHADE_maths.cpp:3446
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getSphereLatLonLinearInterpolationPos
proshade_double getSphereLatLonLinearInterpolationPos(proshade_double lattitude, proshade_double longitude)
Function for obtaining sphere values outside of the grid points.
Definition: ProSHADE_spheres.cpp:875
ProSHADE_internal_maths::findAllPrimes
std::vector< proshade_unsign > findAllPrimes(proshade_unsign upTo)
This function finds all prime numbers up to the supplied limit.
Definition: ProSHADE_maths.cpp:3058
ProSHADE_internal_maths::compute3x3MatrixInverse
proshade_double * compute3x3MatrixInverse(proshade_double *mat)
Function for computing a 3x3 matrix inverse.
Definition: ProSHADE_maths.cpp:1943
ProSHADE_internal_maths::arrayMedianAndIQR
void arrayMedianAndIQR(proshade_double *vec, proshade_unsign vecSize, proshade_double *&ret)
Function to get array median and inter-quartile range.
Definition: ProSHADE_maths.cpp:200
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getAngularDim
proshade_unsign getAngularDim(void)
Accessor function for the private variable angular dim.
Definition: ProSHADE_spheres.cpp:702
ProSHADE_internal_maths::multiplyGroupElementMatrices
std::vector< proshade_double > multiplyGroupElementMatrices(std::vector< proshade_double > *el1, std::vector< proshade_double > *el2)
This function computes matrix multiplication using the ProSHADE group element matrix format as input ...
Definition: ProSHADE_maths.cpp:2499
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::interpolateSphereValues
void interpolateSphereValues(proshade_complex *rotFun)
Function for interpolating the sphere grid values from angle-axis converted rotation function.
Definition: ProSHADE_spheres.cpp:762
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere::getPeaks
std::vector< std::pair< proshade_unsign, proshade_unsign > > getPeaks(void)
Accessor function for the private variable containing all detected peaks.
Definition: ProSHADE_spheres.cpp:746
ProSHADE_internal_maths::complexMultiplicationRealOnly
proshade_double complexMultiplicationRealOnly(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2)
Function to multiply two complex numbers and return the real part only.
Definition: ProSHADE_maths.cpp:83
ProSHADE_internal_maths::compute3x3MatrixMultiplication
proshade_double * compute3x3MatrixMultiplication(proshade_double *mat1, proshade_double *mat2)
Function for computing a 3x3 matrix multiplication.
Definition: ProSHADE_maths.cpp:1868