JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
|
This class manages data columns (with entries of type double
), used by JKQTPlotter/JKQTBasePlotter to represent data for plots.
More...
#include <jkqtpdatastorage.h>
Public Member Functions | |
JKQTPDatastore () | |
class constructor, generates an empty datastore | |
~JKQTPDatastore () | |
class destructor, destroys all subordered JKQTPDatastoreItem objects | |
size_t | addCalculatedColumn (size_t rows, const std::function< double(size_t)> &f, const QString &name=QString("")) |
add a column with rows entries, that is calculated by calling f for each entry | |
size_t | addCalculatedColumn (size_t rows, const std::function< double(size_t, JKQTPDatastore *)> &f, const QString &name=QString("")) |
add a column with rows entries, that is calculated by calling f for each entry | |
size_t | addCalculatedColumnFromColumn (const std::pair< size_t, size_t > &otherColumn, const std::function< double(double, double)> &f, const QString &name=QString("")) |
size_t | addCalculatedColumnFromColumn (size_t otherColumn, const std::function< double(double)> &f, const QString &name=QString("")) |
add a column with the same number of entries, as in the other column otherColumn , that are calculated by calling f for each entry in otherColumn | |
size_t | addCalculatedColumnFromColumn (size_t otherColumnX, size_t otherColumnY, const std::function< double(double, double)> &f, const QString &name=QString("")) |
add a column with the same number of entries, as in the other column otherColumn , that are calculated by calling f for each pair of entries in otherColumnX and otherColumnY | |
size_t | addCalculatedImageColumn (size_t cols, size_t rows, const std::function< double(size_t, size_t)> &f, const QString &name=QString("")) |
add an image column with width cols and height rows (i.e. rows * cols entries), that is calculated by calling f for each entry | |
size_t | addColumn (const QString &name=QString("")) |
add a new and empty column to the datastore and return its column ID. The new item uses internal memory management. | |
size_t | addColumn (double *data, size_t rows, const QString &name=QString("")) |
add one external column to the datastore. It contains rows rows. This returns its logical column ID. Data is not owned by the JKQTPDatastore! | |
size_t | addColumn (size_t rows, const QString &name=QString("")) |
add a new columns with rows rows to the datastore and return its column ID. The new item uses internal memory management. | |
size_t | addColumnCalculatedFromColumn (size_t otherColumn, const std::function< double(double)> &f, const QString &name=QString("")) |
size_t | addColumnCalculatedFromColumn (size_t otherColumnX, size_t otherColumnY, const std::function< double(double, double)> &f, const QString &name=QString("")) |
template<typename T > | |
size_t | addCopiedColumn (const T *data, size_t rows, const QString &name=QString("")) |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename T > | |
size_t | addCopiedColumn (const T *data, size_t rows, size_t stride, const QString &name) |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename T > | |
size_t | addCopiedColumn (const T *data, size_t rows, size_t stride, int start, const QString &name) |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename TContainer > | |
size_t | addCopiedColumn (const TContainer &data, const QString &name, size_t stride, size_t start=0) |
add one external column to the datastore. It will be filled with the contents of vector data. | |
template<typename TContainer > | |
size_t | addCopiedColumn (const TContainer &data, const QString &name=QString("")) |
add one external column to the datastore. It will be filled with the contents of vector data. | |
template<typename TIterator > | |
size_t | addCopiedColumn (TIterator first, TIterator last, const QString &name=QString("")) |
add one column to the datastore. It will be filled with the values from first ... last | |
template<typename T > | |
size_t | addCopiedColumnMasked (const T *data, const bool *mask, size_t rows, const QString &name=QString(""), bool useIfMaskEquals=false) |
add one external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename TContainer , typename TContainerMask > | |
size_t | addCopiedColumnMasked (const TContainer &data, const TContainerMask &mask, const QString &name=QString(""), bool useIfMaskEquals=false) |
add one external column to the datastore. It will be filled with the contents of vector data. | |
template<typename T > | |
size_t | addCopiedImageAsColumn (const T *data, size_t width, size_t height, const QString &name=QString(""), size_t stride=1, size_t start=0) |
add one external column to the datastore. It contains width * height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename TContainer > | |
size_t | addCopiedImageAsColumn (const TContainer &data, size_t width, const QString &name=QString("")) |
add one external column to the datastore. It contains width * height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID. | |
template<typename T > | |
size_t | addCopiedImageAsColumnTranspose (const QVector< T > &data, size_t width, const QString &name=QString("")) |
add one external column to the datastore. It contains width * height rows. | |
template<typename T > | |
size_t | addCopiedImageAsColumnTranspose (const T *data, size_t width, size_t height, const QString &name=QString(""), size_t stride=1, size_t start=0) |
add a new column to the datastore, which is filled from the transposed column-major array data with the given width and height. | |
template<typename TContainer > | |
std::pair< size_t, size_t > | addCopiedMap (const TContainer &c, const QString &nameKey=QString("map_key"), const QString &nameValue=QString("map_value")) |
copies the contents of the map-like container c into two columns of the datastore, returns the two IDs of the items as a std::pair | |
template<typename TIterator > | |
std::pair< size_t, size_t > | addCopiedMap (TIterator first, TIterator last, const QString &nameKey=QString("map_key"), const QString &nameValue=QString("map_value")) |
copies the contents of the map-like container c into two columns of the datastore, returns the two IDs of the items as a std::pair | |
std::pair< size_t, size_t > | addCopiedPoints (const QList< QPoint > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
std::pair< size_t, size_t > | addCopiedPoints (const QList< QPointF > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
add two columns to the datastore. They will be filled with the values from points (first column: x-value, second column: y-value) | |
std::pair< size_t, size_t > | addCopiedPoints (const std::list< QPoint > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
std::pair< size_t, size_t > | addCopiedPoints (const std::list< QPointF > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
std::pair< size_t, size_t > | addCopiedPoints (const std::vector< QPoint > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
std::pair< size_t, size_t > | addCopiedPoints (const std::vector< QPointF > &points, const QString &namex=QString(""), const QString &namey=QString("")) |
size_t | addDecadeLogColumn (size_t rows, double startDecade, double endDecade, const QString &name=QString("")) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at 10^start and ending at 10^end. the values are logarithmically spaced between 10^start end 10^end | |
size_t | addImageColumn (double *data, size_t width, size_t height, const QString &name=QString("")) |
add one external column to the datastore. It contains width * height rows. This returns its logical column ID. Data is not owned by the JKQTPDatastore! The column is meant to represent an image in row-major order with x-dimention width and y-dimension height . | |
size_t | addImageColumn (size_t width, size_t height, const QString &name=QString("")) |
add a new columns with width * height rows to the datastore and return its column ID. The new item uses internal memory management. The column is meant to represent an image in row-major order with x-dimention width and y-dimension height . | |
size_t | addInternalColumn (double *data, size_t rows, const QString &name) |
add a column with rows entries from the array data, ownership of the memory behind data is transfered to the datastore | |
size_t | addInternalImageColumn (double *data, size_t width, size_t height, const QString &name) |
add a column with width * height entries from the array data, ownership of the memory behind data is transfered to the datastore The column is meant to represent an image in row-major order with x-dimention width and y-dimension height . | |
size_t | addLinearColumn (size_t rows, double start, double end, const QString &name=QString("")) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at start and ending at end. the values are equidistant between start end end | |
std::pair< size_t, size_t > | addLinearGridColumns (size_t width, double startX, double endX, size_t height, double startY, double endY, const QString &nameX=QString(""), const QString &nameY=QString("")) |
add two columns to the datastore that contains the x- and y- coordinates of a rectangular grid with width points in x- and height points in y-direction. | |
size_t | addLogColumn (size_t rows, double start, double end, const QString &name=QString("")) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at start and ending at end. the values are logarithmically spaced between start end end | |
template<class TContainer > | |
void | appendFromContainerToColumn (size_t column, const TContainer &values) |
adds a values in container values to the column column. This changes the column length (number of rows). If the memory was externally managed before, it will be internally managed afterwards | |
void | appendToColumn (size_t column, double value) |
adds a value value to the column column. This changes the column length (number of rows). | |
template<class TIterator > | |
void | appendToColumn (size_t column, TIterator first, TIterator last) |
adds a values from a range first ... last (defined by C++ iterators) to the column column. This changes the column length (number of rows). If the memory was externally managed before, it will be internally managed afterwards | |
void | appendToColumns (size_t column1, size_t column2, double value1, double value2) |
adds a value value1 to the column column1 and a value value2 to column2. | |
void | appendToColumns (size_t column1, size_t column2, size_t column3, double value1, double value2, double value3) |
adds a value value1 to the column column1, a value value2 to column2, etc. | |
void | appendToColumns (size_t column1, size_t column2, size_t column3, size_t column4, double value1, double value2, double value3, double value4) |
adds a value value1 to the column column1, a value value2 to column2, etc. | |
void | appendToColumns (size_t column1, size_t column2, size_t column3, size_t column4, size_t column5, double value1, double value2, double value3, double value4, double value5) |
adds a value value1 to the column column1, a value value2 to column2, etc. | |
void | appendToColumns (size_t columnX, size_t columnY, const QPoint &value) |
adds a the x-coordinate of value to the column columnX and the y-coordinate to columnY. | |
void | appendToColumns (size_t columnX, size_t columnY, const QPointF &value) |
adds a the x-coordinate of value to the column columnX and the y-coordinate to columnY. | |
JKQTPColumnBackInserter | backInserter (int i) |
returns a back-inserter iterator (JKQTPColumnBackInserter) to the i -th column in the JKQTPDatastore | |
JKQTPColumnBackInserter | backInserter (size_t i) |
returns a back-inserter iterator (JKQTPColumnBackInserter) to the i -th column in the JKQTPDatastore | |
JKQTPColumnIterator | begin (int i) |
returns an iterator to the first data entry in the i -th column in the JKQTPDatastore | |
JKQTPColumnConstIterator | begin (int i) const |
returns a const iterator to the first data entry in the i -th column in the JKQTPDatastore | |
JKQTPColumnIterator | begin (size_t i) |
returns an iterator to the first data entry in the i -th column in the JKQTPDatastore | |
JKQTPColumnConstIterator | begin (size_t i) const |
returns a const iterator to the first data entry in the i -th column in the JKQTPDatastore | |
void | clear () |
deletes all items from the datastore and possibly frees the memory they manage | |
size_t | copyColumn (size_t old_column, const QString &name=QString("")) |
copies the given old_column into a new one | |
size_t | copyColumn (size_t old_column, size_t start, size_t stride, const QString &name=QString("")) |
copies the given old_column into a new one, reading the data with the given start column and stride | |
void | copyColumnData (size_t toColumn, size_t fromColumn) |
copies the data from fromColumn into an existing column toColumn | |
void | dec (size_t column, size_t row, double decrement=1) |
decrements entry in row row of column column by decrement | |
void | deleteAllColumns (const QString &name, bool removeItems=true) |
delete all columns with the given name, if no other columns points to the datastore item of the column and removeItems is true , the item will be removed | |
void | deleteAllPrefixedColumns (QString prefix, bool removeItems=true) |
delete all columns where the name starts with a given prefix, if no other columns points to the datastore item of the column and removeItems is true , the item will be removed | |
void | deleteColumn (size_t column, bool removeItems=true) |
delete the given column, if no other columns points to the datastore item of the column and removeItems is true , the item will be removed | |
JKQTPColumnIterator | end (int i) |
returns an iterator behind the last data entry data in the i -th column in the JKQTPDatastore | |
JKQTPColumnConstIterator | end (int i) const |
returns a const iterator behind the last data entry data in the i -th column in the JKQTPDatastore | |
JKQTPColumnIterator | end (size_t i) |
returns an iterator behind the last data entry data in the i -th column in the JKQTPDatastore | |
JKQTPColumnConstIterator | end (size_t i) const |
returns a const iterator behind the last data entry data in the i -th column in the JKQTPDatastore | |
int | ensureColumnNum (const QString &name) |
return the num of the first column with the given name, if none was found this creates a new column with no rows and returns its num | |
void | eraseFromColumn (const JKQTPColumnConstIterator &pos) |
removes the entry pos | |
void | eraseFromColumn (const JKQTPColumnConstIterator &pos, const JKQTPColumnConstIterator &posEnd) |
removes the entries pos to posEnd | |
void | eraseFromColumn (const JKQTPColumnIterator &pos) |
removes the entry pos | |
void | eraseFromColumn (const JKQTPColumnIterator &pos, const JKQTPColumnIterator &posEnd) |
removes the entries pos to posEnd | |
double | get (int column, int row) const |
returns the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
double | get (int column, size_t row) const |
returns the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
double | get (size_t column, int row) const |
returns the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
double | get (size_t column, size_t row) const |
returns the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
quint16 | getColumnChecksum (int column) const |
returns the data checksum of the given column | |
size_t | getColumnCount () const |
returns the number of (logical) columns currently managed by the datastore | |
QList< size_t > | getColumnIDs () const |
returns a list with all available column IDs | |
QVector< int > | getColumnIDsIntVec () const |
returns a list with all available column IDs | |
size_t | getColumnImageHeight (int column) const |
returns the height of the image, represented by column (in row-major ordering) | |
size_t | getColumnImageWidth (int column) const |
returns the width of the image, represented by column (in row-major ordering). Internally this returns the imageColumns or image width, if set in the column | |
QString | getColumnName (size_t column) |
return the title of the first column with the given name, or -1 if none was found | |
QStringList | getColumnNames () const |
return a list with all columns available in the datastore | |
int | getColumnNum (const QString &name) |
return the num of the first column with the given name, or -1 if none was found | |
double * | getColumnPointer (int column, size_t row=0) |
returns a pointer to the data in column column, starting ar row row | |
const double * | getColumnPointer (int column, size_t row=0) const |
returns a pointer to the data in column column, starting ar row row | |
double * | getColumnPointer (size_t column, size_t row=0) |
returns a pointer to the data in column column, starting ar row row | |
const double * | getColumnPointer (size_t column, size_t row=0) const |
returns a pointer to the data in column column, starting ar row row | |
QList< QVector< double > > | getData (QStringList *columnNames=nullptr, const QSet< int > &userColumns=QSet< int >()) const |
return contents of datastore as QList<QVector<double> >, i.e. a list of column-vectors | |
QVector< double > | getData (size_t column, QString *columnName=nullptr) const |
return contents of a given column as QVector<double> | |
size_t | getMaxRows () const |
returns the maximum number of rows in all columns | |
int | getNextHigherIndex (int column, size_t row) const |
gets the index of the datapoint with the nearest, but higher value in the column | |
int | getNextHigherIndex (int column, size_t row, int start, int end) const |
gets the index of the datapoint with the nearest, but higher value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column) | |
int | getNextHigherIndex (size_t column, size_t row) const |
gets the index of the datapoint with the nearest, but higher value in the column | |
int | getNextHigherIndex (size_t column, size_t row, int start, int end) const |
gets the index of the datapoint with the nearest, but higher value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column) | |
int | getNextLowerIndex (int column, size_t row) const |
gets the index of the datapoint with the nearest, but lower value in the column | |
int | getNextLowerIndex (int column, size_t row, int start, int end) const |
gets the index of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column) | |
int | getNextLowerIndex (size_t column, size_t row) const |
gets the index of the datapoint with the nearest, but lower value in the column | |
int | getNextLowerIndex (size_t column, size_t row, int start, int end) const |
gets the index of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column) | |
double | getPixel (size_t column, size_t x, size_t y) const |
returns the value at position (x , y ) in the column-th column, which is interpreted with the imageWidth stored in that column | |
size_t | getRows (int column) const |
returns the number of rows in the column column | |
size_t | getRows (size_t column) const |
returns the number of rows in the column column | |
bool | hasColumn (size_t i) const |
determines whether a column with the given ID exists | |
void | inc (size_t column, size_t row, double increment=1) |
increases entry in row row of column column by increment | |
void | resizeColumn (size_t column, size_t new_rows) |
resizes the column column to have new_rows rows | |
void | resizeImageColumn (size_t column, size_t new_image_width, size_t new_image_height) |
resizes the column column to have enough rows to be interpreted as an image of size new_image_width * new_image_height pixels, also sets the internally store image size in the column! | |
void | saveCSV (const QString &filename, const QSet< int > &userColumns=QSet< int >(), const QString &separator=QString(", "), const QString &decimal_separator=QString("."), const QString &comment=QString("#"), const QString &aroundStrings=QString(""), char floatformat='g') const |
save contents of datastore as Comma Separated Values (CSV) file | |
void | saveCSV (QTextStream &txt, const QSet< int > &userColumns=QSet< int >(), const QString &separator=QString(", "), const QString &decimal_separator=QString("."), const QString &comment=QString("#"), const QString &aroundStrings=QString(""), char floatformat='g') const |
save contents of datastore as Comma Separated Values (CSV) file | |
void | saveDIF (const QString &filename, const QSet< int > &userColumns=QSet< int >(), const QString &floatformat=QString("%10.10lf")) const |
save contents of datastore as DIF file (data interchange format) | |
void | saveMatlab (const QString &filename, const QSet< int > &userColumns=QSet< int >()) const |
save contents of datastore as a Matlab script | |
void | saveMatlab (QTextStream &txt, const QSet< int > &userColumns=QSet< int >()) const |
save contents of datastore as a Matlab script | |
void | saveSYLK (const QString &filename, const QSet< int > &userColumns=QSet< int >(), const QString &floatformat=QString("%10.10lf")) const |
save contents of datastore as SYLK file (SYmbolic LinK) | |
void | scaleColumnValues (size_t column, double factor) |
scales (multiplies) all entries in column column by factor | |
void | set (int column, size_t row, double value) |
sets the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
void | set (size_t column, size_t row, double value) |
sets the value at position (column , row ). column is the logical column and will be mapped to the according memory block internally!) | |
void | setAll (size_t column, double value) |
sets all entries in column column to value | |
void | setColumnCopiedData (size_t toColumn, const double *data, size_t N) |
copies the data from data into an existing column toColumn | |
void | setColumnCopiedImageData (size_t toColumn, const double *data, size_t width, size_t height) |
copies the image data from data into an existing column toColumn | |
void | setColumnData (size_t toColumn, const QVector< double > &data) |
copies the data from data into an existing column toColumn | |
void | setColumnImageHeight (size_t column, size_t imageHeight) |
sets the height of the image, represented by column (in row-major ordering) to imageHeight | |
void | setColumnImageWidth (size_t column, size_t imageWidth) |
sets the width of the image, represented by column (in row-major ordering) to imageWidth | |
void | setPixel (size_t column, size_t x, size_t y, double value) |
returns the value at position (x , y ) in the column-th column, which is interpreted with the imageWidth stored in that column | |
Protected Types | |
typedef QMap< size_t, JKQTPColumn >::iterator | ColumnIterator |
mutable iterator for columns in the JKQTPDatastore (ColumnIterator::first: column number, ColumnIterator::second: column data) | |
typedef QMap< size_t, JKQTPColumn >::const_iterator | ConstColumnIterator |
constant iterator for columns in the JKQTPDatastore (ColumnIterator::first: column number, ColumnIterator::second: column data) | |
Protected Member Functions | |
size_t | addColumn (JKQTPColumn col) |
add a new column to the datastore and return its ID | |
size_t | addColumnForItem (size_t itemID, size_t columnInItem, const QString &name=QString("")) |
add a new columns which references a specified item and a specified column therein. | |
size_t | addCopiedItem (const double *data, size_t rows) |
add one external column to the datastore. It contains rows rows. The data is copied and the copy managed internally This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addCopiedItem (JKQTPDatastoreItemFormat dataformat, double *data, size_t columns, size_t rows) |
add one external data block to the datastore. It contains rows rows and columns columns. The data is copied and the copy managed internally This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addInternalItem (double *data, size_t rows) |
add one internal column to the datastore. It contains rows rows. This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addItem (double *data, size_t rows) |
add one external column to the datastore. It contains rows rows. This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addItem (JKQTPDatastoreItem *item) |
add a new item to the datastore and return its ID This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addItem (JKQTPDatastoreItemFormat dataformat, double *data, size_t columns, size_t rows) |
add an external memory block to the datastore. It contains rows rows and columns columns. dataformat determined the memory layout. This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addItem (size_t columns, size_t rows) |
add a new item with rows rows and columns columns to the datastore and return its ID. The item uses internal memory management. This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
size_t | addItem (size_t rows) |
add a new columns/item with rows rows to the datastore and return its ID. The item uses internal memory management. This function retuns an item ID (which can be used with getItem() ), not a column ID! | |
ColumnIterator | begin () |
returns an iterator to the first column in the JKQTPDatastore | |
ConstColumnIterator | begin () const |
returns a const iterator to the first column in the JKQTPDatastore | |
ColumnIterator | end () |
returns an iterator behind the last column in the JKQTPDatastore | |
ConstColumnIterator | end () const |
returns a const iterator behind the last column in the JKQTPDatastore | |
JKQTPDatastoreItem * | getItem (size_t i) |
returns the JKQTPDatastoreItem object for the i -th item in the store | |
const JKQTPDatastoreItem * | getItem (size_t i) const |
returns the JKQTPDatastoreItem object for the i -th item in the store | |
Private Attributes | |
QMap< size_t, JKQTPColumn > | columns |
a std::vector of all columns that may be used to access the managed chunks of memory. | |
QMap< size_t, JKQTPDatastoreItem * > | items |
a std::vector that contains all items managed by this datastore | |
std::unique_ptr< JKQTPColumn > | m_invalidColumn |
an internal invalid column object, used e.g. to return invalid column iterators | |
size_t | maxColumnsID |
internal variable to keep track about the highest column ID (in columns) used so far | |
size_t | maxItemID |
internal variable to keep track about the highest item ID (in items) used so far | |
Friends | |
class | JKQTPColumn |
class | JKQTPDatastoreItem |
class | JKQTPDatastoreModel |
This class manages data columns (with entries of type double
), used by JKQTPlotter/JKQTBasePlotter to represent data for plots.
A JKQTPDatastore manages a set of data columns. Each column is a continuous vector of numbers. Optionally it can be interpreted as a 2D image. In the latter case, the data is assumed to be ordered in row-major ordering (i.e. row for row).
You can generate new columns e.g. by:
double*
pointer to external. In the latter case owner-ship may be transferred to the datastore, but can also retain externally. width
columns and height
rows. Of course columns can also be deleted by calling:
The properties of columns may be accessed using:
You can modify all data in a column by functions like:
Also you can access a single entry from a column, using:
In addition to teh fucntions above, JKQTPDatastore also provides C++-style iteratos to read the data from a column:
... and also a std::back_inserter
-style interface to append data to columns:
These allow to use the C++ standard algorithms to work with columns and also enabled the library Statistical Computations in this software package. You can use the functions above e.g. for code like:
or simply
Also there are functions to add data from iterator-defined ranges, e.g.:
JKQTPDatastore stores the width and height of the represented image as metadata with any image column. This metadata is used to provide convenience access to the image pixels with:
The image width/height are read using:
This allows to write code like:
JKQTPDatastore provides several functions that allow to store its contents into files:
... and function to read data into different data structures:
This class manages a list if JKQTPDatastoreItem onjects that may each contain a chunk of memory, containig one or more columns of data. Each item can be accessed with get() by a specific ID which is returned by add(). JKQTPColumn. You may only clear all chunks of memory/items. If you no longer need some of the data, but still want to access the rest you will simply have to destroy all JKQTPColumn that point to the item with their JKQTPColumns:datastoreItem property.
+- JKQTPDatastore ---------------------+ std::vector<JKQTPColumn>: | | +- JKQTPColumn ----------------+ | +- JKQTPDatastoreItem --------+ | 0 | datastore | | 0 | JKQTPSingleColumn |<--|-------------------|---datastoreItem = 0 | | | 0 # # # # # # # # # # #<--|---|-------------------|---datastoreOffset = 0 | | | | | | | | +- JKQTPDatastoreItem --------+ | +- JKQTPColumn ----------------+ | 1 | JKQTPSingleColumn |<--|---\ 1 | datastore | | | 0 # # # # # # # # # # #<--|---|-\ \--------------|---datastoreItem = 1 | | | | | \----------------|---datastoreOffset = 0 | | +- JKQTPDatastoreItem --------+ | | | | : : | +------------------------------+ | : : | : : | : : | : : | +- JKQTPDatastoreItem --------+ | : : |N-1 | JKQTPMatrixRow |<--|---\ : : | | 0 # # # # # # # # # # # | | \ +- JKQTPColumn ----------------+ | | 1 # # # # # # # # # # # | | \ M-1 | datastore | | | 2 # # # # # # # # # # #<--|---|--\ \------------|---datastoreItem = N-1 | | | | | \---------------|---datastoreOffset = 2 | | +-----------------------------+ | | | | | +------------------------------+ +--------------------------------------+
In addition the JKQTPDatastore manages a std::vector<JKQTPColumn> which may be used to access the data chunks in the logical notion of data columns. This class provides a set of interface methods for this list:
|
protected |
mutable iterator for columns in the JKQTPDatastore (ColumnIterator::first:
column number, ColumnIterator::second:
column data)
|
protected |
constant iterator for columns in the JKQTPDatastore (ColumnIterator::first:
column number, ColumnIterator::second:
column data)
JKQTPDatastore::JKQTPDatastore | ( | ) |
class constructor, generates an empty datastore
JKQTPDatastore::~JKQTPDatastore | ( | ) |
class destructor, destroys all subordered JKQTPDatastoreItem objects
size_t JKQTPDatastore::addCalculatedColumn | ( | size_t | rows, |
const std::function< double(size_t)> & | f, | ||
const QString & | name = QString("") |
||
) |
add a column with rows entries, that is calculated by calling f for each entry
Pseudocode:
size_t JKQTPDatastore::addCalculatedColumn | ( | size_t | rows, |
const std::function< double(size_t, JKQTPDatastore *)> & | f, | ||
const QString & | name = QString("") |
||
) |
add a column with rows entries, that is calculated by calling f for each entry
Pseudocode:
|
inline |
size_t JKQTPDatastore::addCalculatedColumnFromColumn | ( | size_t | otherColumn, |
const std::function< double(double)> & | f, | ||
const QString & | name = QString("") |
||
) |
add a column with the same number of entries, as in the other column otherColumn , that are calculated by calling f for each entry in otherColumn
Pseudocode:
size_t JKQTPDatastore::addCalculatedColumnFromColumn | ( | size_t | otherColumnX, |
size_t | otherColumnY, | ||
const std::function< double(double, double)> & | f, | ||
const QString & | name = QString("") |
||
) |
add a column with the same number of entries, as in the other column otherColumn , that are calculated by calling f for each pair of entries in otherColumnX and otherColumnY
Pseudocode:
size_t JKQTPDatastore::addCalculatedImageColumn | ( | size_t | cols, |
size_t | rows, | ||
const std::function< double(size_t, size_t)> & | f, | ||
const QString & | name = QString("") |
||
) |
add an image column with width cols and height rows (i.e. rows * cols entries), that is calculated by calling f for each entry
Pseudocode:
size_t JKQTPDatastore::addColumn | ( | const QString & | name = QString("") | ) |
add a new and empty column to the datastore and return its column ID. The new item uses internal memory management.
name | name for the column |
size_t JKQTPDatastore::addColumn | ( | double * | data, |
size_t | rows, | ||
const QString & | name = QString("") |
||
) |
add one external column to the datastore. It contains rows rows. This returns its logical column ID. Data is not owned by the JKQTPDatastore!
data | data array to be copied |
rows | number of rows in the data array |
name | name for the column |
|
protected |
add a new column to the datastore and return its ID
size_t JKQTPDatastore::addColumn | ( | size_t | rows, |
const QString & | name = QString("") |
||
) |
add a new columns with rows rows to the datastore and return its column ID. The new item uses internal memory management.
rows | number of rows in the data array |
name | name for the column |
|
inline |
|
inline |
|
protected |
add a new columns which references a specified item and a specified column therein.
|
inline |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
T | datatype of the element in the vector, this has to be convertible to double! |
data | pointer to the data to be copied |
rows | items in data |
name | name for the column |
|
inline |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
T | datatype of the element in the vector, this has to be convertible to double! |
data | pointer to the data to be copied |
rows | items in data |
name | name for the column |
stride | when copying, this function steps throught the data with the given stride, so only eleemnts [0, stride, 2*stride, ... (rows-1)*stride] are copied! |
Pseudocode:
|
inline |
copy an external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
T | datatype of the element in the vector, this has to be convertible to double! |
data | pointer to the data to be copied |
rows | number of items to copy from data |
stride | when copying, this function steps throught the data with the given stride, so only eleemnts [start, start+stride, start+2*stride, ... start+(rows-1)*stride] are copied! |
start | first element to copy |
name | name for the column |
Pseudocode:
|
inline |
add one external column to the datastore. It will be filled with the contents of vector data.
TContainer | datatype of the container, which need to support standard C++ iterators and the function size() . The contents needs to be convertible to double. The iterator of TContainer needs to support ++ and += |
data | data vector to be copied |
name | name for the column |
stride | strides through the container data with the given stride |
start | starts copying from data with the element start |
Pseudocode:
|
inline |
add one external column to the datastore. It will be filled with the contents of vector data.
TContainer | datatype of the container, which need to support standard C++ iterators. The contents needs to be convertible to double. |
data | data vector to be copied |
name | name for the column |
|
inline |
add one column to the datastore. It will be filled with the values from first ... last
TIterator | a standard C++ iterator |
first | points to the first value in the range of values to add |
last | points behind the last value in the range of values to add |
name | name for the column |
|
inline |
add one external column to the datastore. It contains rows rows. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
T | datatype of the element in the vector, this has to be convertible to double! |
data | pointer to the data to be copied |
mask | boolean array with rows entries, used to mask data when copying from data |
rows | items in data |
name | name for the column |
useIfMaskEquals | data from data is copied if and only if the corresponding entry of mask equals this value |
|
inline |
add one external column to the datastore. It will be filled with the contents of vector data.
TContainer | datatype of the container data, which need to support standard C++ iterators and the function size() . The contents needs to be convertible to double. |
TContainerMask | datatype of the container mask, which need to support standard C++ iterators and the function size() . The contents needs to be convertible to bool. |
data | data vector to be copied |
mask | data vector to be copied |
name | name for the column |
useIfMaskEquals | data from data is copied if and only if the corresponding entry of mask equals this value |
Pseudocode:
|
inline |
add one external column to the datastore. It contains width * height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
|
inline |
add one external column to the datastore. It contains width * height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
TContainer | datatype of the container, which need to support standard C++ iterators and the function size() . The contents needs to be convertible to double. |
data | data vector to be copied |
width | width of the image, stored in data |
name | name for the column |
|
inline |
add one external column to the datastore. It contains width * height rows.
The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so afterwards you can delete the external array This returns its logical column ID.
T | data type of the array data, needs to be convertible to double by jkqtp_todouble() |
data | data vector to be copied |
width | width of the image, stored in data |
name | name for the column |
size_t JKQTPDatastore::addCopiedImageAsColumnTranspose | ( | const T * | data, |
size_t | width, | ||
size_t | height, | ||
const QString & | name = QString("") , |
||
size_t | stride = 1 , |
||
size_t | start = 0 |
||
) |
add a new column to the datastore, which is filled from the transposed column-major array data with the given width and height.
The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so afterwards you can delete the external arrayThis returns its logical column ID.
T | data type of the array data, needs to be convertible to double by jkqtp_todouble() |
data | a column major image |
width | width of data |
height | height of data |
name | name of the new column |
stride | stride to use, when reading data. Use this to e.g. read one channel from a packed RGB-image (stride=3 , start=0/1/2 ) |
start | first entry from data top copy data. Use this to e.g. read one channel from a packed RGB-image (stride=3 , start=0/1/2 ) |
|
protected |
add one external column to the datastore. It contains rows rows. The data is copied and the copy managed internally This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add one external data block to the datastore. It contains rows rows and columns columns. The data is copied and the copy managed internally This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
inline |
copies the contents of the map-like container c into two columns of the datastore, returns the two IDs of the items as a std::pair
TContainer | datatype of the map-typed container (e.g. std::map or QMap ) The requiremen to this container is that it supports standard iterators with begin() and end() . |
c | the map to copy to the datastore |
nameKey | name for the column with the map keys |
nameValue | name for the column with the map values |
|
inline |
copies the contents of the map-like container c into two columns of the datastore, returns the two IDs of the items as a std::pair
TIterator | a standard C++ iterator for a map, dereferencing with it->first and it->second |
first | points to the first value in the range of values to add |
last | points behind the last value in the range of values to add |
nameKey | name for the column with the map keys |
nameValue | name for the column with the map values |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const QList< QPoint > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const QList< QPointF > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
add two columns to the datastore. They will be filled with the values from points (first column: x-value, second column: y-value)
points | list of datapoints to add |
namex | name for the column with the x-values |
namey | name for the column with the y-values |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const std::list< QPoint > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const std::list< QPointF > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const std::vector< QPoint > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
std::pair< size_t, size_t > JKQTPDatastore::addCopiedPoints | ( | const std::vector< QPointF > & | points, |
const QString & | namex = QString("") , |
||
const QString & | namey = QString("") |
||
) |
size_t JKQTPDatastore::addDecadeLogColumn | ( | size_t | rows, |
double | startDecade, | ||
double | endDecade, | ||
const QString & | name = QString("") |
||
) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at 10^start and ending at 10^end. the values are logarithmically spaced between 10^start end 10^end
size_t JKQTPDatastore::addImageColumn | ( | double * | data, |
size_t | width, | ||
size_t | height, | ||
const QString & | name = QString("") |
||
) |
add one external column to the datastore. It contains width * height rows. This returns its logical column ID. Data is not owned by the JKQTPDatastore! The column is meant to represent an image in row-major order with x-dimention width and y-dimension height .
data | data array to be copied |
width | width of the image represented by the data array |
height | height of the image represented by the data array |
name | name for the column |
size_t JKQTPDatastore::addImageColumn | ( | size_t | width, |
size_t | height, | ||
const QString & | name = QString("") |
||
) |
add a new columns with width * height rows to the datastore and return its column ID. The new item uses internal memory management. The column is meant to represent an image in row-major order with x-dimention width and y-dimension height .
width | width of the image represented by the data array |
height | height of the image represented by the data array |
name | name for the column |
size_t JKQTPDatastore::addInternalColumn | ( | double * | data, |
size_t | rows, | ||
const QString & | name | ||
) |
add a column with rows entries from the array data, ownership of the memory behind data is transfered to the datastore
data | data array to be copied |
rows | number of rows in the data array |
name | name for the column |
size_t JKQTPDatastore::addInternalImageColumn | ( | double * | data, |
size_t | width, | ||
size_t | height, | ||
const QString & | name | ||
) |
add a column with width * height entries from the array data, ownership of the memory behind data is transfered to the datastore The column is meant to represent an image in row-major order with x-dimention width and y-dimension height .
data | data array to be copied |
width | width of the image represented by the data array |
height | height of the image represented by the data array |
name | name for the column |
|
protected |
add one internal column to the datastore. It contains rows rows. This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add one external column to the datastore. It contains rows rows. This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add a new item to the datastore and return its ID This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add an external memory block to the datastore. It contains rows rows and columns columns. dataformat determined the memory layout. This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add a new item with rows rows and columns columns to the datastore and return its ID. The item uses internal memory management. This function retuns an item ID (which can be used with getItem() ), not a column ID!
|
protected |
add a new columns/item with rows rows to the datastore and return its ID. The item uses internal memory management. This function retuns an item ID (which can be used with getItem() ), not a column ID!
size_t JKQTPDatastore::addLinearColumn | ( | size_t | rows, |
double | start, | ||
double | end, | ||
const QString & | name = QString("") |
||
) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at start and ending at end. the values are equidistant between start end end
std::pair< size_t, size_t > JKQTPDatastore::addLinearGridColumns | ( | size_t | width, |
double | startX, | ||
double | endX, | ||
size_t | height, | ||
double | startY, | ||
double | endY, | ||
const QString & | nameX = QString("") , |
||
const QString & | nameY = QString("") |
||
) |
add two columns to the datastore that contains the x- and y- coordinates of a rectangular grid with width points in x- and height points in y-direction.
width | number of columns in the mesh grid |
startX | x-coordinate of the first column of the mesh grid |
endX | x-coordinate of the last column of the mesh grid |
height | number of rows in the mesh grid |
startY | y-coordinate of the first row of the mesh grid |
endY | y-coordinate of the last row of the mesh grid |
nameX | name for the x-coordinate column |
nameY | name for the y-coordinate column |
size_t JKQTPDatastore::addLogColumn | ( | size_t | rows, |
double | start, | ||
double | end, | ||
const QString & | name = QString("") |
||
) |
add a column to the datastore that contains rows rows with monotonely increasing value starting at start and ending at end. the values are logarithmically spaced between start end end
|
inline |
adds a values in container values to the column column. This changes the column length (number of rows). If the memory was externally managed before, it will be internally managed afterwards
TContainer | a container with standard iterators |
column | the column to extend |
values | vector with data to append to column column |
void JKQTPDatastore::appendToColumn | ( | size_t | column, |
double | value | ||
) |
adds a value value to the column column. This changes the column length (number of rows).
|
inline |
adds a values from a range first ... last (defined by C++ iterators) to the column column. This changes the column length (number of rows). If the memory was externally managed before, it will be internally managed afterwards
TIterator | a standard C++ iterator |
column | the column to extend |
first | points to the first value in the range of values to add |
last | points behind the last value in the range of values to add |
void JKQTPDatastore::appendToColumns | ( | size_t | column1, |
size_t | column2, | ||
double | value1, | ||
double | value2 | ||
) |
adds a value value1 to the column column1 and a value value2 to column2.
This is equivalent to
void JKQTPDatastore::appendToColumns | ( | size_t | column1, |
size_t | column2, | ||
size_t | column3, | ||
double | value1, | ||
double | value2, | ||
double | value3 | ||
) |
adds a value value1 to the column column1, a value value2 to column2, etc.
This is equivalent to
void JKQTPDatastore::appendToColumns | ( | size_t | column1, |
size_t | column2, | ||
size_t | column3, | ||
size_t | column4, | ||
double | value1, | ||
double | value2, | ||
double | value3, | ||
double | value4 | ||
) |
adds a value value1 to the column column1, a value value2 to column2, etc.
This is equivalent to
void JKQTPDatastore::appendToColumns | ( | size_t | column1, |
size_t | column2, | ||
size_t | column3, | ||
size_t | column4, | ||
size_t | column5, | ||
double | value1, | ||
double | value2, | ||
double | value3, | ||
double | value4, | ||
double | value5 | ||
) |
adds a value value1 to the column column1, a value value2 to column2, etc.
This is equivalent to
void JKQTPDatastore::appendToColumns | ( | size_t | columnX, |
size_t | columnY, | ||
const QPoint & | value | ||
) |
adds a the x-coordinate of value to the column columnX and the y-coordinate to columnY.
This is equivalent to
void JKQTPDatastore::appendToColumns | ( | size_t | columnX, |
size_t | columnY, | ||
const QPointF & | value | ||
) |
adds a the x-coordinate of value to the column columnX and the y-coordinate to columnY.
This is equivalent to
JKQTPColumnBackInserter JKQTPDatastore::backInserter | ( | int | i | ) |
returns a back-inserter iterator (JKQTPColumnBackInserter) to the i -th column in the JKQTPDatastore
JKQTPColumnBackInserter JKQTPDatastore::backInserter | ( | size_t | i | ) |
returns a back-inserter iterator (JKQTPColumnBackInserter) to the i -th column in the JKQTPDatastore
|
protected |
returns an iterator to the first column in the JKQTPDatastore
|
protected |
returns a const iterator to the first column in the JKQTPDatastore
JKQTPColumnIterator JKQTPDatastore::begin | ( | int | i | ) |
returns an iterator to the first data entry in the i -th column in the JKQTPDatastore
JKQTPColumnConstIterator JKQTPDatastore::begin | ( | int | i | ) | const |
returns a const iterator to the first data entry in the i -th column in the JKQTPDatastore
JKQTPColumnIterator JKQTPDatastore::begin | ( | size_t | i | ) |
returns an iterator to the first data entry in the i -th column in the JKQTPDatastore
JKQTPColumnConstIterator JKQTPDatastore::begin | ( | size_t | i | ) | const |
returns a const iterator to the first data entry in the i -th column in the JKQTPDatastore
void JKQTPDatastore::clear | ( | ) |
deletes all items from the datastore and possibly frees the memory they manage
size_t JKQTPDatastore::copyColumn | ( | size_t | old_column, |
const QString & | name = QString("") |
||
) |
copies the given old_column into a new one
old_column | the column to be duplicated |
name | name for the new column |
size_t JKQTPDatastore::copyColumn | ( | size_t | old_column, |
size_t | start, | ||
size_t | stride, | ||
const QString & | name = QString("") |
||
) |
copies the given old_column into a new one, reading the data with the given start column and stride
old_column | the column to be duplicated |
start | for row in column old_column to copy |
stride | stride for iterating through old_column when copying |
name | name for the new column |
Pseuo-Code:
void JKQTPDatastore::copyColumnData | ( | size_t | toColumn, |
size_t | fromColumn | ||
) |
copies the data from fromColumn into an existing column toColumn
toColumn | target of the copy operation |
fromColumn | source of the copy operation |
|
inline |
decrements entry in row row of column column by decrement
void JKQTPDatastore::deleteAllColumns | ( | const QString & | name, |
bool | removeItems = true |
||
) |
delete all columns with the given name, if no other columns points to the datastore item of the column and removeItems is true
, the item will be removed
void JKQTPDatastore::deleteAllPrefixedColumns | ( | QString | prefix, |
bool | removeItems = true |
||
) |
delete all columns where the name starts with a given prefix, if no other columns points to the datastore item of the column and removeItems is true
, the item will be removed
void JKQTPDatastore::deleteColumn | ( | size_t | column, |
bool | removeItems = true |
||
) |
delete the given column, if no other columns points to the datastore item of the column and removeItems is true
, the item will be removed
|
protected |
returns an iterator behind the last column in the JKQTPDatastore
|
protected |
returns a const iterator behind the last column in the JKQTPDatastore
JKQTPColumnIterator JKQTPDatastore::end | ( | int | i | ) |
returns an iterator behind the last data entry data in the i -th column in the JKQTPDatastore
JKQTPColumnConstIterator JKQTPDatastore::end | ( | int | i | ) | const |
returns a const iterator behind the last data entry data in the i -th column in the JKQTPDatastore
JKQTPColumnIterator JKQTPDatastore::end | ( | size_t | i | ) |
returns an iterator behind the last data entry data in the i -th column in the JKQTPDatastore
JKQTPColumnConstIterator JKQTPDatastore::end | ( | size_t | i | ) | const |
returns a const iterator behind the last data entry data in the i -th column in the JKQTPDatastore
int JKQTPDatastore::ensureColumnNum | ( | const QString & | name | ) |
return the num of the first column with the given name, if none was found this creates a new column with no rows and returns its num
|
inline |
removes the entry pos
|
inline |
removes the entries pos to posEnd
|
inline |
removes the entry pos
|
inline |
removes the entries pos to posEnd
|
inline |
returns the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
|
inline |
returns the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
|
inline |
returns the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
|
inline |
returns the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
quint16 JKQTPDatastore::getColumnChecksum | ( | int | column | ) | const |
returns the data checksum of the given column
|
inline |
returns the number of (logical) columns currently managed by the datastore
|
inline |
returns a list with all available column IDs
QVector< int > JKQTPDatastore::getColumnIDsIntVec | ( | ) | const |
returns a list with all available column IDs
size_t JKQTPDatastore::getColumnImageHeight | ( | int | column | ) | const |
returns the height of the image, represented by column (in row-major ordering)
size_t JKQTPDatastore::getColumnImageWidth | ( | int | column | ) | const |
returns the width of the image, represented by column (in row-major ordering). Internally this returns the imageColumns or image width, if set in the column
QString JKQTPDatastore::getColumnName | ( | size_t | column | ) |
return the title of the first column with the given name, or -1 if none was found
QStringList JKQTPDatastore::getColumnNames | ( | ) | const |
return a list with all columns available in the datastore
int JKQTPDatastore::getColumnNum | ( | const QString & | name | ) |
return the num of the first column with the given name, or -1 if none was found
|
inline |
returns a pointer to the data in column column, starting ar row row
|
inline |
returns a pointer to the data in column column, starting ar row row
|
inline |
returns a pointer to the data in column column, starting ar row row
|
inline |
returns a pointer to the data in column column, starting ar row row
QList< QVector< double > > JKQTPDatastore::getData | ( | QStringList * | columnNames = nullptr , |
const QSet< int > & | userColumns = QSet< int >() |
||
) | const |
return contents of datastore as QList<QVector<double> >, i.e. a list of column-vectors
columnNames | if !=nullptr this will afterwards conatin the column titles |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
QVector< double > JKQTPDatastore::getData | ( | size_t | column, |
QString * | columnName = nullptr |
||
) | const |
return contents of a given column as QVector<double>
column | column to copy |
columnName | if !=nullptr this will afterwards conatin the column title |
|
inlineprotected |
returns the JKQTPDatastoreItem object for the i -th item in the store
|
inlineprotected |
returns the JKQTPDatastoreItem object for the i -th item in the store
size_t JKQTPDatastore::getMaxRows | ( | ) | const |
returns the maximum number of rows in all columns
int JKQTPDatastore::getNextHigherIndex | ( | int | column, |
size_t | row | ||
) | const |
gets the index of the datapoint with the nearest, but higher value in the column
int JKQTPDatastore::getNextHigherIndex | ( | int | column, |
size_t | row, | ||
int | start, | ||
int | end | ||
) | const |
gets the index of the datapoint with the nearest, but higher value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)
int JKQTPDatastore::getNextHigherIndex | ( | size_t | column, |
size_t | row | ||
) | const |
gets the index of the datapoint with the nearest, but higher value in the column
int JKQTPDatastore::getNextHigherIndex | ( | size_t | column, |
size_t | row, | ||
int | start, | ||
int | end | ||
) | const |
gets the index of the datapoint with the nearest, but higher value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)
int JKQTPDatastore::getNextLowerIndex | ( | int | column, |
size_t | row | ||
) | const |
gets the index of the datapoint with the nearest, but lower value in the column
int JKQTPDatastore::getNextLowerIndex | ( | int | column, |
size_t | row, | ||
int | start, | ||
int | end | ||
) | const |
gets the index of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)
int JKQTPDatastore::getNextLowerIndex | ( | size_t | column, |
size_t | row | ||
) | const |
gets the index of the datapoint with the nearest, but lower value in the column
int JKQTPDatastore::getNextLowerIndex | ( | size_t | column, |
size_t | row, | ||
int | start, | ||
int | end | ||
) | const |
gets the index of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)
|
inline |
returns the value at position (x
, y
) in the column-th column, which is interpreted with the imageWidth stored in that column
|
inline |
returns the number of rows in the column column
|
inline |
returns the number of rows in the column column
bool JKQTPDatastore::hasColumn | ( | size_t | i | ) | const |
determines whether a column with the given ID exists
|
inline |
increases entry in row row of column column by increment
void JKQTPDatastore::resizeColumn | ( | size_t | column, |
size_t | new_rows | ||
) |
resizes the column column to have new_rows rows
void JKQTPDatastore::resizeImageColumn | ( | size_t | column, |
size_t | new_image_width, | ||
size_t | new_image_height | ||
) |
resizes the column column to have enough rows to be interpreted as an image of size new_image_width * new_image_height pixels, also sets the internally store image size in the column!
void JKQTPDatastore::saveCSV | ( | const QString & | filename, |
const QSet< int > & | userColumns = QSet< int >() , |
||
const QString & | separator = QString(", ") , |
||
const QString & | decimal_separator = QString(".") , |
||
const QString & | comment = QString("#") , |
||
const QString & | aroundStrings = QString("") , |
||
char | floatformat = 'g' |
||
) | const |
save contents of datastore as Comma Separated Values (CSV) file
filename | the file to create |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
separator | the column separator char |
decimal_separator | the decimal separator ('.' by default) |
comment | comments are started with this string and end with a linebreak. If this parameter is empty no comments will be output |
aroundStrings | strings (in column headers) are surrounded by these characters! |
floatformat | a printf format string that is used to print floating point numbers to the file |
Here are some default configuration:
saveCSV(filename, ", ", ".", "#")
will generate a standard CSV file with commas between the columns and a point as decimal separator. Comments start with #
saveCSV(filename, "; ", ",", "")
will generate a CSV file which may be read by a german Excel version: separated by ; and comma as decimal separatorsaveCSV(filename, "\t", ".", "#")
will generate a tab separated values filevoid JKQTPDatastore::saveCSV | ( | QTextStream & | txt, |
const QSet< int > & | userColumns = QSet< int >() , |
||
const QString & | separator = QString(", ") , |
||
const QString & | decimal_separator = QString(".") , |
||
const QString & | comment = QString("#") , |
||
const QString & | aroundStrings = QString("") , |
||
char | floatformat = 'g' |
||
) | const |
save contents of datastore as Comma Separated Values (CSV) file
txt | QTextStream to write to |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
separator | the column separator char |
decimal_separator | the decimal separator ('.' by default) |
comment | comments are started with this string and end with a linebreak. If this parameter is empty no comments will be output |
aroundStrings | strings (in column headers) are surrounded by these characters! |
floatformat | a printf format string that is used to print floating point numbers to the file |
Here are some default configuration:
saveCSV(filename, ", ", ".", "#")
will generate a standard CSV file with commas between the columns and a point as decimal separator. Comments start with #
saveCSV(filename, "; ", ",", "")
will generate a CSV file which may be read by a german Excel version: separated by ; and comma as decimal separatorsaveCSV(filename, "\t", ".", "#")
will generate a tab separated values filevoid JKQTPDatastore::saveDIF | ( | const QString & | filename, |
const QSet< int > & | userColumns = QSet< int >() , |
||
const QString & | floatformat = QString("%10.10lf") |
||
) | const |
save contents of datastore as DIF file (data interchange format)
filename | the file to create |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
floatformat | a printf format string that is used to print floating point numbers to the file |
void JKQTPDatastore::saveMatlab | ( | const QString & | filename, |
const QSet< int > & | userColumns = QSet< int >() |
||
) | const |
save contents of datastore as a Matlab script
filename | the file to create |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
void JKQTPDatastore::saveMatlab | ( | QTextStream & | txt, |
const QSet< int > & | userColumns = QSet< int >() |
||
) | const |
save contents of datastore as a Matlab script
txt | the QTextStream to write to |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
void JKQTPDatastore::saveSYLK | ( | const QString & | filename, |
const QSet< int > & | userColumns = QSet< int >() , |
||
const QString & | floatformat = QString("%10.10lf") |
||
) | const |
save contents of datastore as SYLK file (SYmbolic LinK)
filename | the file to create |
userColumns | a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() |
floatformat | a printf format string that is used to print floating point numbers to the file |
|
inline |
scales (multiplies) all entries in column column by factor
|
inline |
sets the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
|
inline |
sets the value at position (column
, row
). column
is the logical column and will be mapped to the according memory block internally!)
|
inline |
sets all entries in column column to value
void JKQTPDatastore::setColumnCopiedData | ( | size_t | toColumn, |
const double * | data, | ||
size_t | N | ||
) |
copies the data from data into an existing column toColumn
toColumn | target of the copy operation |
data | data to copy |
N | entries in data |
void JKQTPDatastore::setColumnCopiedImageData | ( | size_t | toColumn, |
const double * | data, | ||
size_t | width, | ||
size_t | height | ||
) |
copies the image data from data into an existing column toColumn
toColumn | target of the copy operation |
data | data to copy, size is width * height |
width | number of columns in data |
height | number of rows in data |
void JKQTPDatastore::setColumnData | ( | size_t | toColumn, |
const QVector< double > & | data | ||
) |
copies the data from data into an existing column toColumn
toColumn | target of the copy operation |
data | data to copy |
void JKQTPDatastore::setColumnImageHeight | ( | size_t | column, |
size_t | imageHeight | ||
) |
sets the height of the image, represented by column (in row-major ordering) to imageHeight
void JKQTPDatastore::setColumnImageWidth | ( | size_t | column, |
size_t | imageWidth | ||
) |
sets the width of the image, represented by column (in row-major ordering) to imageWidth
|
inline |
returns the value at position (x
, y
) in the column-th column, which is interpreted with the imageWidth stored in that column
|
friend |
|
friend |
|
friend |
|
private |
a std::vector of all columns that may be used to access the managed chunks of memory.
|
private |
a std::vector that contains all items managed by this datastore
|
private |
an internal invalid column object, used e.g. to return invalid column iterators
|
private |
internal variable to keep track about the highest column ID (in columns) used so far
|
private |
internal variable to keep track about the highest item ID (in items) used so far