Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MatrixType"/> class.
 /// </summary>
 /// <param name="type">
 /// The type.
 /// </param>
 /// <param name="rowCount">
 /// The row count.
 /// </param>
 /// <param name="columnCount">
 /// The column count.
 /// </param>
 public MatrixType(ScalarType type, int rowCount, int columnCount)
     : this()
 {
     Type        = type;
     RowCount    = rowCount;
     ColumnCount = columnCount;
 }
Esempio n. 2
0
        /// <summary>
        /// Equalses the specified other.
        /// </summary>
        /// <param name="other">
        /// The other.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="ScalarType"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(ScalarType other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(base.Equals(other) && Equals(other.Type, Type));
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a type based on a new base type. If type is a matrix or vector, then the base type is changed to match the newBaseType.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="newBaseType">New type of the base.</param>
        /// <returns>A new type</returns>
        public static TypeBase CreateWithBaseType(TypeBase type, ScalarType newBaseType)
        {
            if (type is MatrixType)
            {
                return(new MatrixType(newBaseType, ((MatrixType)type).RowCount, ((MatrixType)type).ColumnCount));
            }

            if (type is VectorType)
            {
                return(new VectorType(newBaseType, ((VectorType)type).Dimension));
            }

            return(newBaseType);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="VectorType"/> class.
 /// </summary>
 /// <param name="type">
 /// The type.
 /// </param>
 /// <param name="dimension">
 /// The dimension.
 /// </param>
 public VectorType(ScalarType type, int dimension)
     : this()
 {
     Type      = type;
     Dimension = dimension;
 }