diff options
author | simon | 2008-10-30 14:59:23 +0000 |
---|---|---|
committer | simon | 2008-10-30 14:59:23 +0000 |
commit | 2be2cd11107322ac6b9ed1870191686d51a71410 (patch) | |
tree | ae390edeacd63d7d903633e58dac9282ced68452 /src/matrixOperations/eye/seyea.c | |
parent | 22827e45d6fa043ee7f29da84bdfc04d6d953778 (diff) | |
download | scilab2c-2be2cd11107322ac6b9ed1870191686d51a71410.tar.gz scilab2c-2be2cd11107322ac6b9ed1870191686d51a71410.tar.bz2 scilab2c-2be2cd11107322ac6b9ed1870191686d51a71410.zip |
corrected a nasty ignored case
Diffstat (limited to 'src/matrixOperations/eye/seyea.c')
-rw-r--r-- | src/matrixOperations/eye/seyea.c | 7 |
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 ; } |