home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
-
- COPYRIGHT (C) 1992 UNIVERSITY OF CALIFORNIA
-
- ***************************************************************/
-
- #include "kdnode.h"
-
- encode_kd(x, indices, nvec, cbook, k, ncv)
- int *indices, k, ncv, nvec;
- float *x, *cbook;
- {
- int FindClosestVector(), *max;
- float dist;
- struct KDTreeNode *tree, *MakeMedianTree();
-
- tree = MakeMedianTree(k, ncv, cbook);
-
- max = indices + nvec;
- while(indices < max) {
- *indices++ = FindClosestVector(tree, k, ncv, cbook, x, &dist);
- x += k;
- }
- }
-