changed some variable names to eliminate leading ddouble (and some single) underscores

This commit is contained in:
Dave Goodwin 2005-11-22 17:59:04 +00:00
parent 94bc93b6e6
commit 08fa7e3d02
28 changed files with 243 additions and 243 deletions

View file

@ -53,7 +53,7 @@ int kinetics1(int np, void* p) {
r.insert(gas);
env.insert(gas);
r.addHomogenRxnSens(0);
//r.addHomogenRxnSens(0);
// create a wall between the reactor and the environment
Wall w;

View file

@ -20,7 +20,7 @@
namespace Cantera {
FalloffFactory* FalloffFactory::__factory = 0;
FalloffFactory* FalloffFactory::s_factory = 0;
/**
* The 3-parameter Troe falloff parameterization.

View file

@ -97,14 +97,14 @@ namespace Cantera {
* to the existing factory is returned.
*/
static FalloffFactory* factory() {
if (!__factory) __factory = new FalloffFactory;
return __factory;
if (!s_factory) s_factory = new FalloffFactory;
return s_factory;
}
static void deleteFalloffFactory() {
if (__factory) {
delete __factory;
__factory = 0;
if (s_factory) {
delete s_factory;
s_factory = 0;
}
}
@ -127,7 +127,7 @@ namespace Cantera {
virtual Falloff* newFalloff(int type, const vector_fp& c);
private:
static FalloffFactory* __factory;
static FalloffFactory* s_factory;
FalloffFactory(){}
};

View file

@ -320,7 +320,7 @@ namespace Cantera {
pr[i] *= m_rf_high[i];
}
_scatter_copy(pr.begin(), pr.begin() + m_nfall,
scatter_copy(pr.begin(), pr.begin() + m_nfall,
ropf.begin(), m_fallindx.begin());
}

View file

@ -86,7 +86,7 @@ namespace Cantera {
{ warn("setTolerances"); }
virtual void setSensitivityTolerances(doublereal reltol, doublereal abstol)
{ warn("setSensitivityTolerances"); }
{}// { warn("setSensitivityTolerances"); }
/**
* Set problem type.

View file

@ -25,7 +25,7 @@
namespace Cantera {
KineticsFactory* KineticsFactory::__factory = 0;
KineticsFactory* KineticsFactory::s_factory = 0;
static int ntypes = 5;
static string _types[] = {"none", "GasKinetics", "GRI30", "Interface", "Edge"};

View file

@ -38,13 +38,13 @@ namespace Cantera {
public:
static KineticsFactory* factory() {
if (!__factory) __factory = new KineticsFactory;
return __factory;
if (!s_factory) s_factory = new KineticsFactory;
return s_factory;
}
virtual ~KineticsFactory() {
delete __factory;
__factory = 0;
delete s_factory;
s_factory = 0;
}
/**
@ -57,7 +57,7 @@ namespace Cantera {
private:
static KineticsFactory* __factory;
static KineticsFactory* s_factory;
KineticsFactory(){}
};

View file

@ -29,7 +29,7 @@ using namespace ctml;
namespace Cantera {
SpeciesThermoFactory* SpeciesThermoFactory::__factory = 0;
SpeciesThermoFactory* SpeciesThermoFactory::s_factory = 0;
static void getSpeciesThermoTypes(XML_Node* node,

View file

@ -45,13 +45,13 @@ namespace Cantera {
public:
static SpeciesThermoFactory* factory() {
if (!__factory) __factory = new SpeciesThermoFactory;
return __factory;
if (!s_factory) s_factory = new SpeciesThermoFactory;
return s_factory;
}
static void deleteFactory() {
if (__factory) {
delete __factory;
__factory = 0;
if (s_factory) {
delete s_factory;
s_factory = 0;
}
}
@ -78,7 +78,7 @@ namespace Cantera {
SpeciesThermo& spthermo);
private:
static SpeciesThermoFactory* __factory;
static SpeciesThermoFactory* s_factory;
SpeciesThermoFactory(){}
};

View file

@ -55,10 +55,10 @@ namespace Cantera {
* 'maxTemp()', and returns the smallest 'maxTemp' value.
*/
template<class _InputIter>
doublereal _maxTemp(_InputIter __begin, _InputIter __end) {
doublereal _maxTemp(_InputIter begin, _InputIter end) {
doublereal _maxT = 1.e10;
for (; __begin != __end; ++__begin)
_maxT = fminn(_maxT, __begin->maxTemp());
for (; begin != end; ++begin)
_maxT = fminn(_maxT, begin->maxTemp());
return _maxT;
}

View file

@ -135,11 +135,11 @@ namespace Cantera {
}
doublereal State::sum_xlogx() const {
return m_mmw*_sum_xlogx(m_ym.begin(), m_ym.end()) + log(m_mmw);
return m_mmw* Cantera::sum_xlogx(m_ym.begin(), m_ym.end()) + log(m_mmw);
}
doublereal State::sum_xlogQ(doublereal* Q) const {
return m_mmw * _sum_xlogQ(m_ym.begin(), m_ym.end(), Q);
return m_mmw * Cantera::sum_xlogQ(m_ym.begin(), m_ym.end(), Q);
}
void State::setConcentrations(const doublereal* c) {

View file

@ -477,70 +477,70 @@ They are designed to explicitly unroll loops over species or reactions for
};
template<class _InputIter, class Vec1, class Vec2>
inline static void _multiply(_InputIter __begin, _InputIter __end,
template<class InputIter, class Vec1, class Vec2>
inline static void _multiply(InputIter begin, InputIter end,
const Vec1& input, Vec2& output) {
for (; __begin != __end; ++__begin)
__begin->multiply(input, output);
for (; begin != end; ++begin)
begin->multiply(input, output);
}
template<class _InputIter, class Vec1, class Vec2>
inline static void _incrementSpecies(_InputIter __begin,
_InputIter __end, const Vec1& input, Vec2& output) {
for (; __begin != __end; ++__begin)
__begin->incrementSpecies(input, output);
template<class InputIter, class Vec1, class Vec2>
inline static void _incrementSpecies(InputIter begin,
InputIter end, const Vec1& input, Vec2& output) {
for (; begin != end; ++begin)
begin->incrementSpecies(input, output);
}
template<class _InputIter, class Vec1, class Vec2>
inline static void _decrementSpecies(_InputIter __begin,
_InputIter __end, const Vec1& input, Vec2& output) {
for (; __begin != __end; ++__begin)
__begin->decrementSpecies(input, output);
template<class InputIter, class Vec1, class Vec2>
inline static void _decrementSpecies(InputIter begin,
InputIter end, const Vec1& input, Vec2& output) {
for (; begin != end; ++begin)
begin->decrementSpecies(input, output);
}
template<class _InputIter, class Vec1, class Vec2>
inline static void _incrementReactions(_InputIter __begin,
_InputIter __end, const Vec1& input, Vec2& output) {
for (; __begin != __end; ++__begin)
__begin->incrementReaction(input, output);
template<class InputIter, class Vec1, class Vec2>
inline static void _incrementReactions(InputIter begin,
InputIter end, const Vec1& input, Vec2& output) {
for (; begin != end; ++begin)
begin->incrementReaction(input, output);
}
template<class _InputIter, class Vec1, class Vec2>
inline static void _decrementReactions(_InputIter __begin,
_InputIter __end, const Vec1& input, Vec2& output) {
for (; __begin != __end; ++__begin)
__begin->decrementReaction(input, output);
template<class InputIter, class Vec1, class Vec2>
inline static void _decrementReactions(InputIter begin,
InputIter end, const Vec1& input, Vec2& output) {
for (; begin != end; ++begin)
begin->decrementReaction(input, output);
}
template<class _InputIter>
inline static void _writeIncrementSpecies(_InputIter __begin, _InputIter __end, string r,
template<class InputIter>
inline static void _writeIncrementSpecies(InputIter begin, InputIter end, string r,
map<int, string>& out) {
for (; __begin != __end; ++__begin) __begin->writeIncrementSpecies(r, out);
for (; begin != end; ++begin) begin->writeIncrementSpecies(r, out);
}
template<class _InputIter>
inline static void _writeDecrementSpecies(_InputIter __begin, _InputIter __end, string r,
template<class InputIter>
inline static void _writeDecrementSpecies(InputIter begin, InputIter end, string r,
map<int, string>& out) {
for (; __begin != __end; ++__begin) __begin->writeDecrementSpecies(r, out);
for (; begin != end; ++begin) begin->writeDecrementSpecies(r, out);
}
template<class _InputIter>
inline static void _writeIncrementReaction(_InputIter __begin, _InputIter __end, string r,
template<class InputIter>
inline static void _writeIncrementReaction(InputIter begin, InputIter end, string r,
map<int, string>& out) {
for (; __begin != __end; ++__begin) __begin->writeIncrementReaction(r, out);
for (; begin != end; ++begin) begin->writeIncrementReaction(r, out);
}
template<class _InputIter>
inline static void _writeDecrementReaction(_InputIter __begin, _InputIter __end, string r,
template<class InputIter>
inline static void _writeDecrementReaction(InputIter begin, InputIter end, string r,
map<int, string>& out) {
for (; __begin != __end; ++__begin) __begin->writeDecrementReaction(r, out);
for (; begin != end; ++begin) begin->writeDecrementReaction(r, out);
}
template<class _InputIter>
inline static void _writeMultiply(_InputIter __begin, _InputIter __end, string r,
template<class InputIter>
inline static void _writeMultiply(InputIter begin, InputIter end, string r,
map<int, string>& out) {
for (; __begin != __end; ++__begin) __begin->writeMultiply(r, out);
for (; begin != end; ++begin) begin->writeMultiply(r, out);
}
/*

View file

@ -44,7 +44,7 @@
namespace Cantera {
ThermoFactory* ThermoFactory::__factory = 0;
ThermoFactory* ThermoFactory::s_factory = 0;
static int ntypes = 8;
static string _types[] = {"IdealGas", "Incompressible",

View file

@ -38,14 +38,14 @@ namespace Cantera {
public:
static ThermoFactory* factory() {
if (!__factory) __factory = new ThermoFactory;
return __factory;
if (!s_factory) s_factory = new ThermoFactory;
return s_factory;
}
static void deleteFactory() {
if (__factory) {
delete __factory;
__factory = 0;
if (s_factory) {
delete s_factory;
s_factory = 0;
}
}
@ -67,7 +67,7 @@ namespace Cantera {
private:
static ThermoFactory* __factory;
static ThermoFactory* s_factory;
ThermoFactory(){}
};

View file

@ -44,7 +44,7 @@ namespace Cantera {
}
void multiply(doublereal* output, const_workPtr work) {
_scatter_mult(work, work + m_n,
scatter_mult(work, work + m_n,
output, m_reaction_index.begin());
}

View file

@ -105,13 +105,13 @@ namespace Cantera {
void setDefaultDirectories();
/// Pointer to the single Application instance
static Application* __app = 0;
static Application* s_app = 0;
Unit* Unit::__u = 0;
Unit* Unit::s_u = 0;
static void appinit() {
if (__app == 0) {
__app = new Application;
if (s_app == 0) {
s_app = new Application;
}
}
@ -120,9 +120,9 @@ namespace Cantera {
* application if leak checking is to be done.
*/
void appdelete() {
if (__app) {
delete __app;
__app = 0;
if (s_app) {
delete s_app;
s_app = 0;
}
SpeciesThermoFactory::deleteFactory();
ThermoFactory::deleteFactory();
@ -131,11 +131,11 @@ namespace Cantera {
}
Application* app() {
if (__app == 0) {
__app = new Application;
if (s_app == 0) {
s_app = new Application;
setDefaultDirectories();
}
return __app;
return s_app;
}
@ -205,7 +205,7 @@ namespace Cantera {
cout << "get_XML_File(): File, " << ff << ", was previously read."
<< " Retrieving the storred xml tree." << endl;
#endif
return __app->xmlfiles[ff];
return s_app->xmlfiles[ff];
}
/*
* Ok, we didn't find the processed XML tree. Do the conversion
@ -226,7 +226,7 @@ namespace Cantera {
if (s) {
x->build(s);
x->lock();
__app->xmlfiles[ff] = x;
s_app->xmlfiles[ff] = x;
}
else {
string estring = "cannot open "+ff+" for reading.";
@ -239,7 +239,7 @@ namespace Cantera {
* lookup operation in the return statement will return a valid
* pointer.
*/
return __app->xmlfiles[ff];
return s_app->xmlfiles[ff];
}
void close_XML_File(string file) {
@ -249,14 +249,14 @@ namespace Cantera {
for(; b != e; ++b) {
b->second->unlock();
delete b->second;
__app->xmlfiles.erase(b->first);
s_app->xmlfiles.erase(b->first);
}
}
else if (app()->xmlfiles.find(file)
!= app()->xmlfiles.end()) {
__app->xmlfiles[file]->unlock();
delete __app->xmlfiles[file];
__app->xmlfiles.erase(file);
s_app->xmlfiles[file]->unlock();
delete s_app->xmlfiles[file];
s_app->xmlfiles.erase(file);
}
}
@ -282,8 +282,8 @@ namespace Cantera {
void popError() {
appinit();
if (nErrors() > 0) {
__app->errorMessage.pop_back();
__app->errorRoutine.pop_back();
s_app->errorMessage.pop_back();
s_app->errorRoutine.pop_back();
}
}
@ -300,8 +300,8 @@ namespace Cantera {
"\n\n************************************************\n"
" Cantera Error! \n"
"************************************************\n\n";
return head+string("\nProcedure: ")+__app->errorRoutine.back()
+string("\nError: ")+__app->errorMessage.back();
return head+string("\nProcedure: ")+s_app->errorRoutine.back()
+string("\nError: ")+s_app->errorMessage.back();
}
else {
return "<no Cantera error>";
@ -318,7 +318,7 @@ namespace Cantera {
*/
void showErrors(ostream& f) {
appinit();
int i = static_cast<int>(__app->errorMessage.size());
int i = static_cast<int>(s_app->errorMessage.size());
if (i == 0) return;
f << endl << endl;
f << "************************************************" << endl;
@ -328,12 +328,12 @@ namespace Cantera {
int j;
for (j = 0; j < i; j++) {
f << endl;
f << "Procedure: " << __app->errorRoutine[j] << endl;
f << "Error: " << __app->errorMessage[j] << endl;
f << "Procedure: " << s_app->errorRoutine[j] << endl;
f << "Error: " << s_app->errorMessage[j] << endl;
}
f << endl << endl;
__app->errorMessage.clear();
__app->errorRoutine.clear();
s_app->errorMessage.clear();
s_app->errorRoutine.clear();
}
/**
@ -346,7 +346,7 @@ namespace Cantera {
*/
void showErrors() {
appinit();
int i = static_cast<int>(__app->errorMessage.size());
int i = static_cast<int>(s_app->errorMessage.size());
if (i == 0) return;
writelog("\n\n");
writelog("************************************************\n");
@ -355,12 +355,12 @@ namespace Cantera {
int j;
for (j = 0; j < i; j++) {
writelog("\n");
writelog(string("Procedure: ")+ __app->errorRoutine[j]+" \n");
writelog(string("Error: ")+__app->errorMessage[j]+" \n");
writelog(string("Procedure: ")+ s_app->errorRoutine[j]+" \n");
writelog(string("Error: ")+s_app->errorMessage[j]+" \n");
}
writelog("\n\n");
__app->errorMessage.clear();
__app->errorRoutine.clear();
s_app->errorMessage.clear();
s_app->errorRoutine.clear();
}
/**
@ -373,8 +373,8 @@ namespace Cantera {
*/
void setError(string r, string msg) {
appinit();
__app->errorMessage.push_back(msg);
__app->errorRoutine.push_back(r);
s_app->errorMessage.push_back(msg);
s_app->errorRoutine.push_back(r);
}
/// @defgroup inputfiles Input File Handling
@ -411,7 +411,7 @@ namespace Cantera {
*/
void setDefaultDirectories() {
appinit();
vector<string>& dirs = __app->inputDirs;
vector<string>& dirs = s_app->inputDirs;
// always look in the local directory first
dirs.push_back(".");
@ -475,15 +475,15 @@ namespace Cantera {
/// @ingroup inputfiles
void addDirectory(string dir) {
appinit();
if (__app->inputDirs.size() == 0) setDefaultDirectories();
if (s_app->inputDirs.size() == 0) setDefaultDirectories();
string d = stripnonprint(dir);
size_t m, n = __app->inputDirs.size();
size_t m, n = s_app->inputDirs.size();
// don't add if already present
for (m = 0; m < n; m++)
if (d == __app->inputDirs[m]) return;
if (d == s_app->inputDirs[m]) return;
__app->inputDirs.push_back(stripnonprint(dir));
s_app->inputDirs.push_back(stripnonprint(dir));
}
/*!
@ -513,7 +513,7 @@ namespace Cantera {
string::size_type islash = name.find('/');
string::size_type ibslash = name.find('\\');
string inname;
vector<string>& dirs = __app->inputDirs;
vector<string>& dirs = s_app->inputDirs;
if (dirs.size() == 0) setDefaultDirectories();
int nd;
@ -672,8 +672,8 @@ namespace Cantera {
/// @ingroup textlogs
void setLogger(Logger* logwriter) {
appinit();
delete __app->logwriter;
__app->logwriter = logwriter;
delete s_app->logwriter;
s_app->logwriter = logwriter;
}
#ifdef WITH_HTML_LOGS
@ -711,48 +711,48 @@ namespace Cantera {
/// @ingroup HTML_logs
void beginLogGroup(string title, int loglevel) {
appinit();
if (loglevel != -99) __app->loglevel = loglevel;
else __app->loglevel--;
__app->loglevels.push_back(__app->loglevel);
__app->loggroups.push_back(title);
if (__app->loglevel <= 0) return;
if (__app->xmllog == 0) {
__app->xmllog = new XML_Node("html");
__app->current = &__app->xmllog->addChild("ul");
if (loglevel != -99) s_app->loglevel = loglevel;
else s_app->loglevel--;
s_app->loglevels.push_back(s_app->loglevel);
s_app->loggroups.push_back(title);
if (s_app->loglevel <= 0) return;
if (s_app->xmllog == 0) {
s_app->xmllog = new XML_Node("html");
s_app->current = &s_app->xmllog->addChild("ul");
}
__app->current = &__app->current->addChild("li","<b>"+title+"</b>");
__app->current = &__app->current->addChild("ul");
s_app->current = &s_app->current->addChild("li","<b>"+title+"</b>");
s_app->current = &s_app->current->addChild("ul");
}
/// Add an entry to the log file. Entries appear in the form "tag:
/// value".
/// @ingroup HTML_logs
void addLogEntry(string tag, string value) {
if (__app->loglevel > 0)
__app->current->addChild("li",tag+": "+value);
if (s_app->loglevel > 0)
s_app->current->addChild("li",tag+": "+value);
}
/// Add an entry to the log file. Entries appear in the form "tag:
/// value".
/// @ingroup HTML_logs
void addLogEntry(string tag, doublereal value) {
if (__app->loglevel > 0)
__app->current->addChild("li",tag+": "+fp2str(value));
if (s_app->loglevel > 0)
s_app->current->addChild("li",tag+": "+fp2str(value));
}
/// Add an entry to the log file. Entries appear in the form "tag:
/// value".
/// @ingroup HTML_logs
void addLogEntry(string tag, int value) {
if (__app->loglevel > 0)
__app->current->addChild("li",tag+": "+int2str(value));
if (s_app->loglevel > 0)
s_app->current->addChild("li",tag+": "+int2str(value));
}
/// Add an entry to the log file.
/// @ingroup HTML_logs
void addLogEntry(string msg) {
if (__app->loglevel > 0)
__app->current->addChild("li",msg);
if (s_app->loglevel > 0)
s_app->current->addChild("li",msg);
}
/// Close the current group of log messages. This is typically
@ -763,27 +763,27 @@ namespace Cantera {
/// beginLogGroup is called first to create a new group.
/// @ingroup HTML_logs
void endLogGroup(string title) {
if (__app->loglevel > 0) {
__app->current = __app->current->parent();
__app->current = __app->current->parent();
if (s_app->loglevel > 0) {
s_app->current = s_app->current->parent();
s_app->current = s_app->current->parent();
}
__app->loglevels.pop_back();
__app->loglevel = __app->loglevels.back();
if (title != "" && title != __app->loggroups.back()) {
s_app->loglevels.pop_back();
s_app->loglevel = s_app->loglevels.back();
if (title != "" && title != s_app->loggroups.back()) {
writelog("Logfile error."
"\n beginLogGroup: "+ __app->loggroups.back()+
"\n beginLogGroup: "+ s_app->loggroups.back()+
"\n endLogGroup: "+title+"\n");
write_logfile("logerror");
//__app->loggroups.clear();
//__app->loglevels.clear();
//s_app->loggroups.clear();
//s_app->loglevels.clear();
}
else if (__app->loggroups.size() == 1) {
write_logfile(__app->loggroups.back()+"_log");
__app->loggroups.clear();
__app->loglevels.clear();
else if (s_app->loggroups.size() == 1) {
write_logfile(s_app->loggroups.back()+"_log");
s_app->loggroups.clear();
s_app->loglevels.clear();
}
else
__app->loggroups.pop_back();
s_app->loggroups.pop_back();
}
/// Write the HTML log file. Log entries are stored in memory in
@ -796,7 +796,7 @@ namespace Cantera {
/// file will be overwritten. will be appended to the name.
/// @ingroup HTML_logs
void write_logfile(string file) {
if (!__app->xmllog) {
if (!s_app->xmllog) {
return;
}
string::size_type idot = file.rfind('.');
@ -830,15 +830,15 @@ namespace Cantera {
// existing file. Open it as an output stream, and dump the
// XML (HTML) tree to it.
if (__app->xmllog) {
if (s_app->xmllog) {
ofstream f(fname.c_str());
// go to the top of the tree, and write it all.
__app->xmllog->root().write(f);
s_app->xmllog->root().write(f);
f.close();
writelog("Log file " + fname + " written.\n");
delete __app->xmllog;
__app->xmllog = 0;
__app->current = 0;
delete s_app->xmllog;
s_app->xmllog = 0;
s_app->current = 0;
}
}

View file

@ -44,7 +44,7 @@
namespace Cantera {
TransportFactory* TransportFactory::__factory = 0;
TransportFactory* TransportFactory::s_factory = 0;
////////////////////////// exceptions /////////////////////////
@ -268,9 +268,9 @@ namespace Cantera {
* This static function deletes the statically allocated instance.
*/
void TransportFactory::deleteTransportFactory() {
if (__factory) {
delete __factory;
__factory = 0;
if (s_factory) {
delete s_factory;
s_factory = 0;
}
}

View file

@ -91,10 +91,10 @@ namespace Cantera {
* @endcode
*/
static TransportFactory* factory() {
if (!__factory) {
__factory = new TransportFactory();
if (!s_factory) {
s_factory = new TransportFactory();
}
return __factory;
return s_factory;
}
/**
@ -124,7 +124,7 @@ namespace Cantera {
private:
static TransportFactory* __factory;
static TransportFactory* s_factory;
// The constructor is private; use static method factory() to
// get a pointer to a factory instance
@ -191,7 +191,7 @@ namespace Cantera {
}
Transport* ptr = f->newTransport(transportModel, thermo, loglevel);
/*
* Note: We delete the static __factory instance here, instead of in
* Note: We delete the static s_factory instance here, instead of in
* appdelete() in misc.cpp, to avoid linking problems involving
* the need for multiple cantera and transport library statements
* for applications that don't have transport in them.

View file

@ -16,14 +16,14 @@ namespace Cantera {
public:
static Unit* units() {
if (!__u) __u = new Unit;
return __u;
if (!s_u) s_u = new Unit;
return s_u;
}
static void deleteUnit() {
if (__u) {
delete __u;
__u = 0;
if (s_u) {
delete s_u;
s_u = 0;
}
}
@ -119,7 +119,7 @@ namespace Cantera {
private:
/// pointer to the single instance of Unit
static Unit* __u;
static Unit* s_u;
map<string, doublereal> m_u;
map<string, doublereal> m_act_u;

View file

@ -73,9 +73,9 @@ namespace Cantera {
/**
* Inner product.
*/
template<class _InputIter, class _InputIter2>
inline doublereal dot(_InputIter x_begin, _InputIter x_end,
_InputIter2 y_begin) {
template<class InputIter, class InputIter2>
inline doublereal dot(InputIter x_begin, InputIter x_end,
InputIter2 y_begin) {
doublereal sum = 0.0;
for(; x_begin != x_end; ++x_begin, ++y_begin)
sum += *x_begin * *y_begin;
@ -89,26 +89,26 @@ namespace Cantera {
* scale(in.begin(), in.end(), out.begin(), factor);
* \endcode
*/
template<class _InputIter, class _OutputIter, class S>
inline void scale(_InputIter __begin, _InputIter __end,
_OutputIter __out, S scale_factor) {
for (; __begin != __end; ++__begin, ++__out)
*__out = scale_factor * *__begin;
template<class InputIter, class OutputIter, class S>
inline void scale(InputIter begin, InputIter end,
OutputIter out, S scale_factor) {
for (; begin != end; ++begin, ++out)
*out = scale_factor * *begin;
}
template<class _InputIter, class _OutputIter, class S>
inline void increment_scale(_InputIter __begin, _InputIter __end,
_OutputIter __out, S scale_factor) {
for (; __begin != __end; ++__begin, ++__out)
*__out += scale_factor * *__begin;
template<class InputIter, class OutputIter, class S>
inline void increment_scale(InputIter begin, InputIter end,
OutputIter out, S scale_factor) {
for (; begin != end; ++begin, ++out)
*out += scale_factor * *begin;
}
/**
* Multiply each entry in x by the corresponding entry in y.
*/
template<class _InputIter, class _OutputIter>
inline void multiply_each(_OutputIter x_begin, _OutputIter x_end,
_InputIter y_begin) {
template<class InputIter, class OutputIter>
inline void multiply_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin) {
for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin *= *y_begin;
}
@ -116,47 +116,47 @@ namespace Cantera {
/**
* Invoke method 'resize' with argument \a m for a sequence of objects.
*/
template<class _InputIter>
inline void _resize_each(int m, _InputIter __begin, _InputIter __end) {
for(; __begin != __end; ++__begin) __begin->resize(m);
template<class InputIter>
inline void resize_each(int m, InputIter begin, InputIter end) {
for(; begin != end; ++begin) begin->resize(m);
}
/**
* The maximum absolute value.
*/
template<class _InputIter>
inline doublereal absmax(_InputIter __begin, _InputIter __end) {
template<class InputIter>
inline doublereal absmax(InputIter begin, InputIter end) {
doublereal amax = 0.0;
for(; __begin != __end; ++__begin)
if (fabs(*__begin) > amax) amax = fabs(*__begin);
for(; begin != end; ++begin)
if (fabs(*begin) > amax) amax = fabs(*begin);
return amax;
}
/**
* Normalize the values in a sequence, such that they sum to 1.0.
*/
template<class _InputIter, class _OutputIter>
inline void normalize(_InputIter __begin, _InputIter __end,
_OutputIter __out) {
doublereal sum = accumulate(__begin, __end, 0.0);
for (; __begin != __end; ++__begin, ++__out) *__out = *__begin/sum;
template<class InputIter, class OutputIter>
inline void normalize(InputIter begin, InputIter end,
OutputIter out) {
doublereal sum = accumulate(begin, end, 0.0);
for (; begin != end; ++begin, ++out) *out = *begin/sum;
}
/**
* Divide each element of \a x by the corresponding element of \a y.
*/
template<class _InputIter, class _OutputIter>
inline void divide_each(_OutputIter x_begin, _OutputIter x_end,
_InputIter y_begin) {
template<class InputIter, class OutputIter>
inline void divide_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin) {
for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin /= *y_begin;
}
/**
* Increment each entry in \a x by the corresponding entry in \a y.
*/
template<class _InputIter, class _OutputIter>
inline void sum_each(_OutputIter x_begin, _OutputIter x_end,
_InputIter y_begin) {
template<class InputIter, class OutputIter>
inline void sum_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin) {
for(; x_begin != x_end; ++x_begin, ++y_begin) *x_begin += *y_begin;
}
@ -169,14 +169,14 @@ namespace Cantera {
* index[0] = 9;
* index[1] = 2;
* index[3] = 16;
* _scatter_copy(x.begin(), x.end(), y.begin(), index.begin());
* scatter_copy(x.begin(), x.end(), y.begin(), index.begin());
* \endcode
*/
template<class _InputIter, class _OutputIter, class _IndexIter>
inline void _scatter_copy(_InputIter __begin, _InputIter __end,
_OutputIter __result, _IndexIter __index) {
for (; __begin != __end; ++__begin, ++__index) {
*(__result + *__index) = *__begin;
template<class InputIter, class OutputIter, class IndexIter>
inline void scatter_copy(InputIter begin, InputIter end,
OutputIter result, IndexIter index) {
for (; begin != end; ++begin, ++index) {
*(result + *index) = *begin;
}
}
@ -190,16 +190,16 @@ namespace Cantera {
* vector_fp data(20);
* ...
* // multiply elements 7, 4, and 13 in data by multipliers
* _scatter_mult(multipliers, multipliers + 3, data.begin(),
* scatter_mult(multipliers, multipliers + 3, data.begin(),
* index);
* \endcode
*/
template<class _InputIter, class _RandAccessIter, class _IndexIter>
inline void _scatter_mult(_InputIter __mult_begin, _InputIter __mult_end,
_RandAccessIter __data, _IndexIter __index) {
for (; __mult_begin != __mult_end; ++__mult_begin, ++__index) {
*(__data + *__index) *= *__mult_begin;
template<class InputIter, class RandAccessIter, class IndexIter>
inline void scatter_mult(InputIter mult_begin, InputIter mult_end,
RandAccessIter data, IndexIter index) {
for (; mult_begin != mult_end; ++mult_begin, ++index) {
*(data + *index) *= *mult_begin;
}
}
@ -213,15 +213,15 @@ namespace Cantera {
* vector_fp data(20);
* ...
* // divide elements 7, 4, and 13 in data by divisors
* _scatter_divide(divisors, divisors + 3, data.begin(),
* scatter_divide(divisors, divisors + 3, data.begin(),
* index);
* \endcode
*/
template<class _InputIter, class _OutputIter, class _IndexIter>
inline void _scatter_divide(_InputIter __begin, _InputIter __end,
_OutputIter __result, _IndexIter __index) {
for (; __begin != __end; ++__begin, ++__index) {
*(__result + *__index) /= *__begin;
template<class InputIter, class OutputIter, class IndexIter>
inline void scatter_divide(InputIter begin, InputIter end,
OutputIter result, IndexIter index) {
for (; begin != end; ++begin, ++index) {
*(result + *index) /= *begin;
}
}
@ -229,11 +229,11 @@ namespace Cantera {
* Compute \f[ \sum_k x_k \log x_k. \f]. A small number (1.0E-20)
* is added before taking the log.
*/
template<class _InputIter>
inline doublereal _sum_xlogx(_InputIter __begin, _InputIter __end) {
template<class InputIter>
inline doublereal sum_xlogx(InputIter begin, InputIter end) {
doublereal sum = 0.0;
for (; __begin != __end; ++__begin) {
sum += (*__begin) * log(*__begin + Tiny);
for (; begin != end; ++begin) {
sum += (*begin) * log(*begin + Tiny);
}
return sum;
}
@ -242,12 +242,12 @@ namespace Cantera {
* Compute \f[ \sum_k x_k \log Q_k. \f]. A small number (1.0E-20)
* is added before taking the log.
*/
template<class _InputIter1, class _InputIter2>
inline doublereal _sum_xlogQ(_InputIter1 __begin, _InputIter1 __end,
_InputIter2 _Q_begin) {
template<class InputIter1, class InputIter2>
inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end,
InputIter2 Q_begin) {
doublereal sum = 0.0;
for (; __begin != __end; ++__begin, ++_Q_begin) {
sum += (*__begin) * log(*_Q_begin + Tiny);
for (; begin != end; ++begin, ++Q_begin) {
sum += (*begin) * log(*Q_begin + Tiny);
}
return sum;
}

View file

@ -72,7 +72,7 @@ namespace Cantera {
*/
template<class T>
inline doublereal dot_ratio(const T& x, const T& y) {
return __dot_ratio(x.begin(), x.end(), y.begin(), 0.0);
return _dot_ratio(x.begin(), x.end(), y.begin(), 0.0);
}
/**
@ -84,11 +84,11 @@ namespace Cantera {
x.begin(), plus<TYPENAME_KEYWORD T::value_type>());
}
template<class _InputIter, class S>
inline doublereal __dot_ratio(_InputIter __x_begin, _InputIter __x_end,
_InputIter __y_begin, S start_value) {
for (; __x_begin != __x_end; ++__x_begin, ++__y_begin)
start_value += *__x_begin / *__y_begin;
template<class InputIter, class S>
inline doublereal _dot_ratio(InputIter x_begin, InputIter x_end,
InputIter y_begin, S start_value) {
for (; x_begin != x_end; ++x_begin, ++y_begin)
start_value += *x_begin / *y_begin;
return start_value;
}

View file

@ -48,7 +48,7 @@ CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx
CANTERA_INCDIR=@ctroot@/build/include/cantera
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# How to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:

View file

@ -49,7 +49,7 @@ CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx
CANTERA_INCDIR=@ctroot@/build/include/cantera
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@: Interface.h

View file

@ -5,7 +5,7 @@ INCDIR = -I@ctroot@/Cantera/src
BINDIR = @buildbin@
build_ck = @BUILD_CK@
LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
LOCAL_LIBS = -lcantera -ltpx -lctcxx
#LOCAL_LIBS = -lcantera @math_libs@ @BLAS_LAPACK_LIBS@ -lctcxx

View file

@ -57,7 +57,7 @@ CANTERA_LIBS = -lct -lcantera -lckreader
CANTERA_INCDIR=@CANTERA_INCDIR@
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:

View file

@ -53,7 +53,7 @@ CANTERA_LIBS =
CANTERA_INCDIR=@CANTERA_INCDIR@
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:

View file

@ -60,7 +60,7 @@ CANTERA_LIBS = -lctf -lcantera -lckreader
CANTERA_INCDIR=@CANTERA_INCDIR@
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:

View file

@ -5,7 +5,7 @@ INCDIR = @ctroot@/build/include/cantera
BINDIR = @ctroot@/bin
build_ck = @BUILD_CK@
LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
LOCAL_LIBS = -lcantera -lckreader @math_libs@ @LAPACK_LIBRARY@ @BLAS_LIBRARY@ -lctcxx
LCXX_END_LIBS = @LCXX_END_LIBS@