 
 // MARK: Matrix Addition
 
+/**
+    Returns the sum of the two matrices.
+
+    :param: left    The left matrix in the sum.
+    :param: right   The right matrix in the sum.
+
+    :returns: A matrix of the same dimensions as the two
+                given matrices.
+
+    :exception: Throws an exception when the dimensions of the two matrices are not equal.
+*/
 func + <T: MatrixCompatible> (left: Matrix<T>, right: Matrix<T>) -> Matrix<T> {
     
     if left.dimensions != right.dimensions {

    return mcombine(left, right){ $0 + $1 }
}

func + (left: Matrix<Float>, right: Matrix<Float>) -> Matrix<Float> {
    
    if left.dimensions != right.dimensions {


// MARK: - MatrixGenerator

/**
    A struct representing a generator for iterating over a matrix.
*/
struct MatrixGenerator <T: MatrixCompatible> : GeneratorType {
    
    /**
        The generator of the elements list of the matrix.
    */
    private var generator: IndexingGenerator<Array<T>>
    
    /**
        Creates a new matrix generator to iterator over the given matrix.
    
        :param: The matrix to iterate over.
    */
    init(matrix: Matrix<T>) {
        
        self.generator = matrix.elementsList.generate()
    }
    
    /**
        Returns the next element in the matrix or nil if there are no elements left.
    */
    mutating func next() -> T? {
        return self.generator.next()
    }
