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
11
12const double pi = 3.14159265358979323846;
13const double L = 1.0; // must be integer for cosine test to work, and > 1 for gaussian tests to work
14const double xshift = 0.0; // shift from origin of charge distributions to test the periodicity in [-0.5*L,0.5*L]
15const double yshift = 0.0;
16const double zshift = 0.0;
17
18// Will be assigned by main program based on test_case selection
19extern double (*f)(double, double, double);
20extern double (*exact)(double, double, double);
21
22void set_test_case(int test_case);
23
24// print the matrix M[m,n] in row-major order
25template <typename T>
26void 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
35std::vector<double> tabulate(double(*f)(double, double, double), std::vector<double> x, std::vector<double> y, std::vector<double> z);
36
37std::vector<double> linspace(double a, double b, size_t n, bool include_right_endpoint = true);
38
39#endif
static const double b
Definition nonlinschro.cc:119
static const double a
Definition nonlinschro.cc:118
static const double m
Definition relops.cc:9
const double L
Definition testpc.h:13
std::vector< double > linspace(double a, double b, size_t n, bool include_right_endpoint=true)
Definition testfuns.cc:221
const double zshift
Definition testpc.h:16
const double pi
Definition testpc.h:12
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
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
void set_test_case(int test_case)
Definition testfuns.cc:230
double(* f)(double, double, double)
Definition testfuns.cc:5
const double xshift
Definition testpc.h:14