From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,32d9aa9d79729b31 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.162 with SMTP id wj2mr4167639pbc.2.1340613427190; Mon, 25 Jun 2012 01:37:07 -0700 (PDT) Path: l9ni17558pbj.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 25 Jun 2012 10:36:46 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix? References: <1xzo3825h9yt7$.45flobqwlel6.dlg@40tude.net> In-Reply-To: Message-ID: <4fe8231d$0$6633$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 25 Jun 2012 10:36:45 CEST NNTP-Posting-Host: af842eda.newsspool2.arcor-online.net X-Trace: DXC=>PFJgHLA>7N2:OR3:3gaE@A9EHlD;3YcB4Fo<]lROoRA8kFejVHUA8SZ>dQUNG1Hkde9aN:oE X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-06-25T10:36:45+02:00 List-Id: On 25.06.12 08:32, Nasser M. Abbasi wrote: > > In Mathematica for example, I do this whole operation in one line: > > --------------------------- > Table[ReplacePart[A,{{i},{i,_},{_,j}}:>Sequence[]],{i,nRow},{j,nCol}]; > --------------------------- > > That is all. This generates all submatrices from A as needed > in this problem :) What if, as is usually the case, you'd have "primitive" array routines like Pick, Take, Drop, Transpose, and then (this is what it looks like here) implement the removals at i, j like like this: Shrunk := Transpose (Drop (i, Transpose (Drop (j, Matrix))));