#ifndef POTENTIAL_H
#define POTENTIAL_H
#include"Cvec.h"
#include<complex>
typedef std::complex<double> Creal;


class Potential :public Cvec {
protected:
	double& dx;

public:
	// initialize potential with step dxin
	Potential(double& dxin);
	// initialize potentisl with length n and step dxin
	Potential(const int n, double& dxin);


	//-------------Functions----------
	// addition of (real) "d" to every entry of potential
	friend Potential operator+(const double& d, const Potential& vin) {
		Potential out(vin.size, vin.dx);
		for (int i = 0; i < vin.size; i++) out.vec[i] = vin.vec[i] + d;
		return out;
	};
	// initialize box potential over xlist with depth (negative number reqiured) for x0-length/2(incl) to x0+length/2(incl) (else zero)
	void init_box(Cvec xlist, double depth, double length, double x0);
	// initialize box potential with fermi edge on the right
	void init_fermibox(Cvec xlist, double depth, double s, double length, double x0);
	// initalize screened/smoothed Coulomb potential over xlist with mean x0, atomic number Z, screening parameter a
	void init_Coulomb(Cvec xlist, double x0, int Z, double a);
	//
	void init_Yukawa(Cvec xlist, double x0, int Z, double a);
	// initialize step potential over xlist with height (positive number required) for x >= x0 (else 0)
	void init_step(Cvec xlist, double x0, double height);


	// init imaginary potential for absorbing boundary conditions
	void init_imag(Cvec xlist, double x0, Creal value, double power);

	Potential& operator=(const Potential& in);
	Potential& operator=(const double& in);
	Potential operator+(const Potential& in);
	Potential operator+(const Cvec& in);
	Potential operator*(const double& in);

	double minimum();
};


#endif
