c128

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package c128 provides complex128 vector primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.8.0

func Add(dst, s []complex128)

Add is

for i, v := range s {
	dst[i] += v
}

func AddConst added in v0.8.0

func AddConst(alpha complex128, x []complex128)

AddConst is

for i := range x {
	x[i] += alpha
}

func AxpyInc

func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr)

AxpyInc is

for i := 0; i < int(n); i++ {
	y[iy] += alpha * x[ix]
	ix += incX
	iy += incY
}

func AxpyIncTo

func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr)

AxpyIncTo is

for i := 0; i < int(n); i++ {
	dst[idst] = alpha*x[ix] + y[iy]
	ix += incX
	iy += incY
	idst += incDst
}

func AxpyUnitary

func AxpyUnitary(alpha complex128, x, y []complex128)

AxpyUnitary is

for i, v := range x {
	y[i] += alpha * v
}

func AxpyUnitaryTo

func AxpyUnitaryTo(dst []complex128, alpha complex128, x, y []complex128)

AxpyUnitaryTo is

for i, v := range x {
	dst[i] = alpha*v + y[i]
}

func CumProd added in v0.8.0

func CumProd(dst, s []complex128) []complex128

CumProd is

if len(s) == 0 {
	return dst
}
dst[0] = s[0]
for i, v := range s[1:] {
	dst[i+1] = dst[i] * v
}
return dst

func CumSum added in v0.8.0

func CumSum(dst, s []complex128) []complex128

CumSum is

if len(s) == 0 {
	return dst
}
dst[0] = s[0]
for i, v := range s[1:] {
	dst[i+1] = dst[i] + v
}
return dst

func Div added in v0.8.0

func Div(dst, s []complex128)

Div is

for i, v := range s {
	dst[i] /= v
}

func DivTo added in v0.8.0

func DivTo(dst, s, t []complex128) []complex128

DivTo is

for i, v := range s {
	dst[i] = v / t[i]
}
return dst

func DotUnitary added in v0.8.0

func DotUnitary(x, y []complex128) (sum complex128)

DotUnitary is

for i, v := range x {
	sum += cmplx.Conj(v) * y[i]
}
return sum

func DotcInc

func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128)

DotcInc is

for i := 0; i < int(n); i++ {
	sum += y[iy] * cmplx.Conj(x[ix])
	ix += incX
	iy += incY
}
return sum

func DotcUnitary

func DotcUnitary(x, y []complex128) (sum complex128)

DotcUnitary is

for i, v := range x {
	sum += y[i] * cmplx.Conj(v)
}
return sum

func DotuInc

func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128)

DotuInc is

for i := 0; i < int(n); i++ {
	sum += y[iy] * x[ix]
	ix += incX
	iy += incY
}
return sum

func DotuUnitary

func DotuUnitary(x, y []complex128) (sum complex128)

DotuUnitary is

for i, v := range x {
	sum += y[i] * v
}
return sum

func DscalInc

func DscalInc(alpha float64, x []complex128, n, inc uintptr)

DscalInc is

var ix uintptr
for i := 0; i < int(n); i++ {
	x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha)
	ix += inc
}

func DscalUnitary

func DscalUnitary(alpha float64, x []complex128)

DscalUnitary is

for i, v := range x {
	x[i] = complex(real(v)*alpha, imag(v)*alpha)
}

func L2DistanceUnitary added in v0.8.0

func L2DistanceUnitary(x, y []complex128) (norm float64)

L2DistanceUnitary returns the L2-norm of x-y.

func L2NormUnitary added in v0.8.0

func L2NormUnitary(x []complex128) (norm float64)

L2NormUnitary returns the L2-norm of x.

func ScalInc

func ScalInc(alpha complex128, x []complex128, n, inc uintptr)

ScalInc is

var ix uintptr
for i := 0; i < int(n); i++ {
	x[ix] *= alpha
	ix += incX
}

func ScalIncTo

func ScalIncTo(dst []complex128, incDst uintptr, alpha complex128, x []complex128, n, incX uintptr)

ScalIncTo is

var idst, ix uintptr
for i := 0; i < int(n); i++ {
	dst[idst] = alpha * x[ix]
	ix += incX
	idst += incDst
}

func ScalUnitary

func ScalUnitary(alpha complex128, x []complex128)

ScalUnitary is

for i := range x {
	x[i] *= alpha
}

func ScalUnitaryTo

func ScalUnitaryTo(dst []complex128, alpha complex128, x []complex128)

ScalUnitaryTo is

for i, v := range x {
	dst[i] = alpha * v
}

func Sum added in v0.8.0

func Sum(x []complex128) complex128

Sum is

var sum complex128
for i := range x {
    sum += x[i]
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL