/
ThreeDeePolynomial.h
59 lines (46 loc) · 2.12 KB
/
ThreeDeePolynomial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* -------------------------------------------------------------------------- */
/* ThreeDeePolynomial.h */
/* */
/* 3D polynomial basic routines header file. */
/* */
/* A.Kisselev, PNPI, St.Petersburg, Russia. */
/* e-mail: kisselev@hermes.desy.de */
/* -------------------------------------------------------------------------- */
#ifndef _THREE_DEE_POLYNOMIAL_H
#define _THREE_DEE_POLYNOMIAL_H
class ThreeDeePolySpace;
class ThreeDeePolynomial {
friend class ThreeDeePolySpace;
public:
// Constructor;
ThreeDeePolynomial(ThreeDeePolySpace *_space);
// Polynomial value at a given point;
double value(double xx[3]);
// Calculate polynomial gradient;
int calculateGradient(ThreeDeePolynomial *gradient[3]);
private:
// Polynomial may be turned off alltogether; really used?;
int off;
// Back door; in principle one could use a declared polynomial
// on top of some other (parameter-compatible) ThreeDeePolySpace object;
// to this point I just do not want to overload the code; should
// check however that some functionality of mgrid routines (the
// only ones which are actually using this stuff) is not lost
// after moving this pointer from parameters to ThreeDeePolynomial class
// variable;
ThreeDeePolySpace *space;
// 'linear' means 'dim' coefficients with respect to the
// basis vectors; 'cff' are 3-dim array of coefficients
// to polynomials like 'x2yz';
double ***cff, *linear;
// Get polynomial value at a given 3D space point;
double linearValue(double xx[3]);
// Normalization, rescaling, increment; do not bother to create
// overloaded operators, sorry;
int normalize();
void multiply(double _cff);
void increment(ThreeDeePolynomial *incr);
// Recalculate basis representation to cff[] array;
void convertLinearToCff();
} ;
#endif