Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kosuke Morimoto <[email protected]>
  • Loading branch information
kmrmt committed Aug 20, 2024
1 parent 66ae195 commit 1d43dbb
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions internal/core/algorithm/ngt/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,26 @@ 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
AccuracyTable string
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
Expand Down Expand Up @@ -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
}

0 comments on commit 1d43dbb

Please sign in to comment.