[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Visualize Matrix A (in Ax = b)
From: |
Vijay Patil |
Subject: |
[Help-glpk] Visualize Matrix A (in Ax = b) |
Date: |
Mon, 11 Aug 2008 23:23:58 +0530 |
Few days back, there was a discussion on the mailing list about sparse and dense constraint coefficient matrices. I thought it would be nice to be able to visualize matrix A and "see" how much sparse it is. This might help verify, understand and debug LP/MIP models created using MathProg.
Attached is source code of a simple C program written using GLPK API and OpenGL.
= Input: The program takes MathProg file as input.
= Output: Visualization of matrix A. Nonzero matrix coefficients are colored (BLUE or RED). Coefficient with zero value are BLACK.
Last row show is obj. fun. coefficients. LBs and UBs are NOT shown.
Note: Program is version 0.1, might contain bugs, might fail for large models.
Also attached are some screen shots for input files assign.mod and queens.mod. For more details see README file in the tarball.
Comments/ideas are welcome. There might be easier way of visualizing the matrix (Postscript?, MathLab?). Also is this really useful?
----------
$ ./matrix
Usage: matrix filename
Where filename is MathProg model file name.
Color of the cell depends on the its value.
BLUE = Positive value.
RED = Negative value.
BLACK = Zero.
--
Vijay Patil
matrix-0.1.tar.gz
Description: GNU Zip compressed data
assign.mod.png
Description: PNG image
queens.mod.png
Description: PNG image
- [Help-glpk] Visualize Matrix A (in Ax = b),
Vijay Patil <=