Changeset 831 for trunk/psLib/src/dataManip/psVectorFFT.c
- Timestamp:
- Jun 2, 2004, 1:29:39 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psVectorFFT.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psVectorFFT.c
r827 r831 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06-02 03:02:48$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-02 23:29:21 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 448 448 numElements = in->n; 449 449 450 out = psVectorRecycle(out, PS_TYPE_C32,numElements);450 out = psVectorRecycle(out, numElements, PS_TYPE_C32); 451 451 452 452 if (type == PS_TYPE_F32) { 453 453 // need to convert to complex 454 psC32* outVec = out-> vec.cf;455 psF32* inVec = in-> vec.f;454 psC32* outVec = out->data.C32; 455 psF32* inVec = in->data.F32; 456 456 for (unsigned int i=0;i<numElements;i++) { 457 457 outVec[i] = inVec[i]; 458 458 } 459 459 } else { 460 psC32* outVec = out-> vec.cf;461 psC32* inVec = in-> vec.cf;460 psC32* outVec = out->data.C32; 461 psC32* inVec = in->data.C32; 462 462 for (unsigned int i=0;i<numElements;i++) { 463 463 outVec[i] = inVec[i]; … … 466 466 467 467 plan = fftwf_plan_dft_1d(numElements, 468 (fftwf_complex*)out-> vec.cf,469 (fftwf_complex*)out-> vec.cf,468 (fftwf_complex*)out->data.C32, 469 (fftwf_complex*)out->data.C32, 470 470 direction, 471 471 P_FFTW_PLAN_RIGOR); … … 504 504 psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. " 505 505 "Just a vector copy was performed."); 506 out = psVectorRecycle(out, type,numElements);507 memcpy(out-> vec.v,in->vec.v,numElements*PSELEMTYPE_SIZEOF(type));506 out = psVectorRecycle(out,numElements,type); 507 memcpy(out->data.V,in->data.V,numElements*PSELEMTYPE_SIZEOF(type)); 508 508 return out; 509 509 } … … 511 511 if (type == PS_TYPE_C32) { 512 512 psF32* outVec; 513 psC32* inVec = in-> vec.cf;514 515 out = psVectorRecycle(out, PS_TYPE_F32,numElements);516 outVec = out-> vec.f;513 psC32* inVec = in->data.C32; 514 515 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 516 outVec = out->data.F32; 517 517 518 518 for (unsigned int i=0;i<numElements;i++) { … … 548 548 "A zeroed vector was returned."); 549 549 out = psVectorRecycle(out,numElements,type); 550 memset(out-> vec.v,0,PSELEMTYPE_SIZEOF(type)*numElements);550 memset(out->data.V,0,PSELEMTYPE_SIZEOF(type)*numElements); 551 551 return out; 552 552 } … … 554 554 if (type == PS_TYPE_C32) { 555 555 psF32* outVec; 556 psC32* inVec = in-> vec.cf;557 558 out = psVectorRecycle(out, PS_TYPE_F32,numElements);559 outVec = out-> vec.f;556 psC32* inVec = in->data.C32; 557 558 out = psVectorRecycle(out,numElements, PS_TYPE_F32); 559 outVec = out->data.F32; 560 560 561 561 for (unsigned int i=0;i<numElements;i++) { … … 601 601 if (type == PS_TYPE_F32) { 602 602 psC32* outVec; 603 psF32* realVec = real-> vec.f;604 psF32* imagVec = imag-> vec.f;605 606 out = psVectorRecycle(out, PS_TYPE_C32,numElements);607 outVec = out-> vec.cf;603 psF32* realVec = real->data.F32; 604 psF32* imagVec = imag->data.F32; 605 606 out = psVectorRecycle(out,numElements, PS_TYPE_C32); 607 outVec = out->data.C32; 608 608 609 609 for (unsigned int i=0;i<numElements;i++) { … … 639 639 "Vector copy was performed instead."); 640 640 641 out = psVectorRecycle(out, type,numElements);642 memcpy(out-> vec.v,in->vec.v,PSELEMTYPE_SIZEOF(type)*numElements);641 out = psVectorRecycle(out,numElements,type); 642 memcpy(out->data.V,in->data.V,PSELEMTYPE_SIZEOF(type)*numElements); 643 643 return out; 644 644 } … … 646 646 if (type == PS_TYPE_C32) { 647 647 psC32* outVec; 648 psC32* inVec = in-> vec.cf;649 650 out = psVectorRecycle(out, PS_TYPE_C32,numElements);651 outVec = out-> vec.cf;648 psC32* inVec = in->data.C32; 649 650 out = psVectorRecycle(out,numElements,PS_TYPE_C32); 651 outVec = out->data.C32; 652 652 653 653 for (unsigned int i=0;i<numElements;i++) { … … 686 686 if (type == PS_TYPE_C32) { 687 687 psF32* outVec; 688 psC32* inVec = in-> vec.cf;688 psC32* inVec = in->data.C32; 689 689 psF32 real; 690 690 psF32 imag; 691 691 692 692 693 out = psVectorRecycle(out, PS_TYPE_F32,numElements);694 outVec = out-> vec.f;693 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 694 outVec = out->data.F32; 695 695 696 696 for (unsigned int i=0;i<numElements;i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
