/// Checks whether all entries from the main diagonal of `$matrix`
/// are set while all other entries are equal to 0
/// @group checkers
/// @param {Matrix} $matrix - matrix
/// @return {Bool}
/// @require {function} get-entry
/// @require {function} columns
/// @require {function} rows
@function is-diagonal($matrix) {
  @for $i from 1 through rows($matrix) {
    @for $j from 1 through columns($matrix) {
      $entry: get-entry($matrix, ($i $j));
      @if ($i != $j and $entry != 0) or ($i == $j and $entry == 0) {
        @return false;
      }
    }
  }

  @return true;
}
