View source: R/radius_graphs.R
| cpp.create.rknn.graphs | R Documentation |
Tentative C++-backed counterpart to create.rknn.graphs(). It builds one
ANN kd-tree, computes nearest-neighbor distances through the maximal
requested k value once, derives each requested k.scale from that shared
result, and materializes adaptive-radius edge tables for all k values in
C++. The existing R finalization path is then used for pruning, lifecycle
branches, and optional component repair.
This function is exported as a diagnostic helper while the native backend is
being benchmarked and validated. Ordinary callers should use
create.rknn.graphs() with the default backend = "auto" or with
backend = "cpp" to request this native backend explicitly.
cpp.create.rknn.graphs(X, kmin = NULL, kmax = NULL, ..., k.values = NULL)
X |
Numeric matrix or data frame with observations in rows. |
kmin, kmax |
Optional integer scalars defining the inclusive k range.
Required when |
... |
Additional arguments forwarded to |
k.values |
Optional integer vector of k values to evaluate. When
supplied, |
A "rknn_graphs" object with the same default structure as
create.rknn.graphs(). When return.timing = TRUE, timing is attached at
the graph-sequence level because the ANN setup and max-k scale search are
shared across k values.
create.rknn.graphs()
X <- matrix(c(0, 1, 3, 4), ncol = 1)
result <- cpp.create.rknn.graphs(
X,
k.values = c(1, 2),
graph.detail = "minimal",
prune.method = "none"
)
names(result$graphs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.