Fixed code indentation.

issue#70
Stéphane Adjemian (Charybdis) 2017-06-14 07:01:31 +02:00
parent 3eddd5ce88
commit 51feda7d02
35 changed files with 1325 additions and 1255 deletions

View File

@ -2025,4 +2025,3 @@ public:
#endif #endif
#pragma pack(pop) #pragma pack(pop)
#endif #endif

View File

@ -289,9 +289,9 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
it = options_list.num_options.find("hp_filter"); it = options_list.num_options.find("hp_filter");
OptionsList::num_options_t::const_iterator it1 = options_list.num_options.find("bandpass.indicator"); OptionsList::num_options_t::const_iterator it1 = options_list.num_options.find("bandpass.indicator");
OptionsList::num_options_t::const_iterator it2 = options_list.num_options.find("one_sided_hp_filter"); OptionsList::num_options_t::const_iterator it2 = options_list.num_options.find("one_sided_hp_filter");
if ((it != options_list.num_options.end() && it1 != options_list.num_options.end()) || if ((it != options_list.num_options.end() && it1 != options_list.num_options.end())
(it != options_list.num_options.end() && it2 != options_list.num_options.end()) || || (it != options_list.num_options.end() && it2 != options_list.num_options.end())
(it1 != options_list.num_options.end() && it2 != options_list.num_options.end())) || (it1 != options_list.num_options.end() && it2 != options_list.num_options.end()))
{ {
cerr << "ERROR: stoch_simul: can only use one of hp, one-sided hp, and bandpass filters" cerr << "ERROR: stoch_simul: can only use one of hp, one-sided hp, and bandpass filters"
<< endl; << endl;
@ -827,15 +827,15 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (options_list.string_options.find("datafile") == options_list.string_options.end() && if (options_list.string_options.find("datafile") == options_list.string_options.end()
!mod_file_struct.estimation_data_statement_present) && !mod_file_struct.estimation_data_statement_present)
{ {
cerr << "ERROR: The estimation statement requires a data file to be supplied via the datafile option." << endl; cerr << "ERROR: The estimation statement requires a data file to be supplied via the datafile option." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (options_list.string_options.find("mode_file") != options_list.string_options.end() && if (options_list.string_options.find("mode_file") != options_list.string_options.end()
mod_file_struct.estim_params_use_calib) && mod_file_struct.estim_params_use_calib)
{ {
cerr << "ERROR: The mode_file option of the estimation statement is incompatible with the use_calibration option of the estimated_params_init block." << endl; cerr << "ERROR: The mode_file option of the estimation statement is incompatible with the use_calibration option of the estimated_params_init block." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -1976,8 +1976,8 @@ MSSBVAREstimationStatement::checkPass(ModFileStructure &mod_file_struct, Warning
mod_file_struct.bvar_present = true; mod_file_struct.bvar_present = true;
if (options_list.num_options.find("ms.create_init") == options_list.num_options.end()) if (options_list.num_options.find("ms.create_init") == options_list.num_options.end())
if (options_list.string_options.find("datafile") == options_list.string_options.end() || if (options_list.string_options.find("datafile") == options_list.string_options.end()
options_list.num_options.find("ms.initial_year") == options_list.num_options.end()) || options_list.num_options.find("ms.initial_year") == options_list.num_options.end())
{ {
cerr << "ERROR: If you do not pass no_create_init to ms_estimation, " cerr << "ERROR: If you do not pass no_create_init to ms_estimation, "
<< "you must pass the datafile and initial_year options." << endl; << "you must pass the datafile and initial_year options." << endl;
@ -2144,9 +2144,9 @@ MSSBVARIrfStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
if (it != options_list.num_options.end()) if (it != options_list.num_options.end())
filtered_probabilities_present = true; filtered_probabilities_present = true;
if ((filtered_probabilities_present && regime_present) || if ((filtered_probabilities_present && regime_present)
(filtered_probabilities_present && regimes_present) || || (filtered_probabilities_present && regimes_present)
(regimes_present && regime_present)) || (regimes_present && regime_present))
{ {
cerr << "ERROR: You may only pass one of regime, regimes and " cerr << "ERROR: You may only pass one of regime, regimes and "
<< "filtered_probabilities to ms_irf" << endl; << "filtered_probabilities to ms_irf" << endl;
@ -2244,9 +2244,9 @@ MSSBVARVarianceDecompositionStatement::checkPass(ModFileStructure &mod_file_stru
if (it != options_list.num_options.end()) if (it != options_list.num_options.end())
filtered_probabilities_present = true; filtered_probabilities_present = true;
if ((filtered_probabilities_present && regime_present) || if ((filtered_probabilities_present && regime_present)
(filtered_probabilities_present && regimes_present) || || (filtered_probabilities_present && regimes_present)
(regimes_present && regime_present)) || (regimes_present && regime_present))
{ {
cerr << "ERROR: You may only pass one of regime, regimes and " cerr << "ERROR: You may only pass one of regime, regimes and "
<< "filtered_probabilities to ms_variance_decomposition" << endl; << "filtered_probabilities to ms_variance_decomposition" << endl;
@ -2614,8 +2614,8 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(const OptionsList &options_li
if (it_num != options_list.num_options.end()) if (it_num != options_list.num_options.end())
{ {
using namespace boost; using namespace boost;
OptionsList::num_options_t::const_iterator it_num_regimes = OptionsList::num_options_t::const_iterator it_num_regimes
options_list.num_options.find("ms.number_of_regimes"); = options_list.num_options.find("ms.number_of_regimes");
assert(it_num_regimes != options_list.num_options.end()); assert(it_num_regimes != options_list.num_options.end());
int num_regimes = lexical_cast< int >(it_num_regimes->second); int num_regimes = lexical_cast< int >(it_num_regimes->second);
@ -2697,8 +2697,8 @@ MarkovSwitchingStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
if (it_num != options_list.num_options.end()) if (it_num != options_list.num_options.end())
{ {
using namespace boost; using namespace boost;
OptionsList::num_options_t::const_iterator it_num_regimes = OptionsList::num_options_t::const_iterator it_num_regimes
options_list.num_options.find("ms.number_of_regimes"); = options_list.num_options.find("ms.number_of_regimes");
assert(it_num_regimes != options_list.num_options.end()); assert(it_num_regimes != options_list.num_options.end());
int num_regimes = lexical_cast< int >(it_num_regimes->second); int num_regimes = lexical_cast< int >(it_num_regimes->second);
vector<double> col_trans_prob_sum(num_regimes, 0); vector<double> col_trans_prob_sum(num_regimes, 0);
@ -2800,8 +2800,8 @@ MarkovSwitchingStatement::writeCOutput(ostream &output, const string &basename)
{ {
output << endl; output << endl;
OptionsList::num_options_t::const_iterator it = OptionsList::num_options_t::const_iterator it
options_list.num_options.find("ms.chain"); = options_list.num_options.find("ms.chain");
assert(it != options_list.num_options.end()); assert(it != options_list.num_options.end());
output << "chain = " << it->second << ";" << endl; output << "chain = " << it->second << ";" << endl;
@ -2827,8 +2827,8 @@ MarkovSwitchingStatement::writeCOutput(ostream &output, const string &basename)
if (!itvs->empty()) if (!itvs->empty())
output << "duration.push_back(" << *itvs << ");" << endl; output << "duration.push_back(" << *itvs << ");" << endl;
OptionsList::symbol_list_options_t::const_iterator itsl = OptionsList::symbol_list_options_t::const_iterator itsl
options_list.symbol_list_options.find("ms.parameters"); = options_list.symbol_list_options.find("ms.parameters");
assert(itsl != options_list.symbol_list_options.end()); assert(itsl != options_list.symbol_list_options.end());
vector<string> parameters = itsl->second.get_symbols(); vector<string> parameters = itsl->second.get_symbols();
output << "parameters.clear();" << endl; output << "parameters.clear();" << endl;
@ -2887,11 +2887,11 @@ SvarStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation
it2 = options_list.string_options.find("ms.constants"); it2 = options_list.string_options.find("ms.constants");
assert((it0 != options_list.string_options.end() assert((it0 != options_list.string_options.end()
&& it1 == options_list.string_options.end() && it1 == options_list.string_options.end()
&& it2 == options_list.string_options.end()) || && it2 == options_list.string_options.end())
(it0 == options_list.string_options.end() || (it0 == options_list.string_options.end()
&& it1 != options_list.string_options.end() && it1 != options_list.string_options.end()
&& it2 == options_list.string_options.end()) || && it2 == options_list.string_options.end())
(it0 == options_list.string_options.end() || (it0 == options_list.string_options.end()
&& it1 == options_list.string_options.end() && it1 == options_list.string_options.end()
&& it2 != options_list.string_options.end())); && it2 != options_list.string_options.end()));
} }
@ -3006,15 +3006,15 @@ EstimationDataStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if ((options_list.string_options.find("file") == options_list.string_options.end()) && if ((options_list.string_options.find("file") == options_list.string_options.end())
(options_list.string_options.find("series") == options_list.string_options.end())) && (options_list.string_options.find("series") == options_list.string_options.end()))
{ {
cerr << "ERROR: The file or series option must be passed to the data statement." << endl; cerr << "ERROR: The file or series option must be passed to the data statement." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if ((options_list.string_options.find("file") != options_list.string_options.end()) && if ((options_list.string_options.find("file") != options_list.string_options.end())
(options_list.string_options.find("series") != options_list.string_options.end())) && (options_list.string_options.find("series") != options_list.string_options.end()))
{ {
cerr << "ERROR: The file and series options cannot be used simultaneously in the data statement." << endl; cerr << "ERROR: The file and series options cannot be used simultaneously in the data statement." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -3235,8 +3235,8 @@ JointPriorStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (options_list.num_options.find("mean") == options_list.num_options.end() && if (options_list.num_options.find("mean") == options_list.num_options.end()
options_list.num_options.find("mode") == options_list.num_options.end()) && options_list.num_options.find("mode") == options_list.num_options.end())
{ {
cerr << "ERROR: You must pass at least one of mean and mode to the prior statement." << endl; cerr << "ERROR: You must pass at least one of mean and mode to the prior statement." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -3396,16 +3396,16 @@ BasicPriorStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (options_list.num_options.find("mean") == options_list.num_options.end() && if (options_list.num_options.find("mean") == options_list.num_options.end()
options_list.num_options.find("mode") == options_list.num_options.end()) && options_list.num_options.find("mode") == options_list.num_options.end())
{ {
cerr << "ERROR: You must pass at least one of mean and mode to the prior statement." << endl; cerr << "ERROR: You must pass at least one of mean and mode to the prior statement." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
OptionsList::num_options_t::const_iterator it_stdev = options_list.num_options.find("stdev"); OptionsList::num_options_t::const_iterator it_stdev = options_list.num_options.find("stdev");
if ((it_stdev == options_list.num_options.end() && variance == NULL) || if ((it_stdev == options_list.num_options.end() && variance == NULL)
(it_stdev != options_list.num_options.end() && variance != NULL)) || (it_stdev != options_list.num_options.end() && variance != NULL))
{ {
cerr << "ERROR: You must pass exactly one of stdev and variance to the prior statement." << endl; cerr << "ERROR: You must pass exactly one of stdev and variance to the prior statement." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -3824,8 +3824,8 @@ PriorEqualStatement::PriorEqualStatement(const string &to_declaration_type_arg,
void void
PriorEqualStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) PriorEqualStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
{ {
if ((to_declaration_type != "par" && to_declaration_type != "std" && to_declaration_type != "corr") || if ((to_declaration_type != "par" && to_declaration_type != "std" && to_declaration_type != "corr")
(from_declaration_type != "par" && from_declaration_type != "std" && from_declaration_type != "corr")) || (from_declaration_type != "par" && from_declaration_type != "std" && from_declaration_type != "corr"))
{ {
cerr << "Internal Dynare Error" << endl; cerr << "Internal Dynare Error" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -3856,7 +3856,6 @@ PriorEqualStatement::writeOutput(ostream &output, const string &basename, bool m
else else
get_base_name(symbol_table.getType(from_name1), rhs_field); get_base_name(symbol_table.getType(from_name1), rhs_field);
if (to_declaration_type == "corr") if (to_declaration_type == "corr")
lhs_field += "_corr"; lhs_field += "_corr";
@ -4189,8 +4188,8 @@ OptionsEqualStatement::OptionsEqualStatement(const string &to_declaration_type_a
void void
OptionsEqualStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) OptionsEqualStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
{ {
if ((to_declaration_type != "par" && to_declaration_type != "std" && to_declaration_type != "corr") || if ((to_declaration_type != "par" && to_declaration_type != "std" && to_declaration_type != "corr")
(from_declaration_type != "par" && from_declaration_type != "std" && from_declaration_type != "corr")) || (from_declaration_type != "par" && from_declaration_type != "std" && from_declaration_type != "corr"))
{ {
cerr << "Internal Dynare Error" << endl; cerr << "Internal Dynare Error" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -4236,7 +4235,6 @@ OptionsEqualStatement::writeOutput(ostream &output, const string &basename, bool
else else
get_base_name(symbol_table.getType(from_name1), rhs_field); get_base_name(symbol_table.getType(from_name1), rhs_field);
if (to_declaration_type == "corr") if (to_declaration_type == "corr")
lhs_field += "_corr"; lhs_field += "_corr";

View File

@ -146,7 +146,8 @@ public:
class RamseyConstraintsStatement : public Statement class RamseyConstraintsStatement : public Statement
{ {
public: public:
struct Constraint { struct Constraint
{
int endo; int endo;
BinaryOpcode code; BinaryOpcode code;
expr_t expression; expr_t expression;
@ -455,7 +456,8 @@ public:
/*! \param model_tree_arg the model tree used to store the objective function. /*! \param model_tree_arg the model tree used to store the objective function.
It is owned by the PlannerObjectiveStatement, and will be deleted by its destructor */ It is owned by the PlannerObjectiveStatement, and will be deleted by its destructor */
PlannerObjectiveStatement(StaticModel *model_tree_arg); PlannerObjectiveStatement(StaticModel *model_tree_arg);
virtual ~PlannerObjectiveStatement(); virtual
~PlannerObjectiveStatement();
/*! \todo check there are only endogenous variables at the current period in the objective /*! \todo check there are only endogenous variables at the current period in the objective
(no exogenous, no lead/lag) */ (no exogenous, no lead/lag) */
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings); virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
@ -819,11 +821,11 @@ public:
virtual void writeJsonOutput(ostream &output) const; virtual void writeJsonOutput(ostream &output) const;
}; };
class BasicPriorStatement : public Statement class BasicPriorStatement : public Statement
{ {
public: public:
virtual ~BasicPriorStatement(); virtual
~BasicPriorStatement();
protected: protected:
const string name; const string name;
const string subsample_name; const string subsample_name;
@ -932,7 +934,8 @@ public:
class BasicOptionsStatement : public Statement class BasicOptionsStatement : public Statement
{ {
public: public:
virtual ~BasicOptionsStatement(); virtual
~BasicOptionsStatement();
protected: protected:
const string name; const string name;
const string subsample_name; const string subsample_name;

View File

@ -158,7 +158,6 @@ ConfigFile::getConfigFileInfo(const string &config_file)
} }
} }
string name, computerName, port, userName, password, remoteDrive, string name, computerName, port, userName, password, remoteDrive,
remoteDirectory, dynarePath, matlabOctavePath, operatingSystem, remoteDirectory, dynarePath, matlabOctavePath, operatingSystem,
global_init_file; global_init_file;

View File

@ -37,7 +37,11 @@ public:
private: private:
map<string, string> hooks; map<string, string> hooks;
public: public:
inline map<string, string>get_hooks() { return hooks; }; inline map<string, string>
get_hooks()
{
return hooks;
};
}; };
class Path class Path
@ -48,7 +52,11 @@ public:
private: private:
map<string, vector<string> > paths; map<string, vector<string> > paths;
public: public:
inline map<string, vector<string> >get_paths() { return paths; }; inline map<string, vector<string> >
get_paths()
{
return paths;
};
}; };
class SlaveNode class SlaveNode

View File

@ -104,7 +104,8 @@ private:
public: public:
DataTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_arg); DataTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_arg);
virtual ~DataTree(); virtual
~DataTree();
//! Some predefined constants //! Some predefined constants
expr_t Zero, One, Two, MinusOne, NaN, Infinity, MinusInfinity, Pi; expr_t Zero, One, Two, MinusOne, NaN, Infinity, MinusInfinity, Pi;

View File

@ -2982,7 +2982,6 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
row_state_var_incidence.insert(make_pair(it_state_equ - state_equ.begin(), it_state_var - state_var.begin())); row_state_var_incidence.insert(make_pair(it_state_equ - state_equ.begin(), it_state_var - state_var.begin()));
} }
} }
/*tmp_block_endo_derivative[make_pair(it->second.first, make_pair(it->first.second, it->first.first))] = it->second.second; /*tmp_block_endo_derivative[make_pair(it->second.first, make_pair(it->first.second, it->first.first))] = it->second.second;
if (block == 0) if (block == 0)
@ -3042,7 +3041,6 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
output << modstruct << "n_diag = " << nb_diag << ";" << endl; output << modstruct << "n_diag = " << nb_diag << ";" << endl;
KF_index_file.write(reinterpret_cast<char *>(&nb_diag), sizeof(nb_diag)); KF_index_file.write(reinterpret_cast<char *>(&nb_diag), sizeof(nb_diag));
typedef pair<int, pair<int, int > > index_KF; typedef pair<int, pair<int, int > > index_KF;
vector<index_KF> v_index_KF; vector<index_KF> v_index_KF;
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
@ -4478,7 +4476,6 @@ DynamicModel::substituteLeadLagInternal(aux_var_t type, bool deterministic_model
equations[i] = substeq; equations[i] = substeq;
} }
// Substitute in aux_equations // Substitute in aux_equations
// Without this loop, the auxiliary equations in equations // Without this loop, the auxiliary equations in equations
// will diverge from those in aux_equations // will diverge from those in aux_equations
@ -5090,7 +5087,6 @@ DynamicModel::writeFirstDerivativesC_csr(const string &basename, bool cuda) cons
// this is always empty here, but needed by d1->writeOutput // this is always empty here, but needed by d1->writeOutput
deriv_node_temp_terms_t tef_terms; deriv_node_temp_terms_t tef_terms;
// Indexing derivatives in column order // Indexing derivatives in column order
vector<derivative> D; vector<derivative> D;
for (first_derivatives_t::const_iterator it = first_derivatives.begin(); for (first_derivatives_t::const_iterator it = first_derivatives.begin();
@ -5441,7 +5437,6 @@ DynamicModel::writeCCOutput(ostream &output, const string &basename, bool block_
<< "NNZDerivatives.push_back(-1);" << endl; << "NNZDerivatives.push_back(-1);" << endl;
} }
void void
DynamicModel::writeJsonOutput(ostream &output) const DynamicModel::writeJsonOutput(ostream &output) const
{ {

View File

@ -544,13 +544,16 @@ public:
unsigned int row_nbr; unsigned int row_nbr;
expr_t value; expr_t value;
derivative(long unsigned int arg1, long unsigned int arg2, int arg3, expr_t arg4) : derivative(long unsigned int arg1, long unsigned int arg2, int arg3, expr_t arg4) :
linear_address(arg1), col_nbr(arg2), row_nbr(arg3), value(arg4) {}; linear_address(arg1), col_nbr(arg2), row_nbr(arg3), value(arg4)
{
};
}; };
class derivative_less_than class derivative_less_than
{ {
public: public:
bool operator()(const derivative & d1, const derivative & d2) const bool
operator()(const derivative &d1, const derivative &d2) const
{ {
return d1.linear_address < d2.linear_address; return d1.linear_address < d2.linear_address;
} }

View File

@ -130,8 +130,8 @@ main(int argc, char **argv)
clear_all = false; clear_all = false;
else if (strlen(argv[arg]) >= 19 && !strncmp(argv[arg], "params_derivs_order", 19)) else if (strlen(argv[arg]) >= 19 && !strncmp(argv[arg], "params_derivs_order", 19))
{ {
if (strlen(argv[arg]) >= 22 || argv[arg][19] != '=' || if (strlen(argv[arg]) >= 22 || argv[arg][19] != '='
!(argv[arg][20] == '0' || argv[arg][20] == '1' || argv[arg][20] == '2')) || !(argv[arg][20] == '0' || argv[arg][20] == '1' || argv[arg][20] == '2'))
{ {
cerr << "Incorrect syntax for params_derivs_order option" << endl; cerr << "Incorrect syntax for params_derivs_order option" << endl;
usage(); usage();

View File

@ -537,7 +537,6 @@ NumConstNode::substituteStaticAuxiliaryVariable() const
return const_cast<NumConstNode *>(this); return const_cast<NumConstNode *>(this);
} }
VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, int lag_arg) : VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, int lag_arg) :
ExprNode(datatree_arg), ExprNode(datatree_arg),
symb_id(symb_id_arg), symb_id(symb_id_arg),
@ -4160,7 +4159,6 @@ BinaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpN
return buildSimilarBinaryOpNode(arg1subst, arg2subst, datatree); return buildSimilarBinaryOpNode(arg1subst, arg2subst, datatree);
} }
expr_t expr_t
BinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const BinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const
{ {
@ -4877,7 +4875,6 @@ TrinaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOp
return buildSimilarTrinaryOpNode(arg1subst, arg2subst, arg3subst, datatree); return buildSimilarTrinaryOpNode(arg1subst, arg2subst, arg3subst, datatree);
} }
expr_t expr_t
TrinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const TrinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const
{ {

View File

@ -173,7 +173,8 @@ protected:
public: public:
ExprNode(DataTree &datatree_arg); ExprNode(DataTree &datatree_arg);
virtual ~ExprNode(); virtual
~ExprNode();
//! Initializes data member non_null_derivatives //! Initializes data member non_null_derivatives
virtual void prepareForDerivation() = 0; virtual void prepareForDerivation() = 0;
@ -563,7 +564,11 @@ public:
{ {
return symb_id; return symb_id;
}; };
int get_lag() const { return lag; }; int
get_lag() const
{
return lag;
};
virtual pair<int, expr_t> normalizeEquation(int symb_id_endo, vector<pair<int, pair<expr_t, expr_t> > > &List_of_Op_RHS) const; virtual pair<int, expr_t> normalizeEquation(int symb_id_endo, vector<pair<int, pair<expr_t, expr_t> > > &List_of_Op_RHS) const;
virtual expr_t getChainRuleDerivative(int deriv_id, const map<int, expr_t> &recursive_variables); virtual expr_t getChainRuleDerivative(int deriv_id, const map<int, expr_t> &recursive_variables);
virtual int maxEndoLead() const; virtual int maxEndoLead() const;

View File

@ -257,15 +257,15 @@ ModFile::checkPass(bool nostrict)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (dynamic_model.staticOnlyEquationsNbr() > 0 && if (dynamic_model.staticOnlyEquationsNbr() > 0
(mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present)) && (mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present))
{ {
cerr << "ERROR: marking equations as [static] or [dynamic] is not possible with ramsey_model, ramsey_policy or discretionary_policy" << endl; cerr << "ERROR: marking equations as [static] or [dynamic] is not possible with ramsey_model, ramsey_policy or discretionary_policy" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (stochastic_statement_present && if (stochastic_statement_present
(dynamic_model.isUnaryOpUsed(oSign) && (dynamic_model.isUnaryOpUsed(oSign)
|| dynamic_model.isUnaryOpUsed(oAbs) || dynamic_model.isUnaryOpUsed(oAbs)
|| dynamic_model.isBinaryOpUsed(oMax) || dynamic_model.isBinaryOpUsed(oMax)
|| dynamic_model.isBinaryOpUsed(oMin) || dynamic_model.isBinaryOpUsed(oMin)
@ -553,8 +553,8 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri
else // No computing task requested, compute derivatives up to 2nd order by default else // No computing task requested, compute derivatives up to 2nd order by default
dynamic_model.computingPass(true, true, false, none, global_eval_context, no_tmp_terms, block, use_dll, byte_code); dynamic_model.computingPass(true, true, false, none, global_eval_context, no_tmp_terms, block, use_dll, byte_code);
if ((linear && !mod_file_struct.ramsey_model_present && !dynamic_model.checkHessianZero()) || if ((linear && !mod_file_struct.ramsey_model_present && !dynamic_model.checkHessianZero())
(linear && mod_file_struct.ramsey_model_present && !orig_ramsey_dynamic_model.checkHessianZero())) || (linear && mod_file_struct.ramsey_model_present && !orig_ramsey_dynamic_model.checkHessianZero()))
{ {
map<int, string> eqs; map<int, string> eqs;
if (mod_file_struct.ramsey_model_present) if (mod_file_struct.ramsey_model_present)
@ -867,7 +867,6 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
<< "end" << endl; << "end" << endl;
} }
if (!no_log) if (!no_log)
mOutputFile << "diary off" << endl; mOutputFile << "diary off" << endl;
@ -926,7 +925,6 @@ ModFile::writeExternalFilesC(const string &basename, FileOutputType output) cons
if (!no_static) if (!no_static)
static_model.writeStaticFile(basename, false, false, true, false); static_model.writeStaticFile(basename, false, false, true, false);
// static_model.writeStaticCFile(basename, block, byte_code, use_dll); // static_model.writeStaticCFile(basename, block, byte_code, use_dll);
// static_model.writeParamsDerivativesFileC(basename, cuda); // static_model.writeParamsDerivativesFileC(basename, cuda);
// static_model.writeAuxVarInitvalC(mOutputFile, oMatlabOutsideModel, cuda); // static_model.writeAuxVarInitvalC(mOutputFile, oMatlabOutsideModel, cuda);

View File

@ -1918,7 +1918,8 @@ ModelTree::computeParamsDerivativesTemporaryTerms()
params_derivs_temporary_terms_g2 = temp_terms_map[eHessianParamsDeriv]; params_derivs_temporary_terms_g2 = temp_terms_map[eHessianParamsDeriv];
} }
bool ModelTree::isNonstationary(int symb_id) const bool
ModelTree::isNonstationary(int symb_id) const
{ {
return (nonstationary_symbols_map.find(symb_id) return (nonstationary_symbols_map.find(symb_id)
!= nonstationary_symbols_map.end()); != nonstationary_symbols_map.end());

View File

@ -128,7 +128,6 @@ protected:
*/ */
third_derivatives_t hessian_params_derivatives; third_derivatives_t hessian_params_derivatives;
//! Temporary terms for the static/dynamic file (those which will be noted Txxxx) //! Temporary terms for the static/dynamic file (those which will be noted Txxxx)
temporary_terms_t temporary_terms; temporary_terms_t temporary_terms;
temporary_terms_t temporary_terms_res; temporary_terms_t temporary_terms_res;
@ -144,7 +143,6 @@ protected:
temporary_terms_t params_derivs_temporary_terms_g12; temporary_terms_t params_derivs_temporary_terms_g12;
temporary_terms_t params_derivs_temporary_terms_g2; temporary_terms_t params_derivs_temporary_terms_g2;
//! Trend variables and their growth factors //! Trend variables and their growth factors
map<int, expr_t> trend_symbols_map; map<int, expr_t> trend_symbols_map;
@ -274,7 +272,8 @@ protected:
virtual unsigned int getBlockMaxLag(int block_number) const = 0; virtual unsigned int getBlockMaxLag(int block_number) const = 0;
//! Return the maximum lead in a block //! Return the maximum lead in a block
virtual unsigned int getBlockMaxLead(int block_number) const = 0; virtual unsigned int getBlockMaxLead(int block_number) const = 0;
inline void setBlockLeadLag(int block, int max_lag, int max_lead) inline void
setBlockLeadLag(int block, int max_lag, int max_lead)
{ {
block_lag_lead[block] = make_pair(max_lag, max_lead); block_lag_lead[block] = make_pair(max_lag, max_lead);
}; };

View File

@ -259,8 +259,8 @@ void
ParsingDriver::declare_statement_local_variable(string *name) ParsingDriver::declare_statement_local_variable(string *name)
{ {
if (mod_file->symbol_table.exists(*name)) if (mod_file->symbol_table.exists(*name))
error("Symbol " + *name + " cannot be assigned within a statement " + error("Symbol " + *name + " cannot be assigned within a statement "
"while being assigned elsewhere in the modfile"); +"while being assigned elsewhere in the modfile");
declare_symbol(name, eStatementDeclaredVariable, NULL, NULL); declare_symbol(name, eStatementDeclaredVariable, NULL, NULL);
delete name; delete name;
} }
@ -1426,8 +1426,8 @@ ParsingDriver::copy_subsamples(string *to_name1, string *to_name2, string *from_
mod_file->addStatement(new SubsamplesEqualStatement(*to_name1, *to_name2, *from_name1, *from_name2, mod_file->addStatement(new SubsamplesEqualStatement(*to_name1, *to_name2, *from_name1, *from_name2,
mod_file->symbol_table)); mod_file->symbol_table));
subsample_declarations[make_pair(*to_name1, *to_name2)] = subsample_declarations[make_pair(*to_name1, *to_name2)]
subsample_declarations[make_pair(*from_name1, *from_name2)]; = subsample_declarations[make_pair(*from_name1, *from_name2)];
delete to_name1; delete to_name1;
delete to_name2; delete to_name2;
@ -1494,7 +1494,6 @@ ParsingDriver::check_subsample_declaration_exists(string *name1, string *name2,
error("The subsample name " + *subsample_name + " was not previously declared in a subsample statement."); error("The subsample name " + *subsample_name + " was not previously declared in a subsample statement.");
} }
void void
ParsingDriver::set_prior(string *name, string *subsample_name) ParsingDriver::set_prior(string *name, string *subsample_name)
{ {
@ -2850,7 +2849,8 @@ ParsingDriver::add_moment_calibration_item(string *endo1, string *endo2, string
moment_calibration_constraints.push_back(c); moment_calibration_constraints.push_back(c);
} }
void ParsingDriver::end_moment_calibration() void
ParsingDriver::end_moment_calibration()
{ {
mod_file->addStatement(new MomentCalibration(moment_calibration_constraints, mod_file->addStatement(new MomentCalibration(moment_calibration_constraints,
mod_file->symbol_table)); mod_file->symbol_table));
@ -2887,7 +2887,8 @@ ParsingDriver::add_irf_calibration_item(string *endo, string *periods, string *e
irf_calibration_constraints.push_back(c); irf_calibration_constraints.push_back(c);
} }
void ParsingDriver::end_irf_calibration() void
ParsingDriver::end_irf_calibration()
{ {
mod_file->addStatement(new IrfCalibration(irf_calibration_constraints, mod_file->addStatement(new IrfCalibration(irf_calibration_constraints,
mod_file->symbol_table, mod_file->symbol_table,
@ -2909,7 +2910,6 @@ ParsingDriver::histval_file(string *filename)
delete filename; delete filename;
} }
void void
ParsingDriver::perfect_foresight_setup() ParsingDriver::perfect_foresight_setup()
{ {
@ -2996,7 +2996,6 @@ ParsingDriver::add_shock_group_element(string *name)
delete name; delete name;
} }
void void
ParsingDriver::add_shock_group(string *name) ParsingDriver::add_shock_group(string *name)
{ {

View File

@ -239,7 +239,9 @@ private:
ostringstream model_errors; ostringstream model_errors;
public: public:
ParsingDriver(WarningConsolidation &warnings_arg, bool nostrict_arg) : warnings(warnings_arg), nostrict(nostrict_arg), model_error_encountered(false) { }; ParsingDriver(WarningConsolidation &warnings_arg, bool nostrict_arg) : warnings(warnings_arg), nostrict(nostrict_arg), model_error_encountered(false)
{
};
//! Starts parsing, and constructs the MOD file representation //! Starts parsing, and constructs the MOD file representation
/*! The returned pointer should be deleted after use */ /*! The returned pointer should be deleted after use */

View File

@ -151,7 +151,6 @@ ShocksStatement::writeOutput(ostream &output, const string &basename, bool minim
output << "M_.sigma_e_is_diagonal = 1;" << endl; output << "M_.sigma_e_is_diagonal = 1;" << endl;
} }
void void
ShocksStatement::writeJsonOutput(ostream &output) const ShocksStatement::writeJsonOutput(ostream &output) const
{ {

View File

@ -78,11 +78,13 @@ Statement::writeCOutput(ostream &output, const string &basename)
{ {
} }
void Statement::writeJuliaOutput(ostream &output, const string &basename) void
Statement::writeJuliaOutput(ostream &output, const string &basename)
{ {
} }
void Statement::writeJsonOutput(ostream &output) const void
Statement::writeJsonOutput(ostream &output) const
{ {
} }
@ -241,12 +243,12 @@ OptionsList::writeJsonOutput(ostream &output) const
{ {
output << "\""<< it->first << "\": " << it->second; output << "\""<< it->first << "\": " << it->second;
it++; it++;
if (it != num_options.end() || if (it != num_options.end()
!(paired_num_options.empty() && || !(paired_num_options.empty()
string_options.empty() && && string_options.empty()
date_options.empty() && && date_options.empty()
symbol_list_options.empty() && && symbol_list_options.empty()
vector_int_options.empty())) && vector_int_options.empty()))
output << ", "; output << ", ";
} }
@ -255,11 +257,11 @@ OptionsList::writeJsonOutput(ostream &output) const
{ {
output << "\""<< it->first << "\": [" << it->second.first << " " << it->second.second << "]"; output << "\""<< it->first << "\": [" << it->second.first << " " << it->second.second << "]";
it++; it++;
if (it != paired_num_options.end() || if (it != paired_num_options.end()
!(string_options.empty() && || !(string_options.empty()
date_options.empty() && && date_options.empty()
symbol_list_options.empty() && && symbol_list_options.empty()
vector_int_options.empty())) && vector_int_options.empty()))
output << ", "; output << ", ";
} }
@ -268,10 +270,10 @@ OptionsList::writeJsonOutput(ostream &output) const
{ {
output << "\""<< it->first << "\": \"" << it->second << "\""; output << "\""<< it->first << "\": \"" << it->second << "\"";
it++; it++;
if (it != string_options.end() || if (it != string_options.end()
!(date_options.empty() && || !(date_options.empty()
symbol_list_options.empty() && && symbol_list_options.empty()
vector_int_options.empty())) && vector_int_options.empty()))
output << ", "; output << ", ";
} }
@ -280,9 +282,9 @@ OptionsList::writeJsonOutput(ostream &output) const
{ {
output << "\""<< it->first << "\": \"" << it->second << "\""; output << "\""<< it->first << "\": \"" << it->second << "\"";
it++; it++;
if (it != date_options.end() || if (it != date_options.end()
!(symbol_list_options.empty() && || !(symbol_list_options.empty()
vector_int_options.empty())) && vector_int_options.empty()))
output << ", "; output << ", ";
} }
@ -292,8 +294,8 @@ OptionsList::writeJsonOutput(ostream &output) const
output << "\""<< it->first << "\":"; output << "\""<< it->first << "\":";
it->second.writeJsonOutput(output); it->second.writeJsonOutput(output);
it++; it++;
if (it != symbol_list_options.end() || if (it != symbol_list_options.end()
!vector_int_options.empty()) || !vector_int_options.empty())
output << ", "; output << ", ";
} }

View File

@ -128,7 +128,8 @@ public:
class Statement class Statement
{ {
public: public:
virtual ~Statement(); virtual
~Statement();
//! Do some internal check, and fill the ModFileStructure class //! Do some internal check, and fill the ModFileStructure class
/*! Don't forget to update ComputingTasks.hh, Shocks.hh and /*! Don't forget to update ComputingTasks.hh, Shocks.hh and
NumericalInitialization.hh if you modify the signature of this NumericalInitialization.hh if you modify the signature of this

View File

@ -1338,7 +1338,6 @@ StaticModel::writeStaticModel(ostream &StaticOutput, bool use_dll, bool julia) c
int id2 = getSymbIDByDerivID(var2); int id2 = getSymbIDByDerivID(var2);
int id3 = getSymbIDByDerivID(var3); int id3 = getSymbIDByDerivID(var3);
// Reference column number for the g3 matrix // Reference column number for the g3 matrix
int ref_col = id1 * hessianColsNbr + id2 * JacobianColsNbr + id3; int ref_col = id1 * hessianColsNbr + id2 * JacobianColsNbr + id3;
@ -1622,7 +1621,6 @@ StaticModel::writeStaticCFile(const string &func_name) const
output << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl output << "#define max(a, b) (((a) > (b)) ? (a) : (b))" << endl
<< "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl; << "#define min(a, b) (((a) > (b)) ? (b) : (a))" << endl;
// Write function definition if oPowerDeriv is used // Write function definition if oPowerDeriv is used
writePowerDerivCHeader(output); writePowerDerivCHeader(output);
writeNormcdfCHeader(output); writeNormcdfCHeader(output);
@ -2129,7 +2127,8 @@ StaticModel::writeAuxVarInitval(ostream &output, ExprNodeOutputType output_type)
} }
} }
void StaticModel::writeSetAuxiliaryVariables(const string &basename, const bool julia) const void
StaticModel::writeSetAuxiliaryVariables(const string &basename, const bool julia) const
{ {
string func_name = basename + "_set_auxiliary_variables"; string func_name = basename + "_set_auxiliary_variables";
@ -2311,7 +2310,6 @@ StaticModel::writeParamsDerivativesFile(const string &basename, bool julia) cons
third_derivs1_output << ";" << endl; third_derivs1_output << ";" << endl;
} }
ofstream paramsDerivsFile; ofstream paramsDerivsFile;
string filename = julia ? basename + "StaticParamsDerivs.jl" : basename + "_static_params_derivs.m"; string filename = julia ? basename + "StaticParamsDerivs.jl" : basename + "_static_params_derivs.m";
paramsDerivsFile.open(filename.c_str(), ios::out | ios::binary); paramsDerivsFile.open(filename.c_str(), ios::out | ios::binary);

View File

@ -224,12 +224,14 @@ public:
return (block_type_firstequation_size_mfs[block_number].second.first); return (block_type_firstequation_size_mfs[block_number].second.first);
}; };
//! Return the number of exogenous variable in the block block_number //! Return the number of exogenous variable in the block block_number
virtual unsigned int getBlockExoSize(int block_number) const virtual unsigned int
getBlockExoSize(int block_number) const
{ {
return 0; return 0;
}; };
//! Return the number of colums in the jacobian matrix for exogenous variable in the block block_number //! Return the number of colums in the jacobian matrix for exogenous variable in the block block_number
virtual unsigned int getBlockExoColSize(int block_number) const virtual unsigned int
getBlockExoColSize(int block_number) const
{ {
return 0; return 0;
} }

View File

@ -44,9 +44,17 @@ public:
//! Clears all content //! Clears all content
void clear(); void clear();
//! Get a copy of the string vector //! Get a copy of the string vector
vector<string> get_symbols() const { return symbols; }; vector<string>
get_symbols() const
{
return symbols;
};
//! Is Empty //! Is Empty
int empty() const { return symbols.empty(); }; int
empty() const
{
return symbols.empty();
};
}; };
#endif #endif

View File

@ -228,7 +228,6 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
<< "M_.exo_names_tex = char(M_.exo_names_tex, '" << getTeXName(exo_ids[id]) << "');" << endl << "M_.exo_names_tex = char(M_.exo_names_tex, '" << getTeXName(exo_ids[id]) << "');" << endl
<< "M_.exo_names_long = char(M_.exo_names_long, '" << getLongName(exo_ids[id]) << "');" << endl; << "M_.exo_names_long = char(M_.exo_names_long, '" << getLongName(exo_ids[id]) << "');" << endl;
map<string, map<int, string> > partitions = getPartitionsForType(eExogenous); map<string, map<int, string> > partitions = getPartitionsForType(eExogenous);
for (map<string, map<int, string> >::const_iterator it = partitions.begin(); for (map<string, map<int, string> >::const_iterator it = partitions.begin();
it != partitions.end(); it++) it != partitions.end(); it++)

View File

@ -58,13 +58,41 @@ private:
expr_t expr_node; //! Auxiliary variable definition expr_t expr_node; //! Auxiliary variable definition
public: public:
AuxVarInfo(int symb_id_arg, aux_var_t type_arg, int orig_symb_id, int orig_lead_lag, int equation_number_for_multiplier_arg, int information_set_arg, expr_t expr_node_arg); AuxVarInfo(int symb_id_arg, aux_var_t type_arg, int orig_symb_id, int orig_lead_lag, int equation_number_for_multiplier_arg, int information_set_arg, expr_t expr_node_arg);
int get_symb_id() const { return symb_id; }; int
aux_var_t get_type() const { return type; }; get_symb_id() const
int get_orig_symb_id() const { return orig_symb_id; }; {
int get_orig_lead_lag() const { return orig_lead_lag; }; return symb_id;
int get_equation_number_for_multiplier() const { return equation_number_for_multiplier; }; };
int get_information_set() const { return information_set; }; aux_var_t
expr_t get_expr_node() const { return expr_node; } ; get_type() const
{
return type;
};
int
get_orig_symb_id() const
{
return orig_symb_id;
};
int
get_orig_lead_lag() const
{
return orig_lead_lag;
};
int
get_equation_number_for_multiplier() const
{
return equation_number_for_multiplier;
};
int
get_information_set() const
{
return information_set;
};
expr_t
get_expr_node() const
{
return expr_node;
};
}; };
//! Stores the symbol table //! Stores the symbol table
@ -250,7 +278,11 @@ public:
*/ */
int searchAuxiliaryVars(int orig_symb_id, int orig_lead_lag) const throw (SearchFailedException); int searchAuxiliaryVars(int orig_symb_id, int orig_lead_lag) const throw (SearchFailedException);
//! Returns the number of auxiliary variables //! Returns the number of auxiliary variables
int AuxVarsSize() const { return aux_vars.size(); }; int
AuxVarsSize() const
{
return aux_vars.size();
};
//! Retruns expr_node for an auxiliary variable //! Retruns expr_node for an auxiliary variable
expr_t getAuxiliaryVarsExprNode(int symb_id) const throw (SearchFailedException); expr_t getAuxiliaryVarsExprNode(int symb_id) const throw (SearchFailedException);
//! Tests if symbol already exists //! Tests if symbol already exists

View File

@ -20,7 +20,8 @@
#include "WarningConsolidation.hh" #include "WarningConsolidation.hh"
#include <ostream> #include <ostream>
WarningConsolidation& WarningConsolidation
&
operator<<(WarningConsolidation &wcc, const string &warning) operator<<(WarningConsolidation &wcc, const string &warning)
{ {
if (wcc.no_warn) if (wcc.no_warn)

View File

@ -34,16 +34,28 @@ private:
bool no_warn; bool no_warn;
public: public:
WarningConsolidation(bool no_warn_arg) : no_warn(no_warn_arg) { }; WarningConsolidation(bool no_warn_arg) : no_warn(no_warn_arg)
~WarningConsolidation() { }; {
};
~WarningConsolidation()
{
};
//! Add A Warning to the StringStream //! Add A Warning to the StringStream
friend WarningConsolidation &operator<<(WarningConsolidation &wcc, const string &warning); friend WarningConsolidation &operator<<(WarningConsolidation &wcc, const string &warning);
friend WarningConsolidation &operator<<(WarningConsolidation &wcc, const Dynare::location &loc); friend WarningConsolidation &operator<<(WarningConsolidation &wcc, const Dynare::location &loc);
friend WarningConsolidation &operator<<(WarningConsolidation &wcc, ostream & (*pf)(ostream &)); friend WarningConsolidation &operator<<(WarningConsolidation &wcc, ostream & (*pf)(ostream &));
inline void addWarning(const string &w) { warnings << w; }; inline void
inline void addWarning(ostream& (*pf) (ostream&)) { warnings << pf; }; addWarning(const string &w)
{
warnings << w;
};
inline void
addWarning(ostream & (*pf)(ostream &))
{
warnings << pf;
};
//! Write Warnings to m file //! Write Warnings to m file
void writeOutput(ostream &output) const; void writeOutput(ostream &output) const;

View File

@ -177,7 +177,8 @@ public:
//! Constructor //! Constructor
MacroDriver(); MacroDriver();
//! Destructor //! Destructor
virtual ~MacroDriver(); virtual
~MacroDriver();
//! Starts parsing a file, returns output in out //! Starts parsing a file, returns output in out
/*! \param no_line_macro should we omit the @#line statements ? */ /*! \param no_line_macro should we omit the @#line statements ? */

View File

@ -49,7 +49,8 @@ public:
{ {
}; };
MacroValue(MacroDriver &driver_arg); MacroValue(MacroDriver &driver_arg);
virtual ~MacroValue(); virtual
~MacroValue();
//! Applies + operator //! Applies + operator
virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError) = 0; virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError) = 0;
//! Applies unary + operator //! Applies unary + operator
@ -118,7 +119,8 @@ private:
const int value; const int value;
public: public:
IntMV(MacroDriver &driver, int value_arg); IntMV(MacroDriver &driver, int value_arg);
virtual ~IntMV(); virtual
~IntMV();
//! Computes arithmetic addition //! Computes arithmetic addition
virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError); virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError);
//! Unary plus //! Unary plus
@ -158,7 +160,11 @@ public:
If mv2 < mv1, returns an empty range (for consistency with MATLAB). If mv2 < mv1, returns an empty range (for consistency with MATLAB).
*/ */
static const MacroValue *new_range(MacroDriver &driver, const MacroValue *mv1, const MacroValue *mv2) throw (TypeError); static const MacroValue *new_range(MacroDriver &driver, const MacroValue *mv1, const MacroValue *mv2) throw (TypeError);
inline int get_int_value() const { return value; }; inline int
get_int_value() const
{
return value;
};
}; };
//! Represents a string value in macro language //! Represents a string value in macro language
@ -170,7 +176,8 @@ private:
const string value; const string value;
public: public:
StringMV(MacroDriver &driver, const string &value_arg); StringMV(MacroDriver &driver, const string &value_arg);
virtual ~StringMV(); virtual
~StringMV();
//! Computes string concatenation //! Computes string concatenation
virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError); virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError);
virtual const MacroValue *operator==(const MacroValue &mv) const throw (TypeError); virtual const MacroValue *operator==(const MacroValue &mv) const throw (TypeError);
@ -202,7 +209,8 @@ private:
const vector<T> values; const vector<T> values;
public: public:
ArrayMV(MacroDriver &driver, const vector<T> &values_arg); ArrayMV(MacroDriver &driver, const vector<T> &values_arg);
virtual ~ArrayMV(); virtual
~ArrayMV();
//! Computes array concatenation //! Computes array concatenation
/*! Both array must be of same type */ /*! Both array must be of same type */
virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError); virtual const MacroValue *operator+(const MacroValue &mv) const throw (TypeError);