lobot::PointMatrix Class Reference

A thread-safe container for storing "normalized" point lists. More...

#include <Robots/LoBot/metlog/LoPointMatrix.H>

Collaboration diagram for lobot::PointMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PointMatrix (int rows, int cols)
 Initalization: creates a point matrix of the specified size.
void add (const PointList &)
PointList average () const

Detailed Description

A thread-safe container for storing "normalized" point lists.

When we conduct an experiment to gauge lobot's performance, we collect several different lists of points: one to record the robot's trajectory from start to finish, another to record the locations where the robot's emergency stop behaviour was activated, another for the locations where the LGMD avoidance algorithm averted the robot away from an approaching obstacle; so on and so forth.

Each experiment will produce point lists of different sizes. To compute the robot's average case behaviour, we will have to "normalize" these lists so that they all contain the same number of elements as some reference experiment. After we have discarded extra points or added missing points w.r.t. the reference experiment, we can find point correspondences across experiments and, finally, average these transformed lists to get the desired result.

This class stores the intermediate "normalized" point lists in a matrix. The columns of this matrix correspond to the individual experiments. The rows store corresponding points across experiments. For example, if we have 25 experiments in a dataset and the reference experiment is found to have 300 points in its trajectory point list, then this point matrix will have 25 columns and 300 rows.

To find the point correspondences between each experiment's point lists and that of the reference experiment, we find the nearest point to each point in the reference experiment. The resulting list of points is stored as a column vector in the point matrix.

The correspondences for one experiment are completely independent of the correspondences for another. Therefore, we can parallelize the correspondence finding procedure by launching multiple threads to handle the different experiments.

Consequently, this class implements a thread-safe API for adding column vectors. The main thread should instantiate this class and then pass its address to each of the correspondence finding threads.

Definition at line 128 of file LoPointMatrix.H.


Constructor & Destructor Documentation

lobot::PointMatrix::PointMatrix ( int  rows,
int  cols 
)

Initalization: creates a point matrix of the specified size.

Definition at line 63 of file LoPointMatrix.C.

References fill().


Member Function Documentation

void lobot::PointMatrix::add ( const PointList L  ) 

This method adds the supplied point list to the point matrix by copying the point list to one of its columns. Since this method is called by the correspondence finder threads, it ensures thread-safety.

WARNING: Attempting to add more point lists, i.e., column vectors, to the matrix than the number of columns (dataset size) will result in a lobot::misc_error(LOGIC_ERROR).

Definition at line 71 of file LoPointMatrix.C.

References lobot::PointList::begin().

PointList lobot::PointMatrix::average (  )  const

Computes the component-wise average of the matrix's column vectors.

Definition at line 87 of file LoPointMatrix.C.

References lobot::PointList::add(), and sum().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:30:42 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3