summaryrefslogtreecommitdiff
path: root/boost/libs/math/dot_net_example/boost_math
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
committerChristoph Berg <myon@debian.org>2018-12-19 22:58:32 +0100
commite0737c56c1e384e05064a0c6e1ac46979371041b (patch)
treea0123d694a2d36c43dabdf0a3907392fce11d457 /boost/libs/math/dot_net_example/boost_math
parentb4aebf2d137b892f53503b13785ecae900062ff7 (diff)
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'boost/libs/math/dot_net_example/boost_math')
-rw-r--r--boost/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp44
-rw-r--r--boost/libs/math/dot_net_example/boost_math/ReadMe.txt38
-rw-r--r--boost/libs/math/dot_net_example/boost_math/Stdafx.cpp11
-rw-r--r--boost/libs/math/dot_net_example/boost_math/app.icobin0 -> 1078 bytes
-rw-r--r--boost/libs/math/dot_net_example/boost_math/app.rc63
-rw-r--r--boost/libs/math/dot_net_example/boost_math/boost_math.cpp255
-rw-r--r--boost/libs/math/dot_net_example/boost_math/boost_math.h331
-rw-r--r--boost/libs/math/dot_net_example/boost_math/boost_math.sln20
-rw-r--r--boost/libs/math/dot_net_example/boost_math/boost_math.sln.lnkbin0 -> 1176 bytes
-rw-r--r--boost/libs/math/dot_net_example/boost_math/boost_math.vcproj260
-rw-r--r--boost/libs/math/dot_net_example/boost_math/resource.h9
-rw-r--r--boost/libs/math/dot_net_example/boost_math/stdafx.h54
12 files changed, 1085 insertions, 0 deletions
diff --git a/boost/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp b/boost/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp
new file mode 100644
index 00000000..1153fcc1
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp
@@ -0,0 +1,44 @@
+#include "stdafx.h"
+
+// Copyright Paul A. Bristow & John Maddock 2009, 2010
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+using namespace System;
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+using namespace System::Runtime::InteropServices;
+using namespace System::Security::Permissions;
+
+// General Information about an assembly is controlled through the following set of attributes.
+// Change these attribute values to modify the information associated with an assembly.
+
+[assembly:AssemblyTitleAttribute("boost_math")];
+[assembly:AssemblyDescriptionAttribute("Math Toolkit")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("jmc")];
+[assembly:AssemblyProductAttribute("boost_math")];
+[assembly:AssemblyCopyrightAttribute("Copyright (c) jmc 2007 - 2010")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.1.*")];
+
+[assembly:ComVisible(false)];
+
+[assembly:CLSCompliantAttribute(true)];
+
+[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
diff --git a/boost/libs/math/dot_net_example/boost_math/ReadMe.txt b/boost/libs/math/dot_net_example/boost_math/ReadMe.txt
new file mode 100644
index 00000000..a7a5a5d7
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/ReadMe.txt
@@ -0,0 +1,38 @@
+========================================================================
+ DYNAMIC LINK LIBRARY : boost_math Project Overview
+========================================================================
+
+AppWizard has created this boost_math DLL for you.
+
+// Copyright Paul A. Bristow & John Maddock 2009
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+This file contains a summary of what you will find in each of the files that
+make up your boost_math application.
+
+boost_math.vcproj
+ This is the main project file for VC++ projects generated using an Application Wizard.
+ It contains information about the version of Visual C++ that generated the file, and
+ information about the platforms, configurations, and project features selected with the
+ Application Wizard.
+
+boost_math.cpp
+ This is the main DLL source file.
+
+boost_math.h
+ This file contains a class declaration.
+
+AssemblyInfo.cpp
+ Contains custom attributes for modifying assembly metadata.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////
+
diff --git a/boost/libs/math/dot_net_example/boost_math/Stdafx.cpp b/boost/libs/math/dot_net_example/boost_math/Stdafx.cpp
new file mode 100644
index 00000000..f65a89a5
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/Stdafx.cpp
@@ -0,0 +1,11 @@
+// stdafx.cpp : source file that includes just the standard includes
+// boost_math.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+// Copyright Paul A. Bristow & John Maddock 2009
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include "stdafx.h"
diff --git a/boost/libs/math/dot_net_example/boost_math/app.ico b/boost/libs/math/dot_net_example/boost_math/app.ico
new file mode 100644
index 00000000..3a5525fd
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/app.ico
Binary files differ
diff --git a/boost/libs/math/dot_net_example/boost_math/app.rc b/boost/libs/math/dot_net_example/boost_math/app.rc
new file mode 100644
index 00000000..0bc391bd
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/app.rc
@@ -0,0 +1,63 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon placed first or with lowest ID value becomes application icon
+
+LANGUAGE 9, 2
+#pragma code_page(1252)
+1 ICON "app.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+ "\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/boost/libs/math/dot_net_example/boost_math/boost_math.cpp b/boost/libs/math/dot_net_example/boost_math/boost_math.cpp
new file mode 100644
index 00000000..468b6d25
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/boost_math.cpp
@@ -0,0 +1,255 @@
+// Copyright John Maddock 2007.
+// Copyright Paul A. Bristow 2007, 2009, 2012.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// boost_math.cpp This is the main DLL file.
+
+//#define BOOST_MATH_OVERFLOW_ERROR_POLICY errno_on_error
+//#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+// These are now defined in project properties
+// to avoid complications with pre-compiled headers:
+// "BOOST_MATH_ASSERT_UNDEFINED_POLICY=0"
+// "BOOST_MATH_OVERFLOW_ERROR_POLICY="errno_on_error""
+// so command line shows:
+// /D "BOOST_MATH_ASSERT_UNDEFINED_POLICY=0"
+// /D "BOOST_MATH_OVERFLOW_ERROR_POLICY="errno_on_error""
+
+#include "stdafx.h"
+
+#ifdef _MSC_VER
+# pragma warning(disable: 4400) // 'const boost_math::any_distribution ^' : const/volatile qualifiers on this type are not supported
+# pragma warning(disable: 4244) // 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
+# pragma warning(disable: 4512) // assignment operator could not be generated
+// hypergeometric expects integer parameters.
+# pragma warning(disable: 4127) // constant
+#endif
+
+#include "boost_math.h"
+
+namespace boost_math
+{
+
+any_distribution::any_distribution(int t, double arg1, double arg2, double arg3)
+{
+ TRANSLATE_EXCEPTIONS_BEGIN
+ // This is where all the work gets done:
+ switch(t) // index of distribution to distribution_info distributions[]
+ { // New entries must match distribution names, parameter name(s) and defaults defined below.
+ case 0:
+ this->reset(new concrete_distribution<boost::math::bernoulli>(boost::math::bernoulli(arg1)));
+ break;
+ case 1:
+ this->reset(new concrete_distribution<boost::math::beta_distribution<> >(boost::math::beta_distribution<>(arg1, arg2)));
+ break; // Note - no typedef, so need explicit type <> but rely on default = double.
+ case 2:
+ this->reset(new concrete_distribution<boost::math::binomial_distribution<> >(boost::math::binomial_distribution<>(arg1, arg2)));
+ break; // Note - no typedef, so need explicit type <> but rely on default = double.
+ case 3:
+ this->reset(new concrete_distribution<boost::math::cauchy>(boost::math::cauchy(arg1, arg2)));
+ break;
+ case 4:
+ this->reset(new concrete_distribution<boost::math::chi_squared>(boost::math::chi_squared(arg1)));
+ break;
+ case 5:
+ this->reset(new concrete_distribution<boost::math::exponential>(boost::math::exponential(arg1)));
+ break;
+ case 6:
+ this->reset(new concrete_distribution<boost::math::extreme_value>(boost::math::extreme_value(arg1)));
+ break;
+ case 7:
+ this->reset(new concrete_distribution<boost::math::fisher_f >(boost::math::fisher_f(arg1, arg2)));
+ break;
+ case 8:
+ this->reset(new concrete_distribution<boost::math::gamma_distribution<> >(boost::math::gamma_distribution<>(arg1, arg2)));
+ break;
+ case 9:
+ this->reset(new concrete_distribution<boost::math::geometric_distribution<> >(boost::math::geometric_distribution<>(arg1)));
+ break;
+ case 10:
+ this->reset(new concrete_distribution<boost::math::hypergeometric_distribution<> >(boost::math::hypergeometric_distribution<>(arg1, arg2, arg3)));
+ break;
+ case 11:
+ this->reset(new concrete_distribution<boost::math::inverse_chi_squared_distribution<> >(boost::math::inverse_chi_squared_distribution<>(arg1, arg2)));
+ break;
+ case 12:
+ this->reset(new concrete_distribution<boost::math::inverse_gamma_distribution<> >(boost::math::inverse_gamma_distribution<>(arg1, arg2)));
+ break;
+ case 13:
+ this->reset(new concrete_distribution<boost::math::inverse_gaussian_distribution<> >(boost::math::inverse_gaussian_distribution<>(arg1, arg2)));
+ break;
+ case 14:
+ this->reset(new concrete_distribution<boost::math::laplace_distribution<> >(boost::math::laplace_distribution<>(arg1, arg2)));
+ break;
+ case 15:
+ this->reset(new concrete_distribution<boost::math::logistic_distribution<> >(boost::math::logistic_distribution<>(arg1, arg2)));
+ break;
+ case 16:
+ this->reset(new concrete_distribution<boost::math::lognormal_distribution<> >(boost::math::lognormal_distribution<>(arg1, arg2)));
+ break;
+ case 17:
+ this->reset(new concrete_distribution<boost::math::negative_binomial_distribution<> >(boost::math::negative_binomial_distribution<>(arg1, arg2)));
+ break;
+ case 18:
+ this->reset(new concrete_distribution<boost::math::non_central_beta_distribution<> >(boost::math::non_central_beta_distribution<>(arg1, arg2, arg3)));
+ break;
+ case 19:
+ this->reset(new concrete_distribution<boost::math::non_central_chi_squared_distribution<> >(boost::math::non_central_chi_squared_distribution<>(arg1, arg2)));
+ break;
+ case 20:
+ this->reset(new concrete_distribution<boost::math::non_central_f_distribution<> >(boost::math::non_central_f_distribution<>(arg1, arg2, arg3)));
+ break;
+ case 21:
+ this->reset(new concrete_distribution<boost::math::non_central_t_distribution<> >(boost::math::non_central_t_distribution<>(arg1, arg2)));
+ break;
+ case 22:
+ this->reset(new concrete_distribution<boost::math::normal_distribution<> >(boost::math::normal_distribution<>(arg1, arg2)));
+ break;
+ case 23:
+ this->reset(new concrete_distribution<boost::math::pareto>(boost::math::pareto(arg1, arg2)));
+ break;
+ case 24:
+ this->reset(new concrete_distribution<boost::math::poisson>(boost::math::poisson(arg1)));
+ break;
+ case 25:
+ this->reset(new concrete_distribution<boost::math::rayleigh>(boost::math::rayleigh(arg1)));
+ break;
+ case 26:
+ this->reset(new concrete_distribution<boost::math::skew_normal>(boost::math::skew_normal(arg1, arg2, arg3)));
+ break;
+ case 27:
+ this->reset(new concrete_distribution<boost::math::students_t>(boost::math::students_t(arg1)));
+ break;
+ case 28:
+ this->reset(new concrete_distribution<boost::math::triangular>(boost::math::triangular(arg1, arg2, arg3)));
+ break;
+ case 29:
+ this->reset(new concrete_distribution<boost::math::uniform>(boost::math::uniform(arg1, arg2)));
+ break;
+ case 30:
+ this->reset(new concrete_distribution<boost::math::weibull>(boost::math::weibull(arg1, arg2)));
+ break;
+
+
+ default:
+ // TODO Need some proper error handling here?
+ assert(0);
+ }
+ TRANSLATE_EXCEPTIONS_END
+} // any_distribution constructor.
+
+struct distribution_info
+{
+ const char* name; // of distribution.
+ const char* first_param; // Parameters' name like "degrees of freedom",
+ const char* second_param; // if required, else "",
+ const char* third_param; // if required, else "".
+ // triangular and non-centrals need 3 parameters.
+ // (Only the Bi-Weibull would need 5 parameters?)
+ double first_default; // distribution parameter value, often 0, 0.5 or 1.
+ double second_default; // 0 if there isn't a second argument.
+ // Note that defaults below follow default argument in constructors,
+ // if any, but need not be the same.
+ double third_default; // 0 if there isn't a third argument.
+};
+
+distribution_info distributions[] =
+{ // distribution name, parameter name(s) and default(s)
+ // Order must match any_distribution constructor above!
+ // Null string "" and zero default for un-used arguments.
+ { "Bernoulli", "Probability", "", "",0.5, 0, 0}, // case 0
+ { "Beta", "Alpha", "Beta", "", 1, 1, 0}, // case 1
+ { "Binomial", "Trials", "Probability of success", "", 1, 0.5, 0}, // case 2
+ { "Cauchy", "Location", "Scale", "", 0, 1, 0}, // case 3
+ { "Chi_squared", "Degrees of freedom", "", "", 1, 0, 0}, // case 4
+ { "Exponential", "lambda", "", "", 1, 0, 0}, // case 5
+ { "Extreme value", "Location", "Scale", "", 0, 1, 0}, // case 6
+ { "Fisher-F", "Degrees of freedom 1", "Degrees of freedom 2", "", 1, 1, 0}, // case 7
+ { "Gamma (Erlang)", "Shape", "Scale", "", 1, 1, 0}, // case 8
+ { "Geometric", "Probability", "", "", 1, 0, 0}, // case 9
+ { "HyperGeometric", "Defects", "Samples", "Objects", 1, 0, 1}, // case 10
+ { "InverseChiSq", "Degrees of Freedom", "Scale", "", 1, 1, 0}, // case 11
+ { "InverseGamma", "Shape", "Scale", "", 1, 1, 0}, // case 12
+ { "InverseGaussian", "Mean", "Scale", "", 1, 1, 0}, // case 13
+ { "Laplace", "Location", "Scale", "", 0, 1, 0}, // case 14
+ { "Logistic", "Location", "Scale", "", 0, 1, 0}, // case 15
+ { "LogNormal", "Location", "Scale", "", 0, 1, 0}, // case 16
+ { "Negative Binomial", "Successes", "Probability of success", "", 1, 0.5, 0}, // case 17
+ { "Noncentral Beta", "Shape alpha", "Shape beta", "Non-centrality", 1, 1, 0}, // case 18
+ { "Noncentral ChiSquare", "Degrees of Freedom", "Non-centrality", "", 1, 0, 0}, // case 19
+ { "Noncentral F", "Degrees of Freedom 1", "Degrees of Freedom 2", "Non-centrality", 1, 1, 0}, // case 20
+ { "Noncentral t", "Degrees of Freedom", "Non-centrality", "", 1, 0, 0}, // case 21
+ { "Normal (Gaussian)", "Mean", "Standard Deviation", "", 0, 1, 0}, // case 22
+ { "Pareto", "Location", "Shape","", 1, 1, 0}, // case 23
+ { "Poisson", "Mean", "", "", 1, 0, 0}, // case 24
+ { "Rayleigh", "Shape", "", "", 1, 0, 0}, // case 25
+ { "Skew Normal", "Location", "Shape", "Skew", 0, 1, 0}, // case 27 (defaults to Gaussian).
+ { "Student's t", "Degrees of Freedom", "", "", 1, 0, 0}, // case 28
+ { "Triangular", "Lower", "Mode", "Upper", -1, 0, +1 }, // case 29 3rd parameter!
+ // 0, 0.5, 1 also said to be 'standard' but this is most like an approximation to Gaussian distribution.
+ { "Uniform", "Lower", "Upper", "", 0, 1, 0}, // case 30
+ { "Weibull", "Shape", "Scale", "", 1, 1, 0}, // case 31
+};
+
+// How many distributions are supported:
+int any_distribution::size()
+{
+ return sizeof(distributions) / sizeof(distributions[0]);
+}
+
+// Display name of i'th distribution:
+System::String^ any_distribution::distribution_name(int i)
+{
+ if(i >= size())
+ return "";
+ return gcnew System::String(distributions[i].name);
+}
+// Name of first distribution parameter, or null if not supported:
+System::String^ any_distribution::first_param_name(int i)
+{
+ if(i >= size())
+ return "";
+ return gcnew System::String(distributions[i].first_param);
+}
+// Name of second distribution parameter, or null if not supported:
+System::String^ any_distribution::second_param_name(int i)
+{
+ if(i >= size())
+ return "";
+ return gcnew System::String(distributions[i].second_param);
+}
+// Name of third distribution parameter, or null if not supported:
+System::String^ any_distribution::third_param_name(int i)
+{
+ if(i >= size())
+ return "";
+ return gcnew System::String(distributions[i].third_param);
+}
+// default value for first parameter:
+double any_distribution::first_param_default(int i)
+{
+ if(i >= size())
+ return 0;
+ return distributions[i].first_default;
+}
+// default value for second parameter:
+double any_distribution::second_param_default(int i)
+{
+ if(i >= size())
+ return 0;
+ return distributions[i].second_default;
+}
+// default value for third parameter:
+double any_distribution::third_param_default(int i)
+{
+ if(i >= size())
+ return 0;
+ return distributions[i].third_default;
+}
+
+} // namespace boost_math
+
+
diff --git a/boost/libs/math/dot_net_example/boost_math/boost_math.h b/boost/libs/math/dot_net_example/boost_math/boost_math.h
new file mode 100644
index 00000000..1f9b0156
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/boost_math.h
@@ -0,0 +1,331 @@
+// boost_math.h
+
+// Copyright John Maddock 2007.
+// Copyright Paul A. Bristow 2007.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//#define BOOST_MATH_OVERFLOW_ERROR_POLICY errno_on_error
+//#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+// These are now defined in project properties
+// "BOOST_MATH_ASSERT_UNDEFINED_POLICY=0"
+// "BOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error"
+// to avoid complications with pre-compiled headers.
+
+#ifdef _MSC_VER
+# pragma once
+# pragma warning (disable : 4127)
+#endif
+
+using namespace System;
+
+#define TRANSLATE_EXCEPTIONS_BEGIN try{
+
+#define TRANSLATE_EXCEPTIONS_END \
+ }catch(const std::exception& e){ \
+ System::String^ s = gcnew System::String(e.what());\
+ InvalidOperationException^ se = gcnew InvalidOperationException(s);\
+ throw se; \
+ }
+
+namespace boost_math {
+
+ class any_imp
+ {
+ public:
+ // Distribution properties.
+ virtual double mean()const = 0;
+ virtual double mode()const = 0;
+ virtual double median()const = 0;
+ virtual double variance()const = 0;
+ virtual double standard_deviation()const = 0;
+ virtual double skewness()const = 0;
+ virtual double kurtosis()const = 0;
+ virtual double kurtosis_excess()const = 0;
+ virtual double coefficient_of_variation()const = 0;
+ // Values computed from random variate x.
+ virtual double hazard(double x)const = 0;
+ virtual double chf(double x)const = 0;
+ virtual double cdf(double x)const = 0;
+ virtual double ccdf(double x)const = 0;
+ virtual double pdf(double x)const = 0;
+ virtual double quantile(double x)const = 0;
+ virtual double quantile_c(double x)const = 0;
+ // Range & support of x
+ virtual double lowest()const = 0;
+ virtual double uppermost()const = 0;
+ virtual double lower()const = 0;
+ virtual double upper()const = 0;
+ };
+
+ template <class Distribution>
+ class concrete_distribution : public any_imp
+ {
+ public:
+ concrete_distribution(const Distribution& d) : m_dist(d) {}
+ // Distribution properties.
+ virtual double mean()const
+ {
+ return boost::math::mean(m_dist);
+ }
+ virtual double median()const
+ {
+ return boost::math::median(m_dist);
+ }
+ virtual double mode()const
+ {
+ return boost::math::mode(m_dist);
+ }
+ virtual double variance()const
+ {
+ return boost::math::variance(m_dist);
+ }
+ virtual double skewness()const
+ {
+ return boost::math::skewness(m_dist);
+ }
+ virtual double standard_deviation()const
+ {
+ return boost::math::standard_deviation(m_dist);
+ }
+ virtual double coefficient_of_variation()const
+ {
+ return boost::math::coefficient_of_variation(m_dist);
+ }
+ virtual double kurtosis()const
+ {
+ return boost::math::kurtosis(m_dist);
+ }
+ virtual double kurtosis_excess()const
+ {
+ return boost::math::kurtosis_excess(m_dist);
+ }
+ // Range of x for the distribution.
+ virtual double lowest()const
+ {
+ return boost::math::range(m_dist).first;
+ }
+ virtual double uppermost()const
+ {
+ return boost::math::range(m_dist).second;
+ }
+ // Support of x for the distribution.
+ virtual double lower()const
+ {
+ return boost::math::support(m_dist).first;
+ }
+ virtual double upper()const
+ {
+ return boost::math::support(m_dist).second;
+ }
+
+ // Values computed from random variate x.
+ virtual double hazard(double x)const
+ {
+ return boost::math::hazard(m_dist, x);
+ }
+ virtual double chf(double x)const
+ {
+ return boost::math::chf(m_dist, x);
+ }
+ virtual double cdf(double x)const
+ {
+ return boost::math::cdf(m_dist, x);
+ }
+ virtual double ccdf(double x)const
+ {
+ return boost::math::cdf(complement(m_dist, x));
+ }
+ virtual double pdf(double x)const
+ {
+ return boost::math::pdf(m_dist, x);
+ }
+ virtual double quantile(double x)const
+ {
+ return boost::math::quantile(m_dist, x);
+ }
+ virtual double quantile_c(double x)const
+ {
+ return boost::math::quantile(complement(m_dist, x));
+ }
+ private:
+ Distribution m_dist;
+ };
+
+ public ref class any_distribution
+ {
+ public:
+ // Added methods for this class here.
+ any_distribution(int t, double arg1, double arg2, double arg3);
+ ~any_distribution()
+ {
+ reset(0);
+ }
+ // Is it OK for these to be inline?
+ // Distribution properties as 'pointer-to-implementions'.
+ double mean()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->mean();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double median()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->median();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double mode()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->mode();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double variance()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->variance();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double standard_deviation()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->standard_deviation();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double coefficient_of_variation()
+ { // aka Relative Standard deviation.
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->coefficient_of_variation();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double skewness()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->skewness();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double kurtosis()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->kurtosis();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double kurtosis_excess()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->kurtosis_excess();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ // Values computed from random variate x.
+ double hazard(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->hazard(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double chf(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->chf(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double cdf(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->cdf(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double ccdf(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->ccdf(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double pdf(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->pdf(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double quantile(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->quantile(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double quantile_c(double x)
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->quantile_c(x);
+ TRANSLATE_EXCEPTIONS_END
+ }
+
+ double lowest()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->lowest();
+ TRANSLATE_EXCEPTIONS_END
+ }
+
+ double uppermost()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->uppermost();
+ TRANSLATE_EXCEPTIONS_END
+ }
+
+ double lower()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->lower();
+ TRANSLATE_EXCEPTIONS_END
+ }
+ double upper()
+ {
+ TRANSLATE_EXCEPTIONS_BEGIN
+ return pimpl->upper();
+ TRANSLATE_EXCEPTIONS_END
+ }
+
+ // How many distributions are supported:
+ static int size();
+ // Display name of i'th distribution:
+ static System::String^ distribution_name(int i);
+ // Name of first distribution parameter, or null if not supported:
+ static System::String^ first_param_name(int i);
+ // Name of second distribution parameter, or null if not supported:
+ static System::String^ second_param_name(int i);
+ // Name of third distribution parameter, or null if not supported:
+ static System::String^ third_param_name(int i);
+ // Default value for first parameter:
+ static double first_param_default(int i);
+ // Default value for second parameter:
+ static double second_param_default(int i);
+ // Default value for third parameter:
+ static double third_param_default(int i);
+
+ private:
+ any_distribution(const any_distribution^)
+ { // Constructor is private.
+ }
+ const any_distribution^ operator=(const any_distribution^ d)
+ { // Copy Constructor is private too.
+ return d;
+ }
+ // We really should use a shared_ptr here,
+ // but apparently it's not allowed in a managed class like this :-(
+ void reset(any_imp* p)
+ {
+ if(pimpl)
+ { // Exists already, so
+ delete pimpl;
+ }
+ pimpl = p;
+ }
+ any_imp* pimpl;
+ };
+}
diff --git a/boost/libs/math/dot_net_example/boost_math/boost_math.sln b/boost/libs/math/dot_net_example/boost_math/boost_math.sln
new file mode 100644
index 00000000..29dba805
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/boost_math.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_math", "boost_math.vcxproj", "{CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}.Debug|Win32.Build.0 = Debug|Win32
+ {CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}.Release|Win32.ActiveCfg = Release|Win32
+ {CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/boost/libs/math/dot_net_example/boost_math/boost_math.sln.lnk b/boost/libs/math/dot_net_example/boost_math/boost_math.sln.lnk
new file mode 100644
index 00000000..94cb7997
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/boost_math.sln.lnk
Binary files differ
diff --git a/boost/libs/math/dot_net_example/boost_math/boost_math.vcproj b/boost/libs/math/dot_net_example/boost_math/boost_math.vcproj
new file mode 100644
index 00000000..830ed40d
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/boost_math.vcproj
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="boost_math"
+ ProjectGUID="{CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}"
+ RootNamespace="boost_math"
+ Keyword="ManagedCProj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ ManagedExtensions="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ AssemblyDebug="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ ManagedExtensions="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ AdditionalIncludeDirectories="../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <AssemblyReference
+ RelativePath="System.dll"
+ AssemblyName="System, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ MinFrameworkVersion="131072"
+ />
+ <AssemblyReference
+ RelativePath="System.Data.dll"
+ AssemblyName="System.Data, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
+ MinFrameworkVersion="131072"
+ />
+ <AssemblyReference
+ RelativePath="System.XML.dll"
+ AssemblyName="System.Xml, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ MinFrameworkVersion="131072"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\AssemblyInfo.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\boost_math.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\boost_math.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\app.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\app.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/boost/libs/math/dot_net_example/boost_math/resource.h b/boost/libs/math/dot_net_example/boost_math/resource.h
new file mode 100644
index 00000000..c775cb92
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/resource.h
@@ -0,0 +1,9 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by app.rc
+
+// Copyright Paul A. Bristow & John Maddock 2009
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/boost/libs/math/dot_net_example/boost_math/stdafx.h b/boost/libs/math/dot_net_example/boost_math/stdafx.h
new file mode 100644
index 00000000..f463f27f
--- /dev/null
+++ b/boost/libs/math/dot_net_example/boost_math/stdafx.h
@@ -0,0 +1,54 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently.
+
+// Copyright John Maddock 2007.
+// Copyright Paul A. Bristow 2007, 2009, 2010, 2012
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// Laplace added Aug 2009 PAB, and several others Nov 2010,
+// added skew_normal 2012.
+
+#ifdef _MSC_VER
+# pragma once
+# pragma warning (disable : 4127)
+#endif
+
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false
+#define BOOST_MATH_OVERFLOW_ERROR_POLICY errno_on_error
+
+#include <boost/math/distributions/bernoulli.hpp>
+#include <boost/math/distributions/beta.hpp>
+#include <boost/math/distributions/binomial.hpp>
+#include <boost/math/distributions/cauchy.hpp>
+#include <boost/math/distributions/chi_squared.hpp>
+#include <boost/math/distributions/exponential.hpp>
+#include <boost/math/distributions/extreme_value.hpp>
+#include <boost/math/distributions/fisher_f.hpp>
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/math/distributions/geometric.hpp>
+#include <boost/math/distributions/hypergeometric.hpp>
+#include <boost/math/distributions/inverse_chi_squared.hpp>
+#include <boost/math/distributions/inverse_gamma.hpp>
+#include <boost/math/distributions/inverse_gaussian.hpp>
+#include <boost/math/distributions/laplace.hpp>
+#include <boost/math/distributions/logistic.hpp>
+#include <boost/math/distributions/lognormal.hpp>
+#include <boost/math/distributions/negative_binomial.hpp>
+#include <boost/math/distributions/non_central_beta.hpp>
+#include <boost/math/distributions/non_central_chi_squared.hpp>
+#include <boost/math/distributions/non_central_f.hpp>
+#include <boost/math/distributions/non_central_t.hpp>
+#include <boost/math/distributions/normal.hpp>
+#include <boost/math/distributions/pareto.hpp>
+#include <boost/math/distributions/poisson.hpp>
+#include <boost/math/distributions/rayleigh.hpp>
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/math/distributions/skew_normal.hpp>
+#include <boost/math/distributions/triangular.hpp>
+#include <boost/math/distributions/uniform.hpp>
+#include <boost/math/distributions/weibull.hpp>