cmath

package
v0.0.0-...-ac1304b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2013 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

Compute Abs(A), Returns a new float valued matrix.

func Add

func Add(A *matrix.ComplexMatrix, alpha complex128, indexes ...int) *matrix.ComplexMatrix

Make a copy C of A and compute C += alpha for all elements in the matrix if list of indexes is empty. Otherwise compute C[i] += alpha for indexes in column-major order.

func AddAt

func AddAt(A *matrix.ComplexMatrix, values []complex128, indexes []int) *matrix.ComplexMatrix

Make copy C of A and compute C[indexes[i]] += values[i]. Indexes are in column-major order. Returns a new matrix.

func Apply

func Apply(A *matrix.ComplexMatrix, fn func(complex128) complex128, indexes ...int) *matrix.ComplexMatrix

Make a copy C of A and apply function fn element wise to C. For indexes is not empty then C[indexes[i]] = fn(C[indexes[i]]). Returns a new matrix.

func ApplyConst

func ApplyConst(A *matrix.ComplexMatrix, x complex128, fn func(complex128, complex128) complex128, indexes ...int) *matrix.ComplexMatrix

Make a copy C of A and apply function fn element wise to C. For indexes is not empty then C[indexes[i]] = fn(C[indexes[i]], x). Returns a new matrix.

func ApplyConstValues

func ApplyConstValues(A *matrix.ComplexMatrix, values []complex128, fn func(complex128, complex128) complex128, indexes []int) *matrix.ComplexMatrix

Makes a copy of A and for all elements pointed by the element of the indexes array calculates fn(A[k], values[i]) where k is the i'th value in the indexes array.

func Complex

func Complex(Real, Imag *matrix.FloatMatrix) *matrix.ComplexMatrix

Return Complex(Real, Imag). Return a new matrix.

func Conj

func Conj(A *matrix.ComplexMatrix, indexes ...int) *matrix.ComplexMatrix

Compute element-wise C = Conj(A). Returns a new matrix.

func Div

Compute element wise division C[i,j] = A[i,j] / B[i,j]. Returns new matrix.

func Exp

func Exp(A *matrix.ComplexMatrix, indexes ...int) *matrix.ComplexMatrix

Compute element-wise C = Exp(A). Returns a new matrix.

func Imag

Return Imag(A).

func Inv

func Inv(A *matrix.ComplexMatrix, indexes ...int) *matrix.ComplexMatrix

Make a copy C of A and compute inverse C[i] = 1.0/C[i]. If indexes is empty calculates for all elements. Returns a new matrix.

func Log

func Log(A *matrix.ComplexMatrix, indexes ...int) *matrix.ComplexMatrix

Compute element-wise C = Log(A). Returns a new matrix.

func Minus

func Minus(matrices ...*matrix.ComplexMatrix) *matrix.ComplexMatrix

Compute element-wise difference C = A - B. Returns a new matrix.

func Mul

Compute element-wise product C[i,j] = A[i,j] * B[i,j]. Returns new matrix.

func Plus

func Plus(matrices ...*matrix.ComplexMatrix) *matrix.ComplexMatrix

Compute element-wise sum C = A + B. Returns a new matrix.

func Pow

func Pow(A *matrix.ComplexMatrix, exp complex128, indexes ...int) *matrix.ComplexMatrix

Compute element-wise C = Pow(A). Returns a new matrix.

func Real

Return Real(A).

func Scale

func Scale(A *matrix.ComplexMatrix, alpha complex128, indexes ...int) *matrix.ComplexMatrix

Make a copy C of A and compute C *= alpha for all elements in the matrix if list of indexes is empty. Otherwise compute C[i] *= alpha for i in indexes array.

func ScaleAt

func ScaleAt(A *matrix.ComplexMatrix, values []complex128, indexes []int) *matrix.ComplexMatrix

Make a copy C of A and compute for all k in indexes: C[k] *= values[k]. Indexes are in column-major order. Returns a new matrix

func Sqrt

func Sqrt(A *matrix.ComplexMatrix, indexes ...int) *matrix.ComplexMatrix

Compute element-wise C = Sqrt(A). Returns a new matrix.

func Times

Compute matrix product C = A * B where A is m*p and B is p*n. Returns a new m*n matrix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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