Extracting submatrix from matrix

From: Anonymous (nospam_at_noISP.com)
Date: 05/28/04


Date: Fri, 28 May 2004 17:31:35 GMT

Given a 2-dimensional array A(m,n), and lists of rows, R(m), and columns, C(n), how can I
create the submatrix of A consisting of A(r,c), where r is in R and c is in C?

Example (m=3, n=4):

   (1 2 3 4)
A=(5 6 7 8) R=(2,0,0) C=(2,4,0,0) submatrix=(6 8)
   (9 10 11 12)

    R=(2,3,0) C=(1,2,4,0,0) submatrix=(5 6 8)
                                        (9 10 12)

In R and C, 0 means no row or column is used.

sherNOwoodSPAM@computer.org (remove caps to get e-mail)



Relevant Pages

  • Re: garbage collection problem in large linked lists
    ... Instead all buckets are allocated at once in an array. ... VG.net, which must be very scalable, but only for lists which would normally ... Linked lists require pointer dereferencing in order to traverse. ... When you run out of space, you allocate a new smaller array. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Dict sharing vs. duplication
    ... array to enforce unique keys and I use lists to enforce order. ... API in a page or two of Tcl code, it isn't so much a missing feature ... OpenACS database API which creates a new specialized data structure, ...
    (comp.lang.tcl)
  • Re: Translating python to scheme
    ... Scheme has mutation, and there are reasons to use it. ... confusing when considering a 2d array. ... in other languages: Lisp Lists and Vectors. ...
    (comp.lang.scheme)
  • Re: vasam
    ... // Set the size for long lists in records #2 and #3 only! ... Here is the sequel of my previous post "Variable array sizes as members" ... I was given some advice on how to use malloc and realloc in oder to achieve ...
    (microsoft.public.vc.language)
  • Re: Approx mode creates largedr matricies
    ... real/complex "array" types ... In the "list (of lists)" alternate storage type, ... no ROM address is ever used, ... which started with the HP48S series) ...
    (comp.sys.hp48)