rote_binomial.cpp

Go to the documentation of this file.
00001 
00002 
00003 #include <iostream>
00004 #include "binomial.h"
00005 
00006 const char *binomial_option::_error_msg;
00007 int binomial_option::_erno;
00008 
00009 #ifdef CHECK
00010 #undef CHECK
00011 #endif
00012 #ifdef linux
00013 #define CHECK(y,z,a) if (y) { _error_msg = __STRING(y)" at line "\
00014   __STRING(z)" in " a "::check_attributes"; \
00015   return (_erno = z);}
00016 #else
00017 #define CHECK(y,z,a) if (y) {_error_msg = #y" at line "\
00018   #z" in " #a"::check_attributes"; \
00019   return (_erno = z);}
00020 #endif
00021 
00022 int binomial_option::check_attributes(
00023       double S,
00024       double K,
00025       double Tau,
00026       double Alpha,
00027       double R,
00028       double Sigma,
00029       int NumberIterations)
00030 {
00031   #define Funcname  "binomial_option::check_attributes"
00032 
00033   _error_msg = "";
00034   _erno = 0;
00035 
00036   CHECK(S <  0, __LINE__, Funcname);
00037   CHECK(K <  0, __LINE__, Funcname);
00038   CHECK(Tau <  0, __LINE__, Funcname);
00039   CHECK(Alpha <  0, __LINE__, Funcname);
00040   CHECK(R <  0, __LINE__, Funcname);
00041   CHECK(Sigma <  0, __LINE__, Funcname);
00042 
00043   return 0;
00044 }

Generated on Fri Jan 7 12:36:18 2011 for public_options by  doxygen 1.5.1