12 #ifndef MLPACK_BINDINGS_GO_GONUM_ARMA_UTIL_HPP 13 #define MLPACK_BINDINGS_GO_GONUM_ARMA_UTIL_HPP 27 const_cast<arma::uhword&
>(t.mem_state) = state;
39 if (t.mem && t.n_elem <= arma::arma_config::mat_prealloc)
42 return (
size_t) t.mem_state;
53 if (m.mem && m.n_elem <= arma::arma_config::mat_prealloc)
56 typename T::elem_type* mem =
57 arma::memory::acquire<typename T::elem_type>(m.n_elem);
58 arma::arrayops::copy(mem, m.memptr(), m.n_elem);
63 arma::access::rw(m.mem_state) = 1;
void SetMemState(T &t, int state)
Set 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...
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.