Merge pull request #376 from Pan7/m4x4

m4_submat modification
This commit is contained in:
Timothee "TTimo" Besset 2017-01-01 08:41:38 -06:00 committed by GitHub
commit d8480ac41c

View file

@ -702,29 +702,33 @@ void m4_submat( m4x4_t mr, m3x3_t mb, int i, int j ){
idst = 0; idst = 0;
for ( ti = 0; ti < 4; ti++ ) for ( ti = 0; ti < 4; ti++ )
{ {
if ( ti == i ) {
continue;
}
if ( ti < i ) { if ( ti < i ) {
idst = ti; idst = ti;
} }
else else
if ( ti > i ) { {
idst = ti - 1; idst = ti - 1;
} }
for ( tj = 0; tj < 4; tj++ ) for ( tj = 0; tj < 4; tj++ )
{ {
if ( tj == j ) {
continue;
}
if ( tj < j ) { if ( tj < j ) {
jdst = tj; jdst = tj;
} }
else else
if ( tj > j ) { {
jdst = tj - 1; jdst = tj - 1;
} }
if ( ti != i && tj != j ) {
mb[idst * 3 + jdst] = mr[ti * 4 + tj ]; mb[idst * 3 + jdst] = mr[ti * 4 + tj ];
} }
} }
}
} }
float m4_det( m4x4_t mr ){ float m4_det( m4x4_t mr ){