Skip to content

Commit a1bf411

Browse files
committed
Added assertions to ComplexFloatArray
1 parent d627273 commit a1bf411

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

LibSource/ComplexFloatArray.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ void ComplexFloatArray::complexDotProduct(ComplexFloatArray& operand2, ComplexFl
6262
}
6363

6464
void ComplexFloatArray::complexByComplexMultiplication(ComplexFloatArray& operand2, ComplexFloatArray& result){
65-
int minSize=min(size,operand2.getSize()); //TODO: shall we take this out and allow it to segfault?
65+
ASSERT(size==operand2.getSize(), "Wrong size");
6666
#ifdef ARM_CORTEX
67-
arm_cmplx_mult_cmplx_f32 ( (float*)data, (float*)operand2, (float*)result, minSize );
67+
arm_cmplx_mult_cmplx_f32 ( (float*)data, (float*)operand2, (float*)result, size );
6868
#else
6969
float *pSrcA=(float*)data;
7070
float *pSrcB=(float*)operand2;
7171
float *pDst=(float*)result;
72-
for(int n=0; n<minSize; n++) {
72+
for(int n=0; n<size; n++) {
7373
pDst[(2*n)+0] = pSrcA[(2*n)+0] * pSrcB[(2*n)+0] - pSrcA[(2*n)+1] * pSrcB[(2*n)+1];
7474
pDst[(2*n)+1] = pSrcA[(2*n)+0] * pSrcB[(2*n)+1] + pSrcA[(2*n)+1] * pSrcB[(2*n)+0];
7575
}
7676
#endif
7777
}
7878

7979
void ComplexFloatArray::getComplexConjugateValues(ComplexFloatArray& buf){
80-
int minSize= min(size,buf.getSize()); //TODO: shall we take this out and allow it to segfault?
80+
ASSERT(size==buf.getSize(), "Wrong size");
8181
#ifdef ARM_CORTEX
82-
arm_cmplx_conj_f32( (float*)data, (float*)buf, minSize );
82+
arm_cmplx_conj_f32( (float*)data, (float*)buf, size );
8383
#else
8484
float *pSrc=(float*)data;
8585
float *pDst=(float *)buf;
@@ -91,9 +91,9 @@ void ComplexFloatArray::getComplexConjugateValues(ComplexFloatArray& buf){
9191
}
9292

9393
void ComplexFloatArray::complexByRealMultiplication(FloatArray& operand2, ComplexFloatArray& result){
94-
int minSize= min(size,operand2.getSize()); //TODO: shall we take this out and allow it to segfault?
94+
ASSERT(size==operand2.getSize(), "Wrong size");
9595
#ifdef ARM_CORTEX
96-
arm_cmplx_mult_real_f32 ( (float*)data, (float*)operand2, (float*)result, minSize );
96+
arm_cmplx_mult_real_f32 ( (float*)data, (float*)operand2, (float*)result, size );
9797
#else
9898
float *pSrcCmplx=(float*)data;
9999
float *pSrcReal=(float*)operand2;

0 commit comments

Comments
 (0)