Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate DistanceMatrix code in eigen_helpers.hpp and arc_helpers.hpp #46

Open
dmcconachie opened this issue Apr 19, 2018 · 0 comments

Comments

@dmcconachie
Copy link
Contributor

eigen_helpers.hpp

template<typename ScalarType, int VectorLength, int NumVectors>              
inline Eigen::Matrix<double, NumVectors, NumVectors> CalculateSquaredDistanceMatrix(const Eigen::Matrix<ScalarType, VectorLength, NumVectors>& set)

arc_helpers.hpp:

template<typename Datatype, typename Allocator = std::allocator<Datatype>>   
inline Eigen::MatrixXd BuildDistanceMatrix(const std::vector<Datatype, Allocator>& data, const std::function<double(const Datatype&, const Datatype&)>& distance_fn)
template<typename FirstDatatype, typename SecondDatatype, typename FirstAllocator = std::allocator<FirstDatatype>, typename SecondAllocator = std::allocator<SecondDatatype>>
inline Eigen::MatrixXd BuildDistanceMatrix(const std::vector<FirstDatatype, FirstAllocator>& data1, const std::vector<SecondDatatype, SecondAllocator>& data2, const std::function<double(const                 FirstDatatype&, const SecondDatatype&)>& distance_fn)

We might want to consider cleaning this up at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant