12#ifndef MLPACK_BINDINGS_PYTHON_CYTHON_ARMA_UTIL_HPP
13#define MLPACK_BINDINGS_PYTHON_CYTHON_ARMA_UTIL_HPP
24 const_cast<arma::uhword&
>(t.mem_state) = state;
35 if (t.mem && t.n_elem <= arma::arma_config::mat_prealloc)
38 return (
size_t) t.mem_state;
49 if (m.mem && m.n_elem <= arma::arma_config::mat_prealloc)
52 typename T::elem_type* mem =
53 arma::memory::acquire<typename T::elem_type>(m.n_elem);
54 arma::arrayops::copy(mem, m.memptr(), m.n_elem);
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
size_t GetMemState(T &t)
Get the memory state of the given Armadillo object.
T::elem_type * GetMemory(T &m)
Return the matrix's allocated memory pointer, unless the matrix is using its internal preallocated me...
void SetMemState(T &t, int state)
Set the memory state of the given Armadillo object.