NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <wx/image.h>
#include "dataops.hpp"
#include "container.hpp"
#include "../../kernel.hpp"
#include "../ui/language.hpp"
#include "../utils/tools.hpp"
#include "../utils/BasicExcel.hpp"
#include "../ui/error.hpp"
#include "../structures.hpp"
#include "../built-in.hpp"
#include "../maths/parser_functions.hpp"
Go to the source code of this file.
Functions | |
std::string | removeQuotationMarks (const std::string &) |
This function simply removes the surrounding quotation marks. More... | |
static void | evaluateTransposeForDataOperation (const string &sTarget, Indices &_iSourceIndex, Indices &_iTargetIndex, const MemoryManager &_data, bool bTranspose) |
This function evaluates the transpose flag and switches the indices correspondingly. More... | |
static void | performDataOperation (const string &sSource, const string &sTarget, const Indices &_iSourceIndex, const Indices &_iTargetIndex, MemoryManager &_data, bool bMove, bool bTranspose) |
This function will perform the actual data operation. More... | |
void | load_data (MemoryManager &_data, Settings &_option, Parser &_parser, string sFileName) |
This function is a wrapper for the Datafile object. It will simply do the whole UI stuff and let the Datafile object do the hard work. More... | |
static std::string ** | make_stringmatrix (MemoryManager &_data, Output &_out, Settings &_option, const std::string &sCache, long long int &nLines, long long int &nCols, int &nHeadlineCount, size_t nPrecision, bool bSave) |
This function transforms the data into a string matrix and returns the corresponding pointer. More... | |
void | show_data (MemoryManager &_data, Output &_out, Settings &_option, const string &_sCache, size_t nPrecision) |
This function presents the passed data to the user in a visual way. More... | |
void | append_data (CommandLineParser &cmdParser) |
This function handles appending data sets to already existing data. More... | |
void | clear_cache (MemoryManager &_data, Settings &_option, bool bIgnore) |
This function removes all allocated tables and frees the assigned memory. More... | |
static bool | searchAndDeleteTable (const string &sCache, Parser &_parser, MemoryManager &_data, const Settings &_option) |
This static function searches for the named table in the cache map, evaluates the specified indices and deletes the corresponding contents from the table. More... | |
static bool | searchAndDeleteCluster (const string &sCluster, Parser &_parser, MemoryManager &_data, const Settings &_option) |
This static function searches for the named cluster in the cluster map, evaluates the specified indices and deletes the corresponding contents from the cluster. More... | |
bool | deleteCacheEntry (CommandLineParser &cmdParser) |
This function removes one or multiple entries in the selected table or cluster. More... | |
bool | CopyData (CommandLineParser &cmdParser) |
This function copies whole chunks of data between tables. More... | |
bool | moveData (CommandLineParser &cmdParser) |
This function will move the selected part of a data table to a new location. More... | |
static bool | sortStrings (CommandLineParser &cmdParser, Indices &_idx) |
This static function sorts strings and is called by sortData, if the selected data object equals "string". More... | |
static bool | sortClusters (CommandLineParser &cmdParser, const string &sCluster, Indices &_idx) |
This static function sorts clusters and is called by sortData, if the selected data object equals a cluster identifier. More... | |
bool | sortData (CommandLineParser &cmdParser) |
This function is a wrapper for the corresponding member function of the Datafile object. More... | |
bool | writeToFile (CommandLineParser &cmdParser) |
This function writes the string contents in the command to a file. More... | |
bool | readFromFile (CommandLineParser &cmdParser) |
This function reads the content of a file as strings and copies them to a temporary string vector variable. More... | |
bool | readImage (CommandLineParser &cmdParser) |
This function reads image data from an image file and stores it as a cache table. More... | |
Variables | |
Language | _lang |
void append_data | ( | CommandLineParser & | cmdParser | ) |
This function handles appending data sets to already existing data.
cmdParser | CommandLineParser& |
Definition at line 346 of file dataops.cpp.
References _lang, SyntaxError::FILE_NOT_EXIST, Language::get(), MemoryManager::getCols(), CommandLineParser::getCommandLine(), getFileList(), NumeReKernel::getInstance(), MemoryManager::getLines(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getSettings(), CommandLineParser::hasParam(), intCast(), SyntaxError::invalid_position, MemoryManager::isEmpty(), LineBreak(), NumeRe::FileHeaderInfo::nCols, NumeRe::FileHeaderInfo::nRows, NumeRe::FileAdapter::openFile(), CommandLineParser::parseExprAsString(), NumeReKernel::print(), NumeRe::FileAdapter::setbLoadEmptyColsInNextFile(), NumeRe::FileHeaderInfo::sFileName, Settings::systemPrints(), and toString().
Referenced by cmd_append(), cmd_load(), and load_data().
void clear_cache | ( | MemoryManager & | _data, |
Settings & | _option, | ||
bool | bIgnore | ||
) |
This function removes all allocated tables and frees the assigned memory.
_data | Datafile& |
_option | Settings& |
bIgnore | bool |
Definition at line 428 of file dataops.cpp.
References _lang, Language::get(), Settings::getExePath(), NumeReKernel::getline(), Settings::getSavePath(), MemoryManager::getSaveStatus(), MemoryManager::isValid(), LineBreak(), NumeReKernel::print(), NumeReKernel::printPreFmt(), MemoryManager::removeTablesFromMemory(), Settings::systemPrints(), and Language::YES().
Referenced by cmd_clear().
bool CopyData | ( | CommandLineParser & | cmdParser | ) |
This function copies whole chunks of data between tables.
cmdParser | CommandLineParser& |
Definition at line 620 of file dataops.cpp.
References DataAccessParser::evalIndices(), evaluateTransposeForDataOperation(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), and performDataOperation().
Referenced by cmd_copy().
bool deleteCacheEntry | ( | CommandLineParser & | cmdParser | ) |
This function removes one or multiple entries in the selected table or cluster.
cmdParser | CommandLineParser& |
Definition at line 579 of file dataops.cpp.
References CommandLineParser::getExpr(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), getNextArgument(), NumeReKernel::getParser(), NumeReKernel::getSettings(), NumeRe::ClusterManager::isCluster(), searchAndDeleteCluster(), searchAndDeleteTable(), and StripSpaces().
Referenced by cmd_delete().
|
static |
This function evaluates the transpose flag and switches the indices correspondingly.
sTarget | const string& |
_iSourceIndex | Indices& |
_iTargetIndex | Indices& |
_data | const Datafile& |
bTranspose | bool |
Definition at line 698 of file dataops.cpp.
References Indices::col, VectorIndex::front(), MemoryManager::getCols(), VectorIndex::isOpenEnd(), isValidIndexSet(), Indices::row, and VectorIndex::size().
Referenced by CopyData(), and moveData().
void load_data | ( | MemoryManager & | _data, |
Settings & | _option, | ||
Parser & | _parser, | ||
string | sFileName | ||
) |
This function is a wrapper for the Datafile object. It will simply do the whole UI stuff and let the Datafile object do the hard work.
_data | Datafile& |
_option | Settings& |
_parser | Parser& |
sFileName | string |
Definition at line 53 of file dataops.cpp.
References _lang, append_data(), CommandLineParser::CMD_DAT_PAR, Language::get(), NumeRe::FileAdapter::getDataFileName(), NumeReKernel::getline(), FileSystem::getPath(), MemoryManager::isEmpty(), LineBreak(), NumeRe::FileAdapter::openFile(), NumeReKernel::print(), NumeReKernel::printPreFmt(), MemoryManager::removeData(), StripSpaces(), and Language::YES().
Referenced by cmd_load().
|
static |
This function transforms the data into a string matrix and returns the corresponding pointer.
_data | Datafile& |
_out | Output& |
_option | Settings& |
sCache | const std::string& |
nLines | long longint& |
nCols | long longint& |
nHeadlineCount | int& |
nPrecision | size_t |
bSave | bool |
Definition at line 147 of file dataops.cpp.
References date::abs(), MemoryManager::getCols(), MemoryManager::getElement(), MemoryManager::getHeadlineCount(), MemoryManager::getHeadLineElement(), MemoryManager::getLines(), MemoryManager::getTopHeadLineElement(), SyntaxError::invalid_position, Output::isCompact(), Settings::isDeveloperMode(), mu::isinf(), MemoryManager::isValidElement(), SyntaxError::NO_CACHED_DATA, NumeReKernel::print(), Output::setCompact(), toString(), and Settings::useExternalDocWindow().
Referenced by show_data().
bool moveData | ( | CommandLineParser & | cmdParser | ) |
This function will move the selected part of a data table to a new location.
cmdParser | CommandLineParser& |
Definition at line 655 of file dataops.cpp.
References DataAccessParser::evalIndices(), evaluateTransposeForDataOperation(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), and performDataOperation().
Referenced by cmd_move().
|
static |
This function will perform the actual data operation.
sSource | const string& |
sTarget | const string& |
_iSourceIndex | const Indices& |
_iTargetIndex | const Indices& |
_data | Datafile& |
bMove | bool |
bTranspose | bool |
Definition at line 757 of file dataops.cpp.
References Indices::col, MemoryManager::deleteEntry(), MemoryManager::getCols(), MemoryManager::getElement(), MemoryManager::getHeadLineElement(), MemoryManager::getLines(), MemoryManager::isValidElement(), Indices::row, MemoryManager::setHeadLineElement(), VectorIndex::size(), and MemoryManager::writeToTable().
Referenced by CopyData(), and moveData().
bool readFromFile | ( | CommandLineParser & | cmdParser | ) |
This function reads the content of a file as strings and copies them to a temporary string vector variable.
cmdParser | CommandLineParser& |
Definition at line 1145 of file dataops.cpp.
References SyntaxError::CANNOT_READ_FILE, getAllArguments(), CommandLineParser::getCommandLine(), CommandLineParser::getExprAsFileName(), StyledTextFile::getLine(), StyledTextFile::getLinesCount(), CommandLineParser::getParameterValueAsString(), StyledTextFile::getStrippedLine(), CommandLineParser::hasParam(), SyntaxError::invalid_position, SyntaxError::NO_FILENAME, removeQuotationMarks(), replaceAll(), StyledTextFile::reStyle(), CommandLineParser::setReturnValue(), and StripSpaces().
Referenced by cmd_read().
bool readImage | ( | CommandLineParser & | cmdParser | ) |
This function reads image data from an image file and stores it as a cache table.
CommandLineParser& | cmdParser |
Definition at line 1234 of file dataops.cpp.
References SyntaxError::CANNOT_READ_FILE, Indices::col, DetachedLogger::debug(), VectorIndex::front(), g_logger, CommandLineParser::getCommandLine(), CommandLineParser::getExprAsFileName(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsString(), MemoryManager::getTable(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), DetachedLogger::info(), VectorIndex::INVALID, SyntaxError::invalid_position, VectorIndex::isOpenEnd(), Memory::markModified(), VectorIndex::max(), max, VectorIndex::min(), SyntaxError::NO_FILENAME, Indices::row, MemoryManager::setHeadLineElement(), Memory::setHeadLineElement(), VectorIndex::setRange(), CommandLineParser::setReturnValue(), VectorIndex::subidx(), toString(), Memory::writeData(), and Memory::writeDataDirectUnsafe().
Referenced by cmd_imread().
std::string removeQuotationMarks | ( | const std::string & | sString | ) |
This function simply removes the surrounding quotation marks.
sString | const std::string& |
Definition at line 79 of file stringfunctions.hpp.
Referenced by readFromFile().
|
static |
This static function searches for the named cluster in the cluster map, evaluates the specified indices and deletes the corresponding contents from the cluster.
sCluster | const string& |
_parser | Parser& |
_data | Datafile& |
_option | const Settings& |
Definition at line 540 of file dataops.cpp.
References NumeRe::Cluster::deleteItems(), NumeRe::ClusterManager::getCluster(), NumeRe::ClusterManager::getClusterMap(), getIndices(), VectorIndex::isOpenEnd(), isValidIndexSet(), Indices::row, VectorIndex::setRange(), and NumeRe::Cluster::size().
Referenced by deleteCacheEntry().
|
static |
This static function searches for the named table in the cache map, evaluates the specified indices and deletes the corresponding contents from the table.
sCache | const string& |
_parser | Parser& |
_data | Datafile& |
_option | const Settings& |
Definition at line 483 of file dataops.cpp.
References Indices::col, NumeRe::TableMetaData::comment, MemoryManager::deleteBulk(), MemoryManager::getCols(), getIndices(), MemoryManager::getLines(), MemoryManager::getMetaData(), MemoryManager::getTableMap(), MemoryManager::isEmpty(), VectorIndex::isOpenEnd(), isValidIndexSet(), NumeRe::TableMetaData::modify(), Indices::row, MemoryManager::setMetaData(), VectorIndex::setRange(), and NumeRe::TableMetaData::source.
Referenced by deleteCacheEntry().
void show_data | ( | MemoryManager & | _data, |
Output & | _out, | ||
Settings & | _option, | ||
const string & | _sCache, | ||
size_t | nPrecision | ||
) |
This function presents the passed data to the user in a visual way.
Definition at line 281 of file dataops.cpp.
References MemoryManager::extractTable(), Output::format(), NumeRe::FileAdapter::getDataFileName(), SyntaxError::invalid_position, MemoryManager::isValid(), make_hline(), make_stringmatrix(), SyntaxError::NO_CACHED_DATA, NumeReKernel::print(), Output::reset(), Output::setPluginName(), Output::setPrefix(), NumeReKernel::showTable(), NumeReKernel::toggleTableStatus(), toUpperCase(), and Settings::useExternalDocWindow().
Referenced by cmd_show().
|
static |
This static function sorts clusters and is called by sortData, if the selected data object equals a cluster identifier.
cmdParser | CommandLineParser& |
sCluster | const string& |
_idx | Indices& |
Definition at line 891 of file dataops.cpp.
References VectorIndex::back(), CommandLineParser::clearReturnValue(), VectorIndex::front(), NumeRe::ClusterManager::getCluster(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), VectorIndex::isOpenEnd(), Indices::row, VectorIndex::setRange(), CommandLineParser::setReturnValue(), NumeRe::Cluster::size(), and NumeRe::Cluster::sortElements().
Referenced by sortData().
bool sortData | ( | CommandLineParser & | cmdParser | ) |
This function is a wrapper for the corresponding member function of the Datafile object.
cmdParser | CommandLineParser& |
Definition at line 933 of file dataops.cpp.
References CommandLineParser::clearReturnValue(), Indices::col, DataAccessParser::evalIndices(), VectorIndex::front(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, DataAccessParser::isCluster(), isValidIndexSet(), VectorIndex::last(), Indices::row, CommandLineParser::setReturnValue(), sortClusters(), MemoryManager::sortElements(), sortStrings(), SyntaxError::TABLE_DOESNT_EXIST, and VectorIndex::to_string().
Referenced by cmd_sort().
|
static |
This static function sorts strings and is called by sortData, if the selected data object equals "string".
cmdParser | CommandLineParser& |
_idx | Indices& |
Definition at line 844 of file dataops.cpp.
References VectorIndex::back(), CommandLineParser::clearReturnValue(), Indices::col, VectorIndex::front(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), StringMemory::getStringCols(), StringMemory::getStringElements(), VectorIndex::isOpenEnd(), Indices::row, VectorIndex::setRange(), CommandLineParser::setReturnValue(), and StringMemory::sortStringElements().
Referenced by sortData().
bool writeToFile | ( | CommandLineParser & | cmdParser | ) |
This function writes the string contents in the command to a file.
cmdParser | CommandLineParser& |
Definition at line 998 of file dataops.cpp.
References SyntaxError::CANNOT_READ_FILE, NumeRe::StringParser::evalAndFormat(), fileExists(), SyntaxError::FILETYPE_MAY_NOT_BE_WRITTEN, CommandLineParser::getCommandLine(), CommandLineParser::getExpr(), CommandLineParser::getFileParameterValueForSaving(), NumeReKernel::getInstance(), getNextArgument(), CommandLineParser::getParameterList(), CommandLineParser::getParameterValue(), NumeReKernel::getStringParser(), CommandLineParser::hasParam(), FileSystem::initializeFromKernel(), SyntaxError::invalid_position, SyntaxError::NO_FILENAME, SyntaxError::NO_STRING_FOR_WRITING, sErrorToken, StripSpaces(), and date::detail::trunc().
Referenced by cmd_write().
|
extern |
Definition at line 39 of file kernel.cpp.
Referenced by MemoryManager::addTable(), analyzePulse(), append_data(), applyFitAlgorithm(), autoSave(), boneDetection(), FlowCtrl::calc(), calculate1dFFT(), calculate2dFFT(), calculateChiMap(), calculateSplines(), clear_cache(), cmd_audio(), cmd_audioread(), cmd_clear(), cmd_copy(), cmd_credits(), cmd_datagrid(), cmd_define(), cmd_delete(), cmd_find(), cmd_ifndefined(), cmd_load(), cmd_move(), cmd_plotting(), cmd_redefine(), cmd_regularize(), cmd_remove(), cmd_rename(), cmd_resample(), cmd_retouch(), cmd_seek(), cmd_set(), cmd_smooth(), cmd_start(), cmd_stfa(), cmd_workpath(), FlowCtrl::compile(), confirmOperation(), createOutputForHist1D(), createOutputForHist2D(), createPlotForHist1D(), Plot::createPlotOrAnimation(), createPlotsForHist2D(), createStatsFile(), createStatsOutput(), Plot::createSubPlotSet(), createTeXExport(), differentiate(), Plot::displayMessage(), doc_Help(), doc_HelpAsHTML(), doc_SearchFct(), editObject(), FlowCtrl::eval(), FlowCtrl::evalForkFlowCommands(), FlowCtrl::evalHeader(), FlowCtrl::evalRangeBasedHeader(), Script::evaluateInstallInformation(), ProcedureVarFactory::evaluateProcedureArguments(), executeCommand(), fastFourierTransform(), fastWaveletTransform(), NumeRe::DataBase::findRecordsUsingRelevance(), fitDataSet(), FlowCtrl::for_loop(), Output::format(), getDataForFit(), getErrorType(), getFitAnalysis(), getFitOptionsTable(), Documentation::getHelpArticle(), Script::getNextScriptCommandFromScript(), getPathForSetting(), NumeReDebugger::getStackTrace(), getStatFieldName(), Script::handleInstallInformation(), integrate(), integrate2d(), Language::Language(), listCommands(), listConstants(), listDeclaredVariables(), listDefinitions(), listDirectory(), listFiles(), listFunctions(), listInstalledPlugins(), listLogicalOperators(), listUnitConversions(), FunctionDefinitionManager::load(), load_data(), newObject(), Includer::openIncludedFile(), mu::ParserError::ParserError(), Plot::Plot(), plugin_random(), Output::print(), Output::print_legal(), FlowCtrl::range_based_for_loop(), Script::returnCommand(), rotateTable(), FunctionDefinitionManager::save(), Settings::save(), saveDataObject(), FlowCtrl::setCommand(), NumeReDebugger::showBreakPoint(), Odesolver::solve(), solveLGS(), solveLGSSymbolic(), strfnc_getkeyval(), strfnc_regex(), strfnc_weekday(), swapTables(), taylor(), NumeReDebugger::throwException(), toString(), undefineFunctions(), FlowCtrl::while_loop(), Script::writeProcedure(), and Procedure::writeProcedure().