Exemplo n.º 1
0
        private void multiplyButton_Click(object sender, EventArgs e)
        {
            TakeBoxes(_left.Matrix, _leftBoxes);
            TakeBoxes(_right.Matrix, _rightBoxes);
            IMultiply algorithm = mulBox1.SelectedIndex switch
            {
                0 => new NativeMultiply(),
                1 => new LibraryMultiply(),
                _ => null
            };

            _result = _left.Multiply(_right.Matrix, algorithm);
            RefreshResultBoxes();
            if (_left is TimeDecorator timeDecorator)
            {
                timeLabel.Text = timeDecorator.Time + " ms";
            }
        }
 /// <summary>
 /// Calls Multiply method of MatrixFacade instance.
 /// </summary>
 /// <param name="other">Other matrix to be multiplied to this.</param>
 /// <param name="mul">Passed algorithm for matrix multiply.</param>
 /// <returns>New matrix that equals to substraction of this and other matrixes.</returns>
 public virtual Matrix Multiply(Matrix other, IMultiply mul)
 {
     return(_facade.Multiply(other, mul));
 }