codac 1.5.6
Loading...
Searching...
No Matches
codac2_SepProj.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <vector>
13#include "codac2_Sep.h"
14#include "codac2_Collection.h"
16#include "codac2_ProjBase.h"
17
18namespace codac2
19{
20 class SepProj : public Sep<SepProj>, protected ProjBase
21 {
22 public:
23
24 template<typename S>
25 requires IsSepBaseOrPtr<S>
26 SepProj(const S& s, const std::vector<Index>& proj_indices, double default_eps = 0.01)
27 : SepProj(s, proj_indices, IntervalVector(size_of(s)-proj_indices.size()), default_eps)
28 { }
29
30 template<typename S>
31 requires IsSepBaseOrPtr<S>
32 SepProj(const S& s, const std::vector<Index>& proj_indices, const IntervalVector& y, double default_eps = 0.01)
33 : Sep<SepProj>(proj_indices.size()), ProjBase(proj_indices,y,default_eps), _sep(s)
34 {
35 assert_release(_y.size() == size_of(s)-(Index)_xi.size());
36 assert_release(*min_element(_xi.begin(),_xi.end()) >= 0);
37 assert_release(*max_element(_xi.begin(),_xi.end()) < size_of(s));
38 assert_release(size_of(s) >= (Index)_xi.size() && "cannot compute a projection of a set into a superset");
39 assert_release(y.is_bisectable());
40 assert_release(default_eps > 0.);
41 }
42
43 BoxPair separate(const IntervalVector& x) const;
44 BoxPair separate(const IntervalVector& x, double eps) const;
45
46 protected:
47
48 const Collection<SepBase> _sep;
49 };
50}