shared3p.sc

shared3p.sc

Module with shared3p protection domain functions.

Functions:

abs

all

any

erf

exp

inv

ln

log

pow

sin

max

min

sum

abs

Function for finding absolute values.

Detailed Description

D - shared3p protection domain

Supported types - int8 / int16 / int32 / int / float32 / float64 / fix32 / fix64

Parameters

x

- an array of any dimension

returns an array of equal shape, size and dimension, where all values are the absolute values of the input array at that position

None

Function Overloads

D uint8 abs(D int8[[N]] x)

D uint16 abs(D int16[[N]] x)

D uint32 abs(D int32[[N]] x)

D uint abs(D int[[N]] x)

D float32 abs(D float32[[N]] value)

D float64 abs(D float64[[N]] value)

D fix32 abs(D fix32[[N]] value)

D fix64 abs(D fix64[[N]] value)

all

Function for checking if all values of the input vector are true.

Detailed Description

D - shared3p protection domain

Supported types - bool

true if all of the input bits are set

false if any input bit is not set

performs one vectorized cast, and one comparison against length of the vector

None

Function Overloads

D bool all(D bool b)

Parameters

b

- scalar boolean

D bool all(D bool[[1]] vec)

Parameters

vec

- boolean 1-dimensional vector

D bool all(D bool[[1]] vec, uint k)

Parameters

vec

- boolean 1-dimensional vector

k

- an uint type value that shows in how many subarrays must all be found

D bool all(D bool[[N]] arr)

Parameters

arr

- boolean any dimension vector

any

Function for checking if any value of the input vector is true.

Detailed Description

D - shared3p protection domain

Supported types - bool

true if any of the input bits is set

false if all input bits are not set

performs one vectorized cast, and one comparison against zero

None

Function Overloads

D bool any(D bool b)

Parameters

b

- scalar boolean

D bool any(D bool[[1]] vec)

Parameters

vec

- boolean 1-dimensional vector

D bool any(D bool[[1]] vec, uint k)

Parameters

vec

- boolean 1-dimensional vector

k

- an uint type value that shows in how many subarrays must any be found

D bool any(D bool[[N]] arr)

Parameters

arr

- boolean any dimension vector

argument

Function for accessing the named program arguments of shared3p types.

Detailed Description

T - any data type

Parameters

name

The name of the argument.

returns the value associated with the argument specified by parameter name.

Function Overloads

D T argument(string name)

An argument of scalar type.

An argument of 1-dimensional array type.

bit extraction

Function for converting xor_uint(X) type value to the bit representation.

Detailed Description

D - shared3p protection domain

Supported types - xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

The input is arbitrary dimensional array, output is flattened to one boolean vector. Reshape the result to get appropriate dimensionality.

Parameters

input

- the input value to convert

returns filattened vector of extracted bits

None

Function Overloads

D bool bit_extract(D xor_uint8[[N]] input)

D bool bit_extract(D xor_uint16[[N]] input)

D bool bit_extract(D xor_uint32[[N]] input)

D bool bit_extract(D xor_uint64[[N]] input)

ceiling

Functions for rounding a value upwards.

Detailed Description

D - shared3p protection domain

Supported types - float32 float64

returns the upwards rounded value of the input scalar/vector

None

Function Overloads

D float32 ceiling(D float32 value)

Parameters

value

- input scalar of supported type

D float64 ceiling(D float64 value)

D float32 ceiling(D float32[[1]] arr)

Parameters

arr

- input vector of supported type

D float64 ceiling(D float64[[1]] arr)

choose(multiple conditions)

Function for obliviously choosing pointwise from the inputs.

Detailed Description

D - shared3p protection domain

Supported types - xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

cond

- a boolean vector

pointwise check if cond at a certain position is true or false. if true the element of first at that position is returned else the element of second at that position is returned

None

Function Overloads

D xor_uint8 choose(D bool[[N]] cond, D xor_uint8[[N]] first, D xor_uint8[[N]] second)

D xor_uint16 choose(D bool[[N]] cond, D xor_uint16[[N]] first, D xor_uint16[[N]] second)

D xor_uint32 choose(D bool[[N]] cond, D xor_uint32[[N]] first, D xor_uint32[[N]] second)

D xor_uint64 choose(D bool[[N]] cond, D xor_uint64[[N]] first, D xor_uint64[[N]] second)

choose(single condition)

Function for obliviously choosing one of the inputs.

Detailed Description

D - shared3p protection domain

Supported types - xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

cond

- a boolean scalar

returns one of the input arrays that was obliviously chosen with the condition. if true, array first is returned else second is returned

None

Function Overloads

D xor_uint8 choose(D bool cond, D xor_uint8[[N]] first, D xor_uint8[[N]] second)

D xor_uint16 choose(D bool cond, D xor_uint16[[N]] first, D xor_uint16[[N]] second)

D xor_uint32 choose(D bool cond, D xor_uint32[[N]] first, D xor_uint32[[N]] second)

D xor_uint64 choose(D bool cond, D xor_uint64[[N]] first, D xor_uint64[[N]] second)

erf

Function for finding the value of error function.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

x

- input array

error function applied to elements of the input array

None

Function Overloads

D float32 erf(D float32[[N]] x)

D float64 erf(D float64[[N]] x)

exp

Function for finding exp(x)

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

Parameters

x

- input array

exponential function applied to elements of the input array

None

Function Overloads

D float32 exp(D float32[[N]] x)

D float64 exp(D float64[[N]] x)

D fix32 exp(D fix32[[N]] x)

D fix64 exp(D fix64[[N]] x)

floor

Functions for rounding a value downwards.

Detailed Description

D - shared3p protection domain

Supported types - float32 float64

returns the downwards rounded value of the input scalar/vector

None

Function Overloads

D float32 floor(D float32 value)

Parameters

value

- input scalar of supported type

D float64 floor(D float64 value)

D float32 floor(D float32[[1]] arr)

Parameters

arr

- input vector of supported type

D float64 floor(D float64[[1]] arr)

inv

Function for inversing a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

returns the inversed values of the input array

None

Function Overloads

D float32 inv(D float32[[N]] x)

D float64 inv(D float64[[N]] x)

D fix32 inv(D fix32[[N]] x)

D fix64 inv(D fix64[[N]] x)

invPrefixSum

Fast inverse prefix sum.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

Parameters

vec

- a vector of supported type

Reverses prefixSum: subtracts the preceding element from each element of vec.

None

Function Overloads

D uint8 invPrefixSum(D uint8[[1]] vec)

D uint16 invPrefixSum(D uint16[[1]] vec)

D uint32 invPrefixSum(D uint32[[1]] vec)

D uint64 invPrefixSum(D uint64[[1]] vec)

D int8 invPrefixSum(D int8[[1]] vec)

D int16 invPrefixSum(D int16[[1]] vec)

D int32 invPrefixSum(D int32[[1]] vec)

D int64 invPrefixSum(D int64[[1]] vec)

isNegligible

Function for finding if the error is small enough to neglect.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

returns true if the error is small enough to neglect

returns false if the error is not small enough

isNegligible checks up to the 5th place after the comma

this does not quite match public isNegligible

None

Function Overloads

D bool isNegligible(D float32 a)

Parameters

a

- a scalar of supported type

returns true if the error is small enough to neglect

returns false if the error is not small enough

D bool isNegligible(D float64 a)

Parameters

a

- a scalar of supported type

returns true if the error is small enough to neglect

returns false if the error is not small enough

D bool isNegligible(D float32[[1]] a)

Parameters

a

- a vector of supported type

returns a vector where each element of the input vector has been evaluated, whether the error is small enough to neglect or not

D bool isNegligible(D float64[[1]] a)

Parameters

a

- a vector of supported type

returns a vector where each element of the input vector has been evaluated, whether the error is small enough to neglect or not

ln

Function for finding the natural logarithm of a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

returns the natural logarithms of the input array

None

Function Overloads

D float32 ln(D float32[[N]] x)

D float64 ln(D float64[[N]] x)

D fix32 ln(D fix32[[N]] x)

D fix64 ln(D fix64[[N]] x)

log

Function for finding the logarithm of a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

x input

b logarithm base

returns the logarithms of the input array

None

Function Overloads

D float32 log(D float32[[N]] x, D float32[[N]] b)

D float64 log(D float64[[N]] x, D float64[[N]] b)

D fix32 log(D fix32[[N]] x, D fix32[[N]] b)

D fix64 log(D fix64[[N]] x, D fix64[[N]] b)

log10

Function for finding the base 10 logarithm of a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

x input

returns the base 10 logarithms of the input array

None

Function Overloads

D float32 log10(D float32[[N]] x)

D float64 log10(D float64[[N]] x)

logGamma

Compute the logarithm of the Gamma function.

Detailed Description

D - shared3p protection domain

Supported types - float64

Parameters

x

- input

returns log(Gamma(x))

None

Function Overloads

D float64 logGamma(D float64[[1]] x)

pow

Function for computing values of the power function.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

a

base

b

exponent

returns the b-th powers of vector a

None

Function Overloads

D float32 pow(D float32[[N]] a, D float32[[N]] b)

D float64 pow(D float64[[N]] a, D float64[[N]] b)

prefixSum

Fast prefix sum.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

Parameters

vec

- a vector of supported type

Turns the input vector [x1, x2, …​, xn] to [x1, x1 + x2, …​ , x1 + …​ + xn]

None

Function Overloads

D uint8 prefixSum(D uint8[[1]] vec)

D uint16 prefixSum(D uint16[[1]] vec)

D uint32 prefixSum(D uint32[[1]] vec)

D uint64 prefixSum(D uint64[[1]] vec)

D int8 prefixSum(D int8[[1]] vec)

D int16 prefixSum(D int16[[1]] vec)

D int32 prefixSum(D int32[[1]] vec)

D int64 prefixSum(D int64[[1]] vec)

publish

Function for publishing the named values of shared3p types.

Detailed Description

N - any array size of any dimension

T - any data type

Parameters

name

The name of the argument.

val

the value to publish under the given name. Accepts scalars as well as arrays.

Function Overloads

void publish(string name, D T[[N]] val)

reshare

Function for converting uint(X) type values to xor_uint(X) and the other way around.

Detailed Description

D - shared3p protection domain

Supported types - xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

input

- the input value to convert

returns a converted value from uint(X) → xor_uint(X) or xor_uint(X) → uint(X)

None

Function Overloads

D xor_uint8 reshare(D uint8 input)

D xor_uint8 reshare(D int8 input)

D uint8 reshare(D xor_uint8 input)

D xor_uint8 reshare(D uint8[[1]] input)

D xor_uint8 reshare(D int8[[1]] input)

D uint8 reshare(D xor_uint8[[1]] input)

D xor_uint8 reshare(D uint8[[2]] input)

D xor_uint8 reshare(D int8[[2]] input)

D uint8 reshare(D xor_uint8[[2]] input)

D xor_uint16 reshare(D uint16 input)

D xor_uint16 reshare(D int16 input)

D uint16 reshare(D xor_uint16 input)

D xor_uint16 reshare(D uint16[[1]] input)

D xor_uint16 reshare(D int16[[1]] input)

D uint16 reshare(D xor_uint16[[1]] input)

D xor_uint16 reshare(D uint16[[2]] input)

D xor_uint16 reshare(D int16[[2]] input)

D uint16 reshare(D xor_uint16[[2]] input)

D xor_uint32 reshare(D uint32 input)

D xor_uint32 reshare(D int32 input)

D uint32 reshare(D xor_uint32 input)

D xor_uint32 reshare(D uint32[[1]] input)

D xor_uint32 reshare(D int32[[1]] input)

D uint32 reshare(D xor_uint32[[1]] input)

D xor_uint32 reshare(D uint32[[2]] input)

D xor_uint32 reshare(D int32[[2]] input)

D uint32 reshare(D xor_uint32[[2]] input)

D xor_uint64 reshare(D uint64 input)

D xor_uint64 reshare(D int64 input)

D uint64 reshare(D xor_uint64 input)

D xor_uint64 reshare(D uint64[[1]] input)

D xor_uint64 reshare(D int64[[1]] input)

D uint64 reshare(D xor_uint64[[1]] input)

D xor_uint64 reshare(D uint64[[2]] input)

D xor_uint64 reshare(D int64[[2]] input)

D uint64 reshare(D xor_uint64[[2]] input)

sign

Function for determining the sign of values.

Detailed Description

D - shared3p protection domain

Supported types - int8 / int16 / int32 / int

Parameters

x

- an array of any dimension

returns an array of equal shape, size and dimension, where -1 signifies that, in the input array at that position was a negative number and 1 that it was a positive number

None

Function Overloads

D int8 sign(D int8[[N]] x)

D int16 sign(D int16[[N]] x)

D int32 sign(D int32[[N]] x)

D int sign(D int[[N]] x)

sin

Function for finding the sine of a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64

Parameters

x

- input

the sines of the input array

None

Function Overloads

D float32 sin(D float32[[N]] x)

D float64 sin(D float64[[N]] x)

sqrt

Function for finding the square root of a value.

Detailed Description

D - shared3p protection domain

Supported types - float32 / float64 / fix32 / fix64

Parameters

x

- input

the square roots of the input array

None

Function Overloads

D float32 sqrt(D float32[[N]] x)

D float64 sqrt(D float64[[N]] x)

D fix32 sqrt(D fix32[[N]] x)

D fix64 sqrt(D fix64[[N]] x)

truePrefixLength

Function for finding how many elements from the start of a vector are true.

Detailed Description

D - shared3p protection domain

Supported types - bool

the number of set bits in the longest constant true prefix of the input

this function performs log n multiplications on vectors of at most size n this is more efficient than performing n multiplications on scalars

None

Function Overloads

D uint truePrefixLength(D bool[[1]] arr)

Parameters

arr

- boolean 1-dimensional vector

max

Functions for finding the maximum value.

Functions:

max

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

max

Function for finding the maximum element of the input vector.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

x

- input

maximum element of the input vector

input vector is not empty

None

Function Overloads

D T max(D T x)

D uint8 max(D uint8[[1]] x)

D uint16 max(D uint16[[1]] x)

D uint32 max(D uint32[[1]] x)

D uint max(D uint[[1]] x)

D int8 max(D int8[[1]] x)

D int16 max(D int16[[1]] x)

D int32 max(D int32[[1]] x)

D int max(D int[[1]] x)

D float32 max(D float32[[1]] x)

D float64 max(D float64[[1]] x)

D xor_uint8 max(D xor_uint8[[1]] x)

D xor_uint16 max(D xor_uint16[[1]] x)

D xor_uint32 max(D xor_uint32[[1]] x)

D xor_uint64 max(D xor_uint64[[1]] x)

max(2 vectors)

Function for finding the pointwise maximum of 2 arrays.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64 / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

an array with the pointwise maximum of each element in the two input vectors

both input vectors are of equal length

None

Function Overloads

D uint8 max(D uint8 x, D uint8 y)

D uint16 max(D uint16 x, D uint16 y)

D uint32 max(D uint32 x, D uint32 y)

D uint max(D uint x, D uint y)

D int8 max(D int8 x, D int8 y)

D int16 max(D int16 x, D int16 y)

D int32 max(D int32 x, D int32 y)

D int max(D int x, D int y)

D float32 max(D float32 x, D float32 y)

D float64 max(D float64 x, D float64 y)

D uint8 max(D uint8[[1]] x, D uint8[[1]] y)

D uint16 max(D uint16[[1]] x, D uint16[[1]] y)

D uint32 max(D uint32[[1]] x, D uint32[[1]] y)

D uint max(D uint[[1]] x, D uint[[1]] y)

D int8 max(D int8[[1]] x, D int8[[1]] y)

D int16 max(D int16[[1]] x, D int16[[1]] y)

D int32 max(D int32[[1]] x, D int32[[1]] y)

D int max(D int[[1]] x, D int[[1]] y)

D float32 max(D float32[[1]] x, D float32[[1]] y)

D float64 max(D float64[[1]] x, D float64[[1]] y)

D uint8 max(D uint8[[N]] x, D uint8[[N]] y)

D uint16 max(D uint16[[N]] x, D uint16[[N]] y)

D uint32 max(D uint32[[N]] x, D uint32[[N]] y)

D uint max(D uint[[N]] x, D uint[[N]] y)

D int8 max(D int8[[N]] x, D int8[[N]] y)

D int16 max(D int16[[N]] x, D int16[[N]] y)

D int32 max(D int32[[N]] x, D int32[[N]] y)

D int max(D int[[N]] x, D int[[N]] y)

D float32 max(D float32[[N]] x, D float32[[N]] y)

D float64 max(D float64[[N]] x, D float64[[N]] y)

D xor_uint8 max(D xor_uint8 x, D xor_uint8 y)

D xor_uint16 max(D xor_uint16 x, D xor_uint16 y)

D xor_uint32 max(D xor_uint32 x, D xor_uint32 y)

D xor_uint64 max(D xor_uint64 x, D xor_uint64 y)

D xor_uint8 max(D xor_uint8[[1]] x, D xor_uint8[[1]] y)

D xor_uint16 max(D xor_uint16[[1]] x, D xor_uint16[[1]] y)

D xor_uint32 max(D xor_uint32[[1]] x, D xor_uint32[[1]] y)

D xor_uint64 max(D xor_uint64[[1]] x, D xor_uint64[[1]] y)

D xor_uint8 max(D xor_uint8[[N]] x, D xor_uint8[[N]] y)

D xor_uint16 max(D xor_uint16[[N]] x, D xor_uint16[[N]] y)

D xor_uint32 max(D xor_uint32[[N]] x, D xor_uint32[[N]] y)

D xor_uint64 max(D xor_uint64[[N]] x, D xor_uint64[[N]] y)

max(parts)

Function for finding the maximum element in the specified parts of the vector.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

Parameters

x

- input vector

k

- an uint type value, which specifies into how many subarrays must the input array be divided

a vector with all the maximum elements of all the subarrays specified by k

input vector is not empty

the size of the input array is dividable by k

None

Function Overloads

D uint8 max(D uint8[[1]] x, uint k)

D uint16 max(D uint16[[1]] x, uint k)

D uint32 max(D uint32[[1]] x, uint k)

D uint max(D uint[[1]] x, uint k)

D int8 max(D int8[[1]] x, uint k)

D int16 max(D int16[[1]] x, uint k)

D int32 max(D int32[[1]] x, uint k)

D int max(D int[[1]] x, uint k)

min

Functions for finding the minimum value.

Functions:

min

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

min

Function for finding the minimum element of the input vector.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

x

- input

minimum element of the input vector.

input vector is not empty

None

Function Overloads

D T min(D T x)

D uint8 min(D uint8[[1]] x)

D uint16 min(D uint16[[1]] x)

D uint32 min(D uint32[[1]] x)

D uint min(D uint[[1]] x)

D int8 min(D int8[[1]] x)

D int16 min(D int16[[1]] x)

D int32 min(D int32[[1]] x)

D int min(D int[[1]] x)

D float32 min(D float32[[1]] x)

D float64 min(D float64[[1]] x)

D xor_uint8 min(D xor_uint8[[1]] x)

D xor_uint16 min(D xor_uint16[[1]] x)

D xor_uint32 min(D xor_uint32[[1]] x)

D xor_uint64 min(D xor_uint64[[1]] x)

min(2 vectors)

Function for finding the pointwise minimum of 2 arrays.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64 / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64

Parameters

x

- first argument

y

- second argument

an array with the pointwise minimum of each element in the two input vectors

both input vectors are of equal length

None

Function Overloads

D uint8 min(D uint8 x, D uint8 y)

D uint16 min(D uint16 x, D uint16 y)

D uint32 min(D uint32 x, D uint32 y)

D uint min(D uint x, D uint y)

D int8 min(D int8 x, D int8 y)

D int16 min(D int16 x, D int16 y)

D int32 min(D int32 x, D int32 y)

D int min(D int x, D int y)

D float32 min(D float32 x, D float32 y)

D float64 min(D float64 x, D float64 y)

D uint8 min(D uint8[[1]] x, D uint8[[1]] y)

D uint16 min(D uint16[[1]] x, D uint16[[1]] y)

D uint32 min(D uint32[[1]] x, D uint32[[1]] y)

D uint min(D uint[[1]] x, D uint[[1]] y)

D int8 min(D int8[[1]] x, D int8[[1]] y)

D int16 min(D int16[[1]] x, D int16[[1]] y)

D int32 min(D int32[[1]] x, D int32[[1]] y)

D int min(D int[[1]] x, D int[[1]] y)

D float32 min(D float32[[1]] x, D float32[[1]] y)

D float64 min(D float64[[1]] x, D float64[[1]] y)

D uint8 min(D uint8[[N]] x, D uint8[[N]] y)

D uint16 min(D uint16[[N]] x, D uint16[[N]] y)

D uint32 min(D uint32[[N]] x, D uint32[[N]] y)

D uint min(D uint[[N]] x, D uint[[N]] y)

D int8 min(D int8[[N]] x, D int8[[N]] y)

D int16 min(D int16[[N]] x, D int16[[N]] y)

D int32 min(D int32[[N]] x, D int32[[N]] y)

D int min(D int[[N]] x, D int[[N]] y)

D float32 min(D float32[[N]] x, D float32[[N]] y)

D float64 min(D float64[[N]] x, D float64[[N]] y)

D xor_uint8 min(D xor_uint8 x, D xor_uint8 y)

D xor_uint16 min(D xor_uint16 x, D xor_uint16 y)

D xor_uint32 min(D xor_uint32 x, D xor_uint32 y)

D xor_uint64 min(D xor_uint64 x, D xor_uint64 y)

D xor_uint8 min(D xor_uint8[[1]] x, D xor_uint8[[1]] y)

D xor_uint16 min(D xor_uint16[[1]] x, D xor_uint16[[1]] y)

D xor_uint32 min(D xor_uint32[[1]] x, D xor_uint32[[1]] y)

D xor_uint64 min(D xor_uint64[[1]] x, D xor_uint64[[1]] y)

D xor_uint8 min(D xor_uint8[[N]] x, D xor_uint8[[N]] y)

D xor_uint16 min(D xor_uint16[[N]] x, D xor_uint16[[N]] y)

D xor_uint32 min(D xor_uint32[[N]] x, D xor_uint32[[N]] y)

D xor_uint64 min(D xor_uint64[[N]] x, D xor_uint64[[N]] y)

min(parts)

Function for finding the minimum element in the specified parts of the vector.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

Parameters

x

- input vector

k

- an uint type value, which specifies into how many subarrays must the input array be divided

a vector with all the minimum elements of all the subarrays specified by k

input vector is not empty

the size of the input array is dividable by k

None

Function Overloads

D uint8 min(D uint8[[1]] x, uint k)

D uint16 min(D uint16[[1]] x, uint k)

D uint32 min(D uint32[[1]] x, uint k)

D uint min(D uint[[1]] x, uint k)

D int8 min(D int8[[1]] x, uint k)

D int16 min(D int16[[1]] x, uint k)

D int32 min(D int32[[1]] x, uint k)

D int min(D int[[1]] x, uint k)

product

Functions for finding products.

Functions:

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

product

Function for finding the product of the input vector.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

Parameters

vec

- a vector of supported type

The product of the input vector

None

Function Overloads

D T product(D T scalar)

D uint8 product(D uint8[[1]] vec)

D uint16 product(D uint16[[1]] vec)

D uint32 product(D uint32[[1]] vec)

D uint product(D uint[[1]] vec)

D int8 product(D int8[[1]] vec)

D int16 product(D int16[[1]] vec)

D int32 product(D int32[[1]] vec)

D int product(D int[[1]] vec)

product(parts)

Function for finding the product of all elements in the input vector in specified parts.

Detailed Description

D - shared3p protection domain

Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int

the length of the input array must be a multiple of k

Parameters

vec

- The input array of subarrays to find the product of. The subarrays are stacked one after another and are all of the same size.

k

- The number of subarrays in the input array.

The array of subarrayCount number of products, each corresponding to respective subarray in the input array vec.

None

Function Overloads

D uint8 product(D uint8[[1]] vec, uint k)

D uint16 product(D uint16[[1]] vec, uint k)

D uint32 product(D uint32[[1]] vec, uint k)

D uint product(D uint[[1]] vec, uint k)

D int8 product(D int8[[1]] vec, uint k)

D int16 product(D int16[[1]] vec, uint k)

D int32 product(D int32[[1]] vec, uint k)

D int product(D int[[1]] vec, uint k)

sum

Functions for finding sums.

Functions:

sum

D - shared3p protection domain

Supported types - bool / uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64

sum

Function for finding the sum of all the elements in a vector.

Detailed Description

D - shared3p protection domain

Supported types - bool / uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64

We are using a system call for summing vectors as it’s very common operation, and the performance overhead of manually summing is in the range of 100 to 200 times slower.

Parameters

vec

- a 1-dimensional array

the sum of all input vector elements

None

Function Overloads

D uint sum(D bool[[1]] vec)

boolean values are converted to numerical values and then added, for more info click here

returns the sum of all the elements in the input vector as an uint64 type value

D uint8 sum(D uint8[[1]] vec)

D uint16 sum(D uint16[[1]] vec)

D uint32 sum(D uint32[[1]] vec)

D uint sum(D uint[[1]] vec)

D int8 sum(D int8[[1]] vec)

D int16 sum(D int16[[1]] vec)

D int32 sum(D int32[[1]] vec)

D int sum(D int[[1]] vec)

D float32 sum(D float32[[1]] vec)

D float64 sum(D float64[[1]] vec)

D fix32 sum(D fix32[[1]] vec)

D fix64 sum(D fix64[[1]] vec)

sum(parts)

Function for finding the sum of all elements in the input vector in specified parts.

Detailed Description

D - shared3p protection domain

Supported types - bool / uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64

the length of the input array must be a multiple of k

Parameters

vec

- The input array of subarrays to sum. The subarrays are stacked one after another and are all of the same size.

k

- The number of subarrays in the input array.

The array of subarrayCount number of sums, each corresponding to respective subarray in the input array vec.

None

Function Overloads

D uint sum(D bool[[1]] vec, uint k)

D uint8 sum(D uint8[[1]] vec, uint k)

D uint16 sum(D uint16[[1]] vec, uint k)

D uint32 sum(D uint32[[1]] vec, uint k)

D uint sum(D uint[[1]] vec, uint k)

D int8 sum(D int8[[1]] vec, uint k)

D int16 sum(D int16[[1]] vec, uint k)

D int32 sum(D int32[[1]] vec, uint k)

D int sum(D int[[1]] vec, uint k)

D float32 sum(D float32[[1]] vec, uint k)

D float64 sum(D float64[[1]] vec, uint k)

D fix32 sum(D fix32[[1]] vec, uint k)

D fix64 sum(D fix64[[1]] vec, uint k)