From 1d43dbbf1041fb3df5a641848066b37a02656006 Mon Sep 17 00:00:00 2001 From: Kosuke Morimoto Date: Tue, 20 Aug 2024 15:23:40 +0900 Subject: [PATCH] fix Signed-off-by: Kosuke Morimoto --- internal/core/algorithm/ngt/ngt.go | 49 ++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/internal/core/algorithm/ngt/ngt.go b/internal/core/algorithm/ngt/ngt.go index 8661c95ed6..2078775432 100644 --- a/internal/core/algorithm/ngt/ngt.go +++ b/internal/core/algorithm/ngt/ngt.go @@ -167,9 +167,9 @@ type ( IndexType indexType DatabaseType databaseType ObjectAlignment objectAlignment - pathAdjustmentInterval int32 - graphSharedMemorySize int32 - treeSharedMemorySize int32 + PathAdjustmentInterval int32 + GraphSharedMemorySize int32 + TreeSharedMemorySize int32 ObjectSharedMemorySize int32 PrefetchOffset int32 PrefetchSize int32 @@ -177,16 +177,16 @@ type ( SearchType string MaxMagnitude float32 NOfNeighborsForInsertionOrder int32 - EpsilonForInsersionOrder float32 + EpsilonForInsertionOrder float32 RefinementObjectType objectType TruncationThreshold int32 EdgeSizeForCreation int32 EdgeSizeForSearch int32 EdgeSizeLimitForCreation int32 InsertionRadiusCoefficient float64 - SeedSize string + SeedSize int32 SeedType seedType - TruuncationThreadPoolSize int32 + TruncationThreadPoolSize int32 BatchSizeForCreation int32 GraphType graphType DynamicEdgeSizeBase int32 @@ -1160,4 +1160,41 @@ func (n *ngt) GetGraphStatistics(m statisticsType) (stats *GraphStatistics, err func (n *ngt) GetProperty() (prop *Property, err error) { ne := n.GetErrorBuffer() cprop := C.ngt_get_property_info(n.index, ne.err) + n.PutErrorBuffer(ne) + return &Property{ + Dimension: int32(cprop.dimension), + ThreadPoolSize: int32(cprop.thread_pool_size), + ObjectType: objectType(cprop.object_type), + DistanceType: distanceType(cprop.distance_type), + IndexType: indexType(cprop.index_type), + DatabaseType: databaseType(cprop.database_type), + ObjectAlignment: objectAlignment(cprop.object_alignment), + PathAdjustmentInterval: int32(cprop.path_adjustment_interval), + GraphSharedMemorySize: int32(cprop.graph_shared_memory_size), + TreeSharedMemorySize: int32(cprop.tree_shared_memory_size), + ObjectSharedMemorySize: int32(cprop.object_shared_memory_size), + PrefetchOffset: int32(cprop.prefetch_offset), + PrefetchSize: int32(cprop.prefetch_size), + AccuracyTable: C.GoString(cprop.accuracy_table), + SearchType: C.GoString(cprop.search_type), + MaxMagnitude: float32(cprop.max_magnitude), + NOfNeighborsForInsertionOrder: int32(cprop.n_of_neighbors_for_insertion_order), + EpsilonForInsertionOrder: float32(cprop.n_of_neighbors_for_insertion_order), + RefinementObjectType: objectType(cprop.refinement_object_type), + TruncationThreshold: int32(cprop.truncation_threshold), + EdgeSizeForCreation: int32(cprop.edge_size_for_creation), + EdgeSizeForSearch: int32(cprop.edge_size_for_search), + EdgeSizeLimitForCreation: int32(cprop.edge_size_limit_for_creation), + InsertionRadiusCoefficient: float64(cprop.insertion_radius_coefficient), + SeedSize: int32(cprop.seed_size), + SeedType: seedType(cprop.seed_type), + TruncationThreadPoolSize: int32(cprop.truncation_thread_pool_size), + BatchSizeForCreation: int32(cprop.batch_size_for_creation), + GraphType: graphType(cprop.graph_type), + DynamicEdgeSizeBase: int32(cprop.dynamic_edge_size_base), + DynamicEdgeSizeRate: int32(cprop.dynamic_edge_size_rate), + BuildTimeLimit: float32(cprop.build_time_limit), + OutgoingEdge: int32(cprop.outgoing_edge), + IncomingEdge: int32(cprop.incoming_edge), + }, nil }