Minor stylistic improvements

parent 92af6ffb
Pipeline #994 passed with stage
in 1 minute and 44 seconds
......@@ -106,7 +106,7 @@ protected:
static string packageDir(const string &package);
private:
const static int constants_precision{16};
constexpr static int constants_precision{16};
//! The list of nodes
vector<unique_ptr<ExprNode>> node_list;
......
......@@ -181,8 +181,8 @@ class ExprNode
//! Used for caching of first order derivatives (when non-null)
map<int, expr_t> derivatives;
const static int min_cost_matlab{40*90};
const static int min_cost_c{40*4};
constexpr static int min_cost_matlab{40*90};
constexpr static int min_cost_c{40*4};
inline static int min_cost(bool is_matlab) { return(is_matlab ? min_cost_matlab : min_cost_c); };
//! Cost of computing current node
......
......@@ -53,11 +53,11 @@ public:
};
using external_function_table_type = map<int, external_function_options>;
//! Symbol ID used when no external function exists that calculates the derivative
const static int IDNotSet = -1;
constexpr static int IDNotSet = -1;
//! Symbol ID used when the derivative is obtained from the top-level function
const static int IDSetButNoNameProvided = -2;
constexpr static int IDSetButNoNameProvided = -2;
//! Default number of arguments when nargs is not specified
const static int defaultNargs = 1;
constexpr static int defaultNargs = 1;
private:
//! Map containing options provided to external_functions()
external_function_table_type externalFunctionTable;
......
......@@ -143,8 +143,8 @@ void
OptionsList::writeOutput(ostream &output, const string &option_group) const
{
// Initialize option_group as an empty struct iff the field does not exist!
unsigned idx = option_group.find_last_of(".");
if (idx < UINT_MAX)
size_t idx = option_group.find_last_of(".");
if (idx != string::npos)
{
output << "if ~isfield(" << option_group.substr(0, idx) << ",'" << option_group.substr(idx+1) << "')" << endl;
output << " " << option_group << " = struct();" << endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment