Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
Matrices and Sets of Linear Equations 245
41 display_mat(ga);
42 /
*
Compute scalar multiplication of matrix ga
*
/
43 gsl_matrix_scale (ga, x);
44 printf("\nMatrix ga after scalar mul: \n");
45 display_mat(ga);
46 /
*
matrix element multiplication and div of ga and gb
*
/
47 gsl_matrix_mul_elements (ga, gb);
48 gsl_matrix_div_elements (ga, gb);
49 printf("\nMatrix ga after matrix element mul and div: \n");
50 display_mat(ga);
51 return 0;
52 } // end main
53 void display_mat(gsl_matrix
*
gslmat) {
54 int m = gslmat->size1; // get number of rows
55 int n = gslmat->size2; // get number of cols
56 int i, j;
57 double val;
58 for (i = 0; i < m; i++) {
59 for (j = 0; j <
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783