Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 06 Feb 2013 10:13:31 -0600 Date: Wed, 06 Feb 2013 16:13:29 +0000 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: compare several boolean =?windows-1252?Q?matrix=92s?= References: <8f60207e-f848-490b-a402-7cc1aba657e9@googlegroups.com> <6479f031-e796-4e27-ba9c-d5d77465159e@googlegroups.com> In-Reply-To: <6479f031-e796-4e27-ba9c-d5d77465159e@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 73 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-lIgzWNMT6b0ilbP+EaW5NvlT6HmLxnM0NPsVB//hQPZpZDL8dCmkyVjbmPDakdIl+0BVng+GvjBe0Up!omWxQMBpEY2YUDPVAej7XRmpB8kcWwURiA2VSUWzTXQP2yjhKMK987YpyWxmC6JHHwBKIzKZrDo= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2993 Xref: csiph.com comp.lang.java.programmer:22166 On 06/02/13 14:35, Keivan Jafari wrote: > Den tisdagen den 5:e februari 2013 kl. 20:19:58 UTC+1 skrev Keivan Jafari: >> Hi there, >> >> >> >> Is there any way to compare several boolean matrix’s(25 matrix’s) and pick up a final valid matrix of those 25. >> >> >> >> The elements in the valid matrix will be, an example: >> >> >> >> If matrix M(0) to M(5) element(21) have value false >> >> >> >> And if matrix M(6) to M(24) element(21) have value true, Then most probably the value of element 21 is true, since much more matrix’s shows that that element 21 value is true >> >> >> >> Java code will be mostly appreciated >> >> >> >> Best regards/ >> >> >> >> Keivan > > > No, check below: > > matrix 1 > 0 | 1 | 0 > 1 | 1 | 0 > 0 | 0 | 1 > > matrix 2 > 1 | 1 | 1 > 0 | 1 | 0 > 1 | 1 | 1 > > matrix 3 > 0 | 0 | 1 > 0 | 0 | 1 > 1 | 1 | 0 > > > Result will be as below: > example: > consider element (0,0) of matrix's above: > since maximum amount of matrix's(matrix1 and matrix3) says that element(0,0) is false, then I chose false at element (0,0) in result matrix > > consider another element element (2,0) of matrix's above: > since maximum amount of matrixes(matrix2 and matrix3) says that element(2,0) is true, then I chose true at element (2,0) in result matrix > > Here is result matrix: > > 0 | 1 | 1 > 0 | 1 | 0 > 1 | 1 | 1 I see, so you are 'counting' values at a given index and the 'winner' is the one with the most ... I can see an instant optimization. lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun