Validate that the matrix has equal number of rows and columns.
182534
def validate_square(data, message=None, exception=MatrixError):
    """"""
    rows, columns = len(data), len(data[0]) if data else 0
    if message is None:
        message = 'Number of rows: %s != number of columns: %s in matrix' % (
            rows, columns)
    if rows != columns:
        raise exception(message)
739351
def _validate_columns(self):
        """"""
        geom_cols = {'the_geom', 'the_geom_webmercator', }
        col_overlap = set(self.style_cols) & geom_cols
        if col_overlap:
            raise ValueError('Style columns cannot be geometry '
                             'columns. `{col}` was chosen.'.format(
                                 col=','.join(col_overlap)))
1276314
def validate_row(vb_list, start_list, index_column)
      start_vb = start_list[index_column]
      index_vb = vb_list[index_column]
      row_index = index_vb.name.index(start_vb.name)
      vb_list.each_index do |i|
        if i != index_column
          expected_oid = start_list[i].name + row_index
          if vb_list[i].name != expected_oid
            vb_list[i] = VarBind.new(expected_oid, NoSuchInstance).with_mib(@mib)
          end
        end
      end
      vb_list
    end
595034
function(matrix) {
            	var M = matrix.elements || matrix;
            	if (typeof(M[0][0]) == 'undefined') { M = Matrix$b.create(M).elements; }
            	// this.columns should equal matrix.rows
            	return (this.elements[0].length == M.length);
                }
1193781
public void validate(byte[] buffer, int rowOffset, int rowHead, int blobTail)
  {
    for (Column column : columns()) {
      column.validate(buffer, rowOffset, rowHead, blobTail);
    }
  }
1341133
def _validate_input(self, table: pd.DataFrame, failed_only=False) -> pd.DataFrame:
        """"""
        return self._do_validation_set(
            table=table,
            columns=self.input_columns,
            validation_type="input",
            failed_only=failed_only,)
311771
def _check_align(self):
        

        if not hasattr(self, "_align"):
            self._align = ["l"]*self._row_size
        if not hasattr(self, "_valign"):
            self._valign = ["t"]*self._row_size
347553
function makeMatrix(columns, rows) {
  let matrix = [];
  for (let i = 0; i < columns; i++) {
    let column = [];
    for (let j = 0; j < rows; j++) {
      column.push(0);
    }
    matrix.push(column);
  }
  return matrix;
}
717460
public static void removeEqualRows(DenseMatrix64F matrix)
    {
        int rows = matrix.numRows;
        if (rows < 2)
        {
            return;
        }
        double[] d = matrix.data;
        int cols = matrix.numCols;
        int left = rows-1;
        int delta = 0;
        for (int i=0;i<left;i++)
        {
            int j=i;
            for (;j<left && eq(d, i, j+1, cols);j++);
            if (i != j)
            {
                int cnt = j-i;
                System.arraycopy(d, cols*j, d, cols*i, cols*(left-j+1));
                left -= cnt;
                delta += cnt;
            }
        }
        if (eq(d, 0, rows-1, cols))
        {
            delta++;
        }
        if (delta > 0)
        {
            matrix.reshape(rows-delta, cols, true);
        }
    }
354942
def __quick_validate(r, check=('ResultSet', 'Result', 'totalRecords')):
    '''
    
    '''
    if 'ResultSet' in check and 'ResultSet' not in r:
        raise ResultSetError('no ResultSet in server response')
    if 'Result' in check and 'Result' not in r['ResultSet']:
        raise ResultSetError('no Result in server response')
    if 'totalRecords' in check and 'totalRecords' not in r['ResultSet']:
        raise ResultSetError('no totalRecords in server response')
    return True
543320
def validate_multiindex(self, obj):
        
        levels = [l if l is not None else "level_{0}".format(i)
                  for i, l in enumerate(obj.index.names)]
        try:
            return obj.reset_index(), levels
        except ValueError:
            raise ValueError("duplicate names/columns in the multi-index when "
                             "storing as a table")
615456
function(matrix) {
    var M = matrix.elements || matrix;
    if (typeof(M[0][0]) == 'undefined') { M = Matrix.create(M).elements; }
    // this.columns should equal matrix.rows
    return (this.elements[0].length == M.length);
  }
322147
def vcat(y)
      unless self.dims[1] == y.dims[1]
        raise ArgumentError, "Matrices must have same number of columns"
      end
      DoubleMatrix.concat_vertically(self, y)
    end
213455
def check_matrix(m):
    """"""
    if m.shape != (4, 4):
        raise ValueError("The argument must be a 4x4 array.")
    if max(abs(m[3, 0:3])) > eps:
        raise ValueError("The given matrix does not have correct translational part")
    if abs(m[3, 3] - 1.0) > eps:
        raise ValueError("The lower right element of the given matrix must be 1.0.")
206160
private void checkColumnSize(Column<?> newColumn) {
        if (columnCount() != 0) {
            Preconditions.checkArgument(newColumn.size() == rowCount(),
                    "Column " + newColumn.name() +
                            " does not have the same number of rows as the other columns in the table.");
        }
    }
70795
function _validateTable() {
        if (!empty($this->_headers)) {
            $this->_calculateRowHeight(-1, $this->_headers[0]);
        }

        for ($i = 0; $i < $this->_max_rows; $i++) {
            for ($j = 0; $j < $this->_max_cols; $j++) {
                if (!isset($this->_data[$i][$j]) &&
                    (!isset($this->_data[$i]) ||
                        $this->_data[$i] !== self::CONSOLE_TABLE_HORIZONTAL_RULE)
                ) {
                    $this->_data[$i][$j] = '';
                }

            }
            $this->_calculateRowHeight($i, $this->_data[$i]);

            if ($this->_data[$i] !== self::CONSOLE_TABLE_HORIZONTAL_RULE) {
                ksort($this->_data[$i]);
            }

        }

        $this->_splitMultilineRows();

        // Update cell lengths.
        for ($i = 0; $i < count($this->_headers); $i++) {
            $this->_calculateCellLengths($this->_headers[$i]);
        }
        for ($i = 0; $i < $this->_max_rows; $i++) {
            $this->_calculateCellLengths($this->_data[$i]);
        }

        ksort($this->_data);
    }
356340
def validate(self):
        
        if self.left_hand_side.rows != self.right_hand_side.rows:
            raise ValueError("There are {0} left hand side equations and {1} right hand side equations. "
                             "The same number is expected.".format(self.left_hand_side.rows, self.right_hand_side.rows))