Previous Page Next Page Contents

linalg::row -- extract rows of a matrix

Introduction

linalg::row(A, r) extracts the r-th row vector of the matrix A.

Call(s)

linalg::row(A, r)
linalg::row(A, r1..r2)
linalg::row(A, list)

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 single row vector or a list of row vectors; a row vector is a 1 x n matrix of category Cat::Matrix(R), where R is the component ring of A.

Related Functions

linalg::col, linalg::delCol, linalg::delRow, linalg::setCol, linalg::setRow

Details

Example 1

We define a matrix over Q:

>> A := Dom::Matrix(Dom::Rational)( 
     [[1, 1/5], [-3/2, 5], [2, -3]] 
   )
                              +-           -+
                              |    1,  1/5  |
                              |             |
                              |  -3/2,  5   |
                              |             |
                              |    2,   -3  |
                              +-           -+

and illustrate the three different input formats for the function linalg::row:

>> linalg::row(A, 2)
                                +-       -+
                                | -3/2, 5 |
                                +-       -+
>> linalg::row(A, [2, 1, 3])
                 -- +-       -+  +-      -+  +-     -+ --
                 |  | -3/2, 5 |, | 1, 1/5 |, | 2, -3 |  |
                 -- +-       -+  +-      -+  +-     -+ --
>> linalg::row(A, 2..3)
                       -- +-       -+  +-     -+ --
                       |  | -3/2, 5 |, | 2, -3 |  |
                       -- +-       -+  +-     -+ --




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000