Created
December 10, 2016 02:26
-
-
Save TexAgg/6ec021bda8594f6752c350248d91e794 to your computer and use it in GitHub Desktop.
A package for doing handy calculations with game-theory-style matrix games.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* ::Package:: *) | |
(* A package for doing handy calculations with game-theory-style matrix games. *) | |
BeginPackage["MatrixGame`"] | |
getSaddlePoints::usage = "Get the saddle points of a matrix game m" | |
Begin["`Private`"] | |
isRowMin[i_, j_, m_] := m[[i,j]]==Min[m[[i]]] | |
isColMax[i_,j_,m_]:=m[[i,j]]==Max[m[[All,j]]] | |
getSaddlePoints[m_] := Select[Range/@Dimensions[m]//Tuples, isRowMin[#[[1]],#[[2]],m]&&isColMax[#[[1]],#[[2]],m]&] | |
End[] | |
EndPackage[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment