libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
crn::LazyDistanceMatrix< DATA, DISTANCE > Class Template Reference

Lazy computation of a distance matrix. More...

#include <CRNLazyDistanceMatrix.h>

Public Member Functions

 LazyDistanceMatrix (const std::vector< DATA > &d, DISTANCE &&dist)
 
 LazyDistanceMatrix (const LazyDistanceMatrix &)=default
 
 LazyDistanceMatrix (LazyDistanceMatrix &&)=default
 
LazyDistanceMatrixoperator= (const LazyDistanceMatrix &)=delete
 
LazyDistanceMatrixoperator= (LazyDistanceMatrix &&)=delete
 
size_t GetRows () const noexcept
 Returns the number of rows. More...
 
size_t GetCols () const noexcept
 Returns the number of columns. More...
 
double At (size_t i, size_t j)
 Distance between two elements. More...
 
const SquareMatrixDoubleGetDistanceMatrix ()
 Access to the whole distance matrix. More...
 

Detailed Description

template<typename DATA, typename DISTANCE>
class crn::LazyDistanceMatrix< DATA, DISTANCE >

Lazy computation of a distance matrix.

Computes the elements of the distance matrix only when needed.

Author
Yann LEYDIER
Version
0.1
Date
June 2015

Definition at line 38 of file CRNLazyDistanceMatrix.h.

Constructor & Destructor Documentation

template<typename DATA , typename DISTANCE >
crn::LazyDistanceMatrix< DATA, DISTANCE >::LazyDistanceMatrix ( const std::vector< DATA > &  d,
DISTANCE &&  dist 
)
inline
Parameters
[in]dthe population
[in]distthe distance function

Definition at line 45 of file CRNLazyDistanceMatrix.h.

template<typename DATA , typename DISTANCE >
crn::LazyDistanceMatrix< DATA, DISTANCE >::LazyDistanceMatrix ( const LazyDistanceMatrix< DATA, DISTANCE > &  )
default
template<typename DATA , typename DISTANCE >
crn::LazyDistanceMatrix< DATA, DISTANCE >::LazyDistanceMatrix ( LazyDistanceMatrix< DATA, DISTANCE > &&  )
default

Member Function Documentation

template<typename DATA , typename DISTANCE >
double crn::LazyDistanceMatrix< DATA, DISTANCE >::At ( size_t  i,
size_t  j 
)
inline

Distance between two elements.

Warning
no bound check is performed on indices
Parameters
[in]ifirst element index in population
[in]jsecond element index in population
Returns
the distance

Definition at line 72 of file CRNLazyDistanceMatrix.h.

template<typename DATA , typename DISTANCE >
size_t crn::LazyDistanceMatrix< DATA, DISTANCE >::GetCols ( ) const
inlinenoexcept

Returns the number of columns.

Returns
The number of columns.

Definition at line 64 of file CRNLazyDistanceMatrix.h.

template<typename DATA , typename DISTANCE >
const SquareMatrixDouble& crn::LazyDistanceMatrix< DATA, DISTANCE >::GetDistanceMatrix ( )
inline

Access to the whole distance matrix.

Returns
the fully computed distance matrix

Definition at line 85 of file CRNLazyDistanceMatrix.h.

template<typename DATA , typename DISTANCE >
size_t crn::LazyDistanceMatrix< DATA, DISTANCE >::GetRows ( ) const
inlinenoexcept

Returns the number of rows.

Returns
The number of rows.

Definition at line 59 of file CRNLazyDistanceMatrix.h.

template<typename DATA , typename DISTANCE >
LazyDistanceMatrix& crn::LazyDistanceMatrix< DATA, DISTANCE >::operator= ( const LazyDistanceMatrix< DATA, DISTANCE > &  )
delete
template<typename DATA , typename DISTANCE >
LazyDistanceMatrix& crn::LazyDistanceMatrix< DATA, DISTANCE >::operator= ( LazyDistanceMatrix< DATA, DISTANCE > &&  )
delete

The documentation for this class was generated from the following file: