Skip to content

Commit

Permalink
Correct include directive for ValuableDescendantContract.h in DuoValD…
Browse files Browse the repository at this point in the history
…escendant.h
  • Loading branch information
devin-ai-integration[bot] authored and ohhmm committed Sep 17, 2024
1 parent a315b64 commit de55ef2
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions omnn/math/DuoValDescendant.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: sergejkrivonos
*/
#pragma once
#include <omnn/math/ValuableDescendantContract.h>
#include "ValuableDescendantContract.h"
#include <utility>

namespace omnn::math {
Expand Down Expand Up @@ -78,7 +78,7 @@ namespace omnn::math {
Valuable::hash ^= _1.Hash();
Valuable::optimized = {};
}

const Valuable& get2() const { return _2; }
template<class T>
void set2(T&& p) {
Expand All @@ -99,13 +99,13 @@ namespace omnn::math {
Valuable::hash ^= _2.Hash();
Valuable::optimized = {};
}

using base::base;

template <class T1, class T2>
constexpr DuoValDescendant(T1&& v1, T2&& v2)
: _1(std::forward<T1>(v1))
, _2(std::forward<T2>(v2))
template <class T1, class T2>
constexpr DuoValDescendant(T1&& v1, T2&& v2)
: _1(std::forward<T1>(v1))
, _2(std::forward<T2>(v2))
{
Valuable::hash = _1.Hash() ^ _2.Hash();
Valuable::maxVaExp = Chld::getMaxVaExp(_1, _2);
Expand Down Expand Up @@ -165,16 +165,16 @@ namespace omnn::math {
max_exp_t getMaxVaExp() const override {
return Chld::getMaxVaExp(_1, _2);
}

bool IsSimple() const override {
return IsMultival() == Valuable::YesNoMaybe::No
&& _1.IsSimple() && _2.IsSimple();
}

Valuable::YesNoMaybe IsMultival() const override {
return _1.IsMultival() || _2.IsMultival();
}

void Values(const std::function<bool(const Valuable&)>& f) const override
{
if (f) {
Expand All @@ -184,14 +184,14 @@ namespace omnn::math {
}

// TODO: multival caching (inspect all optimized and optimization transisions)


Valuable::solutions_t vals, thisValues;
_1.Values([&](auto& thisVal){
thisValues.insert(thisVal);
return true;
});

_2.Values([&](auto&vVal){
for(auto& tv:thisValues){
Valuable v = Chld{tv,vVal};
Expand All @@ -200,17 +200,17 @@ namespace omnn::math {
}
return true;
});

for(auto& v:vals)
f(v);
}
}

a_int Complexity() const override {
return _1.Complexity() + _2.Complexity();
}


Valuable::solutions_t Distinct() const override {
Valuable::solutions_t branches;
for (auto&& f : _1.Distinct()) {
Expand All @@ -222,4 +222,3 @@ namespace omnn::math {
}
};
}

0 comments on commit de55ef2

Please sign in to comment.