Menu

[r5]: / wizard.hpp  Maximize  Restore  History

Download this file

81 lines (58 with data), 1.9 kB

 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
#ifndef _LACE_WIZARD_H
#define _LACE_WIZARD_H
//#include <lace/shape.hpp>
//#include <lace/storage.hpp>
#include <lace/matrix.hpp>
//#include <lace/expressions.hpp>
// Forward declarations
namespace _lace_main{
template<class VALTYPE>
class unary;
template<class VALTYPE>
class convertor;
template<class VALTYPE>
class summator;
template<class VALTYPE>
class multiplicator;
};
namespace _lace_main{
using _lace_storage::matrix_type;
using _lace_storage::n_matrix_type;
using _lace_storage::rectang;
using _lace_storage::symmetric;
using _lace_storage::hermitian;
using _lace_storage::banddiag;
using _lace_storage::symmband;
using _lace_storage::hermband;
using _lace_storage::triang;
/* -------------------------------------------------------- *
* The wizard class -- main internal interface *
* -------------------------------------------------------- */
template<class VALTYPE>
class wizard
{
static unary<VALTYPE> *_unary [n_matrix_type];
static convertor<VALTYPE> *_convertor [n_matrix_type][n_matrix_type];
static summator<VALTYPE> *_summator [n_matrix_type][n_matrix_type];
static multiplicator<VALTYPE> *_multiplicator [n_matrix_type][n_matrix_type][n_matrix_type];
public:
static inline unary<VALTYPE>& unary(matrix_type mtp)
{
return *_unary[mtp];
}
static inline convertor<VALTYPE>& convertor(matrix_type mtp1, matrix_type mtp2)
{
return *_convertor[mtp1][mtp2];
}
static inline summator<VALTYPE>& summator(matrix_type mtp1, matrix_type mtp2)
{
return *_summator[mtp1][mtp2];
}
static inline multiplicator<VALTYPE>& multiplicator(matrix_type mtpa, matrix_type mtpb,
matrix_type mtpc)
{
return *_multiplicator[mtpa][mtpb][mtpc];
}
};
};
#endif