-/NAMESPACE
-/man/*
-!/man/nngd-package.Rd
-/R/RcppExports.R
-/src/RcppExports.cpp
/src/*.o
/src/*.so
.RData
+Encoding: UTF-8
Package: nngd
Type: Package
Title: Compute distances based on the nearest-neighbors graph.
-Version: 1.0
-Date: 2021-12-06
+Version: 1.0.1
+Date: 2025-01-16
Author: Benjamin Auder <benjamin.auder@universite-paris-saclay.fr> [aut,cre]
Maintainer: Benjamin Auder <benjamin.auder@universite-paris-saclay.fr>
Description: Only two functions for now. nng() builds the nearest-neighbors graph,
License: MIT + file LICENSE
Imports: Rcpp, RcppEigen, igraph, pracma
LinkingTo: Rcpp, RcppEigen
-RoxygenNote: 7.1.2
+RoxygenNote: 7.3.2
-YEAR: 2021-2021
+YEAR: 2021-2025
COPYRIGHT HOLDER: Benjamin Auder
--- /dev/null
+# Generated by roxygen2: do not edit by hand
+
+export(ectd)
+export(nng)
+import(Rcpp)
+importFrom(igraph,as_edgelist)
+importFrom(igraph,components)
+importFrom(igraph,graph_from_edgelist)
+importFrom(igraph,is_directed)
+importFrom(igraph,vcount)
+importFrom(pracma,pinv)
+useDynLib(nngd, .registration = TRUE)
--- /dev/null
+# Generated by using Rcpp::compileAttributes() -> do not edit by hand
+# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
+
+findNeighbors <- function(data, k, mutual) {
+ .Call(`_nngd_findNeighbors`, data, k, mutual)
+}
+
## Usage
-roxygenize(".") <br>
R CMD INSTALL . <br>
library(nngd) <br>
?nng <br>
--- /dev/null
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ectd.R
+\name{ectd}
+\alias{ectd}
+\title{Compute the Euclidian Commute-Time Distances (ECTD) in an undirected graph.}
+\usage{
+ectd(o, similarity = function(x) 1, inf.replace = TRUE)
+}
+\arguments{
+\item{o}{Output of \code{nng}.}
+
+\item{similarity}{function distance --> similarity.}
+
+\item{inf.replace}{Replace Inf values by large finite number ?}
+}
+\value{
+A distances matrix (n x n)
+}
+\description{
+Assuming similarity function doesn't depend on x, and undirected graph.
+}
--- /dev/null
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/nng.R
+\name{nng}
+\alias{nng}
+\title{Compute the nearest-neighbors graph + pairwise distances.}
+\usage{
+nng(data, k = ceil(sqrt(nrow(data))), mutual = TRUE)
+}
+\arguments{
+\item{data}{data.frame or matrix.}
+
+\item{k}{Number of neighbors at each point.}
+
+\item{mutual}{Whether or not to build mutual kNN graph.}
+}
+\value{
+A list with $graph and $distances.
+}
+\description{
+This is just a wrapper around C++/Rcpp function.
+}
--- /dev/null
+// Generated by using Rcpp::compileAttributes() -> do not edit by hand
+// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
+
+#include <RcppEigen.h>
+#include <Rcpp.h>
+
+using namespace Rcpp;
+
+#ifdef RCPP_USE_GLOBAL_ROSTREAM
+Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
+Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
+#endif
+
+// findNeighbors
+List findNeighbors(NumericMatrix data, int k, bool mutual);
+RcppExport SEXP _nngd_findNeighbors(SEXP dataSEXP, SEXP kSEXP, SEXP mutualSEXP) {
+BEGIN_RCPP
+ Rcpp::RObject rcpp_result_gen;
+ Rcpp::RNGScope rcpp_rngScope_gen;
+ Rcpp::traits::input_parameter< NumericMatrix >::type data(dataSEXP);
+ Rcpp::traits::input_parameter< int >::type k(kSEXP);
+ Rcpp::traits::input_parameter< bool >::type mutual(mutualSEXP);
+ rcpp_result_gen = Rcpp::wrap(findNeighbors(data, k, mutual));
+ return rcpp_result_gen;
+END_RCPP
+}
+
+static const R_CallMethodDef CallEntries[] = {
+ {"_nngd_findNeighbors", (DL_FUNC) &_nngd_findNeighbors, 3},
+ {NULL, NULL, 0}
+};
+
+RcppExport void R_init_nngd(DllInfo *dll) {
+ R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
+ R_useDynamicSymbols(dll, FALSE);
+}