Hello,
Does anyone know how to write a function to sum the diagonals of a matrix in
glpk? It is simple to sum the rows or columns* but I cannot figure out how
to write it for diagonals.

*sum{i in xxx} y[i,j]

For anyone interested, this code needs to provide the solution for the
maximum number of bishops on a chess board without any bishop being under
attach. The matrix will consist of 0's for empty spaces on the board and 1's
where a space is occupied by a bishop. So the sum of both diagonals in which
a bishop lies must be 1. Any advice would be much appreciated.

Thanks,

Bill
-- 
View this message in context: 
http://www.nabble.com/Chess-Problem-tp22997210p22997210.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.






_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to