Documentation ¶
Overview ¶
Package blas contains linear algebra routines for matrix manipulation with optional OpenCL acceleration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SeedRandom ¶
SeedRandom function sets the random seed, or seeds using time if input is zero. Returns the seed which was used.
Types ¶
type BinaryCL ¶
BinaryCL type represents a user function of two variables.
func NewBinaryCL ¶
NewUnaryCL function compiles a new function of one variable
type BinaryFunction ¶
Function2 interface applies a function elementwise to two matrices
type Image ¶
type Image interface { Import(in ...Matrix) Export(xv, yv, out Matrix) SetOrigin(x0, y0 float32) Image Scale(xscale, yscale, dx, dy Matrix) Rotate(angle, dx, dy Matrix) Release() }
Image interface type represents a 2 dimensional image.
type Impl ¶
type Impl int
Different implementations which can be selected
const ( Native32 Impl OpenCL32 )
func Implementation ¶
func Implementation() Impl
Implementation function returns the current implementation
type Matrix ¶
type Matrix interface { Rows() int Cols() int Size() int Release() Copy(m, ix Matrix) Matrix Transpose(m Matrix) Matrix Reshape(rows, cols int, shrink bool) Matrix Set(val float32) Matrix Load(Ordering, ...float32) Matrix Random(min, max float32) Matrix Data(Ordering) []float32 Col(col1, col2 int) Matrix Row(row1, row2 int) Matrix Scale(s float32) Matrix Add(a, b Matrix, sc float32) Matrix Cmp(a, b Matrix, epsilon float32) Matrix Mul(a, b Matrix, aTrans, bTrans, oTrans bool) Matrix MulElem(a, b Matrix) Matrix Sum() float32 SumRows(a Matrix) Matrix MaxCol(m Matrix) Matrix Norm(m Matrix) Matrix Histogram(m Matrix, bins int, min, max float32) Matrix SetFormat(string) String() string }
Matrix interface type represents a fix size matrix of row x cols.
func GaussianKernel ¶
Create a gaussian kernel with given size and standard deviation, xs and ys should be odd
type UnaryCL ¶
UnaryCL type represents a user function of one variable.
func NewUnaryCL ¶
NewUnaryCL function compiles a new function of one variable
type UnaryFunction ¶
UnaryFunction interface type represents a function which can be applied elementwise to a matrix