public static double[] OpponentPointsPerGameByGame(this BasketballTeam t) { double[] ofgp = new double[t.Matchups.Count]; for (int i = 0; i < t.Matchups.Count; i++) { BasketballTeam opp = t.Teams[t.Matchups[i].Opponent]; if (opp != null) { ofgp[i] = opp.PointsPerGame(); } } return(ofgp); }
public static double[] OffensivePpgRatio(this BasketballTeam t) { double[] d = t.PointsPerGameByGame(); double ppg = t.PointsPerGame(); for (int k = 0; k < t.Matchups.Count; k++) { BasketballTeam opp = t.Teams[t.Matchups[k].Opponent]; if (opp != null) { d[k] /= (opp.DefensivePpgRatioAverage() * ppg); } } return(d); }
public static double[] DefensivePpgRatio(this BasketballTeam t) { double[] data = new double[t.Matchups.Count]; for (int k = 0; k < data.Length; k++) { BasketballTeam opp = t.Teams[t.Matchups[k].Opponent]; if (opp == null) { data[k] = 1.0; } else { data[k] = t.Matchups[k].OppScore / opp.PointsPerGame(); } } return(data); }