mlpack::bound::addr Namespace Reference

Functions

template
<
typename
AddressType
,
typename
VecType
>
void AddressToPoint (VecType &point, const AddressType &address)
 Translate the address to the point. More...

 
template
<
typename
AddressType
1
,
typename
AddressType
2
>
int CompareAddresses (const AddressType1 &addr1, const AddressType2 &addr2)
 Compare two addresses. More...

 
template
<
typename
AddressType
1
,
typename
AddressType
2
,
typename
AddressType
3
>
bool Contains (const AddressType1 &address, const AddressType2 &loBound, const AddressType3 &hiBound)
 Returns true if an address is contained between two other addresses. More...

 
template
<
typename
AddressType
,
typename
VecType
>
void PointToAddress (AddressType &address, const VecType &point)
 Calculate the address of a point. More...

 

Function Documentation

◆ AddressToPoint()

void mlpack::bound::addr::AddressToPoint ( VecType &  point,
const AddressType &  address 
)

Translate the address to the point.

Be careful, the point and the address variables should be equal-sized and the type of the address should correspond to the type of the vector.

The function makes the backward transform to the function above.

Parameters
addressAn address to translate.
pointThe point that corresponds to the address.

Definition at line 153 of file address.hpp.

◆ CompareAddresses()

int mlpack::bound::addr::CompareAddresses ( const AddressType1 &  addr1,
const AddressType2 &  addr2 
)

Compare two addresses.

The function returns 1 if the first address is greater than the second one, -1 if the first address is less than the second one, otherwise the function returns 0.

Definition at line 233 of file address.hpp.

Referenced by Contains().

◆ Contains()

bool mlpack::bound::addr::Contains ( const AddressType1 &  address,
const AddressType2 &  loBound,
const AddressType3 &  hiBound 
)

Returns true if an address is contained between two other addresses.

Definition at line 256 of file address.hpp.

References CompareAddresses().

Referenced by HRectBound< MetricType >::Metric().

◆ PointToAddress()

void mlpack::bound::addr::PointToAddress ( AddressType &  address,
const VecType &  point 
)

Calculate the address of a point.

Be careful, the point and the address variables should be equal-sized and the type of the address should correspond to the type of the vector.

The function maps each floating point coordinate to an equal-sized unsigned integer datatype in such a way that the transform preserves the ordering (i.e. lower floating point values correspond to lower integers). Thus, the mapping saves the exponent and the mantissa of each floating point value consequently, furthermore the exponent is stored before the mantissa. In the case of negative numbers the resulting integer value should be inverted. In the multi-dimensional case, after we transform the representation, we have to interleave the bits of the new representation across all the elements in the address vector.

Parameters
addressThe resulting address.
pointThe point that is being translated to the address.

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.

Definition at line 57 of file address.hpp.