Panda3D
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
panda
src
linmath
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>
22
INLINE
LSimpleMatrix<FloatType, NumRows, 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>
33
INLINE
LSimpleMatrix<FloatType, NumRows, NumCols>::
34
LSimpleMatrix
(
const
LSimpleMatrix<FloatType, NumRows, 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>
44
INLINE
void
LSimpleMatrix<FloatType, NumRows, NumCols>::
45
operator =
(
const
LSimpleMatrix<FloatType, NumRows, 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>
55
INLINE
const
FloatType &
LSimpleMatrix<FloatType, NumRows, 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>
66
INLINE FloatType &
LSimpleMatrix<FloatType, NumRows, 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>
77
INLINE
const
FloatType &
LSimpleMatrix<FloatType, NumRows, 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>
88
INLINE FloatType &
LSimpleMatrix<FloatType, NumRows, NumCols>::
89
operator ()
(
int
col) {
90
return
_array[0][col];
91
}
LSimpleMatrix
This class provides an underlying storage of the various linear-algebra classes (e.g.
Definition:
lsimpleMatrix.h:32
Generated on Mon Feb 1 2016 13:44:29 for Panda3D by
1.8.5