00001 #ifndef vnl_linear_operators_3_h_
00002 #define vnl_linear_operators_3_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vnl/vnl_double_3.h>
00019 #include <vnl/vnl_double_3x3.h>
00020
00021
00022 inline
00023 vnl_double_3 operator* (const vnl_double_3x3& A, const vnl_double_3& x)
00024 {
00025 const double* a = A.data_block();
00026 double r0 = a[0] * x[0] + a[1] * x[1] + a[2] * x[2];
00027 double r1 = a[3] * x[0] + a[4] * x[1] + a[5] * x[2];
00028 double r2 = a[6] * x[0] + a[7] * x[1] + a[8] * x[2];
00029 return vnl_double_3(r0, r1, r2);
00030 }
00031
00032
00033 inline
00034 vnl_double_3 operator+ (const vnl_double_3& a, const vnl_double_3& b)
00035 {
00036 double r0 = a[0] + b[0];
00037 double r1 = a[1] + b[1];
00038 double r2 = a[2] + b[2];
00039 return vnl_double_3(r0, r1, r2);
00040 }
00041
00042 #endif // vnl_linear_operators_3_h_