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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC 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.219.170 with SMTP id pp10mr10167816pbc.1.1340540214460; Sun, 24 Jun 2012 05:16:54 -0700 (PDT) Path: l9ni14356pbj.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix? Date: Sun, 24 Jun 2012 07:16:50 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <1xzo3825h9yt7$.45flobqwlel6.dlg@40tude.net> Reply-To: nma@12000.org NNTP-Posting-Host: KdJUrTuvv3Zv/s8pPxNluw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-06-24T07:16:50-05:00 List-Id: On 6/24/2012 6:10 AM, Dmitry A. Kazakov wrote: > And to me the problem is not clear. Are you writing a concrete program or > considering a proper way to model matrix lattices in a strongly typed > programming language? The difference is huge. > > Dmitry; I was try to implement, just for fun, finding the adjungate matrix, using the direct algorithm using Ada, as shown here: http://en.wikipedia.org/wiki/Adjugate_matrix it requires finding the cofactors of each element in a 2D matrix. Hence needed a simply way to obtain a submatrix from the main matrix. I understand that slices are not supported for 2D matrices in Ada. Only for 1D. I think something like pack() (and unpack()) functions would be useful to have in Ada: http://fortranwiki.org/fortran/show/pack pack() allows one to extract rows/columns, not necessarily in sequence, out of a matrix using a mask matrix. This is very useful for many linear algebra operations on matrices. thanks, --Nasser