[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Chess Problem
From: |
BillGrieves |
Subject: |
[Help-glpk] Chess Problem |
Date: |
Sat, 11 Apr 2009 06:52:01 +0300 |
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] Chess Problem,
BillGrieves <=