Previous Page Next Page Contents

linalg::multRow -- multiply rows with a scalar

Introduction

linalg::multRow(A, r, s) returns a copy of the matrix A resulting from A by multiplying the r-th row of A with the scalar s.

Call(s)

linalg::multRow(A, r, s)
linalg::multRow(A, r1..r2, s)
linalg::multRow(A, list, s)

Parameters

A - an m x n matrix of a domain of category Cat::Matrix
r - the row index: a positive integer <= m
r1..r2 - a range of row indices (positive integers <= m)
list - a list of row indices (positive integers <= m)

Returns

a matrix of the same domain type as A.

Related Functions

linalg::addCol, linalg::addRow, linalg::multCol

Details

Example 1

We define the following matrix:

>> A := matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
                               +-         -+
                               |  1, 2, 3  |
                               |           |
                               |  4, 5, 6  |
                               |           |
                               |  7, 8, 9  |
                               +-         -+

and illustrate the three different input formats for linalg::multRow:

>> linalg::multRow(A, 2, -1)
                             +-            -+
                             |   1,  2,  3  |
                             |              |
                             |  -4, -5, -6  |
                             |              |
                             |   7,  8,  9  |
                             +-            -+
>> linalg::multRow(A, 1..2, 2)
                              +-           -+
                              |  2,  4,  6  |
                              |             |
                              |  8, 10, 12  |
                              |             |
                              |  7,  8,  9  |
                              +-           -+
>> linalg::multRow(A, [3, 1], 0)
                               +-         -+
                               |  0, 0, 0  |
                               |           |
                               |  4, 5, 6  |
                               |           |
                               |  0, 0, 0  |
                               +-         -+




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000