mlpack
Namespaces | Functions
unmap.hpp File Reference
#include <mlpack/prereqs.hpp>
Include dependency graph for unmap.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mlpack
 Linear algebra utility functions, generally performed on matrices or vectors.
 

Functions

void mlpack::neighbor::Unmap (const arma::Mat< size_t > &neighbors, const arma::mat &distances, const std::vector< size_t > &referenceMap, const std::vector< size_t > &queryMap, arma::Mat< size_t > &neighborsOut, arma::mat &distancesOut, const bool squareRoot=false)
 Assuming that the datasets have been mapped using the referenceMap and the queryMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors. More...
 
void mlpack::neighbor::Unmap (const arma::Mat< size_t > &neighbors, const arma::mat &distances, const std::vector< size_t > &referenceMap, arma::Mat< size_t > &neighborsOut, arma::mat &distancesOut, const bool squareRoot=false)
 Assuming that the datasets have been mapped using referenceMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors. More...
 

Detailed Description

Author
Ryan Curtin

Convenience methods to unmap results.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ Unmap() [1/2]

void mlpack::neighbor::Unmap ( const arma::Mat< size_t > &  neighbors,
const arma::mat &  distances,
const std::vector< size_t > &  referenceMap,
const std::vector< size_t > &  queryMap,
arma::Mat< size_t > &  neighborsOut,
arma::mat &  distancesOut,
const bool  squareRoot = false 
)

Assuming that the datasets have been mapped using the referenceMap and the queryMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors.

This is useful for the dual-tree case.

Parameters
neighborsMatrix of neighbors resulting from neighbor search.
distancesMatrix of distances resulting from neighbor search.
referenceMapMapping of reference set to old points.
queryMapMapping of query set to old points.
neighborsOutMatrix to store unmapped neighbors into.
distancesOutMatrix to store unmapped distances into.
squareRootIf true, take the square root of the distances.

◆ Unmap() [2/2]

void mlpack::neighbor::Unmap ( const arma::Mat< size_t > &  neighbors,
const arma::mat &  distances,
const std::vector< size_t > &  referenceMap,
arma::Mat< size_t > &  neighborsOut,
arma::mat &  distancesOut,
const bool  squareRoot = false 
)

Assuming that the datasets have been mapped using referenceMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors.

This is useful for the single-tree case.

Parameters
neighborsMatrix of neighbors resulting from neighbor search.
distancesMatrix of distances resulting from neighbor search.
referenceMapMapping of reference set to old points.
neighborsOutMatrix to store unmapped neighbors into.
distancesOutMatrix to store unmapped distances into.
squareRootIf true, take the square root of the distances.