Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
fmin.hpp
Go to the documentation of this file.
1 #ifndef __STAN__AGRAD__REV__FMIN_HPP__
2 #define __STAN__AGRAD__REV__FMIN_HPP__
3 
4 #include <stan/agrad/rev/var.hpp>
5 
6 namespace stan {
7  namespace agrad {
8 
22  inline var fmin(const stan::agrad::var& a,
23  const stan::agrad::var& b) {
24  return a.vi_->val_ < b.vi_->val_ ? a : b;
25  }
26 
41  inline var fmin(const stan::agrad::var& a,
42  const double& b) {
43  return a.vi_->val_ <= b ? a : var(b);
44  }
45 
62  inline var fmin(const double& a,
63  const stan::agrad::var& b) {
64  return a < b.vi_->val_ ? var(a) : b;
65  }
66 
67  }
68 }
69 #endif

     [ Stan Home Page ] © 2011–2013, Stan Development Team.