Regina 7.0 Calculation Engine
Public Member Functions | Public Attributes | List of all members
regina::LPCol< LPConstraint > Struct Template Reference

Used by LPInitialTableaux<LPConstraint> to store a single column of the adjusted matching equation matrix in sparse form. More...

#include <enumerate/treelp.h>

Public Member Functions

 LPCol ()
 Initialises an empty column. More...
 
 LPCol (const LPCol &)=default
 Creates a new copy of the given column. More...
 
 LPCol (LPCol &&)=default
 Moves the contents of the given column into this new column. More...
 
LPColoperator= (const LPCol &)=default
 Sets this to be a copy of the given column. More...
 
LPColoperator= (LPCol &&)=default
 Moves the contents of the given column into this column. More...
 
void push (unsigned row, int val)
 Adds the given entry in the given row to this column. More...
 

Public Attributes

unsigned nPlus
 The total number of +1 entries in this column. More...
 
unsigned plus [4]
 The rows containing these +1 entries, in any order. More...
 
unsigned nMinus
 The total number of -1 entries in this column. More...
 
unsigned minus [4]
 The rows containing these -1 entries, in any order. More...
 
std::array< typename LPConstraint::Coefficient, LPConstraint::nConstraints > extra
 The coefficients for this column that appear in each extra linear constraint defined by the LPConstraint class. More...
 

Detailed Description

template<class LPConstraint>
struct regina::LPCol< LPConstraint >

Used by LPInitialTableaux<LPConstraint> to store a single column of the adjusted matching equation matrix in sparse form.

See the LPInitialTableaux class notes for details on what the "adjusted matching equation matrix" means.

Specifically, an LPCol object stores the location of each +1 entry, and the location of each -1 entry. If some entry in the matrix is greater than +1 or less than -1, we represent it using multiple +1 or -1 entries in the same matrix location.

For any additional rows that represent extra linear constraints described by the LPConstraint class, an LPCol object stores the coefficients for those rows explicitly. The number of such rows is assumed to be very small (at the time of writing, this is no larger than 2 for all of Regina's constraint classes).

These column objects have full value semantics. Assuming the number of rows from any extra linear constraints is very small (as noted above), these column objects are cheap to move, cheap to copy, and cheap to swap via std::swap().

Warning
End users should not use this class at all. It was designed purely for use as internal storage for LPInitialTableaux, and at some point in the future this class will most likely become private to LPInitialTableaux.
Python
Not present, since LPCol is only designed to be used as part of the internal data storage for LPInitialTableaux.
Warning
The API for this class has not yet been finalised. This means that the class interface may change in new versions of Regina, without maintaining backward compatibility. If you use this class directly in your own code, please watch the detailed changelogs upon new releases to see if you need to make changes to your code.

Constructor & Destructor Documentation

◆ LPCol() [1/3]

template<class LPConstraint >
regina::LPCol< LPConstraint >::LPCol
inline

Initialises an empty column.

◆ LPCol() [2/3]

template<class LPConstraint >
regina::LPCol< LPConstraint >::LPCol ( const LPCol< LPConstraint > &  )
default

Creates a new copy of the given column.

◆ LPCol() [3/3]

template<class LPConstraint >
regina::LPCol< LPConstraint >::LPCol ( LPCol< LPConstraint > &&  )
default

Moves the contents of the given column into this new column.

This move operation is not marked noexcept, since this depends upon the underlying LPConstraint class.

After this operation, the given column will no longer be usable.

Member Function Documentation

◆ operator=() [1/2]

template<class LPConstraint >
LPCol & regina::LPCol< LPConstraint >::operator= ( const LPCol< LPConstraint > &  )
default

Sets this to be a copy of the given column.

Returns
a reference to this column.

◆ operator=() [2/2]

template<class LPConstraint >
LPCol & regina::LPCol< LPConstraint >::operator= ( LPCol< LPConstraint > &&  )
default

Moves the contents of the given column into this column.

This move operation is not marked noexcept, since this depends upon the underlying LPConstraint class.

After this operation, the given column will no longer be usable.

Returns
a reference to this column.

◆ push()

template<class LPConstraint >
void regina::LPCol< LPConstraint >::push ( unsigned  row,
int  val 
)
inline

Adds the given entry in the given row to this column.

Precondition
No entry in the given row has been added to this column yet.
The sum of absolute values of all entries in this column must never exceed 4.
Parameters
rowthe row containing the given value.
valthe value at this location in the matrix.

Member Data Documentation

◆ extra

template<class LPConstraint >
std::array<typename LPConstraint::Coefficient, LPConstraint::nConstraints> regina::LPCol< LPConstraint >::extra

The coefficients for this column that appear in each extra linear constraint defined by the LPConstraint class.

◆ minus

template<class LPConstraint >
unsigned regina::LPCol< LPConstraint >::minus[4]

The rows containing these -1 entries, in any order.

The same row may appear in this list more than once (indicating a -2, -3 or -4 entry in the matrix).

◆ nMinus

template<class LPConstraint >
unsigned regina::LPCol< LPConstraint >::nMinus

The total number of -1 entries in this column.

◆ nPlus

template<class LPConstraint >
unsigned regina::LPCol< LPConstraint >::nPlus

The total number of +1 entries in this column.

◆ plus

template<class LPConstraint >
unsigned regina::LPCol< LPConstraint >::plus[4]

The rows containing these +1 entries, in any order.

The same row may appear in this list more than once (indicating a +2, +3 or +4 entry in the matrix).


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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).