The class vdiff describes a set of difference vectors. More...

`#include <vdiff.hh>`

Collaboration diagram for vdiff:

## Public Member Functions | |

vdiff (std::vector< const field * > &fields) | |

Constructor that calculates difference vectors. | |

field | operator[] (int col) const |

Retrieve a difference operator. | |

bool | operator< (const vdiff &d) const |

Compare sets of vector differences. | |

size_t | num_cols () const |

Retrieve number of difference vecors. | |

## Private Attributes | |

int | rows |

Number of rows in the matrix of difference vectors. | |

int | cols |

Number of columns in the matrix of difference vectors. | |

std::set< triplet< rational > > | elements |

Matrix elements of the matrix of difference vectors. |

The class vdiff describes a set of difference vectors.

The most important use of this class is the ability to compare sets of difference vectors, so that these sets can be used as a map key.

Definition at line 36 of file vdiff.hh.

vdiff::vdiff | ( | std::vector< const field * > & | fields |
) |

Constructor that calculates difference vectors.

Given a set of input vectors (field descriptions), this constructor sorts them, calculates differences between the first and subsequent vectors, and stores these difference vectors internally.

**Parameters:**-
`[in,out]`*fields*a collection of fields, will be sorted.

Definition at line 81 of file vdiff.cc.

References cols, elements, make_triplet(), and rows.

size_t vdiff::num_cols | ( | ) | const` [inline]` |

Retrieve number of difference vecors.

This allows read-only access to the private member vdiff::cols.

**Returns:**- the number of difference vectors.

Definition at line 48 of file vdiff.hh.

References cols.

Compare sets of vector differences.

The comparison is implemented as a lexicographical comparison over matrix element triplets. However, any total order should do.

**Parameters:**-
*d*the other set of difference vectors.

**Returns:**- whether this set is less than the other set of difference vectors.

field vdiff::operator[] | ( | int | col |
) | const |

Retrieve a difference operator.

The difference vector with the given index is constructed on the fly. Assuming input consisted of vectors v[0] thrugh v[n], then for a given argument i this method here will return the vector v[i+1]-v[0]. Obviously the maximum index is two less than the number of input vectors to the constructor.

**Parameters:**-
*col*the index of the difference vector to be returned.

**Returns:**- the specified difference vector.

Definition at line 106 of file vdiff.cc.

References elements, rows, and field::values.

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

Generated on Fri Aug 21 08:15:08 2009 for mqn2mps by 1.6.0