Ejemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="RealDegreeOnePolynomial"/> class.
        /// </summary>
        /// <param name="absoluteCoefficient">The absolute coefficient.</param>
        /// <param name="firstOrderCoefficient">The first order coefficient.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown, if one of the parameter is not a valid real number.</exception>
        /// <exception cref="ArgumentException">Thrown, if <paramref name="firstOrderCoefficient"/> is <c>0.0</c>.</exception>
        internal RealDegreeOnePolynomial(double absoluteCoefficient, double firstOrderCoefficient)
        {
            RealPolynomial.CheckCoefficient(absoluteCoefficient, nameof(absoluteCoefficient), "Absolute coefficient");
            m_AbsoluteCoefficient = absoluteCoefficient;

            RealPolynomial.CheckCoefficient(firstOrderCoefficient, nameof(firstOrderCoefficient), "First order coefficient");
            if (firstOrderCoefficient == 0.0)
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentIsInvalid, "0.0"), nameof(firstOrderCoefficient));
            }
            m_FirstOrderCoefficient = firstOrderCoefficient;
        }
        /// <summary>Initializes a new instance of the <see cref="RealDegreeFourPolynomial"/> class.
        /// </summary>
        /// <param name="absoluteCoefficient">The absolute coefficient.</param>
        /// <param name="firstOrderCoefficient">The first order coefficient.</param>
        /// <param name="secondOrderCoefficient">The second order coefficient.</param>
        /// <param name="thirdOrderCoefficient">The third order coefficient.</param>
        /// <param name="fourthOrderCoefficient">The fourth order coefficient.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown, if one of the parameter is not a valid real number.</exception>
        /// <exception cref="ArgumentException">Thrown, if <paramref name="fourthOrderCoefficient"/> is <c>0.0</c>.</exception>
        internal RealDegreeFourPolynomial(double absoluteCoefficient, double firstOrderCoefficient, double secondOrderCoefficient, double thirdOrderCoefficient, double fourthOrderCoefficient)
        {
            RealPolynomial.CheckCoefficient(absoluteCoefficient, nameof(absoluteCoefficient), "Absolute coefficient");
            m_AbsoluteCoefficient = absoluteCoefficient;

            RealPolynomial.CheckCoefficient(firstOrderCoefficient, nameof(firstOrderCoefficient), "1st order coefficient");
            m_FirstOrderCoefficient = firstOrderCoefficient;

            RealPolynomial.CheckCoefficient(secondOrderCoefficient, nameof(secondOrderCoefficient), "2. order coefficient");
            m_SecondOrderCoefficient = secondOrderCoefficient;

            RealPolynomial.CheckCoefficient(thirdOrderCoefficient, nameof(thirdOrderCoefficient), "3. order coefficient");
            m_ThirdOrderCoefficient = thirdOrderCoefficient;

            RealPolynomial.CheckCoefficient(fourthOrderCoefficient, nameof(fourthOrderCoefficient), "4. order coefficient");
            if (fourthOrderCoefficient == 0.0)
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, ExceptionMessages.ArgumentIsInvalid, "0.0"), nameof(fourthOrderCoefficient));
            }
            m_FourthOrderCoefficient = fourthOrderCoefficient;
        }
Ejemplo n.º 3
0
 /// <summary>Initializes a new instance of the <see cref="RealDegreeNullPolynomial"/> class.
 /// </summary>
 /// <param name="absoluteCoefficient">The absolute coefficient.</param>
 /// <exception cref="ArgumentOutOfRangeException">Thrown, if <paramref name="absoluteCoefficient"/> is not a valid real number.</exception>
 internal RealDegreeNullPolynomial(double absoluteCoefficient)
 {
     RealPolynomial.CheckCoefficient(absoluteCoefficient, nameof(absoluteCoefficient), "Absolute coefficient");
     m_AbsoluteCoefficient = absoluteCoefficient;
 }