4.1.6.1 : Le header MatrixHdf5.h



Il décrit les diffrentes méthodes que nous pourront utiliser comme la lecture, l'écriture, l'allocation et l'intialisation d'un bloc d'images, etc.

Le fichier header MatrixHdf5.h ressemble à ceci :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/***************************************
	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