/**
 *
 * Copyright (c) 2016-2016, Emil Forslund. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.github.pyknic.vector.mat;

/**
 * Universal super-interface for all matrices, regardless of dimension and
 * backing implementation.
 * 
 * @param <M>  the main interface for this kind of matrix
 * 
 * @author Emil Forslund
 * @since  1.1.0
 */
public interface Mat<M extends Mat<? super M>> {

    /**
     * Returns a matrix that is an exact copy of the specified matrix. Depending
     * on the implementation of this interface, that might be either this
     * instance (if this is mutable) or a completely new matrix. The given
     * matrix will not be modified.
     * 
     * @param matrix  the matrix to copy
     * @return        the copy, either this instance or a new matrix
     */
    M set(M matrix);
    
    /**
     * Performs an element-wise addition between every element in this matrix
     * and every element in the specified matrix. The sum matrix returned might 
     * be either this instance (if this is mutable) or a completely new matrix.
     * The given matrix will not be modified.
     * 
     * @param matrix  the matrix to add with
     * @return        the sum, either this instance or a new matrix
     */
    M plus(M matrix);
    
    /**
     * Performs an element-wise subtraction of every element in the specified 
     * matrix from every element in this matrix. The difference matrix returned 
     * might be either this instance (if this is mutable) or a completely new 
     * matrix. The given matrix will not be modified.
     * 
     * @param matrix  the matrix to add with
     * @return        the difference, either this instance or a new matrix
     */
    M minus(M matrix);
    
    /**
     * Performs an element-wise multiplication of every element in the specified 
     * matrix to every element in this matrix. The product matrix returned 
     * might be either this instance (if this is mutable) or a completely new 
     * matrix. The given matrix will not be modified.
     * 
     * @param matrix  the matrix to multiply with
     * @return        the product, either this instance or a new matrix
     */
    M multiply(M matrix);
    
}
@@ -928,16 +928,1763 @@
 er M%3E%3E %7B
+%0A    %0A    /**%0A     * Returns a new (mutable) matrix with the specified elements.%0A     * %0A     * @param e0_0  the top-left element%0A     * @param e0_1  the top-center element%0A     * @param e0_2  the top-right element%0A     * @param e1_0  the middle-left element%0A     * @param e1_1  the middle-center element%0A     * @param e1_2  the middle-right element%0A     * @param e2_0  the bottom-left element%0A     * @param e2_1  the bottom-center element%0A     * @param e2_2  the bottom-right element%0A     * @return      the new (mutable) matrix%0A     */%0A    static Mat3x3f mat3x3f(float e0_0, float e0_1, float e0_2,%0A                      float e1_0, float e1_1, float e1_2,%0A                      float e2_0, float e2_1, float e2_2) %7B%0A        %0A        return Mat3x3f.of(%0A            e0_0, e0_1, e0_2,%0A            e1_0, e1_1, e1_2,%0A            e2_0, e2_1, e2_2%0A        );%0A    %7D%0A    %0A    /**%0A     * Returns a new (immutable) matrix with the specified elements.%0A     * %0A     * @param e0_0  the top-left element%0A     * @param e0_1  the top-center element%0A     * @param e0_2  the top-right element%0A     * @param e1_0  the middle-left element%0A     * @param e1_1  the middle-center element%0A     * @param e1_2  the middle-right element%0A     * @param e2_0  the bottom-left element%0A     * @param e2_1  the bottom-center element%0A     * @param e2_2  the bottom-right element%0A     * @return      the new (immutable) matrix%0A     */%0A    static Mat3x3f constMat3x3f(float e0_0, float e0_1, float e0_2,%0A                            float e1_0, float e1_1, float e1_2,%0A                            float e2_0, float e2_1, float e2_2) %7B%0A        %0A        return Mat3x3f.constant(%0A            e0_0, e0_1, e0_2,%0A            e1_0, e1_1, e1_2,%0A            e2_0, e2_1, e2_2%0A        );%0A    %7D
 %0A%0A    /*

Add static constructor for Mat3x3f