16 ConfiguredSimplex::ConfiguredSimplex (
const Context& context,
NodeRefVec&& deps, std::unique_ptr<Simplex>&& simplex)
18 , simplex_(std::move(simplex))
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->simplex_;
50 return typeid (thisFS) ==
typeid (otherFS);
57 return typeid (bppFS).hash_code ();
62 auto m = ConfiguredParametrizable::createConfigured<Target, Self>(c, std::move (deps), std::unique_ptr<Target>(
dynamic_cast<Target*
>(
simplex_->clone ())));
73 :
Value<
Eigen::RowVectorXd>(std::move (deps)), targetDimension_ (dim) {}
77 using namespace numeric;
84 return dynamic_cast<const Self*
>(&other) !=
nullptr;
92 auto buildFWithNewSimplex = [
this, &c](
NodeRef&& newSimplex) {
93 return ConfiguredParametrizable::createRowVector<ConfiguredSimplex, Self>(c, {std::move (newSimplex)},
targetDimension_);
96 NodeRefVec derivativeSumDeps = ConfiguredParametrizable::generateDerivativeSumDepsForComputations<ConfiguredSimplex, T >(
104 return ConfiguredParametrizable::createRowVector<ConfiguredSimplex, Self>(c, std::move (deps),
targetDimension_);
109 const auto* simplex = accessValueConstCast<const Simplex*>(*this->
dependency (0));
110 const auto& freqsFromFS = simplex->getFrequencies ();
112 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.
NodeRef derive(Context &c, const Node_DF &node) final
Returns a node computing d(this_node_expression)/d(node_expression).
static std::shared_ptr< Self > create(Context &c, NodeRefVec &&deps)
void compute() final
Computation implementation.
FrequenciesFromSimplex(NodeRefVec &&deps, const Dimension< T > &dim)
bool compareAdditionalArguments(const Node_DF &other) const final
Compare node-specific configuration to another.
NodeRef recreate(Context &c, NodeRefVec &&deps) final
Recreate the node with different dependencies.
Dimension< T > targetDimension_
std::string debugInfo() const final
Node debug info (default = ""): user defined detailed info for DF graph debug.
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.