Skip to content

Commit

Permalink
Some more warnings picked up from msvc+clang
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhbell committed Sep 7, 2023
1 parent edddb2d commit 035cde0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
21 changes: 14 additions & 7 deletions include/teqp/ideal_eosterms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ namespace teqp {
*/
class IdealHelmholtzPowerT {
public:
const std::valarray<double> n, t, R;
const std::valarray<double> n, t;
const double R;
IdealHelmholtzPowerT(const std::valarray<double>& n, const std::valarray<double>& t, double R) : n(n), t(t), R(R) {};

template<typename TType, typename RhoType>
Expand All @@ -90,7 +91,8 @@ namespace teqp {
*/
class IdealHelmholtzPlanckEinstein {
public:
const std::valarray<double> n, theta, R;
const std::valarray<double> n, theta;
const double R;
IdealHelmholtzPlanckEinstein(const std::valarray<double>& n, const std::valarray<double>& theta, double R) : n(n), theta(theta), R(R) {};

template<typename TType, typename RhoType>
Expand All @@ -108,7 +110,8 @@ namespace teqp {
*/
class IdealHelmholtzPlanckEinsteinGeneralized {
public:
const std::valarray<double> n, c, d, theta, R;
const std::valarray<double> n, c, d, theta;
const double R;
IdealHelmholtzPlanckEinsteinGeneralized(
const std::valarray<double>& n,
const std::valarray<double>& c,
Expand All @@ -134,7 +137,8 @@ namespace teqp {
*/
class IdealHelmholtzGERG2004Cosh {
public:
const std::valarray<double> n, theta, R;
const std::valarray<double> n, theta;
const double R;
IdealHelmholtzGERG2004Cosh(const std::valarray<double>& n, const std::valarray<double>& theta, double R) : n(n), theta(theta), R(R) {};

template<typename TType, typename RhoType>
Expand All @@ -156,7 +160,8 @@ namespace teqp {
*/
class IdealHelmholtzGERG2004Sinh {
public:
const std::valarray<double> n, theta, R;
const std::valarray<double> n, theta;
const double R;
IdealHelmholtzGERG2004Sinh(const std::valarray<double>& n, const std::valarray<double>& theta, double R) : n(n), theta(theta), R(R) {};

template<typename TType, typename RhoType>
Expand All @@ -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) {};
Expand All @@ -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) {};
Expand Down
4 changes: 2 additions & 2 deletions include/teqp/json_tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/teqp/models/pcsaft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> &names){
auto get_coeffs_from_names(const std::vector<std::string> &the_names){
PCSAFTLibrary library;
return library.get_coeffs(names);
return library.get_coeffs(the_names);
}
auto build_hardchain(const std::vector<SAFTCoeffs> &coeffs){
check_kmat(coeffs.size());
Expand Down
4 changes: 2 additions & 2 deletions include/teqp/models/saftvrmie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eigen::Index>(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];
Expand Down

0 comments on commit 035cde0

Please sign in to comment.