Skip to content

Commit

Permalink
Merge pull request #131 from rcurtin/compat-fixes
Browse files Browse the repository at this point in the history
Minor compatibility fixes for ensmallen 1.x
  • Loading branch information
rcurtin authored Sep 9, 2019
2 parents 2554e32 + 0e542f6 commit 5a87d5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/ensmallen_bits/function/arma_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct MatTypeTraits<arma::Col<eT>>
template<typename eT>
struct MatTypeTraits<arma::Row<eT>>
{
typedef arma::Row<eT> BaseMatType;
typedef arma::Mat<eT> BaseMatType;
};

template<typename eT>
Expand Down
7 changes: 4 additions & 3 deletions include/ensmallen_bits/sdp/lrsdp_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ class LRSDPFunction
size_t NumConstraints() const { return sdp.NumConstraints(); }

//! Get the initial point of the LRSDP.
template<typename MatType>
const MatType& GetInitialPoint() const
template<typename MatType = arma::mat>
MatType GetInitialPoint() const
{
return arma::conv_to<MatType>::from(initialPoint);
MatType result = arma::conv_to<MatType>::from(initialPoint);
return result;
}

//! Return the SDP object representing the problem.
Expand Down
4 changes: 2 additions & 2 deletions include/ensmallen_bits/sdp/sdp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ class SDP
bool HasLinearlyIndependentConstraints() const;

//! Get an initial point for the primal coordinates.
template<typename MatType>
template<typename MatType = arma::mat>
MatType GetInitialPoint() const;

//! Get initial points for the primal and dual coordinates.
template<typename MatType>
template<typename MatType = arma::mat>
void GetInitialPoints(MatType& coordinates,
MatType& ySparse,
MatType& yDense,
Expand Down

0 comments on commit 5a87d5a

Please sign in to comment.