NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
Go to the source code of this file.
Functions | |
size_t | findVariableInExpression (const std::string &sExpr, const std::string &sVarName, size_t nPosStart) |
This function searches for the selected variable in the passed string and returns the position of the first occurence or string::npos, if nothing was found. More... | |
void | convertVectorToExpression (string &sLine, const Settings &_option) |
This function replaces vector expressions with their corresponding multi- expression equation. More... | |
string | addMissingVectorComponent (const string &sVectorComponent, const string &sLeft, const string &sRight, bool bAddStrings) |
This function determines the value of missing vector components (i.e. a vector contains not enough elements compared to the others used in the current expression) by applying a simple heuristic to the expression. It will either insert "1", "0" or an empty string in string expressions. More... | |
unsigned int | getPositionOfFirstDelimiter (const string &sLine) |
This function returns the position of the first delimiter in the passed string, but it jumps over parentheses and braces. More... | |
string | promptForUserInput (const string &__sCommand) |
This function is invoked, if a prompt operator ("??") was found in a string. More... | |
mu::value_type * | getPointerToVariable (const string &sVarName, Parser &_parser) |
This function returns the pointer to the passed variable. More... | |
int | integralFactorial (int nNumber) |
This function returns the factorial of the passed integral value. More... | |
string | evaluateTargetOptionInCommand (string &sCmd, const string &sDefaultTarget, Indices &_idx, Parser &_parser, MemoryManager &_data, const Settings &_option) |
This function evaluates the "target=TABLE()" expression and creates the target table, if needed. More... | |
bool | evaluateIndices (const string &sCache, Indices &_idx, MemoryManager &_data) |
This function will evaluate the passed indices, so that they match the dimensions of the passed cache, if they are defined as open ended. More... | |
static void | readAndParseLegacyIntervals (string &sExpr, const string &sLegacyIntervalIdentifier, Parser &_parser, vector< double > &vInterval, size_t nMinSize, bool bEraseInterval) |
This static function handles a single legacy interval. It's a helper for readAndParseIntervals(). More... | |
vector< double > | readAndParseIntervals (string &sExpr, Parser &_parser, MemoryManager &_data, FunctionDefinitionManager &_functions, const Settings &_option, bool bEraseInterval) |
This function will read the interval syntax in commands and return their values in a single vector. More... | |
Variables | |
mu::value_type | vAns |
mglGraph | _fontData |
string addMissingVectorComponent | ( | const string & | sVectorComponent, |
const string & | sLeft, | ||
const string & | sRight, | ||
bool | bAddStrings | ||
) |
This function determines the value of missing vector components (i.e. a vector contains not enough elements compared to the others used in the current expression) by applying a simple heuristic to the expression. It will either insert "1", "0" or an empty string in string expressions.
sVectorComponent | const string& |
sLeft | const string& |
sRight | const string& |
bAddStrings | bool |
Definition at line 300 of file parser_functions.cpp.
Referenced by convertVectorToExpression(), and evalMatOp().
void convertVectorToExpression | ( | string & | sLine, |
const Settings & | _option | ||
) |
This function replaces vector expressions with their corresponding multi- expression equation.
sLine | string& |
_option | const Settings& |
It is used quite extensively, however, it might not be necessary everywhere, because the parser can cope with the vector syntax now.
Definition at line 82 of file parser_functions.cpp.
References addMissingVectorComponent(), containsStrings(), convertVectorToExpression(), getMatchingParenthesis(), getNextArgument(), SyntaxError::INCOMPLETE_VECTOR_SYNTAX, SyntaxError::invalid_position, isMultiValue(), isToStringArg(), and parser_CheckMultArgFunc().
Referenced by NumeRe::StringFuncHandler::argumentParser(), convertVectorToExpression(), Plot::create2dDrawing(), Plot::create3dDrawing(), evalPoints(), evaluateFittingParams(), Plot::fillData(), CommandLineParser::getExprAsMathExpression(), NumeRe::StringParser::numToString(), and NumeRe::StringParser::storeStringResults().
bool evaluateIndices | ( | const string & | sCache, |
Indices & | _idx, | ||
MemoryManager & | _data | ||
) |
This function will evaluate the passed indices, so that they match the dimensions of the passed cache, if they are defined as open ended.
sCache | const string& |
_idx | Indices& |
_data | Datafile& |
Definition at line 625 of file parser_functions.cpp.
References Indices::col, MemoryManager::getCols(), MemoryManager::getLines(), VectorIndex::isOpenEnd(), isValidIndexSet(), Indices::row, and VectorIndex::setRange().
Referenced by evalMatOp(), and evaluateFittingParams().
string evaluateTargetOptionInCommand | ( | string & | sCmd, |
const string & | sDefaultTarget, | ||
Indices & | _idx, | ||
Parser & | _parser, | ||
MemoryManager & | _data, | ||
const Settings & | _option | ||
) |
This function evaluates the "target=TABLE()" expression and creates the target table, if needed.
sCmd | string& |
sDefaultTarget | const string& |
_idx | Indices& |
_parser | Parser& |
_data | Datafile& |
_option | const Settings& |
If this option is not found, the function will create a default target cache.
Definition at line 566 of file parser_functions.cpp.
References MemoryManager::addTable(), VectorIndex::back(), Indices::col, findParameter(), VectorIndex::front(), getArgAtPos(), MemoryManager::getCols(), getIndices(), SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, MemoryManager::isTable(), isValidIndexSet(), VectorIndex::OPEN_END, Indices::row, and VectorIndex::to_string().
Referenced by CommandLineParser::getTargetTable(), plugin_histogram(), plugin_random(), and plugin_statistics().
size_t findVariableInExpression | ( | const std::string & | sExpr, |
const std::string & | sVarName, | ||
size_t | nPosStart | ||
) |
This function searches for the selected variable in the passed string and returns the position of the first occurence or string::npos, if nothing was found.
sExpr | const std::string& |
sVarName | const std::string& |
nPosStart | size_t |
Definition at line 42 of file parser_functions.cpp.
References isInQuotes().
Referenced by CodeAnalyzer::analysePreDefs(), Interval::contains(), Plot::createSubPlotSet(), findExtrema(), findZeroes(), SymDefManager::resolveSymbols(), and taylor().
mu::value_type * getPointerToVariable | ( | const string & | sVarName, |
Parser & | _parser | ||
) |
This function returns the pointer to the passed variable.
sVarName | const string& |
_parser | Parser& |
Definition at line 511 of file parser_functions.cpp.
References mu::ParserBase::GetVar().
Referenced by differentiate(), evalPoints(), findExtrema(), findZeroes(), FlowCtrl::prepareLocalVarsAndReplace(), NumeRe::StringParser::storeStringResults(), and taylor().
unsigned int getPositionOfFirstDelimiter | ( | const string & | sLine | ) |
This function returns the position of the first delimiter in the passed string, but it jumps over parentheses and braces.
sLine | const string& |
Definition at line 396 of file parser_functions.cpp.
References getMatchingParenthesis().
Referenced by NumeRe::StringParser::numToString().
int integralFactorial | ( | int | nNumber | ) |
This function returns the factorial of the passed integral value.
nNumber | int |
Definition at line 535 of file parser_functions.cpp.
Referenced by taylor().
string promptForUserInput | ( | const string & | __sCommand | ) |
This function is invoked, if a prompt operator ("??") was found in a string.
__sCommand | const string& |
It will ask the user to provide the needed value during the execution.
Definition at line 429 of file parser_functions.cpp.
References NumeReKernel::getline(), NumeReKernel::printPreFmt(), and StripSpaces().
Referenced by FlowCtrl::calc(), cmd_print(), FlowCtrl::compile(), Plot::createSubPlotSet(), CommandLineParser::getExprAsDataObject(), CommandLineParser::getExprAsMathExpression(), NumeReKernel::MainLoop(), CommandLineParser::parseExprAsString(), and Procedure::ProcCalc().
vector< double > readAndParseIntervals | ( | string & | sExpr, |
Parser & | _parser, | ||
MemoryManager & | _data, | ||
FunctionDefinitionManager & | _functions, | ||
const Settings & | _option, | ||
bool | bEraseInterval | ||
) |
This function will read the interval syntax in commands and return their values in a single vector.
sExpr | string& |
_parser | Parser& |
_data | Datafile& |
_functions | Define& |
_option | const Settings& |
bEraseInterval | bool |
Definition at line 706 of file parser_functions.cpp.
References FunctionDefinitionManager::call(), MemoryManager::containsTablesOrClusters(), mu::ParserBase::Eval(), findParameter(), SyntaxError::FUNCTION_ERROR, getAllArguments(), getAllIndices(), getDataElements(), getMatchingParenthesis(), SyntaxError::invalid_position, isInQuotes(), isNotEmptyExpression(), readAndParseLegacyIntervals(), and mu::ParserBase::SetExpr().
Referenced by evaluateFittingParams(), evaluateParameterValues(), and Odesolver::solve().
|
static |
This static function handles a single legacy interval. It's a helper for readAndParseIntervals().
sExpr | string& |
sLegacyIntervalIdentifier | const string& |
_parser | Parser&6 |
vInterval | vector<double>& |
nMinSize | size_t |
bEraseInterval | bool |
Definition at line 657 of file parser_functions.cpp.
References mu::ParserBase::Eval(), findParameter(), getAllIndices(), getArgAtPos(), isNotEmptyExpression(), and mu::ParserBase::SetExpr().
Referenced by readAndParseIntervals().
|
extern |
Definition at line 40 of file kernel.cpp.
mu::value_type vAns |
Definition at line 24 of file parser_functions.cpp.
Referenced by FlowCtrl::calc(), FlowCtrl::compile(), NumeReKernel::createCalculationAnswer(), NumeRe::StringParser::eval(), Procedure::ProcCalc(), NumeReKernel::StartUp(), and NumeRe::StringParser::storeStringResults().