From 3c9676f4286937985cb4ce277a5032331e314740 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Wed, 24 Aug 2016 11:28:08 +0200 Subject: [PATCH] m4_submat modification --- libs/mathlib/m4x4.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/mathlib/m4x4.c b/libs/mathlib/m4x4.c index 5dfdd10d..6f3e75ab 100644 --- a/libs/mathlib/m4x4.c +++ b/libs/mathlib/m4x4.c @@ -702,27 +702,31 @@ void m4_submat( m4x4_t mr, m3x3_t mb, int i, int j ){ idst = 0; for ( ti = 0; ti < 4; ti++ ) { + if ( ti == i ) { + continue; + } if ( ti < i ) { idst = ti; } else - if ( ti > i ) { + { idst = ti - 1; } for ( tj = 0; tj < 4; tj++ ) { + if ( tj == j ) { + continue; + } if ( tj < j ) { jdst = tj; } else - if ( tj > j ) { + { jdst = tj - 1; } - if ( ti != i && tj != j ) { - mb[idst * 3 + jdst] = mr[ti * 4 + tj ]; - } + mb[idst * 3 + jdst] = mr[ti * 4 + tj ]; } } }