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-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program 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
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. 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
Filter()
Construc a default Filter instance.
Definition: Filter.cpp:28
std::vector< double > Point
A type that describes an entry point of an optimisation filter.
Definition: Filter.hpp:31
auto acceptable(const Point &point) const -> bool
Check if a given point is acceptable to the filter.
Definition: Filter.cpp:36
auto clear() -> void
Clear the filter by removing all its points.
Definition: Filter.cpp:31
A type that describes an optimisation filter.
Definition: Filter.hpp:27
auto extend(const Point &point) -> void
Extend the filter with a new point.
Definition: Filter.cpp:43
static auto dominated(const Point &a, const Point &b) -> bool
Check if a point is dominated by another.
Definition: Filter.cpp:62
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24