Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

hadamard.cpp 796 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/***************************************
	Auteur : Pierre Aubert
	Mail : aubertp7@gmail.com
	Licence : CeCILL-C
****************************************/

//some doc at : https://en.cppreference.com/w/cpp/header/algorithm
#include <algorithm>

//Some doc at : https://en.cppreference.com/w/cpp/header/execution
#include <execution>


14
#include "hadamard.h"
15

16
///Do a classical hadamard product
17 18 19 20 21
/**	@param[out] tabRes : table of the result
 * 	@param tabX : talbe of x values
 * 	@param tabY : table of y values
 * 	@param nbElement : number of elements in the tables
*/
22 23 24
void hadamard_product(float * tabRes, const float* tabX, const float* tabY, size_t nbElement){
	std::transform(std::execution::par_unseq, tabX, tabX + nbElement, tabY, tabRes,
			[=](float xi, float yi){ return xi * yi; });
25 26 27
}