matrix4x4.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // This file is part of libgvectors.
00004 // libgvectors is a C++ library intended for visualizing mathematical vectors.
00005 // Copyright (C) 2007  Rafael Ostertag
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // This program is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with this program; if not, write to the Free Software
00019 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
00020 // USA.
00021 //
00022 // $Id: matrix4x4_8h-source.html,v 1.1 2007-09-08 19:02:36 rafi Exp $
00023 // 
00024 // File:   matrix4x4.h
00025 // Author: Rafael Ostertag
00026 //
00027 // Created on August 5, 2007, 8:09 PM
00028 //
00029 
00038 #ifndef _MATRIX4X4_H
00039 #define _MATRIX4X4_H
00040 
00041 #include <gvectortypes.h>
00042 #include <matrix.h>
00043 
00044 namespace GVectors {
00045 
00046     //Forward declaration to the 4x1 matrix.
00047     class Matrix4x1;
00048    
00054     class Matrix4x4 : public Matrix {
00055     public:
00061         inline Matrix4x4() : Matrix(4,4) {}
00069         inline Matrix4x4(const Matrix4x4& m) : Matrix(m) {}
00071         const Matrix4x4& operator=(const Matrix4x4& m); 
00077         inline ~Matrix4x4() {}
00078 
00090         inline void operator()(matindex_t r, matindex_t c, double v) { set(r,c,v);      }
00102         inline double operator()(matindex_t r, matindex_t c) const { return get(r,c); }
00103 
00105         Matrix4x4 operator+(const Matrix4x4& m) const;
00107         Matrix4x4 operator-(const Matrix4x4& m) const;
00109         Matrix4x4 operator*(const Matrix4x4& m) const;
00111         Matrix4x1 operator*(const Matrix4x1& m) const;
00113         Matrix4x4 operator*(const double v) const;
00125         inline Matrix4x4 operator/(const double v) const { return operator*(1/v); }
00127         Matrix4x4& operator+=(const Matrix4x4& m);
00130         Matrix4x4& operator*=(const Matrix4x4& m);
00132         Matrix4x4& operator*=(const double v);
00134         Matrix4x4& operator/=(const double v);
00136         bool operator==(const Matrix4x4& m) const;
00151         inline bool operator!=(const Matrix4x4& m) const { return !operator==(m); }
00152     };
00153 }
00154 
00155 #endif  /* _MATRIX4X4_H */
00156 

Generated on Sat Sep 8 19:37:29 2007 for libgvectors by  doxygen 1.4.7