Пример #1
0
// See function Asum.
func AsumComplex(X *matrix.ComplexMatrix, opts ...linalg.Option) (v float64, err error) {
	v = 0.0
	ind := linalg.GetIndexOpts(opts...)
	err = check_level1_func(ind, fasum, X, nil)
	if err != nil {
		return
	}
	if ind.Nx == 0 {
		return
	}
	Xa := X.ComplexArray()
	v = dzasum(ind.Nx, Xa[ind.OffsetX:], ind.IncX)
	return
}
Пример #2
0
// See function Dotc.
func DotcComplex(X, Y *matrix.ComplexMatrix, opts ...linalg.Option) (v complex128, err error) {
	v = 0.0
	ind := linalg.GetIndexOpts(opts...)
	err = check_level1_func(ind, fdot, X, Y)
	if err != nil {
		return
	}
	if ind.Nx == 0 {
		return
	}
	Xa := X.ComplexArray()
	Ya := Y.ComplexArray()
	v = zdotc(ind.Nx, Xa[ind.OffsetX:], ind.IncX, Ya[ind.OffsetY:], ind.IncY)
	return
}