summaryrefslogtreecommitdiff
path: root/src/matrixOperations/eye/seyea.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/matrixOperations/eye/seyea.c')
-rw-r--r--src/matrixOperations/eye/seyea.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/matrixOperations/eye/seyea.c b/src/matrixOperations/eye/seyea.c
index 91b56662..2f256b86 100644
--- a/src/matrixOperations/eye/seyea.c
+++ b/src/matrixOperations/eye/seyea.c
@@ -14,9 +14,10 @@
void seyea(float* in, int _iRows, int _iCols)
{
- int i ;
+ int i, j ;
- for ( i = 0 ; i < _iRows*_iCols ; i++ )
- in[i] = (i%(_iCols+1) == 0)?1.0f:0.0f ;
+ for ( i = 0 ; i < _iCols ; i++ )
+ for ( j = 0 ; j < _iRows ; j++ )
+ in[i*_iRows + j] = (i == j)?1.0f:0 ;
}