예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NumericMatrixFactor" /> 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 NumericMatrixFactor(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 NumericFactor[NumRows, NumCols];
            for (var row = 0; row < NumRows; row++)
            {
                for (var col = 0; col < NumCols; col++)
                {
                    Items[row, col] = new NumericFactor(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="NumericFactor"/> 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 NumericFactor(NumericFactor factor, IExpression?exponent = null, INumeric?sequence = null, bool?editable = null)
     : this(factor.Value, exponent ?? factor.Exponent, sequence ?? factor.Sequence, editable ?? factor.Editable)
 {
 }