16 ConfiguredFrequencySet::ConfiguredFrequencySet (
const Context& context,
NodeRefVec&& deps, std::unique_ptr<FrequencySetInterface>&& freqset)
18 , freqset_(std::move(freqset))
22 const auto& param = std::dynamic_pointer_cast<ConfiguredParameter>(dep);
41 const auto* derived =
dynamic_cast<const Self*
>(&other);
42 if (derived ==
nullptr)
49 const auto& otherFS = *derived->freqset_;
50 return typeid (thisFS) ==
typeid (otherFS);
57 return typeid (bppFS).hash_code ();
63 auto m = ConfiguredParametrizable::createConfigured<Target, Self>(c, std::move (deps), std::unique_ptr<Target>{
dynamic_cast<Target*
>(
freqset_->clone ())});
72 :
Value<
Eigen::RowVectorXd>(std::move (deps)), targetDimension_ (dim) {}
76 using namespace numeric;
83 return dynamic_cast<const Self*
>(&other) !=
nullptr;
91 auto buildFWithNewFreqSet = [
this, &c](
NodeRef&& newFreqSet) {
92 return ConfiguredParametrizable::createRowVector<ConfiguredFrequencySet, Self>(c, {std::move (newFreqSet)},
targetDimension_);
95 NodeRefVec derivativeSumDeps = ConfiguredParametrizable::generateDerivativeSumDepsForComputations<ConfiguredFrequencySet, T >(
102 return ConfiguredParametrizable::createRowVector<ConfiguredFrequencySet, Self>(c, std::move (deps),
targetDimension_);
107 const auto* freqset = accessValueConstCast<const FrequencySetInterface*>(*this->
dependency (0));
108 const auto& freqsFromFS = freqset->getFrequencies ();
110 r = Eigen::Map<const T>(freqsFromFS.data(),
static_cast<Eigen::Index
>(freqsFromFS.size ()));
virtual void shareParameter_(const std::shared_ptr< Parameter > ¶meter)
Context for dataflow node construction.
void compute() final
Computation implementation.
Dimension< T > targetDimension_
FrequenciesFromFrequencySet(NodeRefVec &&deps, const Dimension< T > &dim)
std::string debugInfo() const final
Node debug info (default = ""): user defined detailed info for DF graph debug.
bool compareAdditionalArguments(const Node_DF &other) const final
Compare node-specific configuration to another.
NodeRef derive(Context &c, const Node_DF &node) final
Returns a node computing d(this_node_expression)/d(node_expression).
NodeRef recreate(Context &c, NodeRefVec &&deps) final
Recreate the node with different dependencies.
Parametrize a set of state frequencies.
Base dataflow Node class.
const NodeRef & dependency(std::size_t i) const noexcept
const NodeRefVec & dependencies() const noexcept
Abstract Node storing a value of type T.
const Eigen::RowVectorXd & accessValueConst() const noexcept
Raw value access (const).
Eigen::RowVectorXd & accessValueMutable() noexcept
std::string debug(const T &t, typename std::enable_if< std::is_arithmetic< T >::value >::type *=0)
Defines the basic types of data flow nodes.
std::string to_string(const NoDimension &)
std::vector< NodeRef > NodeRefVec
Alias for a dependency vector (of NodeRef).
std::shared_ptr< Node_DF > NodeRef
Store a dimension for type T.