Statistics
| Revision:

root / trunk / src / df1b2-separable / bounder.cpp @ 1110

History | View | Annotate | Download (541 Bytes)

1
/*
2
 * $Id: bounder.cpp 1110 2013-07-12 01:11:28Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
6
 */
7
/**
8
 * \file
9
 * Description not yet available.
10
 */
11
#include "df1b2fun.h"
12

    
13
/**
14
 * Description not yet available.
15
 * \param x
16
 * \param min
17
 * \param max
18
 * \param mscale
19
 */
20
df1b2variable bounder(const df1b2variable&  x,double min,double max,
21
    double scale)
22
{
23
  df1b2variable y=x/scale;
24
  df1b2variable z;
25
  if (value(y)<20.0)
26
  {
27
    z=exp(y)/(1.0+exp(y));
28
  }
29
  else
30
  {
31
    z=1.0/(1+exp(-y));
32
  }
33
  return min+(max-min)*z;
34
}