0
我想在列表的列表中執行什麼是Rcpp中有效的並行lapply,有效地從列表中移除元素並使用它們進行計算。 基本上做什麼Rcpp並行,但與列表,而不是數字向量。在Rcpp中,如果通過數字索引完成,則會獲取/設置線程安全列表元素?訪問/設置Rcpp :: List線程中的元素是否安全?
因爲我想下面要做的事情型僞代碼:
List original = // created somewhere else,
List results = List(original.size());
// Is this function thread safe?
auto func = [original&, results&](int i) {
List data = original[i];
// Calculate a new List, stuff
results[i] = stuff;
};
```