Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
min.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * thrill/api/min.hpp
3  *
4  * Part of Project Thrill - http://project-thrill.org
5  *
6  * Copyright (C) 2016 Timo Bingmann <[email protected]>
7  *
8  * All rights reserved. Published under the BSD-2 license in the LICENSE file.
9  ******************************************************************************/
10 
11 #pragma once
12 #ifndef THRILL_API_MIN_HEADER
13 #define THRILL_API_MIN_HEADER
14 
17 
18 namespace thrill {
19 namespace api {
20 
21 template <typename ValueType, typename Stack>
22 ValueType DIA<ValueType, Stack>::Min(const ValueType& initial_value) const {
23  assert(IsValid());
24 
26  auto node = tlx::make_counting<MinNode>(*this, "Min", initial_value);
27  node->RunScope();
28  return node->result();
29 }
30 
31 template <typename ValueType, typename Stack>
33  const ValueType& initial_value) const {
34  assert(IsValid());
35 
37  auto node = tlx::make_counting<MinNode>(*this, "Min", initial_value);
38  return Future<ValueType>(node);
39 }
40 
41 } // namespace api
42 } // namespace thrill
43 
44 #endif // !THRILL_API_MIN_HEADER
45 
46 /******************************************************************************/
ValueType_ ValueType
Definition: dia.hpp:152
The return type class for all ActionFutures.
Definition: action_node.hpp:83
ValueType Min(const ValueType &initial_value=ValueType()) const
Min is an Action, which computes the minimum of all elements globally.
Definition: min.hpp:22
Future< ValueType > MinFuture(const ValueType &initial_value=ValueType()) const
Min is an ActionFuture, which computes the minimum of all elements globally.
Definition: min.hpp:32