看板 Mathematica 關於我們 聯絡資訊
當我是要做 data={{1,2,3},{4,5,6}} fun=Compile[{{x,_Real,2}},x[[2,1]]+1]; fun[data]這樣可以work 得很好 但是當我 data={{1,2,3},{4,5}} 就出現 CompiledFunction::cfta: "Argument {{1,2,3},{4,5}} at position 1 should be a rank 2 tensor of \!\(\"machine-size real number\"\)s" 要怎麼compile 有不同長度的List?? 謝謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.41.45
chungyuandye:fun=Compile[{{x,_Real,2}},x[[2,1]]+1]; 01/18 17:57
chungyuandye:{{x,_Real,2}} 01/18 17:57
抱歉~~這邊是我打錯 謝謝樓上提醒 ※ 編輯: vacahung 來自: 140.112.41.45 (01/19 15:02)