IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2004, 1:29:39 PM (22 years ago)
Author:
harman
Message:

Changed psVector to be consistent with psImage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psVectorFFT.c

    r827 r831  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    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 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    448448    numElements = in->n;
    449449
    450     out = psVectorRecycle(out,PS_TYPE_C32,numElements);
     450    out = psVectorRecycle(out, numElements, PS_TYPE_C32);
    451451
    452452    if (type == PS_TYPE_F32) {
    453453        // 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;
    456456        for (unsigned int i=0;i<numElements;i++) {
    457457            outVec[i] = inVec[i];
    458458        }
    459459    } 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;
    462462        for (unsigned int i=0;i<numElements;i++) {
    463463            outVec[i] = inVec[i];
     
    466466
    467467    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,
    470470                             direction,
    471471                             P_FFTW_PLAN_RIGOR);
     
    504504        psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
    505505                 "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));
    508508        return out;
    509509    }
     
    511511    if (type == PS_TYPE_C32) {
    512512        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;
    517517
    518518        for (unsigned int i=0;i<numElements;i++) {
     
    548548                 "A zeroed vector was returned.");
    549549        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);
    551551        return out;
    552552    }
     
    554554    if (type == PS_TYPE_C32) {
    555555        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;
    560560
    561561        for (unsigned int i=0;i<numElements;i++) {
     
    601601    if (type == PS_TYPE_F32) {
    602602        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;
    608608
    609609        for (unsigned int i=0;i<numElements;i++) {
     
    639639                 "Vector copy was performed instead.");
    640640
    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);
    643643        return out;
    644644    }
     
    646646    if (type == PS_TYPE_C32) {
    647647        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;
    652652
    653653        for (unsigned int i=0;i<numElements;i++) {
     
    686686    if (type == PS_TYPE_C32) {
    687687        psF32* outVec;
    688         psC32* inVec = in->vec.cf;
     688        psC32* inVec = in->data.C32;
    689689        psF32 real;
    690690        psF32 imag;
    691691
    692692
    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;
    695695
    696696        for (unsigned int i=0;i<numElements;i++) {
Note: See TracChangeset for help on using the changeset viewer.