Show
Ignore:
Timestamp:
07/23/12 11:03:24 (12 years ago)
Author:
smidl
Message:

upravy choleskiho + nove qmath

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/simulator_zdenek/ekf_example/matrix_vs.cpp

    r1340 r1464  
    663663} 
    664664 
    665 void carlson_fastC(int16 *difz, int16 *xp, int16 *Ch, int16 *C, int16 *R, unsigned int16 dimy, unsigned int16 dimx ) { 
     665void carlson_fastC(int16 *difz, int16 *xp, int16 *Ch, int16 *C, int16 *R, unsigned int16 dimy, unsigned int16 dimx, int16 *detS, int16 *rem ) { 
    666666        int16 alpha,beta,gamma; 
    667667        int16 delta, eta,epsilon,zeta,sigma,tau; 
     
    672672        int16 *Ch_ij, *w_i, *x_i, *C_yi; 
    673673         
    674          
     674        *detS = 32767; 
    675675        for (iy=0; iy<dimy; iy++) 
    676676        { 
     
    695695                        alpha=(tmp_long+(1<<14))>>15;                           // vyssi presnost 
    696696                                         
    697                         //            gamma= qsqrt(((long)alpha*beta));                          // verze pro DSP 
     697                        //gamma= qsqrt(((long)alpha*beta));                          // verze pro DSP 
    698698                        gamma= (int16)(sqrt((double)((int32)alpha*beta)));              // verze pro PC 
    699699                               // in q15 
     
    734734                        w_i++; 
    735735                } 
    736         } 
    737 } 
    738  
     736                 
     737                *detS = ((int32)*detS*alpha+(1<<14))>>8; 
     738                *rem += ((int32)delta*delta)/alpha; 
     739        } 
     740} 
     741