add .reset_cache()
This commit is contained in:
@@ -360,6 +360,7 @@ class SpMat : public SpBase< eT, SpMat<eT> >
|
||||
inline const SpMat& sprandn(const SizeMat& s, const double density);
|
||||
|
||||
inline void reset();
|
||||
inline void reset_cache();
|
||||
|
||||
//! don't use this unless you're writing internal Armadillo code
|
||||
inline void reserve(const uword in_rows, const uword in_cols, const uword new_n_nonzero);
|
||||
|
||||
@@ -4501,6 +4501,45 @@ SpMat<eT>::reset()
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
void
|
||||
SpMat<eT>::reset_cache()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
|
||||
sync_csc();
|
||||
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
{
|
||||
#pragma omp critical (arma_SpMat_cache)
|
||||
{
|
||||
cache.reset();
|
||||
|
||||
sync_state = 0;
|
||||
}
|
||||
}
|
||||
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
|
||||
{
|
||||
cache_mutex.lock();
|
||||
|
||||
cache.reset();
|
||||
|
||||
sync_state = 0;
|
||||
|
||||
cache_mutex.unlock();
|
||||
}
|
||||
#else
|
||||
{
|
||||
cache.reset();
|
||||
|
||||
sync_state = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user