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: a07f3367d7,3737542e2ed2b8e1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!tudelft.nl!txtfeed1.tudelft.nl!feeder8.cambrium.nl!feed.tweaknews.nl!195.238.0.231.MISMATCH!news.skynet.be!195.238.0.222.MISMATCH!newsspl501.isp.belgacom.be!tjb!not-for-mail Date: Tue, 28 Apr 2009 22:21:51 +0200 From: Olivier Scalbert User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with optimizations References: <49f73730$0$2850$ba620e4c@news.skynet.be> <49f75d09$1_5@news.bluewin.ch> In-Reply-To: <49f75d09$1_5@news.bluewin.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <49f7655b$0$2853$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 1e5fbb02.news.skynet.be X-Trace: 1240950107 news.skynet.be 2853 87.65.130.237:48607 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news2.google.com comp.lang.ada:5597 Date: 2009-04-28T22:21:51+02:00 List-Id: Gautier wrote: > For your short-cut version of Is_Solved you might want to write: > > for i in Face_Index_T'range loop > for c in Column_T loop > for r in Row_T loop > if Cube(i)(c,r) /= Final_Position(i)(c,r) then > return False; > end if; > ... > > Just nicer looking, probably as fast as the "unrolled" version you have. > Anyway, I strongly recommend adding -funroll-loops along with your -O2 > switch. Also -fpeel-loops, -ftracer, -funswitch-loops might help. > _________________________________________________________ > Gautier's Ada programming -- http://sf.net/users/gdemont/ > NB: For a direct answer, e-mail address on the Web site! By the way, it seems that all the 3x3 cube position can be solved in less than 26 moves. As my prog does a full search at a depth of 8 in 15 secondes, it will need less than 12^18*15.0 seconds (12663305403769 years) So I should focus on the algorithm instead of the compilation flags ... ;-)