test_gauss_elimination.c
Go to the documentation of this file.
00001 
00003 #include <vl/random.h>
00004 #include <vl/mathop.h>
00005 
00006 #include <math.h>
00007 
00008 int
00009 main(int argc VL_UNUSED, char**argv VL_UNUSED)
00010 {
00011   double A [] = { 1, 12, 3, 4 };
00012   double b [] = { 1, -2 } ;
00013   double x [2] ;
00014   double c [2] ;
00015   int i ;
00016 
00017   vl_solve_linear_system_2 (x, A, b) ;
00018 
00019   c[0] = A[0] * x[0] + A[2] * x[1] ;
00020   c[1] = A[1] * x[0] + A[3] * x[1] ;
00021 
00022   for (i = 0 ; i < 2 ; ++i) {
00023     VL_PRINTF("[A x]_%-4d = %4g, b_%-4d = %4g\n", i+1, c[i], i+1, b[i]) ;
00024   }
00025 
00026   return 0 ;
00027 }


libvlfeat
Author(s): Andrea Vedaldi
autogenerated on Thu Jun 6 2019 20:25:51