diff --git a/Cpp/lib/waveform.cpp b/Cpp/lib/waveform.cpp index 2162a7e8777d5e4a1dc3ba6aae93758cca31db76..b62d3ed417ab5434cbfb0d662ca4b5392756cfec 100644 --- a/Cpp/lib/waveform.cpp +++ b/Cpp/lib/waveform.cpp @@ -265,7 +265,7 @@ double ArrayWaveform::setMovingSegment( return nextPhase; } -std::pair<int16_t*, int64_t> ArrayWaveform::getStaticWaveform() { +std::pair<void*, int64_t> ArrayWaveform::getStaticWaveform() { auto minSampleLen = 2 * this->wfmParam.samplingRate / std::gcd( this->wfmParam.samplingRate, @@ -283,13 +283,13 @@ std::pair<int16_t*, int64_t> ArrayWaveform::getStaticWaveform() { + this->wfmParam.phases.array()) ).array().colwise() * this->wfmParam.amplitudes.array(); bindBuffer(minSampleLen * 2); // bytes - auto pData = (int16_t*) this->pDataBuffer; + auto pData = (void*) this->pDataBuffer; Eigen::Map<EigenVectorXi16> dataMap(pData, minSampleLen); dataMap = wfmMatrixrix.colwise().sum().cast<int16_t>(); return std::pair(pData, int64_t(minSampleLen)); } -std::pair<int16_t*, int64_t> ArrayWaveform::getTrickWaveform( +std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform( std::set<int> siteIndex, double df, double tauMove, @@ -354,7 +354,7 @@ std::pair<int16_t*, int64_t> ArrayWaveform::getTrickWaveform( } } bindBuffer(sampleLen * 2); - auto pData = (int16_t*) this->pDataBuffer; + auto pData = (void*) this->pDataBuffer; Eigen::Map<EigenVectorXi16> dataMap(pData, sampleLen); dataMap = wfmMatrix.rowwise().sum().cast<int16_t> (); return std::pair(pData, int64_t(sampleLen)); diff --git a/Cpp/lib/waveform.h b/Cpp/lib/waveform.h index 17f87218cdc0f858381980fca9928c65e04a0002..cf84db8b05f09439505bad361df50a4762fa424b 100644 --- a/Cpp/lib/waveform.h +++ b/Cpp/lib/waveform.h @@ -225,7 +225,7 @@ class ArrayWaveform { * * @return std::pair(pDataBuffer: int16_t*, dataLength: int64_t) */ - std::pair<int16_t*, int64_t> getStaticWaveform(); + std::pair<void*, int64_t> getStaticWaveform(); /** * @brief generate a tricky-trick waveform from current set of @@ -237,7 +237,7 @@ class ArrayWaveform { * @param tauStay wait time (s) * @return std::pair(pDataBuffer: int16_t*, dataLength: int64_t) */ - std::pair<int16_t*, int64_t> getTrickWaveform( + std::pair<void*, int64_t> getTrickWaveform( std::set<int> siteIndex, double df, double tauMove=0,