{"id":88910,"date":"2019-07-26T16:22:22","date_gmt":"2019-07-26T08:22:22","guid":{"rendered":"http:\/\/4563.org\/?p=88910"},"modified":"2019-07-26T16:22:22","modified_gmt":"2019-07-26T08:22:22","slug":"f2py-%e5%b0%86-c-%e8%af%ad%e8%a8%80%e7%bc%96%e8%af%91%e6%88%90-so-%e6%96%87%e4%bb%b6%e5%90%8e%e8%bf%90%e8%a1%8c%e5%af%b9%e8%be%93%e5%85%a5%e6%98%af%e4%b8%8d%e6%98%af%e5%be%88%e6%95%8f%e6%84%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=88910","title":{"rendered":"f2py \u5c06 C \u8bed\u8a00\u7f16\u8bd1\u6210 so \u6587\u4ef6\u540e\u8fd0\u884c\u5bf9\u8f93\u5165\u662f\u4e0d\u662f\u5f88\u654f\u611f\u5462\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  f2py \u5c06 C \u8bed\u8a00\u7f16\u8bd1\u6210 so \u6587\u4ef6\u540e\u8fd0\u884c\u5bf9\u8f93\u5165\u662f\u4e0d\u662f\u5f88\u654f\u611f\u5462\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : douglas1997 <\/span>  <span><i><\/i> 53<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6d41\u7a0b\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<ol>\n<li>\u5148\u5199\u4e86\u4e00\u4e2a C \u8bed\u8a00\u51fd\u6570\uff0c\u63a5\u53d7\u7684\u90fd\u662f\u6307\u9488\u5f62\u5f0f\u7684\u8f93\u5165\uff08 2 \u4e2a int \u7c7b\u578b\u7684\u6307\u9488\uff09<\/li>\n<li>\u7136\u540e\u5199\u4e86\u4e00\u4e2a f2py \u7684\u811a\u672c\uff0c\u5c06 C \u8bed\u8a00\u51fd\u6570\u7f16\u8bd1\u6210 python \u80fd import \u7684\u5e93<\/li>\n<li>\u5728 python \u4e2d\u8fd0\u884c\u8fd9\u4e2a\u5e93\uff0c\u5728\u5c11\u91cf\u6570\u636e\u7684\u60c5\u51b5\u4e0b\uff08 10x512x512 int \uff09\u7684\u60c5\u51b5\u4e0b\u6b63\u5e38\uff0c\u5728\u5927\u91cf\u8f93\u5165\u7684\u60c5\u51b5\u4e0b segmentation fault \uff08 100x512x512 \uff09<\/li>\n<\/ol>\n<p>\u8fd9\u662f\u56e0\u4e3a f2py \u6253\u5305\u7684\u95ee\u9898\u8fd8\u662f\u56e0\u4e3a C \u4ee3\u7801\u672c\u8eab\u7684\u95ee\u9898\u5462\uff0c\u9759\u6001\u8bed\u8a00\u68c0\u67e5\u8981\u7206\u70b8\u4e86\u3002\u3002= =<\/p>\n<p>\u5c06 C \u8bed\u8a00\u8fd0\u884c\u524d\u51e0\u884c\u76f4\u63a5 return 0\uff0c\u53d1\u73b0\u8fd8\u662f\u4f1a segmentation fault\uff0c\u4e0d\u77e5\u9053\u662f\u4e3a\u5565\u4e86\uff0cf2py \u811a\u672c\u5982\u4e0b<\/p>\n<pre><code>python module region_growing interface     subroutine grow(m, n, p, img, seg, si, sj, sk, t)         intent(c) grow         intent(c)          integer intent(hide), depend(img) :: m = shape(img,0)         integer intent(hide), depend(img) :: n = shape(img,1)         integer intent(hide), depend(img) :: p = shape(img,2)          integer intent(in)                           :: img(m,n,p)         integer(kind=1) intent(in)              :: seg(m,n,p)         integer intent(in)                           :: si, sj, sk, t     end subroutine grow end interface end python module region_growing <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"574590\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : douglas1997 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f46\u662f\u5176\u5b9e\u8f93\u5165\u672c\u8d28\u4e0a\u662f\u5dee\u4e0d\u591a\u7684\uff0c\u6211\u4e2a\u4eba\u611f\u89c9\u66f4\u591a\u7684\u53ef\u80fd\u662f C \u8bed\u8a00\u7684 bug\uff0c\u800c\u4e0d\u662f f2py \u7684\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"574591\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : douglas1997 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u89e3\u51b3\u4e86\uff0c\u662f\u56e0\u4e3a\u6808\u7a7a\u95f4\u4e0d\u8db3\u5bfc\u81f4\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>f2py \u5c06 C \u8bed\u8a00\u7f16\u8bd1\u6210 so&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/88910"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=88910"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/88910\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88910"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}