Cleaned up Doxygen docs for PrintCtrl and LogPrintCtrl
This commit is contained in:
parent
65d7cab42e
commit
1ee0835e9c
4 changed files with 20 additions and 206 deletions
|
|
@ -44,14 +44,11 @@ namespace Cantera
|
|||
* cropping functions are also available as a "double"
|
||||
* conversion utility.
|
||||
*
|
||||
*
|
||||
* @ingroup globalUtilFuncs
|
||||
*
|
||||
*/
|
||||
class PrintCtrl
|
||||
{
|
||||
public:
|
||||
|
||||
//! enum for cropping control
|
||||
enum CROP_TYPE {
|
||||
//! Turn off cropping always
|
||||
|
|
@ -86,8 +83,7 @@ public:
|
|||
*
|
||||
* @param coutProxy This is a reference to the ostream
|
||||
* to use for all IO from ths object.
|
||||
* @param Ndec value of Ndec. Defaults to -1000, i.e.,
|
||||
* no decade cropping
|
||||
* @param Ndec value of Ndec. Defaults to -1000, i.e., no decade cropping
|
||||
* @param ctlocal The default is to turn on cropping all the time.
|
||||
*/
|
||||
PrintCtrl(std::ostream& coutProxy = std::cout, int Ndec = -1000,
|
||||
|
|
@ -102,10 +98,9 @@ public:
|
|||
* fit into the maximum space.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param sigDigits Number of significant digits
|
||||
* (-1 = default, means to use the default
|
||||
* number for the object, which is initially
|
||||
* set to 13.
|
||||
* @param sigDigits Number of significant digits (-1 = default, means to
|
||||
* use the default number for the object, which is initially set
|
||||
* to 13.
|
||||
* @param wMin Minimum number of spaces to print out
|
||||
* @param wMax Maximum number of spaces to print out
|
||||
*/
|
||||
|
|
@ -123,10 +118,9 @@ public:
|
|||
* fit into the maximum space.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param sigDigits Number of significant digits
|
||||
* (-1 = default, means to use the default
|
||||
* number for the object, which is initially
|
||||
* set to 13.
|
||||
* @param sigDigits Number of significant digits (-1 = default, means to
|
||||
* use the default number for the object, which is initially set
|
||||
* to 13.
|
||||
* @param wMin Minimum number of spaces to print out
|
||||
* @param wMax Maximum number of spaces to print out
|
||||
*/
|
||||
|
|
@ -150,10 +144,9 @@ public:
|
|||
|
||||
//! Crop a double at a certain decade level
|
||||
/*!
|
||||
* This routine will crop a floating point number at a certain
|
||||
* decade lvl. In other words everything below a power of 10^Ndec
|
||||
* will be deleted.
|
||||
* Note, it does rounding up of the last digit.
|
||||
* This routine will crop a floating point number at a certain decade
|
||||
* lvl. In other words everything below a power of 10^Ndec will be
|
||||
* deleted. Note, it does rounding up of the last digit.
|
||||
*
|
||||
* @param d Double to be cropped
|
||||
* @param nDecades Number of significant digits
|
||||
|
|
@ -171,16 +164,13 @@ public:
|
|||
//! Set the default value of N decade
|
||||
/*!
|
||||
* @param nDecades new value of Ndec
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int setNdec(int nDecades);
|
||||
|
||||
|
||||
//! Set the default significant digits to output
|
||||
/*!
|
||||
* @param sigDigits new value of the sig digits
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int setSigDigits(int sigDigits);
|
||||
|
|
@ -188,7 +178,6 @@ public:
|
|||
//! Set the default minimum width
|
||||
/*!
|
||||
* @param wMin Default minimum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int setWmin(int wMin);
|
||||
|
|
@ -196,7 +185,6 @@ public:
|
|||
//! Set the default maximum width
|
||||
/*!
|
||||
* @param wMax Default maximum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int setWmax(int wMax);
|
||||
|
|
@ -207,9 +195,7 @@ public:
|
|||
*/
|
||||
void setCropCntrl(CROP_TYPE ctlocal);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! private function to figure out cropping logic
|
||||
/*!
|
||||
* @return Returns the decision as to whether to crop or not
|
||||
|
|
@ -255,4 +241,3 @@ private:
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -37,18 +37,6 @@ LogPrintCtrl::~LogPrintCtrl()
|
|||
delete m_ffss;
|
||||
}
|
||||
|
||||
// Print a double using scientific notation
|
||||
/*
|
||||
* Prints a double using scientific notation in a
|
||||
* fixed number of spaces
|
||||
*
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param w Number of spaces to use
|
||||
* @param p Precision
|
||||
*
|
||||
*
|
||||
*/
|
||||
void LogPrintCtrl::pr_de_c10(const double din, int p, const int wMin,
|
||||
const int wMax)
|
||||
{
|
||||
|
|
@ -57,16 +45,6 @@ void LogPrintCtrl::pr_de_c10(const double din, int p, const int wMin,
|
|||
m_os.str("");
|
||||
}
|
||||
|
||||
// Print a double using scientific notation
|
||||
/*
|
||||
* Prints a double using scientific notation in a
|
||||
* fixed number of spaces. Rounding of the last digit is carried out
|
||||
* by the standard c++ printing utilities.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param w Number of spaces to use
|
||||
* @param p Precision
|
||||
*/
|
||||
void LogPrintCtrl::pr_de(const double d, int sigDigIn, const int wMinIn,
|
||||
const int wMaxIn)
|
||||
{
|
||||
|
|
@ -75,89 +53,34 @@ void LogPrintCtrl::pr_de(const double d, int sigDigIn, const int wMinIn,
|
|||
m_os.str("");
|
||||
}
|
||||
|
||||
// Croup a double at a certain decade level
|
||||
/*
|
||||
* This routine will crop a floating point number at a certain
|
||||
* decade lvl. In other words everything below a power of 10^Ndec
|
||||
* will be deleted.
|
||||
* Note, it currently does not do rounding of the last digit.
|
||||
*
|
||||
* @param d Double to be cropped
|
||||
* @param nSig Number of significant digits
|
||||
* example:
|
||||
* d = 1.1305E-15;
|
||||
* Ndec = -16;
|
||||
* This routine will return 1.1E-15
|
||||
*
|
||||
* d = 8.0E-17
|
||||
* Ndec = -16
|
||||
* This routine will return 0.0
|
||||
*/
|
||||
double LogPrintCtrl::cropAbs10(const double d, int Ndec) const
|
||||
{
|
||||
return m_pc->cropAbs10(d, Ndec);
|
||||
}
|
||||
|
||||
// Crop a double at a certain number of significant digits
|
||||
/*
|
||||
* This routine will crop a floating point number at a certain
|
||||
* number of significant digits. Note, it currently does
|
||||
* rounding up of the last digit.
|
||||
*
|
||||
* example:
|
||||
* d = 1.0305E-15;
|
||||
* nsig = 3;
|
||||
* This routine will return 1.03E-15
|
||||
*/
|
||||
double LogPrintCtrl::cropSigDigits(const double d, int nSig) const
|
||||
{
|
||||
return m_pc->cropSigDigits(d, nSig);
|
||||
}
|
||||
|
||||
// Set the default value of N decade
|
||||
/*
|
||||
* @param Ndec new value of Ndec
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int LogPrintCtrl::setNdec(int Ndec)
|
||||
{
|
||||
return m_pc->setNdec(Ndec);
|
||||
}
|
||||
|
||||
// Set the default significant digits to output
|
||||
/*
|
||||
* @param nSigDigits new value of the sig digits
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int LogPrintCtrl::setSigDigits(int nSigDigits)
|
||||
{
|
||||
return m_pc->setSigDigits(nSigDigits);
|
||||
}
|
||||
|
||||
// Set the default minimum width
|
||||
/*
|
||||
* @param wmin Default minimum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int LogPrintCtrl::setWmin(int wmin)
|
||||
{
|
||||
return m_pc->setWmin(wmin);
|
||||
}
|
||||
|
||||
|
||||
// Set the default maximum width
|
||||
/*
|
||||
* @param wmin Default maximum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int LogPrintCtrl::setWmax(int wmax)
|
||||
{
|
||||
return m_pc->setWmax(wmax);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,13 +37,11 @@ namespace Cantera
|
|||
class LogPrintCtrl
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
/*!
|
||||
* This also serves to initialize the ticks within the object
|
||||
*
|
||||
* @param Ndec value of Ndec. Defaults to -1000, i.e.,
|
||||
* no decade cropping
|
||||
* @param Ndec value of Ndec. Defaults to -1000, i.e., no decade cropping
|
||||
*/
|
||||
LogPrintCtrl(int Ndec = -1000);
|
||||
|
||||
|
|
@ -59,10 +57,9 @@ public:
|
|||
* fit into the maximum space.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param sigDigits Number of significant digits
|
||||
* (-1 = default, means to use the default
|
||||
* number for the object, which is initially
|
||||
* set to 13.
|
||||
* @param sigDigits Number of significant digits (-1 = default, means to
|
||||
* use the default number for the object, which is initially set
|
||||
* to 13.
|
||||
* @param wMin Minimum number of spaces to print out
|
||||
* @param wMax Maximum number of spaces to print out
|
||||
*/
|
||||
|
|
@ -80,10 +77,9 @@ public:
|
|||
* fit into the maximum space.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param sigDigits Number of significant digits
|
||||
* (-1 = default, means to use the default
|
||||
* number for the object, which is initially
|
||||
* set to 13.
|
||||
* @param sigDigits Number of significant digits (-1 = default, means to
|
||||
* use the default number for the object, which is initially set
|
||||
* to 13.
|
||||
* @param wMin Minimum number of spaces to print out
|
||||
* @param wMax Maximum number of spaces to print out
|
||||
*/
|
||||
|
|
@ -107,10 +103,9 @@ public:
|
|||
|
||||
//! Crop a double at a certain decade level
|
||||
/*!
|
||||
* This routine will crop a floating point number at a certain
|
||||
* decade lvl. In other words everything below a power of 10^Ndec
|
||||
* will be deleted.
|
||||
* Note, it does rounding up of the last digit.
|
||||
* This routine will crop a floating point number at a certain decade
|
||||
* lvl. In other words everything below a power of 10^Ndec will be
|
||||
* deleted. Note, it does rounding up of the last digit.
|
||||
*
|
||||
* @param d Double to be cropped
|
||||
* @param nDecades Number of significant digits
|
||||
|
|
@ -128,7 +123,6 @@ public:
|
|||
//! Set the default value of N decade
|
||||
/*!
|
||||
* @param nDecades new value of Ndec
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int setNdec(int nDecades);
|
||||
|
|
@ -137,7 +131,6 @@ public:
|
|||
//! Set the default significant digits to output
|
||||
/*!
|
||||
* @param sigDigits new value of the sig digits
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int setSigDigits(int sigDigits);
|
||||
|
|
@ -145,7 +138,6 @@ public:
|
|||
//! Set the default minimum width
|
||||
/*!
|
||||
* @param wMin Default minimum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int setWmin(int wMin);
|
||||
|
|
@ -153,14 +145,11 @@ public:
|
|||
//! Set the default maximum width
|
||||
/*!
|
||||
* @param wMax Default maximum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int setWmax(int wMax);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! local stringstream class for temp output
|
||||
std::ostringstream m_os;
|
||||
|
||||
|
|
@ -170,11 +159,7 @@ private:
|
|||
|
||||
//! Pointer to the PrintCtrl class
|
||||
PrintCtrl* m_pc;
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -22,11 +22,9 @@ using namespace std;
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
|
||||
// Storage for the global crop flag
|
||||
PrintCtrl::CROP_TYPE_GLOBAL PrintCtrl::GlobalCrop = GCT_NOPREF;
|
||||
|
||||
|
||||
PrintCtrl::PrintCtrl(std::ostream& coutProxy, int Ndec,
|
||||
CROP_TYPE ctlocal) :
|
||||
m_cout(coutProxy),
|
||||
|
|
@ -36,21 +34,8 @@ PrintCtrl::PrintCtrl(std::ostream& coutProxy, int Ndec,
|
|||
m_wMax(19),
|
||||
m_cropCntrl(ctlocal)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Print a double using scientific notation
|
||||
/*
|
||||
* Prints a double using scientific notation in a
|
||||
* fixed number of spaces
|
||||
*
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param w Number of spaces to use
|
||||
* @param p Precision
|
||||
*
|
||||
*
|
||||
*/
|
||||
void PrintCtrl::pr_de_c10(const double din, int p, const int wMin,
|
||||
const int wMax)
|
||||
{
|
||||
|
|
@ -58,16 +43,6 @@ void PrintCtrl::pr_de_c10(const double din, int p, const int wMin,
|
|||
pr_de(d, p, wMin, wMax);
|
||||
}
|
||||
|
||||
// Print a double using scientific notation
|
||||
/*
|
||||
* Prints a double using scientific notation in a
|
||||
* fixed number of spaces. Rounding of the last digit is carried out
|
||||
* by the standard c++ printing utilities.
|
||||
*
|
||||
* @param d double to be printed
|
||||
* @param w Number of spaces to use
|
||||
* @param p Precision
|
||||
*/
|
||||
void PrintCtrl::pr_de(const double d, int sigDigIn, const int wMinIn,
|
||||
const int wMaxIn)
|
||||
{
|
||||
|
|
@ -135,24 +110,6 @@ void PrintCtrl::pr_de(const double d, int sigDigIn, const int wMinIn,
|
|||
m_cout.width(wold);
|
||||
}
|
||||
|
||||
// Croup a double at a certain decade level
|
||||
/*
|
||||
* This routine will crop a floating point number at a certain
|
||||
* decade lvl. In other words everything below a power of 10^Ndec
|
||||
* will be deleted.
|
||||
* Note, it currently does not do rounding of the last digit.
|
||||
*
|
||||
* @param d Double to be cropped
|
||||
* @param nSig Number of significant digits
|
||||
* example:
|
||||
* d = 1.1305E-15;
|
||||
* Ndec = -16;
|
||||
* This routine will return 1.1E-15
|
||||
*
|
||||
* d = 8.0E-17
|
||||
* Ndec = -16
|
||||
* This routine will return 0.0
|
||||
*/
|
||||
double PrintCtrl::cropAbs10(const double d, int Ndec) const
|
||||
{
|
||||
if (!doCrop()) {
|
||||
|
|
@ -175,17 +132,6 @@ double PrintCtrl::cropAbs10(const double d, int Ndec) const
|
|||
return cropSigDigits(d, nsig);
|
||||
}
|
||||
|
||||
// Crop a double at a certain number of significant digits
|
||||
/*
|
||||
* This routine will crop a floating point number at a certain
|
||||
* number of significant digits. Note, it currently does
|
||||
* rounding up of the last digit.
|
||||
*
|
||||
* example:
|
||||
* d = 1.0305E-15;
|
||||
* nsig = 3;
|
||||
* This routine will return 1.03E-15
|
||||
*/
|
||||
double PrintCtrl::cropSigDigits(const double d, int nSig) const
|
||||
{
|
||||
if (!doCrop()) {
|
||||
|
|
@ -220,12 +166,6 @@ double PrintCtrl::cropSigDigits(const double d, int nSig) const
|
|||
return sgn * daltabs;
|
||||
}
|
||||
|
||||
// Set the default value of N decade
|
||||
/*
|
||||
* @param Ndec new value of Ndec
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int PrintCtrl::setNdec(int Ndec)
|
||||
{
|
||||
int nold = m_Ndec;
|
||||
|
|
@ -233,12 +173,6 @@ int PrintCtrl::setNdec(int Ndec)
|
|||
return nold;
|
||||
}
|
||||
|
||||
// Set the default significant digits to output
|
||||
/*
|
||||
* @param nSigDigits new value of the sig digits
|
||||
*
|
||||
* @return returns the old value of Ndec
|
||||
*/
|
||||
int PrintCtrl::setSigDigits(int nSigDigits)
|
||||
{
|
||||
int nold = m_precision + 1;
|
||||
|
|
@ -249,12 +183,6 @@ int PrintCtrl::setSigDigits(int nSigDigits)
|
|||
return nold;
|
||||
}
|
||||
|
||||
// Set the default minimum width
|
||||
/*
|
||||
* @param wmin Default minimum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int PrintCtrl::setWmin(int wmin)
|
||||
{
|
||||
int nold = m_wMin;
|
||||
|
|
@ -262,13 +190,6 @@ int PrintCtrl::setWmin(int wmin)
|
|||
return nold;
|
||||
}
|
||||
|
||||
|
||||
// Set the default maximum width
|
||||
/*
|
||||
* @param wmin Default maximum width
|
||||
*
|
||||
* @return returns the old default
|
||||
*/
|
||||
int PrintCtrl::setWmax(int wmax)
|
||||
{
|
||||
int nold = m_wMax;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue