File: rfs_tensor.h

package info (click to toggle)
dynare 4.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,408 kB
  • sloc: cpp: 84,998; ansic: 29,058; pascal: 13,843; sh: 4,833; objc: 4,236; yacc: 3,622; makefile: 2,278; lex: 1,541; python: 236; lisp: 69; xml: 8
file content (121 lines) | stat: -rw-r--r-- 2,176 bytes parent folder | download | duplicates (5)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*1:*/
#line 37 "./rfs_tensor.hweb"

#ifndef RFS_TENSOR_H
#define RFS_TENSOR_H

#include "tensor.h"
#include "fs_tensor.h"
#include "symmetry.h"

/*2:*/
#line 53 "./rfs_tensor.hweb"

class FRTensor;
class URTensor:public UTensor{
int nv;
public:
/*3:*/
#line 73 "./rfs_tensor.hweb"

URTensor(int c,int nvar,int d)
:UTensor(along_row,IntSequence(d,nvar),
UFSTensor::calcMaxOffset(nvar,d),c,d),nv(nvar){}
URTensor(const URTensor&ut)
:UTensor(ut),nv(ut.nv){}
URTensor(const FRTensor&ft);

/*:3*/
#line 58 "./rfs_tensor.hweb"
;
virtual~URTensor(){}

void increment(IntSequence&v)const;
void decrement(IntSequence&v)const;
FTensor&fold()const;

int getOffset(const IntSequence&v)const;
int nvar()const
{return nv;}
Symmetry getSym()const
{return Symmetry(dimen());}
};

/*:2*/
#line 45 "./rfs_tensor.hweb"
;
/*4:*/
#line 82 "./rfs_tensor.hweb"

class FRTensor:public FTensor{
int nv;
public:
/*5:*/
#line 102 "./rfs_tensor.hweb"

FRTensor(int c,int nvar,int d)
:FTensor(along_row,IntSequence(d,nvar),
FFSTensor::calcMaxOffset(nvar,d),c,d),nv(nvar){}
FRTensor(const FRTensor&ft)
:FTensor(ft),nv(ft.nv){}
FRTensor(const URTensor&ut);

/*:5*/
#line 86 "./rfs_tensor.hweb"
;
virtual~FRTensor(){}

void increment(IntSequence&v)const;
void decrement(IntSequence&v)const;
UTensor&unfold()const;

int nvar()const
{return nv;}
int getOffset(const IntSequence&v)const
{return FTensor::getOffset(v,nv);}
Symmetry getSym()const
{return Symmetry(dimen());}
};

/*:4*/
#line 46 "./rfs_tensor.hweb"
;
/*6:*/
#line 117 "./rfs_tensor.hweb"

class URSingleTensor:public URTensor{
public:
URSingleTensor(int nvar,int d)
:URTensor(1,nvar,d){}
URSingleTensor(const vector<ConstVector> &cols);
URSingleTensor(const ConstVector&v,int d);
URSingleTensor(const URSingleTensor&ut)
:URTensor(ut){}
virtual~URSingleTensor(){}
FTensor&fold()const;
};

/*:6*/
#line 47 "./rfs_tensor.hweb"
;
/*7:*/
#line 136 "./rfs_tensor.hweb"

class FRSingleTensor:public FRTensor{
public:
FRSingleTensor(int nvar,int d)
:FRTensor(1,nvar,d){}
FRSingleTensor(const URSingleTensor&ut);
FRSingleTensor(const FRSingleTensor&ft)
:FRTensor(ft){}
virtual~FRSingleTensor(){}
};


/*:7*/
#line 48 "./rfs_tensor.hweb"
;

#endif

/*:1*/