#ifndef __FILE_AUXFUNCS_H_SEEN__
#define __FILE_AUXSFUNCS_H_SEEN__

double ncdf(const double q);

int binary_val(const double& x, const int& nx, const double* X);

void ar1(const double& lambda, double* Z, double* P);

void kGrid(const double* Z, double* K);

void vfInit(const double* Z, double* V);

void grid_max(const int& klo, const int& nksub, int& l, double& w,
	      double& wmax, int& windmax, const double& ydepK,
	      const double* K, const double* Exp, double* V, double* G);

void binary_max(const int& klo, const int& nksub, int& kslo, int& kshi,
		int& ksmid1, int& ksmid2, double& w1, double& w2, double& w3,
		const double& ydepK, const double* K, const double* Exp,
		double* V, double* G);

void vfStep(int& klo, int& khi, int& nksub, int& kslo, int& kshi, int& ksmid1,
	    int& ksmid2, double& w, double& wmax, int& windmax, double& w1,
	    double& w2, double& w3, int& i, int& j, int& l, double& ydepK,
	    const bool& howard, const double* K,const double* Z,
	    const double* P, double* Exp, const double* V0, double* V,
	    double* G);

int vfiCPU(double* V, double* G);

int vfiGPU(double* hV, double* hG);

#endif
