Class: Roseflow::VectorStores::HNSWMemoryStore::HNSWNode
- Inherits:
-
Object
- Object
- Roseflow::VectorStores::HNSWMemoryStore::HNSWNode
- Defined in:
- lib/roseflow/vector_stores/hnsw_memory_store.rb
Overview
HNSW vector store node.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#level ⇒ Object
Returns the value of attribute level.
-
#neighbors ⇒ Object
Returns the value of attribute neighbors.
-
#vector ⇒ Object
readonly
Returns the value of attribute vector.
Instance Method Summary collapse
-
#initialize(id, vector, level, m) ⇒ HNSWNode
constructor
Initializes a new node.
Constructor Details
#initialize(id, vector, level, m) ⇒ HNSWNode
Initializes a new node.
324 325 326 327 328 329 |
# File 'lib/roseflow/vector_stores/hnsw_memory_store.rb', line 324 def initialize(id, vector, level, m) @id = id @vector = vector @level = level @neighbors = Array.new(level + 1) { Array.new(m) } end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
314 315 316 |
# File 'lib/roseflow/vector_stores/hnsw_memory_store.rb', line 314 def id @id end |
#level ⇒ Object
Returns the value of attribute level.
315 316 317 |
# File 'lib/roseflow/vector_stores/hnsw_memory_store.rb', line 315 def level @level end |
#neighbors ⇒ Object
Returns the value of attribute neighbors.
315 316 317 |
# File 'lib/roseflow/vector_stores/hnsw_memory_store.rb', line 315 def neighbors @neighbors end |
#vector ⇒ Object (readonly)
Returns the value of attribute vector.
314 315 316 |
# File 'lib/roseflow/vector_stores/hnsw_memory_store.rb', line 314 def vector @vector end |