ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ShortestJobFirst.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*------------------------ File ShortestJobFirst.h -------------------------*/
3/*--------------------------------------------------------------------------*/
42/*--------------------------------------------------------------------------*/
43/*----------------------------- DEFINITIONS --------------------------------*/
44/*--------------------------------------------------------------------------*/
45
46#ifndef __ADS_ShortestJobFirst
47 #define __ADS_ShortestJobFirst
48/* self-identification: #endif constant */
49
50/*--------------------------------------------------------------------------*/
51/*------------------------------ INCLUDES ----------------------------------*/
52/*--------------------------------------------------------------------------*/
53
54#include "ADS/Contract.h"
55
56#include <algorithm>
57#include <cstddef>
58#include <numeric>
59#include <vector>
60
61/*--------------------------------------------------------------------------*/
62/*--------------------------- NAMESPACE ------------------------------------*/
63/*--------------------------------------------------------------------------*/
64
65namespace ADS
66{
67
82template< class T >
83std::vector< std::size_t > shortestJobFirst( const std::vector< T > & t );
84
88template< class T >
89T totalCompletion( const std::vector< T > & t ,
90 const std::vector< std::size_t > & A );
91
107template< class T , class W >
108std::vector< std::size_t > smithOrder( const std::vector< T > & t ,
109 const std::vector< W > & w );
110
114template< class T , class W >
115auto weightedCompletion( const std::vector< T > & t ,
116 const std::vector< W > & w ,
117 const std::vector< std::size_t > & A );
118
119/*--------------------------------------------------------------------------*/
120
121} // end( namespace ADS )
122
123/*--------------------------------------------------------------------------*/
124/*-------------------------- IMPLEMENTATION --------------------------------*/
125/*--------------------------------------------------------------------------*/
126
127#include "ADS/optimization/impl/ShortestJobFirst.tpp"
128
129/*--------------------------------------------------------------------------*/
130
131#endif /* ShortestJobFirst.h included */
132
133/*--------------------------------------------------------------------------*/
134/*---------------------- End File ShortestJobFirst.h -----------------------*/
135/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
T totalCompletion(const std::vector< T > &t, const std::vector< std::size_t > &A)
the sum of the times of completion of the programs in the order ,
std::vector< std::size_t > shortestJobFirst(const std::vector< T > &t)
the order of the programs, by increasing duration
std::vector< std::size_t > smithOrder(const std::vector< T > &t, const std::vector< W > &w)
the order of the programs of times and weights of least weighted sum of the times of completion,...
auto weightedCompletion(const std::vector< T > &t, const std::vector< W > &w, const std::vector< std::size_t > &A)
the sum of in the order , the time of completion of
Definition ADT.h:96