|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55664 - sandbox/math_toolkit/libs/math/dot_net_example/boost_math
From: pbristow_at_[hidden]
Date: 2009-08-19 09:41:20
Author: pbristow
Date: 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
New Revision: 55664
URL: http://svn.boost.org/trac/boost/changeset/55664
Log:
added laplace distribution
Text files modified:
sandbox/math_toolkit/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp | 4 +-
sandbox/math_toolkit/libs/math/dot_net_example/boost_math/Stdafx.h | 4 ++
sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.cpp | 55 +++++++++++++++++++++------------------
sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.sln | 4 +-
sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.vcproj | 16 ++++++-----
5 files changed, 46 insertions(+), 37 deletions(-)
Modified: sandbox/math_toolkit/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp (original)
+++ sandbox/math_toolkit/libs/math/dot_net_example/boost_math/AssemblyInfo.cpp 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
@@ -16,7 +16,7 @@
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("jmc")];
[assembly:AssemblyProductAttribute("boost_math")];
-[assembly:AssemblyCopyrightAttribute("Copyright (c) jmc 2007")];
+[assembly:AssemblyCopyrightAttribute("Copyright (c) jmc 2007, 2009")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
@@ -31,7 +31,7 @@
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly:AssemblyVersionAttribute("1.0.*")];
+[assembly:AssemblyVersionAttribute("1.1.*")];
[assembly:ComVisible(false)];
Modified: sandbox/math_toolkit/libs/math/dot_net_example/boost_math/Stdafx.h
==============================================================================
--- sandbox/math_toolkit/libs/math/dot_net_example/boost_math/Stdafx.h (original)
+++ sandbox/math_toolkit/libs/math/dot_net_example/boost_math/Stdafx.h 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
@@ -3,13 +3,14 @@
// but are changed infrequently.
// Copyright John Maddock 2007.
-// Copyright Paul A. Bristow 2007.
+// Copyright Paul A. Bristow 2007, 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)
+// Laplace added Aug 2009 PAB
#pragma once
@@ -25,6 +26,7 @@
#include <boost/math/distributions/extreme_value.hpp>
#include <boost/math/distributions/fisher_f.hpp>
#include <boost/math/distributions/gamma.hpp>
+#include <boost/math/distributions/laplace.hpp>
#include <boost/math/distributions/lognormal.hpp>
#include <boost/math/distributions/negative_binomial.hpp>
#include <boost/math/distributions/normal.hpp>
Modified: sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.cpp (original)
+++ sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.cpp 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
@@ -1,5 +1,5 @@
// Copyright John Maddock 2007.
-// Copyright Paul A. Bristow 2007.
+// Copyright Paul A. Bristow 2007, 2009.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
@@ -51,45 +51,49 @@
case 5:
this->reset(new concrete_distribution<boost::math::exponential>(boost::math::exponential(arg1)));
break;
- case 6:
+ case 6:
this->reset(new concrete_distribution<boost::math::extreme_value>(boost::math::extreme_value(arg1)));
break;
- case 7:
+ case 7:
this->reset(new concrete_distribution<boost::math::fisher_f >(boost::math::fisher_f(arg1, arg2)));
break;
- case 8:
+ case 8:
this->reset(new concrete_distribution<boost::math::gamma_distribution<> >(boost::math::gamma_distribution<>(arg1, arg2)));
break;
- case 9:
+ case 9:
+ this->reset(new concrete_distribution<boost::math::laplace_distribution<> >(boost::math::laplace_distribution<>(arg1, arg2)));
+ break;
+ case 10:
this->reset(new concrete_distribution<boost::math::lognormal_distribution<> >(boost::math::lognormal_distribution<>(arg1, arg2)));
break;
- case 10:
+ case 11:
this->reset(new concrete_distribution<boost::math::negative_binomial_distribution<> >(boost::math::negative_binomial_distribution<>(arg1, arg2)));
break;
- case 11:
+ case 12:
this->reset(new concrete_distribution<boost::math::normal_distribution<> >(boost::math::normal_distribution<>(arg1, arg2)));
break;
- case 12:
+ case 13:
this->reset(new concrete_distribution<boost::math::pareto>(boost::math::pareto(arg1, arg2)));
break;
- case 13:
+ case 14:
this->reset(new concrete_distribution<boost::math::poisson>(boost::math::poisson(arg1)));
break;
- case 14:
+ case 15:
this->reset(new concrete_distribution<boost::math::rayleigh>(boost::math::rayleigh(arg1)));
break;
- case 15:
+ case 16:
this->reset(new concrete_distribution<boost::math::students_t>(boost::math::students_t(arg1)));
break;
- case 16:
+ case 17:
this->reset(new concrete_distribution<boost::math::triangular>(boost::math::triangular(arg1, arg2, arg3)));
break;
- case 17:
+ case 18:
this->reset(new concrete_distribution<boost::math::uniform>(boost::math::uniform(arg1, arg2)));
break;
- case 18:
+ case 19:
this->reset(new concrete_distribution<boost::math::weibull>(boost::math::weibull(arg1, arg2)));
break;
+
default:
// TODO:
// Need some proper error handling here:
@@ -126,17 +130,18 @@
{ "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", "Shape", "Scale", "", 1, 1, }, // case 8
- { "Lognormal", "Location", "Scale", "", 0, 1, 0}, // case 9
- { "Negative Binomial", "Successes", "Probability of success", "", 1, 0.5, 0}, // case 10
- { "Normal (Gaussian)", "Mean", "Standard Deviation", "", 0, 1, 0}, // case 11
- { "Pareto", "Location", "Shape","", 1, 1, 0}, // case 12
- { "Poisson", "Mean", "", "", 1, 0, 0}, // case 13
- { "Rayleigh", "Sigma", "", "", 1, 0, 0}, // case 14
- { "Student's t", "Degrees of Freedom", "", "", 1, 0, 0}, // case 15
- { "Triangular", "Lower", "Mode", "Upper", -1, 0, +1 }, // case 16 3rd parameter!
- // 0, 0.5, 1 also said to 'standard' but this is most like an approximation to Gaussian distribution.
- { "Uniform", "Lower", "Upper", "", 0, 1, 0}, // case 17
- { "Weibull", "Shape", "Scale", "", 1, 1, 0}, // case 18
+ { "Laplace", "Location", "Scale", "", 0, 1, 0}, // case 9
+ { "Lognormal", "Location", "Scale", "", 0, 1, 0}, // case 10
+ { "Negative Binomial", "Successes", "Probability of success", "", 1, 0.5, 0}, // case 11
+ { "Normal (Gaussian)", "Mean", "Standard Deviation", "", 0, 1, 0}, // case 12
+ { "Pareto", "Location", "Shape","", 1, 1, 0}, // case 13
+ { "Poisson", "Mean", "", "", 1, 0, 0}, // case 14
+ { "Rayleigh", "Sigma", "", "", 1, 0, 0}, // case 15
+ { "Student's t", "Degrees of Freedom", "", "", 1, 0, 0}, // case 16
+ { "Triangular", "Lower", "Mode", "Upper", -1, 0, +1 }, // case 17 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 18
+ { "Weibull", "Shape", "Scale", "", 1, 1, 0}, // case 19
};
// How many distributions are supported:
Modified: sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.sln
==============================================================================
--- sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.sln (original)
+++ sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.sln 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
@@ -1,6 +1,6 @@

-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C++ Express 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_math", "boost_math.vcproj", "{CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}"
EndProject
Global
Modified: sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.vcproj
==============================================================================
--- sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.vcproj (original)
+++ sandbox/math_toolkit/libs/math/dot_net_example/boost_math/boost_math.vcproj 2009-08-19 09:41:19 EDT (Wed, 19 Aug 2009)
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="boost_math"
ProjectGUID="{CEE4BAD0-967A-4193-9EDB-C0DD6C3B05C9}"
RootNamespace="boost_math"
Keyword="ManagedCProj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -63,6 +64,8 @@
LinkIncremental="1"
GenerateDebugInformation="true"
AssemblyDebug="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -84,9 +87,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -139,6 +139,8 @@
AdditionalDependencies="$(NoInherit)"
LinkIncremental="1"
GenerateDebugInformation="false"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -160,9 +162,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -171,14 +170,17 @@
<AssemblyReference
RelativePath="System.dll"
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ MinFrameworkVersion="131072"
/>
<AssemblyReference
RelativePath="System.Data.dll"
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
+ MinFrameworkVersion="131072"
/>
<AssemblyReference
RelativePath="System.XML.dll"
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
+ MinFrameworkVersion="131072"
/>
</References>
<Files>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk