COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
Ft.h
Go to the documentation of this file.
1#ifndef FT_H
2#define FT_H
3
4#include <iostream>
5#include <math.h>
6#include <set>
7#include <limits>
8#include "../../trunk/CombBLAS/CombBLAS.h"
9
10#define PERIOD (3600 * 24)
11
12using namespace std;
13
14struct Ft {
15 //Customize this.
16 double cost;
17
18 Ft() {
19 }
20
21 Ft(int n) {
22 }
23
24 Ft& operator=(const Ft& _ft) {
25 if (this != &_ft)
26 cost = _ft.cost;
27 return *this;
28 }
29
30 double arrivalTime(double t) const {
31 // return t + (2 - 4 * (pow(((t - PERIOD * (int) (t / PERIOD)) / PERIOD - 0.5), 2))) * cost;
32 return 2 * t;
33 }
34};
35
36// hack not needed
37bool operator< (const Ft &ft1, const Ft &ft2) {
38 return true;
39}
40
41template <typename c, typename t>
42inline std::basic_istream<c,t>& operator<<(std::basic_istream<c,t>& lhs, const Ft& rhs) {
43 lhs << rhs.cost;
44 return lhs;
45}
46
47template <typename c, typename t>
48inline std::basic_istream<c,t>& operator>>(std::basic_istream<c,t>& lhs, Ft& rhs) {
49 // Customize this.
50 lhs >> rhs.cost;
51 return lhs;
52}
53
54MPI::Datatype Ft_MPI_datatype;
55template<> MPI::Datatype MPIType< Ft >( void ) {
56 return Ft_MPI_datatype;
57}
58
59#endif
MPI::Datatype MPIType< Ft >(void)
Definition Ft.h:55
std::basic_istream< c, t > & operator<<(std::basic_istream< c, t > &lhs, const Ft &rhs)
Definition Ft.h:42
MPI::Datatype Ft_MPI_datatype
Definition Ft.h:54
bool operator<(const Ft &ft1, const Ft &ft2)
Definition Ft.h:37
std::basic_istream< c, t > & operator>>(std::basic_istream< c, t > &lhs, Ft &rhs)
Definition Ft.h:48
Definition Ft.h:14
Ft & operator=(const Ft &_ft)
Definition Ft.h:24
double arrivalTime(double t) const
Definition Ft.h:30
double cost
Definition Ft.h:16
Ft(int n)
Definition Ft.h:21
Ft()
Definition Ft.h:18