Browse Source

note in random_points_on_mesh about alias table method

Former-commit-id: 34d3104d4a62c4bfdd7533dfdbfc5f120de83d45
Alec Jacobson 11 năm trước cách đây
mục cha
commit
b9babab1cf
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      include/igl/random_points_on_mesh.cpp

+ 1 - 0
include/igl/random_points_on_mesh.cpp

@@ -34,6 +34,7 @@ IGL_INLINE void igl::random_points_on_mesh(
   VectorXs A0(A.size()+1);
   A0(0) = 0;
   A0.bottomRightCorner(A.size(),1) = A;
+  // Even faster would be to use the "Alias Table Method"
   cumsum(A0,1,C);
   const VectorXs R = (VectorXs::Random(n,1).array() + 1.)/2.;
   assert(R.minCoeff() >= 0);