1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/random_test.cc Thu Jan 03 11:13:29 2008 +0100
1.3 @@ -0,0 +1,36 @@
1.4 +/* -*- C++ -*-
1.5 + *
1.6 + * This file is a part of LEMON, a generic C++ optimization library
1.7 + *
1.8 + * Copyright (C) 2003-2007
1.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.11 + *
1.12 + * Permission to use, modify and distribute this software is granted
1.13 + * provided that this copyright notice appears in all copies. For
1.14 + * precise terms see the accompanying LICENSE file.
1.15 + *
1.16 + * This software is provided "AS IS" with no warranty of any kind,
1.17 + * express or implied, and with no claim as to its suitability for any
1.18 + * purpose.
1.19 + *
1.20 + */
1.21 +
1.22 +#include <lemon/random.h>
1.23 +#include "test_tools.h"
1.24 +
1.25 +///\file \brief Test cases for random.h
1.26 +///
1.27 +///\todo To be extended
1.28 +///
1.29 +
1.30 +int main()
1.31 +{
1.32 + double a=lemon::rnd();
1.33 + check(a<1.0&&a>0.0,"This should be in [0,1)");
1.34 + a=lemon::rnd.gauss();
1.35 + a=lemon::rnd.gamma(3.45,0);
1.36 + a=lemon::rnd.gamma(4);
1.37 + //Does gamma work with integer k?
1.38 + a=lemon::rnd.gamma(4.0,0);
1.39 +}