Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16280


Ignore:
Timestamp:
11/07/18 13:58:04 (6 years ago)
Author:
abeham
Message:

#2960: added query methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Data/3.3/StringMatrix.cs

    r15583 r16280  
    209209    }
    210210
     211    public string[,] CloneAsMatrix() {
     212      return (string[,])matrix.Clone();
     213    }
     214
     215    public virtual IEnumerable<string> GetRow(int row) {
     216      for (var col = 0; col < Columns; col++) {
     217        yield return matrix[row, col];
     218      }
     219    }
     220
     221    public virtual IEnumerable<string> GetColumn(int col) {
     222      for (var row = 0; row < Rows; row++) {
     223        yield return matrix[row, col];
     224      }
     225    }
     226
    211227    public override string ToString() {
    212228      if (matrix.Length == 0) return "[]";
Note: See TracChangeset for help on using the changeset viewer.