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/a021

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 : vgconsit.h */ /* ------------------------------------ */ double add_coef_r_Ab_mR( double **Ab, int r ) { double x; int c; x=0.; for ( c=C1; c<Ab[C_SIZE][C0]; c++) x+=fabs(Ab[r][c]); return(x); } /* ------------------------------------ */ double add_coef_r_A_mR( double **Ab, int r ) { double x; int c; x=0.; for ( c=C1; c<Ab[C_SIZE_A][C0]; c++) x+=fabs(Ab[r][c]); return(x); } /* ------------------------------------ */ void is_system_consistent_mR( double **Ab ) { int r; int consistent = 1; for ( r=R1; r<Ab[R_SIZE][C0]; r++) if((add_coef_r_A_mR(Ab,r)<ERROR_E) && (add_coef_r_Ab_mR(Ab,r)>ERROR_E)) { if(consistent) /* Print this line only the fisrt time */ printf(" This(ese) row(s) are incompatible.\n"); printf(" row %d; ",r); consistent=0; } if(!consistent) { printf("\n The system is inconsistent. \n"); printf(" I prefer to close the program.\n"); printf(" Press return to continue. \n"); fflush(stdout); getchar(); exit(EXIT_FAILURE); } } /* ------------------------------------ */ /* ------------------------------------ */