1 #ifndef MULTIINDEXLIMITER_H_
2 #define MULTIINDEXLIMITER_H_
23 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const = 0;
39 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override {
return (multi->Sum() <=
totalOrder);};
61 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override;
87 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override;
137 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override;
157 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override {
return true;};
169 AndLimiter(std::shared_ptr<MultiIndexLimiter> limitA, std::shared_ptr<MultiIndexLimiter> limitB) :
a(limitA),
b(limitB){};
171 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override {
return (
a->IsFeasible(multi)&&
b->IsFeasible(multi));};
175 std::shared_ptr<MultiIndexLimiter>
a,
b;
187 OrLimiter(std::shared_ptr<MultiIndexLimiter> limitA, std::shared_ptr<MultiIndexLimiter> limitB) :
a(limitA),
b(limitB){};
189 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override {
return (
a->IsFeasible(multi)||
b->IsFeasible(multi));};
193 std::shared_ptr<MultiIndexLimiter>
a,
b;
206 XorLimiter(std::shared_ptr<MultiIndexLimiter> limitA, std::shared_ptr<MultiIndexLimiter> limitB) :
a(limitA),
b(limitB){};
208 virtual bool IsFeasible(std::shared_ptr<MultiIndex> multi)
const override {
return (
a->IsFeasible(multi)^
b->IsFeasible(multi));};
212 std::shared_ptr<MultiIndexLimiter>
a,
b;
Combines two limiters through an AND operation.
std::shared_ptr< MultiIndexLimiter > a
std::shared_ptr< MultiIndexLimiter > b
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
virtual ~AndLimiter()=default
AndLimiter(std::shared_ptr< MultiIndexLimiter > limitA, std::shared_ptr< MultiIndexLimiter > limitB)
Declares multiindices as feasible if their entries for less important dimensions are not too high.
const Eigen::RowVectorXf & weights
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
AnisotropicLimiter(const Eigen::RowVectorXf &weightsIn, const double epsilonIn)
Provides bounds on what dimensions are allowed to have nonzero values.
DimensionLimiter(unsigned int lowerDimIn, unsigned int lengthIn)
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
virtual ~DimensionLimiter()=default
Provides a cap on the maximum value of each component the multiindex.
virtual ~MaxOrderLimiter()=default
Eigen::VectorXi maxOrders
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
MaxOrderLimiter(Eigen::VectorXi const &maxOrdersIn)
MaxOrderLimiter(unsigned int maxOrderIn)
An abstract base class for multi index limiters.
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const =0
virtual ~MultiIndexLimiter()=default
Returns true for an multiindex.
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
virtual ~NoLimiter()=default
Combines two limiters through an OR operation.
OrLimiter(std::shared_ptr< MultiIndexLimiter > limitA, std::shared_ptr< MultiIndexLimiter > limitB)
virtual ~OrLimiter()=default
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
std::shared_ptr< MultiIndexLimiter > a
std::shared_ptr< MultiIndexLimiter > b
Provides a cap on the total-order allowed.
virtual ~TotalOrderLimiter()=default
TotalOrderLimiter(unsigned int totalOrderIn)
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
Combines two limiters through an XOR operation.
XorLimiter(std::shared_ptr< MultiIndexLimiter > limitA, std::shared_ptr< MultiIndexLimiter > limitB)
virtual bool IsFeasible(std::shared_ptr< MultiIndex > multi) const override
std::shared_ptr< MultiIndexLimiter > a
virtual ~XorLimiter()=default
std::shared_ptr< MultiIndexLimiter > b