ionflux.org | Impressum

Matrix3.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_MATRIX3
00002 #define IONFLUX_TOOLS_MATRIX3
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * Matrix3.hpp                       Matrix (R3 x R3).
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it
00014  * under the terms of the GNU General Public License as published by the 
00015  * Free Software Foundation; either version 2 of the License, or (at your 
00016  * option) any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00021  * General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License along 
00024  * with Ionflux Tools; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <sstream>
00032 #include <math.h>
00033 #include "ionflux/Vector3.hpp"
00034 #include "ionflux/ManagedObject.hpp"
00035 
00036 namespace Ionflux
00037 {
00038 
00039 namespace Tools
00040 {
00041 
00047 class Matrix3
00048 : public ManagedObject
00049 {
00050     protected:
00052         double* entry;
00053         
00054     public:
00059         Matrix3();
00060         
00075         Matrix3(double initX11, double initX12, double initX13, double initX21, 
00076         double initX22, double initX23, double initX31, double initX32, double 
00077         initX33);
00078         
00085         Matrix3(const Matrix3& initMat);
00086         
00095         Matrix3(const Vector3& initC1, const Vector3& initC2, const Vector3& 
00096         initC3);
00097         
00104         Matrix3(const double* initEntry);
00105         
00110         virtual ~Matrix3();
00111         
00126         virtual void setEntries(double newX11, double newX12, double newX13, 
00127             double newX21, double newX22, double newX23, double newX31, 
00128             double newX32, double newX33);
00129         
00138         virtual void setEntries(const double* newEntry);
00139         
00148         virtual void setColumns(const Vector3& newC1, const Vector3& newC2, 
00149             const Vector3& newC3);
00150         
00159         virtual void setRows(const Vector3& newR1, const Vector3& newR2, 
00160             const Vector3& newR3);
00161         
00173         virtual void setEntry(int rowIndex, int colIndex, double newEntry);
00174         
00184         virtual void setColumn(int colIndex, const Vector3& newCol);
00185         
00195         virtual void setRow(int rowIndex, const Vector3& newRow);
00196         
00208         virtual Vector3 getColumn(int colIndex) const;
00209         
00221         virtual Vector3 getRow(int rowIndex) const;
00222         
00235         virtual double getEntry(int rowIndex, int colIndex) const;
00236         
00245         virtual Matrix3& operator=(const Matrix3& newMat);
00246         
00255         virtual Matrix3 operator+(const Matrix3& otherMat) const;
00256         
00265         virtual Matrix3 operator-(const Matrix3& otherMat) const;
00266         
00275         virtual Matrix3 operator*(const Matrix3& otherMat) const;
00276         
00285         virtual Matrix3& operator+=(const Matrix3& otherMat);
00286         
00295         virtual Matrix3& operator-=(const Matrix3& otherMat);
00296         
00305         virtual Matrix3& operator*=(const Matrix3& otherMat);
00306         
00315         virtual Matrix3& operator*=(double a);
00316         
00325         virtual Vector3 operator*(const Vector3& argVec) const;
00326         
00335         virtual Matrix3 operator*(double a) const;
00336         
00348         virtual Vector3 operator[](int rowIndex) const;
00349         
00358         virtual std::string toString() const;
00359         
00371         virtual double getSubDet(int rowIndex, int colIndex) const;
00372         
00379         virtual double getDet() const;
00380         
00387         virtual Matrix3 getAdjoint() const;
00388         
00395         virtual Matrix3& transpose();
00396         
00403         virtual Matrix3& invert();
00404         
00411         virtual Matrix3& clear();
00412         
00419         virtual Matrix3& setIdentity();
00420         
00429         virtual Matrix3& setRotateX(double phi);
00430         
00439         virtual Matrix3& setRotateY(double phi);
00440         
00449         virtual Matrix3& setRotateZ(double phi);
00450         
00461         virtual Matrix3& setScale(double scaleX, double scaleY, double scaleZ);
00462         
00469         virtual void setX11(double newX11);
00470         
00477         virtual void setX12(double newX12);
00478         
00485         virtual void setX13(double newX13);
00486         
00493         virtual void setX21(double newX21);
00494         
00501         virtual void setX22(double newX22);
00502         
00509         virtual void setX23(double newX23);
00510         
00517         virtual void setX31(double newX31);
00518         
00525         virtual void setX32(double newX32);
00526         
00533         virtual void setX33(double newX33);
00534         
00539         virtual double getX11() const;
00540         
00545         virtual double getX12() const;
00546         
00551         virtual double getX13() const;
00552         
00557         virtual double getX21() const;
00558         
00563         virtual double getX22() const;
00564         
00569         virtual double getX23() const;
00570         
00575         virtual double getX31() const;
00576         
00581         virtual double getX32() const;
00582         
00587         virtual double getX33() const;
00588 };
00589 
00598 Matrix3 operator*(double a, const Matrix3& mat);
00599 
00600 }
00601 
00602 }
00603 
00607 #endif

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6