Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a018

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install this file in your working directory. /* ------------------------------------ */ /* Save as : vbsm.h */ /* ------------------------------------ */ double **Exp_mR( double **A, double **ExpA ) { double **A_n = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **sA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **NewExpA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); int n = 25; int i = 0; for(i = 0; i <= n; i++) { pow_mR(i, A, A_n); smul_mR(1./factorial(i), A_n, sA); add_mR(ExpA,sA,NewExpA); c_mR(NewExpA,ExpA); } f_mR(A_n); f_mR(sA); f_mR(NewExpA); return (ExpA); } /* ------------------------------------ */ /* ------------------------------------ */ /* ------------------------------------ */ /* ------------------------------------ */ double **sinh_mR( double **A, double **sinhA ) { double **A_n = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **sA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **NewsinhA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); int n = 10; int i; for(i = 1.; i <= n; i+=2.) { pow_mR(i, A, A_n); smul_mR(1./factorial(i), A_n, sA); add_mR(sinhA,sA,NewsinhA); c_mR(NewsinhA,sinhA); } f_mR(A_n); f_mR(sA); f_mR(NewsinhA); return (sinhA); } /* ------------------------------------ */ /* ------------------------------------ */ double **cosh_mR( double **A, double **coshA ) { double **A_n = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **sA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **NewcoshA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); int n = 10; int i; for(i = 0.; i <= n; i+=2.) { pow_mR(i, A, A_n); smul_mR(1./factorial(i), A_n, sA); add_mR(coshA,sA,NewcoshA); c_mR(NewcoshA,coshA); } f_mR(A_n); f_mR(sA); f_mR(NewcoshA); return (coshA); } /* ------------------------------------ */ /* ------------------------------------ */ /* ------------------------------------ */ /* ------------------------------------ */ double **sin_mR( double **A, double **sinA ) { double **A_n = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **sA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **NewsinA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); int n = 10; int i; int j; for(i=1.,j=0.; i <= n; i+=2.,j++) { pow_mR(i, A, A_n); smul_mR(pow((-1),j)/factorial(i), A_n, sA); add_mR(sinA,sA,NewsinA); c_mR(NewsinA,sinA); } f_mR(A_n); f_mR(sA); f_mR(NewsinA); return (sinA); } /* ------------------------------------ */ /* ------------------------------------ */ double **cos_mR( double **A, double **cosA ) { double **A_n = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **sA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); double **NewcosA = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); int n = 10; int i; int j; for(i=0.,j=0.; i <= n; i+=2.,j++) { pow_mR(i, A, A_n); smul_mR(pow((-1),j)/factorial(i), A_n, sA); add_mR(cosA,sA,NewcosA); c_mR(NewcosA,cosA); } f_mR(A_n); f_mR(sA); f_mR(NewcosA); return (cosA); } /* ------------------------------------ */ /* ------------------------------------ */