diff options
Diffstat (limited to 'src/matrixOperations/eye/ceyea.c')
-rw-r--r-- | src/matrixOperations/eye/ceyea.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/matrixOperations/eye/ceyea.c b/src/matrixOperations/eye/ceyea.c index a0ef2759..735018c6 100644 --- a/src/matrixOperations/eye/ceyea.c +++ b/src/matrixOperations/eye/ceyea.c @@ -14,10 +14,11 @@ void ceyea(floatComplex *in, int _iRows, int _iCols) { - int i ; + int i , j ; - for ( i = 0 ; i < _iRows*_iCols ; i++ ) - in[i] = FloatComplex ( (i%(_iCols+1) == 0)?1.0f:0.0f , 0) ; + for ( i = 0 ; i < _iCols ; i++ ) + for ( j = 0 ; j < _iRows ; j++ ) + in[i*_iRows + j] = FloatComplex ( (i == j)? 1.0f:0 , 0) ; } |