Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
refactor LRSDP into separate LRSDPFunction class #305
Reported by rcurtin on 3 Nov 44079170 06:54 UTC
So you end up with a situation where LRSDP holds an object of type
which in turn holds an object of type
A template parameter to AugLagrangianFunction must implement the following functions:
So the LRSDP class must expose those four functions publicly for the whole thing to work. But this is confusing to users, who notice that the LRSDP class has these four functions, but they shouldn't call them, because those functions are only implemented as template specializations of AugLagrangianFunction::Evaluate() and AugLagrangianFunction::Gradient() (if you just call LRSDP::Evaluate(), it will throw an error).
A better class design could prevent this problem, by putting those four functions into a separate class, so that a user who creates an LRSDP object does not see those four functions.
Commented by abhishek on 3 May 44180012 05:57 UTC
I have run the mlpack_test -t LRSDPTest and it is working fine with this.
Commented by abhishek on 9 Sep 44181715 12:36 UTC
Similarly we can change lrsdp_impl.hpp to lrsdp.cpp which was already done in svn trunk.
Why lrsdp_impl.hpp is present if lrsdp.cpp already has implementation of Custom specializations of the AugmentedLagrangianFunction for the LRSDP case ?
Replying to rcurtin:
Commented by abhishek on 7 Jun 44240261 03:18 UTC
Okay, That would be great. I will try to contribute more to mlpack.