Ask Your Question
0

Matrix operations

asked 2022-03-28 16:52:39 +0200

Cyrille gravatar image

Tree questions in one : 1) If I follow the quickref guide the following code

AA=matrix([[3,-2,2],[1,-4,4],[1,-1,1]]

AA.rescale_row(0,-1)

should return

matrix([[-3,2,-2],[1,-4,4],[1,-1,1]]

but I see no change. What gos wrong ?

2) Is ther a way to decuplate a line and rescale it without retransforming the matrix in list?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-28 17:15:02 +0200

tmonteil gravatar image

The rescale_row method acts in place, which means that it does not return anything, but modifies the matrix:

sage: AA=matrix([[3,-2,2],[1,-4,4],[1,-1,1]])
sage: AA
[ 3 -2  2]
[ 1 -4  4]
[ 1 -1  1]
sage: AA.rescale_row(0,-1)
sage: AA
[-3  2 -2]
[ 1 -4  4]
[ 1 -1  1]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-03-28 16:52:39 +0200

Seen: 134 times

Last updated: Mar 28 '22