help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Small inconsistency


From: Andrew Makhorin
Subject: Re: [Help-glpk] Small inconsistency
Date: Thu, 26 Apr 2007 03:40:00 +0400

> I noticed a small inconsistency with working with lpx_set_mat_row().
> If you inserted a couple of columns the output of the columns 
> lpx_write_cpxlp() are reversed. Clearly this is not bug, but sometimes
> it confuses me. Should also be valid in combination of lpx_add_row()
> and lpx_set_mat_col(). Can you check?

The order of column indices reported by lpx_get_mat_row is
unpredictable, i.e. the indices may follow in arbitrary order,
not necessarily in the same order they were specified on a call to
lpx_set_mat_row. (This is normal in sparse matrix computations.)
Lpx_write_cpxlp writes columns as they reported by lpx_get_mat_row,
so the column ordering may be altered.

In principle, you can call the routine lpx_order_matrix(lp) before
a call to lpx_write_cpxlp. It rearranges the row and column lists, in
which case column indices reported by lpx_get_mat_row will follow in
ascending order.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]