Arageli::simplex_method Namespace Reference


Classes

struct  rule_s_primal_first
 Rule to choice the first appropriate column as pivot in the primal simplex method. More...
struct  rule_r_primal_first
 Rule to choice the first appropriate row as pivot in the primal simplex method. More...
struct  rule_r_primal_lex
 Rule to choice the lexmin appropriate row as pivot in the primal simplex method. More...
struct  rule_r_dual_first
 Rule to choice the first appropriate row as pivot in the dual simplex method. More...
struct  rule_s_dual_first
 Rule to choice the first appropriate column as pivot in the dual simplex method. More...
struct  linear_prog_task_base
class  linear_prog_task
 Model of the linear programming task with partial integer constraints. More...

Looking for parts of a simplex table that is not satisfied certain criterion.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
matrix< T1, REFCNT1 >::size_type find_row_notallow (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &basis)
 Finds the first not allowable basis column in a row simplex table.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
matrix< T1, REFCNT1 >::size_type find_col_notallow (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &nonbasis)
 Finds the first not allowable basis row in a column simplex table.
template<typename T1, bool REFCNT1>
matrix< T1, REFCNT1 >::size_type find_primal_notallow (const matrix< T1, REFCNT1 > &a)
 Finds the first not allowable row in a primal simplex table.
template<typename T1, bool REFCNT1>
matrix< T1, REFCNT1 >::size_type find_dual_notallow (const matrix< T1, REFCNT1 > &a)
 Finds the first not allowable column in a dual simplex table.

Determination type of a simplex table.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
bool is_row_allow (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &basis)
 Returns true if simplex table 'a' with basis 'basis' is row simplex table.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
bool is_col_allow (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &nonbasis)
 Returns true if simplex table 'a' with nonbasis 'nonbasis' is column simplex table.
template<typename T1, bool REFCNT1>
bool is_primal_allow (const matrix< T1, REFCNT1 > &a)
 Returns true if simplex table 'a' is primal allowable.
template<typename T1, bool REFCNT1>
bool is_dual_allow (const matrix< T1, REFCNT1 > &a)
 Returns true if simplex table 'a' is dual allowable.

The primal row iterations on a row simplex table.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename T_pivot, typename Rule_s, typename Rule_r>
result_kind primal_row_iter (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis, T_pivot &prow, T_pivot &pcol, Rule_s rule_s, Rule_r rule_r)
 Performs one primal row iteration on a row simplex table.
template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis>
result_kind primal_row_iter (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis)
 Performs one primal row iteration on a row simplex table.
template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Rule_s, typename Rule_r>
result_kind primal_row_iter (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis, Rule_s rule_s, Rule_r rule_r)
 Performs one primal row iteration on a row simplex table.
template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename T_pivot>
result_kind primal_row_iter_pivotout (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis, T_pivot &prow, T_pivot &pcol)
 Performs one primal row iteration on a row simplex table.

Artificial basis method.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void artificial_basis_create (matrix< T1, REFCNT1 > &a, vector< T2, REFCNT2 > &basis)
 Creates artificial task to find valid basis by the artifical basis method.

The Gomory's algorithms.

template<typename T, bool REFCNT, typename Prow>
result_kind gomory1_clip (matrix< T, REFCNT > &t, Prow &prow)
 Creates Gomory's clip on optimal column simplex table.
template<typename T, bool REFCNT>
result_kind gomory1_clip (matrix< T, REFCNT > &t)
 Creates Gomory's clip on optimal column simplex table.

Enumerations

enum  result_kind { rk_found, rk_empty, rk_infinite, rk_nonoptimal }
 General kind of result of one or more iterations of the simplex method. More...

Functions

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind primal_row_iters (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Performs numerous primal row iterations on a row simplex table.
template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis>
result_kind primal_row_iters (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis)
 Performs numerous primal row iterations on a row simplex table.
template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Ctrler>
result_kind primal_row_iters (matrix< T_q, REFCNT_q > &q, vector< T_basis, REFCNT_basis > &basis, Ctrler ctrler)
 Performs numerous primal row iterations on a row simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind primal_col_iters (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Performs numerous primal colunt iterations on a column simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind primal_col_iters (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis)
 Performs numerous primal column iterations on a column simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind dual_col_iter (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Performs one dual column iteration on a column simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind dual_col_iter (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis)
 Performs one dual column iteration on a column simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r>
result_kind dual_col_iter (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis, Rule_s rule_s, Rule_r rule_r)
 Performs one dual column iteration on a column simplex table.
template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind dual_col_iters (matrix< T_Q, REFCNT_Q > &Q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Performs numerous dual colunt iterations on a column simplex table.
template<typename T_q, bool REFCNT_q, typename T_nonbasis, bool REFCNT_nonbasis, typename Ctrler>
result_kind dual_col_iters (matrix< T_q, REFCNT_q > &q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis, Ctrler ctrler)
 Performs numerous dual colunt iterations on a column simplex table.
template<typename T_q, bool REFCNT_q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind dual_col_iters (matrix< T_q, REFCNT_q > &q, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis)
 Performs numerous dual column iterations on a column simplex table.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
void basis_create_by_artificial (matrix< T1, REFCNT1 > &q, vector< T2, REFCNT2 > &basis, Ctrler ctrler)
 Produces a valid basis from artifical optimal simplex table due the artifical basis method.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void basis_create_by_artificial (matrix< T1, REFCNT1 > &a, vector< T2, REFCNT2 > &basis)
 Produces a valid basis from artifical optimal simplex table due the artifical basis method.
template<typename T1, bool REFCNT1, typename T3, bool REFCNT3, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind basis_artificial (matrix< T1, REFCNT1 > &q, vector< T3, REFCNT3 > &basis, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Builds primal allowable basis from simplex table q by artificial basis method.
template<typename T1, bool REFCNT1, typename T3, bool REFCNT3, typename Ctrler>
result_kind basis_artificial (matrix< T1, REFCNT1 > &q, vector< T3, REFCNT3 > &basis, Ctrler ctrler)
 Builds primal allowable basis from simplex table q by artificial basis method.
template<typename T1, bool REFCNT1, typename T3, bool REFCNT3>
result_kind basis_artificial (matrix< T1, REFCNT1 > &q, vector< T3, REFCNT3 > &basis)
 Builds primal allowable basis from simplex table q by artificial basis method.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3>
void row_table_create (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &b, matrix< T3, REFCNT3 > &q)
 Creating of a row table from matrix A and vector b, with zeros in the first row.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void row_table_place_c (const vector< T1, REFCNT1 > &c, matrix< T2, REFCNT2 > &q)
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void row_table_extract_c (vector< T1, REFCNT1 > &c, const matrix< T2, REFCNT2 > &q)
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void row_table_pivot_basis_c (matrix< T1, REFCNT1 > &q, const vector< T2, REFCNT2 > &basis)
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3>
void row_table_extract_solution (const matrix< T1, REFCNT1 > &q, const vector< T2, REFCNT2 > &basis, vector< T3, REFCNT3 > &x)
template<typename T1, bool REFCNT1, typename N, typename T2, bool REFCNT2>
void col_table_extract_solution (const matrix< T1, REFCNT1 > &t, const N &n, vector< T2, REFCNT2 > &x)
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4>
void row_table_create (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &b, const vector< T3, REFCNT3 > &c, matrix< T4, REFCNT4 > &q)
 Creating of a row table from matrix A and vectors b, c.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T4, bool REFCNT4>
void row_table_split (matrix< T1, REFCNT1 > &a, vector< T2, REFCNT2 > &b, const matrix< T4, REFCNT4 > &q)
 Creating of matrix A and vectors b, c from a row table q.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4>
void row_table_split (matrix< T1, REFCNT1 > &a, vector< T2, REFCNT2 > &b, const vector< T3, REFCNT3 > &c, const matrix< T4, REFCNT4 > &q)
 Creating of matrix A and vectors b, c from a row table q.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4, typename T5, bool REFCNT5>
void col_table_create_by_standard (const matrix< T1, REFCNT1 > &a, const vector< T2, REFCNT2 > &b, const vector< T3, REFCNT3 > &c, matrix< T4, REFCNT4 > &t, vector< T5, REFCNT5 > &nonbasis)
 Makes primal column table by given task in standard shape.
template<typename Ta, bool REFCNTa, typename Tb, bool REFCNTb, typename Tc, bool REFCNTc, typename Tx, bool REFCNTx, typename Tbasis, bool REFCNTbasis, typename Tres, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind primal_row_with_artificial_basis (const matrix< Ta, REFCNTa > &a, const vector< Tb, REFCNTb > &b, const vector< Tc, REFCNTc > &c, vector< Tx, REFCNTx > &basis_x, vector< Tbasis, REFCNTbasis > &basis, Tres &res, Rule_s rule_s, Rule_r rule_r, Ctrler ctrler)
 Solves the linear programming problem with artificial basis method as zeroth step.
template<typename Ta, bool REFCNTa, typename Tb, bool REFCNTb, typename Tc, bool REFCNTc, typename Tx, bool REFCNTx, typename Tbasis, bool REFCNTbasis, typename Tres>
result_kind primal_row_with_artificial_basis (const matrix< Ta, REFCNTa > &a, const vector< Tb, REFCNTb > &b, const vector< Tc, REFCNTc > &c, vector< Tx, REFCNTx > &basis_x, vector< Tbasis, REFCNTbasis > &basis, Tres &res)
 Solves the linear programming problem with artificial basis method as zeroth step.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void basis_to_nonbasis (const vector< T1, REFCNT1 > &basis, vector< T2, REFCNT2 > &nonbasis, std::size_t first_number, std::size_t n)
 Makes nonbasis by basis.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void basis_to_nonbasis (const vector< T1, REFCNT1 > &basis, vector< T2, REFCNT2 > &nonbasis, std::size_t n)
 Makes nonbasis by basis.
template<typename T_Q, bool REFCNT_Q, typename T_basis, bool REFCNT_basis, typename T_T, bool REFCNT_T, typename T_nonbasis, bool REFCNT_nonbasis>
void row_to_col_table (const matrix< T_Q, REFCNT_Q > &q, const vector< T_basis, REFCNT_basis > &basis, matrix< T_T, REFCNT_T > &t, vector< T_nonbasis, REFCNT_nonbasis > &nonbasis)
 Converts a valid simplex table from a row form to a column form.
template<typename T_QT, bool REFCNT_QT, typename T_basis_nonbasis, bool REFCNT_basis_nonbasis>
void row_to_col_table (matrix< T_QT, REFCNT_QT > &qt, vector< T_basis_nonbasis, REFCNT_basis_nonbasis > &basis_nonbasis)
 Converts a valid simplex table from a row form to a column form.
template<typename T_Q, bool REFCNT_Q, typename T_basis, bool REFCNT_basis, typename T_DQ, bool REFCNT_DQ, typename T_Dbasis, bool REFCNT_Dbasis>
void primal_row_to_dual_row_table (const matrix< T_Q, REFCNT_Q > &q, const vector< T_basis, REFCNT_basis > &basis, matrix< T_DQ, REFCNT_DQ > &dq, vector< T_Dbasis, REFCNT_Dbasis > &dbasis)
 Creates a dual row simplex table by primal row simplex table with selected basis.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
result_kind gomory1_iter (matrix< T1, REFCNT1 > &t, vector< T2, REFCNT2 > &nonbasis, Ctrler ctrler)
 One iteration of The First Gomory's Algorithm on an optimal column simplex table.
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
result_kind gomory1_iters (matrix< T1, REFCNT1 > &t, vector< T2, REFCNT2 > &nonbasis, Ctrler ctrler)
template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
result_kind gomory1_iters (matrix< T1, REFCNT1 > &t, vector< T2, REFCNT2 > &nonbasis)
template<typename T_a, bool REFCNT_a, typename T_b, bool REFCNT_b, typename T_c, bool REFCNT_c, typename T_da, bool REFCNT_da, typename T_db, bool REFCNT_db, typename T_dc, bool REFCNT_dc, typename T_basis, bool REFCNT_basis>
void primal_to_dual_canonical (const matrix< T_a, REFCNT_a > &a, const vector< T_b, REFCNT_b > &b, const vector< T_c, REFCNT_c > &c, matrix< T_da, REFCNT_da > &da, vector< T_db, REFCNT_db > &db, vector< T_dc, REFCNT_dc > &dc, vector< T_basis, REFCNT_basis > &basis)
 Makes the dual task in canonical shape by primal task.
template<typename T_a, bool REFCNT_a, typename T_b, bool REFCNT_b, typename T_c, bool REFCNT_c, typename T_basis, bool REFCNT_basis, typename T_da, bool REFCNT_da, typename T_db, bool REFCNT_db, typename T_dc, bool REFCNT_dc, typename T_res, typename T_ab, bool REFCNT_ab, typename T_cb, bool REFCNT_cb>
void primal_to_dual_standard_discr (const matrix< T_a, REFCNT_a > &a, const vector< T_b, REFCNT_b > &b, const vector< T_c, REFCNT_c > &c, const vector< T_basis, REFCNT_basis > basis, matrix< T_da, REFCNT_da > &da, vector< T_db, REFCNT_db > &db, vector< T_dc, REFCNT_dc > &dc, T_res &res_offset, matrix< T_ab, REFCNT_ab > &bsuba, vector< T_cb, REFCNT_cb > &bsubc)
 Makes the dual task in standard shape by primal task via introducing discrepancy variables.
template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_ostream< Ch, ChT > & output_list (std::basic_ostream< Ch, ChT > &out, const linear_prog_task< T, REFCNT > &lpt)
template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_istream< Ch, ChT > & input_list (std::basic_istream< Ch, ChT > &in, linear_prog_task< T, REFCNT > &lpt)
template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_ostream< Ch, ChT > & output_aligned (std::basic_ostream< Ch, ChT > &out, const linear_prog_task< T, REFCNT > &lpt, const char *var="x")


Enumeration Type Documentation

enum Arageli::simplex_method::result_kind

General kind of result of one or more iterations of the simplex method.

Enumerator:
rk_found  an optimal vector is found
rk_empty  there are no allowable vectors
rk_infinite  the criterion function is unbounded
rk_nonoptimal  an optimal vector is not found (to be found next iter)

Definition at line 176 of file simplex_method.hpp.


Function Documentation

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
matrix<T1, REFCNT1>::size_type Arageli::simplex_method::find_row_notallow ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  basis 
) [inline]

Finds the first not allowable basis column in a row simplex table.

WARNING! EXPLANATION MAYBE INCORRECT. Suppose 'a' is a row simplex table corresponding the basis. The function finds the column such that 1) its number j (j > 0) is contained in basis at position k, 2) there is a number i in {0, ..., a.nrows()-1} \ {k+1}, a(i, j) != 0, 3) a(k+1, j) == 1. Returns the first such index at 'basis', i.e. basis[return value] is such column number.

Definition at line 61 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
matrix<T1, REFCNT1>::size_type Arageli::simplex_method::find_col_notallow ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  nonbasis 
) [inline]

Finds the first not allowable basis row in a column simplex table.

WARNING! EXPLANATION MAYBE INCORRECT. Suppose 'a' is a column simplex table corresponding the nonbasis. The function finds the row such that 1) its number j (j > 0) is contained in nonbasis at position k, 2) there is a number i in {0, ..., a.ncols()-1} \ {k+1}, a(j, i) != 0, 3) a(j, k+1) == -1. Returns the first such index at 'nonbasis', i.e. nonbasis[return value] is such column number.

Definition at line 89 of file simplex_method.hpp.

template<typename T1, bool REFCNT1>
matrix<T1, REFCNT1>::size_type Arageli::simplex_method::find_primal_notallow ( const matrix< T1, REFCNT1 > &  a  )  [inline]

Finds the first not allowable row in a primal simplex table.

Finds the first row i that satisfies an expression a(i, j) < 0 for some j (if any). If there is no such i, returns a.nrows().

Definition at line 113 of file simplex_method.hpp.

template<typename T1, bool REFCNT1>
matrix<T1, REFCNT1>::size_type Arageli::simplex_method::find_dual_notallow ( const matrix< T1, REFCNT1 > &  a  )  [inline]

Finds the first not allowable column in a dual simplex table.

Finds the first column j that satisfies an expression a(i, j) < 0 for some i (if any). If there is no such j, returns a.ncols().

Definition at line 128 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
bool Arageli::simplex_method::is_row_allow ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  basis 
) [inline]

Returns true if simplex table 'a' with basis 'basis' is row simplex table.

Definition at line 148 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
bool Arageli::simplex_method::is_col_allow ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  nonbasis 
) [inline]

Returns true if simplex table 'a' with nonbasis 'nonbasis' is column simplex table.

Definition at line 155 of file simplex_method.hpp.

template<typename T1, bool REFCNT1>
bool Arageli::simplex_method::is_primal_allow ( const matrix< T1, REFCNT1 > &  a  )  [inline]

Returns true if simplex table 'a' is primal allowable.

Definition at line 162 of file simplex_method.hpp.

template<typename T1, bool REFCNT1>
bool Arageli::simplex_method::is_dual_allow ( const matrix< T1, REFCNT1 > &  a  )  [inline]

Returns true if simplex table 'a' is dual allowable.

Definition at line 169 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename T_pivot, typename Rule_s, typename Rule_r>
result_kind Arageli::simplex_method::primal_row_iter ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis,
T_pivot &  prow,
T_pivot &  pcol,
Rule_s  rule_s,
Rule_r  rule_r 
)

Performs one primal row iteration on a row simplex table.

Performs the iteration, determines if the table is optimal or if there are no an optimum. The result value depends on status of input table, not output. In particular if not optimal table is passed to the algorithm and on the output we have an optimal table then the functions returns rk_nonoptimal.

Parameters:
q  the simplex table
basis  the basis
prow  row number of pivot item (output, valid after call if table is nonoptimal)
pcol  column number of pivot item (output, valid after call if table is nonoptimal)
rule_s  the rule to choice a pivot column
rule_r  the rule to choice a pivot row

Definition at line 369 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis>
result_kind Arageli::simplex_method::primal_row_iter ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis 
) [inline]

Performs one primal row iteration on a row simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 404 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Rule_s, typename Rule_r>
result_kind Arageli::simplex_method::primal_row_iter ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis,
Rule_s  rule_s,
Rule_r  rule_r 
) [inline]

Performs one primal row iteration on a row simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 429 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename T_pivot>
result_kind Arageli::simplex_method::primal_row_iter_pivotout ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis,
T_pivot &  prow,
T_pivot &  pcol 
) [inline]

Performs one primal row iteration on a row simplex table.

Just calls full vertion of the method primal_row_iter with some default arguments.

Definition at line 450 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::primal_row_iters ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Performs numerous primal row iterations on a row simplex table.

Performs the iteration, determines if the table is optimal or if there are no an optimum and so on until table becomes optimal.

Definition at line 515 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis>
result_kind Arageli::simplex_method::primal_row_iters ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis 
) [inline]

Performs numerous primal row iterations on a row simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 562 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_basis, bool REFCNT_basis, typename Ctrler>
result_kind Arageli::simplex_method::primal_row_iters ( matrix< T_q, REFCNT_q > &  q,
vector< T_basis, REFCNT_basis > &  basis,
Ctrler  ctrler 
) [inline]

Performs numerous primal row iterations on a row simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 586 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::primal_col_iters ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Performs numerous primal colunt iterations on a column simplex table.

Performs the iteration, determines if the table is optimal or if there are no an optimum and so on until table becomes optimal.

Definition at line 814 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind Arageli::simplex_method::primal_col_iters ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis 
) [inline]

Performs numerous primal column iterations on a column simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 844 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::dual_col_iter ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Performs one dual column iteration on a column simplex table.

Performs the iteration, determines if the table is optimal or if there are no an optimum.

Definition at line 938 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind Arageli::simplex_method::dual_col_iter ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis 
) [inline]

Performs one dual column iteration on a column simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 991 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r>
result_kind Arageli::simplex_method::dual_col_iter ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis,
Rule_s  rule_s,
Rule_r  rule_r 
) [inline]

Performs one dual column iteration on a column simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 1013 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_nonbasis, bool REFCNT_nonbasis, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::dual_col_iters ( matrix< T_Q, REFCNT_Q > &  Q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Performs numerous dual colunt iterations on a column simplex table.

Performs the iteration, determines if the table is optimal or if there are no an optimum and so on until table becomes optimal.

Definition at line 1067 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_nonbasis, bool REFCNT_nonbasis, typename Ctrler>
result_kind Arageli::simplex_method::dual_col_iters ( matrix< T_q, REFCNT_q > &  q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis,
Ctrler  ctrler 
) [inline]

Performs numerous dual colunt iterations on a column simplex table.

Rules of selection of pivot rows and columns are rule_s_dual_first and rule_r_dual_first. See complete version of this function.

Definition at line 1099 of file simplex_method.hpp.

template<typename T_q, bool REFCNT_q, typename T_nonbasis, bool REFCNT_nonbasis>
result_kind Arageli::simplex_method::dual_col_iters ( matrix< T_q, REFCNT_q > &  q,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis 
) [inline]

Performs numerous dual column iterations on a column simplex table.

Just calls full vertion of the method with some default arguments.

Definition at line 1123 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::artificial_basis_create ( matrix< T1, REFCNT1 > &  a,
vector< T2, REFCNT2 > &  basis 
)

Creates artificial task to find valid basis by the artifical basis method.

New variables (and columns) will have been placed to the beginning of the table.

Definition at line 1145 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
void Arageli::simplex_method::basis_create_by_artificial ( matrix< T1, REFCNT1 > &  q,
vector< T2, REFCNT2 > &  basis,
Ctrler  ctrler 
)

Produces a valid basis from artifical optimal simplex table due the artifical basis method.

The artifical variables must be located in the beginning of the table.

Definition at line 1221 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::basis_create_by_artificial ( matrix< T1, REFCNT1 > &  a,
vector< T2, REFCNT2 > &  basis 
) [inline]

Produces a valid basis from artifical optimal simplex table due the artifical basis method.

Just calls full vertion of the method with some default arguments.

Definition at line 1279 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T3, bool REFCNT3, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::basis_artificial ( matrix< T1, REFCNT1 > &  q,
vector< T3, REFCNT3 > &  basis,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Builds primal allowable basis from simplex table q by artificial basis method.

After calling this method the old values of the first row of q is lost.

Definition at line 1344 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T3, bool REFCNT3, typename Ctrler>
result_kind Arageli::simplex_method::basis_artificial ( matrix< T1, REFCNT1 > &  q,
vector< T3, REFCNT3 > &  basis,
Ctrler  ctrler 
) [inline]

Builds primal allowable basis from simplex table q by artificial basis method.

Rule of selection of row and column are by the default.

Definition at line 1397 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T3, bool REFCNT3>
result_kind Arageli::simplex_method::basis_artificial ( matrix< T1, REFCNT1 > &  q,
vector< T3, REFCNT3 > &  basis 
) [inline]

Builds primal allowable basis from simplex table q by artificial basis method.

With default idle conroller. See complete version of this function.

Definition at line 1421 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3>
void Arageli::simplex_method::row_table_create ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  b,
matrix< T3, REFCNT3 > &  q 
)

Creating of a row table from matrix A and vector b, with zeros in the first row.

The result will have been placed into q.

Definition at line 1502 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::row_table_place_c ( const vector< T1, REFCNT1 > &  c,
matrix< T2, REFCNT2 > &  q 
)

Definition at line 1526 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::row_table_extract_c ( vector< T1, REFCNT1 > &  c,
const matrix< T2, REFCNT2 > &  q 
)

Definition at line 1544 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::row_table_pivot_basis_c ( matrix< T1, REFCNT1 > &  q,
const vector< T2, REFCNT2 > &  basis 
)

Definition at line 1562 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3>
void Arageli::simplex_method::row_table_extract_solution ( const matrix< T1, REFCNT1 > &  q,
const vector< T2, REFCNT2 > &  basis,
vector< T3, REFCNT3 > &  x 
)

Definition at line 1579 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename N, typename T2, bool REFCNT2>
void Arageli::simplex_method::col_table_extract_solution ( const matrix< T1, REFCNT1 > &  t,
const N &  n,
vector< T2, REFCNT2 > &  x 
)

Parameters:
n  number of meaningful variables

Definition at line 1598 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4>
void Arageli::simplex_method::row_table_create ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  b,
const vector< T3, REFCNT3 > &  c,
matrix< T4, REFCNT4 > &  q 
)

Creating of a row table from matrix A and vectors b, c.

The result will have been placed into q.

Definition at line 1620 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T4, bool REFCNT4>
void Arageli::simplex_method::row_table_split ( matrix< T1, REFCNT1 > &  a,
vector< T2, REFCNT2 > &  b,
const matrix< T4, REFCNT4 > &  q 
)

Creating of matrix A and vectors b, c from a row table q.

The result will have been placed into a, b, c.

Definition at line 1642 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4>
void Arageli::simplex_method::row_table_split ( matrix< T1, REFCNT1 > &  a,
vector< T2, REFCNT2 > &  b,
const vector< T3, REFCNT3 > &  c,
const matrix< T4, REFCNT4 > &  q 
)

Creating of matrix A and vectors b, c from a row table q.

The result will have been placed into a, b, c.

Definition at line 1672 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename T3, bool REFCNT3, typename T4, bool REFCNT4, typename T5, bool REFCNT5>
void Arageli::simplex_method::col_table_create_by_standard ( const matrix< T1, REFCNT1 > &  a,
const vector< T2, REFCNT2 > &  b,
const vector< T3, REFCNT3 > &  c,
matrix< T4, REFCNT4 > &  t,
vector< T5, REFCNT5 > &  nonbasis 
)

Makes primal column table by given task in standard shape.

Additional variables will have been placed to the end of the list of main variables. basis will have been filled by numbers additional variables.

Definition at line 1699 of file simplex_method.hpp.

template<typename Ta, bool REFCNTa, typename Tb, bool REFCNTb, typename Tc, bool REFCNTc, typename Tx, bool REFCNTx, typename Tbasis, bool REFCNTbasis, typename Tres, typename Rule_s, typename Rule_r, typename Ctrler>
result_kind Arageli::simplex_method::primal_row_with_artificial_basis ( const matrix< Ta, REFCNTa > &  a,
const vector< Tb, REFCNTb > &  b,
const vector< Tc, REFCNTc > &  c,
vector< Tx, REFCNTx > &  basis_x,
vector< Tbasis, REFCNTbasis > &  basis,
Tres &  res,
Rule_s  rule_s,
Rule_r  rule_r,
Ctrler  ctrler 
)

Solves the linear programming problem with artificial basis method as zeroth step.

Definition at line 1747 of file simplex_method.hpp.

template<typename Ta, bool REFCNTa, typename Tb, bool REFCNTb, typename Tc, bool REFCNTc, typename Tx, bool REFCNTx, typename Tbasis, bool REFCNTbasis, typename Tres>
result_kind Arageli::simplex_method::primal_row_with_artificial_basis ( const matrix< Ta, REFCNTa > &  a,
const vector< Tb, REFCNTb > &  b,
const vector< Tc, REFCNTc > &  c,
vector< Tx, REFCNTx > &  basis_x,
vector< Tbasis, REFCNTbasis > &  basis,
Tres &  res 
) [inline]

Solves the linear programming problem with artificial basis method as zeroth step.

Just calls full vertion of the method with some default arguments.

Definition at line 1837 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::basis_to_nonbasis ( const vector< T1, REFCNT1 > &  basis,
vector< T2, REFCNT2 > &  nonbasis,
std::size_t  first_number,
std::size_t  n 
)

Makes nonbasis by basis.

Parameters:
first_number  number of first variable
n  number of variables

Definition at line 1865 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
void Arageli::simplex_method::basis_to_nonbasis ( const vector< T1, REFCNT1 > &  basis,
vector< T2, REFCNT2 > &  nonbasis,
std::size_t  n 
) [inline]

Makes nonbasis by basis.

Parameters:
n  number of variables

Definition at line 1894 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_basis, bool REFCNT_basis, typename T_T, bool REFCNT_T, typename T_nonbasis, bool REFCNT_nonbasis>
void Arageli::simplex_method::row_to_col_table ( const matrix< T_Q, REFCNT_Q > &  q,
const vector< T_basis, REFCNT_basis > &  basis,
matrix< T_T, REFCNT_T > &  t,
vector< T_nonbasis, REFCNT_nonbasis > &  nonbasis 
)

Converts a valid simplex table from a row form to a column form.

Definition at line 1910 of file simplex_method.hpp.

template<typename T_QT, bool REFCNT_QT, typename T_basis_nonbasis, bool REFCNT_basis_nonbasis>
void Arageli::simplex_method::row_to_col_table ( matrix< T_QT, REFCNT_QT > &  qt,
vector< T_basis_nonbasis, REFCNT_basis_nonbasis > &  basis_nonbasis 
)

Converts a valid simplex table from a row form to a column form.

Just calls full vertion of the method with some default arguments.

Definition at line 1965 of file simplex_method.hpp.

template<typename T_Q, bool REFCNT_Q, typename T_basis, bool REFCNT_basis, typename T_DQ, bool REFCNT_DQ, typename T_Dbasis, bool REFCNT_Dbasis>
void Arageli::simplex_method::primal_row_to_dual_row_table ( const matrix< T_Q, REFCNT_Q > &  q,
const vector< T_basis, REFCNT_basis > &  basis,
matrix< T_DQ, REFCNT_DQ > &  dq,
vector< T_Dbasis, REFCNT_Dbasis > &  dbasis 
)

Creates a dual row simplex table by primal row simplex table with selected basis.

WARNING! IMPLEMENTATION MAYBE INCORRECT! A new simplex table negates vector of a goal function, thus you should negate the value of goal function if you want to have correct result. During building a new task formulation, this function introduces a set of new variables to prepare the task in the canonical shape. Those variables will have been placed into the end of new table.

Definition at line 1995 of file simplex_method.hpp.

template<typename T, bool REFCNT, typename Prow>
result_kind Arageli::simplex_method::gomory1_clip ( matrix< T, REFCNT > &  t,
Prow &  prow 
)

Creates Gomory's clip on optimal column simplex table.

Definition at line 2043 of file simplex_method.hpp.

template<typename T, bool REFCNT>
result_kind Arageli::simplex_method::gomory1_clip ( matrix< T, REFCNT > &  t  ) 

Creates Gomory's clip on optimal column simplex table.

Just calls the full version of the function with some default arguments.

Definition at line 2070 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
result_kind Arageli::simplex_method::gomory1_iter ( matrix< T1, REFCNT1 > &  t,
vector< T2, REFCNT2 > &  nonbasis,
Ctrler  ctrler 
)

One iteration of The First Gomory's Algorithm on an optimal column simplex table.

Definition at line 2143 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2, typename Ctrler>
result_kind Arageli::simplex_method::gomory1_iters ( matrix< T1, REFCNT1 > &  t,
vector< T2, REFCNT2 > &  nonbasis,
Ctrler  ctrler 
)

Definition at line 2177 of file simplex_method.hpp.

template<typename T1, bool REFCNT1, typename T2, bool REFCNT2>
result_kind Arageli::simplex_method::gomory1_iters ( matrix< T1, REFCNT1 > &  t,
vector< T2, REFCNT2 > &  nonbasis 
) [inline]

Definition at line 2208 of file simplex_method.hpp.

template<typename T_a, bool REFCNT_a, typename T_b, bool REFCNT_b, typename T_c, bool REFCNT_c, typename T_da, bool REFCNT_da, typename T_db, bool REFCNT_db, typename T_dc, bool REFCNT_dc, typename T_basis, bool REFCNT_basis>
void Arageli::simplex_method::primal_to_dual_canonical ( const matrix< T_a, REFCNT_a > &  a,
const vector< T_b, REFCNT_b > &  b,
const vector< T_c, REFCNT_c > &  c,
matrix< T_da, REFCNT_da > &  da,
vector< T_db, REFCNT_db > &  db,
vector< T_dc, REFCNT_dc > &  dc,
vector< T_basis, REFCNT_basis > &  basis 
)

Makes the dual task in canonical shape by primal task.

Introcudes two additional set of variables: to limitation by sign, and to transforming from >= to =.

Definition at line 2233 of file simplex_method.hpp.

template<typename T_a, bool REFCNT_a, typename T_b, bool REFCNT_b, typename T_c, bool REFCNT_c, typename T_basis, bool REFCNT_basis, typename T_da, bool REFCNT_da, typename T_db, bool REFCNT_db, typename T_dc, bool REFCNT_dc, typename T_res, typename T_ab, bool REFCNT_ab, typename T_cb, bool REFCNT_cb>
void Arageli::simplex_method::primal_to_dual_standard_discr ( const matrix< T_a, REFCNT_a > &  a,
const vector< T_b, REFCNT_b > &  b,
const vector< T_c, REFCNT_c > &  c,
const vector< T_basis, REFCNT_basis >  basis,
matrix< T_da, REFCNT_da > &  da,
vector< T_db, REFCNT_db > &  db,
vector< T_dc, REFCNT_dc > &  dc,
T_res &  res_offset,
matrix< T_ab, REFCNT_ab > &  bsuba,
vector< T_cb, REFCNT_cb > &  bsubc 
)

Makes the dual task in standard shape by primal task via introducing discrepancy variables.

The final dual task is formulated in the discrepancy variables set y = u*bsuba + bsubc, where bsuba is basis submatrix in a, bsubc is subvector of c that corresponds to bsuba. Native dual variables are found by u = (y+bsubc)*bsuba^(-1). Note the result task is formulated as "-max" task, so you should negate the result function value for THIS task to produce the result of original dual task. You must add value of res_offset to "-max" task result function value.

Parameters:
bsuba  basis submatrix for a
bsubc  basis subvector for c

Definition at line 2292 of file simplex_method.hpp.

template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_ostream<Ch, ChT>& Arageli::simplex_method::output_list ( std::basic_ostream< Ch, ChT > &  out,
const linear_prog_task< T, REFCNT > &  lpt 
)

Definition at line 2452 of file simplex_method.hpp.

template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_istream<Ch, ChT>& Arageli::simplex_method::input_list ( std::basic_istream< Ch, ChT > &  in,
linear_prog_task< T, REFCNT > &  lpt 
)

Definition at line 2474 of file simplex_method.hpp.

template<typename T, bool REFCNT, typename Ch, typename ChT>
std::basic_ostream<Ch, ChT>& Arageli::simplex_method::output_aligned ( std::basic_ostream< Ch, ChT > &  out,
const linear_prog_task< T, REFCNT > &  lpt,
const char *  var = "x" 
)

Definition at line 2562 of file simplex_method.hpp.


Generated on Thu Aug 31 17:38:46 2006 for Arageli by  doxygen 1.4.7