test/random_test.cc
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 24 Jan 2008 11:31:19 +0000
changeset 96 b55e501a90ee
parent 10 99e499ca560b
child 92 5d4decd1b870
permissions -rw-r--r--
Path related files ported from svn -r3435
but ItemReader/Writer for Path (originally belonging to path_utils.h)
hasn't ported yet.
alpar@10
     1
/* -*- C++ -*-
alpar@10
     2
 *
alpar@10
     3
 * This file is a part of LEMON, a generic C++ optimization library
alpar@10
     4
 *
alpar@39
     5
 * Copyright (C) 2003-2008
alpar@10
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@10
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@10
     8
 *
alpar@10
     9
 * Permission to use, modify and distribute this software is granted
alpar@10
    10
 * provided that this copyright notice appears in all copies. For
alpar@10
    11
 * precise terms see the accompanying LICENSE file.
alpar@10
    12
 *
alpar@10
    13
 * This software is provided "AS IS" with no warranty of any kind,
alpar@10
    14
 * express or implied, and with no claim as to its suitability for any
alpar@10
    15
 * purpose.
alpar@10
    16
 *
alpar@10
    17
 */
alpar@10
    18
alpar@10
    19
#include <lemon/random.h>
alpar@10
    20
#include "test_tools.h"
alpar@10
    21
alpar@10
    22
///\file \brief Test cases for random.h
alpar@10
    23
///
alpar@10
    24
///\todo To be extended
alpar@10
    25
///
alpar@10
    26
alpar@10
    27
int main()
alpar@10
    28
{
alpar@10
    29
  double a=lemon::rnd();
alpar@10
    30
  check(a<1.0&&a>0.0,"This should be in [0,1)");
alpar@10
    31
  a=lemon::rnd.gauss();
alpar@10
    32
  a=lemon::rnd.gamma(3.45,0);
alpar@10
    33
  a=lemon::rnd.gamma(4);
alpar@10
    34
  //Does gamma work with integer k?
alpar@10
    35
  a=lemon::rnd.gamma(4.0,0);
alpar@10
    36
}