예제 #1
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns><c>true</c> if the current object is equal to the <paramref name="other" />
        /// parameter; otherwise, <c>false</c>.</returns>
        /// <remarks>
        /// <inheritdoc cref="ComplexMatrixRow"
        /// path="para[@id='quasi.lexicographic.equality']"/>
        /// </remarks>
        public bool Equals(ComplexMatrixRow other)
        {
            if (other is null)
            {
                return(false);
            }

            int thisLength       = this.Length;
            int lengthDifference = other.Length - thisLength;

            if (lengthDifference != 0)
            {
                return(false);
            }

            // Here if and only if lengthDifference == 0

            bool    result = true;
            Complex thisValue, otherValue;

            for (int j = 0; j < thisLength; j++)
            {
                thisValue  = this[j];
                otherValue = other[j];
                if (!thisValue.Equals(otherValue))
                {
                    result = false;
                    break;
                }
            }

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Converts from <see cref="ComplexMatrixRow"/> to <see cref="ComplexMatrix"/>.
        /// </summary>
        /// <param name="value">The object to convert.</param>
        /// <returns>The converted object.</returns>
        public static ComplexMatrix ToComplexMatrix(ComplexMatrixRow value)
        {
            if (value is null)
            {
                return(null);
            }

            return(value.collection.matrix[value.rowIndex, ":"]);
        }
 public ComplexMatrixRowEnumerator(ComplexMatrixRow matrixRow)
 {
     this.matrixRow = matrixRow;
 }