[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master d0787c6: Book: Fixed some errors in the kdtree
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master d0787c6: Book: Fixed some errors in the kdtree library examples |
Date: |
Sun, 8 Nov 2020 17:00:27 -0500 (EST) |
branch: master
commit d0787c691e770738be3c9328404e396ec77b55d2
Author: Sachin Kumar Singh <sachinkumarsingh092@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Book: Fixed some errors in the kdtree library examples
Some missing arguments are fixed in the kdtree examples for creating
kdtree and finding the nearest neighbour functions.
---
doc/gnuastro.texi | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 0f3dafd..a8715d9 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -25061,10 +25061,10 @@ main (void)
GAL_TABLE_SEARCH_NAME, 0, -1, 0, NULL);
/* Construct a k-d tree. The index of root is stored in `root` */
- kdtree=gal_kdtree_create(coords_raw, &root);
+ kdtree=gal_kdtree_create(input, &root);
/* Write output to a file. */
- gal_table_write(kdtree, NULL, GAL_TABLE_FORMAT_BFITS,
+ gal_table_write(kdtree, NULL, NULL, GAL_TABLE_FORMAT_BFITS,
kdtreefile, "kdtree", 0);
/* Report k-d tree root. */
@@ -25094,6 +25094,7 @@ For example the function below reads the input, and the
k-d tree file created in
int
main (void)
@{
+ double least_dist;
size_t root=KDTREE_ROOT;
gal_data_t *input, *kdtree;
char kdtreefile[]="kd-tree.txt"; /* Inputs and outputs can */
@@ -25113,7 +25114,7 @@ main (void)
/* Find the nearest neighbour of the point. */
nearest_index=gal_kdtree_nearest_neighbour(input, kdtree, root,
- point);
+ point, &least_dist);
/* Clean up and return. */
gal_list_data_free(input);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master d0787c6: Book: Fixed some errors in the kdtree library examples,
Mohammad Akhlaghi <=