1.17.0
User Documentation for Apache MADlib
svec.sql_in File Reference

SQL type definitions and functions for sparse vector data type svec More...

Functions

svec svec_in (cstring)
 
cstring svec_out (svec)
 
svec svec_recv (internal)
 
bytea svec_send (svec)
 
svec svec_plus (svec, svec)
 
svec svec_minus (svec, svec)
 
svec svec_div (svec, svec)
 
svec svec_mult (svec, svec)
 
svec svec_pow (svec, svec)
 
integer svec_cmp (svec, svec)
 
boolean svec_ge (svec, svec)
 
boolean svec_lt (svec, svec)
 
boolean svec_le (svec, svec)
 
boolean svec_gt (svec, svec)
 
boolean svec_ne (svec, svec)
 
boolean svec_eq (svec, svec)
 
boolean float8arr_eq (float8[], float8[])
 
svec float8arr_minus_float8arr (float8[], float8[])
 
svec float8arr_minus_svec (float8[], svec)
 
svec svec_minus_float8arr (svec, float8[])
 
svec float8arr_plus_float8arr (float8[], float8[])
 
svec float8arr_plus_svec (float8[], svec)
 
svec svec_plus_float8arr (svec, float8[])
 
svec float8arr_mult_float8arr (float8[], float8[])
 
svec float8arr_mult_svec (float8[], svec)
 
svec svec_mult_float8arr (svec, float8[])
 
svec float8arr_div_float8arr (float8[], float8[])
 
svec float8arr_div_svec (float8[], svec)
 
svec svec_div_float8arr (svec, float8[])
 
float8 svec_dot (svec, svec)
 
float8 svec_dot (float8[], float8[])
 
float8 svec_dot (svec, float8[])
 
float8 svec_dot (float8[], svec)
 
svec svec_cast_int2 (int2)
 
svec svec_cast_int4 (int4)
 
svec svec_cast_int8 (bigint)
 
svec svec_cast_float4 (float4)
 
svec svec_cast_float8 (float8)
 
svec svec_cast_numeric (numeric)
 
float8 [] float8arr_cast_int2 (int2)
 
float8 [] float8arr_cast_int4 (int4)
 
float8 [] float8arr_cast_int8 (bigint)
 
float8 [] float8arr_cast_float4 (float4)
 
float8 [] float8arr_cast_float8 (float8)
 
float8 [] float8arr_cast_numeric (numeric)
 
svec svec_cast_float8arr (float8[])
 
svec svec_cast_positions_float8arr (int8[], float8[], int8, float8)
 
float8 [] svec_return_array (svec)
 
svec svec_concat (svec, svec)
 
svec svec_concat_replicate (int4, svec)
 
bool svec_l2_lt (svec, svec)
 
bool svec_l2_le (svec, svec)
 
bool svec_l2_eq (svec, svec)
 
bool svec_l2_ne (svec, svec)
 
bool svec_l2_gt (svec, svec)
 
bool svec_l2_ge (svec, svec)
 
integer svec_l2_cmp (svec, svec)
 

Detailed Description

See also
For an introduction to the sparse vector implementation, see the module description Sparse Vectors.

Function Documentation

◆ float8arr_cast_float4()

float8 [] float8arr_cast_float4 ( float4  )

Casts a float4 into a float8 array.

◆ float8arr_cast_float8()

float8 [] float8arr_cast_float8 ( float8  )

Casts a float8 into a float8 array.

◆ float8arr_cast_int2()

float8 [] float8arr_cast_int2 ( int2  )

Casts an int2 into a float8 array.

◆ float8arr_cast_int4()

float8 [] float8arr_cast_int4 ( int4  )

Casts an int4 into a float8 array.

◆ float8arr_cast_int8()

float8 [] float8arr_cast_int8 ( bigint  )

Casts an int8 into a float8 array.

◆ float8arr_cast_numeric()

float8 [] float8arr_cast_numeric ( numeric  )

Casts a numeric into a float8 array.

◆ float8arr_div_float8arr()

svec float8arr_div_float8arr ( float8  [],
float8  [] 
)

Divides a float8 array by another, element by element.

◆ float8arr_div_svec()

svec float8arr_div_svec ( float8  [],
svec   
)

Divides a float8 array by an SVEC, element by element.

◆ float8arr_eq()

boolean float8arr_eq ( float8  [],
float8  [] 
)

Returns true if two float8 arrays are equal

◆ float8arr_minus_float8arr()

svec float8arr_minus_float8arr ( float8  [],
float8  [] 
)

Minus second array from the first array, element by element.

◆ float8arr_minus_svec()

svec float8arr_minus_svec ( float8  [],
svec   
)

Minus second SVEC from the first array, element by element.

◆ float8arr_mult_float8arr()

svec float8arr_mult_float8arr ( float8  [],
float8  [] 
)

Multiplies two float8 arrays, element by element.

◆ float8arr_mult_svec()

svec float8arr_mult_svec ( float8  [],
svec   
)

Multiplies an array and an SVEC, element by element.

◆ float8arr_plus_float8arr()

svec float8arr_plus_float8arr ( float8  [],
float8  [] 
)

Adds two arrays together, element by element.

◆ float8arr_plus_svec()

svec float8arr_plus_svec ( float8  [],
svec   
)

Adds an array and an SVEC, element by element.

◆ svec_cast_float4()

svec svec_cast_float4 ( float4  )

Casts a float4 into an SVEC.

◆ svec_cast_float8()

svec svec_cast_float8 ( float8  )

Casts a float8 into an SVEC.

◆ svec_cast_float8arr()

svec svec_cast_float8arr ( float8  [])

Casts a float8 into an SVEC.

◆ svec_cast_int2()

svec svec_cast_int2 ( int2  )

Casts an int2 into an SVEC.

◆ svec_cast_int4()

svec svec_cast_int4 ( int4  )

Casts an int4 into an SVEC.

◆ svec_cast_int8()

svec svec_cast_int8 ( bigint  )

Casts an int8 into an SVEC.

◆ svec_cast_numeric()

svec svec_cast_numeric ( numeric  )

Casts a numeric into an SVEC.

◆ svec_cast_positions_float8arr()

svec svec_cast_positions_float8arr ( int8  [],
float8  [],
int8  ,
float8   
)

Casts an array of int8 positions, float8 values into an SVEC.

◆ svec_cmp()

integer svec_cmp ( svec  ,
svec   
)

Compare two SVECs, -1 for left side smaller, 1 for greater, 0 for equal

◆ svec_concat()

svec svec_concat ( svec  ,
svec   
)

Concatenates two SVECs.

◆ svec_concat_replicate()

svec svec_concat_replicate ( int4  ,
svec   
)

Replicates n copies of an SVEC and concatenates them together.

◆ svec_div()

svec svec_div ( svec  ,
svec   
)

Divides the first SVEC by the second, element by element.

◆ svec_div_float8arr()

svec svec_div_float8arr ( svec  ,
float8  [] 
)

Divides an SVEC by a float8 array, element by element.

◆ svec_dot() [1/4]

float8 svec_dot ( svec  ,
svec   
)

Computes the dot product of two SVECs.

◆ svec_dot() [2/4]

float8 svec_dot ( float8  [],
float8  [] 
)

Computes the dot product of two float8 arrays.

◆ svec_dot() [3/4]

float8 svec_dot ( svec  ,
float8  [] 
)

Computes the dot product of an SVEC and a float8 array.

◆ svec_dot() [4/4]

float8 svec_dot ( float8  [],
svec   
)

Computes the dot product of a float8 array and an SVEC.

◆ svec_eq()

boolean svec_eq ( svec  ,
svec   
)

Returns true if two SVECs are equal. If the two SVECs are of different size, then will return false.

◆ svec_ge()

boolean svec_ge ( svec  ,
svec   
)

Returns true if the left SVEC is greater or equal to the right.

◆ svec_gt()

boolean svec_gt ( svec  ,
svec   
)

Returns true if the left SVEC is greater.

◆ svec_in()

svec svec_in ( cstring  )

SVEC constructor from CSTRING.

◆ svec_l2_cmp()

integer svec_l2_cmp ( svec  ,
svec   
)

Returns a value indicating the relative values of the l2 norms of two SVECs.

◆ svec_l2_eq()

bool svec_l2_eq ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is equal to that of the second SVEC.

◆ svec_l2_ge()

bool svec_l2_ge ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is greater than or equal to that of the second SVEC.

◆ svec_l2_gt()

bool svec_l2_gt ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is greater than that of the second SVEC.

◆ svec_l2_le()

bool svec_l2_le ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is less than or equal to that of the second SVEC.

◆ svec_l2_lt()

bool svec_l2_lt ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is less than that of the second SVEC.

◆ svec_l2_ne()

bool svec_l2_ne ( svec  ,
svec   
)

Returns true if the l2 norm of the first SVEC is not equal to that of the second SVEC.

◆ svec_le()

boolean svec_le ( svec  ,
svec   
)

Returns true if the left SVEC is less or equal to the right.

◆ svec_lt()

boolean svec_lt ( svec  ,
svec   
)

Returns true if the left SVEC is less than the right.

◆ svec_minus()

svec svec_minus ( svec  ,
svec   
)

Minus second SVEC from the first, element by element.

◆ svec_minus_float8arr()

svec svec_minus_float8arr ( svec  ,
float8  [] 
)

Minus second array from the first SVEC, element by element.

◆ svec_mult()

svec svec_mult ( svec  ,
svec   
)

Multiplies two SVEVs together, element by element.

◆ svec_mult_float8arr()

svec svec_mult_float8arr ( svec  ,
float8  [] 
)

Multiplies an SVEC and an array, element by element.

◆ svec_ne()

boolean svec_ne ( svec  ,
svec   
)

Returns true if two SVECs are not equal. If the two SVECs are of different size, then will return true.

◆ svec_out()

cstring svec_out ( svec  )

Converts SVEC to CSTRING.

◆ svec_plus()

svec svec_plus ( svec  ,
svec   
)

Adds two SVECs together, element by element.

◆ svec_plus_float8arr()

svec svec_plus_float8arr ( svec  ,
float8  [] 
)

Adds an SVEC and an array, element by element.

◆ svec_pow()

svec svec_pow ( svec  ,
svec   
)

Raises each element of the first SVEC to the power given by second SVEC, which must have dimension 1 (a scalar).

◆ svec_recv()

svec svec_recv ( internal  )

Converts SVEC internal representation to SVEC.

◆ svec_return_array()

float8 [] svec_return_array ( svec  )

Casts an SVEC into a float8 array.

◆ svec_send()

bytea svec_send ( svec  )

Converts SVEC to BYTEA.