diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
commit | aa31a06235496c0d808e57c8ce914cb4b640bc6e (patch) | |
tree | 33385e828ddca0b2857bac9e3dac4dd3723a3eee /matlab/mex/mexDataManagerHelpFunctions.cpp | |
parent | f6aa2db83dfea89f9d2cfc6fcbd3da141ee77e02 (diff) | |
parent | 00a1c6118b2d64b867c8e640c295462bcccfc7c9 (diff) | |
download | astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.gz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.bz2 astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.xz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.zip |
Merge branch 'master' into parallel_vec
Diffstat (limited to 'matlab/mex/mexDataManagerHelpFunctions.cpp')
-rw-r--r-- | matlab/mex/mexDataManagerHelpFunctions.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/matlab/mex/mexDataManagerHelpFunctions.cpp b/matlab/mex/mexDataManagerHelpFunctions.cpp index 1794abb..c47ee27 100644 --- a/matlab/mex/mexDataManagerHelpFunctions.cpp +++ b/matlab/mex/mexDataManagerHelpFunctions.cpp @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "mexDataManagerHelpFunctions.h" @@ -42,10 +41,10 @@ $Id$ #ifdef USE_MATLAB_UNDOCUMENTED extern "C" { mxArray *mxCreateSharedDataCopy(const mxArray *pr); -bool mxUnshareArray(const mxArray *pr, const bool noDeepCopy); -mxArray *mxUnreference(const mxArray *pr); +bool mxUnshareArray(mxArray *pr, bool noDeepCopy); +mxArray *mxUnreference(mxArray *pr); #if 0 -// Unsupported in Matlab R2014b +// Unsupported in Matlab R2014b and later bool mxIsSharedArray(const mxArray *pr); #endif } @@ -66,12 +65,12 @@ public: // First unshare the input array, so that we may modify it. if (bUnshare) { #if 0 - // Unsupported in Matlab R2014b + // Unsupported in Matlab R2014b and later if (mxIsSharedArray(_pArray)) { fprintf(stderr, "Performance note: unsharing shared array in link\n"); } #endif - mxUnshareArray(_pArray, false); + mxUnshareArray(const_cast<mxArray*>(_pArray), false); //fprintf(stderr, "Unshared:\narray: %p\tdata: %p\n", (void*)_pArray, (void*)mxGetData(_pArray)); } // Then create a (persistent) copy so the data won't be deleted @@ -79,7 +78,7 @@ public: m_pLink = mxCreateSharedDataCopy(_pArray); //fprintf(stderr, "SharedDataCopy:\narray: %p\tdata: %p\n", (void*)m_pLink, (void*)mxGetData(m_pLink)); mexMakeArrayPersistent(m_pLink); - m_fPtr = (float *)mxGetData(m_pLink); + m_fPtr = (float *)mxGetData(_pArray); m_fPtr += iOffset; } virtual ~CFloat32CustomMemoryMatlab3D() { @@ -167,17 +166,6 @@ checkDataSize(const mxArray * const mArray, //----------------------------------------------------------------------------------------- void -updateStatistics(const std::vector<astra::CFloat32Data3DMemory *> & vecIn) -{ - const size_t tot_size = vecIn.size(); - for (size_t count = 0; count < tot_size; count++) - { - vecIn[count]->updateStatistics(); - } -} - -//----------------------------------------------------------------------------------------- -void getDataPointers(const std::vector<astra::CFloat32Data3DMemory *> & vecIn, std::vector<astra::float32 *> & vecOut) { |