{"id":3040,"date":"2020-04-25T13:43:01","date_gmt":"2020-04-25T04:43:01","guid":{"rendered":"https:\/\/www.ktech.biz\/jp\/?p=3040"},"modified":"2021-01-13T19:08:46","modified_gmt":"2021-01-13T10:08:46","slug":"pascal","status":"publish","type":"post","link":"https:\/\/www.ktech.biz\/jp\/manual-api\/pascal\/","title":{"rendered":"XLPack API: Pascal \u4f7f\u7528\u4f8b"},"content":{"rendered":"<h3>Pascal\u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059<\/h3>\n<p>Pascal (Delphi \u307e\u305f\u306f Free Pascal) \u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306b\u306fDLL\u3092\u76f4\u63a5\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059.<br \/>\nSDK\u306b\u306fDLL\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u30d7\u30ed\u30b0\u30e9\u30e0xlpack.pas\u304c\u5165\u3063\u3066\u3044\u307e\u3059. \u3053\u308c\u3092\u4f7f\u3046\u3068, \u547c\u3073\u51fa\u3057\u30d7\u30ed\u30b0\u30e9\u30e0\u306f &#8220;uses XLPack;&#8221; \u3068\u5ba3\u8a00\u3059\u308b\u3060\u3051\u3067DLL\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u8a73\u7d30\u3092\u6c17\u306b\u305b\u305a\u7d44\u8fbc\u307f\u95a2\u6570\u306e\u3088\u3046\u306b\u7c21\u5358\u306bXLPack\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059.<br \/>\n\u4fc2\u6570\u884c\u5217a, \u53f3\u8fba\u884c\u5217b\u3068\u3082\u306b1\u6b21\u5143\u914d\u5217\u3092\u4f7f\u3044\u307e\u3059.<\/p>\n<h3>Pascal\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b (\u4f8b\u984c(1))<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-pascal\" data-lang=\"Pascal\"><code>program test_xlpack_1;\r\n\r\nuses XLPack;\r\n\r\nprocedure test_dgesv;\r\nconst\r\n    n = 3; lda = n; ldb = n;\r\n    a: array[1..n*n] of Double =\r\n        (0.2,  -0.32, -0.8,\r\n         -0.11, 0.81, -0.92,\r\n         -0.93, 0.37, -0.29);\r\n    b: array[1..n] of Double =\r\n        (-0.3727, 0.4319, -1.4247);\r\nvar\r\n    ipiv: array[1..n] of Integer;\r\n    info: Integer;\r\nbegin\r\n    Dgesv(n, lda, a, ipiv, ldb, b, info);\r\n    Writeln('x =');\r\n    Writeln(b[1], '  ', b[2], '  ', b[3]);\r\n    Writeln('info = ', info);\r\nend;\r\n\r\nbegin\r\n    test_dgesv;\r\nend.<\/code><\/pre>\n<\/div>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\"><code>x =\r\n 8.60000000000000E-0001   6.40000000000000E-0001   5.10000000000000E-0001\r\ninfo = 0<\/code><\/pre>\n<\/div>\n<h3>Pascal\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b (\u4f8b\u984c(2))<\/h3>\n<p>\u4f8b\u984c(2)\u3067\u306ff(x)\u306e\u7a4d\u5206\u3092qk15\u3092\u4f7f\u3063\u3066\u6c42\u3081\u307e\u3059. qk15\u306ff(x)\u3092\u5b9a\u7fa9\u3059\u308b\u5916\u90e8\u95a2\u6570\u3092\u5fc5\u8981\u3068\u3057\u307e\u3059. \u5916\u90e8\u95a2\u6570\u306fDelphi\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d, qk15\u306f\u5fc5\u8981\u306a\u3068\u304d\u306b\u305d\u308c\u3092\u547c\u3073\u51fa\u3057\u307e\u3059.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-pascal\" data-lang=\"Pascal\"><code>program test_xlpack_2;\r\n\r\nuses XLPack;\r\n\r\nfunction f(x: Double): Double;\r\nbegin\r\n    f := 1\/(1 + x*x);\r\nend;\r\n\r\nprocedure test_qk15;\r\nvar\r\n    a, b, result, abserr: Double;\r\nbegin\r\n    a := 0; b := 4;\r\n    Qk15(f, a, b, result, abserr);\r\n    Writeln('result = ', result, ', abserr = ', abserr);\r\nend;\r\n\r\nbegin\r\n    test_qk15;\r\nend.<\/code><\/pre>\n<\/div>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\"><code>result =  1.32581766136379E+0000, abserr =  1.48272394121622E-0003<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Pascal\u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059 Pascal (Delphi \u307e\u305f\u306f Free Pascal) \u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306b\u306fDLL\u3092\u76f4\u63a5\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059. SDK\u306b\u306fDLL\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u30d7\u30ed\u30b0\u30e9\u30e0xlp [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16],"tags":[],"class_list":["post-3040","post","type-post","status-publish","format-standard","hentry","category-manual-api"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts\/3040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/comments?post=3040"}],"version-history":[{"count":3,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts\/3040\/revisions"}],"predecessor-version":[{"id":3223,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts\/3040\/revisions\/3223"}],"wp:attachment":[{"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/media?parent=3040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/categories?post=3040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/tags?post=3040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}