conv

package
v0.0.0-...-dfba71b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package conv provides matrix type interconversion utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImag

func NewImag(m cmat128.Matrix) mat64.Matrix

NewImag returns a mat64.Matrix representing the imaginary part of m. If m is an Imager, the imaginary part is returned.

func NewReal

func NewReal(m cmat128.Matrix) mat64.Matrix

NewReal returns a mat64.Matrix representing the real part of m. If m is a Realer, the real part is returned.

Types

type Complex

type Complex struct {
	// contains filtered or unexported fields
}

Complex is a complex matrix constructed from two real matrices.

func NewComplex

func NewComplex(r, i mat64.Matrix) Complex

NewComplex returns a complex matrix constructed from r and i. At least one of r or i must be non-nil otherwise NewComplex will panic. If one of the inputs is nil, that part of the complex number will be zero when returned by At. If both are non-nil but differ in their sizes, NewComplex will panic.

func (Complex) At

func (m Complex) At(i, j int) complex128

At returns the element at row i, column j.

func (Complex) Dims

func (m Complex) Dims() (r, c int)

Dims returns the number of rows and columns in the matrix.

func (Complex) H

func (m Complex) H() cmat128.Matrix

H performs an implicit transpose.

func (Complex) Imag

func (m Complex) Imag() mat64.Matrix

Imag returns the imaginary part of the receiver.

func (Complex) Real

func (m Complex) Real() mat64.Matrix

Real returns the real part of the receiver.

type Imag

type Imag struct {
	// contains filtered or unexported fields
}

Imag is the imaginary part of a complex matrix.

func (Imag) At

func (m Imag) At(i, j int) float64

At returns the element at row i, column j.

func (Imag) Dims

func (m Imag) Dims() (r, c int)

Dims returns the number of rows and columns in the matrix.

func (Imag) T

func (m Imag) T() mat64.Matrix

T performs an implicit transpose.

type Imager

type Imager interface {
	Imag() mat64.Matrix
}

Imager is a complex matrix that can return its imaginary part.

type Real

type Real struct {
	// contains filtered or unexported fields
}

Real is the real part of a complex matrix.

func (Real) At

func (m Real) At(i, j int) float64

At returns the element at row i, column j.

func (Real) Dims

func (m Real) Dims() (r, c int)

Dims returns the number of rows and columns in the matrix.

func (Real) T

func (m Real) T() mat64.Matrix

T performs an implicit transpose.

type Realer

type Realer interface {
	Real() mat64.Matrix
}

Realer is a complex matrix that can return its real part.

Jump to

Keyboard shortcuts

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