5.6.1 : Le fichier hadamard_product.h

Développons le hadamard_product.h :

On gère les inclusions multiples comme d'habitude :
1
2
#ifndef __HADAMARD_PRODUCT_H__
#define __HADAMARD_PRODUCT_H__


On utilisera des vecteurs :
1
#include <vector>


On définit le prototype de notre fonction noteet là ce produit de Hadamard va vraiment nous servir :
1
2
3
4
void hadamard_product(std::vector<float> & tabRes, const std::vector<float> & tabX, const std::vector<float> & tabY); 


#endif


Le fichier hadamard_product.h complet :

1
2
3
4
5
6
7
8
9
10
11
12
13
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/
#ifndef __HADAMARD_PRODUCT_H__
#define __HADAMARD_PRODUCT_H__
#include <vector>

void hadamard_product(std::vector<float> & tabRes, const std::vector<float> & tabX, const std::vector<float> & tabY); 


#endif


Le fichier hadamard_product.h est disponible ici.