NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
variables.hpp
Go to the documentation of this file.
1
36/* If you use this library, you must include dtl.hpp only. */
37
38#ifndef DTL_VARIABLES_H
39#define DTL_VARIABLES_H
40
41#include <vector>
42#include <list>
43#include <string>
44#include <algorithm>
45#include <iostream>
46
47namespace dtl {
48
49 using std::vector;
50 using std::string;
51 using std::pair;
52 using std::ostream;
53 using std::list;
54 using std::for_each;
55 using std::distance;
56 using std::fill;
57 using std::cout;
58 using std::endl;
59 using std::rotate;
60 using std::swap;
61 using std::max;
62
66 const string version = "1.19";
67
71 typedef int edit_t;
72 const edit_t SES_DELETE = -1;
73 const edit_t SES_COMMON = 0;
74 const edit_t SES_ADD = 1;
75
79#define SES_MARK_DELETE "-"
80#define SES_MARK_COMMON " "
81#define SES_MARK_ADD "+"
82
86 typedef struct eleminfo {
87 long long beforeIdx; // index of prev sequence
88 long long afterIdx; // index of after sequence
89 edit_t type; // type of edit(Add, Delete, Common)
90 bool operator==(const eleminfo& other) const{
91 return (this->beforeIdx == other.beforeIdx && this->afterIdx == other.afterIdx && this->type == other.type);
92 }
94
95 const long long DTL_SEPARATE_SIZE = 3;
96 const long long DTL_CONTEXT_SIZE = 3;
97
101 typedef struct Point {
102 long long x; // x cordinate
103 long long y; // y cordinate
104 long long k; // vertex
105 } P;
106
110 const unsigned long long MAX_CORDINATES_SIZE = 2000000;
111
112 typedef vector< long long > editPath;
113 typedef vector< P > editPathCordinates;
114
118 template <typename sesElem>
119 struct uniHunk {
120 long long a, b, c, d; // @@ -a,b +c,d @@
121 vector< sesElem > common[2]; // anteroposterior commons on changes
122 vector< sesElem > change; // changes
123 long long inc_dec_count; // count of increace and decrease
124 };
125
126#define dtl_typedefs(elem, sequence) \
127 typedef pair< elem, elemInfo > sesElem; \
128 typedef vector< sesElem > sesElemVec; \
129 typedef vector< uniHunk< sesElem > > uniHunkVec; \
130 typedef list< elem > elemList; \
131 typedef vector< elem > elemVec; \
132 typedef typename uniHunkVec::iterator uniHunkVec_iter; \
133 typedef typename sesElemVec::iterator sesElemVec_iter; \
134 typedef typename elemList::iterator elemList_iter; \
135 typedef typename sequence::iterator sequence_iter; \
136 typedef typename sequence::const_iterator sequence_const_iter; \
137 typedef typename elemVec::iterator elemVec_iter;
138
139
140}
141
142#endif // DTL_VARIABLES_H
Definition: Diff.hpp:41
const string version
Definition: variables.hpp:66
struct dtl::eleminfo elemInfo
int edit_t
Definition: variables.hpp:71
struct dtl::Point P
const edit_t SES_ADD
Definition: variables.hpp:74
const long long DTL_CONTEXT_SIZE
Definition: variables.hpp:96
const unsigned long long MAX_CORDINATES_SIZE
Definition: variables.hpp:110
const long long DTL_SEPARATE_SIZE
Definition: variables.hpp:95
const edit_t SES_COMMON
Definition: variables.hpp:73
const edit_t SES_DELETE
Definition: variables.hpp:72
vector< long long > editPath
Definition: variables.hpp:112
vector< P > editPathCordinates
Definition: variables.hpp:113
#define max(a, b)
Definition: resampler.cpp:30
long long x
Definition: variables.hpp:102
long long k
Definition: variables.hpp:104
long long y
Definition: variables.hpp:103
long long afterIdx
Definition: variables.hpp:88
long long beforeIdx
Definition: variables.hpp:87
bool operator==(const eleminfo &other) const
Definition: variables.hpp:90
vector< sesElem > change
Definition: variables.hpp:122
long long b
Definition: variables.hpp:120
long long d
Definition: variables.hpp:120
long long inc_dec_count
Definition: variables.hpp:123
long long c
Definition: variables.hpp:120
long long a
Definition: variables.hpp:120
vector< sesElem > common[2]
Definition: variables.hpp:121