vnl_linear_operators_3.h
Go to the documentation of this file.
1 // This is core/vnl/vnl_linear_operators_3.h
2 #ifndef vnl_linear_operators_3_h_
3 #define vnl_linear_operators_3_h_
4 //:
5 // \file
6 // \brief 3D linear algebra operations
7 // \author Andrew W. Fitzgibbon, Oxford RRG
8 // \date 04 Aug 96
9 //
10 // Specialized linear operators for 3D vectors and matrices.
11 // Include this file if you're inlining or compiling linear algebra
12 // code for speed.
13 //
14 // \verbatim
15 // Modifications
16 // LSB (Manchester) 23/3/01 Tidied documentation
17 // \endverbatim
18 //-----------------------------------------------------------------------------
19 
20 #include <vnl/vnl_double_3.h>
21 #include <vnl/vnl_double_3x3.h>
22 
23 //: The binary multiplication operator
24 // \relatesalso vnl_matrix_fixed
25 inline
26 vnl_double_3 operator* (const vnl_double_3x3& A, const vnl_double_3& x)
27 {
28  const double* a = A.data_block();
29  double r0 = a[0] * x[0] + a[1] * x[1] + a[2] * x[2];
30  double r1 = a[3] * x[0] + a[4] * x[1] + a[5] * x[2];
31  double r2 = a[6] * x[0] + a[7] * x[1] + a[8] * x[2];
32  return {r0, r1, r2};
33 }
34 
35 //: The binary addition operator
36 // \relatesalso vnl_vector_fixed
37 inline
38 vnl_double_3 operator+ (const vnl_double_3& a, const vnl_double_3& b)
39 {
40  double r0 = a[0] + b[0];
41  double r1 = a[1] + b[1];
42  double r2 = a[2] + b[2];
43  return {r0, r1, r2};
44 }
45 
46 #endif // vnl_linear_operators_3_h_
vnl_bignum operator+(vnl_bignum const &r1, long r2)
Returns the sum of two bignum numbers.
Definition: vnl_bignum.h:279
T const * data_block() const
Access the contiguous block storing the elements in the matrix row-wise. O(1).
Fixed size, stack-stored, space-efficient matrix.
Definition: vnl_fwd.h:23
3x3 matrix of double
Contains class vnl_double_3 and function vnl_cross_3d()
vnl_bignum operator *(vnl_bignum const &r1, vnl_bignum const &r2)
Returns the product of two bignum numbers.
Definition: vnl_bignum.h:302