Complex constant(d3vec r,double dconst) Complex planewave(d3vec r,double G)Output:
- constant: for all values of r, returns the same value, dconst as a Complex number, Complex(dconst,0.)
- planewave: returns exp(i*G*r.x)
To debug evalr() above and to test that your transforms represent the correct physics, add the two functions above to your physics.C program (not as part of the pvector class, but as regular functions). Then, compile and run the program. Note how the program uses the statement ``ones.evalr(constant,1.)'' to fill the pvector ``ones'' with the value of 1. using your constant() function!
Next, based on the test for G=(0,0,0) provided in main(), use your planewave() function to write your own test for G=(1,0,0).