SecreC 2 language 2.9.0 (2026.10)
Language and standard library reference
Loading...
Searching...
No Matches
Functions

Functions

template<domain D :shared3p >
D float32 unitVector (D float32 x)
 
template<domain D :shared3p >
D float64 unitVector (D float64 x)
 

Detailed Description

Function for finding the unit vector of the input vector.

Note
D - shared3p protection domain
Supported types - float32 / float64

Function Documentation

◆ unitVector() [1/2]

template<domain D :shared3p >
D float32 unitVector ( D float32  x)
Parameters
x- vector of supported type
Returns
returns the unit vector for the input vector
Parameters
x- matrix of supported type
Returns
returns a matrix with the unit vector of each row in the input matrix

◆ unitVector() [2/2]

template<domain D :shared3p >
D float64 unitVector ( D float64  x)
Parameters
x- vector of supported type
Returns
returns the unit vector for the input vector
Parameters
x- matrix of supported type
Returns
returns a matrix with the unit vector of each row in the input matrix