{"id":38,"date":"2024-09-10T07:28:02","date_gmt":"2024-09-09T23:28:02","guid":{"rendered":"http:\/\/chaixiangyu.cn\/?p=38"},"modified":"2024-09-11T21:40:19","modified_gmt":"2024-09-11T13:40:19","slug":"armadillo%e4%bd%bf%e7%94%a8%e4%bb%8b%e7%bb%8d%ef%bc%88%e5%8d%81%e4%b8%89%ef%bc%89%ef%bc%9a%e5%b8%b8%e9%87%8f","status":"publish","type":"post","link":"https:\/\/chaixiangyu.cn\/?p=38","title":{"rendered":"Armadillo\u4f7f\u7528\u4ecb\u7ecd\uff08\u5341\u4e09\uff09\uff1a\u5e38\u91cf"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u5e38\u91cf (pi, inf, \u5149\u901f, \u2026)<\/h2>\n\n\n\n<p><code>datum::pi<\/code> \u03c0, the ratio of any circle&#8217;s circumference to its diameter \u5706\u5468\u7387<br><code>datum::inf<\/code> \u221e, infinity \u65e0\u7a77\u5927<br><code>datum::nan<\/code> \u201cnot a number\u201d (NaN); <strong>\u6ce8\u610f:<\/strong> NaN is not equal to anything, even itself \u975e\u6570\u5b57<\/p>\n\n\n\n<p><code>datum::e<\/code> base of the natural logarithm \u81ea\u7136\u5e38\u6570<br><code>datum::sqrt2<\/code> square root of 2<br><code>datum::sqrt2pi<\/code> square root of 2\u03c0<br><code>datum::eps<\/code> machine epsilon: the difference between 1 and the value least greater than 1 that is representable (type and machine dependent)<\/p>\n\n\n\n<p><code>datum::log_min<\/code> log of minimum non-zero value (type and machine dependent)<br><code>datum::log_max<\/code> log of maximum value (type and machine dependent)<br><code>datum::euler<\/code> Euler&#8217;s constant, aka Euler-Mascheroni constant<\/p>\n\n\n\n<p><code>datum::gratio<\/code> golden ratio<br><code>datum::m_u<\/code> atomic mass constant (in kg)<br><code>datum::N_A<\/code> Avogadro constant<\/p>\n\n\n\n<p><code>datum::k<\/code> Boltzmann constant (in joules per kelvin)<br><code>datum::k_evk<\/code> Boltzmann constant (in eV\/K)<br><code>datum::a_0<\/code> Bohr radius (in meters)<\/p>\n\n\n\n<p><code>datum::mu_B<\/code> Bohr magneton<br><code>datum::Z_0<\/code> characteristic impedance of vacuum (in ohms)<br><code>datum::G_0<\/code> conductance quantum (in siemens)<\/p>\n\n\n\n<p><code>datum::k_e<\/code> Coulomb&#8217;s constant (in meters per farad)<br><code>datum::eps_0<\/code> electric constant (in farads per meter)<br><code>datum::m_e<\/code> \u7535\u5b50\u8d28\u91cf (in kg)<\/p>\n\n\n\n<p><code>datum::eV<\/code> \u7535\u5b50\u4f0f (in joules)<br><code>datum::ec<\/code> \u5143\u7535\u8377 (in coulombs)<br><code>datum::F<\/code> \u6cd5\u62c9\u7b2c\u5e38\u6570 (in coulombs)<\/p>\n\n\n\n<p><code>datum::alpha<\/code> fine-structure constant<br><code>datum::alpha_inv<\/code> inverse fine-structure constant<br><code>datum::K_J<\/code> \u7ea6\u745f\u592b\u900a\u5e38\u6570<\/p>\n\n\n\n<p><code>datum::mu_0<\/code> magnetic constant (in henries per meter)<br><code>datum::phi_0<\/code> magnetic flux quantum (in webers)<br><code>datum::R<\/code> \u6469\u5c14\u6c14\u4f53\u5e38\u6570 (in joules per mole kelvin)<\/p>\n\n\n\n<p><code>datum::G<\/code> \u725b\u987f\u4e07\u6709\u5f15\u529b\u5e38\u6570 (in newton square meters per kilogram squared)<br><code>datum::h<\/code> \u666e\u6717\u514b\u5e38\u6570 (in joule seconds)<br><code>datum::h_bar<\/code> Planck constant over 2 pi, aka reduced Planck constant (in joule seconds)<\/p>\n\n\n\n<p><code>datum::m_p<\/code> \u8d28\u5b50\u8d28\u91cf (kg)<br><code>datum::R_inf<\/code> Rydberg constant (in reciprocal meters)<br><code>datum::c_0<\/code> \u771f\u7a7a\u4e2d\u5149\u901f (m\/s)<\/p>\n\n\n\n<p><code>datum::sigma<\/code> Stefan-Boltzmann constant \u65af\u5fd2\u85e9-\u73bb\u8033\u5179\u66fc\u5e38\u6570,\u03c3=5.67\u00d710<sup>-8<\/sup>W\/(m<sup>2<\/sup>\u00b7K<sup>4<\/sup>)<br><code>datum::R_k<\/code> von Klitzing constant (in ohms)<br><code>datum::b<\/code> Wien wavelength displacement law constant<br>The constants are stored in the <em>Datum\\<\/em> class, where type is either <em>float<\/em> or <em>double<\/em>;<br>for convenience, <em>Datum\\<\/em> is typedefed as <em>datum<\/em>, and <em>Datum\\<\/em> is typedefed as <em>fdatum<\/em><\/p>\n\n\n\n<p><strong>\u6ce8\u610f:<\/strong> <code>datum::nan<\/code> is not equal to anything, even itself; to check whether a scalar <code>x<\/code> is finite, use <code>std::isfinite(x)<\/code><\/p>\n\n\n\n<p>The physical constants were mainly taken from NIST 2018 CODATA values, and some from WolframAlpha (as of 2009-06-23)<\/p>\n\n\n\n<p>\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cout &lt;&lt; \"2.0 * pi = \" &lt;&lt; 2.0 * datum::pi &lt;&lt; endl;\n\ncout &lt;&lt; \"speed of light = \" &lt;&lt; datum::c_0 &lt;&lt; endl;\n\ncout &lt;&lt; \"log_max for floats = \";\ncout &lt;&lt; fdatum::log_max &lt;&lt; endl;\n\ncout &lt;&lt; \"log_max for doubles = \";\ncout &lt;&lt; datum::log_max &lt;&lt; endl;<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Armadillo version: 9.900.1 (Nocturnal Misbehaviour)\n2.0 * pi = 6.28319\nspeed of light = 2.99792e+008\nlog_max for floats = 88.7228\nlog_max for doubles = 709.783\n\u8bf7\u6309\u4efb\u610f\u952e\u7ee7\u7eed. . .<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5e38\u91cf (pi, inf, \u5149\u901f, \u2026) datum::pi \u03c0, the ratio of any circl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-algorithm"],"_links":{"self":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=38"}],"version-history":[{"count":1,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}