00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GEOM_MAT3_HH
00020 #define GEOM_MAT3_HH
00021
00022 #include <cstddef>
00023 #include <ostream>
00024
00025 #include <boost/operators.hpp>
00026
00027 #include <ost/geom/module_config.hh>
00028
00029 namespace geom {
00030
00031 class Mat2;
00032 class Vec3;
00033
00034 class DLLEXPORT_OST_GEOM Mat3:
00035 private boost::equality_comparable<Mat3>,
00036 private boost::additive1<Mat3>,
00037 private boost::multiplicative2<Mat3, Real>
00038 {
00039 public:
00040 static Mat3 Identity();
00041
00043 Mat3();
00044
00046
00055 Mat3(Real i00, Real i01, Real i02,Real i10, Real i11, Real i12,Real i20, Real i21, Real i22);
00056
00058 Mat3(const Mat3& m);
00059
00060
00061 explicit Mat3(const Mat2& m);
00062
00064 explicit Mat3(const Real[9]);
00065
00067 Mat3& operator=(const Mat3& m);
00068
00070 bool operator==(const Mat3& rhs) const;
00071
00073 Real& operator()(std::size_t r, std::size_t c);
00075 const Real& operator()(std::size_t r, std::size_t c) const;
00076
00078 Mat3& operator+=(const Mat3& rhs);
00080 Mat3& operator-=(const Mat3& rhs);
00081
00082 Mat3& operator*=(const Real d);
00083 Mat3& operator/=(const Real d);
00084
00085 Mat3& operator*=(const Mat3& m);
00086
00087 Real* Data() {return &data_[0][0];}
00088 const Real* Data() const {return &data_[0][0];}
00089
00090 geom::Vec3 GetCol(int index) const;
00091 geom::Vec3 GetRow(int index) const;
00092 private:
00093 Real data_[3][3];
00094
00095 void set(Real i00, Real i01, Real i02,Real i10, Real i11, Real i12,Real i20, Real i21, Real i22);
00096 };
00097
00098 DLLEXPORT_OST_GEOM std::ostream& operator<<(std::ostream& o, const Mat3& m);
00099
00100 }
00101
00102
00103 #endif