tensormatrix.h 2.05 KB
Newer Older
Camille Coti's avatar
Camille Coti committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _TENSORMATRIX_H_
#define _TENSORMATRIX_H_

namespace gi = GiNaC;

/*******************************************************************************
 *                                Datatypes                                    *
 *******************************************************************************/

typedef std::vector<std::vector<std::vector<gi::ex> > > tensor3D_t;
typedef std::vector<std::vector<gi::ex> > slab_t;
typedef std::vector<gi::ex> line_t;

typedef std::vector<std::vector<int> > matrix_int_t;
typedef std::vector<int> vector_int_t;

/*******************************************************************************
 *                                Prototypes                                   *
 *******************************************************************************/

// sequential
22
23
24
gi::ex multiply_seq( tensor3D_t&, int );
gi::ex multiply_1level( tensor3D_t&, int );
gi::ex multiply_2levels( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
25
// parallel
26
gi::ex multiply_1level_mw( tensor3D_t&, int );
27
gi::ex multiply_1level_mw2( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
28
gi::ex multiply_1level_mw3( tensor3D_t&, int );
29
gi::ex multiply_1level_mw_addslave( tensor3D_t&, int );
30
gi::ex multiply_1level_mw_addslave2( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
31
gi::ex multiply_1level_mw_addslave3( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
32
gi::ex multiply_1level_mw_addslave4( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
33
gi::ex multiply_2levels_mw_hierarch( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
34
gi::ex multiply_2levels_mw_hierarch2( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
35
gi::ex multiply_combined( tensor3D_t&, int );
Camille Coti's avatar
Camille Coti committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49

/*******************************************************************************
 *                              Default values                                 *
 *******************************************************************************/

#define DEFAULTN           4    /* Default size */
#define DEFAULTFUNCTION   'm'   /* Default function to use */
#define NBFOREMEN          2    /* Default number of foremen to use with the hierarchical M/W */

#define ROOT 0

#define MAXRESULT 8   /* Maximum results to accumulate before sending the addition to a slave */

#endif // ndef _TENSORMATRIX_H_