egsl_test.c
Go to the documentation of this file.
00001 #include <math.h>
00002 #include <gsl/gsl_math.h>
00003 #include "egsl_macros.h"
00004 
00005 int main() {    
00006         egsl_push();
00007         
00008                 /* Creates a vector from a double array */
00009                 double p[2] = {1,2};
00010                 val vp = egsl_vFa(2,p); 
00011                 
00012                 /* Creates a matrix from a double array */
00013                 double md[4] = {
00014                         1, 2,
00015                         0, -1
00016                 };
00017                 val m = egsl_vFda(2,2,md);
00018 
00019                 /* Creates a rotation matrix */
00020                 val R = rot(M_PI/2);
00021                 
00022                 /* Multiplies the three together */
00023                 val vrot = m3(R, m, vp); 
00024         
00025                 /* Displays the results */
00026                 egsl_print("R", R);
00027                 egsl_print("vp", vp);
00028                 egsl_print("vrot", vrot);
00029         
00030                 /* Create a semidifinite matrix (symmetric part of R) */
00031                 val A = sc(0.5, sum(m, tr(m)) );
00032  
00033                 /* Displays spectrum */
00034                 egsl_print("A",A);
00035                 egsl_print_spectrum("A",A);
00036                 
00037         egsl_pop();
00038         
00039         return 0;
00040 }
00041 


csm
Author(s): Andrea Censi
autogenerated on Mon Jan 16 2017 03:48:29