Jump to content

User:Leakec/sandbox

From Wikipedia, the free encyclopedia

-vector (also known as the one-dimensional -vector) is a data structure used to organize the elements of a one-dimensional database. The -vector data structure is used in the -vector range searching algorithm. The algorithm can be used for any application that involves range searching, such as star identification or isosurface identification for level set analysis. In addition, the algorithm can be used for a handful of other applications such as function inversion.

Historical background

[edit]

The -vector was originally developed and used in star identification algorithms[1][2][3], most notably the Pyramid star identification algorithm[4], and more recently in the Super k-ID algorithm[5]. Star identification algorithms perform range searches on a large, one-dimensional database of interstellar angles. In order for the star identification and eventual attitude estimation to be useful, the range searches on the database of interstellar angles must be performed very quickly. Thus, the -vector range searching technique was devised to search on large, one-dimensional databases by performing only two calculations: one to retrieve the upper index and a second to retrieve the lower index of elements in the sorted database that meet the search criteria. Hence, the number of operations needed to perform a range search is small and independent of the size of the database. Consequently, the -vector is able to search in large, one-dimensional databases very quickly.

Informal description

[edit]
1-Dimensional K-Vector Construction
1-Dimensional K-Vector Construction

The k-vector is a vector of integers that organizes elements of the sorted database into bins. The image to the right gives an example of the k-vector for a sample database of ten elements. The ten elements, each represented by a star in the image, have been sorted and plotted in ascending order. The y-axis of the image gives the value of each of the elements. The x-axis of the image has two sets of numbers. The upper set is a counting index that begins at one and ends at ten. The lower set is the k-vector.

The elements of the k-vector give the number of elements in the sorted database below the associated bin. For example, the first element of the k-vector has a value of zero because there are zero elements below the first bin, and the second element of the k-vector has a value of two because there are two elements below the second bin. Organizing the database elements using the k-vector in this way allows range searches to be performed on the database using a number of operations that is independent of the database size. In other words, the order of the algorithm is independent of the database size. This feature of the -vector is one that does not exist in other one-dimensional search algorithms, such as the binary search tree, whose order goes as , where is the number of elements in the database.

Searching algorithm description

[edit]

The searching algorithm is broken down into two steps: pre-processing and searching. The pre-processing step is only done once, and must be completed before the searching step. The pre-processing step assembles the k-vector for use in the searching step.[6][7]

Pre-processing

[edit]

During the pre-processing step the k-vector is assembled. In addition, an index that maps the sorted database to the original database is created and stored.

Let be a user-specified one dimensional database with elements. Then, a sorted database, , and an index, , are created using a sorting algorithm and sorting the database in ascending order such that:

Then, a mapping function is created that will be used to define the location of the k-vector bins. Typically, this mapping function is a line, because a line is easily inverted. Let the mapping function have a slope, , and intercept, , defined by:

where is the largest element in the database, is the smallest element in the database, is the number of k-vector bins, and . The symbol is the relative machine precision ( for double precision numbers). The value of , which the user chooses, is a trade off between memory and performance of the searching algorithm. If is larger, the algorithm will take less time to perform a search, but will use more memory. If is smaller, the algorithm will take more time to search, but use less memory.[8] Generally, a good choice for the value of is the number of elements in the database, .

The addition of into the slope and intercept equations ensures that the bottom bin will be below the smallest element in the database, and the top bin will be above the largest element in the database. This is necessary for all of the elements in the database to be searchable. Now the mapping function, , is defined as:

Now that the mapping function is defined, the -vector is built using:

Searching

[edit]

Once the pre-processing step has been completed, the database can be searched. Let the user defined search range be given by . The searching algorithm steps to return the indices of the elements that meet the search criteria are

,

where are the indices of the elements in the original database, , that meet the search criteria. Note, in the equations above the symbol is used to denote the floor function, and symbol is used to denote the ceiling function.

The search algorithm in the form implemented above may contain elements extraneous to the search range; however, those elements will be the elements in the database closest to the user defined search range. Databases that are approximately linear when sorted and whose -vector has bins, the approximate number of extraneous elements for any search range is .[6] Thus, for large databases that meet the aforementioned criteria, there will be approximately one extraneous element per search. If the extraneous elements cannot be tolerated, a simple linear search can be implemented as follows.

For ,

,

and for ,

.

References

[edit]
  1. ^ Pham, M.D.; Low, Kay-Soon; Chen, Shoushun (2013). "An Autonomous Star Recognition Algorithm with Optimized Database". Aerospace and Electronic Systems, IEEE Transactions on. 49: 1467–1475.
  2. ^ Fialho, Márcio (2017). Improved Star Identification Algorithms and Techniques for Monochrome and Color Star Trackers (PDF) (PhD). Instituto Nacional De Pesquisas Espaciais. Retrieved 2018-11-13.}
  3. ^ Dong, Y.; Xing, F.; You, Z. (2006). "Brightness Independent 4-Star Matching Algorithm for Lost-in-Space 3-Axis Attitude Acquisition". Tsinghua Science and Technology. 11 (5): 543–548.
  4. ^ Mortari, Daniele; Samaan A., Malak; Bruccoleri, Christian; Junkins, John L. (2004). "Pyramid Star Identification Technique". Journal of the Institute of Navigation. 51 (3): 171–183.
  5. ^ "Star Trackers: First Contact Results". Kelvins. ESA.
  6. ^ a b Mortari, Daniele; Neta, Beny (2014). "K-Vector Range Searching Techniques". Calhoun. {{cite journal}}: Cite journal requires |journal= (help)
  7. ^ Mortari, Daniele; Leake, Carl; Borissov, Stoian (2018). The N-Dimensional K-Vector with Applications. 2018 AAS/AIAA Space Flight Mechanics Meeting Conference, Kissimmee, FL.
  8. ^ Mortari, Daniele (2014). Memory Adaptive K-Vector. 2014 AAS/AIAA Space Flight Mechanics Meeting Conference, Santa Fe, NM.

Category:Vectors (mathematics and physics) Category:Database algorithms