Documentation
¶
Index ¶
- func Average(v []float64) float64
- func DataExport(data [][]float64, fileName string)
- func MatToStr(M [][]float64) [][]string
- func MatToVec(M [][]float64) []float64
- func MatVecMult(M [][]float64, v []float64) []float64
- func ModMatFloat(M [][]float64, q uint64) [][]uint64
- func ModVec(v []int64, q uint64) []uint64
- func ModVecFloat(v []float64, q uint64) []uint64
- func RoundVec(v []float64) []int64
- func ScalMatMult(s float64, M [][]float64) [][]float64
- func ScalVecMult(s float64, v []float64) []float64
- func ScalVecMultInt(s int64, v []int64) []int64
- func SignFloat(s float64, T uint64) float64
- func Vec2Norm(v []float64) float64
- func VecAdd(v1 []float64, v2 []float64) []float64
- func VecDuplicate(v []float64, n int, h int) []float64
- func VecSub(v1 []float64, v2 []float64) []float64
- func VecSumUint(v []uint64, T uint64, bredparams [2]uint64) uint64
- func VecToStr(v []float64) [][]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataExport ¶
func MatToStr ¶
Convert a matrix to a string Input - M : m x n float matrix Output - strOut : m x n string matrix
func MatToVec ¶
Convert a matrix to a vector The matrix must have 1 column Input - M : m x 1 float matrix Output - vOut : m x 1 float vector
func MatVecMult ¶
Multiply a matrix to a vector Input - M : m x n float matrix - v : n x 1 float vector Output - vOut: m x l float vector
func ModMatFloat ¶
Mod q of float matrix Each component of MOut belongs to [0, q). Input - M : m x n float matrix Output - MOut: m x n uint64 matrix
func ModVecFloat ¶
Mod q of float vector Each component of vOut belongs to [0, q). Input - v : m x 1 float vector Output - vOut: m x 1 uint64 vector
func RoundVec ¶
Rounding of a vector Input - v : n x 1 float vector Output - v : n x 1 float vector
func RoundVec(v []float64) []float64 {
row := len(v)
vOut := make([]float64, row)
for r := 0; r < row; r++ {
vOut[r] = math.Round(v[r])
}
return vOut
}
func ScalMatMult ¶
Multiply a scalar to a matrix Input - s : scalar float - M : m x n float matrix Output - MOut: m x n float matrix
func ScalVecMult ¶
Multiply a scalar to a vector Input - s : scalar float - v : m x 1 float vector Output - vOut: m x 1 float vector
func ScalVecMultInt ¶
func VecAdd ¶
Add a vector to a vector Input - v1 : m x 1 float vector - v2 : m x 1 float vector Output - vOut: m x 1 float vector
func VecDuplicate ¶
Duplicate + zero padding length h vector n times Length of a must be less than or equal to h Input - v : float vector Output - v: nh x 1 float vector
func VecSub ¶
Subtract a vector to a vector Input - v1 : m x 1 float vector - v2 : m x 1 float vector Output - vOut: m x 1 float vector
func VecSumUint ¶
Inner sum of vector elements (mod q) Input - v : m x 1 uint64 vector Output - sum: scalar uint64
Types ¶
This section is empty.