581 lines
88 KiB
XML
581 lines
88 KiB
XML
|
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||
|
|
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.13.2" xml:lang="en-US">
|
||
|
|
<compounddef id="eos_2runtime_2details_8hpp" kind="file" language="C++">
|
||
|
|
<compoundname>details.hpp</compoundname>
|
||
|
|
<includes local="no">array</includes>
|
||
|
|
<includes local="no">type_traits</includes>
|
||
|
|
<includes local="no">tuple</includes>
|
||
|
|
<includes local="no">expected</includes>
|
||
|
|
<includes refid="dimensions_2runtime_2concepts_8hpp" local="yes">serif/dimensions/runtime/concepts.hpp</includes>
|
||
|
|
<includes refid="eos_2exceptions_8hpp" local="yes">serif/eos/exceptions.hpp</includes>
|
||
|
|
<includes refid="eos_2evaluation_8hpp" local="yes">serif/eos/evaluation.hpp</includes>
|
||
|
|
<includes refid="catalog_8hpp" local="yes">serif/eos/relations/catalog.hpp</includes>
|
||
|
|
<includes refid="codes_8hpp" local="yes">serif/utils/error/codes.hpp</includes>
|
||
|
|
<includedby refid="details_8cpp" local="yes">src/compile_time_checks/serif/eos/runtime/details.cpp</includedby>
|
||
|
|
<includedby refid="eos_2runtime_2concepts_8hpp" local="yes">src/include/serif/eos/runtime/concepts.hpp</includedby>
|
||
|
|
<incdepgraph>
|
||
|
|
<node id="31">
|
||
|
|
<label>serif/dimensions/dimensions.hpp</label>
|
||
|
|
<link refid="dimensions_8hpp"/>
|
||
|
|
<childnode refid="7" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="8" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="22">
|
||
|
|
<label>serif/dimensions/partial.hpp</label>
|
||
|
|
<link refid="partial_8hpp"/>
|
||
|
|
<childnode refid="8" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="12" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="8">
|
||
|
|
<label>serif/dimensions/quantities.hpp</label>
|
||
|
|
<link refid="quantities_8hpp"/>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="9" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="10" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="4" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="11" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="12" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="6">
|
||
|
|
<label>serif/dimensions/runtime/concepts.hpp</label>
|
||
|
|
<link refid="dimensions_2runtime_2concepts_8hpp"/>
|
||
|
|
<childnode refid="7" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="8" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="13" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="13">
|
||
|
|
<label>serif/dimensions/runtime/runtime.hpp</label>
|
||
|
|
<link refid="dimensions_2runtime_2runtime_8hpp"/>
|
||
|
|
<childnode refid="7" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="14" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="15" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="19">
|
||
|
|
<label>serif/eos/evaluation.hpp</label>
|
||
|
|
<link refid="eos_2evaluation_8hpp"/>
|
||
|
|
<childnode refid="20" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="16">
|
||
|
|
<label>serif/eos/exceptions.hpp</label>
|
||
|
|
<link refid="eos_2exceptions_8hpp"/>
|
||
|
|
<childnode refid="15" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="17" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="18" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="20">
|
||
|
|
<label>serif/eos/models/concepts.hpp</label>
|
||
|
|
<link refid="eos_2models_2concepts_8hpp"/>
|
||
|
|
<childnode refid="21" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="30" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="21">
|
||
|
|
<label>serif/eos/models/traits.hpp</label>
|
||
|
|
<link refid="eos_2models_2traits_8hpp"/>
|
||
|
|
<childnode refid="8" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="22" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="23" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="25">
|
||
|
|
<label>serif/eos/relations/catalog.hpp</label>
|
||
|
|
<link refid="catalog_8hpp"/>
|
||
|
|
<childnode refid="26" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="28" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="8" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="23">
|
||
|
|
<label>serif/eos/relations/concepts.hpp</label>
|
||
|
|
<link refid="eos_2relations_2concepts_8hpp"/>
|
||
|
|
<childnode refid="24" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="30">
|
||
|
|
<label>serif/eos/relations/relations.hpp</label>
|
||
|
|
<link refid="eos_2relations_2relations_8hpp"/>
|
||
|
|
<childnode refid="25" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="31" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="24">
|
||
|
|
<label>serif/eos/relations/traits.hpp</label>
|
||
|
|
<link refid="eos_2relations_2traits_8hpp"/>
|
||
|
|
<childnode refid="25" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="1">
|
||
|
|
<label>src/include/serif/eos/runtime/details.hpp</label>
|
||
|
|
<link refid="eos_2runtime_2details_8hpp"/>
|
||
|
|
<childnode refid="2" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="4" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="5" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="6" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="16" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="19" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="25" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="32" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="33">
|
||
|
|
<label>serif/meta/enums.hpp</label>
|
||
|
|
<link refid="enums_8hpp"/>
|
||
|
|
<childnode refid="34" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="35" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="32">
|
||
|
|
<label>serif/utils/error/codes.hpp</label>
|
||
|
|
<link refid="codes_8hpp"/>
|
||
|
|
<childnode refid="15" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="33" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="12">
|
||
|
|
<label>serif/utils/misc/concepts/numeric.hpp</label>
|
||
|
|
<link refid="numeric_8hpp"/>
|
||
|
|
<childnode refid="10" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="26">
|
||
|
|
<label>serif/utils/misc/concepts/type_uniqueness.hpp</label>
|
||
|
|
<link refid="concepts_2type__uniqueness_8hpp"/>
|
||
|
|
<childnode refid="27" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="11">
|
||
|
|
<label>serif/utils/misc/std_helper/cleaning.hpp</label>
|
||
|
|
<link refid="cleaning_8hpp"/>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="28">
|
||
|
|
<label>serif/utils/misc/std_helper/variadic_cleaning.hpp</label>
|
||
|
|
<link refid="variadic__cleaning_8hpp"/>
|
||
|
|
<childnode refid="29" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="27">
|
||
|
|
<label>serif/utils/misc/traits/type_uniqueness.hpp</label>
|
||
|
|
<link refid="traits_2type__uniqueness_8hpp"/>
|
||
|
|
<childnode refid="11" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="2">
|
||
|
|
<label>array</label>
|
||
|
|
</node>
|
||
|
|
<node id="9">
|
||
|
|
<label>compare</label>
|
||
|
|
</node>
|
||
|
|
<node id="10">
|
||
|
|
<label>concepts</label>
|
||
|
|
</node>
|
||
|
|
<node id="29">
|
||
|
|
<label>cstddef</label>
|
||
|
|
</node>
|
||
|
|
<node id="15">
|
||
|
|
<label>cstdint</label>
|
||
|
|
</node>
|
||
|
|
<node id="5">
|
||
|
|
<label>expected</label>
|
||
|
|
</node>
|
||
|
|
<node id="35">
|
||
|
|
<label>magic_enum/magic_enum_all.hpp</label>
|
||
|
|
</node>
|
||
|
|
<node id="14">
|
||
|
|
<label>span</label>
|
||
|
|
</node>
|
||
|
|
<node id="17">
|
||
|
|
<label>stdexcept</label>
|
||
|
|
</node>
|
||
|
|
<node id="18">
|
||
|
|
<label>string</label>
|
||
|
|
</node>
|
||
|
|
<node id="7">
|
||
|
|
<label>string_view</label>
|
||
|
|
</node>
|
||
|
|
<node id="4">
|
||
|
|
<label>tuple</label>
|
||
|
|
</node>
|
||
|
|
<node id="3">
|
||
|
|
<label>type_traits</label>
|
||
|
|
</node>
|
||
|
|
<node id="34">
|
||
|
|
<label>unordered_map</label>
|
||
|
|
</node>
|
||
|
|
</incdepgraph>
|
||
|
|
<invincdepgraph>
|
||
|
|
<node id="2">
|
||
|
|
<label>src/compile_time_checks/serif/eos/runtime/details.cpp</label>
|
||
|
|
<link refid="details_8cpp"/>
|
||
|
|
</node>
|
||
|
|
<node id="5">
|
||
|
|
<label>src/compile_time_checks/serif/eos/runtime/views.cpp</label>
|
||
|
|
<link refid="views_8cpp"/>
|
||
|
|
</node>
|
||
|
|
<node id="3">
|
||
|
|
<label>src/include/serif/eos/runtime/concepts.hpp</label>
|
||
|
|
<link refid="eos_2runtime_2concepts_8hpp"/>
|
||
|
|
<childnode refid="4" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="1">
|
||
|
|
<label>src/include/serif/eos/runtime/details.hpp</label>
|
||
|
|
<link refid="eos_2runtime_2details_8hpp"/>
|
||
|
|
<childnode refid="2" relation="include">
|
||
|
|
</childnode>
|
||
|
|
<childnode refid="3" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
<node id="4">
|
||
|
|
<label>src/include/serif/eos/runtime/views.hpp</label>
|
||
|
|
<link refid="views_8hpp"/>
|
||
|
|
<childnode refid="5" relation="include">
|
||
|
|
</childnode>
|
||
|
|
</node>
|
||
|
|
</invincdepgraph>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers" prot="public">serif::eos::runtime::HasRuntimeQuantityIdentifiers</innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers_3_01relations_1_1_relation_3_cccf8857ab0156cf2afc2677bc16446c" prot="public">serif::eos::runtime::HasRuntimeQuantityIdentifiers< relations::Relation< OutputT, InputTs... > ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities_3_01relations_1_1_relation_3_01_ou3e28a4892e3a6a07a1f901a4b02b1a2d" prot="public">serif::eos::runtime::RuntimeRelationQuantities< relations::Relation< OutputT, InputTs... > ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported" prot="public">serif::eos::runtime::RuntimeRelationsAreSupported</innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported_3_01true_00_01_relation_ts_8_8_8_01_4" prot="public">serif::eos::runtime::RuntimeRelationsAreSupported< true, RelationTs... ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported" prot="public">serif::eos::runtime::RuntimeCatalogIsSupported</innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported_3_01relations_1_1_relation_cataloe1dd4e8866d49db6ba530e370961bebe" prot="public">serif::eos::runtime::RuntimeCatalogIsSupported< relations::RelationCatalog< RelationTs... > ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533" prot="public">serif::eos::runtime::RuntimeRelationStorage< EOS, relations::Relation< OutputT, InputTs... > ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage_3_01_e_o_s_00_01relations_1_1_relation983e333b4bd596c3958f49a1bba13994" prot="public">serif::eos::runtime::RuntimeCatalogStorage< EOS, relations::RelationCatalog< RelationTs... > ></innerclass>
|
||
|
|
<innerclass refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_dispatch_3_01_e_o_s_00_01relations_1_1_relatio0166b9bbd8882975b3d1325bcdcd27cb" prot="public">serif::eos::runtime::RuntimeCatalogDispatch< EOS, relations::RelationCatalog< RelationTs... > ></innerclass>
|
||
|
|
<innernamespace refid="namespaceserif">serif</innernamespace>
|
||
|
|
<innernamespace refid="namespaceserif_1_1eos">serif::eos</innernamespace>
|
||
|
|
<innernamespace refid="namespaceserif_1_1eos_1_1runtime">serif::eos::runtime</innernamespace>
|
||
|
|
<briefdescription>
|
||
|
|
<para>File containing implementation details for the eos runtime module. These details are used internally by the runtime system and are not intended to be used directly by users. </para>
|
||
|
|
</briefdescription>
|
||
|
|
<detaileddescription>
|
||
|
|
<para><simplesect kind="author"><para>Emily M. Boudreaux </para>
|
||
|
|
</simplesect>
|
||
|
|
</para>
|
||
|
|
</detaileddescription>
|
||
|
|
<programlisting>
|
||
|
|
<codeline lineno="1"><highlight class="preprocessor">#pragma<sp/>once</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="2"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><array></highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><type_traits></highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><tuple></highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><expected></highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="dimensions_2runtime_2concepts_8hpp" kindref="compound">serif/dimensions/runtime/concepts.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="eos_2exceptions_8hpp" kindref="compound">serif/eos/exceptions.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="eos_2evaluation_8hpp" kindref="compound">serif/eos/evaluation.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="catalog_8hpp" kindref="compound">serif/eos/relations/catalog.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="codes_8hpp" kindref="compound">serif/utils/error/codes.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceserif_1_1eos_1_1runtime" kindref="compound">serif::eos::runtime</ref><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>RelationT></highlight></codeline>
|
||
|
|
<codeline lineno="27" refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers" kindref="compound">HasRuntimeQuantityIdentifiers</ref><sp/>:<sp/>std::false_type<sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="28"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="35" refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers_3_01relations_1_1_relation_3_cccf8857ab0156cf2afc2677bc16446c" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_has_runtime_quantity_identifiers" kindref="compound">HasRuntimeQuantityIdentifiers</ref><<ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::Relation<OutputT,<sp/>InputTs...>></highlight></codeline>
|
||
|
|
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>std::bool_constant<</highlight></codeline>
|
||
|
|
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity<OutputT><sp/>&&</highlight></codeline>
|
||
|
|
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(dimensions::runtime::RuntimeIdentifiedThermodynamicQuantity<InputTs><sp/>&&<sp/>...)><sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>RelationT></highlight></codeline>
|
||
|
|
<codeline lineno="45" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities" kindref="compound">RuntimeRelationQuantities</ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="53" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities_3_01relations_1_1_relation_3_01_ou3e28a4892e3a6a07a1f901a4b02b1a2d" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities" kindref="compound">RuntimeRelationQuantities</ref><<ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::Relation<OutputT,<sp/>InputTs...>><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities_3_01relations_1_1_relation_3_01_ou3e28a4892e3a6a07a1f901a4b02b1a2d_1abc10d86dcb3d36583a2e06aa22e5e2ce" kindref="member">Type</ref><sp/>=<sp/>std::tuple<OutputT,<sp/>InputTs...>;</highlight></codeline>
|
||
|
|
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="56"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/></highlight><highlight class="normal"><ref refid="namespaceserif_1_1eos_1_1runtime_1a401a6ebdc70fa8ebcaa52ae6d85088c3" kindref="member">RuntimeCatalogQuantityTuple</ref><sp/>=<sp/></highlight><highlight class="keyword">decltype</highlight><highlight class="normal">(std::tuple_cat(std::declval<</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_quantities" kindref="compound">RuntimeRelationQuantities<RelationTs>::Type</ref>>()...));</highlight></codeline>
|
||
|
|
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>FirstQuantityT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>SecondQuantityT></highlight></codeline>
|
||
|
|
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">consteval</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1ad0ac24809585cfe3727b7c54825ee888" kindref="member">runtimeQuantityIdentifiersAreCompatible</ref>()<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/>(std::same_as<FirstQuantityT,<sp/>SecondQuantityT>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1dimensions_1_1runtime_1ad1eac97b6b9f34f3be395e42d7edc4ba" kindref="member">dimensions::runtime::thermodynamicQuantityID<FirstQuantityT></ref><sp/>!=</highlight></codeline>
|
||
|
|
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1dimensions_1_1runtime_1ad1eac97b6b9f34f3be395e42d7edc4ba" kindref="member">dimensions::runtime::thermodynamicQuantityID<SecondQuantityT></ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>QuantityTupleT,<sp/>std::size_t<sp/>First,<sp/>std::size_t...<sp/>Offsets></highlight></codeline>
|
||
|
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">consteval</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1af820c5291bf57d6f96d7394880ae120d" kindref="member">runtimeQuantityIdentifierIsUnambiguous</ref>(std::index_sequence<Offsets...>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(</highlight></codeline>
|
||
|
|
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1ad0ac24809585cfe3727b7c54825ee888" kindref="member">runtimeQuantityIdentifiersAreCompatible</ref><</highlight></codeline>
|
||
|
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::tuple_element_t<First,<sp/>QuantityTupleT>,</highlight></codeline>
|
||
|
|
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::tuple_element_t<First<sp/>+<sp/>1<sp/>+<sp/>Offsets,<sp/>QuantityTupleT>>()<sp/>&&<sp/>...</highlight></codeline>
|
||
|
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
|
||
|
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>QuantityTupleT,<sp/>std::size_t...<sp/>Indices></highlight></codeline>
|
||
|
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">consteval</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a70b84b0bdf6dfd9a32811741eeb5904c" kindref="member">runtimeQuantityIdentifiersAreUnambiguous</ref>(std::index_sequence<Indices...>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(</highlight></codeline>
|
||
|
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1af820c5291bf57d6f96d7394880ae120d" kindref="member">runtimeQuantityIdentifierIsUnambiguous<QuantityTupleT, Indices></ref>(std::make_index_sequence<std::tuple_size_v<QuantityTupleT><sp/>-<sp/>Indices<sp/>-<sp/>1>{})<sp/>&&<sp/>...</highlight></codeline>
|
||
|
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
|
||
|
|
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>QuantitiesAreIdentified,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="114" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported" kindref="compound">RuntimeRelationsAreSupported</ref><sp/>:<sp/>std::false_type<sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="115"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="121" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported_3_01true_00_01_relation_ts_8_8_8_01_4" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported" kindref="compound">RuntimeRelationsAreSupported</ref><true,<sp/>RelationTs...><sp/>:</highlight></codeline>
|
||
|
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::bool_constant<runtimeQuantityIdentifiersAreUnambiguous<RuntimeCatalogQuantityTuple<RelationTs...>>(</highlight></codeline>
|
||
|
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::make_index_sequence<std::tuple_size_v<RuntimeCatalogQuantityTuple<RelationTs...>>>{}</highlight></codeline>
|
||
|
|
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)><sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="125"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>CatalogT></highlight></codeline>
|
||
|
|
<codeline lineno="131" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported" kindref="compound">RuntimeCatalogIsSupported</ref><sp/>:<sp/>std::false_type<sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="132"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="138" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported_3_01relations_1_1_relation_cataloe1dd4e8866d49db6ba530e370961bebe" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_is_supported" kindref="compound">RuntimeCatalogIsSupported</ref><<ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::RelationCatalog<RelationTs...>><sp/>:</highlight></codeline>
|
||
|
|
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relations_are_supported" kindref="compound">RuntimeRelationsAreSupported</ref><(HasRuntimeQuantityIdentifiers<RelationTs>::value<sp/>&&<sp/>...),<sp/>RelationTs...><sp/>{};</highlight></codeline>
|
||
|
|
<codeline lineno="140"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>RelationT></highlight></codeline>
|
||
|
|
<codeline lineno="146" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage" kindref="compound">RuntimeRelationStorage</ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="147"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="155" refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage" kindref="compound">RuntimeRelationStorage</ref><EOS,<sp/><ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::Relation<OutputT,<sp/>InputTs...>><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1a32d4cb5126e6e5b434528a24663a8412" kindref="member">RelationType</ref><sp/>=<sp/><ref refid="structserif_1_1eos_1_1relations_1_1_relation" kindref="compound">relations::Relation</ref><OutputT,<sp/>InputTs...>;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
||
|
|
<codeline lineno="157"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static_assert</highlight><highlight class="normal">(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">...(InputTs)<sp/><=<sp/>64,<sp/></highlight><highlight class="stringliteral">"Runtime<sp/>EOS<sp/>relation<sp/>descriptors<sp/>support<sp/>at<sp/>most<sp/>64<sp/>inputs.<sp/>If<sp/>you<sp/>need<sp/>more<sp/>than<sp/>this<sp/>you<sp/>will<sp/>need<sp/>to<sp/>implement<sp/>your<sp/>own<sp/>custom<sp/>RuntimeRelationStorage<sp/>specialization"</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
|
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/>std::array<<ref refid="classserif_1_1dimensions_1_1runtime_1_1_thermodynamic_quantity_i_d" kindref="compound">dimensions::runtime::ThermodynamicQuantityID</ref>,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">...(InputTs)><sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1ab2bfb5180579561d59675559fcd52c8d" kindref="member">inputQuantityIDs</ref><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1dimensions_1_1runtime_1ad1eac97b6b9f34f3be395e42d7edc4ba" kindref="member">dimensions::runtime::thermodynamicQuantityID<InputTs></ref>...</highlight></codeline>
|
||
|
|
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="166"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><std::size_t...<sp/>Indices></highlight></codeline>
|
||
|
|
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">consteval</highlight><highlight class="normal"><sp/>std::uint64_t<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1a9b29e7a41487640087ed4093c8632e7c" kindref="member">makePartialDerivativeMask</ref>(std::index_sequence<Indices...>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/></highlight><highlight class="normal">InputTuple<sp/>=<sp/>std::tuple<InputTs...>;</highlight></codeline>
|
||
|
|
<codeline lineno="175"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>This<sp/>is<sp/>perhaps<sp/>overly<sp/>"clever"<sp/>and<sp/>self-indulgent.</highlight></codeline>
|
||
|
|
<codeline lineno="177"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="178"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>Instead<sp/>of<sp/>changing<sp/>that<sp/>I<sp/>will<sp/>provide<sp/>a<sp/>brief<sp/>explanation<sp/>of<sp/>what<sp/>this<sp/>is<sp/>doing.</highlight></codeline>
|
||
|
|
<codeline lineno="179"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>Effectively<sp/>we<sp/>are<sp/>accumulating<sp/>a<sp/>bit<sp/>mask.<sp/>std::uint64_t<sp/>on<sp/>the<sp/>left<sp/>initializes<sp/>the<sp/>bit<sp/>mask<sp/>to<sp/>all<sp/>0s</highlight></codeline>
|
||
|
|
<codeline lineno="180"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>Then<sp/>we<sp/>fold<sp/>over<sp/>all<sp/>the<sp/>indices<sp/>of<sp/>the<sp/>input<sp/>quantities</highlight></codeline>
|
||
|
|
<codeline lineno="181"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="182"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>As<sp/>a<sp/>reminder<sp/>if<sp/>you<sp/>have<sp/>not<sp/>run<sp/>into<sp/>any<sp/>of<sp/>the<sp/>other<sp/>folding<sp/>comments<sp/>I<sp/>have<sp/>left<sp/>scattered<sp/>in<sp/>the<sp/>code<sp/>base.<sp/>C++17<sp/>introduced<sp/>the<sp/>folding<sp/>operator,</highlight></codeline>
|
||
|
|
<codeline lineno="183"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>what<sp/>we<sp/>have<sp/>here<sp/>is<sp/>what<sp/>is<sp/>called<sp/>a<sp/>right<sp/>binary<sp/>fold.<sp/>Essentially<sp/>we<sp/>start<sp/>with<sp/>a<sp/>value<sp/>then<sp/>repeatedly<sp/>logically<sp/>or<sp/>it<sp/>with<sp/>the<sp/>result<sp/>of<sp/>an<sp/>iteration</highlight></codeline>
|
||
|
|
<codeline lineno="184"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>over<sp/>the<sp/>type<sp/>pack<sp/>Indices<sp/>(which<sp/>is<sp/>some<sp/>list<sp/>of<sp/>integers<sp/>from<sp/>0<sp/>to<sp/>sizeof...(InputTs)<sp/>-<sp/>1).<sp/>The<sp/>|<sp/>...<sp/>|<sp/>is<sp/>what<sp/>indicates<sp/>this,<sp/>the<sp/>first<sp/>pipe<sp/>shows<sp/>we<sp/>or</highlight></codeline>
|
||
|
|
<codeline lineno="185"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>the<sp/>initial<sp/>state<sp/>(a<sp/>64<sp/>bit<sp/>integer<sp/>with<sp/>all<sp/>bits<sp/>set<sp/>to<sp/>0)<sp/>with<sp/>the<sp/>result<sp/>of<sp/>the<sp/>first<sp/>iteration,<sp/>then<sp/>we<sp/>or<sp/>that<sp/>result<sp/>with<sp/>the<sp/>result<sp/>of<sp/>the<sp/>second<sp/>iteration,<sp/>and<sp/>so<sp/>on<sp/>until<sp/>we<sp/>have<sp/>iterated<sp/>over<sp/>all<sp/>indices.</highlight></codeline>
|
||
|
|
<codeline lineno="186"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>There<sp/>is<sp/>persistent<sp/>confusion<sp/>I<sp/>feel<sp/>with<sp/>this<sp/>since<sp/>we<sp/>do<sp/>not<sp/>have<sp/>a<sp/>loop<sp/>variable<sp/>as<sp/>a<sp/>standard<sp/>for<sp/>loop<sp/>would;<sp/>however,<sp/>this<sp/>is<sp/>simply<sp/>the<sp/>syntax<sp/>available</highlight></codeline>
|
||
|
|
<codeline lineno="187"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>in<sp/>C++<sp/>(as<sp/>of<sp/>C++23).<sp/>The<sp/>looping<sp/>is<sp/>implicit<sp/>in<sp/>so<sp/>far<sp/>as<sp/>the<sp/>compiler<sp/>implicitly<sp/>generates<sp/>the<sp/>loop<sp/>over<sp/>Indices.</highlight></codeline>
|
||
|
|
<codeline lineno="188"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="189"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>We<sp/>use<sp/>std::tuple_element_t<sp/>to<sp/>get<sp/>the<sp/>type<sp/>of<sp/>the<sp/>input<sp/>quantity<sp/>at<sp/>the<sp/>current<sp/>index<sp/>(recall<sp/>that<sp/>the<sp/>fold<sp/>loop<sp/>goes<sp/>over<sp/>all<sp/>indices)</highlight></codeline>
|
||
|
|
<codeline lineno="190"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>So<sp/>for<sp/>example<sp/>if<sp/>the<sp/>tuple<sp/>is<sp/><int,<sp/>float,<sp/>int,<sp/>int><sp/>and<sp/>we<sp/>are<sp/>at<sp/>the<sp/>second<sp/>iteration<sp/>of<sp/>the<sp/>folding<sp/>loop<sp/>(index<sp/>1)<sp/>then<sp/>std::tuple_element_t<sp/>will<sp/>evaluate<sp/>to<sp/>float</highlight></codeline>
|
||
|
|
<codeline lineno="191"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>This<sp/>is<sp/>contrived<sp/>though<sp/>since<sp/>we<sp/>are<sp/>not<sp/>storing<sp/>primitives<sp/>in<sp/>the<sp/>tuple<sp/>but<sp/>rather<sp/>types<sp/>derived<sp/>from<sp/>the<sp/>ThermodynamicQuantity<sp/>concept.</highlight></codeline>
|
||
|
|
<codeline lineno="192"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="193"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>Note<sp/>where<sp/>we<sp/>evaluate<sp/>this<sp/>type.<sp/>In<sp/>the<sp/>template<sp/>argument<sp/>for<sp/>EOSSupportingPartialDerivative.<sp/>Basically<sp/>we<sp/>are<sp/>asking<sp/>if,<sp/>for<sp/>the<sp/>given<sp/>EOS</highlight></codeline>
|
||
|
|
<codeline lineno="194"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>and<sp/>relation<sp/>type,<sp/>does<sp/>it<sp/>support<sp/>a<sp/>partial<sp/>derivative<sp/>with<sp/>respect<sp/>to<sp/>the<sp/>input<sp/>quantity<sp/>at<sp/>the<sp/>current<sp/>index.<sp/>This<sp/>evaluates<sp/>at<sp/>compile</highlight></codeline>
|
||
|
|
<codeline lineno="195"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>time<sp/>to<sp/>either<sp/>true<sp/>or<sp/>false.<sp/>There<sp/>is<sp/>then<sp/>a<sp/>ternary<sp/>operator<sp/>that<sp/>selects<sp/>a<sp/>1<sp/>(bit<sp/>shifted<sp/>by<sp/>the<sp/>current<sp/>index<sp/>to<sp/>fit<sp/>in<sp/>the<sp/>right<sp/>bitmask<sp/>location)<sp/>or<sp/>a<sp/>0<sp/>(which<sp/>we<sp/>don't<sp/>need<sp/>to<sp/>bitshift)</highlight></codeline>
|
||
|
|
<codeline lineno="196"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="197"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>What<sp/>that<sp/>means<sp/>is<sp/>when<sp/>all<sp/>is<sp/>said<sp/>and<sp/>done<sp/>for<sp/>an<sp/>input<sp/>type<sp/>list<sp/>made<sp/>of<sp/>n<sp/>types<sp/>there<sp/>is<sp/>an<sp/>n<sp/>bit<sp/>integer<sp/>(padded<sp/>out<sp/>to<sp/>64<sp/>bits)<sp/>where<sp/>each<sp/>bit<sp/>corresponds</highlight></codeline>
|
||
|
|
<codeline lineno="198"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>to<sp/>whether<sp/>the<sp/>EOS<sp/>supports<sp/>a<sp/>partial<sp/>derivative<sp/>with<sp/>respect<sp/>to<sp/>the<sp/>input<sp/>quantity<sp/>at<sp/>that<sp/>index.<sp/>The<sp/>first<sp/>input<sp/>quantity<sp/>corresponds<sp/>to<sp/>the<sp/>least<sp/>significant<sp/>bit<sp/>and<sp/>the<sp/>last<sp/>input<sp/>quantity<sp/>corresponds<sp/>to<sp/>the<sp/>most<sp/>significant<sp/>bit.</highlight></codeline>
|
||
|
|
<codeline lineno="199"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(std::uint64_t{0}<sp/>|<sp/>...<sp/>|<sp/>(<ref refid="conceptserif_1_1eos_1_1models_1_1_e_o_s_supporting_partial_derivative" kindref="compound">models::EOSSupportingPartialDerivative<EOS, RelationType, std::tuple_element_t<Indices, InputTuple></ref>><sp/>?<sp/>(std::uint64_t{1}<sp/><<<sp/>Indices)<sp/>:<sp/>std::uint64_t{0}));</highlight></codeline>
|
||
|
|
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/>std::uint64_t<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1a3ffef5a28638397b3633b08130f36066" kindref="member">partialDerivativeMask</ref><sp/>=<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1a9b29e7a41487640087ed4093c8632e7c" kindref="member">makePartialDerivativeMask</ref>(std::index_sequence_for<InputTs...>{});<sp/><sp/></highlight></codeline>
|
||
|
|
<codeline lineno="204"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/><ref refid="structserif_1_1dimensions_1_1runtime_1_1_runtime_relation_descriptor" kindref="compound">dimensions::runtime::RuntimeRelationDescriptor</ref><sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1ab68766f37a89993c2a3540c66db1c7d4" kindref="member">descriptor</ref><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.outputQuantity<sp/>=<sp/><ref refid="namespaceserif_1_1dimensions_1_1runtime_1ad1eac97b6b9f34f3be395e42d7edc4ba" kindref="member">dimensions::runtime::thermodynamicQuantityID<OutputT></ref>,</highlight></codeline>
|
||
|
|
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.inputQuantities<sp/>=<sp/>std::span<const<sp/>dimensions::runtime::ThermodynamicQuantityID>{<ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1ab2bfb5180579561d59675559fcd52c8d" kindref="member">inputQuantityIDs</ref>},</highlight></codeline>
|
||
|
|
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.partialDerivativeMask<sp/>=<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage_3_01_e_o_s_00_01relations_1_1_relatio1af2754f79c06f8e77304f983650b533_1a3ffef5a28638397b3633b08130f36066" kindref="member">partialDerivativeMask</ref></highlight></codeline>
|
||
|
|
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="214"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>CatalogT></highlight></codeline>
|
||
|
|
<codeline lineno="221" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage" kindref="compound">RuntimeCatalogStorage</ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="229" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage_3_01_e_o_s_00_01relations_1_1_relation983e333b4bd596c3958f49a1bba13994" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage" kindref="compound">RuntimeCatalogStorage</ref><EOS,<sp/><ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::RelationCatalog<RelationTs...>><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/>std::array<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_storage_3_01_e_o_s_00_01relations_1_1_relation983e333b4bd596c3958f49a1bba13994_1a7c3b0bf53b25106876cc78faa022b3ca" kindref="member">descriptors</ref><sp/>{<ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage" kindref="compound">RuntimeRelationStorage<EOS, RelationTs>::descriptor</ref>...};</highlight></codeline>
|
||
|
|
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="232"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a6bf81d411b0ecbf037e521c4fd9a73fd" kindref="member">runtimeEvaluationFailure</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346" kindref="member">utils::errors::SERiFErrorCode</ref><sp/>code</highlight></codeline>
|
||
|
|
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>std::unexpected{code};</highlight></codeline>
|
||
|
|
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1ada3bf0e8223991d705767cfedd798d0e" kindref="member">evaluateRuntimeRelation</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>EOS&<sp/><ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref>,</highlight></codeline>
|
||
|
|
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>relations::Relation<OutputT,<sp/>InputTs...><sp/></highlight><highlight class="comment">/*relation*/</highlight><highlight class="normal">,</highlight></codeline>
|
||
|
|
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues</highlight></codeline>
|
||
|
|
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Once<sp/>again<sp/>we<sp/>find<sp/>ourself<sp/>at<sp/>a<sp/>use<sp/>of<sp/>folding.<sp/>I<sp/>recommend<sp/>you<sp/>read<sp/>the<sp/>comment<sp/>earlier<sp/>in<sp/>this<sp/>file<sp/>regarding<sp/>folding,<sp/>or<sp/>find<sp/>the<sp/>C++<sp/>docs<sp/>on<sp/>folding.</highlight></codeline>
|
||
|
|
<codeline lineno="262"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
|
<codeline lineno="263"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>The<sp/>general<sp/>premise<sp/>here<sp/>is<sp/>that<sp/>we<sp/>call<sp/>the<sp/>evaluation<sp/>function<sp/>for<sp/>the<sp/>EOS<sp/>with<sp/>the<sp/>given<sp/>relation<sp/>and<sp/>input<sp/>values.<sp/>We<sp/>fold<sp/>over<sp/>all<sp/>indices<sp/>using<sp/>the<sp/>final<sp/>...<sp/>operator.</highlight></codeline>
|
||
|
|
<codeline lineno="264"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>This<sp/>is<sp/>an<sp/>implicit<sp/>loop<sp/>generated<sp/>by<sp/>the<sp/>compiler<sp/>over<sp/>the<sp/>so<sp/>called<sp/>"parameter<sp/>pack".</highlight></codeline>
|
||
|
|
<codeline lineno="265"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>invoke_evaluate<sp/>=<sp/>[&]<std::size_t...<sp/>Indices>(std::index_sequence<Indices...>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1ade79763ef51f539b78059d8898a2d2a2" kindref="member">eos::evaluate<OutputT></ref>(<ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref>,<sp/><ref refid="classserif_1_1dimensions_1_1_quantity_value" kindref="compound">dimensions::QuantityValue<InputTs></ref>{inputValues[Indices].value}...).value();</highlight></codeline>
|
||
|
|
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="269"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">try</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>invoke_evaluate(std::make_index_sequence<</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">...(InputTs)>{});</highlight></codeline>
|
||
|
|
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">catch</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>EOSEvaluationError&<sp/>e)<sp/>{<sp/></highlight><highlight class="comment">//<sp/>We<sp/>may<sp/>want<sp/>to<sp/>reconsider<sp/>using<sp/>a<sp/>try-catch<sp/>for<sp/>this,<sp/>but<sp/>this<sp/>is<sp/>good<sp/>enough<sp/>for<sp/>now.<sp/>Realistically<sp/>if<sp/>we<sp/>want<sp/>to<sp/>not<sp/>use<sp/>a<sp/>try<sp/>catch<sp/>we<sp/>will<sp/>need<sp/>to<sp/>change<sp/>the<sp/>signature<sp/>of<sp/>the<sp/>EOS<sp/>evaluation<sp/>function<sp/>to<sp/>return<sp/>a<sp/>std::expected<sp/>instead<sp/>of<sp/>throwing<sp/>an<sp/>exception.<sp/>This<sp/>is<sp/>a<sp/>larger<sp/>change<sp/>that<sp/>I<sp/>don't<sp/>want<sp/>to<sp/>make<sp/>right<sp/>now.</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>std::unexpected<utils::errors::SERiFErrorCode>{<ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a1fdfa3b9c5fc912a083c1a65d4bc7def" kindref="member">utils::errors::SERiFErrorCode::EOS_ERROR</ref>};</highlight></codeline>
|
||
|
|
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="276"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>InputQuantityT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a7a12dde1e7beb91e5714eb5f058b21b9" kindref="member">tryRuntimePartialDerivative</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>EOS&<sp/>eos,</highlight></codeline>
|
||
|
|
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>relations::Relation<OutputT,<sp/>InputTs...><sp/></highlight><highlight class="comment">/*relation*/</highlight><highlight class="normal">,</highlight></codeline>
|
||
|
|
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>dimensions::runtime::ThermodynamicQuantityID<sp/>withRespectTo,</highlight></codeline>
|
||
|
|
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues,</highlight></codeline>
|
||
|
|
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode>&<sp/>result</highlight></codeline>
|
||
|
|
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(withRespectTo<sp/>!=<sp/><ref refid="namespaceserif_1_1dimensions_1_1runtime_1ad1eac97b6b9f34f3be395e42d7edc4ba" kindref="member">dimensions::runtime::thermodynamicQuantityID<InputQuantityT></ref>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="301"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">constexpr</highlight><highlight class="normal"><sp/>(models::EOSSupportingPartialDerivative<EOS,<sp/>relations::Relation<OutputT,<sp/>InputTs...>,<sp/>InputQuantityT>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>invoke_evaluate_partial_derivative<sp/>=<sp/>[&]<std::size_t...<sp/>Indices>(std::index_sequence<Indices...>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1a2d0ca00b47c2dfa34d75bae9456fe390" kindref="member">eos::partial_derivative<OutputT, InputQuantityT></ref>(eos,<sp/>dimensions::QuantityValue<InputTs>{inputValues[Indices].value}...).value();</highlight></codeline>
|
||
|
|
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="306"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">try</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>result<sp/>=<sp/>invoke_evaluate_partial_derivative(std::index_sequence_for<InputTs...>{});</highlight></codeline>
|
||
|
|
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">catch</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>EOSEvaluationError&<sp/></highlight><highlight class="comment">/*e*/</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>result<sp/>=<sp/>std::unexpected{<ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a1fdfa3b9c5fc912a083c1a65d4bc7def" kindref="member">utils::errors::SERiFErrorCode::EOS_ERROR</ref>};</highlight></codeline>
|
||
|
|
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a6bf81d411b0ecbf037e521c4fd9a73fd" kindref="member">runtimeEvaluationFailure</ref>(<ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a7abb36ccb39c78eee29ad309bfc92d83" kindref="member">utils::errors::SERiFErrorCode::EOS_UNSUPPORTED_DERIVATIVE</ref>);</highlight></codeline>
|
||
|
|
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="315"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="318"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>OutputT,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...<sp/>InputTs></highlight></codeline>
|
||
|
|
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a8b97b3741d11fdc026685bd5c857404d" kindref="member">evaluateRuntimePartialDerivative</ref><sp/>(</highlight></codeline>
|
||
|
|
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>EOS&<sp/>eos,</highlight></codeline>
|
||
|
|
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>relations::Relation<OutputT,<sp/>InputTs...><sp/>relation,</highlight></codeline>
|
||
|
|
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>dimensions::runtime::ThermodynamicQuantityID<sp/>withRespectTo,</highlight></codeline>
|
||
|
|
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues</highlight></codeline>
|
||
|
|
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/>result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a6bf81d411b0ecbf037e521c4fd9a73fd" kindref="member">runtimeEvaluationFailure</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a7abb36ccb39c78eee29ad309bfc92d83" kindref="member">utils::errors::SERiFErrorCode::EOS_UNSUPPORTED_DERIVATIVE</ref></highlight></codeline>
|
||
|
|
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
|
||
|
|
<codeline lineno="341"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[maybe_unused]]<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>matched<sp/>=<sp/>(<ref refid="namespaceserif_1_1eos_1_1runtime_1a7a12dde1e7beb91e5714eb5f058b21b9" kindref="member">tryRuntimePartialDerivative<InputTs></ref>(eos,<sp/>relation,<sp/>withRespectTo,<sp/>inputValues,<sp/>result)<sp/>||<sp/>...);<sp/></highlight><highlight class="comment">//<sp/>Here<sp/>we<sp/>fold<sp/>over<sp/>all<sp/>input<sp/>and<sp/>try<sp/>to<sp/>find<sp/>one<sp/>that<sp/>we<sp/>can<sp/>evaluate.</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="343"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>result;</highlight></codeline>
|
||
|
|
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="345"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>RelationT></highlight></codeline>
|
||
|
|
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a47b57535e125e2a963ff0105c77420fd" kindref="member">runtimeRelationMatches</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="357"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>dimensions::runtime::ThermodynamicQuantityID<sp/>outputQuantityID,</highlight></codeline>
|
||
|
|
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues</highlight></codeline>
|
||
|
|
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>dimensions::runtime::RuntimeRelationDescriptor&<sp/>descriptor<sp/>=<sp/><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_relation_storage" kindref="compound">RuntimeRelationStorage<EOS, RelationT>::descriptor</ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="361"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(descriptor.outputQuantity<sp/>!=<sp/>outputQuantityID<sp/>||<sp/>descriptor.inputQuantities.size()<sp/>!=<sp/>inputValues.size())<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="365"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(std::size_t<sp/>i<sp/>=<sp/>0;<sp/>i<sp/><<sp/>inputValues.size();<sp/>++i)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(descriptor.inputQuantities[i]<sp/>!=<sp/>inputValues[i].id)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="371"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
|
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="374"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>CatalogT></highlight></codeline>
|
||
|
|
<codeline lineno="381" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_dispatch" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_dispatch" kindref="compound">RuntimeCatalogDispatch</ref>;</highlight></codeline>
|
||
|
|
<codeline lineno="382"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="388"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><sp/><</highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>EOS,<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal">...RelationTs></highlight></codeline>
|
||
|
|
<codeline lineno="389" refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_dispatch_3_01_e_o_s_00_01relations_1_1_relatio0166b9bbd8882975b3d1325bcdcd27cb" refkind="compound"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structserif_1_1eos_1_1runtime_1_1_runtime_catalog_dispatch" kindref="compound">RuntimeCatalogDispatch</ref><EOS,<sp/><ref refid="namespaceserif_1_1eos_1_1relations" kindref="compound">relations</ref>::RelationCatalog<RelationTs...>><sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/><ref refid="namespaceserif_1_1eos_1ade79763ef51f539b78059d8898a2d2a2" kindref="member">evaluate</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*</highlight><highlight class="keywordtype">object</highlight><highlight class="normal">,</highlight></codeline>
|
||
|
|
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classserif_1_1dimensions_1_1runtime_1_1_thermodynamic_quantity_i_d" kindref="compound">dimensions::runtime::ThermodynamicQuantityID</ref>&<sp/>outputQuantity,</highlight></codeline>
|
||
|
|
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues</highlight></codeline>
|
||
|
|
<codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="402"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>&<ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref><sp/>=<sp/>*</highlight><highlight class="keyword">static_cast<</highlight><highlight class="keyword">const<sp/></highlight><highlight class="normal">EOS*</highlight><highlight class="keyword">></highlight><highlight class="normal">(object);<sp/></highlight><highlight class="comment">//<sp/>Not<sp/>sure<sp/>if<sp/>polymorphic<sp/>type<sp/>erasure<sp/>is<sp/>the<sp/>right<sp/>tool<sp/>here.<sp/>It<sp/>works<sp/>but<sp/>we<sp/>may<sp/>want<sp/>to<sp/>revisit<sp/>it<sp/>if<sp/>it<sp/>precent<sp/>compiler<sp/>optimizations.<sp/>This<sp/>does<sp/>however<sp/>let<sp/>us<sp/>pass<sp/>any<sp/>eos<sp/>model<sp/>to<sp/>the<sp/>runtime<sp/>view<sp/>without<sp/>needing<sp/>to<sp/>know<sp/>the<sp/>type<sp/>at<sp/>compile<sp/>time<sp/>(which<sp/>is<sp/>therefore<sp/>helpful<sp/>when<sp/>building<sp/>extension<sp/>systems<sp/>in<sp/>other<sp/>languages<sp/>like<sp/>python).<sp/>Further,<sp/>it<sp/>may<sp/>make<sp/>sense<sp/>to<sp/>take<sp/>the<sp/>performance<sp/>hit<sp/>here<sp/>and<sp/>use<sp/>something<sp/>like<sp/>a<sp/>dynamic_cast<sp/>to<sp/>ensure<sp/>that<sp/>the<sp/>object<sp/>is<sp/>actually<sp/>of<sp/>the<sp/>correct<sp/>type.<sp/>This<sp/>would<sp/>be<sp/>a<sp/>runtime<sp/>check<sp/>but<sp/>it<sp/>would<sp/>be<sp/>a<sp/>more<sp/>robust<sp/>check<sp/>than<sp/>just<sp/>blindly<sp/>casting<sp/>to<sp/>the<sp/>expected<sp/>type.</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="403"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="404"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="405"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/>result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a6bf81d411b0ecbf037e521c4fd9a73fd" kindref="member">runtimeEvaluationFailure</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="406"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a8e9f88cbd72f5fd2ea30e1a9fc980935" kindref="member">utils::errors::SERiFErrorCode::EOS_UNSUPPORTED_RELATION</ref></highlight></codeline>
|
||
|
|
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
|
||
|
|
<codeline lineno="408"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Fold<sp/>over<sp/>all<sp/>relations<sp/>in<sp/>the<sp/>catalog<sp/>and<sp/>check<sp/>if<sp/>any<sp/>of<sp/>them<sp/>match<sp/>the<sp/>requested<sp/>output<sp/>quantity<sp/>and<sp/>input<sp/>quantities.<sp/>If<sp/>the<sp/>match<sp/>is<sp/>found<sp/>then</highlight></codeline>
|
||
|
|
<codeline lineno="410"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>evaluate<sp/>the<sp/>relation<sp/>and<sp/>return<sp/>the<sp/>result<sp/>and<sp/>set<sp/>matched<sp/>to<sp/>true,<sp/>if<sp/>no<sp/>match<sp/>is<sp/>found<sp/>then<sp/>set<sp/>matched<sp/>to<sp/>false.</highlight></codeline>
|
||
|
|
<codeline lineno="411"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[maybe_unused]]<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>matched<sp/>=<sp/>((<ref refid="namespaceserif_1_1eos_1_1runtime_1a47b57535e125e2a963ff0105c77420fd" kindref="member">runtimeRelationMatches<EOS, RelationTs></ref>(outputQuantity,<sp/>inputValues)<sp/>?<sp/>(result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1ada3bf0e8223991d705767cfedd798d0e" kindref="member">evaluateRuntimeRelation</ref>(<ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref>,<sp/>RelationTs{},<sp/>inputValues),<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>:<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>||<sp/>...);</highlight></codeline>
|
||
|
|
<codeline lineno="413"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>result;</highlight></codeline>
|
||
|
|
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="416"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[nodiscard]]<sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/><ref refid="namespaceserif_1_1eos_1a2d0ca00b47c2dfa34d75bae9456fe390" kindref="member">partial_derivative</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*</highlight><highlight class="keywordtype">object</highlight><highlight class="normal">,</highlight></codeline>
|
||
|
|
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classserif_1_1dimensions_1_1runtime_1_1_thermodynamic_quantity_i_d" kindref="compound">dimensions::runtime::ThermodynamicQuantityID</ref>&<sp/>outputQuantity,</highlight></codeline>
|
||
|
|
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classserif_1_1dimensions_1_1runtime_1_1_thermodynamic_quantity_i_d" kindref="compound">dimensions::runtime::ThermodynamicQuantityID</ref>&<sp/>withRespectTo,</highlight></codeline>
|
||
|
|
<codeline lineno="429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>std::span<const<sp/>dimensions::runtime::RuntimeQuantityValue><sp/>inputValues</highlight></codeline>
|
||
|
|
<codeline lineno="430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)<sp/>{</highlight></codeline>
|
||
|
|
<codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>&<ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref><sp/>=<sp/>*</highlight><highlight class="keyword">static_cast<</highlight><highlight class="keyword">const<sp/></highlight><highlight class="normal">EOS*</highlight><highlight class="keyword">></highlight><highlight class="normal">(object);<sp/></highlight><highlight class="comment">//<sp/>Same<sp/>Comment<sp/>as<sp/>above</highlight><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="432"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>std::expected<double,<sp/>utils::errors::SERiFErrorCode><sp/>result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a6bf81d411b0ecbf037e521c4fd9a73fd" kindref="member">runtimeEvaluationFailure</ref>(</highlight></codeline>
|
||
|
|
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceserif_1_1utils_1_1errors_1ab04484c13887f78337c2331fb2911346a8e9f88cbd72f5fd2ea30e1a9fc980935" kindref="member">utils::errors::SERiFErrorCode::EOS_UNSUPPORTED_RELATION</ref></highlight></codeline>
|
||
|
|
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
|
||
|
|
<codeline lineno="436"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>[[maybe_unused]]<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>matched<sp/>=<sp/>((<ref refid="namespaceserif_1_1eos_1_1runtime_1a47b57535e125e2a963ff0105c77420fd" kindref="member">runtimeRelationMatches<EOS, RelationTs></ref>(outputQuantity,<sp/>inputValues)<sp/>?<sp/>(result<sp/>=<sp/><ref refid="namespaceserif_1_1eos_1_1runtime_1a8b97b3741d11fdc026685bd5c857404d" kindref="member">evaluateRuntimePartialDerivative</ref>(<ref refid="namespaceserif_1_1eos" kindref="compound">eos</ref>,<sp/>RelationTs{},<sp/>withRespectTo,<sp/>inputValues),<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>:<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>||<sp/>...);</highlight></codeline>
|
||
|
|
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>result;</highlight></codeline>
|
||
|
|
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
|
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/>};</highlight></codeline>
|
||
|
|
<codeline lineno="441"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="442"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="443"><highlight class="normal"></highlight></codeline>
|
||
|
|
<codeline lineno="444"><highlight class="normal">}</highlight></codeline>
|
||
|
|
</programlisting>
|
||
|
|
<location file="src/include/serif/eos/runtime/details.hpp"/>
|
||
|
|
</compounddef>
|
||
|
|
</doxygen>
|