-# Cluster one full task (nb_curves / ntasks series); only step 1
-clusteringTask = function(indices, getCoefs, K1, nb_series_per_chunk, ncores)
+#' Two-stage clustering, within one task (see \code{claws()})
+#'
+#' \code{clusteringTask1()} runs one full stage-1 task, which consists in iterated
+#' stage 1 clustering on nb_curves / ntasks energy contributions, computed through
+#' discrete wavelets coefficients.
+#' \code{clusteringTask2()} runs a full stage-2 task, which consists in WER distances
+#' computations between medoids (indices) output from stage 1, before applying
+#' the second clustering algorithm on the distances matrix.
+#'
+#' @param getContribs Function to retrieve contributions from initial series indices:
+#' \code{getContribs(indices)} outputs a contributions matrix
+#' @inheritParams claws
+#' @inheritParams computeSynchrones
+#' @inheritParams computeWerDists
+#'
+#' @return The indices of the computed (resp. K1 and K2) medoids.
+#'
+#' @name clustering
+#' @rdname clustering
+#' @aliases clusteringTask1 clusteringTask2
+NULL
+
+#' @rdname clustering
+#' @export
+clusteringTask1 = function(indices, getContribs, K1, algoClust1, nb_items_clust,
+ ncores_clust=1, verbose=FALSE, parll=TRUE)