private void rankButton2_Click(object sender, EventArgs e) { TakeBoxes(_right.Matrix, _rightBoxes); IFindRank algorithm = rankBox2.SelectedIndex switch { 0 => new NativeFindRank(), 1 => new LibraryFindRank(), _ => null }; rankLabel.Text = _right.Rank(algorithm).ToString(); if (_right is TimeDecorator timeDecorator) { timeLabel.Text = timeDecorator.Time + " ms"; } }
/// <summary> /// Calls Rank method of MatrixFacade instance. /// </summary> /// <param name="rank">Passed algorithm for rank find.</param> /// <returns>Matrix rank</returns> public virtual int Rank(IFindRank rank) { return(_facade.Rank(rank)); }