/// <summary>
        /// Initializes a new instance of the <see cref="FractionNumericMatrixFactor" /> class.
        /// </summary>
        /// <param name="group">if set to <see langword="true" /> [group].</param>
        /// <param name="groupingStyle">The grouping style.</param>
        /// <param name="items">The items.</param>
        /// <param name="editableCells">if set to <see langword="true" /> [editable cells].</param>
        /// <param name="exponent">The exponent.</param>
        /// <param name="sequence">The sequence.</param>
        /// <param name="editable">if set to <see langword="true" /> [editable].</param>
        public FractionNumericMatrixFactor(bool group, BarStyles groupingStyle, double[,] items, bool editableCells = false, IExpression?exponent = null, INumeric?sequence = null, bool editable = false)
        {
            Parent  = null;
            NumRows = items.GetLength(0);
            NumCols = items.GetLength(1);
            //UniformRowSize = true;
            //UniformColSize = true;
            Group         = group;
            GroupingStyle = groupingStyle;

            Items = new FractionFactor[NumRows, NumCols];
            for (var row = 0; row < NumRows; row++)
            {
                for (var col = 0; col < NumCols; col++)
                {
                    Items[row, col] = new FractionFactor(items[row, col]);
                    if (Items[row, col] is IExpression c)
                    {
                        c.Parent   = this;
                        c.Editable = editableCells;
                    }
                }
            }

            Editable = editable;
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FractionFactor"/> class.
 /// </summary>
 /// <param name="factor">The factor.</param>
 /// <param name="exponent">The exponent.</param>
 /// <param name="sequence">The sequence.</param>
 /// <param name="editable">The editable.</param>
 public FractionFactor(FractionFactor factor, IExpression?exponent = null, INumeric?sequence = null, bool?editable = null)
     : this(factor.Numerator, factor.Denominator, exponent ?? factor.Exponent, sequence ?? factor.Sequence, editable ?? factor.Editable)
 {
 }