src/ModelOptions.cpp
void ModelOptions::writeToR(ostream& os, std::string nm, int indent) {
    for (int n=0;n<indent;n++) os<<tb;
        os<<nm<<"=list("<<endl;
    indent++;
        for (int n=0;n<indent;n++) os<<tb;
        os<<"initNatZ="<<optInitNatZ<<cc<<"natmort="<<optParamNM<<cc<<"growth="<<optGrowthPDF<<cc<<endl;
        os<<"prM2M=list(";
            os<<"pen.smoothing="; wts::writeToR(os,wgtPenSmthPrM2M); os<<cc<<endl;
            os<<"pen.nondecreasing="; wts::writeToR(os,wgtPenNonDecPrM2M); os<<"),"<<endl;
        os<<"npSel=list(";
            os<<"pen.smoothing="; wts::writeToR(os,wgtPenSmthNPSel); os<<"),"<<endl;
        os<<"cvFDevsPen="<<cvFDevsPen<<cc<<"phsDecr="<<phsDecrFDevsPen<<cc<<"phsZero="<<phsZeroFDevsPen<<cc
          <<"wgtLastDevPen="<<wgtSqSumDevsPen<<cc<<"phsLastDevsPen="<<phsSqSumDevsPen<<cc;
        os<<"effXtrapScenarios="; ptrEffXtrapScenarios->writeToR(os); os<<"),"<<endl;
        os<<"oflOptions=list(";
            os<<"optAvgCapRate="; wts::writeToR(os,optOFLAvgCapRate); os<<cc<<endl;
            os<<"numYears="; wts::writeToR(os,oflNumYrsForAvgCapRate); os<<cc<<endl;
            os<<"rateInfo="; wts::writeToR(os,oflAvgCapRateInfo); os<<")"<<cc<<endl;
        os<<"itRewgtOptions=list(";
            os<<"option="<<optIterativeReweighting<<cc<<endl;
            os<<"phase="<<phsIterativeReweighting<<cc<<endl;
            os<<"maxIts="<<maxIterations<<")"<<endl;
    indent--;
    for (int n=0;n<indent;n++) os<<tb;
        os<<")";
}
/**
 * Write ModelOptions info as an R list. TODO: complete this!
 * 
 * @param os - output stream to write to
 * @param nm - name to use for list
 * @param indent - number of tabs to indent
 */
Write ModelOptions info as an R list. TODO: complete this!

@param os - output stream to write to
@param nm - name to use for list
@param indent - number of tabs to indent
Write ModelOptions info as an R list . TODO : complete this! @param os - output stream to write to @param nm - name to use for list @param indent - number of tabs to indent
void ModelOptions::writeToR(ostream& os, std::string nm, int indent) {
    for (int n=0;n<indent;n++) os<<tb;
        os<<nm<<"=list("<<endl;
    indent++;
        for (int n=0;n<indent;n++) os<<tb;
        os<<"initNatZ="<<optInitNatZ<<cc<<"natmort="<<optParamNM<<cc<<"growth="<<optGrowthPDF<<cc<<endl;
        os<<"prM2M=list(";
            os<<"pen.smoothing="; wts::writeToR(os,wgtPenSmthPrM2M); os<<cc<<endl;
            os<<"pen.nondecreasing="; wts::writeToR(os,wgtPenNonDecPrM2M); os<<"),"<<endl;
        os<<"npSel=list(";
            os<<"pen.smoothing="; wts::writeToR(os,wgtPenSmthNPSel); os<<"),"<<endl;
        os<<"cvFDevsPen="<<cvFDevsPen<<cc<<"phsDecr="<<phsDecrFDevsPen<<cc<<"phsZero="<<phsZeroFDevsPen<<cc
          <<"wgtLastDevPen="<<wgtSqSumDevsPen<<cc<<"phsLastDevsPen="<<phsSqSumDevsPen<<cc;
        os<<"effXtrapScenarios="; ptrEffXtrapScenarios->writeToR(os); os<<"),"<<endl;
        os<<"oflOptions=list(";
            os<<"optAvgCapRate="; wts::writeToR(os,optOFLAvgCapRate); os<<cc<<endl;
            os<<"numYears="; wts::writeToR(os,oflNumYrsForAvgCapRate); os<<cc<<endl;
            os<<"rateInfo="; wts::writeToR(os,oflAvgCapRateInfo); os<<")"<<cc<<endl;
        os<<"itRewgtOptions=list(";
            os<<"option="<<optIterativeReweighting<<cc<<endl;
            os<<"phase="<<phsIterativeReweighting<<cc<<endl;
            os<<"maxIts="<<maxIterations<<")"<<endl;
    indent--;
    for (int n=0;n<indent;n++) os<<tb;
        os<<")";
}
void ModelOptions :: writeToR ( ostream & os , std :: string nm , int indent ) { for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << nm << " " << endl ; indent ++ ; for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << " " << optInitNatZ << cc << " " << optParamNM << cc << " " << optGrowthPDF << cc << endl ; os << " " ; os << " " ; wts :: writeToR ( os , wgtPenSmthPrM2M ) ; os << cc << endl ; os << " " ; wts :: writeToR ( os , wgtPenNonDecPrM2M ) ; os << " " << endl ; os << " " ; os << " " ; wts :: writeToR ( os , wgtPenSmthNPSel ) ; os << " " << endl ; os << " " << cvFDevsPen << cc << " " << phsDecrFDevsPen << cc << " " << phsZeroFDevsPen << cc << " " << wgtSqSumDevsPen << cc << " " << phsSqSumDevsPen << cc ; os << " " ; ptrEffXtrapScenarios -> writeToR ( os ) ; os << " " << endl ; os << " " ; os << " " ; wts :: writeToR ( os , optOFLAvgCapRate ) ; os << cc << endl ; os << " " ; wts :: writeToR ( os , oflNumYrsForAvgCapRate ) ; os << cc << endl ; os << " " ; wts :: writeToR ( os , oflAvgCapRateInfo ) ; os << " " << cc << endl ; os << " " ; os << " " << optIterativeReweighting << cc << endl ; os << " " << phsIterativeReweighting << cc << endl ; os << " " << maxIterations << " " << endl ; indent -- ; for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << " " ; }
Write ModelOptions info as an R list.
Write ModelOptions info as an R list .