コード例 #1
0
 public void SetValues(
     StateSpecificFireballFieldFunction function
     )
 {
     AssertValidFunction(function);
     DoSetValues(function);
 }
コード例 #2
0
 public StateSpecificFireballField(
     FireballFieldType type,
     CoordinateSystem system,
     IList <double> transverseMomenta,
     StateSpecificFireballFieldFunction function
     ) : this(type, system, transverseMomenta)
 {
     SetValues(function);
 }
コード例 #3
0
 private void AssertValidFunction(
     StateSpecificFireballFieldFunction function
     )
 {
     if (function == null)
     {
         throw new InvalidFireballFieldFunctionException();
     }
 }
コード例 #4
0
 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);
                 }
             }
         }
     }
 }
コード例 #5
0
        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() + ".");
        }