|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65189 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2010-09-02 07:01:28
Author: pbristow
Date: 2010-09-02 07:01:26 EDT (Thu, 02 Sep 2010)
New Revision: 65189
URL: http://svn.boost.org/trac/boost/changeset/65189
Log:
Mistake in declaration noted by Darwin only corrected.
Text files modified:
trunk/libs/math/example/nc_chi_sq_example.cpp | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
Modified: trunk/libs/math/example/nc_chi_sq_example.cpp
==============================================================================
--- trunk/libs/math/example/nc_chi_sq_example.cpp (original)
+++ trunk/libs/math/example/nc_chi_sq_example.cpp 2010-09-02 07:01:26 EDT (Thu, 02 Sep 2010)
@@ -26,7 +26,7 @@
#include <boost/math/distributions/non_central_chi_squared.hpp>
using boost::math::chi_squared;
-boost::math::non_central_chi_squared;
+using boost::math::non_central_chi_squared;
#include <iostream>
using std::cout; using std::endl;
@@ -38,12 +38,12 @@
Create a table of the power of the [chi][super 2] test at
5% significance level, start with a table header:
*/
- std::cout << "[table\n[[[nu]]";
+ cout << "[table\n[[[nu]]";
for(int lam = 2; lam <= 20; lam += 2)
{
- std::cout << "[[lambda]=" << lam << "]";
+ cout << "[[lambda]=" << lam << "]";
}
- std::cout << "]\n";
+ cout << "]\n";
/*`
(Note: the enclosing [] brackets are to format as a table in Boost.Quickbook).
@@ -54,26 +54,26 @@
for(int n = 2; n <= 20; ++n)
{
- std::cout << "[[" << n << "]";
+ cout << "[[" << n << "]";
for(int lam = 2; lam <= 20; lam += 2)
{
/*`
Calculate the [chi][super 2] statistic for a 5% significance:
*/
- double cs = quantile(complement(boost::math::chi_squared(n), 0.05));
+ double cs = quantile(complement(chi_squared(n), 0.05));
/*`
The power of the test is given by the complement of the CDF
of the non-central [chi][super 2] distribution:
*/
- double beta = cdf(complement(boost::math::non_central_chi_squared(n, lam), cs));
+ double beta = cdf(complement(non_central_chi_squared(n, lam), cs));
/*`
Then output the cell value:
*/
- std::cout << "[" << std::setprecision(3) << beta << "]";
+ cout << "[" << setprecision(3) << beta << "]";
}
- std::cout << "]" << std::endl;
+ cout << "]" << endl;
}
- std::cout << "]" << std::endl;
+ cout << "]" << endl;
}
/*`
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