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

Method add

3rdparty/qcustomplot/qcustomplot.h:2873–2894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2871*/
2872template <class DataType>
2873void QCPDataContainer<DataType>::add(const QCPDataContainer<DataType> &data)
2874{
2875 if (data.isEmpty())
2876 return;
2877
2878 const int n = data.size();
2879 const int oldSize = size();
2880
2881 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*constBegin(), *(data.constEnd()-1))) // prepend if new data keys are all smaller than or equal to existing ones
2882 {
2883 if (mPreallocSize < n)
2884 preallocateGrow(n);
2885 mPreallocSize -= n;
2886 std::copy(data.constBegin(), data.constEnd(), begin());
2887 } else // don't need to prepend, so append and merge if necessary
2888 {
2889 mData.resize(mData.size()+n);
2890 std::copy(data.constBegin(), data.constEnd(), end()-n);
2891 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*(constEnd()-n-1), *(constEnd()-n))) // if appended range keys aren't all greater than existing ones, merge the two partitions
2892 std::inplace_merge(begin(), end()-n, end(), qcpLessThanSortKey<DataType>);
2893 }
2894}
2895
2896/*!
2897 Adds the provided data points in \a data to the current data.

Callers 2

addDataMethod · 0.45
timeSeriesToOhlcMethod · 0.45

Calls 12

sizeFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
isEmptyFunction · 0.85
constEndMethod · 0.80
constBeginMethod · 0.80
resizeMethod · 0.80
appendMethod · 0.80
insertMethod · 0.80
lower_boundFunction · 0.50
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected