-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnet.h
41 lines (31 loc) · 1022 Bytes
/
net.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
#ifndef NET_H
#define NET_H
#include <iostream>
#include <vector>
#include <cassert>
#include <string>
#include "common.h"
struct pin
{
point position;
int index; // index of the corresponding rectangle, -1 if fixed pin
/**
* Returns the position of the pin in the given dimension. This is always the postion relative to the unmodified
* rectangle. To obtain the relative or absolute position of the pin respecting rotation and flipping of the
* rectangle, use the functions in the rectangle class.
* @param dim The dimension which is queried.
* @return The position in the specified dimension.
*/
pos get_pos(dimension dim) const;
};
struct net
{
weight net_weight;
std::vector<pin> pin_list;
size_t index;
};
std::istream &operator>> (std::istream &in, pin &p);
std::ostream &operator<< (std::ostream &out, const pin &p);
std::istream &operator>> (std::istream &in, net &n);
std::ostream &operator<< (std::ostream &out, const net &n);
#endif // NET_H