你好,
新年快樂!
有沒有辦法讓處理速度更快?我嘗試使用它對於每個,而且確實節省了一些時間。 我想弄清楚是否可以使用優化列公式
這是我的 for 迴圈。 運行超過 1M 次迭代需要很長時間。 有什麼建議嗎?
Names Default To Here( 1 );
dt = Current Data Table();
start = Tick Seconds();
dt << Clear Row States;
dt << Clear Column Selection();
//Does Table Variable Exist?
var = dt << Get Table Variable( "YieldIteration" );
varnum = Num( var );
If( var == "",
dt << Set Table Variable( "YieldIteration", 1 ),
dt << Set Table Variable( "YieldIteration", varnum + 1 )
);
var = dt << Get Table Variable( "YieldIteration" );
varnum = Num( var );
dt << Clear Column Selection;
allcol = dt << get column names( string );
dt << select column group( "Tests" );
selcol = dt << get selected columns;
nselcol = N Items( selcol );
FUDDnum = Round( nselcol * 0.17 );
dt << Clear Column Selection();
// function to get spec limits
Spec = Function( {colno},
colspec = Column( colno ) << get property( "Spec Limits" );
lsl = colspec["LSL"];
usl = colspec["USL"];
L = Matrix( {lsl, usl} );
);
// set up pareto columns
PassCol = New Column( "PassFail" || var, Numeric, <<SET each="" value=""> L[2],
PassCol[jj] = 0;
If(
ParetoCol[jj] != ".", ParetoCol[jj] = ParetoCol[jj] || ", " || selcolchar,
ParetoCol[jj] == ".", ParetoCol[jj] = selcolchar
);
NumFail[jj] = NumFail[jj] + 1;
);
If( NumFail[jj] >= FUDDnum,
ParetoCol[jj] = "FUDD"
);
);
);
);
dt << end data update;
end2 = Tick Seconds();
runtimetoshow = end2 - start;
formated = Format( runtimetoshow, "min:s", 12 );
Caption( "Runtime: " || formated || "min" );</SET>謝謝。