Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DiscreteLogDomain" /> class.
        /// </summary>
        /// <param name="minimum">The minimum value.</param>
        /// <param name="maximum">The maximum value.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown if minimum value is not positive.</exception>
        public DiscreteLogDomain(int minimum, int maximum)
            : base(minimum, maximum)
        {
            if (minimum <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          $"Logarithmically spaced integer domain must be positive, but minimum is {minimum}.");
            }

            this._logSpace = new ContinuousDomain(Math.Log(minimum), Math.Log(maximum));
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LogDomain" /> class.
        /// </summary>
        /// <param name="minimum">The minimum value.</param>
        /// <param name="maximum">The maximum value.</param>
        /// <param name="defaultValue">The optional default value.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown if minimum value is not positive.</exception>
        public LogDomain(double minimum, double maximum, Allele <double>?defaultValue = null)
            : base(minimum, maximum, defaultValue)
        {
            if (minimum <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          $"Logarithmically spaced domain must be positive, but minimum is {minimum}.");
            }

            this._logSpace = new ContinuousDomain(Math.Log(minimum), Math.Log(maximum));
        }