NebulaGraph Python Client 5.0.0a1
Loading...
Searching...
No Matches
NVector Class Reference
+ Inheritance diagram for NVector:
+ Collaboration diagram for NVector:

Public Member Functions

 __init__ (self, List[float] values, int dimension)
 
List[float] get_values (self)
 
int get_dimension (self)
 
int __len__ (self)
 
float __getitem__ (self, int index)
 
bool __eq__ (self, other)
 
str __str__ (self)
 
str __repr__ (self)
 
List[float] cast_primitive (self)
 
- Public Member Functions inherited from BaseDataObject
str get_decode_type (self)
 
"BaseDataObject" set_decode_type (self, str decode_type)
 

Public Attributes

 values
 
 dimension
 

Additional Inherited Members

- Protected Attributes inherited from BaseDataObject
 _decode_type
 

Detailed Description

Represents a fixed-dimension vector of float values.

Definition at line 858 of file py_data_types.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
List[float]  values,
int  dimension 
)
Initialize a Vector with values and dimension.

Args:
----
    values: List of float values representing the vector components
    dimension: The dimension of the vector (must match length of values)

Raises:
------
    ValueError: If length of values doesn't match the specified dimension

Reimplemented from BaseDataObject.

Definition at line 861 of file py_data_types.py.

+ Here is the call graph for this function:

Member Function Documentation

◆ __eq__()

bool __eq__ (   self,
  other 
)
Compare two vectors for equality.

Definition at line 898 of file py_data_types.py.

+ Here is the call graph for this function:

◆ __getitem__()

float __getitem__ (   self,
int  index 
)
Get vector component at specified index.

Definition at line 892 of file py_data_types.py.

+ Here is the call graph for this function:

◆ __len__()

int __len__ (   self)
Return the dimension of the vector.

Definition at line 888 of file py_data_types.py.

◆ __repr__()

str __repr__ (   self)
Return detailed string representation of the vector.

Definition at line 911 of file py_data_types.py.

◆ __str__()

str __str__ (   self)
Return string representation of the vector.

Definition at line 907 of file py_data_types.py.

◆ cast_primitive()

List[float] cast_primitive (   self)
Convert vector to a list of float values.

Reimplemented from CompositeDataObject.

Definition at line 915 of file py_data_types.py.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_dimension()

int get_dimension (   self)

Definition at line 885 of file py_data_types.py.

◆ get_values()

List[float] get_values (   self)

Definition at line 882 of file py_data_types.py.

Member Data Documentation

◆ dimension

dimension

Definition at line 880 of file py_data_types.py.

◆ values

values

Definition at line 879 of file py_data_types.py.


The documentation for this class was generated from the following file: