#ifndef _NIS_SOLVER_H_
#define _NIS_SOLVER_H_

#include "nis_solver_base.h"
#include "..\handle.h"

class NISSolver : public NISSolverBase
{
public:
	NISSolver();
	~NISSolver();

	// init;
	void Init(const VectorX& x, const EigenMatrixi& elements_indices, std::vector<Handle>& handles, bool mode);
	// update handle;
	void PrepareHandleInfo(const VectorX& x, std::vector<Handle>& handles, EigenMatrix& per_element_weights); // update handle information

	// GetDetF Info
	void GetDetF(const VectorX& x, std::vector<float>& list_detf);
	// GetW11Info
	void GetW11(const VectorX& x, std::vector<float>& list_w11);
	// Get Det(W) Info
	void GetDetW(const VectorX& x, std::vector<float>& list_detw);
	// Get the smallest det(W)
	ScalarType GetSmallestDetW(const VectorX& x);

	inline bool Info() {return m_initialized;}

protected:
	bool m_initialized;
};

#endif