IVT
Matd.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // This file is part of the Integrating Vision Toolkit (IVT).
3 //
4 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
5 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
6 //
7 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
8 // All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // 3. Neither the name of the KIT nor the names of its contributors may be
21 // used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
25 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
28 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // ****************************************************************************
35 // ****************************************************************************
36 // Filename: Matd.h
37 // Author: Pedram Azad
38 // Date: 2004
39 // ****************************************************************************
40 
41 
42 #ifndef _MAT_D_H_
43 #define _MAT_D_H_
44 
45 
46 // ****************************************************************************
47 // Necessary includes
48 // ****************************************************************************
49 
50 #include "Vecd.h"
51 
52 
53 
54 // ****************************************************************************
55 // CMatd
56 // ****************************************************************************
57 
61 class CMatd
62 {
63 public:
64  // constructors
65  CMatd();
66  CMatd(int nRows, int nColumns);
67  CMatd(const CMatd &m);
68 
69  // destructor
70  ~CMatd();
71 
72 
73  // operators
74  double& operator() (int nRow, int nColumn) const;
75  CMatd& operator= (const CMatd &v);
76  void operator*= (const double s);
77  CMatd operator* (const double s);
78  CVecd operator* (const CVecd &v);
79  CMatd operator* (const CMatd &m);
80  CMatd operator+ (const CMatd &m);
81  CMatd operator- (const CMatd &m);
82 
83  // methods
84  void Zero();
85  bool Unit();
86  CMatd Invert() const;
87  void SetSize(int nRows, int nColumns);
89 
90  // member access
91  int GetRows() const { return m_nRows; }
92  int GetColumns() const { return m_nColumns; }
93 
94 
95 private:
96  // private attributes
97  double **m_ppElements;
98  int m_nRows;
99  int m_nColumns;
100 };
101 
102 
103 
104 #endif /* _MAT_D_H_ */
double & operator()(int nRow, int nColumn) const
Definition: Matd.cpp:102
CMatd()
Definition: Matd.cpp:61
int GetColumns() const
Definition: Matd.h:92
CMatd Invert() const
Definition: Matd.cpp:248
~CMatd()
Definition: Matd.cpp:86
void operator*=(const double s)
Definition: Matd.cpp:120
Data structure and operations for calculating with matrices of arbitrary dimension.
Definition: Matd.h:61
CMatd & operator=(const CMatd &v)
Definition: Matd.cpp:109
CMatd operator-(const CMatd &m)
Definition: Matd.cpp:176
void Zero()
Definition: Matd.cpp:227
int GetRows() const
Definition: Matd.h:91
CMatd operator*(const double s)
Definition: Matd.cpp:191
void SetSize(int nRows, int nColumns)
Definition: Matd.cpp:340
bool Unit()
Definition: Matd.cpp:234
CMatd GetTransposed()
Definition: Matd.cpp:367
Data structure and operations for calculating with vectors of arbitrary dimension.
Definition: Vecd.h:54
CMatd operator+(const CMatd &m)
Definition: Matd.cpp:161