Functions
contrib/mul/mmn/mmn_order_cost.h File Reference

Functions to re-arrange cost data to match index rank. More...

#include <vil/vil_image_view.h>

Go to the source code of this file.

Functions

void mmn_get_order (unsigned v0, unsigned v1, unsigned v2, unsigned &i0, unsigned &i1, unsigned &i2)
 (i0,i1,i2) gives ordering of v0,v1,v2.
void mmn_get_rank (unsigned v0, unsigned v1, unsigned v2, unsigned &i0, unsigned &i1, unsigned &i2)
 (i0,i1,i2) gives rank of v0,v1,v2.
vil_image_view< double > mmn_order_cost (const vil_image_view< double > &c, unsigned v1, unsigned v2, unsigned v3)
 Create new view of data, with axes re-arranged.
vil_image_view< double > mmn_unorder_cost (const vil_image_view< double > &c, unsigned v1, unsigned v2, unsigned v3)
 Make new view of data, with axes re-arranged. Inverse of mmn_order_cost.

Detailed Description

Functions to re-arrange cost data to match index rank.

Author:
Tim Cootes

Definition in file mmn_order_cost.h.


Function Documentation

void mmn_get_order ( unsigned  v0,
unsigned  v1,
unsigned  v2,
unsigned &  i0,
unsigned &  i1,
unsigned &  i2 
)

(i0,i1,i2) gives ordering of v0,v1,v2.

Each i is {0,1,2}, indicating rank of equivalent v ie if i0=1, then v0 is the middle value if i1=2, then v1 is the largest value

Definition at line 13 of file mmn_order_cost.cxx.

void mmn_get_rank ( unsigned  v0,
unsigned  v1,
unsigned  v2,
unsigned &  i0,
unsigned &  i1,
unsigned &  i2 
)

(i0,i1,i2) gives rank of v0,v1,v2.

I.e. v[i0] is smallest, v[i2] is largest

Definition at line 29 of file mmn_order_cost.cxx.

vil_image_view<double> mmn_order_cost ( const vil_image_view< double > &  c,
unsigned  v1,
unsigned  v2,
unsigned  v3 
)

Create new view of data, with axes re-arranged.

c(i1,i2,i3) is the value associated with i1 on node v1, i2 on node v2 etc. The i-axis of the returned image is associated with the node min(v1,v2,v3), the j axis with mid(v1,v2,v3) and the k with max(v1,v2,v3) The inverse operation is given by mmn_unorder_cost

Definition at line 50 of file mmn_order_cost.cxx.

vil_image_view<double> mmn_unorder_cost ( const vil_image_view< double > &  c,
unsigned  v1,
unsigned  v2,
unsigned  v3 
)

Make new view of data, with axes re-arranged. Inverse of mmn_order_cost.

The i-axis of c is associated with the node min(v1,v2,v3), the j axis with mid(v1,v2,v3) and the k with max(v1,v2,v3) Returns image r, where r(i1,i2,i3) is the value associated with i1 on node v1, i2 on node v2 etc.

Make new view of data, with axes re-arranged. Inverse of mmn_order_cost.

The i-axis of c is associated with the node min(v1,v2,v3), the j axis with mid(v1,v2,v3) and the k with max(v1,v2,v3) Returns image r, where r(i1,i2,i3) is the value associated with i1 on node v1, i2 on node v2 etc.

Definition at line 70 of file mmn_order_cost.cxx.