Panda3D
lsimpleMatrix.I
1 // Filename: lsimpleMatrix.I
2 // Created by: drose (15Dec11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: LSimpleMatrix::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 template <class FloatType, int NumRows, int NumCols>
23 LSimpleMatrix() {
24  // No default initialization.
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: LSimpleMatrix::Copy Constructor
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 template <class FloatType, int NumRows, int NumCols>
35  memcpy(_array, copy._array, sizeof(_array));
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: LSimpleMatrix::Copy Assignment Operator
40 // Access: Public
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 template <class FloatType, int NumRows, int NumCols>
46  memcpy(_array, copy._array, sizeof(_array));
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: LSimpleMatrix::operator ()
51 // Access: Public
52 // Description:
53 ////////////////////////////////////////////////////////////////////
54 template <class FloatType, int NumRows, int NumCols>
56 operator () (int row, int col) const {
57  return _array[row][col];
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: LSimpleMatrix::operator ()
62 // Access: Public
63 // Description:
64 ////////////////////////////////////////////////////////////////////
65 template <class FloatType, int NumRows, int NumCols>
67 operator () (int row, int col) {
68  return _array[row][col];
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: LSimpleMatrix::operator ()
73 // Access: Public
74 // Description:
75 ////////////////////////////////////////////////////////////////////
76 template <class FloatType, int NumRows, int NumCols>
78 operator () (int col) const {
79  return _array[0][col];
80 }
81 
82 ////////////////////////////////////////////////////////////////////
83 // Function: LSimpleMatrix::operator ()
84 // Access: Public
85 // Description:
86 ////////////////////////////////////////////////////////////////////
87 template <class FloatType, int NumRows, int NumCols>
89 operator () (int col) {
90  return _array[0][col];
91 }
This class provides an underlying storage of the various linear-algebra classes (e.g.
Definition: lsimpleMatrix.h:32