[mlpack-git] [mlpack] Armadillo matrix transposition doubles memory usage for a matrix (#203)

Ryan Curtin notifications at github.com
Thu Feb 19 14:33:20 EST 2015

Hm, so we can't easily determine the amount of available RAM.  One way to do this is to attempt to allocate the memory we need for the transpose, then if that fails, use `inplace_trans()`.  Looking at `armadillo_bits/debug.hpp`, when an allocation fails, the error will be printed (unless `ARMA_PRINT_ERRORS` is not defined), and then a `std::bad_alloc` is thrown.  Maybe a solution is to try and catch the `bad_alloc`, and if that happens, then transpose inplace?

Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150219/7f021d4e/attachment.html>

More information about the mlpack-git mailing list