swarmauri.core.vector_stores.IVectorNorm module

class swarmauri.core.vector_stores.IVectorNorm.IVectorNorm[source]

Bases: ABC

Interface for calculating vector norms. Supports L1 norm, L2 norm, and Max norm calculations.

abstract l1_norm(vector)[source]

Calculate the L1 norm (Manhattan norm) of a vector.

Parameters: - vector (List[Union[int, float]]): The vector for which to calculate the L1 norm.

Returns: - float: The L1 norm of the vector.

Return type:

float

abstract l2_norm(vector)[source]

Calculate the L2 norm (Euclidean norm) of a vector.

Parameters: - vector (List[Union[int, float]]): The vector for which to calculate the L2 norm.

Returns: - float: The L2 norm of the vector.

Return type:

float

abstract max_norm(vector)[source]

Calculate the Max norm (infinity norm) of a vector.

Parameters: - vector (List[Union[int, float]]): The vector for which to calculate the Max norm.

Returns: - float: The Max norm of the vector.

Return type:

float