[mlpack-git] [mlpack/mlpack] Spill trees (#747)

Ryan Curtin notifications at github.com
Sun Aug 14 17:57:38 EDT 2016


> +
> +/**
> + * Simple test for the move constructor.
> + */
> +BOOST_AUTO_TEST_CASE(SpillTreeMoveDatasetTest)
> +{
> +  arma::mat dataset = arma::randu<arma::mat>(3, 1000);
> +  typedef SPTree<EuclideanDistance, EmptyStatistic, arma::mat> TreeType;
> +
> +  TreeType tree(std::move(dataset));
> +
> +  BOOST_REQUIRE_EQUAL(dataset.n_elem, 0);
> +  BOOST_REQUIRE_EQUAL(tree.Dataset().n_rows, 3);
> +  BOOST_REQUIRE_EQUAL(tree.Dataset().n_cols, 1000);
> +}
> +

Should we also test the copy constructor?  You could do this:

```
TreeType t = new TreeType(dataset);
TreeType t2(t);
delete t;

// Now check that everything is still valid.
``` 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/747/files/fe090ee13c7cad79e2b7eb8b6690628ba3ead1ed#r74709361
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/35b3a720/attachment.html>


More information about the mlpack-git mailing list