示例#1
0
文件: blas.go 项目: rygomez/goutil
func Ddot(N int, X []float64, incX int, Y []float64, incY int) float64 {
	val := C.ddot_((*C.int)(unsafe.Pointer(&N)),
		array64(X),
		(*C.int)(unsafe.Pointer(&incX)),
		array64(Y),
		(*C.int)(unsafe.Pointer(&incY)))
	return float64(val)
}
示例#2
0
// Calculates X.T*Y
func ddot(N int, X []float64, incX int, Y []float64, incY int) float64 {
	var val C.double
	val = C.ddot_((*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&X[0])),
		(*C.int)(unsafe.Pointer(&incX)),
		(*C.double)(unsafe.Pointer(&Y[0])),
		(*C.int)(unsafe.Pointer(&incY)))
	return float64(val)
}