public Double getDeterminant() {
        
        Double determinant = null;
        
        Matrix submatrix = null;
            
        if(size == 1) {

            determinant = values[0][0];
        } else {

            determinant = 0.0;

            for(int columns = 0;
                    columns < size;
                    columns++) {
            
                submatrix = getSubmatrix(this, columns);
                
                determinant += (((columns % 2 == 0) ? 1 : -1)
                        * values[0][columns]
                        * submatrix.getDeterminant());
            }
        }
        
        return determinant;
    }