'Formats the block for block_add.
Args:
matrix: The matrix the block will be added to.
block: The matrix/scalar to be added.
rows: The height of the block.
cols: The width of the block.'

def _format_block(self, matrix, block, rows, cols):

    if cvxpy.interface.matrix_utilities.is_scalar(block):
        block = self.scalar_matrix(cvxpy.interface.matrix_utilities.scalar_value(block), rows, cols)
    elif (cvxpy.interface.matrix_utilities.is_vector(block) and (cols > 1)):
        block = self.reshape(block, (rows, cols))
    elif ((not cvxpy.interface.matrix_utilities.is_vector(block)) and (cols == 1)):
        block = self.reshape(block, (rows, cols))
    elif (type(block) != type(matrix)):
        block = self.const_to_matrix(block)
    return block
