1
struct p : std::unary_function<point,Float> {
2
Float operator() (const point& x) const {
3
if (d == 2) return 26*(pow(x[0],5) - 10*pow(x[0],3)*sqr(x[1])
5
else return 3*sqr(x[0])*x[1] - pow(x[1],3);
7
p (size_t d1) : d(d1) {}
10
struct f : std::unary_function<point,Float> {
11
Float operator() (const point& x) const {
12
if (d == 2) return _p(x)/pow(norm(x),5);
13
else return alpha*_p(x);
15
f (size_t d1) : d(d1), _p(d1) {
16
Float pi = acos(Float(-1));
17
alpha = -(13./8.)*sqrt(35./pi);
19
protected: size_t d; p _p; Float alpha;
21
struct u : std::unary_function<point,Float> {
22
Float operator() (const point& x) const {
23
if (d == 2) return _f(x)/(25+sqr(norm(x)));
24
else return sqr(norm(x))/(12+sqr(norm(x)))*_f(x);
26
u (size_t d1) : d(d1), _f(d1) {}
27
protected: size_t d; f _f;
29
Float phi (const point& x) { return norm(x) - 1; }