code cleanup

time-shift
Houtan Bastani 2011-03-28 11:19:10 +02:00
parent 2882827084
commit 330b11ba48
4 changed files with 8 additions and 28 deletions

View File

@ -18,7 +18,6 @@
*/ */
#include <iostream> #include <iostream>
#include <sstream>
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <cassert> #include <cassert>

View File

@ -286,6 +286,7 @@ public:
//! Replaces model equations with derivatives of Lagrangian w.r.t. endogenous //! Replaces model equations with derivatives of Lagrangian w.r.t. endogenous
void computeRamseyPolicyFOCs(const StaticModel &static_model, const string &discount_factor); void computeRamseyPolicyFOCs(const StaticModel &static_model, const string &discount_factor);
//! Replaces the model equations in dynamic_model with those in this model
void replaceMyEquations(DynamicModel &dynamic_model) const; void replaceMyEquations(DynamicModel &dynamic_model) const;
//! Writes LaTeX file with the equations of the dynamic model //! Writes LaTeX file with the equations of the dynamic model

View File

@ -657,7 +657,7 @@ public:
virtual expr_t removeTrendLeadLag(map<int, expr_t> trend_symbols_map) const; virtual expr_t removeTrendLeadLag(map<int, expr_t> trend_symbols_map) const;
//! Function to write out the oPowerNode in expr_t terms as opposed to writing out the function itself //! Function to write out the oPowerNode in expr_t terms as opposed to writing out the function itself
expr_t unpackPowerDeriv() const; expr_t unpackPowerDeriv() const;
//! Returns AUX_LAMBDA*(lhs-rhs) = 0, creating lagrange multiplier AUX_LAMBDA //! Returns MULT_i*(lhs-rhs) = 0, creating multiplier MULT_i
expr_t addMultipliersToConstraints(int i); expr_t addMultipliersToConstraints(int i);
//! Returns the non-zero hand-side of an equation (that must have a hand side equal to zero) //! Returns the non-zero hand-side of an equation (that must have a hand side equal to zero)
expr_t getNonZeroPartofEquation() const; expr_t getNonZeroPartofEquation() const;

View File

@ -560,21 +560,11 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool console,
if (dynamic_model.equation_number() > 0) if (dynamic_model.equation_number() > 0)
{ {
if (dynamic_model_needed) if (dynamic_model_needed)
/* to be removed before ramsey_policy commit
if (mod_file_struct.ramsey_policy_present)
ramsey_policy_FOC_dynamic_model.writeOutput(mOutputFile, basename, block, byte_code, use_dll, mod_file_struct.order_option);
else
*/
dynamic_model.writeOutput(mOutputFile, basename, block, byte_code, use_dll, mod_file_struct.order_option); dynamic_model.writeOutput(mOutputFile, basename, block, byte_code, use_dll, mod_file_struct.order_option);
else else
dynamic_model.writeOutput(mOutputFile, basename, false, false, false, mod_file_struct.order_option); dynamic_model.writeOutput(mOutputFile, basename, false, false, false, mod_file_struct.order_option);
if (!no_static) if (!no_static)
/* to be removed before ramsey_policy commit static_model.writeOutput(mOutputFile, block);
if (mod_file_struct.ramsey_policy_present)
ramsey_policy_FOC_static_model.writeOutput(mOutputFile, block);
else
*/
static_model.writeOutput(mOutputFile, block);
} }
// Print statements // Print statements
@ -614,23 +604,13 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool console,
if (dynamic_model.equation_number() > 0) if (dynamic_model.equation_number() > 0)
{ {
if (!no_static) if (!no_static)
/* to be removed before ramsey_policy commit static_model.writeStaticFile(basename, block, byte_code);
if (mod_file_struct.ramsey_policy_present)
ramsey_policy_FOC_static_model.writeStaticFile(basename, block, byte_code);
else
*/
static_model.writeStaticFile(basename, block, byte_code);
if (dynamic_model_needed) if (dynamic_model_needed)
/* to be removed before ramsey_policy commit {
if (mod_file_struct.ramsey_policy_present) dynamic_model.writeDynamicFile(basename, block, byte_code, use_dll, mod_file_struct.order_option);
ramsey_policy_FOC_dynamic_model.writeDynamicFile(basename, false, false, false, mod_file_struct.order_option); dynamic_model.writeParamsDerivativesFile(basename);
else }
*/
{
dynamic_model.writeDynamicFile(basename, block, byte_code, use_dll, mod_file_struct.order_option);
dynamic_model.writeParamsDerivativesFile(basename);
}
else else
{ {
dynamic_model.writeDynamicFile(basename, false, false, false, mod_file_struct.order_option); dynamic_model.writeDynamicFile(basename, false, false, false, mod_file_struct.order_option);