Revision 55604844

View differences:

utility/matrix.h
172 172
        return ret;
173 173
    }
174 174

  
175
    Matrix<N-1> minor_matrix(int row, int col)
175
    Matrix<N-1> minor_matrix(int row, int col) const
176 176
    {
177
        int colCount = 0, rowCount = 0;
178 177
        Matrix<N-1> ret;
179
        for(int i = 0; i < N; i++ )
178
        for (int i = 0, im = 0; i < N; i++)
180 179
        {
181
            if( i != row )
180
            if (i == row)
181
                continue;
182

  
183
            for (int j = 0, jm = 0; j < N; j++)
182 184
            {
183
                for(int j = 0; j < N; j++ )
185
                if (j != col)
184 186
                {
185
                    if( j != col )
186
                    {
187
                        ret(rowCount, colCount) = cell(i, j);
188
                        colCount++;
189
                    }
187
                    ret(im, jm++) = cell(i, j);
190 188
                }
191
                rowCount++;
192 189
            }
190
            im++;
193 191
        }
194 192
        return ret;
195 193
    }

Also available in: Unified diff