Panda3D

lsimpleMatrix.I

00001 // Filename: lsimpleMatrix.I
00002 // Created by:  drose (15Dec11)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: LSimpleMatrix::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 template <class FloatType, int NumRows, int NumCols>
00022 INLINE LSimpleMatrix<FloatType, NumRows, NumCols>::
00023 LSimpleMatrix() {
00024   // No default initialization.
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: LSimpleMatrix::Copy Constructor
00029 //       Access: Public
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 template <class FloatType, int NumRows, int NumCols>
00033 INLINE LSimpleMatrix<FloatType, NumRows, NumCols>::
00034 LSimpleMatrix(const LSimpleMatrix<FloatType, NumRows, NumCols> &copy) {
00035   memcpy(_array, copy._array, sizeof(_array));
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: LSimpleMatrix::Copy Assignment Operator
00040 //       Access: Public
00041 //  Description:
00042 ////////////////////////////////////////////////////////////////////
00043 template <class FloatType, int NumRows, int NumCols>
00044 INLINE void LSimpleMatrix<FloatType, NumRows, NumCols>::
00045 operator = (const LSimpleMatrix<FloatType, NumRows, NumCols> &copy) {
00046   memcpy(_array, copy._array, sizeof(_array));
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: LSimpleMatrix::operator ()
00051 //       Access: Public
00052 //  Description:
00053 ////////////////////////////////////////////////////////////////////
00054 template <class FloatType, int NumRows, int NumCols>
00055 INLINE const FloatType &LSimpleMatrix<FloatType, NumRows, NumCols>::
00056 operator () (int row, int col) const {
00057   return _array[row][col];
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: LSimpleMatrix::operator ()
00062 //       Access: Public
00063 //  Description:
00064 ////////////////////////////////////////////////////////////////////
00065 template <class FloatType, int NumRows, int NumCols>
00066 INLINE FloatType &LSimpleMatrix<FloatType, NumRows, NumCols>::
00067 operator () (int row, int col) {
00068   return _array[row][col];
00069 }
00070 
00071 ////////////////////////////////////////////////////////////////////
00072 //     Function: LSimpleMatrix::operator ()
00073 //       Access: Public
00074 //  Description:
00075 ////////////////////////////////////////////////////////////////////
00076 template <class FloatType, int NumRows, int NumCols>
00077 INLINE const FloatType &LSimpleMatrix<FloatType, NumRows, NumCols>::
00078 operator () (int col) const {
00079   return _array[0][col];
00080 }
00081 
00082 ////////////////////////////////////////////////////////////////////
00083 //     Function: LSimpleMatrix::operator ()
00084 //       Access: Public
00085 //  Description:
00086 ////////////////////////////////////////////////////////////////////
00087 template <class FloatType, int NumRows, int NumCols>
00088 INLINE FloatType &LSimpleMatrix<FloatType, NumRows, NumCols>::
00089 operator () (int col) {
00090   return _array[0][col];
00091 }
 All Classes Functions Variables Enumerations