Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'nested': 0.07; 'cc:addr :python-list': 0.11; 'dimension': 0.16; 'help?': 0.16; 'loops': 0.16; 'rule.': 0.16; 'subject:array': 0.16; 'subject:bit': 0.16; 'throw': 0.16; 'variants': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'fit': 0.20; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'array': 0.29; 'robert': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'url:python': 0.33; 'are:': 0.33; 'fri,': 0.33; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'returning': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'possible': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'nov': 0.38; 'does': 0.39; 'url:mail': 0.40; 'sum': 0.64; 'results': 0.69; 'joel': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=POSkVfi6yZaPJvWUsKd8dQrBkKS6wHJXSuVeUkEdcw4=; b=aG8HGHltxm6HmmrqZBAghw/Yg1phIfEBlA83eZn67dX2IqDJs0i6tlj0AdD0G+5UHa KFwLLwQGVPtf3BEk8n1PCQhEZgMdJy34dsdfgAky4Dk+Uz9Au3VSPwK3nCg3U0VTtNfn GFpoXBLOfwpGNrt+jGYDb15cCNkJH2/9+/snhgadPr5AvrkzwK3Wra8lrRjZn6pxZQbs eK4W/d3BvnD4NMsjejayxguL2THFsIbeC9icX4V9qwObNQtq88HAFB7DwolzYdqNAa6R Ym5A8OVZp5vhY0M6KGiLvcmJ6mxhy0RycgVULdAQWY+emZMkZUJpd0FodOXzWWEo4jNH ud8A== MIME-Version: 1.0 X-Received: by 10.224.111.201 with SMTP id t9mr18465767qap.44.1415375495961; Fri, 07 Nov 2014 07:51:35 -0800 (PST) In-Reply-To: <0e6787f9-88d6-423a-8410-7578fa83d61c@googlegroups.com> References: <0e6787f9-88d6-423a-8410-7578fa83d61c@googlegroups.com> Date: Fri, 7 Nov 2014 10:51:35 -0500 Subject: Re: generating 2D bit array variants with specific algorythm From: Joel Goldstick Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415375498 news.xs4all.nl 2903 [2001:888:2000:d::a6]:37094 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80368 On Fri, Nov 7, 2014 at 10:39 AM, Robert Voigtl=C3=A4nder wrote: > Hi, > > I need to generate all variants of a 2D array with variable dimension siz= es which fit a specific rule. (up to 200*1000) > > The rules are: > - Values are only 0 or 1 > - the sum of each line bust be 1 > - only valid results must be generated (generating all and only returning= the valid results takes to long; that's what I tried already) > > So for a 2x2 array these would be the valid results: > > 10 > 01 > > 01 > 10 > > 10 > 10 > > 01 > 01 > > > Must be possible with nested loops and a counter per line. But I don't ge= t it. > > Can someone help? is this valid: 1011 What I mean is do you throw away the carry or does each row have only one z= ero? > > Thanks > Robert > -- > https://mail.python.org/mailman/listinfo/python-list --=20 Joel Goldstick http://joelgoldstick.com