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