#ifndef SAVE_ARRAY_H
#define SAVE_ARRAY_H
#include<complex>
#include<iostream>
#include<fstream>
#include<map>
#include"Cvec.h"
#include"Wavefunction.h"
typedef std::complex<double> Creal;
using namespace std;

class Save_Array{
public:
	ofstream ofs;		// stream for saving
	int active = 0;		// stream active? no-0, yes-1


	Save_Array();
	~Save_Array();

	// open file at given path and with given filename
	void init(string path, string filename);

	// write header, #rows and #columns
	void write_begin(int rows, int columns);

	// write complex vector in file
	void write(Cvec input);

	// write complex wavefunction (also a vector) in file
	void write(Wavefunction input);

	// write complex number in file
	void write(Creal input);

	// close file
	void close();


};


#endif

