MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / addData

Method addData

3rdparty/qcustomplot/qcustomplot.cpp:21053–21070  ·  view source on GitHub ↗

! \overload Adds the provided points in \a keys and \a values to the current data. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector. If you can guarantee that the passed data points are sorted by \a keys in ascending order, you can set \a alreadySorted to true, to improve performance by saving a sorting run.

Source from the content-addressed store, hash-verified

21051 returns a pointer to the internal data container.
21052*/
21053void QCPGraph::addData(const QVector<double> &keys, const QVector<double> &values, bool alreadySorted)
21054{
21055 if (keys.size() != values.size())
21056 qDebug() << Q_FUNC_INFO << "keys and values have different sizes:" << keys.size() << values.size();
21057 const int n = qMin(keys.size(), values.size());
21058 QVector<QCPGraphData> tempData(n);
21059 QVector<QCPGraphData>::iterator it = tempData.begin();
21060 const QVector<QCPGraphData>::iterator itEnd = tempData.end();
21061 int i = 0;
21062 while (it != itEnd)
21063 {
21064 it->key = keys[i];
21065 it->value = values[i];
21066 ++it;
21067 ++i;
21068 }
21069 mDataContainer->add(tempData, alreadySorted); // don't modify tempData beyond this to prevent copy on write
21070}
21071
21072/*! \overload
21073

Callers 1

importGraphicEqMethod · 0.80

Calls 9

constEndMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45
isEmptyMethod · 0.45
reserveMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected