Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions inst/include/infoxtr/distance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ namespace distance
}

/***********************************************************
* Vector - Scalar
* Scalar is internally expanded to vector length
* Result is a single double distance value
***********************************************************/
* Vector - Scalar
* Scalar is internally expanded to vector length
* Result is a single double distance value
***********************************************************/
inline double distance(
const std::vector<double>& vec,
const double scalar,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool na_rm = true)
{
if (vec.empty() || std::isnan(scalar))
Expand Down Expand Up @@ -225,7 +225,7 @@ namespace distance
inline double distance(
const double scalar,
const std::vector<double>& vec,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool na_rm = true)
{
return distance(vec, scalar, method, na_rm);
Expand Down Expand Up @@ -263,7 +263,7 @@ namespace distance
inline double distance(
const std::vector<double>& vec1,
const std::vector<double>& vec2,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool na_rm = true)
{
if (vec1.empty() || vec2.empty() || vec1.size() != vec2.size())
Expand Down Expand Up @@ -383,7 +383,7 @@ namespace distance
***************************************************************************/
inline std::vector<std::vector<double>> distance(
const std::vector<std::vector<double>>& mat,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool na_rm = true,
bool byrow = true)
{
Expand Down Expand Up @@ -510,7 +510,7 @@ namespace distance
const std::vector<std::vector<double>>& mat,
const std::vector<size_t>& lib,
const std::vector<size_t>& pred,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool na_rm = true,
bool byrow = true)
{
Expand Down
4 changes: 2 additions & 2 deletions inst/include/infoxtr/neighbor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace neighbor
inline std::vector<std::vector<size_t>> NN4Mat(
const std::vector<std::vector<double>>& mat,
size_t k,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool include_self = false,
bool byrow = true)
{
Expand Down Expand Up @@ -223,7 +223,7 @@ namespace neighbor
const std::vector<size_t>& lib,
const std::vector<size_t>& pred,
size_t k,
std::string method = "euclidean",
const std::string& method = "euclidean",
bool include_self = false,
bool byrow = true)
{
Expand Down
Loading