C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow 2014-06-13 04:24:23 +10:00
parent 2707dd186e
commit 840e442a1b
2 changed files with 13 additions and 3 deletions

View File

@ -258,8 +258,8 @@ namespace exprtk
const std::size_t length = std::min(s1.size(),s2.size()); const std::size_t length = std::min(s1.size(),s2.size());
for (std::size_t i = 0; i < length; ++i) for (std::size_t i = 0; i < length; ++i)
{ {
const char c1 = std::tolower(s1[i]); const char c1 = static_cast<char>(std::tolower(s1[i]));
const char c2 = std::tolower(s2[i]); const char c2 = static_cast<char>(std::tolower(s2[i]));
if (c1 > c2) if (c1 > c2)
return false; return false;
else if (c1 < c2) else if (c1 < c2)
@ -4565,7 +4565,9 @@ namespace exprtk
inline T value() const inline T value() const
{ {
throw break_exception<T>(return_ ? return_->value() : std::numeric_limits<T>::quiet_NaN()); throw break_exception<T>(return_ ? return_->value() : std::numeric_limits<T>::quiet_NaN());
#ifndef _MSC_VER
return std::numeric_limits<T>::quiet_NaN(); return std::numeric_limits<T>::quiet_NaN();
#endif
} }
inline typename expression_node<T>::node_type type() const inline typename expression_node<T>::node_type type() const
@ -4587,7 +4589,9 @@ namespace exprtk
inline T value() const inline T value() const
{ {
throw continue_exception(); throw continue_exception();
#ifndef _MSC_VER
return std::numeric_limits<T>::quiet_NaN(); return std::numeric_limits<T>::quiet_NaN();
#endif
} }
inline typename expression_node<T>::node_type type() const inline typename expression_node<T>::node_type type() const
@ -5422,6 +5426,8 @@ namespace exprtk
private: private:
vector_assignment_node<T>& operator=(const vector_assignment_node<T>&);
mutable T* vector_base_; mutable T* vector_base_;
std::vector<expression_ptr> initialiser_list_; std::vector<expression_ptr> initialiser_list_;
const std::size_t size_; const std::size_t size_;
@ -12760,6 +12766,8 @@ namespace exprtk
private: private:
scope_element_manager& operator=(const scope_element_manager&);
parser_t& parser_; parser_t& parser_;
std::vector<scope_element> element_; std::vector<scope_element> element_;
scope_element null_element_; scope_element null_element_;
@ -12793,6 +12801,8 @@ namespace exprtk
private: private:
scope_handler& operator=(const scope_handler&);
parser_t& parser_; parser_t& parser_;
}; };

View File

@ -69,7 +69,7 @@ void savitzky_golay_filter()
const T pi = T(3.141592653589793238462); const T pi = T(3.141592653589793238462);
srand(time(0)); srand(static_cast<unsigned int>(time(0)));
// Generate a signal with noise. // Generate a signal with noise.
for (T t = T(-5); t <= T(+5); t += T(10.0 / n)) for (T t = T(-5); t <= T(+5); t += T(10.0 / n))