22#include "../gui/terminal/terminal.hpp"
26#define KERNEL_PRINT_SLEEP 2
27#define TERMINAL_FORMAT_FIELD_LENOFFSET 16
28#define DEFAULT_NUM_PRECISION 7
29#define DEFAULT_MINMAX_PRECISION 5
151 std::string sLogFile =
"numere.log";
152 std::string sPath = __sPath;
161 while (sPath.find(
'\\') != std::string::npos)
162 sPath[sPath.find(
'\\')] =
'/';
605 std::string sLine_Temp =
"";
607 std::string sKeep =
"";
608 std::string sLine =
"";
609 std::string sCurrentCommand =
"";
610 std::queue<std::string> emptyQueue;
731 if ((sLine.substr(0, 2) ==
"|>" || nDebuggerCode ==
DEBUGGER_STEP)
736 if (sLine.substr(0, 2) ==
"|>")
755 GetAsyncKeyState(VK_ESCAPE);
807 if (
findCommand(sLine,
"explicit").sString ==
"explicit")
809 sLine.erase(
findCommand(sLine,
"explicit").nPos, 8);
818 || sCurrentCommand ==
"help"
819 || sCurrentCommand ==
"man"
820 || sCurrentCommand ==
"quit"
821 || sCurrentCommand ==
"list"
822 || sCurrentCommand ==
"find"
823 || sCurrentCommand ==
"search")
904 if (sLine.find(
"??") != std::string::npos)
907 bool bWriteToCache =
false;
908 bool bWriteToCluster =
false;
917 if (sCache.length() && sCache.find(
'#') == std::string::npos)
918 bWriteToCache =
true;
921 bWriteToCache =
true;
924 while (sLine.find(
":=") != std::string::npos)
926 sLine.erase(sLine.find(
":="), 1);
950 if (sCache[sCache.find_first_of(
"({")] ==
'{')
952 bWriteToCluster =
true;
961 sCache.erase(sCache.find_first_of(
"({"));
994 unsigned int nErrorPos = e.
GetPos();
1015 if (nErrorPos < e.
GetExpr().length())
1017 if (e.
GetExpr().length() > 63 && nErrorPos > 31 && nErrorPos < e.
GetExpr().length() - 32)
1022 else if (nErrorPos < 32)
1024 std::string sErrorExpr =
"| Position: '";
1025 if (e.
GetExpr().length() > 63)
1026 sErrorExpr += e.
GetExpr().substr(0, 60) +
"...'";
1028 sErrorExpr += e.
GetExpr() +
"'";
1032 else if (nErrorPos > e.
GetExpr().length() - 32)
1034 std::string sErrorExpr =
"| Position: '";
1035 if (e.
GetExpr().length() > 63)
1057 catch (
const std::bad_alloc& e)
1077 catch (
const std::exception& e)
1133 if (sErrLine_0.substr(0, 7) ==
"ERR_NR_")
1136 sErrLine_1 =
_lang.
get(
"ERR_GENERIC_1");
1137 sErrIDString =
"ERR_GENERIC";
1141 if (e.getExpr().length())
1150 if (e.getExpr().length() > 63 && e.getPosition() > 31 && e.getPosition() < e.getExpr().length() - 32)
1152 printPreFmt(
"| Position: '..." + e.getExpr().substr(e.getPosition() - 29, 57) +
"...'\n");
1155 else if (e.getPosition() < 32)
1157 std::string sErrorExpr =
"| Position: '";
1158 if (e.getExpr().length() > 63)
1159 sErrorExpr += e.getExpr().substr(0, 60) +
"...'";
1161 sErrorExpr += e.getExpr() +
"'";
1165 else if (e.getPosition() > e.getExpr().length() - 32)
1167 std::string sErrorExpr =
"| Position: '";
1168 if (e.getExpr().length() > 63)
1170 printPreFmt(sErrorExpr +
"..." + e.getExpr().substr(e.getExpr().length() - 60) +
"'\n");
1273 for (
unsigned int i = 0; i < sLine.length(); i++)
1275 if (sLine[i] ==
'\t')
1280 if (!sLine.length() || sLine[0] ==
'@')
1286 sLine = sLine.substr(
findCommand(sLine).nPos + 6);
1291 if (sLine.length() > 2)
1293 if (sLine.substr(sLine.length() - 2, 2) ==
"\\\\")
1296 sKeep += sLine.substr(0, sLine.length() - 2);
1315 && (sLine.find(
'(') != std::string::npos || sLine.find(
'{') != std::string::npos))
1339 if ((
commandQueue.size() || sLine.find(
';') != std::string::npos)
1348 if (sLine.back() ==
';')
1356 else if (sLine.find(
';') == sLine.length() - 1)
1368 for (
const auto& expr : expressions)
1373 if (sLine.back() !=
';')
1378 if (sLine.back() ==
';')
1388 return sLine.length() != 0;
1408 if ((sCurrentCommand ==
"compose"
1409 || sCurrentCommand ==
"endcompose"
1412 && sCurrentCommand !=
"quit"
1413 && sCurrentCommand !=
"help")
1472 else if (
findCommand(sLine).sString !=
"endcompose")
1476 if (sCommand.substr(0, 4) ==
"plot"
1477 || sCommand.substr(0, 7) ==
"subplot"
1478 || sCommand.substr(0, 4) ==
"grad"
1479 || sCommand.substr(0, 4) ==
"dens"
1480 || sCommand.substr(0, 4) ==
"draw"
1481 || sCommand.substr(0, 4) ==
"vect"
1482 || sCommand.substr(0, 4) ==
"cont"
1483 || sCommand.substr(0, 4) ==
"surf"
1484 || sCommand.substr(0, 4) ==
"mesh")
1611 if (sCurrentCommand ==
"uninstall")
1619 if (sPlugin.length())
1621 if (sPlugin !=
"<<NO_HLP_ENTRY>>")
1623 while (sPlugin.find(
';') != std::string::npos)
1624 sPlugin[sPlugin.find(
';')] =
',';
1626 while (sPlugin.length())
1662 unsigned int nPos = 0;
1665 while (sLine.find(
"to_cmd(", nPos) != std::string::npos)
1667 nPos = sLine.find(
"to_cmd(", nPos) + 6;
1671 if (nParPos == std::string::npos)
1673 std::string sCmdString = sLine.substr(nPos + 1, nParPos - 1);
1679 sCmdString +=
" -nq";
1683 sLine = sLine.substr(0, nPos - 6) + sCmdString + sLine.substr(nPos + nParPos + 1);
1707 unsigned int nPos = 0;
1711 while (sLine.find(
'$', nPos) != std::string::npos && sLine.find(
'(', sLine.find(
'$', nPos)) != std::string::npos)
1713 unsigned int nParPos = 0;
1714 nPos = sLine.find(
'$', nPos) + 1;
1717 std::string __sName = sLine.substr(nPos, sLine.find(
'(', nPos) - nPos);
1718 std::string __sVarList =
"";
1720 if (sLine[nPos] ==
'\'')
1723 __sName = sLine.substr(nPos + 1, sLine.find(
'\'', nPos + 1) - nPos - 1);
1724 nParPos = sLine.find(
'(', nPos + 1 + __sName.length());
1727 nParPos = sLine.find(
'(', nPos);
1729 __sVarList = sLine.substr(nParPos);
1739 sLine = sLine.substr(0, nPos - 1) + sLine.substr(nParPos + 1);
1748 nPos += __sName.length() + __sVarList.length() + 1;
1753 if (!sLine.length())
1756 else if (sLine.find(
'$') != std::string::npos && sLine.find(
'(', sLine.find(
'$')) == std::string::npos)
1760 size_t i = sLine.find(
'$');
1765 bool isnotinquotes =
true;
1770 if (sLine.find(
'$', i + 1) != std::string::npos)
1771 i = sLine.find(
'$', i + 1);
1774 isnotinquotes =
false;
1814 if (_rTemp.
isString() && sLine.find(
"<<RETURNVAL>>") != std::string::npos)
1816 std::string sReturn =
"{";
1817 for (
unsigned int v = 0; v < _rTemp.
vStringVal.size(); v++)
1819 sReturn.back() =
'}';
1820 sLine.replace(sLine.find(
"<<RETURNVAL>>"), 13, sReturn);
1824 std::string sTargetTable = sLine.substr(0, sLine.find(
"<<RETURNVAL>>"));
1826 if (sTargetTable.find(
'=') != std::string::npos)
1827 sTargetTable.erase(sTargetTable.find_last_not_of(
" ="));
1831 if (sTargetTable.find(
'(') != std::string::npos
1832 && sTargetTable.substr(sTargetTable.find(
'(')) ==
"()"
1833 && sLine.substr(sLine.find(
"<<RETURNVAL>>")+13).find_first_not_of(
" ;") == std::string::npos)
1835 sTargetTable.erase(sTargetTable.find(
'('));
1853 + sLine.substr(sLine.find(
"<<RETURNVAL>>")+13);
1863 else if (_rTemp.
isNumeric() && sLine.find(
"<<RETURNVAL>>") != std::string::npos)
1869 if (!sLine.length())
1968 else if (sCurrentCommand ==
"return")
2033#warning NOTE (erik.haenel#3#): This is changed due to double writes in combination with c{nlen+1} = VAL
2037 if (sCache.length())
2039 bWriteToCache =
false;
2082 std::queue<std::string> emptyQueue;
2116 greetingsDB.
addData(
"<>/user/docs/greetings.ndb");
2118 if (!greetingsDB.
size())
2119 return "|-> ERROR: GREETINGS FILE IS EMPTY.\n";
2155 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2267 printPreFmt(
"NUMERE: FRAMEWORK FÜR NUMERISCHE RECHNUNGEN");
2283 std::map<std::string, std::string> mPluginLangStrings;
2293 return mPluginLangStrings;
2308 std::map<std::string, std::string> mFunctionLangStrings;
2312 while (sDesc.find(
"\\\"") != std::string::npos)
2313 sDesc.erase(sDesc.find(
"\\\""), 1);
2317 return mFunctionLangStrings;
2331 std::vector<std::string> vPluginCommands;
2339 return vPluginCommands;
2404 return toString(bytes / 1024.0, 5) +
" MBytes";
2406 return toString(bytes, 5) +
" KBytes";
2409 return toString(bytes, 5) +
" Bytes";
2430 std::string sCurrentLine;
2433 tablemap[
"string"] = std::pair<size_t,size_t>(-1, -1);
2436 for (
auto iter = varmap.begin(); iter != varmap.end(); ++iter)
2438 if ((iter->first).substr(0, 2) ==
"_~")
2441 if ((*iter->second).imag() && !(
isnan((*iter->second).real()) &&
isnan((*iter->second).imag())))
2452 for (
auto iter = stringmap.begin(); iter != stringmap.end(); ++iter)
2454 if ((iter->first).substr(0, 2) ==
"_~")
2457 sCurrentLine = iter->first
2458 +
"\t1 x 1\tstring\t"
2467 for (
auto iter = tablemap.begin(); iter != tablemap.end(); ++iter)
2469 if ((iter->first).substr(0, 2) ==
"_~")
2472 if (iter->first ==
"string")
2489 for (
auto iter = clustermap.begin(); iter != clustermap.end(); ++iter)
2491 if ((iter->first).substr(0, 2) ==
"_~")
2494 sCurrentLine = iter->first +
"{}\t" +
toString(iter->second.size()) +
" x 1";
2496 +
"\t" + iter->first +
"{}\t" +
formatByteSize(iter->second.getBytes());
2533 std::vector<std::string> vPaths;
2598 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2615 for (
size_t i = 0; i < sLine.length(); i++)
2617 if (sLine[i] ==
'$' && (!i || sLine[i - 1] !=
'\\'))
2618 sLine.insert(i, 1,
'\\');
2642 std::string sLine = __sLine;
2646 if (sLine.front() ==
'\r')
2647 sLine.insert(1, 1, (
char)15);
2649 sLine.insert(0, 1, (
char)15);
2651 for (
size_t i = 0; i < sLine.length(); i++)
2653 if (i < sLine.length() - 2 && sLine[i] ==
'\n')
2654 sLine.insert(i + 1, 1, (
char)15);
2668 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2689 std::string sLine = __sLine;
2693 if (sLine.front() ==
'\r')
2694 sLine.insert(1, 1, (
char)15);
2696 sLine.insert(0, 1, (
char)15);
2698 for (
size_t i = 0; i < sLine.length(); i++)
2700 if (i < sLine.length() - 2 && sLine[i] ==
'\n')
2701 sLine.insert(i + 1, 1, (
char)15);
2715 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2740 std::string sAns =
"ans = {";
2743 for (
int i = 0; i < nNum; ++i)
2750 if (nNum + 1 > nLineBreak && !((i + 1) % nLineBreak) && i < nNum - 1)
2785 if (vStringResults.size() > 1)
2791 std::string sAns =
"ans = {";
2792 size_t nNum = vStringResults.size();
2795 for (
size_t i = 0; i < nNum; ++i)
2802 if (nNum + 1 > nLineBreak && !((i + 1) % nLineBreak) && i < nNum - 1)
2815 return "ans = " + vStringResults.front();
2852 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2884 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
2933static std::string
drawBar(
int nValue,
size_t nLength,
const std::string& sProgressChar,
const std::string& sWhitespaceChar)
2935 return "[" +
strfill(sProgressChar, nValue, sProgressChar[0]) +
strfill(sWhitespaceChar, nLength - nValue, sWhitespaceChar[0]) +
"]";
2953 const int BARLENGTH = 40;
2954 const double BARDIVISOR = 2.5;
2955 int nDistance =
std::abs(nFinalStep - nFirstStep);
2956 double dRatio =
std::abs(nStep - nFirstStep) / (double)nDistance;
2960 if (nDistance < 9999
2961 && dRatio * BARLENGTH >
std::abs((nStep - 1 - nFirstStep) / (
double)nDistance * BARLENGTH))
2962 nStatusVal =
intCast(dRatio * BARLENGTH) * BARDIVISOR;
2963 else if (nDistance >= 9999
2964 && dRatio * 100 >
std::abs((nStep - 1 - nFirstStep) / (
double)nDistance * 100))
2965 nStatusVal =
intCast(dRatio * 100);
2980 else if (sType ==
"cancel")
2986 else if (sType ==
"bar")
2992 else if (sType ==
"bcancel")
3003 std::string sLine =
"\r|";
3008 for (
unsigned int i = 0; i < sType.length(); i++)
3011 if (sType.substr(i, 5) ==
"<bar>")
3013 sLine +=
drawBar(
intCast(100*dRatio/BARDIVISOR), BARLENGTH,
"#",
" ");
3020 if (sType.substr(i, 5) ==
"<Bar>")
3022 sLine +=
drawBar(
intCast(100*dRatio/BARDIVISOR), BARLENGTH,
"#",
"-");
3029 if (sType.substr(i, 5) ==
"<BAR>")
3031 sLine +=
drawBar(
intCast(100*dRatio/BARDIVISOR), BARLENGTH,
"#",
"=");
3038 if (sType.substr(i, 5) ==
"<val>")
3047 if (sType.substr(i, 5) ==
"<Val>")
3056 if (sType.substr(i, 5) ==
"<VAL>")
3076 if (nFinalStep == nStep)
3116 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3140 task.
sString = _sDocumentation;
3147 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3175 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3202 task.
table = _table;
3214 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3253 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3285 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3304 bool bHasTable =
false;
3305 bool bWasCanceled =
false;
3318 while (!bHasTable && !bWasCanceled);
3337 std::string sSelectedTable = sTableName;
3339 if (sSelectedTable.find(
"()") != std::string::npos)
3340 sSelectedTable.erase(sSelectedTable.find(
"()"));
3359 if (sStringTableName ==
"string()")
3380 for (
size_t i = 0; i < clust.
size(); i++)
3426 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3445 int nDebuggerCode = 0;
3458 while (!nDebuggerCode);
3461 return nDebuggerCode;
3480 std::map<std::string, std::pair<std::string, mu::value_type*>> mLocalVars;
3481 std::map<std::string, std::pair<std::string, std::string>> mLocalStrings;
3482 std::map<std::string, std::string> mLocalTables;
3483 std::map<std::string, std::string> mLocalClusters;
3484 std::map<std::string, std::string> mArguments;
3493 for (
auto iter : varmap)
3495 if (iter.first.substr(0, 2) !=
"_~")
3496 mLocalVars[iter.first] = std::make_pair(iter.first, iter.second);
3502 for (
const auto& iter : sStringMap)
3504 if (iter.first.substr(0, 2) !=
"_~")
3505 mLocalStrings[iter.first] = std::make_pair(iter.first, iter.second);
3512 tableMap[
"string"] = std::pair<size_t, size_t>(-1, -1);
3514 for (
const auto& iter : tableMap)
3515 mLocalTables[iter.first] = iter.first;
3520 for (
const auto& iter : clusterMap)
3522 if (iter.first.substr(0, 2) !=
"_~")
3523 mLocalClusters[iter.first] = iter.first;
3561 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3608 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3635 bool bgotline =
false;
3689 wxQueueEvent(
m_parent->GetEventHandler(),
new wxThreadEvent());
3724 else if (nLength < -1)
CommandReturnValues commandHandler(string &sCmd)
This function is the main command handling function.
@ COMMAND_HAS_RETURNVALUE
void enable(const std::string &sExpr)
Enables the assertion handler using the passed expression.
void reset()
Resets the assertion handler.
void resetStats()
Resets the internal statistic variables for accumulating the total number of executed and the number ...
void checkAssertion(mu::value_type *v, int nNum)
Checks the return value of a muParser evaluated result.
bool open(const std::string &sLogFile)
Open the log file and push the buffered messages directly to this file.
void info(const std::string &sMessage)
Convenience member function.
void warning(const std::string &sMessage)
Convenience member function.
void debug(const std::string &sMessage)
Convenience member function.
void error(const std::string &sMessage)
Convenience member function.
void setLoggingLevel(Logger::LogLevel lvl)
Change the logging level or completely disable the logger.
void cmdline(const std::string &sMessage)
Convenience member function.
void removeFromDocIndex(const std::string &_sID)
This member function removes the index entry passed to the function from the documentation index.
void createDocumentationIndex(bool bLoadUserLangFiles=true)
This member function loads the index files to memory.
std::vector< std::string > getDocIndex() const
This member function returns the key list for the documentation index prepared for the corresponding ...
This class extends the std::vector for endlessness.
std::string getProgramPath() const
std::string getPath() const
Returns the default path of this FileSystem instance.
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
void setTokens(std::string _sTokens)
This member function may be used to update the path placeholders of the current FileSystem instance.
void createRevisionsFolder()
This member function creates the hidden revisions folders for the version control system.
int setPath(std::string _sPath, bool bMkDir, std::string _sExePath)
This member function may be used to set the preferred file path of the current FileSystem instance.
int getCurrentBlockDepth() const
Returns the current block depth while reading a flow control statement to memory.
bool getReturnSignal() const
static bool isFlowCtrlStatement(const std::string &sCmd)
This static member function returns whether the passed command is a flow control statement.
void setCommand(std::string &__sCmd, int nCurrentLine)
This member function is used to set a command line from the outside into the flow control statement c...
std::string getCurrentBlock() const
void reset()
This function clears the memory of this FlowCtrl object and sets everything back to its original stat...
std::string getFunctionSignature(size_t _i) const
Returns the function signature of the ith defined custom function.
void setPredefinedFuncs(const std::string &sPredefined)
This member function updates the internal list of predefined functions. If the list is whitespace-sep...
std::string getPredefinedFuncs() const
Return a list of the internal defined default functions.
std::string getComment(size_t _i) const
Returns the comment of the ith defined function.
bool call(std::string &sExpr, int nRecursion=0)
This function searches for known custom definitions in the passed expression and replaces them with t...
bool load(const Settings &_option, bool bAutoLoad=false)
This function loads previously saved function definitions to memory.
bool save(const Settings &_option)
This function saves the function definitions to the definition file.
size_t getDefinedFunctions() const
Returns the number of defined functions.
This class handles the internal language system and returns the language strings of the selected lang...
void addToLanguage(const std::map< std::string, std::string > &_langstrings)
This member function adds the contents of the passed language file into the internal map.
void loadStrings(bool bloadUserFiles=true)
This member function loads the language files to the internal map and replaces the named tokens with ...
std::string getKey(const std::string &sMessage) const
This member function searches the internal language map for an identifier, which starts similar with ...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
bool saveToCacheFile()
This member function saves the contents of this class to the cache file so that they may be restored ...
mu::value_type tableLinesCount
bool getSaveStatus() const
Returns, whether there's at least a single table in memory, which has not been saved yet.
mu::value_type tableColumnsCount
std::vector< mu::value_type > min(const std::string &sTable, std::string sDir) const
void removeTablesFromMemory()
Removes all tables in memory and re- initializes the MemoryManager with the default table.
void copyTable(const std::string &source, const std::string &target)
Copy one table to another one (and create the missing table automatically, if needed).
int getLines(StringView sTable, bool _bFull=false) const
const std::map< std::string, std::pair< size_t, size_t > > & getTableMap() const
bool isEmpty(const std::string &sTable) const
bool isTable(const std::string &sTable) const
This member function returns, whether the passed table name corresponds to a known table.
void swapTables(std::string sTable1, std::string sTable2)
bool deleteTable(const std::string &sCache)
This member function removes the selected table.
NumeRe::Table extractTable(const std::string &_sTable, const VectorIndex &lines=VectorIndex(0, VectorIndex::OPEN_END), const VectorIndex &cols=VectorIndex(0, VectorIndex::OPEN_END))
void setPredefinedFuncs(const std::string &sFuncs)
std::vector< mu::value_type > max(const std::string &sTable, std::string sDir) const
void renameTable(const std::string &sCache, const std::string &sNewName, bool bForceRenaming=false)
bool containsTablesOrClusters(const std::string &sCmdLine)
This member function evaluates, whether the passed command line contains tables or clusters.
void writeToTable(int _nLine, int _nCol, const std::string &_sCache, const mu::value_type &_dData)
bool loadFromCacheFile()
This member function wraps the loading of the tables from the cache file. It will automatically detec...
int getBytes(const std::string &sTable) const
int getCols(StringView sTable, bool _bFull=false) const
void setPluginCommands(const std::string &sPluginCmds)
This class represents a whole cluster. The single items are stored as pointers to the abstract cluste...
size_t size() const
This member function returns the size of the internal memory buffer as items.
std::string getString(size_t i) const
This member function returns the data of the i-th cluster item in memory as a string.
void setDouble(size_t i, const mu::value_type &value)
This member function assigns a value as data for the i-th cluster item in memory. The type of the i-t...
void assignResults(Indices _idx, int nNum, mu::value_type *data)
This member function assigns calculation results as data for the cluster items in memory,...
void setDoubleArray(const std::vector< mu::value_type > &vVals)
This member function assigns values as data for the all cluster items in memory. The type of the clus...
mu::value_type getDouble(size_t i) const
This member function returns the data of the i-th cluster item in memory as a value.
unsigned short getType(size_t i) const
This member function returns the type of the i-th cluster item in the internal memory buffer.
void removeTemporaryClusters()
This member function returns all temporary clusters from the internal map. Temporary clusters are ind...
mu::value_type dClusterElementsCount
Cluster & getCluster(StringView sCluster)
This member function returns a reference to the cluster indicated by the passed cluster identifier.
Cluster & newCluster(const std::string &sCluster)
This member function creates a new cluster from the passed cluster identifier and returns a reference...
bool isCluster(StringView sCluster) const
This member function returns true, if the passed cluster identifier can be found in the internal map.
const std::map< std::string, Cluster > & getClusterMap() const
void set(size_t row, size_t col, T val)
This class is an implementation of a database. It will handle the *.ndb data format an provides an in...
std::string getElement(size_t i, size_t j) const
This member function will return the contents of the selected database field, or an empty string,...
size_t randomRecord() const
This member function can be used to select and random record.
void addData(const std::string &sDataBaseFile)
This member function will use the passed database file name to update its internal contents (i....
void setSavePath(const std::string &_sPath)
This function may be used to update the target saving path of this class.
void setbLoadEmptyCols(bool _bLoadEmptyCols)
Set, whether empty columns shall be loaded.
virtual bool isStringExpression(const std::string &sExpression) override
Returns true, if the passed expression is an expression containing strings, string variables or strin...
StringParserRetVal evalAndFormat(std::string &sLine, std::string &sCache, bool bSilent=false, bool bCheckAssertions=false)
This public member function evaluates the passed string expression and formats the results for the co...
void removeTempStringVectorVars()
This member function removes all temporary string vector variables.
const std::map< std::string, std::string > & getStringVars() const
This data container is a copy- efficient table to interchange data between Kernel and GUI.
This class represents an abstract window handled by the window manager.
void gatherInformations(ProcedureVarFactory *_varFactory, const std::string &_sErraticCommand, const std::string &_sErraticModule, unsigned int _nLineNumber)
This member function gathers all information from the current workspace and stores them internally to...
int showBreakPoint()
This member function shows the debugger for the current breakpoint and returns the debugger code (i....
void setActive(bool active)
This class provides the interface to the core of NumeRe. It provides all functionalities,...
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
static ProcedureLibrary ProcLibrary
static int evalDebuggerBreakPoint(const std::string &sCurrentCommand="")
This member function handles the creation of the debugger information for a script debugger breakpoin...
std::string maskProcedureSigns(std::string sLine)
This member function masks the dollar signs in the strings to avoid that the line breaking functions ...
FunctionDefinitionManager _functions
std::map< std::string, std::string > getPluginLanguageStrings()
This member function returns a map of language strings for the installed plugins, which will be used ...
NumeRe::StringParser & getStringParser()
static void getline(std::string &sLine)
This function is an implementation replacing the std::getline() function.
Settings getKernelSettings()
Get the settings available in the Settings class.
static bool bSupressAnswer
bool handleCommandLineSource(std::string &sLine, std::string &sKeep)
This private member function will handle the command line input source and validate it,...
std::string ReadAnswer()
This member function is a simple wrapper to read the kernel answer and reset it automatically.
bool handleProcedureWrite(const std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle the writing of procedure lines to the corresponding file.
static NumeReKernel * kernelInstance
void closeWindows(int type)
This member function informs the GUI to close all windows of the selected type. Use 0 or WT_ALL to cl...
bool evaluateStrings(std::string &sLine, std::string &sCache, bool &bWriteToCache, KernelStatus &nReturnVal)
This private member function redirects the processing of strings to the string parser.
std::vector< std::string > getDocIndex()
This member function returns the documentation index as a string vector, which can be used to fill th...
static NumeRe::Table getTable()
This member function is used by the kernel to be notified when the user finished the table edit proce...
void defineConst()
This member function declares all numerical constants.
bool uninstallPlugin(const std::string &sLine, const std::string &sCurrentCommand)
This private member function uninstalls a previously installed plugin.
void updateLineLenght(int nLength)
This member function is used to update the internal terminal line length information after the termin...
static void printPreFmt(const std::string &__sLine, bool printingEnabled=true)
This member function appends the pre- formatted string to the buffer and informs the terminal that we...
bool SettingsModified()
Returns true, if the user changed any internal settings using the set command.
static std::queue< NumeReTask > taskQueue
static int nLastStatusVal
std::vector< std::string > getPluginCommands()
This member function is used by the syntax highlighter to hightlight the plugin commands.
static bool bCancelSignal
void createCalculationAnswer(int nNum, mu::value_type *v)
This private member function will create the answer line for the parser which is then passed to NumeR...
NumeReDebugger & getDebugger()
static void failMessage(std::string sFailMessage)
This static function may be used to print a test failure message in the terminal.
void defineFunctions()
This member function declares all mathematical functions.
MemoryManager & getMemoryManager()
bool evaluateProcedureCalls(std::string &sLine)
This private member function will evaluate any calls to procedurs and replace their results in the cu...
static void installationDone()
Notify the GUI that the installation was processed.
bool handleComposeBlock(std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle the compose block (i.e. store the different commands and ret...
std::string getGreeting()
Returns a random greeting string, which may be printed to the terminal later.
static int numberOfNumbersPerLine()
This member function returns the count of numbers fitting into a single terminal line depending on it...
static void showDebugEvent(const std::string &sTitle, const std::vector< std::string > &vStacktrace)
This member function passes the debugging information to the GUI to be displayed in the debugger wind...
static void print(const std::string &__sLine, bool printingEnabled=true)
This member function appends the passed string as a new output line to the buffer and informs the ter...
~NumeReKernel()
Destructor of the kernel.
NumeRe::Cluster & getAns()
static void clcTerminal()
Clear the terminal.
static void showTable(NumeRe::Table _table, std::string __name, bool openeditable=false)
This member function passes a table to the GUI to be displayed in the table viewer....
std::map< std::string, std::string > getMenuMap() const
Returns the menu map used to construct the package menu.
KernelStatus MainLoop(const std::string &sCommand)
This is the main loop for the core of NumeRe.
void checkInternalStates()
Evaluates the internal states, performs necessary actions and resets them.
static void progressBar(int nStep, int nFirstStep, int nFinalStep, const std::string &sType)
This function displays a progress bar constructed from characters in the terminal.
static bool bErrorNotification
std::queue< std::string > commandQueue
void StartUp(NumeReTerminal *_parent, const std::string &__sPath, const std::string &sPredefinedFunctions)
This is the kernel "booting" function.
MemoryManager _memoryManager
void displaySplash()
This function displays the intro text.
std::string getDocumentation(const std::string &sCommand)
This member function returns the documentation for the passed command string as HTML string prepared ...
void handleToCmd(std::string &sLine, std::string &sCache, std::string &sCurrentCommand)
This private member function handles the "to_cmd()" function, if it is part of the current command li...
@ NUMERE_INSTALLATION_DONE
@ NUMERE_PRINTLINE_PREFMT
@ NUMERE_STATUSBAR_UPDATE
@ NUMERE_REFRESH_FUNCTIONTREE
@ NUMERE_SHOW_STRING_TABLE
void saveData()
This member function performs the autosaving of tables at application shutdown.
static NumeRe::Table table
void refreshFunctionTree()
This member function informs the GUI to reload the contents of the function tree as soon as possible.
std::map< std::string, std::string > getFunctionLanguageStrings()
This member function returns a map of language strings for the declared functions,...
void sendErrorNotification()
This member function is used to toggle the error notification status. The error notification is used ...
static void flush()
Inform the terminal to write the current output buffer as soon as possible.
void CloseSession()
This member function shuts the kernel down and terminates the kernel instance. Every call to NumeReKe...
void printResult(const std::string &sLine, bool bScriptRunning)
This member function appends the formatted string to the buffer and informs the terminal that we have...
void resetAfterError()
This private member function will reset the kernel variables after an error had been handled.
static NumeReTerminal * m_parent
NumeRe::Container< std::string > getStringTable(const std::string &sStringTableName)
This member function creates the table container for the string table or the clusters.
const std::vector< Package > & getInstalledPackages() const
Returns a vector containing the names and the version info of each installed plugin.
bool handleFlowControls(std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle used flow controls.
void printVersionInfo()
This member function prints the version headline and the version information to the console.
NumeReKernel()
Constructor of the kernel.
NumeReVariables getVariableList()
This member function returns a structure containing all currently declared variables,...
int ReadOpenFileFlag()
This member function returns the mode, how a file shall be opened in the editor, when called by the k...
static void showStringTable(NumeRe::Container< std::string > _stringtable, std::string __name, bool openeditable=false)
This member function passes a string table to the GUI to be displayed in the table viewer.
NumeRe::StringParser _stringParser
void setKernelSettings(const Settings &_settings)
Update the internal settings.
static unsigned int nLastLineLength
static bool bWritingTable
bool getLineFromCommandCache(std::string &sLine, const std::string &sCurrentCommand)
This private member function returns the current command line from the command cache (i....
static void gotoLine(const std::string &sFile, unsigned int nLine=0)
This member function handles opening files and jumping to lines as requested by the kernel.
static void issueWarning(std::string sWarningMessage)
This static function may be used to issue a warning to the user. The warning will be printed by the t...
void initializeStackTracker()
Starts the stack tracker, which will prevent stack overflows.
void defineOperators()
This member function declares all numerical operators.
static bool GetAsyncCancelState()
This function is used by the kernel to get informed, when the user pressed ESC or used other means of...
static void setDocumentation(const std::string &_sDocumentation)
This member function handles the display of a documentation window as requested by the kernel.
std::vector< std::string > getPathSettings() const
This member function returns a vector containing all currently declared paths in a distinct order.
static std::string formatResultOutput(int nNum, mu::value_type *v)
This static function is used to format the result output in the terminal for numerical-only results.
static void toggleTableStatus()
Toggles the table writing status, which will reduce the number or events send to the terminal.
void Autosave()
Saves the allocated memories by the tables automatically.
static int * baseStackPosition
static bool modifiedSettings
static int waitForContinue()
This static function waits until the user sends a continuation command via the debugger and returns t...
void showWindow(const NumeRe::Window &window)
This member function passes a window object to the user interface, which will then converted into a r...
bool executePlugins(std::string &sLine)
This private member function will execute any call to a plugin.
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
NumeReKernel::KernelStatus m_KernelStatus
bool m_bTableEditAvailable
std::string m_sCommandLine
bool m_bTableEditCanceled
wxCriticalSection m_kernelCS
std::string getPackageDescription(unsigned int i=0) const
Returns the description of the ith plugin.
std::string getPluginCommandSignature(unsigned int i=0) const
Returns the plugin command signature of the ith plugin.
std::string getPluginProcName() const
Returns the current plugin's procedure name.
std::string deletePackage(const std::string &sPackage)
This member function deletes the plugin with the passed name from the internal set of definitions and...
std::string getPluginInfoPath()
This member function simply returns the plugin definition file path.
bool loadPlugins()
This member function will read the plugin definitions from the definitions file and create the intern...
std::string getPluginVarList() const
Returns the current plugin's procedure argument list.
const std::vector< Package > & getPackages() const
Returns a const reference to the currently installed packages.
bool isPluginCmd(const std::string &sCmd) const
This member function determines, whether the passed command line contains a plugin command.
bool evalPluginCmd(std::string &sCmd)
This member function converts the call to a plugin in the passed command line into a call to the corr...
std::string getPluginNames() const
Returns the names of the installed plugins.
unsigned int getPackageCount() const
Returns the number of installed plugins.
std::map< std::string, std::string > getMenuMap() const
Returns the menu map connecting menu entry names with their corresponding procedure,...
std::string getPluginCommand(unsigned int i=0) const
Returns the plugin command of the ith plugin.
void setFileName(std::string _sFileName)
Change the output file name.
Returnvalue execute(std::string sProc, std::string sVarList, mu::Parser &_parser, FunctionDefinitionManager &_functions, MemoryManager &_data, Settings &_option, Output &_out, PlotData &_pData, Script &_script, unsigned int nth_procedure=0)
This member function is central in the execution of the currently selected procedure as it handles al...
size_t replaceReturnVal(std::string &sLine, mu::Parser &_parser, const Returnvalue &_return, unsigned int nPos, unsigned int nPos2, const std::string &sReplaceName)
This member function replaces the procedure occurence between the both passed positions using akronym...
void setPredefinedFuncs(const std::string &sPredefined)
int getReturnType() const
bool writeProcedure(std::string sProcedureLine)
This member function handles the procedure installation process by governing the file stream and pass...
static std::string mangleName(std::string sProcedureName)
Mangles a procedure name to be used as a usual variable.
This class manages all already read and possibly pre-parsed procedure files for easier and faster acc...
void close()
This member function closes an opened script.
std::string getScriptFileName() const
std::string getNextScriptCommand()
This member function is the main interface to the internal managed script. It will always return the ...
unsigned int getCurrentLine() const
void returnCommand()
This member function closes the script, if the code reached a "return" statement.
void setPredefinedFuncs(const std::string &sPredefined)
This class manages the setting values of the internal (kernel) settings of this application.
std::string getDefaultPlotFont() const
Returns the current plotting font name.
std::string getLoadPath() const
Returns the current loading path.
bool showGreeting() const
Returns, whether NumeRe shall greet the user with a funny message at application start-up.
bool useLogFile() const
Returns, whether the terminal inputs shall be protocoled in a dedicated logfile. This setting does no...
std::string getWorkPath() const
Returns the current working path (connected to the <wp> token).
bool controlDefinitions() const
Returns, whether NumeRe shall load and save custom functions automatically.
std::string getSavePath() const
Returns the current saving path.
size_t getPrecision() const
Returns the precision for displaying floating numbers in the terminal. This value determines the numb...
std::string getTokenPaths() const
Returns a semicolon-separated list of the current defined path placeholders and their values.
std::string getProcPath() const
Returns the current procedure root import path.
std::string getPlotPath() const
Returns the current plotting path (plot storing location).
std::string getExePath() const
Returns the current application root folder path.
SettingsValue & getSetting(const std::string &value)
Returns a reference to the setting value, which corresponds to the passed string. Throws an exception...
void enableSystemPrints(bool _bSystemPrints=true)
Enables or disables the system printing functionality. This is a convenience wrapper for the direct m...
size_t getWindow(int nWindow=0) const
Returns the current window size of the terminal.
void copySettings(const Settings &_settings)
This member function is an alias for the assignment operator overload.
bool useCustomLangFiles() const
Returns, whether user language files shall be used to override internal language strings.
std::string getScriptPath() const
Returns the current script import folder path.
bool loadEmptyCols() const
Returns, whether NumeRe shall keep empty columns when loading a file to memory.
bool useDebugger() const
Returns, whether the debugger is currently active.
void load(const std::string &_sWhere)
Opens the configuration file, identifies its version and imports the setting values.
bool useEscInScripts() const
Returns, whether ESC key presses shall be handled, when scripts are being executed.
void save(const std::string &_sWhere, bool bMkBackUp=false)
Saves the setting values to the corresponding config file. Does only save the setting values,...
size_t & value()
Returns a reference to an unsigned int value type setting.
std::string & stringval()
Returns a reference to a std::string value type setting.
std::string maxString(unsigned int i1=0, unsigned int i2=std::string::npos, unsigned int nCol=0)
int getStringSize(unsigned int nCol=std::string::npos) const
unsigned int getStringCols() const
unsigned int getStringElements(unsigned int nCol=std::string::npos) const
std::string readString(unsigned int _nthString=std::string::npos, unsigned int nCol=0)
std::string minString(unsigned int i1=0, unsigned int i2=std::string::npos, unsigned int nCol=0)
Common exception class for all exceptions thrown in NumeRe.
@ PROCESS_ABORTED_BY_USER
static size_t invalid_position
bool isOpenEnd() const
This member function determines, whether the internal index set has an open end.
std::string to_string() const
This member function converts the vector indexes contents into a human-readable string representation...
void SetExpr(StringView a_sExpr)
Set the expression. Triggers first time calculation thus the creation of the bytecode and scanning of...
value_type Eval()
Single-value wrapper around the vectorized overload of this member function.
const varmap_type & GetVar() const
Return a map containing the used variables only.
void DeactivateLoopMode()
Deactivates the loop mode and resets the internal arrays.
void ClearVectorVars(bool bIgnoreProcedureVects=false)
This member function cleares the internal vector storage.
void SetVarFactory(facfun_type a_pFactory, void *pUserData=NULL)
Set a function that can create variable pointer for unknown expression variables.
void DefineVar(const string_type &a_sName, value_type *a_fVar)
Add a user defined variable.
void DefineConst(const string_type &a_sName, value_type a_fVal)
Add a user defined constant.
void DefinePostfixOprt(const string_type &a_strFun, fun_type1 a_pOprt, bool optimizeAway=true)
Add a user defined operator.
bool IsAlreadyParsed(StringView sNewEquation)
This member function checks, whether the passed expression is already parsed, so that the parsing ste...
void DefineInfixOprt(const string_type &a_strName, fun_type1 a_pOprt, int a_iPrec=prINFIX, bool optimizeAway=true)
Add a user defined operator.
string_type CreateTempVectorVar(const std::vector< mu::value_type > &vVar)
This member function copies the passed vector into the internal storage referencing it with a auto-ge...
std::map< std::string, std::string > * mVarMapPntr
void DefineFun(const string_type &a_strName, T a_pFun, bool optimizeAway=true)
Define a parser function without arguments.
std::list< mu::value_type * > m_lDataStorage
void SetVectorVar(const std::string &sVarName, const std::vector< mu::value_type > &vVar, bool bAddVectorType=false)
This member function copies the passed vector into the internal storage referencing it with the passe...
void DefineOprt(const string_type &a_strName, fun_type2 a_pFun, unsigned a_iPri=0, EOprtAssociativity a_eAssociativity=oaLEFT, bool optimizeAway=true)
Define a binary operator.
Error class of the parser.
std::size_t GetPos() const
Return the formula position related to the error.
const string_type & GetMsg() const
Returns the message string for this error.
const string_type & GetExpr() const
gets the expression related tp this error.
const string_type & GetToken() const
Return string related with this token (if available).
Mathematical expressions parser.
value_type parser_Random(const value_type &vRandMin, const value_type &vRandMax)
This function returns a uniformly distributed random number between both boundaries.
string getDataElements(string &sLine, Parser &_parser, MemoryManager &_data, const Settings &_option, int options)
Searches the passed string for calls to any table or cluster and replaces them with internal vectors ...
bool isClusterCandidate(string &sLine, string &sCluster, bool doCut)
This function checks, whether the passed command line contains the syntax for a cluster candidate,...
Indices getIndices(StringView sCmd, mu::Parser &_parser, MemoryManager &_data, const Settings &_option)
Wrapper for the new getIndices function interface.
bool isValidIndexSet(const Indices &_idx)
std::string doc_HelpAsHTML(const std::string &__sTopic, bool generateFile, Settings &_option)
This function returns the documentation article for the selected topic as an HTML std::string....
std::string errorTypeToString(ErrorType e)
Return the error type converted to a human readable string.
Assertion _assertionHandler
std::string fromSystemCodePage(std::string)
Transforms the system code page to the internal one.
std::string toSystemCodePage(std::string)
Converts an internal to an external string. Does nothing currently.
value_type parser_Binom(const value_type &v1, const value_type &v2)
Function representing the binomial coefficient.
value_type parser_Faculty(const value_type &v)
Function representing the faculty of any natural number.
value_type parser_Parsec(const value_type &v)
Conversion function for 1pc.
value_type parser_gcd(const value_type &n, const value_type &k)
This function returns the greatest common divisor of both argments.
value_type parser_Norm(const value_type *vElements, int nElements)
This function calculates the vector norm of the elements in the passed array.
value_type parser_Pct(const value_type *vElements, int nElements)
This function calculates the selected percentile of the passed array.
value_type parser_is_string(const value_type &v)
This function is a numerical version of the string is_string() function. Used as a fallback.
value_type parser_studentFactor(const value_type &vFreedoms, const value_type &vAlpha)
This function returns the Student factor s_t for the selected degrees of freedom and a confidence int...
value_type parser_and(const value_type *vElements, int nElements)
This function calculates the logical AND operation between all elements in the passed array.
value_type parser_interval(const value_type &v, const value_type &vLeft, const value_type &vRight)
This function numerically defines a valid value range (the value is set to NaN, if outside of this ra...
value_type parser_Poise(const value_type &v)
Conversion function for 1Ps.
value_type parser_clock()
This function returns the current CPU clock count.
value_type parser_asec(const value_type &x)
This function returns the inverse secant of the passed value.
value_type parser_SphericalNeumann(const value_type &vn, const value_type &vc)
This function calculates the spherical von Neumann function.
value_type parser_theta(const value_type &x, const value_type &y, const value_type &z)
This function calculates the angle of a vector and the z axis in any z-r plane (the polar angle theta...
value_type parser_Lightyear(const value_type &v)
Conversion function for 1ly.
value_type * parser_AddVariable(const char_type *a_szName, void *a_pUserData)
This function represents the numerical variable factory. New memory is allocated in this function and...
value_type parser_SinusCardinalis(const value_type &v)
This function calculates the cardinal sine of x.
value_type parser_Barn(const value_type &v)
Conversion function for 1bn.
value_type parser_Yard(const value_type &v)
Conversion function for 1yd.
value_type parser_mol(const value_type &v)
Conversion function for 1mol.
value_type parser_csch(const value_type &x)
This function returns the hyperbolic cosecant of the passed value.
value_type parser_EllipticD(const value_type &phi, const value_type &n, const value_type &k)
This function returns the value of the elliptic intergal D(phi,n,k).
value_type parser_AiryA(const value_type &x)
This function calculates the Airy function Ai(x).
value_type parser_Nano(const value_type &a_fVal)
Conversion function for 1n.
value_type parser_roof(const value_type &x)
This is the roof (ceil) function.
value_type parser_Zernike(const value_type &vn, const value_type &vm, const value_type &rho, const value_type &phi)
This function calculates the selected Zernike polynomials.
value_type parser_AssociatedLegendrePolynomial(const value_type &vl, const value_type &vm, const value_type &v)
This function calculates the associated Legendre polynomials of the selected order.
value_type parser_EllipticF(const value_type &phic, const value_type &kc)
This function returns the value of the elliptic intergal F(phi,k).
value_type parser_Micro(const value_type &a_fVal)
Conversion function for 1mu.
value_type parser_AssociatedLaguerrePolynomial(const value_type &vn, const value_type &vk, const value_type &v)
This function calculates the associated Laguerre polynomials of the selected order.
value_type parser_Ignore(const value_type &v)
Identity function. Used for ignoring functions and parameters in special cases.
value_type parser_Mile(const value_type &v)
Conversion function for 1mi.
value_type parser_real(const value_type &v)
Extracts the real part of a complex number.
value_type parser_acsc(const value_type &x)
This function returns the inverse cosecant of the passed value.
value_type parser_beta(const value_type &a, const value_type &b)
This function returns the value of the Beta function.
value_type parser_complex(const value_type &re, const value_type &im)
Construct a complex number from two real numbers.
value_type parser_isnan(const value_type &v)
Returns, whether the selected value is NaN.
value_type parser_erf(const value_type &x)
This function calculates the gaussian error function.
value_type parser_date(const value_type &vTime, const value_type &vType)
This function converts UNIX time values into a selected part of a time stamp.
value_type parser_polar2rect(const value_type &v)
Converts a polar representation into a rectangular representation and returns it as a new complex num...
value_type parser_AstroUnit(const value_type &v)
Conversion function for 1AU.
value_type parser_LaguerrePolynomial(const value_type &vn, const value_type &v)
This function calculates the Laguerre polynomials of the selected order.
value_type parser_imSphericalHarmonics(const value_type &vl, const value_type &vm, const value_type &theta, const value_type &phi)
This function calculates the imaginary part of the selected spherical harmonics.
value_type parser_RegularCylBessel(const value_type &n, const value_type &x)
This function calculates the regulary bessel function.
value_type parser_time()
This function returns the current UNIX time.
value_type parser_rect(const value_type &x, const value_type &x0, const value_type &x1)
This is the rect function.
value_type parser_Not(const value_type &v)
Function representing the logical NOT operator.
value_type parser_Cnt(const value_type *vElements, int nElements)
This functioon simply returns the number of elements in its array (even the invalid ones).
value_type parser_PSI(const value_type &v)
Conversion function for 1psi.
value_type parser_sec(const value_type &x)
This function returns the secant of the passed value.
value_type parser_Milli(const value_type &a_fVal)
Conversion function for 1m.
value_type parser_Mega(const value_type &a_fVal)
Conversion function for 1M.
value_type parser_Num(const value_type *vElements, int nElements)
This function returns the number of valid elements in its array.
value_type parser_EllipticP(const value_type &phi, const value_type &n, const value_type &k)
This function returns the value of the elliptic intergal Pi(phi,n,k).
value_type parser_kmh(const value_type &v)
Conversion function for 1kmh.
value_type parser_zeta(const value_type &s)
This function returns the value of the Zeta function.
value_type parser_Giga(const value_type &a_fVal)
Conversion function for 1G.
value_type parser_SphericalBessel(const value_type &vn, const value_type &vc)
This function calculates the spherical bessel function.
value_type parser_gamma(const value_type &x)
This function calculates the riemannian Gamma function.
value_type parser_EllipticE(const value_type &phic, const value_type &kc)
This function returns the value of the elliptic intergal E(phi,k).
value_type parser_BetheWeizsaecker(const value_type &vN, const value_type &vZ)
This function calculates the nucleic core binding energy according the Bethe Weizsäcker formula.
value_type parser_Calorie(const value_type &v)
Conversion function for 1cal.
value_type parser_toDegree(const value_type &v)
This function converts radian to degree.
value_type parser_MaxPos(const value_type *vElements, int nElements)
This function returns the index of the (first) maximal value in the array.
value_type parser_sech(const value_type &x)
This function returns the hyperbolic secant of the passed value.
value_type parser_Torr(const value_type &v)
Conversion function for 1Torr/1mmhg.
value_type parser_Curie(const value_type &v)
Conversion function for 1C.
value_type parser_perlin(const value_type *vElements, int nElements)
This function implements the perlin noise function.
value_type parser_lcm(const value_type &n, const value_type &k)
This function returns the least common multiple of both arguments.
value_type parser_weeknum(const value_type &vTime)
This function returns the calendar week associated with the passed time value.
value_type parser_liter(const value_type &v)
Conversion function for 1l.
value_type parser_BinAND(const value_type &v1, const value_type &v2)
This function represents the binary AND operator.
value_type parser_round(const value_type &vToRound, const value_type &vDecimals)
This function rounds the passed value to the selected number of decimals.
value_type parser_log_b(const value_type &b, const value_type &x)
Calculates the logarithm of x using the base b.
value_type parser_SphericalHarmonics(const value_type &vl, const value_type &vm, const value_type &theta, const value_type &phi)
This function calculates the real part of the selected spherical harmonics.
value_type parser_Std(const value_type *vElements, int nElements)
This function calculates the standard deviation of the elements in the passed array.
value_type parser_Med(const value_type *vElements, int nElements)
This function calculates the median of the elements in the passed array.
value_type parser_digamma(const value_type &x)
This function returns the value of the Digamma function.
value_type parser_HermitePolynomial(const value_type &vn, const value_type &v)
This function calculates the Hermite polynomials of the selected order.
value_type parser_toRadian(const value_type &v)
This function converts degree to radian.
value_type parser_compare(const value_type *vElements, int nElements)
This function searches for elements of a specified type in the passed array.
value_type parser_ivl(const value_type &x, const value_type &x0, const value_type &x1, const value_type &lborder, const value_type &rborder)
This function describes an interval with borders of a selected type (including, excluding,...
value_type parser_Mod(const value_type &v1, const value_type &v2)
This function represents the Modulo operator.
value_type parser_Angstroem(const value_type &v)
Conversion function for 1A.
value_type parser_dilogarithm(const value_type &x)
This function returns the value of the Dilogarithm Li2(x).
value_type parser_MinPos(const value_type *vElements, int nElements)
This function returns the index of the (first) minimal value in the array.
value_type parser_Kilo(const value_type &a_fVal)
Conversion function for 1k.
value_type parser_LegendrePolynomial(const value_type &vn, const value_type &v)
This function calculates the Legendre polynomials of the selected order.
value_type parser_gRandom(const value_type &vRandAvg, const value_type &vRandstd)
This function returns a gaussian distributed random number using the passed values as mean and standa...
value_type parser_Gauss(const value_type &v)
Conversion function for 1Gs.
value_type parser_polynomial(const value_type *vElements, int nElements)
This function implements an abstract polynomial of an arbitrary order.
value_type parser_imag(const value_type &v)
Extracts the imaginary part of a complex number.
value_type parser_xor(const value_type *vElements, int nElements)
This function calculates the logical XOR operation between all elements in the passed array.
value_type parser_acsch(const value_type &x)
This function returns the inverse hyperbolic cosecant of the passed value.
value_type parser_Fahrenheit(const value_type &v)
Conversion function for 1°F.
value_type parser_BinOR(const value_type &v1, const value_type &v2)
This function represents the binary OR operator.
value_type parser_Fermi(const value_type &v)
Conversion function for 1fm.
value_type parser_imaginaryUnit(const value_type &v)
Multiplies a number with the imaginary unit.
value_type parser_ElectronVolt(const value_type &v)
Conversion function for 1eV.
value_type parser_Inch(const value_type &v)
Conversion function for 1in.
value_type parser_cot(const value_type &x)
This function returns the cotangent of the passed value.
value_type parser_erfc(const value_type &x)
This function calculates the complementary gaussian error function.
value_type parser_Foot(const value_type &v)
Conversion function for 1ft.
value_type parser_or(const value_type *vElements, int nElements)
This function calculates the logical OR operation between all elements in the passed array.
value_type parser_numereversion()
Returns the version number of NumeRe as a natural number.
value_type parser_doubleFaculty(const value_type &v)
Function representing the double faculty of any natural number.
value_type parser_Knoten(const value_type &v)
Conversion function for 1kn.
value_type parser_floor(const value_type &x)
This is the floor function.
value_type parser_sleep(const value_type &milliseconds)
Sleeps for the passed amount of milliseconds and returns this number.
value_type parser_csc(const value_type &x)
This function returns the cosecant of the passed value.
value_type parser_clausen(const value_type &x)
This function returns the value of the Clausen function.
value_type parser_phi(const value_type &x, const value_type &y)
This function calculates the angle of a vector and the x axis in the x-y plane (the azimuthal angle p...
value_type parser_asech(const value_type &x)
This function returns the inverse hyperbolic secant of the passed value.
value_type parser_Heaviside(const value_type &v)
This function represents the Heaviside (theta) function.
value_type parser_IrregularCylBessel(const value_type &n, const value_type &x)
This function calculates the irregulary bessel (von Neumann) function.
value_type parser_polygamma(const value_type &n, const value_type &x)
This function returns the value if the Polygamma function.
value_type parser_conj(const value_type &v)
Calculates the complex conjugate number of the passed complex number.
value_type parser_product(const value_type *vElements, int nElements)
This function calculates the product of all elements in the passed array.
value_type parser_mph(const value_type &v)
Conversion function for 1mph.
value_type parser_rect2polar(const value_type &v)
Converts a rectangular representation into polar representation and returns it as a new complex numbe...
value_type parser_XOR(const value_type &v1, const value_type &v2)
This function represent the XOR operator.
value_type parser_AiryB(const value_type &x)
This function calculates the Airy function Bi(x).
value_type parser_Celsius(const value_type &v)
Conversion function for 1°C.
void make_hline(int nLength)
This function prints a horizontal line to the terminal using either minus or equal signs.
#define KERNEL_PRINT_SLEEP
DefaultVariables _defVars
#define TERMINAL_FORMAT_FIELD_LENOFFSET
#define DEFAULT_NUM_PRECISION
#define DEFAULT_MINMAX_PRECISION
const std::string sVersion
static std::string drawBar(int nValue, size_t nLength, const std::string &sProgressChar, const std::string &sWhitespaceChar)
Simple static helper function to render the actual progress bar.
static std::string formatByteSize(double bytes)
Formats the byte size using KB or MB as units.
std::string pointToError(unsigned int nPos)
This function points to the error indicated by nPos. It draws three circumflexes below the error loca...
std::string strfill(const std::string &sString, unsigned int nWidth, char cFill=' ', bool limit=false)
This function fills the passed string up to the width nWidth with the characters cFill....
bool fileExists(const string &)
This function checks, whether the file with the passed file name exists.
unsigned int getMatchingParenthesis(const StringView &)
Returns the position of the closing parenthesis.
static const char MONTH[]
CONSTCD11 std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
MUP_BASETYPE value_type
The numeric datatype used by the parser.
bool isnan(const value_type &v)
std::map< string_type, value_type * > varmap_type
Type used for storing variables.
@ prMUL_DIV
multiplication/division
string promptForUserInput(const string &__sCommand)
This function is invoked, if a prompt operator ("??") was found in a string.
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
#define SETTING_S_PROCPATH
#define SETTING_S_EXEPATH
#define SETTING_V_WINDOW_X
#define SETTING_S_LOADPATH
#define SETTING_S_SAVEPATH
#define SETTING_S_PLOTPATH
#define SETTING_S_SCRIPTPATH
Structure for the four standard variables.
mu::value_type vValue[4][4]
This structure is central for managing the indices of a table or cluster read or write data access....
This structure abstracts the necessary information for a task to be done by the graphical user interf...
NumeRe::Container< std::string > stringTable
std::vector< std::string > vDebugEvent
This structure combines a vector of declared variables including their values and respective sizes wi...
std::vector< std::string > vVariables
Structure as wrapper for the return value of procedures (which may be numerical or string values or a...
std::vector< std::string > vStringVal
std::string sReturnedTable
std::vector< mu::value_type > vNumVal
long long int intCast(const std::complex< double > &)
Casts the real part of the complex number to an integer and avoids rounding errors.
std::string toString(int)
Converts an integer to a string without the Settings bloat.
static NumeRe::WindowInformation getWindow(const std::string &sExpr)
This static function returns the window information describing the window with the selected ID.