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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1e40bdb19094c551,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.236.170 with SMTP id uv10mr11515391pbc.4.1333508127016; Tue, 03 Apr 2012 19:55:27 -0700 (PDT) Path: r9ni15985pbh.0!nntp.google.com!news1.google.com!postnews.google.com!f6g2000vbc.googlegroups.com!not-for-mail From: Will Newsgroups: comp.lang.ada Subject: Array/Matrix Help Date: Tue, 3 Apr 2012 19:55:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 134.240.94.59 Mime-Version: 1.0 X-Trace: posting.google.com 1333508126 13186 127.0.0.1 (4 Apr 2012 02:55:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 4 Apr 2012 02:55:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f6g2000vbc.googlegroups.com; posting-host=134.240.94.59; posting-account=CZZpzgoAAAAoaHoNNp9zhY9EzQgEmxhU User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-03T19:55:26-07:00 List-Id: I need to create function Create_Matrix that accepts four Int_Arrays. It must determine if all 4 Int_Arrays are of equal length and then creates and returns an Int_Matrix of the 2 or more arrays with equal length. Here is what I am thinking so far, I believe it will work but seems inefficient and I am looking for efficiency in my coding. I am not sure how to determine which ones are equal other than a bunch of if/ elsif statement that cover every possible combination of them being equal then write the code that will create the matrix for that given combination of arrays. Any ideas on something better than the following. I am assuming that there will not be 2 sets of arrays that are equal (i.e. 2 arrays of length 5 , and another 2 of length 7) There would only be 1 common length. function Create_Matrix (A, B, C, D : Int_Array) return Int_Matrix begin if A'Length = B'Length and A'Length = C'Length and A'Length = D'Length then Then continue to do this all the way until I cover every combination of 2 or more arrays that are equal length and then whichever if statement it satisfies create the Int_Matrix by each array being its own line inside the matrix. Can anyone offer help or ideas. Any hints/help is greatly appreciated... I prefer that over just giving me the code. -Will