Пример #1
0
func doScale(G *matrix.FloatMatrix, W *cvx.FloatMatrixSet) {
	g := matrix.FloatZeros(G.Rows(), 1)
	g.SetIndexes(matrix.MakeIndexSet(0, g.Rows(), 1), G.GetColumn(0, nil))
	fmt.Printf("** scaling g:\n%v\n", g)
	cvx.Scale(g, W, true, true)
	fmt.Printf("== scaled  g:\n%v\n", g)
}
Пример #2
0
func TestScale() {
	W, err := makeW()
	if err != nil {
		fmt.Printf("parse error: %s\n", err)
	}
	W.Print()
	ws3, _ := matrix.FloatParseSpe(ws3_0s)
	fmt.Printf("ws=\n%v\n", ws3)
	cvx.Scale(ws3, W, true, false)
	fmt.Printf("ws=\n%s\n", ws3.ConvertToString())

}