alpar@2483: /* -*- C++ -*- alpar@2483: * alpar@2483: * This file is a part of LEMON, a generic C++ optimization library alpar@2483: * alpar@2553: * Copyright (C) 2003-2008 alpar@2483: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@2483: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@2483: * alpar@2483: * Permission to use, modify and distribute this software is granted alpar@2483: * provided that this copyright notice appears in all copies. For alpar@2483: * precise terms see the accompanying LICENSE file. alpar@2483: * alpar@2483: * This software is provided "AS IS" with no warranty of any kind, alpar@2483: * express or implied, and with no claim as to its suitability for any alpar@2483: * purpose. alpar@2483: * alpar@2483: */ alpar@2483: alpar@2483: #include alpar@2483: #include "test_tools.h" alpar@2483: alpar@2483: ///\file \brief Test cases for random.h alpar@2483: /// alpar@2483: ///\todo To be extended alpar@2483: /// alpar@2483: deba@2597: int seed_array[] = {1, 2}; deba@2597: alpar@2483: int main() alpar@2483: { alpar@2483: double a=rnd(); alpar@2483: check(a<1.0&&a>0.0,"This should be in [0,1)"); alpar@2483: a=rnd.gauss(); alpar@2483: a=rnd.gamma(3.45,0); alpar@2483: a=rnd.gamma(4); alpar@2483: //Does gamma work with integer k? alpar@2483: a=rnd.gamma(4.0,0); deba@2596: deba@2596: lemon::rnd.seed(100); deba@2596: lemon::rnd.seed(seed_array, seed_array + deba@2596: (sizeof(seed_array) / sizeof(seed_array[0]))); deba@2596: return 0; alpar@2483: }