MADNESS  0.10.1
testpc.h
Go to the documentation of this file.
1 #ifndef MAD_TESTPC_H
2 #define MAD_TESTPC_H
3 
4 #include <iostream>
5 #include <complex>
6 #include <numeric>
7 #include <vector>
8 #include <cmath>
9 
10 #include <madness/misc/gnuplot.h>
11 
12 const double pi = 3.14159265358979323846;
13 const double L = 1.0; // must be integer for cosine test to work, and > 1 for gaussian tests to work
14 const double xshift = 0.0; // shift from origin of charge distributions to test the periodicity in [-0.5*L,0.5*L]
15 const double yshift = 0.0;
16 const double zshift = 0.0;
17 
18 // Will be assigned by main program based on test_case selection
19 extern double (*f)(double, double, double);
20 extern double (*exact)(double, double, double);
21 
22 void set_test_case(int test_case);
23 
24 // print the matrix M[m,n] in row-major order
25 template <typename T>
26 void print(size_t m, size_t n, const std::vector<T>& M) {
27  for (size_t i=0; i<m; i++) {
28  for (size_t j=0; j<n; j++) {
29  std::cout << i << " " << M[i*n+j] << " ";
30  }
31  std::cout << std::endl;
32  }
33 }
34 
35 std::vector<double> tabulate(double(*f)(double, double, double), std::vector<double> x, std::vector<double> y, std::vector<double> z);
36 
37 std::vector<double> linspace(double a, double b, size_t n, bool include_right_endpoint = true);
38 
39 #endif
const double m
Definition: gfit.cc:199
static const double b
Definition: nonlinschro.cc:119
static const double a
Definition: nonlinschro.cc:118
const double L
Definition: testpc.h:13
const double zshift
Definition: testpc.h:16
const double pi
Definition: testpc.h:12
const double yshift
Definition: testpc.h:15
double(* exact)(double, double, double)
Definition: testfuns.cc:6
void print(size_t m, size_t n, const std::vector< T > &M)
Definition: testpc.h:26
std::vector< double > tabulate(double(*f)(double, double, double), std::vector< double > x, std::vector< double > y, std::vector< double > z)
Definition: testfuns.cc:51
void set_test_case(int test_case)
Definition: testfuns.cc:230
std::vector< double > linspace(double a, double b, size_t n, bool include_right_endpoint=true)
Definition: testfuns.cc:221
double(* f)(double, double, double)
Definition: testfuns.cc:5
const double xshift
Definition: testpc.h:14