/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/


//Warning : this file has been generated automatically by the phoenix_hdf5 program
//You can find it at https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/PhoenixHDF5
//Do NOT modify it


#ifndef __MATRIXHDF5_H__
#define __MATRIXHDF5_H__

#include <iostream>
#include "H5Cpp.h"

///@brief Matrix of the concentation of the U specie
class MatrixHdf5{
	public:
		MatrixHdf5();
		virtual ~MatrixHdf5();

		void setTableName(const std::string & name);
		size_t getNbEntries() const;
		void resize(size_t nbRow);
		void clear();

		void read(const std::string & fileName);
		void read(const H5::H5File & file);
		void read(const H5::Group & group);

		void write(const std::string & fileName) const;
		void write(H5::H5File & file) const;
		void write(H5::Group & group) const;

		void setRow(size_t i, float * tabMat);
		void getRow(size_t i, float *& tabMat);
		void getRow(size_t i, const float *& tabMat) const;
		void setTabMat(size_t i, const float * tabVal);
		const float * getTabMatFull() const;
		float * getTabMatFull();
		const float * getTabMat(size_t i) const;
		float * getTabMat(size_t i);

		size_t getOffsetTabMat() const;
		H5::CompType getCompTypeAll() const;
		H5::CompType getCompTypeTabMat() const;
		H5::DataType getTypeTabMat() const;

		void setAllDim(size_t nbCol, size_t nbRow);
		void setNbCol(size_t val);
		size_t getNbCol() const;
		void setNbRow(size_t val);
		size_t getNbRow() const;

	private:
		void readDataSet(const H5::DataSet & dataset);
		void writeDataSet(H5::DataSet & dataset) const;
		void allocate(size_t nbRow);

		void readDimTabMat(const H5::CompType & compType);

		///Number of rows in the table MatrixHdf5
		size_t p__nbRow;

		///HDF5 name of the table MatrixHdf5
		std::string p__tableName;

		///Tensor dimension nbCol
		size_t p_nbCol;
		///Tensor dimension nbRow
		size_t p_nbRow;

		///Matrix of the concentration of the U specie
		float * p_tabMat;
};

#endif

