util

package
v3.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2014 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	X = 0
	Y = 1
	Z = 2
)

Indices for vector components

Variables

This section is empty.

Functions

func Argument

func Argument(test bool)

Panics with "illegal argument" if test is false.

func Assert

func Assert(test bool)

Panics with "assertion failed" if test is false.

func AssertMsg

func AssertMsg(test bool, msg interface{})

Panics with msg if test is false

func FatalErr

func FatalErr(err interface{}, msg ...interface{})

If err != nil, trigger log.Fatal(msg, err)

func Fprint

func Fprint(out io.Writer, array ...interface{})

Produces nicely formatted output for multi-dimensional arrays.

func Fprintf

func Fprintf(out io.Writer, format string, array ...interface{})

Produces nicely formatted output for multi-dimensional arrays.

func FprintfFloats

func FprintfFloats(out io.Writer, format string, a [][][]float32)

Produces nicely formatted output.

func FprintfTensors

func FprintfTensors(out io.Writer, format string, a [][][][]float32)

Produces nicely formatted output.

func LogErr

func LogErr(err error, msg ...interface{})

Logs the error of non-nil, plus message

func NoExt

func NoExt(file string) string

Remove extension from file name.

func PanicErr

func PanicErr(err error)

Panics if err is not nil. Signals a bug.

func Print

func Print(array ...interface{})

Produces nicely formatted output for multi-dimensional arrays.

func Printf

func Printf(format string, array ...interface{})

Produces nicely formatted output for multi-dimensional arrays.

func Println

func Println(array ...interface{})

Produces nicely formatted output for multi-dimensional arrays.

func SwapIndex

func SwapIndex(index, dim int) int

Transforms the index between user and program space, unless it is a scalar:

X  <-> Z
Y  <-> Y
Z  <-> X
XX <-> ZZ
YY <-> YY
ZZ <-> XX
YZ <-> XY
XZ <-> XZ
XY <-> YZ

Types

This section is empty.

Jump to

Keyboard shortcuts

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