I made the following changes:<br>
(a) removed circular reference in optimizer as in<br>
`LinearLayer::LinearLayer: optimizer(*this)`<br>
to<br>
`LinearLayer::LinearLayer: optimizer()'<br>
<br>
(b) removed Law of Demeter violations as in<br>
`t.Optimizer().Reset()` to<br>
`t.ResetOptimizer()`<br>
<br>
`t.Optimizer().Update()` to<br>
`t.UpdateOptimizer()`<br>
<br>
`t.Optimizer().Optimize();` to<br>
`t.OPtimize()`<br>
<br>
<br>
(c) change optimizer from pointer to shared pointer (TODO: make Optimizer a<br>
member variable)<br>
<br>
(d) Implemented copy ctor on top of all this.<br>
<br>
(e) Added a few unit tests for copy ctor<br>
<br>
(d) All the unit tests except for a couple unrelated to ANN ran to success<br>
<br>
The result is in https://github.com/theSundayProgrammer/mlpack<br>
<br>
<br>
<br>
<br>
<br>
My changes are in<br>
<br>
On Sat, Jan 30, 2016 at 6:40 AM, stereomatchingkiss <<br>
notifications@github.com> wrote:<br>
<br>
> I added move constructor and move assignment on most of the layers in the<br>
> pull request of #451 <https://github.com/mlpack/mlpack/pull/451>.<br>
> I also change the reference of the output layer of FFN to non-reference<br>
> type, it would be very easy to implement move constructor and move<br>
> assignment for the FFN after #451<br>
> <https://github.com/mlpack/mlpack/pull/451> is merged.<br>
><br>
> —<br>
> Reply to this email directly or view it on GitHub<br>
> <https://github.com/mlpack/mlpack/issues/510#issuecomment-176933500>.<br>
><br>
<br>
<br>
<br>
-- <br>
Joseph Chakravarti Mariadassou<br>
http://thesundayprogrammer.com<br>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/510#issuecomment-177280888">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFNhtvvsLYXXjY52bJRX8qeOrM7Paks5pfQYIgaJpZM4HOq_n.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/issues/510#issuecomment-177280888"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>