{"id":3036,"date":"2020-04-25T13:39:05","date_gmt":"2020-04-25T04:39:05","guid":{"rendered":"https:\/\/www.ktech.biz\/jp\/?p=3036"},"modified":"2020-07-30T17:11:09","modified_gmt":"2020-07-30T08:11:09","slug":"cs","status":"publish","type":"post","link":"https:\/\/www.ktech.biz\/jp\/manual-api\/cs\/","title":{"rendered":"XLPack API: C#\u4f7f\u7528\u4f8b"},"content":{"rendered":"<h3>C#\u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059<\/h3>\n<p>C#\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.cs\u304c\u5165\u3063\u3066\u3044\u307e\u3059. \u3053\u308c\u3092\u4f7f\u3046\u3068, \u547c\u3073\u51fa\u3057\u30d7\u30ed\u30b0\u30e9\u30e0\u306f &#8220;using static 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\u306f2\u6b21\u5143\u914d\u5217, \u53f3\u8fba\u884c\u5217b\u306f1\u6b21\u5143\u914d\u5217\u3092\u4f7f\u3044\u307e\u3059.<\/p>\n<h3>C#\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b (\u4f8b\u984c(1))<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>using System;\nusing System.IO;\nusing static XLPack;\n\npublic class Test\n{\n\nstatic void Test_dgesv()\n{\n    const int n = 3;\n    double[,] a =\n        {{ 0.2, -0.32, -0.8 },\n         { -0.11, 0.81, -0.92 },\n         { -0.93, 0.37, -0.29 }};\n    double[] b = { -0.3727, 0.4319, -1.4247 };\n    int[] ipiv = new int[n];\n    int info;\n\n    dgesv(n, a, ipiv, b, out info);\n    Console.Write(\"x = {0}  {1}  {2}\\n\", b[0], b[1], b[2]);\n    Console.Write(\"info = {0}\\n\", info);\n}\n\npublic static int Main(string[] args)\n{\n    Test_dgesv();\n    return 0;\n}\n\n}<\/code><\/pre>\n<\/div>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plane\"><code>x = 0.86  0.64  0.51\ninfo = 0\n<\/code><\/pre>\n<\/div>\n<h3>C#\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\u306fC#\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-csharp\" data-lang=\"C#\"><code>using System;\nusing System.IO;\nusing static XLPack;\n\npublic class Test\n{\n\nstatic double f_qk15(double x)\n{\n\treturn 1\/(1 + x*x);\n}\n\nstatic void Test_qk15()\n{\n\tdouble a, b, result, abserr;\n\n\ta = 0; b = 4;\n\tqk15(f_qk15, a, b, out result, out abserr);\n\tConsole.Write(\"result = {0}, abserr = {1}\\n\", result, abserr);\n}\n\npublic static int Main(string[] args)\n{\n    Test_qk15();\n    return 0;\n}\n\n}<\/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.32581766136379, abserr = 0.00148272394121622<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>C#\u304b\u3089XLPack\u3092\u547c\u3073\u51fa\u3059 C#\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\u30e0xlpack.cs\u304c\u5165\u3063\u3066\u3044\u307e\u3059. \u3053\u308c\u3092\u4f7f\u3046\u3068, \u547c\u3073\u51fa\u3057\u30d7\u30ed\u30b0\u30e9\u30e0\u306f  [&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-3036","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\/3036","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=3036"}],"version-history":[{"count":1,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts\/3036\/revisions"}],"predecessor-version":[{"id":3037,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/posts\/3036\/revisions\/3037"}],"wp:attachment":[{"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/media?parent=3036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/categories?post=3036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktech.biz\/jp\/wp-json\/wp\/v2\/tags?post=3036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}