Commit 3aa88765 authored by sebastien's avatar sebastien

Beautified preprocessor code (uncrustify + emacs + manual adjustments, in...

Beautified preprocessor code (uncrustify + emacs + manual adjustments, in particular with templates in MacroValue)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3249 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 160ec5d7
This diff is collapsed.
......@@ -67,18 +67,19 @@ ModelInfoStatement::ModelInfoStatement(const OptionsList &options_list_arg) :
{
}
void ModelInfoStatement::checkPass(ModFileStructure &mod_file_struct)
void
ModelInfoStatement::checkPass(ModFileStructure &mod_file_struct)
{
//mod_file_struct.model_info_present = true;
}
void ModelInfoStatement::writeOutput(ostream &output, const string &basename) const
void
ModelInfoStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output);
output << "model_info();\n";
}
SimulStatement::SimulStatement(const OptionsList &options_list_arg) :
options_list(options_list_arg)
{
......@@ -112,7 +113,7 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
mod_file_struct.order_option = max(mod_file_struct.order_option, atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
......@@ -211,7 +212,7 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
mod_file_struct.order_option = max(mod_file_struct.order_option, atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
......@@ -274,7 +275,7 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct)
void
DynareSensitivityStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output,"options_gsa");
options_list.writeOutput(output, "options_gsa");
output << "dynare_sensitivity(options_gsa);" << endl;
}
......@@ -362,12 +363,12 @@ EstimatedParamsStatement::writeOutput(ostream &output, const string &basename) c
vector<EstimationParams>::const_iterator it;
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
for (it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
int symb_id = symbol_table.getTypeSpecificID(it->name) + 1;
SymbolType symb_type = symbol_table.getType(it->name);
switch(it->type)
switch (it->type)
{
case 1:
if (symb_type == eExogenous)
......@@ -421,7 +422,7 @@ EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basenam
{
vector<EstimationParams>::const_iterator it;
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
for (it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
int symb_id = symbol_table.getTypeSpecificID(it->name) + 1;
SymbolType symb_type = symbol_table.getType(it->name);
......@@ -482,7 +483,7 @@ EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basen
{
vector<EstimationParams>::const_iterator it;
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
for (it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
int symb_id = symbol_table.getTypeSpecificID(it->name) + 1;
SymbolType symb_type = symbol_table.getType(it->name);
......@@ -570,7 +571,7 @@ ObservationTrendsStatement::writeOutput(ostream &output, const string &basename)
trend_elements_type::const_iterator it;
for(it = trend_elements.begin(); it != trend_elements.end(); it++)
for (it = trend_elements.begin(); it != trend_elements.end(); it++)
{
SymbolType type = symbol_table.getType(it->first);
if (type == eEndogenous)
......@@ -604,7 +605,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
<< "% CALIB_VAR" << endl
<< "%" << endl;
for(int i = 1; i < 4 ; i++)
for (int i = 1; i < 4; i++)
{
output << "calib_var_index{" << i << "} = [];\n";
output << "calib_targets{" << i << "} = [];\n";
......@@ -612,8 +613,8 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
}
// Print calibration variances
for(calib_var_type::const_iterator it = calib_var.begin();
it != calib_var.end(); it++)
for (calib_var_type::const_iterator it = calib_var.begin();
it != calib_var.end(); it++)
{
const string &name = it->first;
const string &weight = it->second.first;
......@@ -639,8 +640,8 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
}
// Print calibration covariances
for(calib_covar_type::const_iterator it = calib_covar.begin();
it != calib_covar.end(); it++)
for (calib_covar_type::const_iterator it = calib_covar.begin();
it != calib_covar.end(); it++)
{
const string &name1 = it->first.first;
const string &name2 = it->first.second;
......@@ -670,8 +671,8 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
// Print calibration autocorrelations
int max_iar = 3;
for(calib_ac_type::const_iterator it = calib_ac.begin();
it != calib_ac.end(); it++)
for (calib_ac_type::const_iterator it = calib_ac.begin();
it != calib_ac.end(); it++)
{
const string &name = it->first.first;
int iar = it->first.second + 3;
......@@ -683,7 +684,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
if (iar > max_iar)
{
// Create new variables
for(int i = max_iar + 1; i <= iar; i++)
for (int i = max_iar + 1; i <= iar; i++)
{
output << "calib_var_index{" << i << "} = [];\n";
output << "calib_targets{" << i << "} = [];\n";
......@@ -736,7 +737,7 @@ OsrStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
mod_file_struct.order_option = max(mod_file_struct.order_option, atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
......@@ -776,8 +777,8 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons
<< "optim_weights_ = sparse(M_.endo_nbr,M_.endo_nbr);" << endl
<< "obj_var_ = [];" << endl << endl;
for(var_weights_type::const_iterator it = var_weights.begin();
it != var_weights.end(); it++)
for (var_weights_type::const_iterator it = var_weights.begin();
it != var_weights.end(); it++)
{
const string &name = it->first;
const NodeID value = it->second;
......@@ -788,8 +789,8 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons
output << "obj_var_ = [obj_var_; " << id << "];\n";
}
for(covar_weights_type::const_iterator it = covar_weights.begin();
it != covar_weights.end(); it++)
for (covar_weights_type::const_iterator it = covar_weights.begin();
it != covar_weights.end(); it++)
{
const string &name1 = it->first.first;
const string &name2 = it->first.second;
......@@ -848,8 +849,8 @@ ModelComparisonStatement::writeOutput(ostream &output, const string &basename) c
output << "ModelNames_ = {};" << endl;
output << "ModelPriors_ = [];" << endl;
for(filename_list_type::const_iterator it = filename_list.begin();
it != filename_list.end(); it++)
for (filename_list_type::const_iterator it = filename_list.begin();
it != filename_list.end(); it++)
{
output << "ModelNames_ = { ModelNames_{:} '" << (*it).first << "'};" << endl;
output << "ModelPriors_ = [ ModelPriors_ ; " << (*it).second << "];" << endl;
......@@ -959,8 +960,6 @@ MS_SBVARStatement::writeOutput(ostream &output, const string &basename) const
output << "swz_sbvar(1,M_,options_);" << endl;
}
IdentificationStatement::IdentificationStatement(const OptionsList &options_list_arg) :
options_list(options_list_arg)
{
......@@ -1002,7 +1001,7 @@ WriteLatexStaticModelStatement::writeOutput(ostream &output, const string &basen
}
ShockDecompositionStatement::ShockDecompositionStatement(const SymbolList &symbol_list_arg,
const OptionsList &options_list_arg) :
const OptionsList &options_list_arg) :
symbol_list(symbol_list_arg),
options_list(options_list_arg)
{
......@@ -1104,7 +1103,7 @@ SvarIdentificationStatement::writeOutput(ostream &output, const string &basename
int r = getMaxLag();
int k = r*n+m;
if (k<1)
if (k < 1)
{
cerr << "ERROR: lag = " << r
<< ", number of endogenous variables = " << n
......@@ -1113,7 +1112,7 @@ SvarIdentificationStatement::writeOutput(ostream &output, const string &basename
<< " of the .mod file, please report it to the Dynare Team." << endl;
exit(EXIT_FAILURE);
}
if (n<1)
if (n < 1)
{
cerr << "ERROR: Number of endogenous variables = " << n << "< 1. If this is not a logical "
<< "error in the specification of the .mod file, please report it to the Dynare Team." << endl;
......@@ -1128,7 +1127,7 @@ SvarIdentificationStatement::writeOutput(ostream &output, const string &basename
{
int j = it->second.at(h) + 1;
int i = it->first.second;
if (j < 1 || j > n || (int)h+1 > n || i < 1)
if (j < 1 || j > n || (int) h+1 > n || i < 1)
{
cerr << "SvarIdentificationStatement::writeOutput() Should not arrive here (2). Please report this to the Dynare Team." << endl;
exit(EXIT_FAILURE);
......@@ -1186,12 +1185,12 @@ MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename) c
itState = options_list.num_options.find("ms.state");
itNOS = options_list.num_options.find("ms.number_of_states");
if (itState != options_list.num_options.end() &&
itNOS == options_list.num_options.end())
if (itState != options_list.num_options.end()
&& itNOS == options_list.num_options.end())
output << "options_.ms.ms_chain(" << itChain->second << ").state(" << itState->second << ").duration = " << itDuration->second << ";" << endl;
else if (itState == options_list.num_options.end() &&
itNOS != options_list.num_options.end())
for (int i=0; i<atoi(itNOS->second.c_str()); i++)
else if (itState == options_list.num_options.end()
&& itNOS != options_list.num_options.end())
for (int i = 0; i < atoi(itNOS->second.c_str()); i++)
output << "options_.ms.ms_chain(" << itChain->second << ").state(" << i+1 << ").duration = " << itDuration->second << ";" << endl;
else
{
......@@ -1200,7 +1199,6 @@ MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename) c
}
}
SvarStatement::SvarStatement(const OptionsList &options_list_arg) :
options_list(options_list_arg)
{
......@@ -1224,17 +1222,17 @@ SvarStatement::writeOutput(ostream &output, const string &basename) const
it0 = options_list.string_options.find("ms.coefficients");
it1 = options_list.string_options.find("ms.variances");
it2 = options_list.string_options.find("ms.constants");
if (it0 != options_list.string_options.end() &&
it1 == options_list.string_options.end() &&
it2 == options_list.string_options.end())
if (it0 != options_list.string_options.end()
&& it1 == options_list.string_options.end()
&& it2 == options_list.string_options.end())
output << "." << it0->second;
else if (it0 == options_list.string_options.end() &&
it1 != options_list.string_options.end() &&
it2 == options_list.string_options.end())
else if (it0 == options_list.string_options.end()
&& it1 != options_list.string_options.end()
&& it2 == options_list.string_options.end())
output << "." << it1->second;
else if (it0 == options_list.string_options.end() &&
it1 == options_list.string_options.end() &&
it2 != options_list.string_options.end())
else if (it0 == options_list.string_options.end()
&& it1 == options_list.string_options.end()
&& it2 != options_list.string_options.end())
output << "." << it2->second;
else
{
......@@ -1249,8 +1247,8 @@ SvarStatement::writeOutput(ostream &output, const string &basename) const
if (itv->second.size() > 1)
{
output << "[";
for (vector<int>::const_iterator viit=itv->second.begin();
viit!=itv->second.end(); viit++)
for (vector<int>::const_iterator viit = itv->second.begin();
viit != itv->second.end(); viit++)
output << *viit << ";";
output << "];" << endl;
}
......
......@@ -272,7 +272,8 @@ public:
string name, name2, prior;
NodeID init_val, low_bound, up_bound, mean, std, p3, p4, jscale;
void init(const DataTree &datatree)
void
init(const DataTree &datatree)
{
type = 0;
name = "";
......@@ -465,7 +466,7 @@ private:
const OptionsList options_list;
public:
ShockDecompositionStatement(const SymbolList &symbol_list_arg,
const OptionsList &options_list_arg);
const OptionsList &options_list_arg);
virtual void writeOutput(ostream &output, const string &basename) const;
};
......
......@@ -265,7 +265,8 @@ DataTree::AddLog(NodeID iArg1)
}
}
NodeID DataTree::AddLog10(NodeID iArg1)
NodeID
DataTree::AddLog10(NodeID iArg1)
{
if (iArg1 != Zero && iArg1 != One)
return AddUnaryOp(oLog10, iArg1);
......@@ -459,8 +460,8 @@ DataTree::AddUnknownFunction(const string &function_name, const vector<NodeID> &
bool
DataTree::isSymbolUsed(int symb_id) const
{
for(variable_node_map_type::const_iterator it = variable_node_map.begin();
it != variable_node_map.end(); it++)
for (variable_node_map_type::const_iterator it = variable_node_map.begin();
it != variable_node_map.end(); it++)
if (it->first.first == symb_id)
return true;
......@@ -485,8 +486,8 @@ DataTree::getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException)
bool
DataTree::containsSteadyStateOperator() const
{
for(unary_op_node_map_type::const_iterator it = unary_op_node_map.begin();
it != unary_op_node_map.end(); it++)
for (unary_op_node_map_type::const_iterator it = unary_op_node_map.begin();
it != unary_op_node_map.end(); it++)
if (it->first.second == oSteadyState)
return true;
......
......@@ -58,7 +58,7 @@ protected:
unary_op_node_map_type unary_op_node_map;
typedef map<pair<pair<NodeID, NodeID>, BinaryOpcode>, BinaryOpNode *> binary_op_node_map_type;
binary_op_node_map_type binary_op_node_map;
typedef map<pair<pair<pair<NodeID, NodeID>,NodeID>, TrinaryOpcode>, TrinaryOpNode *> trinary_op_node_map_type;
typedef map<pair<pair<pair<NodeID, NodeID>, NodeID>, TrinaryOpcode>, TrinaryOpNode *> trinary_op_node_map_type;
trinary_op_node_map_type trinary_op_node_map;
//! Stores local variables value (maps symbol ID to corresponding node)
......@@ -94,7 +94,9 @@ public:
{
public:
string name;
LocalVariableException(const string &name_arg) : name(name_arg) {}
LocalVariableException(const string &name_arg) : name(name_arg)
{
}
};
//! Adds a numerical constant
......@@ -190,7 +192,11 @@ public:
virtual int getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException);
//! Returns bool indicating whether DataTree represents a Dynamic Model (returns true in DynamicModel.hh)
virtual bool isDynamic() const { return false; };
virtual bool
isDynamic() const
{
return false;
};
};
inline NodeID
......@@ -232,7 +238,7 @@ DataTree::AddUnaryOp(UnaryOpcode op_code, NodeID arg, int arg_exp_info_set)
double val = UnaryOpNode::eval_opcode(op_code, argval);
return AddPossiblyNegativeConstant(val);
}
catch(ExprNode::EvalException &e)
catch (ExprNode::EvalException &e)
{
}
}
......@@ -254,7 +260,7 @@ DataTree::AddBinaryOp(NodeID arg1, BinaryOpcode op_code, NodeID arg2)
double val = BinaryOpNode::eval_opcode(argval1, op_code, argval2);
return AddPossiblyNegativeConstant(val);
}
catch(ExprNode::EvalException &e)
catch (ExprNode::EvalException &e)
{
}
return new BinaryOpNode(*this, arg1, op_code, arg2);
......@@ -276,7 +282,7 @@ DataTree::AddTrinaryOp(NodeID arg1, TrinaryOpcode op_code, NodeID arg2, NodeID a
double val = TrinaryOpNode::eval_opcode(argval1, op_code, argval2, argval3);
return AddPossiblyNegativeConstant(val);
}
catch(ExprNode::EvalException &e)
catch (ExprNode::EvalException &e)
{
}
return new TrinaryOpNode(*this, arg1, op_code, arg2, arg3);
......
This diff is collapsed.
......@@ -143,7 +143,7 @@ private:
//! Helper for writing the sparse Hessian or third derivatives in MATLAB and C
/*! If order=2, writes either v2(i+1,j+1) or v2[i+j*NNZDerivatives[1]]
If order=3, writes either v3(i+1,j+1) or v3[i+j*NNZDerivatives[2]] */
If order=3, writes either v3(i+1,j+1) or v3[i+j*NNZDerivatives[2]] */
void sparseHelper(int order, ostream &output, int row_nb, int col_nb, ExprNodeOutputType output_type) const;
//! Write chain rule derivative of a recursive equation w.r. to a variable
......@@ -152,12 +152,10 @@ private:
//! Collecte the derivatives w.r. to endogenous of the block, to endogenous of previouys blocks and to exogenous
void collect_block_first_order_derivatives();
//! Factorized code for substitutions of leads/lags
/*! \param[in] type determines which type of variables is concerned */
void substituteLeadLagInternal(aux_var_t type);
private:
//! Indicate if the temporary terms are computed for the overall model (true) or not (false). Default value true
bool global_temporary_terms;
......@@ -202,10 +200,10 @@ public:
double cutoff;
//! Compute the minimum feedback set in the dynamic model:
/*! 0 : all endogenous variables are considered as feedback variables
1 : the variables belonging to non normalized equation are considered as feedback variables
2 : the variables belonging to a non linear equation are considered as feedback variables
3 : the variables belonging to a non normalizable non linear equation are considered as feedback variables
default value = 0 */
1 : the variables belonging to non normalized equation are considered as feedback variables
2 : the variables belonging to a non linear equation are considered as feedback variables
3 : the variables belonging to a non normalizable non linear equation are considered as feedback variables
default value = 0 */
int mfs;
//! the file containing the model and the derivatives code
ofstream code_file;
......@@ -241,7 +239,11 @@ public:
virtual int getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException);
//! Returns true indicating that this is a dynamic model
virtual bool isDynamic() const { return true; };
virtual bool
isDynamic() const
{
return true;
};
//! Transforms the model by removing all leads greater or equal than 2 on endos
/*! Note that this can create new lags on endos and exos */
......@@ -266,38 +268,96 @@ public:
//! Fills eval context with values of model local variables and auxiliary variables
void fillEvalContext(eval_context_type &eval_context) const;
//! Return the number of blocks
virtual unsigned int getNbBlocks() const {return(block_type_firstequation_size_mfs.size());};
virtual unsigned int
getNbBlocks() const
{
return (block_type_firstequation_size_mfs.size());
};
//! Determine the simulation type of each block
virtual BlockSimulationType getBlockSimulationType(int block_number) const {return(block_type_firstequation_size_mfs[block_number].first.first);};
virtual BlockSimulationType
getBlockSimulationType(int block_number) const
{
return (block_type_firstequation_size_mfs[block_number].first.first);
};
//! Return the first equation number of a block
virtual unsigned int getBlockFirstEquation(int block_number) const {return(block_type_firstequation_size_mfs[block_number].first.second);};
virtual unsigned int
getBlockFirstEquation(int block_number) const
{
return (block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the size of the block block_number
virtual unsigned int getBlockSize(int block_number) const {return(block_type_firstequation_size_mfs[block_number].second.first);};
virtual unsigned int
getBlockSize(int block_number) const
{
return (block_type_firstequation_size_mfs[block_number].second.first);
};
//! Return the number of feedback variable of the block block_number
virtual unsigned int getBlockMfs(int block_number) const {return(block_type_firstequation_size_mfs[block_number].second.second);};
virtual unsigned int
getBlockMfs(int block_number) const
{
return (block_type_firstequation_size_mfs[block_number].second.second);
};
//! Return the maximum lag in a block
virtual unsigned int getBlockMaxLag(int block_number) const {return(block_lag_lead[block_number].first);};
virtual unsigned int
getBlockMaxLag(int block_number) const
{
return (block_lag_lead[block_number].first);
};
//! Return the maximum lead in a block
virtual unsigned int getBlockMaxLead(int block_number) const {return(block_lag_lead[block_number].second);};
virtual unsigned int
getBlockMaxLead(int block_number) const
{
return (block_lag_lead[block_number].second);
};
//! Return the type of equation (equation_number) belonging to the block block_number
virtual EquationType getBlockEquationType(int block_number, int equation_number) const {return( equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first);};
virtual EquationType
getBlockEquationType(int block_number, int equation_number) const
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first);
};
//! Return true if the equation has been normalized
virtual bool isBlockEquationRenormalized(int block_number, int equation_number) const {return( equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first == E_EVALUATE_S);};
virtual bool
isBlockEquationRenormalized(int block_number, int equation_number) const
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first == E_EVALUATE_S);
};
//! Return the NodeID of the equation equation_number belonging to the block block_number
virtual NodeID getBlockEquationNodeID(int block_number, int equation_number) const {return( equations[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]]);};
virtual NodeID
getBlockEquationNodeID(int block_number, int equation_number) const
{
return (equations[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]]);
};
//! Return the NodeID of the renormalized equation equation_number belonging to the block block_number
virtual NodeID getBlockEquationRenormalizedNodeID(int block_number, int equation_number) const {return( equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].second);};
virtual NodeID
getBlockEquationRenormalizedNodeID(int block_number, int equation_number) const
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].second);
};
//! Return the original number of equation equation_number belonging to the block block_number
virtual int getBlockEquationID(int block_number, int equation_number) const {return( equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]);};
virtual int
getBlockEquationID(int block_number, int equation_number) const
{
return (equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]);
};
//! Return the original number of variable variable_number belonging to the block block_number
virtual int getBlockVariableID(int block_number, int variable_number) const {return( variable_reordered[block_type_firstequation_size_mfs[block_number].first.second+variable_number]);};
virtual int
getBlockVariableID(int block_number, int variable_number) const
{
return (variable_reordered[block_type_firstequation_size_mfs[block_number].first.second+variable_number]);
};
//! Return the position of equation_number in the block number belonging to the block block_number
virtual int getBlockInitialEquationID(int block_number, int equation_number) const {return((int)inv_equation_reordered[equation_number] - (int)block_type_firstequation_size_mfs[block_number].first.second);};
virtual int
getBlockInitialEquationID(int block_number, int equation_number) const
{
return ((int) inv_equation_reordered[equation_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the position of variable_number in the block number belonging to the block block_number
virtual int getBlockInitialVariableID(int block_number, int variable_number) const {return((int)inv_variable_reordered[variable_number] - (int)block_type_firstequation_size_mfs[block_number].first.second);};
virtual int
getBlockInitialVariableID(int block_number, int variable_number) const
{
return ((int) inv_variable_reordered[variable_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
};
......
......@@ -26,7 +26,7 @@ using namespace std;
#include <cstdlib>
#include <cstring>
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION 4.
# define PACKAGE_VERSION 4.
#endif
#include "macro/MacroDriver.hh"
......@@ -36,9 +36,9 @@ using namespace std;
*/
void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool warn_uninit
#if defined(_WIN32) || defined(__CYGWIN32__)
, bool cygwin, bool msvc
, bool cygwin, bool msvc
#endif
);
);
void
usage()
......@@ -52,7 +52,7 @@ usage()
}
int
main(int argc, char** argv)
main(int argc, char **argv)
{
if (argc < 2)
{
......@@ -150,7 +150,7 @@ main(int argc, char** argv)
#if defined(_WIN32) || defined(__CYGWIN32__)
, cygwin, msvc
#endif
);
);
return EXIT_SUCCESS;
}
......@@ -51,9 +51,9 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tm
// Write outputs
mod_file->writeOutputFiles(basename, clear_all
#if defined(_WIN32) || defined(__CYGWIN32__)
, cygwin, msvc
, cygwin, msvc
#endif
);