Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / BilatTools_CPP / src / core / tools / cpp / TabTools.cpp
1 #include <iostream>
2 #include <math.h>
3 #include <cstdlib>
4 #include <stdlib.h>
5
6 #include "TabTools.h"
7 #include "AleaTools.h"
8
9 using std::cout;
10 using std::endl;
11
12 /*----------------------------------------------------------------------*\
13 |* Implementation *|
14 \*---------------------------------------------------------------------*/
15
16 /*--------------------------------------*\
17 |* Constructor *|
18 \*-------------------------------------*/
19
20 TabTools::TabTools()
21 {
22 // rien
23 }
24
25 TabTools::~TabTools()
26 {
27 // rien
28 }
29
30 /*--------------------------------------*\
31 |* Methodes *|
32 \*-------------------------------------*/
33
34 /*----------------------*\
35 |* static *|
36 \*---------------------*/
37
38 double TabTools::reduction(double* tab, int n)
39 {
40 double sum=0;
41 for(int i=1;i<=n;i++)
42 {
43 sum+=*tab;
44 tab++;
45 }
46 return sum;
47 }
48
49 void TabTools::init(double* tab,int n,double a)
50 {
51 for(int i=1;i<=n;i++)
52 {
53 *tab=a;
54 tab++;
55 }
56 }
57
58
59
60
61 /*----------------------------------------------------------------------*\
62 |* End *|
63 \*---------------------------------------------------------------------*/
64