NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
command_implementations.cpp File Reference
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_sort.h>
#include <algorithm>
#include <memory>
#include "command_implementations.hpp"
#include "parser_functions.hpp"
#include "matrixoperations.hpp"
#include "spline.h"
#include "wavelet.hpp"
#include "filtering.hpp"
#include "../AudioLib/audiofile.hpp"
#include "../../kernel.hpp"
#include "../../../common/http.h"
Include dependency graph for command_implementations.cpp:

Go to the source code of this file.

Classes

struct  FFTData
 This structure gathers all information needed for calculating a FFT in one or two dimensions. More...
 

Macros

#define TRAPEZOIDAL   1
 
#define SIMPSON   2
 

Functions

static mu::value_type localizeExtremum (string &sCmd, mu::value_type *dVarAdress, Parser &_parser, const Settings &_option, mu::value_type dLeft, mu::value_type dRight, double dEps, int nRecursion)
 This function searches for the positions of all extrema, which are located in the selected interval. More...
 
static mu::value_type localizeZero (string &sCmd, mu::value_type *dVarAdress, Parser &_parser, const Settings &_option, mu::value_type dLeft, mu::value_type dRight, double dEps, int nRecursion)
 This function searches for the positions of all zeroes (roots), which are located in the selected interval. More...
 
static std::vector< size_t > getSamplesForDatagrid (CommandLineParser &cmdParser, const std::vector< size_t > &nSamples)
 This function will obtain the samples of the datagrid for each spatial direction. More...
 
static void expandVectorToDatagrid (IntervalSet &ivl, vector< vector< mu::value_type > > &vZVals, size_t nSamples_x, size_t nSamples_y)
 This function will expand the z vector into a z matrix using triangulation. More...
 
static void integrationstep_trapezoidal (mu::value_type &x, mu::value_type x0, mu::value_type dx, vector< mu::value_type > &vResult, vector< mu::value_type > &vFunctionValues, bool bReturnFunctionPoints)
 This static function performs an integration step using a trapezoidal approximation algorithm. More...
 
static void integrationstep_simpson (mu::value_type &x, mu::value_type x0, mu::value_type x1, double dx, vector< mu::value_type > &vResult, vector< mu::value_type > &vFunctionValues, bool bReturnFunctionPoints)
 This static function performs an integration step using the Simpson approximation algorithm. More...
 
static vector< mu::value_typeintegrateSingleDimensionData (CommandLineParser &cmdParser)
 This static function integrates single dimension data. More...
 
bool integrate (CommandLineParser &cmdParser)
 Calculate the integral of a function or a data set in a single dimension. More...
 
static void refreshBoundaries (IntervalSet &ivl, const string &sIntegrationExpression)
 This static function re-evaluates the boundary expression and updates the internal variables correspondingly. More...
 
bool integrate2d (CommandLineParser &cmdParser)
 Calculate the integral of a function in two dimensions. More...
 
bool differentiate (CommandLineParser &cmdParser)
 Calculate the numerical differential of the passed expression or data set. More...
 
static string getIntervalForSearchFunctions (const string &sParams, string &sVar)
 This static function extracts the interval definition for the extrema and root search functions. More...
 
static bool findExtremaInMultiResult (CommandLineParser &cmdParser, string &sExpr, string &sInterval, int nOrder, int nMode)
 This static function finds extrema in a multi-result expression, i.e. an expression containing a table or similar. More...
 
static double calculateMedian (value_type *v, int nResults, int start, int nOrder, int nanShiftStart, int &nNewNanShift)
 Static helper function for findExtremaInData. More...
 
static bool findExtremaInData (CommandLineParser &cmdParser, string &sExpr, int nOrder, int nMode)
 This static function finds extrema in the selected data sets. More...
 
bool findExtrema (CommandLineParser &cmdParser)
 This function is a wrapper to the actual extrema localisation function localizeExtremum() further below. More...
 
static bool findZeroesInMultiResult (CommandLineParser &cmdParser, string &sExpr, string &sInterval, int nMode)
 This static function finds zeroes in a multi-result expression, i.e. an expression containing a table or similar. More...
 
static bool findZeroesInData (CommandLineParser &cmdParser, string &sExpr, int nMode)
 This static function finds zeroes in the selected data set. More...
 
bool findZeroes (CommandLineParser &cmdParser)
 This function is a wrapper to the actual zeros localisation function localizeZero() further below. More...
 
void taylor (CommandLineParser &cmdParser)
 This function approximates the passed expression using Taylor's method. More...
 
static bool detectPhaseOverflow (std::complex< double > cmplx[3])
 This static function is a helper function for fastFourierTransform() and detects phase overflows, which can be reconstructed during calculations. More...
 
static std::vector< size_t > getShiftedAxis (size_t nElements, bool inverseTrafo)
 Calculates an axis index, which performs the necessary data flips used for the shifted fft axis. More...
 
static void calculate1dFFT (MemoryManager &_data, Indices &_idx, const std::string &sTargetTable, mglDataC &_fftData, std::vector< size_t > &vAxis, FFTData &_fft)
 This static function calculates a 1D FFT and stores the result in the target table. More...
 
static void calculate2dFFT (MemoryManager &_data, Indices &_idx, const std::string &sTargetTable, mglDataC &_fftData, std::vector< size_t > &vAxis, FFTData &_fft)
 This static function calculates a 2D FFT and stores the result in the target table. More...
 
bool fastFourierTransform (CommandLineParser &cmdParser)
 This function calculates the fast fourier transform of the passed data set. More...
 
bool fastWaveletTransform (CommandLineParser &cmdParser)
 This function calculates the fast wavelet transform of the passed data set. More...
 
bool evalPoints (CommandLineParser &cmdParser)
 This function samples a defined expression in an array of discrete values. More...
 
bool createDatagrid (CommandLineParser &cmdParser)
 This function calculates a datagrid from passed functions or (x-y-z) data values. More...
 
bool writeAudioFile (CommandLineParser &cmdParser)
 This function creates a WAVE file from the selected data set. More...
 
bool readAudioFile (CommandLineParser &cmdParser)
 Reads either the audio file meta information or the whole audio file to memory. More...
 
bool seekInAudioFile (CommandLineParser &cmdParser)
 Seek a position in an audiofile and extract a length of samples from it. More...
 
bool regularizeDataSet (CommandLineParser &cmdParser)
 This function regularizes the samples of a defined x-y-data array such that DeltaX is equal for every x. More...
 
bool analyzePulse (CommandLineParser &cmdParser)
 This function performs a pulse analysis on the selected data set. More...
 
bool shortTimeFourierAnalysis (CommandLineParser &cmdParser)
 This function performs the short-time fourier analysis on the passed data set. More...
 
static double interpolateToGrid (const std::vector< double > &vAxis, double dInterpolVal, bool bExtent=false)
 This static function is a helper for boneDetection to map/interpolate the calculated values to the final grid. More...
 
void boneDetection (CommandLineParser &cmdParser)
 This function is the implementation of the detect command. More...
 
bool calculateSplines (CommandLineParser &cmdParser)
 This function approximates the passed data set using cubic splines. More...
 
void rotateTable (CommandLineParser &cmdParser)
 This function rotates a table, an image or a datagrid around a specified angle. More...
 
value_type parser_Random (const value_type &vRandMin, const value_type &vRandMax)
 This function returns a uniformly distributed random number between both boundaries. More...
 
void particleSwarmOptimizer (CommandLineParser &cmdParser)
 This function implements a particle swarm optimizer in up to four dimensions (depending on the number of intervals defined). The optimizer has an adaptive velocity part, reducing the overall position variation of the particles over time. More...
 
std::string removeQuotationMarks (const std::string &)
 This function simply removes the surrounding quotation marks. More...
 
void urlExecute (CommandLineParser &cmdParser)
 This function implements the url command providing an interface to http(s) and (s)ftp URLs. More...
 

Variables

DefaultVariables _defVars
 

Macro Definition Documentation

◆ SIMPSON

#define SIMPSON   2

Definition at line 35 of file command_implementations.cpp.

◆ TRAPEZOIDAL

#define TRAPEZOIDAL   1

Definition at line 34 of file command_implementations.cpp.

Function Documentation

◆ analyzePulse()

bool analyzePulse ( CommandLineParser cmdParser)

This function performs a pulse analysis on the selected data set.

Parameters
cmdParserCommandLineParser&
Returns
bool

The function calculates the maximal amplitude, its position, the FWHM, the width near the maximal amplitude (which is different from the FWHM) and the energy in the pulse.

Definition at line 3915 of file command_implementations.cpp.

References _lang, extractRange(), Language::get(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), NumeReKernel::getInstance(), make_hline(), VectorIndex::OPEN_END, NumeReKernel::print(), NumeReKernel::printPreFmt(), CommandLineParser::setReturnValue(), SyntaxError::TABLE_DOESNT_EXIST, NumeReKernel::toggleTableStatus(), toString(), and toUpperCase().

Referenced by cmd_pulse().

Here is the call graph for this function:

◆ boneDetection()

◆ calculate1dFFT()

static void calculate1dFFT ( MemoryManager _data,
Indices _idx,
const std::string &  sTargetTable,
mglDataC &  _fftData,
std::vector< size_t > &  vAxis,
FFTData _fft 
)
static

This static function calculates a 1D FFT and stores the result in the target table.

Parameters
_dataMemoryManager&
_idxIndices&
sTargetTableconst std::string&
_fftDatamglDataC&
vAxisstd::vector<size_t>&
_fftFFTData&
Returns
void

Definition at line 2588 of file command_implementations.cpp.

References _lang, date::abs(), FFTData::bComplex, FFTData::bInverseTrafo, FFTData::bShiftAxis, Indices::col, detectPhaseOverflow(), FFTData::dFrequencyOffset, FFTData::dNyquistFrequency, FFTData::dTimeInterval, VectorIndex::front(), Language::get(), getShiftedAxis(), VectorIndex::isOpenEnd(), FFTData::lines, M_PI, Indices::row, MemoryManager::setHeadLineElement(), VectorIndex::setRange(), VectorIndex::size(), and MemoryManager::writeToTable().

Referenced by fastFourierTransform().

Here is the call graph for this function:

◆ calculate2dFFT()

static void calculate2dFFT ( MemoryManager _data,
Indices _idx,
const std::string &  sTargetTable,
mglDataC &  _fftData,
std::vector< size_t > &  vAxis,
FFTData _fft 
)
static

This static function calculates a 2D FFT and stores the result in the target table.

Parameters
_dataMemoryManager&
_idxIndices&
sTargetTableconst std::string&
_fftDatamglDataC&
vAxisstd::vector<size_t>&
_fftFFTData&
Returns
void

Definition at line 2713 of file command_implementations.cpp.

References _lang, date::abs(), FFTData::bComplex, FFTData::bInverseTrafo, FFTData::bShiftAxis, Indices::col, FFTData::cols, FFTData::dNyquistFrequency, FFTData::dTimeInterval, VectorIndex::front(), Language::get(), VectorIndex::isOpenEnd(), FFTData::lines, max, Indices::row, MemoryManager::setHeadLineElement(), VectorIndex::setRange(), VectorIndex::size(), toString(), and MemoryManager::writeToTable().

Referenced by fastFourierTransform().

Here is the call graph for this function:

◆ calculateMedian()

static double calculateMedian ( value_type v,
int  nResults,
int  start,
int  nOrder,
int  nanShiftStart,
int &  nNewNanShift 
)
static

Static helper function for findExtremaInData.

Parameters
vvalue_type*
nResultsint
startint
nOrderint
nanShiftStartint
nNewNanShiftint&
Returns
double

Definition at line 1272 of file command_implementations.cpp.

References mu::isnan(), and mu::real().

Referenced by findExtremaInData().

Here is the call graph for this function:

◆ calculateSplines()

bool calculateSplines ( CommandLineParser cmdParser)

This function approximates the passed data set using cubic splines.

Parameters
cmdParserCommandLineParser&
Returns
bool

The calculated spline polynomials are defined as new custom functions.

Definition at line 4253 of file command_implementations.cpp.

References _lang, NumeReKernel::bSupressAnswer, FunctionDefinitionManager::defineFunc(), extractRange(), Language::get(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), NumeReKernel::getDefinitions(), CommandLineParser::getExprAsDataObject(), NumeReKernel::getInstance(), NumeReKernel::getSettings(), FunctionDefinitionManager::isDefined(), NumeReKernel::issueWarning(), NumeReKernel::print(), Settings::systemPrints(), SyntaxError::TABLE_DOESNT_EXIST, SyntaxError::TOO_FEW_DATAPOINTS, and toString().

Referenced by cmd_spline().

Here is the call graph for this function:

◆ createDatagrid()

bool createDatagrid ( CommandLineParser cmdParser)

This function calculates a datagrid from passed functions or (x-y-z) data values.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 3312 of file command_implementations.cpp.

References _defVars, date::abs(), CommandLineParser::clearReturnValue(), Indices::col, mu::ParserBase::Eval(), expandVectorToDatagrid(), CommandLineParser::exprContainsDataObjects(), VectorIndex::front(), MemoryManager::getColElements(), MemoryManager::getCols(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), MemoryManager::getElement(), CommandLineParser::getExprAsDataObject(), CommandLineParser::getExprAsMathExpression(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getParser(), getSamplesForDatagrid(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), intCast(), IntervalSet::intervals, VectorIndex::INVALID, SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, DataAccessParser::isCluster(), VectorIndex::isOpenEnd(), isValidIndexSet(), CommandLineParser::parseIntervals(), Indices::row, mu::ParserBase::SetExpr(), MemoryManager::setHeadLineElement(), VectorIndex::setRange(), CommandLineParser::setReturnValue(), IntervalSet::size(), VectorIndex::size(), VectorIndex::subidx(), SyntaxError::TABLE_DOESNT_EXIST, VectorIndex::to_string(), SyntaxError::TOO_FEW_DATAPOINTS, toString(), DefaultVariables::vValue, and MemoryManager::writeToTable().

Referenced by cmd_datagrid().

Here is the call graph for this function:

◆ detectPhaseOverflow()

static bool detectPhaseOverflow ( std::complex< double >  cmplx[3])
static

This static function is a helper function for fastFourierTransform() and detects phase overflows, which can be reconstructed during calculations.

Parameters
cmplxstd::complex<double>[3]
Returns
bool

Definition at line 2499 of file command_implementations.cpp.

References M_PI.

Referenced by calculate1dFFT().

◆ differentiate()

bool differentiate ( CommandLineParser cmdParser)

Calculate the numerical differential of the passed expression or data set.

Parameters
cmdParserCommandLineParser
Returns
bool

Definition at line 754 of file command_implementations.cpp.

References _lang, date::abs(), NumeRe::SavitzkyGolayDiffFilter::apply(), FunctionDefinitionManager::call(), Indices::col, MemoryManager::containsTablesOrClusters(), mu::Parser::Diff(), mu::ParserBase::Eval(), VectorIndex::front(), SyntaxError::FUNCTION_ERROR, Language::get(), CommandLineParser::getCommandLine(), getDataElements(), DataAccessParser::getDataObject(), NumeReKernel::getDefinitions(), MemoryManager::getElement(), CommandLineParser::getExprAsDataObject(), CommandLineParser::getExprAsMathExpression(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), MemoryManager::getLines(), getMatchingParenthesis(), NumeReKernel::getMemoryManager(), getNextArgument(), CommandLineParser::getParameterList(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getParser(), getPointerToVariable(), NumeReKernel::getSettings(), CommandLineParser::hasParam(), intCast(), intPower(), SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, mu::isinf(), mu::isnan(), isNotEmptyExpression(), VectorIndex::isOpenEnd(), NumeReKernel::issueWarning(), MemoryManager::isValidElement(), isValidIndexSet(), min, SyntaxError::NO_DIFF_OPTIONS, SyntaxError::NO_DIFF_VAR, Indices::row, mu::ParserBase::SetExpr(), VectorIndex::setRange(), CommandLineParser::setReturnValue(), VectorIndex::size(), MemoryManager::sortElements(), SyntaxError::STRINGS_MAY_NOT_BE_EVALUATED_WITH_CMD, StripSpaces(), VectorIndex::to_string(), and MemoryManager::writeToTable().

Referenced by cmd_diff().

Here is the call graph for this function:

◆ evalPoints()

◆ expandVectorToDatagrid()

static void expandVectorToDatagrid ( IntervalSet ivl,
vector< vector< mu::value_type > > &  vZVals,
size_t  nSamples_x,
size_t  nSamples_y 
)
static

This function will expand the z vector into a z matrix using triangulation.

Parameters
ivlIntervalSet&
vZValsvector<vector<mu::value_type>>&
nSamples_xsize_t
nSamples_ysize_t
Returns
void

Definition at line 3549 of file command_implementations.cpp.

References mu::real().

Referenced by createDatagrid().

Here is the call graph for this function:

◆ fastFourierTransform()

◆ fastWaveletTransform()

◆ findExtrema()

bool findExtrema ( CommandLineParser cmdParser)

This function is a wrapper to the actual extrema localisation function localizeExtremum() further below.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 1398 of file command_implementations.cpp.

References date::abs(), FunctionDefinitionManager::call(), MemoryManager::containsTablesOrClusters(), mu::Parser::Diff(), mu::ParserBase::Eval(), CommandLineParser::exprContainsDataObjects(), SyntaxError::EXTREMA_VAR_NOT_FOUND, findCommand(), findExtremaInData(), findExtremaInMultiResult(), findParameter(), findVariableInExpression(), getAllIndices(), getArgAtPos(), CommandLineParser::getCommandLine(), getDataElements(), NumeReKernel::getDefinitions(), CommandLineParser::getExpr(), NumeReKernel::getInstance(), getIntervalForSearchFunctions(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), NumeReKernel::getParser(), getPointerToVariable(), Settings::getPrecision(), NumeReKernel::getSettings(), NumeReKernel::getStringParser(), intCast(), SyntaxError::invalid_position, mu::isinf(), mu::isnan(), isNotEmptyExpression(), NumeRe::StringParser::isStringExpression(), localizeExtremum(), SyntaxError::NO_EXTREMA_OPTIONS, SyntaxError::NO_EXTREMA_VAR, mu::real(), mu::ParserBase::SetExpr(), CommandLineParser::setReturnValue(), SyntaxError::STRINGS_MAY_NOT_BE_EVALUATED_WITH_CMD, StripSpaces(), and toString().

Referenced by cmd_extrema().

Here is the call graph for this function:

◆ findExtremaInData()

static bool findExtremaInData ( CommandLineParser cmdParser,
string &  sExpr,
int  nOrder,
int  nMode 
)
static

This static function finds extrema in the selected data sets.

Parameters
cmdParserCommandLineParser&
sExprstring&
nOrderint
nModeint
Returns
bool

Definition at line 1303 of file command_implementations.cpp.

References calculateMedian(), mu::ParserBase::Eval(), CommandLineParser::getCommandLine(), NumeReKernel::getInstance(), NumeReKernel::getParser(), SyntaxError::invalid_position, SyntaxError::NO_EXTREMA_VAR, mu::real(), mu::ParserBase::SetExpr(), and CommandLineParser::setReturnValue().

Referenced by findExtrema().

Here is the call graph for this function:

◆ findExtremaInMultiResult()

static bool findExtremaInMultiResult ( CommandLineParser cmdParser,
string &  sExpr,
string &  sInterval,
int  nOrder,
int  nMode 
)
static

This static function finds extrema in a multi-result expression, i.e. an expression containing a table or similar.

Parameters
cmdParserCommandLineParser&
sExprstring&
sIntervalstring&
nOrderint
nModeint
Returns
bool

Definition at line 1123 of file command_implementations.cpp.

References date::abs(), mu::ParserBase::Eval(), MemoryManager::getElement(), NumeReKernel::getInstance(), MemoryManager::getLines(), NumeReKernel::getParser(), mu::isnan(), mu::ParserBase::SetExpr(), CommandLineParser::setReturnValue(), MemoryManager::sortElements(), and MemoryManager::writeToTable().

Referenced by findExtrema().

Here is the call graph for this function:

◆ findZeroes()

bool findZeroes ( CommandLineParser cmdParser)

◆ findZeroesInData()

static bool findZeroesInData ( CommandLineParser cmdParser,
string &  sExpr,
int  nMode 
)
static

This static function finds zeroes in the selected data set.

Parameters
cmdParserCommandLineParser&
sExprstring&
nModeint
Returns
bool

Definition at line 1770 of file command_implementations.cpp.

References date::abs(), mu::ParserBase::Eval(), CommandLineParser::getCommandLine(), NumeReKernel::getInstance(), NumeReKernel::getParser(), SyntaxError::invalid_position, mu::isnan(), SyntaxError::NO_ZEROES_VAR, mu::real(), mu::ParserBase::SetExpr(), and CommandLineParser::setReturnValue().

Referenced by findZeroes().

Here is the call graph for this function:

◆ findZeroesInMultiResult()

static bool findZeroesInMultiResult ( CommandLineParser cmdParser,
string &  sExpr,
string &  sInterval,
int  nMode 
)
static

This static function finds zeroes in a multi-result expression, i.e. an expression containing a table or similar.

Parameters
cmdParserCommandLineParser&
sExprstring&
sIntervalstring&
nModeint
Returns
bool

Definition at line 1666 of file command_implementations.cpp.

References mu::ParserBase::Eval(), MemoryManager::getElement(), NumeReKernel::getInstance(), MemoryManager::getLines(), NumeReKernel::getParser(), mu::isnan(), Linearize(), mu::ParserBase::SetExpr(), CommandLineParser::setReturnValue(), MemoryManager::sortElements(), and MemoryManager::writeToTable().

Referenced by findZeroes().

Here is the call graph for this function:

◆ getIntervalForSearchFunctions()

static string getIntervalForSearchFunctions ( const string &  sParams,
string &  sVar 
)
static

This static function extracts the interval definition for the extrema and root search functions.

Parameters
sParamsconst string&
sVarstring&
Returns
string

Definition at line 1075 of file command_implementations.cpp.

References getArgAtPos(), getMatchingParenthesis(), and StripSpaces().

Referenced by findExtrema(), and findZeroes().

Here is the call graph for this function:

◆ getSamplesForDatagrid()

static vector< size_t > getSamplesForDatagrid ( CommandLineParser cmdParser,
const std::vector< size_t > &  nSamples 
)
static

◆ getShiftedAxis()

static std::vector< size_t > getShiftedAxis ( size_t  nElements,
bool  inverseTrafo 
)
static

Calculates an axis index, which performs the necessary data flips used for the shifted fft axis.

Parameters
nElementssize_t
inverseTrafobool
Returns
std::vector<size_t>

Definition at line 2515 of file command_implementations.cpp.

Referenced by calculate1dFFT(), and fastFourierTransform().

◆ integrate()

bool integrate ( CommandLineParser cmdParser)

Calculate the integral of a function or a data set in a single dimension.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 272 of file command_implementations.cpp.

References _defVars, _lang, date::abs(), mu::ParserBase::Eval(), Language::get(), NumeReKernel::GetAsyncCancelState(), CommandLineParser::getCommandLine(), CommandLineParser::getExprAsMathExpression(), NumeReKernel::getInstance(), getMatchingParenthesis(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValue(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getParser(), NumeReKernel::getSettings(), CommandLineParser::hasParam(), intCast(), integrateSingleDimensionData(), integrationstep_simpson(), integrationstep_trapezoidal(), SyntaxError::INVALID_INTEGRATION_PRECISION, SyntaxError::INVALID_INTEGRATION_RANGES, SyntaxError::invalid_position, mu::isinf(), mu::isnan(), MemoryManager::isTable(), max, min, SyntaxError::NO_INTEGRATION_FUNCTION, SyntaxError::NO_INTEGRATION_RANGES, CommandLineParser::parseIntervals(), NumeReKernel::printPreFmt(), SyntaxError::PROCESS_ABORTED_BY_USER, mu::rint(), mu::ParserBase::SetExpr(), CommandLineParser::setReturnValue(), SIMPSON, IntervalSet::size(), SyntaxError::STRINGS_MAY_NOT_BE_EVALUATED_WITH_CMD, Settings::systemPrints(), toString(), TRAPEZOIDAL, and DefaultVariables::vValue.

Referenced by cmd_integrate().

Here is the call graph for this function:

◆ integrate2d()

◆ integrateSingleDimensionData()

static vector< mu::value_type > integrateSingleDimensionData ( CommandLineParser cmdParser)
static

This static function integrates single dimension data.

Parameters
cmdParser&ComandLineParser
Returns
vector<double>

Definition at line 162 of file command_implementations.cpp.

References Indices::col, DataAccessParser::evalIndices(), DataAccessParser::getDataObject(), MemoryManager::getElement(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), MemoryManager::getLines(), NumeReKernel::getMemoryManager(), CommandLineParser::hasParam(), IntervalSet::intervals, MemoryManager::isValidElement(), CommandLineParser::parseIntervals(), Indices::row, VectorIndex::size(), MemoryManager::sortElements(), MemoryManager::sum(), and MemoryManager::writeToTable().

Referenced by integrate().

Here is the call graph for this function:

◆ integrationstep_simpson()

static void integrationstep_simpson ( mu::value_type x,
mu::value_type  x0,
mu::value_type  x1,
double  dx,
vector< mu::value_type > &  vResult,
vector< mu::value_type > &  vFunctionValues,
bool  bReturnFunctionPoints 
)
static

This static function performs an integration step using the Simpson approximation algorithm.

Parameters
xmu::value_type&
x0mu::value_type
x1mu::value_type
dxdouble
vResultvector<mu::value_type>&
vFunctionValuesvector<mu::value_type>&
bReturnFunctionPointsbool
Returns
void

Definition at line 109 of file command_implementations.cpp.

References date::abs(), mu::ParserBase::Eval(), NumeReKernel::getInstance(), NumeReKernel::getParser(), and mu::isnan().

Referenced by integrate(), and integrate2d().

Here is the call graph for this function:

◆ integrationstep_trapezoidal()

static void integrationstep_trapezoidal ( mu::value_type x,
mu::value_type  x0,
mu::value_type  dx,
vector< mu::value_type > &  vResult,
vector< mu::value_type > &  vFunctionValues,
bool  bReturnFunctionPoints 
)
static

This static function performs an integration step using a trapezoidal approximation algorithm.

Parameters
xmu::value_type&
x0mu::value_type
dxmu::value_type
vResultvector<mu::value_type>&
vFunctionValuesvector<mu::value_type>&
bReturnFunctionPointsbool
Returns
void

Definition at line 60 of file command_implementations.cpp.

References mu::ParserBase::Eval(), NumeReKernel::getInstance(), NumeReKernel::getParser(), mu::imag(), mu::isnan(), and mu::real().

Referenced by integrate(), and integrate2d().

Here is the call graph for this function:

◆ interpolateToGrid()

static double interpolateToGrid ( const std::vector< double > &  vAxis,
double  dInterpolVal,
bool  bExtent = false 
)
static

This static function is a helper for boneDetection to map/interpolate the calculated values to the final grid.

Parameters
vAxisconst std::vector<double>&
dInterpolValdouble
bExtentbool
Returns
double

Definition at line 4094 of file command_implementations.cpp.

References intCast(), and mu::isnan().

Referenced by boneDetection(), and rotateTable().

Here is the call graph for this function:

◆ localizeExtremum()

static mu::value_type localizeExtremum ( string &  sCmd,
mu::value_type dVarAdress,
Parser _parser,
const Settings _option,
mu::value_type  dLeft,
mu::value_type  dRight,
double  dEps,
int  nRecursion 
)
static

This function searches for the positions of all extrema, which are located in the selected interval.

Parameters
sCmdstring&
dVarAdressmu::value_type*
_parserParser&
_optionconst Settings&
dLeftmu::value_type
dRightmu::value_type
dEpsdouble
nRecursionint
Returns
mu::value_type

The expression has to be setted in advance. The function performs recursions until the defined precision is reached.

Definition at line 2118 of file command_implementations.cpp.

References date::abs(), mu::Parser::Diff(), mu::ParserBase::Eval(), mu::ParserBase::GetExpr(), Linearize(), localizeExtremum(), mu::real(), and mu::ParserBase::SetExpr().

Referenced by findExtrema(), findZeroes(), and localizeExtremum().

Here is the call graph for this function:

◆ localizeZero()

static mu::value_type localizeZero ( string &  sCmd,
mu::value_type dVarAdress,
Parser _parser,
const Settings _option,
mu::value_type  dLeft,
mu::value_type  dRight,
double  dEps,
int  nRecursion 
)
static

This function searches for the positions of all zeroes (roots), which are located in the selected interval.

Parameters
sCmdstring&
dVarAdressmu::value_type*
_parserParser&
_optionconst Settings&
dLeftmu::value_type
dRightmu::value_type
dEpsdouble
nRecursionint
Returns
mu::value_type

The expression has to be setted in advance. The function performs recursions until the defined precision is reached.

Definition at line 2214 of file command_implementations.cpp.

References date::abs(), mu::ParserBase::Eval(), mu::ParserBase::GetExpr(), Linearize(), localizeZero(), mu::real(), and mu::ParserBase::SetExpr().

Referenced by findZeroes(), and localizeZero().

Here is the call graph for this function:

◆ parser_Random()

value_type parser_Random ( const value_type vRandMin,
const value_type vRandMax 
)

This function returns a uniformly distributed random number between both boundaries.

Parameters
vRandMinconst value_type&
vRandMaxconst value_type&
Returns
value_type

Definition at line 1834 of file functionimplementation.cpp.

References getRandGenInstance(), mu::isinf(), and mu::isnan().

Referenced by NumeReKernel::defineFunctions(), and particleSwarmOptimizer().

Here is the call graph for this function:

◆ particleSwarmOptimizer()

void particleSwarmOptimizer ( CommandLineParser cmdParser)

This function implements a particle swarm optimizer in up to four dimensions (depending on the number of intervals defined). The optimizer has an adaptive velocity part, reducing the overall position variation of the particles over time.

Parameters
cmdParserCommandLineParser&
Returns
void

Definition at line 4547 of file command_implementations.cpp.

References _defVars, mu::ParserBase::Eval(), CommandLineParser::getExprAsMathExpression(), NumeReKernel::getInstance(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getParser(), intCast(), IntervalSet::intervals, max, min, CommandLineParser::parseIntervals(), parser_Random(), mu::real(), mu::ParserBase::SetExpr(), CommandLineParser::setReturnValue(), IntervalSet::size(), and DefaultVariables::vValue.

Referenced by cmd_pso().

Here is the call graph for this function:

◆ readAudioFile()

bool readAudioFile ( CommandLineParser cmdParser)

◆ refreshBoundaries()

static void refreshBoundaries ( IntervalSet ivl,
const string &  sIntegrationExpression 
)
static

This static function re-evaluates the boundary expression and updates the internal variables correspondingly.

Parameters
ivlIntervalSet&
y0double&
y1double&
sIntegrationExpressionconst string&
Returns
void

Definition at line 464 of file command_implementations.cpp.

References NumeReKernel::getInstance(), NumeReKernel::getParser(), and mu::ParserBase::SetExpr().

Referenced by integrate2d().

Here is the call graph for this function:

◆ regularizeDataSet()

bool regularizeDataSet ( CommandLineParser cmdParser)

This function regularizes the samples of a defined x-y-data array such that DeltaX is equal for every x.

Parameters
CommandLineParser&cmdParser
Returns
bool

Definition at line 3851 of file command_implementations.cpp.

References extractRange(), MemoryManager::getCols(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsNumericalValue(), intCast(), VectorIndex::OPEN_END, mu::real(), MemoryManager::setHeadLineElement(), SyntaxError::TABLE_DOESNT_EXIST, and MemoryManager::writeToTable().

Referenced by cmd_regularize().

Here is the call graph for this function:

◆ removeQuotationMarks()

std::string removeQuotationMarks ( const std::string &  sString)

This function simply removes the surrounding quotation marks.

Parameters
sStringconst std::string&
Returns
std::string

Definition at line 79 of file stringfunctions.hpp.

◆ rotateTable()

◆ seekInAudioFile()

◆ shortTimeFourierAnalysis()

◆ taylor()

◆ urlExecute()

void urlExecute ( CommandLineParser cmdParser)

This function implements the url command providing an interface to http(s) and (s)ftp URLs.

Parameters
cmdParserCommandLineParser&
Returns
void

Definition at line 4700 of file command_implementations.cpp.

References SyntaxError::CANNOT_OPEN_TARGET, url::get(), CommandLineParser::getCommandLine(), CommandLineParser::getFileParameterValue(), CommandLineParser::getFileParameterValueForSaving(), CommandLineParser::getParameterValueAsString(), CommandLineParser::hasParam(), CommandLineParser::parseExprAsString(), url::put(), replaceAll(), CommandLineParser::setReturnValue(), toString(), date::detail::trunc(), SyntaxError::URL_ERROR, and url::Error::what().

Referenced by cmd_url().

Here is the call graph for this function:

◆ writeAudioFile()

Variable Documentation

◆ _defVars