From 035cde069b50af9d43bca45e7de8b00380def324 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Thu, 7 Sep 2023 16:42:42 -0400 Subject: [PATCH] Some more warnings picked up from msvc+clang --- include/teqp/ideal_eosterms.hpp | 21 ++++++++++++++------- include/teqp/json_tools.hpp | 4 ++-- include/teqp/models/pcsaft.hpp | 4 ++-- include/teqp/models/saftvrmie.hpp | 4 ++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/include/teqp/ideal_eosterms.hpp b/include/teqp/ideal_eosterms.hpp index e654bbb8..2d73f90b 100644 --- a/include/teqp/ideal_eosterms.hpp +++ b/include/teqp/ideal_eosterms.hpp @@ -72,7 +72,8 @@ namespace teqp { */ class IdealHelmholtzPowerT { public: - const std::valarray n, t, R; + const std::valarray n, t; + const double R; IdealHelmholtzPowerT(const std::valarray& n, const std::valarray& t, double R) : n(n), t(t), R(R) {}; template @@ -90,7 +91,8 @@ namespace teqp { */ class IdealHelmholtzPlanckEinstein { public: - const std::valarray n, theta, R; + const std::valarray n, theta; + const double R; IdealHelmholtzPlanckEinstein(const std::valarray& n, const std::valarray& theta, double R) : n(n), theta(theta), R(R) {}; template @@ -108,7 +110,8 @@ namespace teqp { */ class IdealHelmholtzPlanckEinsteinGeneralized { public: - const std::valarray n, c, d, theta, R; + const std::valarray n, c, d, theta; + const double R; IdealHelmholtzPlanckEinsteinGeneralized( const std::valarray& n, const std::valarray& c, @@ -134,7 +137,8 @@ namespace teqp { */ class IdealHelmholtzGERG2004Cosh { public: - const std::valarray n, theta, R; + const std::valarray n, theta; + const double R; IdealHelmholtzGERG2004Cosh(const std::valarray& n, const std::valarray& theta, double R) : n(n), theta(theta), R(R) {}; template @@ -156,7 +160,8 @@ namespace teqp { */ class IdealHelmholtzGERG2004Sinh { public: - const std::valarray n, theta, R; + const std::valarray n, theta; + const double R; IdealHelmholtzGERG2004Sinh(const std::valarray& n, const std::valarray& theta, double R) : n(n), theta(theta), R(R) {}; template @@ -180,7 +185,8 @@ namespace teqp { */ class IdealHelmholtzCp0Constant { public: - const double c, T_0, R; + const double c, T_0; + const double R; IdealHelmholtzCp0Constant( const double c, const double T_0, const double R ) : c(c), T_0(T_0), R(R) {}; @@ -203,7 +209,8 @@ namespace teqp { */ class IdealHelmholtzCp0PowerT { public: - const double c, t, T_0, R; + const double c, t, T_0; + const double R; IdealHelmholtzCp0PowerT( const double c, const double t, const double T_0, const double R ) : c(c), t(t), T_0(T_0), R(R) {}; diff --git a/include/teqp/json_tools.hpp b/include/teqp/json_tools.hpp index 09c720c5..9ba1a65f 100644 --- a/include/teqp/json_tools.hpp +++ b/include/teqp/json_tools.hpp @@ -54,8 +54,8 @@ namespace teqp{ if (row.size() != mat.rows()){ throw std::invalid_argument("provided matrix is not square"); } - for (auto j = 0; j < row.size(); ++j){ - mat(i, j) = row[j]; + for (auto k = 0; k < row.size(); ++k){ + mat(i, k) = row[k]; } } return mat; diff --git a/include/teqp/models/pcsaft.hpp b/include/teqp/models/pcsaft.hpp index 8bb14da6..9251efff 100644 --- a/include/teqp/models/pcsaft.hpp +++ b/include/teqp/models/pcsaft.hpp @@ -304,9 +304,9 @@ class PCSAFTMixture { throw teqp::InvalidArgument("kmat needs to be a square matrix the same size as the number of components"); } }; - auto get_coeffs_from_names(const std::vector &names){ + auto get_coeffs_from_names(const std::vector &the_names){ PCSAFTLibrary library; - return library.get_coeffs(names); + return library.get_coeffs(the_names); } auto build_hardchain(const std::vector &coeffs){ check_kmat(coeffs.size()); diff --git a/include/teqp/models/saftvrmie.hpp b/include/teqp/models/saftvrmie.hpp index b826b1c9..29e52d80 100644 --- a/include/teqp/models/saftvrmie.hpp +++ b/include/teqp/models/saftvrmie.hpp @@ -188,8 +188,8 @@ struct SAFTVRMieChainContributionTerms{ } } std::size_t get_N(){ - auto sizes = (Eigen::ArrayXd(5) << m.size(), epsilon_over_k.size(), sigma_A.size(), lambda_a.size(), lambda_r.size()).finished(); - if (sizes.mean() != sizes.minCoeff()){ + auto sizes = (Eigen::ArrayX(5) << m.size(), epsilon_over_k.size(), sigma_A.size(), lambda_a.size(), lambda_r.size()).finished(); + if (sizes.maxCoeff() != sizes.minCoeff()){ throw teqp::InvalidArgument("sizes of pure component arrays are not all the same"); } return sizes[0];