|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80320 - in sandbox/SOC/2007/visualization: boost/svg_plot boost/svg_plot/detail boost/svg_plot/impl libs/svg_plot/example
From: pbristow_at_[hidden]
Date: 2012-08-30 08:41:20
Author: pbristow
Date: 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
New Revision: 80320
URL: http://svn.boost.org/trac/boost/changeset/80320
Log:
Numerous changes for gcc
Text files modified:
sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp | 22 +++++++-------
sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp | 28 ++++++++++--------
sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp | 2
sandbox/SOC/2007/visualization/boost/svg_plot/impl/svg_1d_plot.ipp | 58 +++++++++++++++++++++------------------
sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp | 2
sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp | 6 ++-
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 9 ++---
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp | 12 ++++----
8 files changed, 73 insertions(+), 66 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -109,8 +109,8 @@
public:
// One only.
- template<typename FPT>
- explicit close_to(FPT tolerance,
+ template<typename T>
+ explicit close_to(T tolerance,
floating_point_comparison_type fpc_type = FPC_STRONG)
:
fraction_tolerance_(tolerance),
@@ -118,7 +118,7 @@
{ //! Constructor for fraction tolerance and strength of comparison.
//! Checks that tolerance isn't negative - which does not make sense,
//! and can be assumed to be a programmer error?
- BOOST_ASSERT(tolerance >= static_cast<FPT>(0));
+ BOOST_ASSERT(tolerance >= static_cast<T>(0));
}
close_to()
@@ -184,8 +184,8 @@
find that x = 0 without any apparent change to x!
*/
public:
- template<typename FPT>
- explicit smallest(FPT s)
+ template<typename T>
+ explicit smallest(T s)
:
smallest_(s)
{ // Constructor.
@@ -204,11 +204,11 @@
*/
}
- template<typename FPT>
- bool operator()(FPT fp_value, FPT s)
+ template<typename T>
+ bool operator()(T fp_value, T s)
{ //!< \return true if smaller than the given small value.
- if (fpt_abs(fp_value) == static_cast<FPT>(0))
- { // Test for zero first in case FPT is actually an integer type zero,
+ if (fpt_abs(fp_value) == static_cast<T>(0))
+ { // Test for zero first in case T is actually an integer type zero,
// when the comparison < below would fail because
// smallest_ could become zero when min_value converts to integer.
return true;
@@ -216,8 +216,8 @@
return fpt_abs(fp_value) < fpt_abs(s);
} // bool operator()
- template<typename FPT>
- bool operator()(FPT fp_value)
+ template<typename T>
+ bool operator()(T fp_value)
{ //!< \return true if smaller than the defined smallest effectively-zero value.
if (fpt_abs(fp_value) == static_cast<FPT>(0))
{ // Test for zero first in case FPT is actually an integer type,
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -38,7 +38,7 @@
#include <cmath> // using std::fabs, std::pow, std::ceil, std::log10
#include <limits> // using std::numeric_limits;
-#include <stdexcept> // using std::domain_error;
+#include <stdexcept> // using std::domain_error; sdtd::runtime_error;
#include <iterator> // using std::iterator_traits;
#include <utility> // using std::pair; using std::make_pair;
@@ -303,7 +303,6 @@
}
// cout << "x_min " << x_min << ", x_max " << x_max << endl; //
}
-
scale_axis(x_min, x_max,
axis_min_value, axis_max_value, axis_tick_increment, auto_ticks, // All 4 updated.
origin, tight, min_ticks, steps); // Display range.
@@ -330,7 +329,7 @@
//! allowing values just 1 pixel over the tick to be shown.
int x_min_ticks = 6, //!< Minimum number of major ticks.
int x_steps = 0, //!< 0, or 2 for 2, 4, 6, 8, 10, 5 for 1, 5, 10, or 10 (2, 5, 10).
- bool y_origin = false, //!< do not include the origin unless the range min_value <= 0 <= max_value.
+ bool y_origin = false, //!< do not include the origin un../sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp:398:5: error: need âtypenameâ before âT:: const_iteratorâ because âTâ is a dependent scopeless the range min_value <= 0 <= max_value.
double y_tight = 0., //!< tightest - fraction of 'overrun' allowed before another tick used.
// for visual effect up to about 0.001 might suit a 1000 pixel wide image,
// allowing values just 1 pixel over the tick to be shown.
@@ -359,7 +358,7 @@
// so still need to iterate through the Y to find y min and y max.
//y_min = px.second;
//y_max = py.second;
- T::const_iterator pos = container.begin();
+ typename T::const_iterator pos = container.begin();
if (pos == container.end())
{
throw std::runtime_error("Autoscale could not find any values to scale axes!");
@@ -395,7 +394,7 @@
using boost::svg::detail::pair_is_limit; // Either x and/or y is not a proper data value.
int goods = 0; // Count of values where both X and Y are normal (within limits).
int limits = 0;// Count of values where both X and Y are at limits (not normal).
- T::const_iterator pos = container.begin();
+ typename T::const_iterator pos = container.begin();
while(pos != container.end() && pair_is_limit(*pos))
{ // Count any limits before the first good.
limits++;
@@ -667,7 +666,7 @@
size_t show(const T& container)
{ //! Utility functions to display STL containers.
cout << container.size() << " values in container: ";
- for (T::const_iterator it = container.begin(); it != container.end(); it++)
+ for (typename T::const_iterator it = container.begin(); it != container.end(); it++)
{
cout << *it << ' ';
}
@@ -696,7 +695,7 @@
size_t show_all(const T& containers)
{ //! Show all the containers values.
// \tparam T an STL container: container of containers.
- for (T::const_iterator it = containers.begin(); it != containers.end(); it++)
+ for (typename T::const_iterator it = containers.begin(); it != containers.end(); it++)
{
show(*it);
}
@@ -708,22 +707,25 @@
{ /*! \return minimum and maximum of an STL container.
\tparam T an STL container: array, vector, set, map ...
*/
- pair<T::const_iterator, T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
- pair<double, double> minmax;
+ std::pair<typename T::const_iterator, typename T::const_iterator> result
+ = boost::minmax_element(container.begin(), container.end());
+ std::pair<double, double> minmax;
minmax.first = *result.first;
minmax.second = *result.second;
return minmax;
} // template <class T> range
-template <class T> // T an STL container: array, vector, set, map ...
+template <typename T> // T an STL container: array, vector, set, map ...
std::pair<double, double> range_all(const T& containers) // Container of STL containers of Data series.
{ /*! \return minimum and maximum of a container containing STL containers.
\tparam T an STL container: array, vector, set, map ...
*/
- std::pair<double, double> minmax((numeric_limits<double>::max)(), (numeric_limits<double>::min)());
- for (T::const_iterator it = containers.begin(); it != containers.end(); it++)
+ std::pair<double, double> minmax(
+ (std::numeric_limits<double>::max)(), (std::numeric_limits<double>::min)()
+ );
+ for (typename T::const_iterator it = containers.begin(); it != containers.end(); it++)
{
- pair<double, double> mm = range(*it); // Scale of this container.
+ std::pair<double, double> mm = range(*it); // Scale of this container.
minmax.first = (std::min)(mm.first, minmax.first); //
minmax.second = (std::max)(mm.second, minmax.second);
}
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -4150,4 +4150,4 @@
} // svg
} // boost
-#endif BOOST_SVG_AXIS_PLOT_FRAME_IPP
+#endif // BOOST_SVG_AXIS_PLOT_FRAME_IPP
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/impl/svg_1d_plot.ipp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/impl/svg_1d_plot.ipp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/impl/svg_1d_plot.ipp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -34,7 +34,7 @@
line_style_(black, blank, 2, false, false) // Default line style, black, no fill, width, line_on, bezier_on false
{
/*
- cout << "typeid(C).name() = " << typeid(C).name() << endl;
+ std::cout << "typeid(C).name() = " << typeid(C).name() << std::endl;
typeid(C).name() =
class boost::transform_iterator
<
@@ -58,9 +58,10 @@
//boost::svg::unc temp = *i; // Assumes unc type.
// So use auto to automatically make temp the right type.
- auto temp = *i; // Should provide double, unc, meas ... type.
-
- //cout << "typeid(temp).name() = " << typeid(temp).name() << endl;
+ unc<false> temp = *i; // Should provide double, unc, meas ... type.
+// TODO will
+ //auto temp = *i; // Should provide double, unc, meas ... type.
+ //std::cout << "typeid(temp).name() = " << typeid(temp).name() << std::endl;
// typeid(temp).name() = class Meas
// typeid(temp).name() = class boost::svg::unc
if(detail::is_limit(temp.value()))
@@ -739,12 +740,13 @@
} // plot
-template <typename T, typename U> /*!
+//template <typename T, typename U>
+/*!
\tparam T floating-point type of the data (which must be convertable to double).
\tparam U functor floating-point type (default is @c double_1d_convert).
*/
-svg_1d_plot_series& svg_1d_plot::plot(const T& container, const std::string& title /* = "" */, U functor/*= double_1d_convert*/)
-{ //! Add a data series to the plot, with optional title.
+//svg_1d_plot_series& svg_1d_plot::plot(const T& container, const std::string& title /* = "" */, U functor/*= double_1d_convert*/)
+//{ //! Add a data series to the plot, with optional title.
/*!
This version of plot includes a functor, allowing other than just convert data values to double(the default).
\param container Container for data (for example vector) that contains the data to be added to the plot.
@@ -754,22 +756,25 @@
\return a reference to data series just added (to make chainable).
*/
- serieses_.push_back(
- svg_1d_plot_series(
- boost::make_transform_iterator(container.begin(), functor),
- boost::make_transform_iterator(container.end(), functor),
- title)
- );
- return serieses_[serieses_.size() - 1]; // Reference to data series just added.
-} // plot
+// serieses_.push_back(
+// svg_1d_plot_series(
+// boost::make_transform_iterator(container.begin(), functor),
+// boost::make_transform_iterator(container.end(), functor),
+// title)
+// );
+// return serieses_[serieses_.size() - 1]; // Reference to data series just added.
+//} // plot
-template <typename T, typename U> /*!
+//template <typename T, typename U>
+ /*!
\tparam T floating-point type of the data (which must be convertable to double).
\tparam U functor floating-point type (default is double_1d_convert).
*/
-svg_1d_plot_series& svg_1d_plot::plot(const T& begin, const T& end, const std::string& title /* = ""*/, U functor /* = double_1d_convert */)
-{ /*! Add a data series to the plot, with optional title. (Version with custom functor, rather than to double).
+//svg_1d_plot_series& svg_1d_plot::plot(const T& begin, const T& end, const std::string& title /* = ""*/,
+// U functor /* = double_1d_convert */)
+//{
+ /*! Add a data series to the plot, with optional title. (Version with custom functor, rather than to double).
\note This version permits a @b partial range, begin to end, of the container to be used.
\param begin Iterator to 1st data item in container.
@@ -778,15 +783,14 @@
\param functor Custom functor.
\return a reference to data series just added (to make chainable).
*/
-
- serieses_.push_back(
- svg_1d_plot_series(
- boost::make_transform_iterator(begin, functor),
- boost::make_transform_iterator(end, functor),
- title)
- );
- return serieses_[serieses_.size() - 1]; //!< \return Reference to data series just added.
-} // plot
+// serieses_.push_back(
+// svg_1d_plot_series(
+// boost::make_transform_iterator(begin, functor),
+// boost::make_transform_iterator(end, functor),
+// title)
+// );
+// return serieses_[serieses_.size() - 1]; //!< \return Reference to data series just added.
+//} // plot
// End Definitions of svg_plot_series Public Member Functions.
} // namespace svg
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -19,7 +19,7 @@
#define BOOST_SVG_SHOW_1D_SETTINGS_HPP
#include <boost/svg_plot/detail/pair.hpp>
- using boost::svg::detail::operator<<;
+// using boost::svg::detail::operator<<;
#include <iostream>
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -285,10 +285,12 @@
svg_1d_plot_series& plot(const T& container, const std::string& title = "");
template <typename T>
svg_1d_plot_series& plot(const T& begin, const T& end, const std::string& title = "");
+ /*
template <typename T, typename U>
- svg_1d_plot_series& plot(const T& container, const std::string& title = "", U functor = double_1d_convert);
+ svg_1d_plot_series& plot(const T& container, const std::string& title = "", U functor = detail::double_1d_convert);
template <typename T, typename U>
- svg_1d_plot_series& plot(const T& begin, const T& end, const std::string& title = "", U functor = double_1d_convert);
+ svg_1d_plot_series& plot(const T& begin, const T& end, const std::string& title = "", U functor = detail::double_1d_convert);
+ */
}; // class svg_1d_plot
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -159,7 +159,7 @@
stroke_(svg_color(0, 0, 0)), //! Stroke default is black.
fill_(blank), //! No fill color.
width_(0), //! No width specified.
- fill_on_(false), stroke_on_(false), width_on_(false) //! All switches off.
+ stroke_on_(false), fill_on_(false), width_on_(false) //! All switches off.
{ // Default constructor initialises all private data.
}
@@ -304,7 +304,7 @@
friend bool operator== (const text_style&, const text_style&);
friend bool operator!= (const text_style&, const text_style&);
- public: //temporary for experimental gil
+ public: // temporary for experimental gil
//private:
int font_size_; //!< Font size (SVG units, default pixels).
@@ -318,8 +318,8 @@
text_style( //!
int size = 12, //!< Default font size (12 pixels).
const std::string& font = "", //!< Examples: "Arial", "Times New Roman", "Verdana", "Lucida Sans Unicode"
- const std::string& style = "", //!< font-style: normal | bold | italic | oblique
const std::string& weight = "", //!< Examples: "bold", "normal"
+ const std::string& style = "", //!< font-style: normal | bold | italic | oblique
const std::string& stretch = "", //!< font-stretch: normal | wider | narrower ...
const std::string& decoration = ""); //!< Examples: "underline" | "overline" | "line-through"
@@ -331,7 +331,6 @@
text_style& font_decoration(const std::string& s);
// text_style& font_variant(const std::string& s); // Not implemented,
-
int font_size() const;
const std::string& font_family() const;
const std::string& font_style() const;
@@ -558,8 +557,8 @@
bool strip_e0s_; //!< If true, then unnecessary zeros and + sign will be stripped to reduce length.
text_style values_text_style_; //!< Font etc used for data point value marking.
// svg_style
- svg_color fill_color_; //!< Fill color for value.
svg_color stroke_color_; //!< Stroke color for value.
+ svg_color fill_color_; //!< Fill color for value.
bool plusminus_on_; /*!< If an uncertainty estimate is to be appended (as + or - value).
\details See http://en.wikipedia.org/wiki/Plus-minus_sign
*/
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp 2012-08-30 08:41:18 EDT (Thu, 30 Aug 2012)
@@ -2,7 +2,7 @@
\brief Simple plot of uncertainty of 1D data.
\details An example to demonstrate simple 1D plot using two vectors,
including showing values with uncertainty information as
- 'plus minus' and degrees of freedom estimates.
+ "plus minus" and degrees of freedom estimates.
\author Paul A. Bristow
\date Mar 2009
*/
@@ -31,7 +31,7 @@
// using boost::svg::detail::unc_1d_convert;
#include <boost/svg_plot/svg_1d_plot.hpp>
using namespace boost::svg;
-
+
#include <boost/svg_plot/show_1d_settings.hpp>
void boost::svg::show_1d_plot_settings(svg_1d_plot&);
@@ -96,7 +96,7 @@
*/
my_plot.autoscale_check_limits(false); // Default is true.
my_plot.autoscale_plusminus(2); // default is 3.
- my_plot.confidence(0.01); // Change alpha from default 0.05 == 95% to 0.01 == 99%.
+ my_plot.confidence(0.01); // Change alpha from default 0.05 == 95% to 0.01 == 99%.
my_plot
.plot_window_on(true)
@@ -139,7 +139,7 @@
Finally, we can write the SVG to a file of our choice.
*/
- std::string svg_file = (my_plot.legend_on() == true) ?
+ std::string svg_file = (my_plot.legend_on() == true) ?
"./demo_1d_uncertainty_legend.svg" : "./demo_1d_uncertainty.svg";
my_plot.write(svg_file);
@@ -160,8 +160,8 @@
Linking...
Embedding manifest...
Autorun j:\Cpp\SVG\debug\demo_1d_uncertainty.exe
-3.1±0.02 (8) 4.2±0.01 (14)
-2.1±0.001 (30) 7.8±0.0025 (21) 3.4±0.03 6.9
+3.1�0.02 (8) 4.2�0.01 (14)
+2.1�0.001 (30) 7.8�0.0025 (21) 3.4�0.03 6.9
Build Time 0:03
//] [/demo_1d_uncertainty_output]
*/
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