本文整理汇总了Golang中github.com/cpmech/gosl/io.Ff函数的典型用法代码示例。如果您正苦于以下问题:Golang Ff函数的具体用法?Golang Ff怎么用?Golang Ff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Ff函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Title
func Title(txt, args string) {
if len(args) > 0 {
io.Ff(&bb, "title('%s',%s)\n", txt, args)
} else {
io.Ff(&bb, "title('%s')\n", txt)
}
}
示例2: PlotOne
func PlotOne(x, y float64, args string) {
if len(args) > 0 {
io.Ff(&bb, "plot(%23.15e,%23.15e,%s)\n", x, y, args)
} else {
io.Ff(&bb, "plot(%23.15e,%23.15e)\n", x, y)
}
}
示例3: Text
func Text(x, y float64, txt, args string) {
if len(args) > 0 {
io.Ff(&bb, "text(%g,%g,'%s',%s)\n", x, y, txt, args)
} else {
io.Ff(&bb, "text(%g,%g,'%s')\n", x, y, txt)
}
}
示例4: Cross
func Cross(args string) {
if len(args) > 0 {
io.Ff(&bb, "Cross(%s)\n", args)
} else {
io.Ff(&bb, "Cross()\n")
}
}
示例5: GenArray
// GenArray generates the NumPy text in 'b' corresponding to an array of float point numbers
func GenArray(b *bytes.Buffer, name string, u []float64) {
io.Ff(b, "%s=array([", name)
for i, _ := range u {
io.Ff(b, "%g,", u[i])
}
io.Ff(b, "],dtype=float)\n")
}
示例6: GenStrArray
// GenStrArray generates the NumPy text in 'b' corresponding to an array of strings
func GenStrArray(b *bytes.Buffer, name string, u []string) {
io.Ff(b, "%s=[", name)
for i, _ := range u {
io.Ff(b, "%q,", u[i])
}
io.Ff(b, "]\n")
}
示例7: write_python_array
func write_python_array(buf *bytes.Buffer, name string, x []float64) {
io.Ff(buf, "%s=np.array([", name)
for i := 0; i < len(x); i++ {
io.Ff(buf, "%g,", x[i])
}
io.Ff(buf, "])\n")
}
示例8: SupTitle
func SupTitle(txt, args string) {
n := bb.Len()
if len(args) > 0 {
io.Ff(&bb, "st%d = suptitle('%s',%s)\n", n, txt, args)
} else {
io.Ff(&bb, "st%d = suptitle('%s')\n", n, txt)
}
io.Ff(&bb, "ea.append(st%d)\n", n)
}
示例9: xResRow
// xResRow adds row to table with X results
func (o *TexReport) xResRow(opt *Optimiser) {
if !o.singleObj {
return
}
io.Ff(o.bxres, "%s &\n", opt.RptName)
io.Ff(o.bxres, " $x_{best} = $"+opt.RptFmtX+" \\\\ \n", opt.BestOfBestFlt)
if len(opt.RptXref) == opt.Nflt {
io.Ff(o.bxres, "& $x_{ref.} = $"+opt.RptFmtX+" \\\\ \n", opt.RptXref)
}
}
示例10: GenList
// GenList generates list
func GenList(buf *bytes.Buffer, name string, a [][]float64) {
io.Ff(buf, "%s=[", name)
for i, _ := range a {
io.Ff(buf, "[")
for j, _ := range a[i] {
io.Ff(buf, "%g,", a[i][j])
}
io.Ff(buf, "],")
}
io.Ff(buf, "]\n")
}
示例11: Plot
func Plot(x, y []float64, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
Gen2Arrays(&bb, sx, sy, x, y)
if len(args) > 0 {
io.Ff(&bb, "plot(%s,%s,%s)\n", sx, sy, args)
} else {
io.Ff(&bb, "plot(%s,%s)\n", sx, sy)
}
}
示例12: GenMat
// GenMat generates matrix
func GenMat(buf *bytes.Buffer, name string, a [][]float64) {
io.Ff(buf, "%s=array([", name)
for i, _ := range a {
io.Ff(buf, "[")
for j, _ := range a[i] {
io.Ff(buf, "%g,", a[i][j])
}
io.Ff(buf, "],")
}
io.Ff(buf, "],dtype=float)\n")
}
示例13: write_python_matrix
func write_python_matrix(buf *bytes.Buffer, name string, xy [][]float64) {
io.Ff(buf, "%s=np.array([", name)
for i := 0; i < len(xy); i++ {
io.Ff(buf, "[")
for j := 0; j < len(xy[i]); j++ {
io.Ff(buf, "%g,", xy[i][j])
}
io.Ff(buf, "],\n")
}
io.Ff(buf, "])\n")
}
示例14: Hist
func Hist(x [][]float64, labels []string, args string) {
n := bb.Len()
sx := io.Sf("x%d", n)
sy := io.Sf("y%d", n)
GenList(&bb, sx, x)
GenStrArray(&bb, sy, labels)
if len(args) > 0 {
io.Ff(&bb, "hist(%s,label=%s,%s)\n", sx, sy, args)
} else {
io.Ff(&bb, "hist(%s,label=%s)\n", sx, sy)
}
}
示例15: vtu_write
func vtu_write(geo, dat *bytes.Buffer) {
if geo == nil || dat == nil {
return
}
nv := len(verts)
nc := len(cells)
var hdr, foo bytes.Buffer
io.Ff(&hdr, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n<UnstructuredGrid>\n")
io.Ff(&hdr, "<Piece NumberOfPoints=\"%d\" NumberOfCells=\"%d\">\n", nv, nc)
io.Ff(&foo, "</Piece>\n</UnstructuredGrid>\n</VTKFile>\n")
io.WriteFileVD(dirout, fnkey+".vtu", &hdr, geo, dat, &foo)
}