-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPiece.h
56 lines (41 loc) · 1.55 KB
/
Piece.h
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
#ifndef PIECE_H
#define PIECE_H
#include "Edge.h"
#include "Data.h"
#include "Track.h"
#include "Interval.h"
#include "Cost.h"
#include <math.h>
#include<vector>
#include<string>
#include <fstream> ///write in a file
class Piece
{
public:
Track m_info;
Interval m_interval;
Cost m_cost;
Piece *nxt; /// pointer to next piece
Piece();
Piece(Track const& info, Interval const& inter = Interval(), Cost const& cost = Cost());
Piece(const Piece* piece); ///COPY CONSTRUCTOR => copy only the first Piece. piece -> nxt = NULL
~Piece();
Piece* copy();
void addCostAndPenalty(Cost const& cost, double penalty);
///
///
Interval intervalMinLessUp(double bound, double currentValue, bool constPiece);
Interval intervalMinLessDw(double bound, double currentValue, bool constPiece);
Piece* pastePieceUp(const Piece* NXTPiece, Interval const& decrInter, Track const& newTrack);
Piece* pastePieceDw(const Piece* NXTPiece, Interval const& decrInter, Track const& newTrack);
Piece* pieceGenerator(Piece* Q1, Piece* Q2, int Bound_Q2_Minus_Q1, double M);
Piece* piece0(Piece* Q1, Piece* Q2, Interval interToPaste, int& Q2_Minus_Q1);
Piece* piece1(Piece* Q1, Piece* Q2, Interval interToPaste, Interval interRoots, int& Q2_Minus_Q1);
Piece* piece2(Piece* Q1, Piece* Q2, Interval interToPaste, Interval interRoots, int& Q2_Minus_Q1);
void get_min_argmin_label_state_position(double* response);
///
///
void show();
};
std::ostream &operator>>(std::ostream &flux, Piece* piece);
#endif // PIECE_H