Documentation ¶
Index ¶
- Variables
- func ForceFree()
- func Free()
- func LogFile() *os.File
- func MeasureTime(s time.Time, d string)
- func Printf(str string, vals ...interface{})
- func Println(str string)
- func RandFloat64() float64
- func RandIntn(n int) int
- func RandNormFloat64() float64
- func RandomComb(u int, v int, m int) [][2]int
- func RefreshRandom(s int64) *rand.Rand
- func Seed() int64
- func SetLogFile(filename string) (*os.File, error)
- func StartTimer()
- func StopTimer() time.Duration
Constants ¶
This section is empty.
Variables ¶
var ( Width = 46 Height = 56 Max = 8 )
Image vars
var ( Pval = 0.0001 Eps = 4.0 Mp = 4 )
Gens parameters
var ( EqualEpsilon = 1e-5 LogEqualEpsilon float64 )
Math
var ( MemLowBoundShrink = 1024 MemConservative = false )
Memory variables
var (
Random *rand.Rand
)
var (
Verbose = false
)
Global config
Functions ¶
func ForceFree ¶
func ForceFree()
ForceFree forces the garbage collector to free memory regardless of sys.MemConservative.
func Free ¶
func Free()
Free forces the garbage collector to free memory. Blocks the program until GC is done.
func LogFile ¶
LogFile returns the log file. The default log file is os.Stdout, which is the standard output device.
func MeasureTime ¶
MeasureTime takes a start time s and a string d. MeasureTime will time s with the current time and print with GoSPN's Printf a string of format ("%s took %s.", d, s). Consider using it as:
func funcToTime() { defer sys.MeasureTime(time.Now(), "funcToTime") // ... }
Since arguments are evaluated before function call, the function will print the correct funcToTime run time.
func Printf ¶
func Printf(str string, vals ...interface{})
Printf is a wrapper for fmt.Printf. Only prints if Verbose is set to true.
func Println ¶
func Println(str string)
Println is a wrapper for fmt.Println. Only prints if Verbose is set to true.
func RandFloat64 ¶
func RandFloat64() float64
func RandNormFloat64 ¶
func RandNormFloat64() float64
func RefreshRandom ¶
RandSeed sets the pseudo-random generator's seed and resets the
func SetLogFile ¶
SetLogFile forces GoSPN to write all content to a log file. If filename is empty, writes to standard output. Returns the file pointer and errors if any.
Types ¶
This section is empty.