Reaktoro
A unified framework for modeling chemically reactive systems
Filter.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2018 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <list>
22 #include <vector>
23 
24 namespace Reaktoro {
25 
27 class Filter
28 {
29 public:
31  using Point = std::vector<double>;
32 
34  Filter();
35 
37  auto clear() -> void;
38 
41  auto acceptable(const Point& point) const -> bool;
42 
48  auto extend(const Point& point) -> void;
49 
52  static auto dominated(const Point& a, const Point& b) -> bool;
53 
54 private:
56  std::list<Point> filter;
57 };
58 
59 } // namespace Reaktoro
static auto dominated(const Point &a, const Point &b) -> bool
Check if a point is dominated by another.
Definition: Filter.cpp:62
auto extend(const Point &point) -> void
Extend the filter with a new point.
Definition: Filter.cpp:43
auto acceptable(const Point &point) const -> bool
Check if a given point is acceptable to the filter.
Definition: Filter.cpp:36
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
Filter()
Construc a default Filter instance.
Definition: Filter.cpp:28
A type that describes an optimisation filter.
Definition: Filter.hpp:28
std::vector< double > Point
A type that describes an entry point of an optimisation filter.
Definition: Filter.hpp:31
auto clear() -> void
Clear the filter by removing all its points.
Definition: Filter.cpp:31