6 Replaced rot90 with flip to save a byte, but found a bug.

# Octave, 5770675151 52 bytes

Saved 1 byte using flip instead of rot90 thanks to @LuisMendo, but found a bug on the 1x1 case

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90flip(A))],1)==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degreesflipped horizontally to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideoneideone.

# Octave, 57706751 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideone.

# Octave, 57706751 52 bytes

Saved 1 byte using flip instead of rot90 thanks to @LuisMendo, but found a bug on the 1x1 case

@(A)all(sum([A A' (d=@spdiags)(A) d(flip(A))],1)==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the matrix flipped horizontally to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideone.

5 Edited explanation.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideone.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column and each is exactly 1.

Sample run on ideone.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column of the concatenated matrix and make sure each column is exactly 1.

Sample run on ideone.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column and each is exactly 1.

Sample run on ideone.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Sample run on ideone.

# Octave, 577067 51 bytes

@(A)all(sum([A A' (d=@spdiags)(A) d(rot90(A))])==1)


Takes input as a binary matrix with 1 representing a Queen and 0 representing an empty space.

Creates an anonymous function that first concatenates the input matrix and its transpose.

spdiags creates a matrix with the same number of rows as the argument, with the diagonals turned into columns (zero-padded as necessary), so concatenate spdiags of the input matrix to get the diagonals and spdiags of the input matrix rotated by 90 degrees to get the antidiagonals.

Now take the sum of each column and each is exactly 1.

Sample run on ideone.

3 Build matrix before sum.
Post Undeleted by beaker
2 Corrected code for antidiagonal.
Post Deleted by beaker
Post Undeleted by beaker
Post Deleted by beaker
1