public void SetValues( StateSpecificFireballFieldFunction function ) { AssertValidFunction(function); DoSetValues(function); }
public StateSpecificFireballField( FireballFieldType type, CoordinateSystem system, IList <double> transverseMomenta, StateSpecificFireballFieldFunction function ) : this(type, system, transverseMomenta) { SetValues(function); }
private void AssertValidFunction( StateSpecificFireballFieldFunction function ) { if (function == null) { throw new InvalidFireballFieldFunctionException(); } }
private void DoSetValues( StateSpecificFireballFieldFunction function ) { for (int pT = 0; pT < PTDimension; pT++) { for (int state = 0; state < NumberBottomiumStates; state++) { for (int x = 0; x < XDimension; x++) { for (int y = 0; y < YDimension; y++) { Values[pT, state][x, y] = function(x, y, pT, state); } } } } }
private void AssertThrowsWhenGivenParams( Type exceptionType, FireballFieldType fireballFieldType, IList <double> transverseMomenta, StateSpecificFireballFieldFunction function ) { bool threwException = false; try { new StateSpecificFireballField( fireballFieldType, CoordinateSystem, transverseMomenta, function); } catch (Exception ex) { Assert.IsInstanceOfType(ex, exceptionType); threwException = true; } Assert.IsTrue(threwException, "No Exception was thrown, expected: " + exceptionType.ToString() + "."); }