mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 05:04:27 +02:00
docs: project documentation updated with the latest unit-related changes
This commit is contained in:
229
docs/_static/img/units.svg
vendored
229
docs/_static/img/units.svg
vendored
@@ -1,122 +1,157 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="619px" preserveAspectRatio="none" style="width:678px;height:619px;background:#FCFCFC;" version="1.1" viewBox="0 0 678 619" width="678px" zoomAndPan="magnify"><defs/><g><!--MD5=[197a77df23d290968e58c76a2239d979]
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
cluster Unit--><a href="../../framework/units.html" target="_top" title="../../framework/units.html" xlink:actuate="onRequest" xlink:href="../../framework/units.html" xlink:show="new" xlink:title="../../framework/units.html" xlink:type="simple"><rect fill="#FCFCFC" height="606" style="stroke:#000000;stroke-width:1.5;" width="665" x="7" y="7"/><path d="M51,7 L51,16.2969 L41,26.2969 L7,26.2969 " fill="none" style="stroke:#000000;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="34" x="10" y="20.9951">Unit</text></a><!--MD5=[fe9c23f38d3f164e458ed7686471f90d]
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="456px" preserveAspectRatio="none" style="width:591px;height:456px;background:#FCFCFC;" version="1.1" viewBox="0 0 591 456" width="591px" zoomAndPan="magnify">
|
||||||
class prefix_family--><a href="../../framework/units.html#prefixed-unit" target="_top" title="../../framework/units.html#prefixed-unit" xlink:actuate="onRequest" xlink:href="../../framework/units.html#prefixed-unit" xlink:show="new" xlink:title="../../framework/units.html#prefixed-unit" xlink:type="simple"><rect codeLine="11" fill="#F8F8F8" height="23.9688" id="prefix_family" style="stroke:#383838;stroke-width:1.5;" width="82" x="65" y="72"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="76" x="68" y="88.1387">prefix_family</text></a><!--MD5=[2c438ee281b14598fe4adbd039a51ed9]
|
<defs />
|
||||||
class no_prefix--><a href="../../framework/units.html#named-scaled-units" target="_top" title="../../framework/units.html#named-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#named-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#named-scaled-units" xlink:type="simple"><rect codeLine="12" fill="#F8F8F8" height="23.9688" id="no_prefix" style="stroke:#383838;stroke-width:1.5;" width="61" x="422" y="101"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="55" x="425" y="117.1387">no_prefix</text></a><!--MD5=[8ec8902a0493db0501cc5ae48138d755]
|
<g> <!--MD5=[197a77df23d290968e58c76a2239d979]
|
||||||
class prefix--><a href="../../framework/units.html#prefixed-unit" target="_top" title="../../framework/units.html#prefixed-unit" xlink:actuate="onRequest" xlink:href="../../framework/units.html#prefixed-unit" xlink:show="new" xlink:title="../../framework/units.html#prefixed-unit" xlink:type="simple"><rect codeLine="13" fill="#F8F8F8" height="23.9688" id="prefix" style="stroke:#383838;stroke-width:1.5;" width="207" x="349" y="42"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="34" x="352" y="58.1387">prefix</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="165" x="394" y="39"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="163" x="395" y="51.1387">PrefixFamily, Symbol, Ratio</text></a><!--MD5=[124cbcdfdb408a63d08476bd52d3bb38]
|
cluster Unit-->
|
||||||
class scaled_unit--><rect codeLine="26" fill="#F8F8F8" height="23.9688" id="scaled_unit" style="stroke:#383838;stroke-width:1.5;" width="166" x="23" y="367"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="68" x="26" y="383.1387">scaled_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="90" x="102" y="364"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="88" x="103" y="376.1387">UnitRatio, Unit</text><!--MD5=[c262fc293e71d96455ecd38c5cba51e9]
|
<g id="cluster_Unit">
|
||||||
class prefixed_alias_unit--><a href="../../framework/units.html#aliased-units" target="_top" title="../../framework/units.html#aliased-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#aliased-units" xlink:show="new" xlink:title="../../framework/units.html#aliased-units" xlink:type="simple"><rect codeLine="28" fill="#F8F8F8" height="23.9688" id="prefixed_alias_unit" style="stroke:#383838;stroke-width:1.5;" width="247" x="329" y="573"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="111" x="332" y="589.1387">prefixed_alias_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="128" x="451" y="570"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="126" x="452" y="582.1387">Unit, Prefix, AliasUnit</text></a><!--MD5=[80b1f1fe027b66c9bd530ac9502a064a]
|
<a href="../../framework/units.html" target="_top" title="../../framework/units.html" xlink:actuate="onRequest" xlink:href="../../framework/units.html" xlink:show="new" xlink:title="../../framework/units.html" xlink:type="simple">
|
||||||
class alias_unit--><a href="../../framework/units.html#aliased-units" target="_top" title="../../framework/units.html#aliased-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#aliased-units" xlink:show="new" xlink:title="../../framework/units.html#aliased-units" xlink:type="simple"><rect codeLine="29" fill="#F8F8F8" height="23.9688" id="alias_unit" style="stroke:#383838;stroke-width:1.5;" width="224" x="340.5" y="514"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="56" x="343.5" y="530.1387">alias_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="160" x="407.5" y="511"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="158" x="408.5" y="523.1387">Unit, Symbol, PrefixFamily</text></a><!--MD5=[a28d6ca64d3db0c31a0f1e5dbad7ee82]
|
<rect height="443" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:1.0;fill:none;" width="578" x="7" y="7" />
|
||||||
class named_derived_unit--><a href="../../framework/units.html#derived-scaled-units" target="_top" title="../../framework/units.html#derived-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#derived-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#derived-scaled-units" xlink:type="simple"><rect codeLine="30" fill="#F8F8F8" height="23.9688" id="named_derived_unit" style="stroke:#383838;stroke-width:1.5;" width="407" x="249" y="455"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="123" x="252" y="471.1387">named_derived_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="276" x="383" y="452"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="274" x="384" y="464.1387">Dimension, Symbol, PrefixFamily, Unit, Unit...</text></a><!--MD5=[21a38f8b465de3a6a580896bb83abf03]
|
<path d="M51,7 L51,16.2969 L41,26.2969 L7,26.2969 " fill="none" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
class derived_unit--><a href="../../framework/units.html#derived-scaled-units" target="_top" title="../../framework/units.html#derived-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#derived-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#derived-scaled-units" xlink:type="simple"><rect codeLine="31" fill="#F8F8F8" height="23.9688" id="derived_unit" style="stroke:#383838;stroke-width:1.5;" width="226" x="339.5" y="396"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="75" x="342.5" y="412.1387">derived_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="143" x="425.5" y="393"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="141" x="426.5" y="405.1387">Dimension, Unit, Unit...</text></a><!--MD5=[002996a525ad7ee43e1a2ae0bbb7adb6]
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="34" x="10" y="20.9951">Unit</text>
|
||||||
class prefixed_unit--><a href="../../framework/units.html#prefixed-unit" target="_top" title="../../framework/units.html#prefixed-unit" xlink:actuate="onRequest" xlink:href="../../framework/units.html#prefixed-unit" xlink:show="new" xlink:title="../../framework/units.html#prefixed-unit" xlink:type="simple"><rect codeLine="32" fill="#F8F8F8" height="23.9688" id="prefixed_unit" style="stroke:#383838;stroke-width:1.5;" width="155" x="375" y="337"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="79" x="378" y="353.1387">prefixed_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="68" x="465" y="334"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="66" x="466" y="346.1387">Prefix, Unit</text></a><!--MD5=[3a0c8cf47fc662100af5bce8b7f7e204]
|
</a>
|
||||||
class named_scaled_unit--><a href="../../framework/units.html#named-scaled-units" target="_top" title="../../framework/units.html#named-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#named-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#named-scaled-units" xlink:type="simple"><rect codeLine="33" fill="#F8F8F8" height="23.9688" id="named_scaled_unit" style="stroke:#383838;stroke-width:1.5;" width="322" x="291.5" y="278"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="116" x="294.5" y="294.1387">named_scaled_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="198" x="418.5" y="275"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="196" x="419.5" y="287.1387">Symbol, PrefixFamily, Ratio, Unit</text></a><!--MD5=[5e57872b30d77ee0da3206dd3d117986]
|
</g> <!--MD5=[124cbcdfdb408a63d08476bd52d3bb38]
|
||||||
class named_unit--><a href="../../framework/units.html#base-units" target="_top" title="../../framework/units.html#base-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#base-units" xlink:show="new" xlink:title="../../framework/units.html#base-units" xlink:type="simple"><rect codeLine="34" fill="#F8F8F8" height="23.9688" id="named_unit" style="stroke:#383838;stroke-width:1.5;" width="207" x="349" y="219"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="72" x="352" y="235.1387">named_unit</text><rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="127" x="432" y="216"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="125" x="433" y="228.1387">Symbol, PrefixFamily</text></a><!--MD5=[71453aad0c321cc4e5ffc62c5a278467]
|
class scaled_unit-->
|
||||||
class unit--><a href="../../framework/units.html#derived-unnamed-units" target="_top" title="../../framework/units.html#derived-unnamed-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#derived-unnamed-units" xlink:show="new" xlink:title="../../framework/units.html#derived-unnamed-units" xlink:type="simple"><rect codeLine="35" fill="#F8F8F8" height="23.9688" id="unit" style="stroke:#383838;stroke-width:1.5;" width="30" x="437.5" y="160"/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="24" x="440.5" y="176.1387">unit</text></a><!--MD5=[d5573293cc2f3397d55e23fbd852731b]
|
<g id="elem_scaled_unit">
|
||||||
reverse link prefix_family to no_prefix--><path codeLine="15" d="M167.21,89.068 C241.552,95.327 365.078,105.725 421.603,110.483 " fill="none" id="prefix_family-backto-no_prefix" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="166.535,96.037,147.193,87.383,167.709,82.086,166.535,96.037" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[a9e0649862d8c9099c6cf94917b5c4f3]
|
<rect codeLine="12" fill="#F1F1F1" height="26.2969" id="scaled_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="23" y="225" />
|
||||||
reverse link prefix_family to prefix--><path codeLine="16" d="M152.197,80.064 C201.883,75.737 283.334,68.644 348.732,62.949 " fill="none" id="prefix_family-backto-prefix" style="stroke:#383838;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#383838" points="147.193,80.5,156.5065,83.703,152.1741,80.0656,155.8115,75.7332,147.193,80.5" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[f28f95aa1567536fda19ae5fa7526b9f]
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="80" x="26" y="242.9951">scaled_unit</text>
|
||||||
reverse link scaled_unit to unit--><path codeLine="37" d="M121.677,348.907 C143.37,307.974 188.09,235.861 249,201 C311.726,165.099 402.687,167.95 437.358,170.629 " fill="none" id="scaled_unit-backto-unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="127.857,352.199,112.578,366.881,115.366,345.876,127.857,352.199" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[d10f3427b03caf67d8b4e569e5f4936e]
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="90" x="114" y="222" />
|
||||||
reverse link scaled_unit to named_unit--><path codeLine="38" d="M130.613,351.798 C156.605,323.813 201.102,281.383 249,260 C279.89,246.21 315.826,238.667 348.778,234.632 " fill="none" id="scaled_unit-backto-named_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="135.822,356.473,117.258,366.689,125.4,347.126,135.822,356.473" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[c4573f7b87c3262f7d3adc92106a39ed]
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="88" x="115" y="234.1387">UnitRatio, Unit</text>
|
||||||
reverse link scaled_unit to named_scaled_unit--><path codeLine="39" d="M148.735,357.996 C176.499,344.874 214.14,328.686 249,319 C275.263,311.703 303.979,306.175 331.318,302.01 " fill="none" id="scaled_unit-backto-named_scaled_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="151.495,364.437,130.445,366.872,145.382,351.842,151.495,364.437" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[65b74da07c0359a7bcc888d9c9b6e7d5]
|
</g> <!--MD5=[c262fc293e71d96455ecd38c5cba51e9]
|
||||||
reverse link scaled_unit to prefixed_unit--><path codeLine="40" d="M209.206,370.1 C262.255,365.48 325.987,359.93 374.771,355.682 " fill="none" id="scaled_unit-backto-prefixed_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="209.611,377.091,189.079,371.852,208.396,363.144,209.611,377.091" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[29a2e6b65a8256359df6b41e4d3b7c7c]
|
class prefixed_alias_unit-->
|
||||||
reverse link scaled_unit to derived_unit--><path codeLine="41" d="M209.24,387.607 C250.204,391.055 297.536,395.039 339.433,398.566 " fill="none" id="scaled_unit-backto-derived_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="208.421,394.562,189.079,385.909,209.595,380.612,208.421,394.562" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[70b39df7ba7c3deccddaa8e432f196b0]
|
<a href="../../framework/units.html#aliased-units" target="_top" title="../../framework/units.html#aliased-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#aliased-units" xlink:show="new" xlink:title="../../framework/units.html#aliased-units" xlink:type="simple">
|
||||||
reverse link scaled_unit to named_derived_unit--><path codeLine="42" d="M149.575,399.543 C177.302,412.126 214.589,427.572 249,437 C277.193,444.724 308.173,450.582 337.239,454.975 " fill="none" id="scaled_unit-backto-named_derived_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="146.43,405.801,131.253,391.014,152.338,393.109,146.43,405.801" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[19d99332ae619b76851ceaa34f4e9014]
|
<g id="elem_prefixed_alias_unit">
|
||||||
reverse link scaled_unit to alias_unit--><path codeLine="43" d="M131.097,406.082 C157.237,433.557 201.619,474.947 249,496 C277.337,508.591 309.881,516.084 340.472,520.492 " fill="none" id="scaled_unit-backto-alias_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="125.691,410.543,117.316,391.079,136.001,401.072,125.691,410.543" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[a61d68e6008f4d1392d92030b50774f1]
|
<rect codeLine="14" fill="#F1F1F1" height="26.2969" id="prefixed_alias_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="269" x="280.5" y="408" />
|
||||||
reverse link scaled_unit to prefixed_alias_unit--><path codeLine="44" d="M121.723,408.926 C143.469,449.631 188.251,521.342 249,556 C273.061,569.7274 301.259,577.7818 328.839,582.3459 " fill="none" id="scaled_unit-backto-prefixed_alias_unit" style="stroke:#383838;stroke-width:1.0;"/><polygon fill="none" points="115.457,412.048,112.598,391.052,127.926,405.682,115.457,412.048" style="stroke:#383838;stroke-width:1.0;"/><!--MD5=[0d042b3ffad7c4747f62a95996e464a5]
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="133" x="283.5" y="425.9951">prefixed_alias_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="128" x="424.5" y="405" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="126" x="425.5" y="417.1387">Unit, Prefix, AliasUnit</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[80b1f1fe027b66c9bd530ac9502a064a]
|
||||||
|
class alias_unit-->
|
||||||
|
<a href="../../framework/units.html#aliased-units" target="_top" title="../../framework/units.html#aliased-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#aliased-units" xlink:show="new" xlink:title="../../framework/units.html#aliased-units" xlink:type="simple">
|
||||||
|
<g id="elem_alias_unit">
|
||||||
|
<rect codeLine="15" fill="#F1F1F1" height="26.2969" id="alias_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="155" x="337.5" y="347" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="67" x="340.5" y="364.9951">alias_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="80" x="415.5" y="344" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="78" x="416.5" y="356.1387">Unit, Symbol</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[26e0af737c6dfe4c6ad8ee7c79493d2e]
|
||||||
|
class derived_scaled_unit-->
|
||||||
|
<a href="../../framework/units.html#derived-scaled-units" target="_top" title="../../framework/units.html#derived-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#derived-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#derived-scaled-units" xlink:type="simple">
|
||||||
|
<g id="elem_derived_deduced_unit">
|
||||||
|
<rect codeLine="16" fill="#F1F1F1" height="26.2969" id="derived_scaled_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="308" x="261" y="286" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="157" x="264" y="303.9951">derived_scaled_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="143" x="429" y="283" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="141" x="430" y="295.1387">Dimension, Unit, Unit...</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[21a38f8b465de3a6a580896bb83abf03]
|
||||||
|
class derived_unit-->
|
||||||
|
<a href="../../framework/units.html#derived-unnamed-units" target="_top" title="../../framework/units.html#derived-unnamed-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#derived-unnamed-units" xlink:show="new" xlink:title="../../framework/units.html#derived-unnamed-units" xlink:type="simple">
|
||||||
|
<g id="elem_derived_unit">
|
||||||
|
<rect codeLine="17" fill="#F1F1F1" height="26.2969" id="derived_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="94" x="368" y="225" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="88" x="371" y="242.9951">derived_unit</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[002996a525ad7ee43e1a2ae0bbb7adb6]
|
||||||
|
class prefixed_unit-->
|
||||||
|
<a href="../../framework/units.html#prefixed-unit" target="_top" title="../../framework/units.html#prefixed-unit" xlink:actuate="onRequest" xlink:href="../../framework/units.html#prefixed-unit" xlink:show="new" xlink:title="../../framework/units.html#prefixed-unit" xlink:type="simple">
|
||||||
|
<g id="elem_prefixed_unit">
|
||||||
|
<rect codeLine="18" fill="#F1F1F1" height="26.2969" id="prefixed_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="169" x="330.5" y="164" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="93" x="333.5" y="181.9951">prefixed_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="68" x="434.5" y="161" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="66" x="435.5" y="173.1387">Prefix, Unit</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[3a0c8cf47fc662100af5bce8b7f7e204]
|
||||||
|
class named_scaled_unit-->
|
||||||
|
<a href="../../framework/units.html#named-scaled-units" target="_top" title="../../framework/units.html#named-scaled-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#named-scaled-units" xlink:show="new" xlink:title="../../framework/units.html#named-scaled-units" xlink:type="simple">
|
||||||
|
<g id="elem_named_scaled_unit">
|
||||||
|
<rect codeLine="19" fill="#F1F1F1" height="26.2969" id="named_scaled_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="263" x="283.5" y="103" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="137" x="286.5" y="120.9951">named_scaled_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="118" x="431.5" y="100" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="116" x="432.5" y="112.1387">Symbol, Ratio, Unit</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[5e57872b30d77ee0da3206dd3d117986]
|
||||||
|
class named_unit-->
|
||||||
|
<a href="../../framework/units.html#base-units" target="_top" title="../../framework/units.html#base-units" xlink:actuate="onRequest" xlink:href="../../framework/units.html#base-units" xlink:show="new" xlink:title="../../framework/units.html#base-units" xlink:type="simple">
|
||||||
|
<g id="elem_named_unit">
|
||||||
|
<rect codeLine="20" fill="#F1F1F1" height="26.2969" id="named_unit" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="139" x="345.5" y="42" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="84" x="348.5" y="59.9951">named_unit</text>
|
||||||
|
<rect fill="#FCFCFC" height="15.9688" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" width="47" x="440.5" y="39" />
|
||||||
|
<text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacing" textLength="45" x="441.5" y="51.1387">Symbol</text>
|
||||||
|
</g>
|
||||||
|
</a> <!--MD5=[d10f3427b03caf67d8b4e569e5f4936e]
|
||||||
|
reverse link scaled_unit to named_unit-->
|
||||||
|
<g id="link_scaled_unit_named_unit">
|
||||||
|
<path codeLine="22" d="M133.027,208.194 C158.437,172.883 205.676,115.067 261,85 C286.686,71.041 317.93,63.52 345.471,59.49 " fill="none" id="scaled_unit-backto-named_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="138.679,212.326,121.521,224.76,127.181,204.34,138.679,212.326" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[c4573f7b87c3262f7d3adc92106a39ed]
|
||||||
|
reverse link scaled_unit to named_scaled_unit-->
|
||||||
|
<g id="link_scaled_unit_named_scaled_unit">
|
||||||
|
<path codeLine="23" d="M145.911,212.637 C174.734,191.666 218.536,162.71 261,146 C279.262,138.814 299.451,133.292 319.011,129.068 " fill="none" id="scaled_unit-backto-named_scaled_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="149.884,218.407,129.672,224.769,141.505,207.191,149.884,218.407" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[65b74da07c0359a7bcc888d9c9b6e7d5]
|
||||||
|
reverse link scaled_unit to prefixed_unit-->
|
||||||
|
<g id="link_scaled_unit_prefixed_unit">
|
||||||
|
<path codeLine="24" d="M194.254,220.784 C215.93,216.246 239.344,211.391 261,207 C288.988,201.325 319.892,195.233 346.556,190.03 " fill="none" id="scaled_unit-backto-prefixed_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="195.542,227.667,174.53,224.927,192.664,213.966,195.542,227.667" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[29a2e6b65a8256359df6b41e4d3b7c7c]
|
||||||
|
reverse link scaled_unit to derived_unit-->
|
||||||
|
<g id="link_scaled_unit_derived_unit">
|
||||||
|
<path codeLine="25" d="M221.579,238 C271.79,238 328.764,238 367.604,238 " fill="none" id="scaled_unit-backto-derived_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="221.276,245,201.276,238,221.276,231,221.276,245" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[1916bf928027667941dfca121ed1aff3]
|
||||||
|
reverse link scaled_unit to derived_scaled_unit-->
|
||||||
|
<g id="link_scaled_unit_derived_deduced_unit">
|
||||||
|
<path codeLine="26" d="M197.3,255.089 C218.121,259.31 240.369,263.819 261,268 C290.086,273.894 322.282,280.418 349.606,285.954 " fill="none" id="scaled_unit-backto-derived_scaled_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="195.683,261.904,177.472,251.07,198.464,248.183,195.683,261.904" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[19d99332ae619b76851ceaa34f4e9014]
|
||||||
|
reverse link scaled_unit to alias_unit-->
|
||||||
|
<g id="link_scaled_unit_alias_unit">
|
||||||
|
<path codeLine="27" d="M145.982,263.005 C174.849,283.698 218.676,312.311 261,329 C285.078,338.494 312.484,345.219 337.384,349.919 " fill="none" id="scaled_unit-backto-alias_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="141.677,268.529,129.714,251.039,149.972,257.251,141.677,268.529" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[a61d68e6008f4d1392d92030b50774f1]
|
||||||
|
reverse link scaled_unit to prefixed_alias_unit-->
|
||||||
|
<g id="link_scaled_unit_prefixed_alias_unit">
|
||||||
|
<path codeLine="28" d="M133.104,267.552 C158.592,302.572 205.908,359.952 261,390 C275.157,397.7215 290.998,403.5283 306.976,407.8934 " fill="none" id="scaled_unit-backto-prefixed_alias_unit" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
<polygon fill="none" points="127.332,271.513,121.559,251.125,138.786,263.462,127.332,271.513" style="stroke:#181818;stroke-width:1.0;" />
|
||||||
|
</g> <!--MD5=[f18d7856f7539404df991684234dc7ed]
|
||||||
@startuml
|
@startuml
|
||||||
skinparam monochrome true
|
skinparam monochrome true
|
||||||
skinparam shadowing false
|
skinparam shadowing false
|
||||||
skinparam backgroundColor #fcfcfc
|
skinparam backgroundColor #fcfcfc
|
||||||
|
|
||||||
hide members
|
hide members
|
||||||
hide circle
|
hide circle
|
||||||
|
|
||||||
left to right direction
|
left to right direction
|
||||||
|
|
||||||
package Unit <<Frame>> [[../../framework/units.html]] {
|
package Unit <<Frame>> [[../../framework/units.html]] {
|
||||||
abstract prefix_family [[../../framework/units.html#prefixed-unit]]
|
|
||||||
abstract no_prefix [[../../framework/units.html#named-scaled-units]]
|
|
||||||
abstract prefix<PrefixFamily, Symbol, Ratio> [[../../framework/units.html#prefixed-unit]]
|
|
||||||
|
|
||||||
prefix_family <|- - no_prefix
|
|
||||||
prefix_family <.. prefix
|
|
||||||
|
|
||||||
' prefix_family <.. named_unit
|
|
||||||
' prefix_family <.. named_scaled_unit
|
|
||||||
' prefix_family <.. named_derived_unit
|
|
||||||
' prefix_family <.. alias_unit
|
|
||||||
|
|
||||||
' prefix <.. prefixed_unit
|
|
||||||
' prefix <.. prefixed_alias_unit
|
|
||||||
|
|
||||||
abstract scaled_unit<UnitRatio, Unit>
|
abstract scaled_unit<UnitRatio, Unit>
|
||||||
|
|
||||||
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
||||||
abstract alias_unit<Unit, Symbol, PrefixFamily> [[../../framework/units.html#aliased-units]]
|
abstract alias_unit<Unit, Symbol> [[../../framework/units.html#aliased-units]]
|
||||||
abstract named_derived_unit<Dimension, Symbol, PrefixFamily, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
abstract derived_scaled_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
||||||
abstract derived_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
abstract derived_unit [[../../framework/units.html#derived-unnamed-units]]
|
||||||
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
||||||
abstract named_scaled_unit<Symbol, PrefixFamily, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
abstract named_scaled_unit<Symbol, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
||||||
abstract named_unit<Symbol, PrefixFamily> [[../../framework/units.html#base-units]]
|
abstract named_unit<Symbol> [[../../framework/units.html#base-units]]
|
||||||
abstract unit [[../../framework/units.html#derived-unnamed-units]]
|
|
||||||
|
|
||||||
scaled_unit <|- - unit
|
|
||||||
scaled_unit <|- - named_unit
|
scaled_unit <|- - named_unit
|
||||||
scaled_unit <|- - named_scaled_unit
|
scaled_unit <|- - named_scaled_unit
|
||||||
scaled_unit <|- - prefixed_unit
|
scaled_unit <|- - prefixed_unit
|
||||||
scaled_unit <|- - derived_unit
|
scaled_unit <|- - derived_unit
|
||||||
scaled_unit <|- - named_derived_unit
|
scaled_unit <|- - derived_scaled_unit
|
||||||
scaled_unit <|- - alias_unit
|
scaled_unit <|- - alias_unit
|
||||||
scaled_unit <|- - prefixed_alias_unit
|
scaled_unit <|- - prefixed_alias_unit
|
||||||
}
|
}
|
||||||
@enduml
|
@enduml
|
||||||
|
|
||||||
@startuml
|
PlantUML version 1.2022.5(Sat Apr 30 10:55:52 UTC 2022)
|
||||||
skinparam monochrome true
|
|
||||||
skinparam shadowing false
|
|
||||||
skinparam backgroundColor #fcfcfc
|
|
||||||
|
|
||||||
hide members
|
|
||||||
hide circle
|
|
||||||
|
|
||||||
left to right direction
|
|
||||||
|
|
||||||
package Unit <<Frame>> [[../../framework/units.html]] {
|
|
||||||
abstract prefix_family [[../../framework/units.html#prefixed-unit]]
|
|
||||||
abstract no_prefix [[../../framework/units.html#named-scaled-units]]
|
|
||||||
abstract prefix<PrefixFamily, Symbol, Ratio> [[../../framework/units.html#prefixed-unit]]
|
|
||||||
|
|
||||||
prefix_family <|- - no_prefix
|
|
||||||
prefix_family <.. prefix
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
abstract scaled_unit<UnitRatio, Unit>
|
|
||||||
|
|
||||||
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
|
||||||
abstract alias_unit<Unit, Symbol, PrefixFamily> [[../../framework/units.html#aliased-units]]
|
|
||||||
abstract named_derived_unit<Dimension, Symbol, PrefixFamily, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
|
||||||
abstract derived_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
|
||||||
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
|
||||||
abstract named_scaled_unit<Symbol, PrefixFamily, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
|
||||||
abstract named_unit<Symbol, PrefixFamily> [[../../framework/units.html#base-units]]
|
|
||||||
abstract unit [[../../framework/units.html#derived-unnamed-units]]
|
|
||||||
|
|
||||||
scaled_unit <|- - unit
|
|
||||||
scaled_unit <|- - named_unit
|
|
||||||
scaled_unit <|- - named_scaled_unit
|
|
||||||
scaled_unit <|- - prefixed_unit
|
|
||||||
scaled_unit <|- - derived_unit
|
|
||||||
scaled_unit <|- - named_derived_unit
|
|
||||||
scaled_unit <|- - alias_unit
|
|
||||||
scaled_unit <|- - prefixed_alias_unit
|
|
||||||
}
|
|
||||||
@enduml
|
|
||||||
|
|
||||||
PlantUML version 1.2021.12(Tue Oct 05 16:01:58 UTC 2021)
|
|
||||||
(GPL source distribution)
|
(GPL source distribution)
|
||||||
Java Runtime: Java(TM) SE Runtime Environment
|
Java Runtime: Java(TM) SE Runtime Environment
|
||||||
JVM: Java HotSpot(TM) 64-Bit Server VM
|
JVM: Java HotSpot(TM) 64-Bit Server VM
|
||||||
Default Encoding: UTF-8
|
Default Encoding: UTF-8
|
||||||
Language: en
|
Language: en
|
||||||
Country: US
|
Country: US
|
||||||
--></g></svg>
|
-->
|
||||||
|
</g>
|
||||||
|
</svg>
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 14 KiB |
@@ -40,38 +40,22 @@ of a `scaled_unit` class template:
|
|||||||
left to right direction
|
left to right direction
|
||||||
|
|
||||||
package Unit <<Frame>> [[../../framework/units.html]] {
|
package Unit <<Frame>> [[../../framework/units.html]] {
|
||||||
abstract prefix_family [[../../framework/units.html#prefixed-unit]]
|
|
||||||
abstract no_prefix [[../../framework/units.html#named-scaled-units]]
|
|
||||||
abstract prefix<PrefixFamily, Symbol, Ratio> [[../../framework/units.html#prefixed-unit]]
|
|
||||||
|
|
||||||
prefix_family <|-- no_prefix
|
|
||||||
prefix_family <.. prefix
|
|
||||||
|
|
||||||
' prefix_family <.. named_unit
|
|
||||||
' prefix_family <.. named_scaled_unit
|
|
||||||
' prefix_family <.. named_derived_unit
|
|
||||||
' prefix_family <.. alias_unit
|
|
||||||
|
|
||||||
' prefix <.. prefixed_unit
|
|
||||||
' prefix <.. prefixed_alias_unit
|
|
||||||
|
|
||||||
abstract scaled_unit<UnitRatio, Unit>
|
abstract scaled_unit<UnitRatio, Unit>
|
||||||
|
|
||||||
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
abstract prefixed_alias_unit<Unit, Prefix, AliasUnit> [[../../framework/units.html#aliased-units]]
|
||||||
abstract alias_unit<Unit, Symbol, PrefixFamily> [[../../framework/units.html#aliased-units]]
|
abstract alias_unit<Unit, Symbol> [[../../framework/units.html#aliased-units]]
|
||||||
abstract named_derived_unit<Dimension, Symbol, PrefixFamily, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
abstract derived_scaled_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
||||||
abstract derived_unit<Dimension, Unit, Unit...> [[../../framework/units.html#derived-scaled-units]]
|
abstract derived_unit [[../../framework/units.html#derived-unnamed-units]]
|
||||||
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
abstract prefixed_unit<Prefix, Unit> [[../../framework/units.html#prefixed-unit]]
|
||||||
abstract named_scaled_unit<Symbol, PrefixFamily, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
abstract named_scaled_unit<Symbol, Ratio, Unit> [[../../framework/units.html#named-scaled-units]]
|
||||||
abstract named_unit<Symbol, PrefixFamily> [[../../framework/units.html#base-units]]
|
abstract named_unit<Symbol> [[../../framework/units.html#base-units]]
|
||||||
abstract unit [[../../framework/units.html#derived-unnamed-units]]
|
|
||||||
|
|
||||||
scaled_unit <|-- unit
|
|
||||||
scaled_unit <|-- named_unit
|
scaled_unit <|-- named_unit
|
||||||
scaled_unit <|-- named_scaled_unit
|
scaled_unit <|-- named_scaled_unit
|
||||||
scaled_unit <|-- prefixed_unit
|
scaled_unit <|-- prefixed_unit
|
||||||
scaled_unit <|-- derived_unit
|
scaled_unit <|-- derived_unit
|
||||||
scaled_unit <|-- named_derived_unit
|
scaled_unit <|-- derived_scaled_unit
|
||||||
scaled_unit <|-- alias_unit
|
scaled_unit <|-- alias_unit
|
||||||
scaled_unit <|-- prefixed_alias_unit
|
scaled_unit <|-- prefixed_alias_unit
|
||||||
}
|
}
|
||||||
@@ -191,14 +175,11 @@ Those units are the scaled versions of a time dimension's base unit,
|
|||||||
namely second. Those can be defined easily in the library using
|
namely second. Those can be defined easily in the library using
|
||||||
`named_scaled_unit` class template::
|
`named_scaled_unit` class template::
|
||||||
|
|
||||||
struct minute : named_scaled_unit<minute, "min", no_prefix, ratio(60), second> {};
|
struct minute : named_scaled_unit<minute, "min", ratio(60), second> {};
|
||||||
struct hour : named_scaled_unit<hour, "h", no_prefix, ratio(60), minute> {};
|
struct hour : named_scaled_unit<hour, "h", ratio(60), minute> {};
|
||||||
struct day : named_scaled_unit<day, "d", no_prefix, ratio(24), hour> {};
|
struct day : named_scaled_unit<day, "d", ratio(24), hour> {};
|
||||||
|
|
||||||
where `no_prefix` is a special tag type describing that the library should
|
The `ratio` type used in the definition is really similar to ``std::ratio`` but it takes
|
||||||
not allow to define a new prefixed unit that would use this unit as a
|
|
||||||
reference ("kilohours" does not have much sense, right?). The `ratio` type
|
|
||||||
used in the definition is really similar to ``std::ratio`` but it takes
|
|
||||||
an additional ``Exponent`` template parameter that defines the exponent of the ratio.
|
an additional ``Exponent`` template parameter that defines the exponent of the ratio.
|
||||||
Another important difference is the fact that the objects of that class are used
|
Another important difference is the fact that the objects of that class are used
|
||||||
as class NTTPs rather then a type template parameter kind.
|
as class NTTPs rather then a type template parameter kind.
|
||||||
@@ -227,28 +208,26 @@ complete list of all the :term:`SI` prefixes supported by the library::
|
|||||||
|
|
||||||
namespace si {
|
namespace si {
|
||||||
|
|
||||||
struct prefix : prefix_family {};
|
struct yocto : units::prefix<yocto, "y", ratio(1, 1, -24)> {};
|
||||||
|
struct zepto : units::prefix<zepto, "z", ratio(1, 1, -21)> {};
|
||||||
struct yocto : units::prefix<yocto, prefix, "y", ratio(1, 1, -24)> {};
|
struct atto : units::prefix<atto, "a", ratio(1, 1, -18)> {};
|
||||||
struct zepto : units::prefix<zepto, prefix, "z", ratio(1, 1, -21)> {};
|
struct femto : units::prefix<femto, "f", ratio(1, 1, -15)> {};
|
||||||
struct atto : units::prefix<atto, prefix, "a", ratio(1, 1, -18)> {};
|
struct pico : units::prefix<pico, "p", ratio(1, 1, -12)> {};
|
||||||
struct femto : units::prefix<femto, prefix, "f", ratio(1, 1, -15)> {};
|
struct nano : units::prefix<nano, "n", ratio(1, 1, -9)> {};
|
||||||
struct pico : units::prefix<pico, prefix, "p", ratio(1, 1, -12)> {};
|
struct micro : units::prefix<micro, "µ", ratio(1, 1, -6)> {};
|
||||||
struct nano : units::prefix<nano, prefix, "n", ratio(1, 1, -9)> {};
|
struct milli : units::prefix<milli, "m", ratio(1, 1, -3)> {};
|
||||||
struct micro : units::prefix<micro, prefix, "µ", ratio(1, 1, -6)> {};
|
struct centi : units::prefix<centi, "c", ratio(1, 1, -2)> {};
|
||||||
struct milli : units::prefix<milli, prefix, "m", ratio(1, 1, -3)> {};
|
struct deci : units::prefix<deci, "d", ratio(1, 1, -1)> {};
|
||||||
struct centi : units::prefix<centi, prefix, "c", ratio(1, 1, -2)> {};
|
struct deca : units::prefix<deca, "da",ratio(1, 1, 1)> {};
|
||||||
struct deci : units::prefix<deci, prefix, "d", ratio(1, 1, -1)> {};
|
struct hecto : units::prefix<hecto, "h", ratio(1, 1, 2)> {};
|
||||||
struct deca : units::prefix<deca, prefix, "da", ratio(1, 1, 1)> {};
|
struct kilo : units::prefix<kilo, "k", ratio(1, 1, 3)> {};
|
||||||
struct hecto : units::prefix<hecto, prefix, "h", ratio(1, 1, 2)> {};
|
struct mega : units::prefix<mega, "M", ratio(1, 1, 6)> {};
|
||||||
struct kilo : units::prefix<kilo, prefix, "k", ratio(1, 1, 3)> {};
|
struct giga : units::prefix<giga, "G", ratio(1, 1, 9)> {};
|
||||||
struct mega : units::prefix<mega, prefix, "M", ratio(1, 1, 6)> {};
|
struct tera : units::prefix<tera, "T", ratio(1, 1, 12)> {};
|
||||||
struct giga : units::prefix<giga, prefix, "G", ratio(1, 1, 9)> {};
|
struct peta : units::prefix<peta, "P", ratio(1, 1, 15)> {};
|
||||||
struct tera : units::prefix<tera, prefix, "T", ratio(1, 1, 12)> {};
|
struct exa : units::prefix<exa, "E", ratio(1, 1, 18)> {};
|
||||||
struct peta : units::prefix<peta, prefix, "P", ratio(1, 1, 15)> {};
|
struct zetta : units::prefix<zetta, "Z", ratio(1, 1, 21)> {};
|
||||||
struct exa : units::prefix<exa, prefix, "E", ratio(1, 1, 18)> {};
|
struct yotta : units::prefix<yotta, "Y", ratio(1, 1, 24)> {};
|
||||||
struct zetta : units::prefix<zetta, prefix, "Z", ratio(1, 1, 21)> {};
|
|
||||||
struct yotta : units::prefix<yotta, prefix, "Y", ratio(1, 1, 24)> {};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,14 +236,12 @@ domain::
|
|||||||
|
|
||||||
namespace iec80000 {
|
namespace iec80000 {
|
||||||
|
|
||||||
struct binary_prefix : prefix_family {};
|
struct kibi : units::prefix<kibi, "Ki", ratio( 1'024)> {};
|
||||||
|
struct mebi : units::prefix<mebi, "Mi", ratio( 1'048'576)> {};
|
||||||
struct kibi : units::prefix<kibi, binary_prefix, "Ki", ratio( 1'024)> {};
|
struct gibi : units::prefix<gibi, "Gi", ratio( 1'073'741'824)> {};
|
||||||
struct mebi : units::prefix<mebi, binary_prefix, "Mi", ratio( 1'048'576)> {};
|
struct tebi : units::prefix<tebi, "Ti", ratio( 1'099'511'627'776)> {};
|
||||||
struct gibi : units::prefix<gibi, binary_prefix, "Gi", ratio( 1'073'741'824)> {};
|
struct pebi : units::prefix<pebi, "Pi", ratio( 1'125'899'906'842'624)> {};
|
||||||
struct tebi : units::prefix<tebi, binary_prefix, "Ti", ratio( 1'099'511'627'776)> {};
|
struct exbi : units::prefix<exbi, "Ei", ratio(1'152'921'504'606'846'976)> {};
|
||||||
struct pebi : units::prefix<pebi, binary_prefix, "Pi", ratio( 1'125'899'906'842'624)> {};
|
|
||||||
struct exbi : units::prefix<exbi, binary_prefix, "Ei", ratio(1'152'921'504'606'846'976)> {};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +315,7 @@ will result in a different unnamed unit symbol:
|
|||||||
|
|
||||||
where ``kilogram_metre_per_second`` is defined as::
|
where ``kilogram_metre_per_second`` is defined as::
|
||||||
|
|
||||||
struct kilogram_metre_per_second : unit<kilogram_metre_per_second> {};
|
struct kilogram_metre_per_second : derived_unit<kilogram_metre_per_second> {};
|
||||||
|
|
||||||
However, the easiest way to define momentum is just to use the
|
However, the easiest way to define momentum is just to use the
|
||||||
``si::dim_speed`` derived dimension in the recipe:
|
``si::dim_speed`` derived dimension in the recipe:
|
||||||
@@ -385,12 +362,12 @@ ratio in reference to the "metre per second":
|
|||||||
|
|
||||||
Whichever, we choose there will always be someone not happy with our choice.
|
Whichever, we choose there will always be someone not happy with our choice.
|
||||||
|
|
||||||
Thanks to a `derived_unit` class template provided by the library this problem
|
Thanks to a `derived_scaled_unit` class template provided by the library this problem
|
||||||
does not exist at all. With it ``si::kilometre_per_hour`` can be defined as::
|
does not exist at all. With it ``si::kilometre_per_hour`` can be defined as::
|
||||||
|
|
||||||
namespace si {
|
namespace si {
|
||||||
|
|
||||||
struct kilometre_per_hour : derived_unit<kilometre_per_hour, dim_speed, kilometre, hour> {};
|
struct kilometre_per_hour : derived_scaled_unit<kilometre_per_hour, dim_speed, kilometre, hour> {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +377,7 @@ by him/her-self::
|
|||||||
|
|
||||||
namespace si::fps {
|
namespace si::fps {
|
||||||
|
|
||||||
struct knot : named_derived_unit<knot, dim_speed, "knot", no_prefix, nautical_mile, hour> {};
|
struct knot : named_derived_unit<knot, dim_speed, "knot", nautical_mile, hour> {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,10 +8,6 @@ Concepts
|
|||||||
All names defined in this chapter reside in the :any:`units` namespace unless
|
All names defined in this chapter reside in the :any:`units` namespace unless
|
||||||
specified otherwise.
|
specified otherwise.
|
||||||
|
|
||||||
.. concept:: template<typename T> PrefixFamily
|
|
||||||
|
|
||||||
A concept matching a prefix family. Satisfied by all types derived from :class:`prefix_family`.
|
|
||||||
|
|
||||||
.. concept:: template<typename T> Prefix
|
.. concept:: template<typename T> Prefix
|
||||||
|
|
||||||
A concept matching a symbol prefix. Satisfied by all instantiations of :struct:`prefix`.
|
A concept matching a symbol prefix. Satisfied by all instantiations of :struct:`prefix`.
|
||||||
@@ -44,6 +40,11 @@ Concepts
|
|||||||
A concept matching all unit types in the library. Satisfied by all unit types derived
|
A concept matching all unit types in the library. Satisfied by all unit types derived
|
||||||
from the instantiation of :class:`scaled_unit`.
|
from the instantiation of :class:`scaled_unit`.
|
||||||
|
|
||||||
|
.. concept:: template<typename T> NamedUnit
|
||||||
|
|
||||||
|
A concept matching all unit types that have an atomic text symbol that can be used to aggregate it with
|
||||||
|
other named units to form a final symbol of a derived unit.
|
||||||
|
|
||||||
.. concept:: template<typename U, typename D> UnitOf
|
.. concept:: template<typename U, typename D> UnitOf
|
||||||
|
|
||||||
A concept matching only units of a specified dimension. Satisfied by all unit types that
|
A concept matching only units of a specified dimension. Satisfied by all unit types that
|
||||||
|
@@ -1,11 +1,5 @@
|
|||||||
Prefixes
|
Prefixes
|
||||||
========
|
========
|
||||||
|
|
||||||
.. doxygenstruct:: units::prefix_family
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. doxygenstruct:: units::no_prefix
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. doxygenstruct:: units::prefix
|
.. doxygenstruct:: units::prefix
|
||||||
:members:
|
:members:
|
||||||
|
@@ -4,9 +4,6 @@ Units
|
|||||||
.. doxygenstruct:: units::scaled_unit
|
.. doxygenstruct:: units::scaled_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. doxygenstruct:: units::unit
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. doxygenstruct:: units::named_unit
|
.. doxygenstruct:: units::named_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
@@ -19,7 +16,7 @@ Units
|
|||||||
.. doxygenstruct:: units::derived_unit
|
.. doxygenstruct:: units::derived_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. doxygenstruct:: units::named_derived_unit
|
.. doxygenstruct:: units::derived_scaled_unit
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. doxygenstruct:: units::alias_unit
|
.. doxygenstruct:: units::alias_unit
|
||||||
|
@@ -22,7 +22,7 @@ Defining a New Unit
|
|||||||
My working desk is of ``180 cm x 60 cm`` which gives an area of ``0.3 m²``. I would like to
|
My working desk is of ``180 cm x 60 cm`` which gives an area of ``0.3 m²``. I would like to
|
||||||
make it a unit of area for my project::
|
make it a unit of area for my project::
|
||||||
|
|
||||||
struct desk : named_scaled_unit<desk, "desk", no_prefix, ratio(3, 10), si::square_metre> {};
|
struct desk : named_scaled_unit<desk, "desk", ratio(3, 10), si::square_metre> {};
|
||||||
|
|
||||||
With the above I can define a quantity with the area of ``2 desks``::
|
With the above I can define a quantity with the area of ``2 desks``::
|
||||||
|
|
||||||
@@ -56,28 +56,22 @@ In case I would like to check how much area ``6 desks`` take in SI units::
|
|||||||
Enabling a Unit for Prefixing
|
Enabling a Unit for Prefixing
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
In case I decide it is reasonable to express my desks with SI prefixes the only thing I have
|
In case I decide it is reasonable to express my desks with SI prefixes, I can define
|
||||||
to change in the above code is to replace `no_prefix` with `isq::si::prefix`::
|
a new unit named ``kilodesk``::
|
||||||
|
|
||||||
struct desk : named_scaled_unit<desk, "desk", si::prefix, ratio(3, 10), si::square_metre> {};
|
|
||||||
|
|
||||||
Now I can define a new unit named ``kilodesk``::
|
|
||||||
|
|
||||||
struct kilodesk : prefixed_unit<kilodesk, si::kilo, desk> {};
|
struct kilodesk : prefixed_unit<kilodesk, si::kilo, desk> {};
|
||||||
static_assert(3_d * 1000 == si::area<kilodesk>(3));
|
static_assert(3_d * 1000 == si::area<kilodesk>(3));
|
||||||
|
|
||||||
But maybe SI prefixes are not good for me. Maybe I always pack ``6`` desks into one package
|
But maybe SI prefixes are not good for me. Maybe I always pack ``6`` desks into one package
|
||||||
for shipment and ``40`` such packages fit into my lorry. To express this with prefixes a new
|
for shipment and ``40`` such packages fit into my lorry. To express this new prefix definitions
|
||||||
prefix family and prefixes are needed::
|
are needed::
|
||||||
|
|
||||||
struct shipping_prefix : prefix_family {};
|
struct package : prefix<package, "pkg", ratio(6)> {};
|
||||||
|
struct lorry : prefix<lorry, "lorry", ratio(6 * 40)> {};
|
||||||
struct package : prefix<package, shipping_prefix, "pkg", ratio(6)> {};
|
|
||||||
struct lorry : prefix<lorry, shipping_prefix, "lorry", ratio(6 * 40)> {};
|
|
||||||
|
|
||||||
Now we can use it for our unit::
|
Now we can use it for our unit::
|
||||||
|
|
||||||
struct desk : named_scaled_unit<desk, "desk", shipping_prefix, ratio(3, 10), si::square_metre> {};
|
struct desk : named_scaled_unit<desk, "desk", ratio(3, 10), si::square_metre> {};
|
||||||
struct packagedesk : prefixed_unit<packagedesk, package, desk> {};
|
struct packagedesk : prefixed_unit<packagedesk, package, desk> {};
|
||||||
struct lorrydesk : prefixed_unit<lorrydesk, lorry, desk> {};
|
struct lorrydesk : prefixed_unit<lorrydesk, lorry, desk> {};
|
||||||
|
|
||||||
@@ -111,14 +105,14 @@ rate of wood during production I need to define a new derived dimension together
|
|||||||
coherent unit::
|
coherent unit::
|
||||||
|
|
||||||
// coherent unit must apply to the system rules (in this case SI)
|
// coherent unit must apply to the system rules (in this case SI)
|
||||||
struct square_metre_per_second : unit<square_metre_per_second> {};
|
struct square_metre_per_second : derived_unit<square_metre_per_second> {};
|
||||||
|
|
||||||
// new derived dimensions
|
// new derived dimensions
|
||||||
struct dim_desk_rate : derived_dimension<dim_desk_rate, square_metre_per_second,
|
struct dim_desk_rate : derived_dimension<dim_desk_rate, square_metre_per_second,
|
||||||
exponent<si::dim_area, 1>, exponent<si::dim_time, -1>> {};
|
exponent<si::dim_area, 1>, exponent<si::dim_time, -1>> {};
|
||||||
|
|
||||||
// our unit of interest for a new derived dimension
|
// our unit of interest for a new derived dimension
|
||||||
struct desk_per_hour : derived_unit<desk_per_hour, dim_desk_rate, desk, si::hour> {};
|
struct desk_per_hour : derived_scaled_unit<desk_per_hour, dim_desk_rate, desk, si::hour> {};
|
||||||
|
|
||||||
// a quantity of our dimension
|
// a quantity of our dimension
|
||||||
template<UnitOf<dim_desk_rate> U, Representation Rep = double>
|
template<UnitOf<dim_desk_rate> U, Representation Rep = double>
|
||||||
@@ -147,7 +141,7 @@ a customer's office I would need a unit called ``person_per_desk`` of a new deri
|
|||||||
dimension. However, our library does not know what a ``person`` is. For this I need to
|
dimension. However, our library does not know what a ``person`` is. For this I need to
|
||||||
define a new base dimension, its units, quantity helper, concept, and UDLs::
|
define a new base dimension, its units, quantity helper, concept, and UDLs::
|
||||||
|
|
||||||
struct person : named_unit<person, "person", no_prefix> {};
|
struct person : named_unit<person, "person"> {};
|
||||||
struct dim_people : base_dimension<"people", person> {};
|
struct dim_people : base_dimension<"people", person> {};
|
||||||
|
|
||||||
template<UnitOf<dim_people> U, Representation Rep = double>
|
template<UnitOf<dim_people> U, Representation Rep = double>
|
||||||
@@ -162,12 +156,12 @@ define a new base dimension, its units, quantity helper, concept, and UDLs::
|
|||||||
|
|
||||||
With the above we can now define a new derived dimension::
|
With the above we can now define a new derived dimension::
|
||||||
|
|
||||||
struct person_per_square_metre : unit<person_per_square_metre> {};
|
struct person_per_square_metre : derived_unit<person_per_square_metre> {};
|
||||||
struct dim_occupancy_rate : derived_dimension<dim_occupancy_rate, person_per_square_metre,
|
struct dim_occupancy_rate : derived_dimension<dim_occupancy_rate, person_per_square_metre,
|
||||||
exponent<dim_people, 1>,
|
exponent<dim_people, 1>,
|
||||||
exponent<si::dim_area, -1>> {};
|
exponent<si::dim_area, -1>> {};
|
||||||
|
|
||||||
struct person_per_desk : derived_unit<person_per_desk, dim_occupancy_rate, person, desk> {};
|
struct person_per_desk : derived_scaled_unit<person_per_desk, dim_occupancy_rate, person, desk> {};
|
||||||
|
|
||||||
template<UnitOf<dim_occupancy_rate> U, Representation Rep = double>
|
template<UnitOf<dim_occupancy_rate> U, Representation Rep = double>
|
||||||
using occupancy_rate = quantity<dim_occupancy_rate, U, Rep>;
|
using occupancy_rate = quantity<dim_occupancy_rate, U, Rep>;
|
||||||
@@ -211,8 +205,8 @@ Such units do not share their references with base units of other systems:
|
|||||||
|
|
||||||
namespace fps {
|
namespace fps {
|
||||||
|
|
||||||
struct foot : named_unit<foot, "ft", no_prefix> {};
|
struct foot : named_unit<foot, "ft"> {};
|
||||||
struct yard : named_scaled_unit<yard, "yd", no_prefix, ratio(3), foot> {};
|
struct yard : named_scaled_unit<yard, "yd", ratio(3), foot> {};
|
||||||
|
|
||||||
struct dim_length : base_dimension<"L", foot> {};
|
struct dim_length : base_dimension<"L", foot> {};
|
||||||
|
|
||||||
@@ -231,7 +225,7 @@ different systems:
|
|||||||
|
|
||||||
namespace si {
|
namespace si {
|
||||||
|
|
||||||
struct metre : named_unit<metre, "m", units::isq::si::prefix> {};
|
struct metre : named_unit<metre, "m"> {};
|
||||||
struct kilometre : prefixed_unit<kilometre, units::isq::si::kilo, metre> {};
|
struct kilometre : prefixed_unit<kilometre, units::isq::si::kilo, metre> {};
|
||||||
|
|
||||||
struct dim_length : base_dimension<"L", metre> {};
|
struct dim_length : base_dimension<"L", metre> {};
|
||||||
@@ -241,8 +235,8 @@ different systems:
|
|||||||
|
|
||||||
namespace fps {
|
namespace fps {
|
||||||
|
|
||||||
struct foot : named_scaled_unit<foot, "ft", no_prefix, ratio(3'048, 1'000, -1), metre> {};
|
struct foot : named_scaled_unit<foot, "ft", ratio(3'048, 1'000, -1), metre> {};
|
||||||
struct yard : named_scaled_unit<yard, "yd", no_prefix, ratio(3), foot> {};
|
struct yard : named_scaled_unit<yard, "yd", ratio(3), foot> {};
|
||||||
|
|
||||||
struct dim_length : base_dimension<"L", foot> {};
|
struct dim_length : base_dimension<"L", foot> {};
|
||||||
|
|
||||||
@@ -300,7 +294,7 @@ the library always keeps the ratio relative to the primary reference unit
|
|||||||
which in this case is ``si::metre``. This results in much bigger ratios
|
which in this case is ``si::metre``. This results in much bigger ratios
|
||||||
and in case of some units may result with a problem of limited resolution
|
and in case of some units may result with a problem of limited resolution
|
||||||
of ``std::int64_t`` used to store numerator, denominator, and exponent
|
of ``std::int64_t`` used to store numerator, denominator, and exponent
|
||||||
values of ratio. For example the ``si::fps::qubic_foot`` already has the
|
values of ratio. For example the ``si::fps::cubic_foot`` already has the
|
||||||
ratio of ``ratio{55306341, 1953125, -3}``. In case of more complicated
|
ratio of ``ratio{55306341, 1953125, -3}``. In case of more complicated
|
||||||
conversion ratio we can overflow `ratio` and get a compile-time error.
|
conversion ratio we can overflow `ratio` and get a compile-time error.
|
||||||
In such a situation the standalone system may be a better choice here.
|
In such a situation the standalone system may be a better choice here.
|
||||||
|
Reference in New Issue
Block a user