Esempio n. 1
0
        /// <summary>
        /// Returns true if each of the actual dimension symbols satisfies the
        /// corresponding required dimension symbol.
        /// </summary>
        /// <param name="actualDimensionSymbols">
        /// Nine dimension symbols to validate. Possible values
        /// are {T, F, * , 0, 1, 2}.
        /// </param>
        /// <param name="requiredDimensionSymbols">
        /// Nine dimension symbols to validate against. Possible values
        /// are {T, F, * , 0, 1, 2}.
        /// </param>
        /// <returns>
        /// true if each of the required dimension symbols encompass the
        /// corresponding actual dimension symbol.
        /// </returns>
        public static bool Matches(string actualDimensionSymbols,
                                   string requiredDimensionSymbols)
        {
            IntersectionMatrix m = new IntersectionMatrix(actualDimensionSymbols);

            return(m.Matches(requiredDimensionSymbols));
        }
Esempio n. 2
0
        /// <summary>
        /// Adds one matrix to another.
        /// </summary>
        /// <param name="input">the matrix to Add
        /// </param>
        /// <remarks>
        /// Addition is defined by taking the maximum dimension value of
        /// each position in the summand matrices.
        /// </remarks>
        public void Add(IntersectionMatrix input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    SetAtLeast(i, j, input.GetValue(i, j));
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Creates an IntersectionMatrix with the same elements as
 /// other.
 /// </summary>
 /// <param name="other">
 /// An IntersectionMatrix to copy.
 /// </param>
 public IntersectionMatrix(IntersectionMatrix other) : this()
 {
     matrix[LocationType.Interior][LocationType.Interior] =
         other.matrix[LocationType.Interior][LocationType.Interior];
     matrix[LocationType.Interior][LocationType.Boundary] =
         other.matrix[LocationType.Interior][LocationType.Boundary];
     matrix[LocationType.Interior][LocationType.Exterior] =
         other.matrix[LocationType.Interior][LocationType.Exterior];
     matrix[LocationType.Boundary][LocationType.Interior] =
         other.matrix[LocationType.Boundary][LocationType.Interior];
     matrix[LocationType.Boundary][LocationType.Boundary] =
         other.matrix[LocationType.Boundary][LocationType.Boundary];
     matrix[LocationType.Boundary][LocationType.Exterior] =
         other.matrix[LocationType.Boundary][LocationType.Exterior];
     matrix[LocationType.Exterior][LocationType.Interior] =
         other.matrix[LocationType.Exterior][LocationType.Interior];
     matrix[LocationType.Exterior][LocationType.Boundary] =
         other.matrix[LocationType.Exterior][LocationType.Boundary];
     matrix[LocationType.Exterior][LocationType.Exterior] =
         other.matrix[LocationType.Exterior][LocationType.Exterior];
 }