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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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.196.232 with SMTP id ip8mr15258051pbc.6.1340678929417; Mon, 25 Jun 2012 19:48:49 -0700 (PDT) Path: l9ni20422pbj.0!nntp.google.com!news2.google.com!postnews.google.com!g4g2000pbn.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix? Date: Mon, 25 Jun 2012 19:48:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: <788af57d-750d-418d-94bb-75c6557e36a9@g4g2000pbn.googlegroups.com> References: NNTP-Posting-Host: 97.117.193.220 Mime-Version: 1.0 X-Trace: posting.google.com 1340678929 29898 127.0.0.1 (26 Jun 2012 02:48:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Jun 2012 02:48:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g4g2000pbn.googlegroups.com; posting-host=97.117.193.220; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-06-25T19:48:48-07:00 List-Id: Most submatrix needs, including Nasser's example, can be handled by slices (or slice syntax--not sure what the difference is). Boolean masks would not often be needed. Why doesn't Ada provide this? It seems that one of the Ada design principles has been to build in commonly used features rather than force the user to write them, setting up the greater possibility of mistakes and inefficiencies. Slices exist for 1D arrays; why not for >1D arrays? The reverse operation, composition, is also useful. In Matlab/Octave (assuming compatible sizes): C = [A, B] makes A B and D = [A; B] makes A B and [0, 0, 0, A; B, 0, 0, 0] makes 0 0 0 A B 0 0 0 etc. Which brings me to one of my least favorite Ada features, the use of () instead of [] for array indices. Talk about a readability killer. But I'm sure that's been beat to death many times. (No, it's not because [] are not part of ASCII.) Jerry