From patchwork Sun Sep 16 22:29:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 184164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4BD312C0081 for ; Mon, 17 Sep 2012 08:30:15 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348439416; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=PfLxVkqzNl0LDXwSLv9rUiyuTfs=; b=kv8AXyzk/jWR2Zm2YjB95GJca4xHRErrDD/aAe4ewkR8O8jIMt6iXCG3xGnmNW d/IY+wM96eyeII4Jjo5K4MuxMVlcESz8QYyRKDI2213N3PseH0rS0joYZ1urueMm wJCtHWXCvajZRbrLJcgmwS0S+G2XZux/m81NFsfTWB/1Y= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=i6rSyIlYQ9mNVjDJRFz3ugPj3l3TKLN8p1zjEPIlxnxOScWgFAzYmKter++qkZ TsvW/r78+rwoKFRyq7+1Cw5RtBICfTOVfgX6SqPM3lVxalBJy4iqQYBh2x15T53f 4wtmQEN0+5P3kb9IQ6mBtBpTUzmSbKwe6joFLLDZ6sYBI=; Received: (qmail 20646 invoked by alias); 16 Sep 2012 22:30:03 -0000 Received: (qmail 20490 invoked by uid 22791); 16 Sep 2012 22:29:53 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_50, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Sep 2012 22:29:34 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8GMTWkL014892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Sep 2012 22:29:33 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8GMTUk9007536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Sep 2012 22:29:31 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8GMTUZY032188; Sun, 16 Sep 2012 17:29:30 -0500 Received: from [192.168.1.4] (/79.33.216.197) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Sep 2012 15:29:29 -0700 Message-ID: <505652C7.9000403@oracle.com> Date: Mon, 17 Sep 2012 00:29:27 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: gcc-patches CC: Marc Glisse , Ed Smith-Rowland <3dw4rd@verizon.net>, libstdc++ Subject: Re: Add Rice distribution to libstdc++ References: <50560EE2.2070601@verizon.net> <5056420A.9070700@oracle.com> In-Reply-To: <5056420A.9070700@oracle.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 09/16/2012 11:18 PM, Paolo Carlini wrote: > On 09/16/2012 10:02 PM, Marc Glisse wrote: >> On Sun, 16 Sep 2012, Ed Smith-Rowland wrote: >> >>> This adds the Rice distribution to the C++11 facility and a >>> Gnu extension. >> >> Hello, >> >> libstdc++ not in copy? >> >> The change to beta_distribution is not mentioned in the ChangeLog. >> >> You don't appear to have a test like those added for PR 54376, and >> like Ulrich I find the operator== suspicious. > Indeed, please fix that, I thought it was clear by now: no inline > template friends. I went ahead and fixed both the issues. Thanks, Paolo. ///////////////// 2012-09-16 Paolo Carlini * include/ext/random (rice_distribution<>::operator==): Change inline friend definition to non-template. * testsuite/ext/random/rice_distribution/requirements/ explicit_instantiation/1.cc: New. * testsuite/26_numerics/random/normal_mv_distribution: Move... * testsuite/ext/random/normal_mv_distribution: ... here. * testsuite/26_numerics/random/simd_fast_mersenne_twister_engine: Move... * testsuite/ext/random/simd_fast_mersenne_twister_engine: ... here. * testsuite/26_numerics/random/beta_distribution: Move... * testsuite/ext/random/beta_distribution: ... here. * testsuite/26_numerics/random/rice_distribution: Move... * testsuite/ext/random/rice_distribution: ... here. Index: include/ext/random =================================================================== --- include/ext/random (revision 191365) +++ include/ext/random (working copy) @@ -87,7 +87,8 @@ { seed(__sd); } template::value> + std::enable_if::value> ::type> explicit simd_fast_mersenne_twister_engine(_Sseq& __q) @@ -149,7 +150,8 @@ typename _CharT, typename _Traits> friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, - const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType_2, + const __gnu_cxx::simd_fast_mersenne_twister_engine + <_UIntType_2, __m_2, __pos1_2, __sl1_2, __sl2_2, __sr1_2, __sr2_2, __msk1_2, __msk2_2, __msk3_2, __msk4_2, __parity1_2, __parity2_2, __parity3_2, __parity4_2>& __x); @@ -1079,13 +1081,12 @@ * the same parameters and the sequences that would * be generated are equal. */ - template - friend bool - operator==(const rice_distribution<_RealType1>& __d1, - const rice_distribution<_RealType1>& __d2) - { return (__d1.param() == __d2.param() - && __d1._M_ndx == __d2._M_ndx - && __d1._M_ndy == __d2._M_ndy); } + friend bool + operator==(const rice_distribution& __d1, + const rice_distribution& __d2) + { return (__d1.param() == __d2.param() + && __d1._M_ndx == __d2._M_ndx + && __d1._M_ndy == __d2._M_ndy); } /** * @brief Inserts a %rice_distribution random number distribution Index: testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/cons/parms.cc (working copy) @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2> u({5.0, 4.0}, {4.0, 9.0}); - VERIFY( u.mean()[0] == 5.0 ); - VERIFY( u.mean()[1] == 4.0 ); - VERIFY( u.varcov()[0] == 2.0 ); - VERIFY( u.varcov()[1] == 0.0 ); - VERIFY( u.varcov()[2] == 3.0 ); - typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits::min() ); - VERIFY( u.max()[0] == std::numeric_limits::max() ); - VERIFY( u.min()[1] == std::numeric_limits::min() ); - VERIFY( u.max()[1] == std::numeric_limits::max() ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/cons/default.cc (working copy) @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2> u; - VERIFY( u.mean()[0] == 0.0 ); - VERIFY( u.mean()[1] == 0.0 ); - VERIFY( u.varcov()[0] == 1.0 ); - VERIFY( u.varcov()[1] == 0.0 ); - VERIFY( u.varcov()[2] == 1.0 ); - typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits::min() ); - VERIFY( u.max()[0] == std::numeric_limits::max() ); - VERIFY( u.min()[1] == std::numeric_limits::min() ); - VERIFY( u.max()[1] == std::numeric_limits::max() ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/requirements/explicit_instantiation/1.cc (working copy) @@ -1,26 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++11" } -// { dg-require-cstdint "" } -// -// Copyright (C) 2012 Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -template class __gnu_cxx::normal_mv_distribution<2,float>; -template class __gnu_cxx::normal_mv_distribution<2,double>; -template class __gnu_cxx::normal_mv_distribution<2,long double>; Index: testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/requirements/typedefs.cc (working copy) @@ -1,34 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - typedef __gnu_cxx::normal_mv_distribution<3,double> test_type; - - typedef test_type::result_type result_type; - typedef test_type::param_type param_type; -} Index: testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/operators/inequal.cc (working copy) @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2,double> u({3.0, 5.0}, {1.0, 2.0}), v, w; - - VERIFY( u != v ); - VERIFY( !(v != w) ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/operators/equal.cc (working copy) @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::normal_mv_distribution<2,double> u({5.0, 4.0}, {2.0, 1.5}), v, w; - - VERIFY( v == w ); - VERIFY( !(u == v) ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc =================================================================== --- testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc (revision 191365) +++ testsuite/26_numerics/random/normal_mv_distribution/operators/serialize.cc (working copy) @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - std::stringstream str; - __gnu_cxx::normal_mv_distribution<2,double> u({1.0, 5.0}, {2.0, 4.0}), v; - std::minstd_rand0 rng; - - u(rng); // advance - str << u; - - str >> v; -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/beta_distribution/cons/parms.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/cons/parms.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/cons/parms.cc (working copy) @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution<> u(1.5, 3.0); - VERIFY( u.alpha() == 1.5 ); - VERIFY( u.beta() == 3.0 ); - VERIFY( u.min() == 0.0 ); - VERIFY( u.max() == 1.0 ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/beta_distribution/cons/default.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/cons/default.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/cons/default.cc (working copy) @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution<> u; - VERIFY( u.alpha() == 1.0 ); - VERIFY( u.beta() == 1.0 ); - VERIFY( u.min() == 0.0 ); - VERIFY( u.max() == 1.0 ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/requirements/explicit_instantiation/1.cc (working copy) @@ -1,26 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++11" } -// { dg-require-cstdint "" } -// -// Copyright (C) 2012 Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -template class __gnu_cxx::beta_distribution; -template class __gnu_cxx::beta_distribution; -template class __gnu_cxx::beta_distribution; Index: testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/requirements/typedefs.cc (working copy) @@ -1,34 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - typedef __gnu_cxx::beta_distribution test_type; - - typedef test_type::result_type result_type; - typedef test_type::param_type param_type; -} Index: testsuite/26_numerics/random/beta_distribution/operators/inequal.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/operators/inequal.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/operators/inequal.cc (working copy) @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; - - VERIFY( u != v ); - VERIFY( !(v != w) ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/beta_distribution/operators/equal.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/operators/equal.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/operators/equal.cc (working copy) @@ -1,42 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::beta_distribution u(1.5, 3.0), v, w; - - VERIFY( v == w ); - VERIFY( !(u == v) ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/beta_distribution/operators/serialize.cc =================================================================== --- testsuite/26_numerics/random/beta_distribution/operators/serialize.cc (revision 191365) +++ testsuite/26_numerics/random/beta_distribution/operators/serialize.cc (working copy) @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2009-08-14 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-09-04 Ulrich Drepper -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include - -void -test01() -{ - std::stringstream str; - __gnu_cxx::beta_distribution u(1.5, 3.0), v; - std::minstd_rand0 rng; - - u(rng); // advance - str << u; - - str >> v; -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed1.cc (working copy) @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - unsigned long seed = 2; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint64_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed2.cc (working copy) @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - double seed = 2.0; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint64_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/default.cc (working copy) @@ -1,183 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include -#include - - -template -void run_test(std::initializer_list vals) -{ - typedef typename SFMT::result_type result_type; - SFMT e; - - e.seed(sizeof(result_type) == 4 ? 1234 : 4321); - e.discard(990); - bool success = true; - for (auto i : vals) - { - result_type r = e(); - success &= r == i; - std::cout << r << " vs " << i << std::endl; - } - VERIFY( success ); -} - - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 e; - - VERIFY( e.min() == 0 ); - VERIFY( e.max() == std::numeric_limits::max() ); - - run_test<__gnu_cxx::sfmt607>({ UINT32_C(1318548553), UINT32_C(1985957974), - UINT32_C(1367744196), UINT32_C(3463392791), UINT32_C(2780736231), - UINT32_C(3894488561), UINT32_C(3157036262), UINT32_C(3491812767), - UINT32_C(1724574180), UINT32_C(3645035493) }); - - run_test<__gnu_cxx::sfmt607_64>({UINT64_C(15510024334182072935), - UINT64_C(5793753331747412752), UINT64_C(16198353238554625740), - UINT64_C(2233208824926016498), UINT64_C(3566091399820823780), - UINT64_C(16608268514591292798), UINT64_C(10684941689666043359), - UINT64_C(12463424292910456802), UINT64_C(5902567440240131366), - UINT64_C(7228030834036501150) }); - - run_test<__gnu_cxx::sfmt1279>({ UINT32_C(66657331), UINT32_C(637106837), - UINT32_C(406927341), UINT32_C(3964420203), UINT32_C(2127134160), - UINT32_C(1327235047), UINT32_C(227339400), UINT32_C(97109542), - UINT32_C(1814799261), UINT32_C(340888197) }); - - run_test<__gnu_cxx::sfmt1279_64>({ UINT64_C(16431921382083697129), - UINT64_C(3107599092104940900), UINT64_C(4055245506102959965), - UINT64_C(16096064917153424198), UINT64_C(14429331498726837109), - UINT64_C(9539664361920633782), UINT64_C(1435296568185387099), - UINT64_C(15922567183295047131), UINT64_C(641988285517426228), - UINT64_C(15936274870984512675) }); - - run_test<__gnu_cxx::sfmt2281>({ UINT32_C(2662391944), UINT32_C(1176696104), - UINT32_C(3587947451), UINT32_C(4098993357), UINT32_C(3140998698), - UINT32_C(870759742), UINT32_C(623529127), UINT32_C(3458807285), - UINT32_C(3341615957), UINT32_C(195614711) }); - - run_test<__gnu_cxx::sfmt2281_64>({ UINT64_C(16747191622237074632), - UINT64_C(15804170396401370381), UINT64_C(3395175278324920203), - UINT64_C(1541877340159274442), UINT64_C(14176322102994316687), - UINT64_C(5130618305074712143), UINT64_C(6769693652413407081), - UINT64_C(17733765687477661079), UINT64_C(5189766940360047353), - UINT64_C(1333654688569723389) }); - - run_test<__gnu_cxx::sfmt4253>({ UINT32_C(90342133), UINT32_C(1083987943), - UINT32_C(1785481425), UINT32_C(1921212667), UINT32_C(3164342992), - UINT32_C(1489324569), UINT32_C(603530523), UINT32_C(952851722), - UINT32_C(2380944844), UINT32_C(3335854133) }); - - run_test<__gnu_cxx::sfmt4253_64>({ UINT64_C(11570915401962514263), - UINT64_C(206693220452528225), UINT64_C(16553299974633247759), - UINT64_C(1069562842508952901), UINT64_C(7203975672387749585), - UINT64_C(7552781925224963166), UINT64_C(16865729458807008705), - UINT64_C(7848963629493506078), UINT64_C(9282397173969292817), - UINT64_C(10738488504584559289) }); - - run_test<__gnu_cxx::sfmt11213>({ UINT32_C(2072997009), UINT32_C(1332330347), - UINT32_C(179681555), UINT32_C(2315290438), UINT32_C(2429393974), - UINT32_C(509881964), UINT32_C(3807607878), UINT32_C(3055319970), - UINT32_C(671840881), UINT32_C(3477325874) }); - - run_test<__gnu_cxx::sfmt11213_64>({ UINT64_C(373867573626408653), - UINT64_C(4732829340233638861), UINT64_C(16174630176505735656), - UINT64_C(10063018133994900869), UINT64_C(17308645173308419196), - UINT64_C(11091353816581371951), UINT64_C(15078420471318089727), - UINT64_C(17965717592743818706), UINT64_C(12301543162252389155), - UINT64_C(1724943167823308511) }); - - run_test<__gnu_cxx::sfmt19937>({ UINT32_C(4002809368), UINT32_C(421169044), - UINT32_C(1112642589), UINT32_C(3076213779), UINT32_C(3387033971), - UINT32_C(2499610950), UINT32_C(3057240914), UINT32_C(1662679783), - UINT32_C(461224431), UINT32_C(1168395933) }); - - run_test<__gnu_cxx::sfmt19937_64>({ UINT64_C(8032857516355555296), - UINT64_C(14023605983059313116), UINT64_C(1032336061815461376), - UINT64_C(9840995337876562612), UINT64_C(9869256223029203587), - UINT64_C(12227975697177267636), UINT64_C(12728115115844186033), - UINT64_C(7752058479783205470), UINT64_C(729733219713393087), - UINT64_C(12954017801239007622) }); - - run_test<__gnu_cxx::sfmt44497>({ UINT32_C(1483092082), UINT32_C(1895679637), - UINT32_C(9122740), UINT32_C(635864575), UINT32_C(320732971), - UINT32_C(4253159584), UINT32_C(30097521), UINT32_C(839233316), - UINT32_C(1431693534), UINT32_C(645981752) }); - - run_test<__gnu_cxx::sfmt44497_64>({ UINT64_C(6246103978016445638), - UINT64_C(4198275826138953222), UINT64_C(12473679170573289212), - UINT64_C(14745709982748360209), UINT64_C(3630790792408208113), - UINT64_C(4195294399578350499), UINT64_C(3742595698794327253), - UINT64_C(17388385867517445933), UINT64_C(4261866397667814669), - UINT64_C(17394085161690598095) }); - - run_test<__gnu_cxx::sfmt86243>({ UINT32_C(3910985535), UINT32_C(100094501), - UINT32_C(3120362616), UINT32_C(1854432382), UINT32_C(314688154), - UINT32_C(522122712), UINT32_C(3026095676), UINT32_C(3681962735), - UINT32_C(1851548627), UINT32_C(2153846465) }); - - run_test<__gnu_cxx::sfmt86243_64>({ UINT64_C(250135615696586029), - UINT64_C(4836277875486422184), UINT64_C(12389320296183057446), - UINT64_C(7983028875884559442), UINT64_C(10079555227308335361), - UINT64_C(14829333386540244214), UINT64_C(12159744972103351172), - UINT64_C(4932579842314286356), UINT64_C(5200375244476537050), - UINT64_C(11795681221121010641) }); - - run_test<__gnu_cxx::sfmt132049>({ UINT32_C(1551023420), UINT32_C(1462317554), - UINT32_C(2882528449), UINT32_C(1136299843), UINT32_C(292840589), - UINT32_C(1307775247), UINT32_C(463274356), UINT32_C(1430357686), - UINT32_C(3907607055), UINT32_C(3462509184) }); - - run_test<__gnu_cxx::sfmt132049_64>({ UINT64_C(649482638765113922), - UINT64_C(14205859353699897918), UINT64_C(14077261854908137257), - UINT64_C(9564785861212212042), UINT64_C(7310747921257808846), - UINT64_C(13759009477111470372), UINT64_C(11942123860149328831), - UINT64_C(12868386070200572127), UINT64_C(18348617059674004332), - UINT64_C(4233208019331956061) }); - - run_test<__gnu_cxx::sfmt216091>({ UINT32_C(4171954654), UINT32_C(2938491210), - UINT32_C(1356393891), UINT32_C(3558249995), UINT32_C(3711769979), - UINT32_C(3434953144), UINT32_C(1601628304), UINT32_C(2187495640), - UINT32_C(1762169715), UINT32_C(2141213778) }); - - run_test<__gnu_cxx::sfmt216091_64>({ UINT64_C(11322404276387828766), - UINT64_C(9653391575000195546), UINT64_C(1767839622905368464), - UINT64_C(1690838241348740821), UINT64_C(817628268513271254), - UINT64_C(15111277786569319196), UINT64_C(15817118810543358764), - UINT64_C(5639001693408668083), UINT64_C(9959854003669400568), - UINT64_C(13675983279642398887) }); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/seed_seq.cc (working copy) @@ -1,43 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-02-01 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - std::seed_seq seed; - __gnu_cxx::simd_fast_mersenne_twister_engine< - uint32_t, 607, 2, - 15, 3, 13, 3, - 0xfdff37ffU, 0xef7f3f7dU, - 0xff777b7dU, 0x7ff7fb2fU, - 0x00000001U, 0x00000000U, - 0x00000000U, 0x5986f054U> x(seed); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/cons/copy.cc (working copy) @@ -1,47 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-02-16 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void -test01() -{ - typedef uint32_t value_type; - - __gnu_cxx::simd_fast_mersenne_twister_engine e(1); - - const auto f(e); - auto g(f); - g = g; // Suppress unused warning. -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/inequal.cc (working copy) @@ -1,52 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2010-03-16 Paolo Carlini -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2010, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.5.3.2 Class template mersenne_twister_engine [rand.eng.mers] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 u, v; - - VERIFY( !(u != v) ); - - u.discard(100); - v.discard(100); - - VERIFY( !(u != v) ); - - v.discard(1); - - VERIFY( u != v ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/equal.cc (working copy) @@ -1,49 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::sfmt19937 u, v; - - VERIFY( u == v ); - - u.discard(100); - v.discard(100); - - VERIFY( u == v ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc =================================================================== --- testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc (revision 191365) +++ testsuite/26_numerics/random/simd_fast_mersenne_twister_engine/operators/serialize.cc (working copy) @@ -1,66 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// 2012-08-28 Ulrich Drepper , adapted for SFMT -// -// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::stringstream str; - __gnu_cxx::sfmt19937 u, v; - - u(); // advance - str << u; - - VERIFY( !(u == v) ); - - str >> v; - VERIFY( u == v ); - for (unsigned i = 0; i < 1000; ++i) - VERIFY( u() == v() ); - - str.clear(); - str << v; - - u(); - u(); - u(); - - str >> u; - VERIFY( u == v ); - for (unsigned i = 0; i < 1000; ++i) - VERIFY( u() == v() ); -} - -int main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/rice_distribution/cons/parms.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/cons/parms.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/cons/parms.cc (working copy) @@ -1,47 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] -// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::rice_distribution<> u(1.5, 3.0); - VERIFY( u.nu() == 1.5 ); - VERIFY( u.sigma() == 3.0 ); - VERIFY( u.min() == 0.0 ); - typedef __gnu_cxx::rice_distribution<>::result_type result_type; - VERIFY( u.max() == std::numeric_limits::max() ); -} - -int -main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/rice_distribution/cons/default.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/cons/default.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/cons/default.cc (working copy) @@ -1,47 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] -// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::rice_distribution<> u; - VERIFY( u.nu() == 0.0 ); - VERIFY( u.sigma() == 1.0 ); - VERIFY( u.min() == 0.0 ); - typedef __gnu_cxx::rice_distribution<>::result_type result_type; - VERIFY( u.max() == std::numeric_limits::max() ); -} - -int -main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/rice_distribution/requirements/typedefs.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/requirements/typedefs.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/requirements/typedefs.cc (working copy) @@ -1,36 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] -// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] - -#include - -void -test01() -{ - typedef __gnu_cxx::rice_distribution test_type; - - typedef test_type::result_type result_type; - typedef test_type::param_type param_type; -} Index: testsuite/26_numerics/random/rice_distribution/operators/inequal.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/operators/inequal.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/operators/inequal.cc (working copy) @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.5.8.4.5 Class template rice_distribution [rand.dist.ext.rice] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::rice_distribution u(2.0, 3.0), v, w; - - VERIFY( u != v ); - VERIFY( !(v != w) ); -} - -int -main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/rice_distribution/operators/equal.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/operators/equal.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/operators/equal.cc (working copy) @@ -1,44 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.5.8.4.5 Class template rice_distribution [rand.dist.ext.rice] - -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - __gnu_cxx::rice_distribution u(2.0, 3.0), v, w; - - VERIFY( v == w ); - VERIFY( !(u == v) ); -} - -int -main() -{ - test01(); - return 0; -} Index: testsuite/26_numerics/random/rice_distribution/operators/serialize.cc =================================================================== --- testsuite/26_numerics/random/rice_distribution/operators/serialize.cc (revision 191365) +++ testsuite/26_numerics/random/rice_distribution/operators/serialize.cc (working copy) @@ -1,51 +0,0 @@ -// { dg-options "-std=c++0x" } -// { dg-require-cstdint "" } -// -// 2012-01-28 Edward M. Smith-Rowland <3dw4rd@verizon.net> -// -// Copyright (C) 2012 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// 26.4.8.3.* Class template rice_distribution [rand.dist.ext.rice] -// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist] - -#include -#include -#include - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::stringstream str; - __gnu_cxx::rice_distribution u(1.5, 3.0), v; - std::minstd_rand0 rng; - - u(rng); // advance - str << u; - - str >> v; - VERIFY( u == v ); -} - -int -main() -{ - test01(); - return 0; -} Index: testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc =================================================================== --- testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc (revision 0) +++ testsuite/ext/random/rice_distribution/requirements/explicit_instantiation/1.cc (revision 0) @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } +// { dg-require-cstdint "" } +// +// Copyright (C) 2012 Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +template class __gnu_cxx::rice_distribution; +template class __gnu_cxx::rice_distribution; +template class __gnu_cxx::rice_distribution;