差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
cgfs:filled_triangles [2025/12/12 15:33] – Replace repeated use std::copy with std::merge and overused auto with explicit type declaration freemikancgfs:filled_triangles [2025/12/12 15:59] (現在) – Replace an overused back_inserter freemikan
行 119: 行 119:
     Interpolate(i0, P0.x, i2, P2.x, x02.begin());     Interpolate(i0, P0.x, i2, P2.x, x02.begin());
  
-    x01.pop_back(); // remove an overlapping point at x01.back and x12.front+ // remove an overlapping point at x01.back and x12.front 
 +    x01.pop_back();
  
-    std::vector<float> x012; +    std::vector<float> x012(x01.size() + x12.size())
-    std::merge(x01.begin(), x01.end(), x12.begin(), x12.end(), std::back_inserter(x012));+    std::merge(x01.begin(), x01.end(), x12.begin(), x12.end(), x012.begin());
  
     assert(x012.size() == x02.size());     assert(x012.size() == x02.size());
文書の先頭へ