 
 namespace Gpu_Rvd{
 
-	CudaRestrictedVoronoiDiagram::CudaRestrictedVoronoiDiagram(Mesh* m, Points* p, int iter, std::vector<int> sample_facet, int k){
+	CudaRestrictedVoronoiDiagram::CudaRestrictedVoronoiDiagram(Mesh* m, Points* p, int iter, std::vector<int> sample_facet, int k, int f_k){
 		vertex_ = m->v_ptr();
 		vertex_nb_ = m->get_vertex_nb();
 		facets_ = m->f_ptr();

		}
	}
	__global__
		void kernel(
		double*			vertex, index_t			vertex_nb,
		double*			points, index_t			points_nb,
		index_t*		facets, index_t			facets_nb,
		index_t*		points_nn, index_t		k_p,
		index_t*		facets_nn, index_t		dim,
		double*			retdata, int*		retindex
		){
		index_t tid = blockIdx.x * blockDim.x + threadIdx.x;

		if (tid >= facets_nb) return;

		//load \memory[facet] 3 times.
		const int3 facet_index = {
			facets[tid * dim + 0],
			facets[tid * dim + 1],
			facets[tid * dim + 2]
		};

		

		update_neighbors();

		//result_print("points_nn.txt", points_nn_, k_ * points_nb_, k_);
		//result_print("facets_nn.txt", facets_nn_, facet_nb_ * f_k_, f_k_);
	}

	void CudaRestrictedVoronoiDiagram::update_neighbors(){
