1 #ifndef DATABASE_BUILDER_H
2 #define DATABASE_BUILDER_H
15 inline bool isFlagSet(uint32_t dbFlags, uint32_t flag);
37 long BinFor(
decimal dist)
const;
102 #define MULTI_DB_FLOAT_FLAG 0x0001
110 const unsigned char *buffer;
A data structure enabling constant-time range queries into fixed numerical data.
KVectorIndex(DeserializeContext *des)
Construct from serialized buffer.
long QueryLiberal(decimal minQueryDistance, decimal maxQueryDistance, long *upperIndex) const
Finds all the entries in the given range, and possibly a few just outside the range on the ends.
decimal Max() const
Upper bound on elements.
long NumValues() const
The number of data points in the data referred to by the kvector.
std::vector< unsigned char > bytes
MultiDatabaseEntry(int32_t magicValue, std::vector< unsigned char > bytes)
MultiDatabase(const unsigned char *buffer)
Create a multidatabase from a serialized multidatabase.
const unsigned char * SubDatabasePointer(int32_t magicValue) const
MultiDatabase memory layout:
A database storing distances between pairs of stars.
long NumPairs() const
Exact number of stored pairs.
std::vector< decimal > StarDistances(int16_t star, const Catalog &) const
Return the distances from the given star to each star it's paired with in the database (for debugging...
decimal MinDistance() const
Lower bound on stored star pair distances.
PairDistanceKVectorDatabase(DeserializeContext *des)
Create the database from a serialized buffer.
static const int32_t kMagicValue
Magic value to use when storing inside a MultiDatabase.
const int16_t * FindPairsExact(const Catalog &, decimal min, decimal max, const int16_t **end) const
const int16_t * FindPairsLiberal(decimal min, decimal max, const int16_t **end) const
Return at least all the star pairs whose inter-star distance is between min and max.
decimal MaxDistance() const
Upper bound on stored star pair distances.
const int32_t kCatalogMagicValue
void SerializePairDistanceKVector(SerializeContext *ser, const Catalog &catalog, decimal minDistance, decimal maxDistance, long numBins)
Serialize a pair-distance KVector into buffer.
bool isFlagSet(uint32_t dbFlags, uint32_t flag)
std::vector< MultiDatabaseEntry > MultiDatabaseDescriptor
void SerializeMultiDatabase(SerializeContext *ser, const MultiDatabaseDescriptor &dbs, uint32_t flags)
std::vector< CatalogStar > Catalog