private void squareButton2_Click(object sender, EventArgs e) { TakeBoxes(_right.Matrix, _rightBoxes); IMultiply algorithm = squareBox2.SelectedIndex switch { 0 => new NativeMultiply(), 1 => new LibraryMultiply(), _ => null }; _right.Square(algorithm); RefreshBoxes(_right.Matrix, _rightBoxes); if (_right is TimeDecorator timeDecorator) { timeLabel.Text = timeDecorator.Time + " ms"; } }
/// <summary> /// Calls Square method of MatrixFacade instance. /// </summary> /// <param name="mul">Passed algorithm for matrix multiply.</param> public virtual void Square(IMultiply mul) { _facade.Square(mul); }