Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102851765
DoubleMatrix2x2.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 20:46
Size
1 KB
Mime Type
text/x-c++
Expires
Wed, Feb 26, 20:46 (2 d)
Engine
blob
Format
Raw Data
Handle
24442224
Attached To
R1106 Programming Concept Rouaze
DoubleMatrix2x2.hpp
View Options
/*
* DoubleMatrix2x2.hpp
*
* Created on: Oct 21, 2012
* Author: radu
*/
#ifndef DOUBLEMATRIX2X2_HPP_
#define DOUBLEMATRIX2X2_HPP_
#include <iostream>
class DoubleMatrix2x2 {
public:
// Empty constructor
DoubleMatrix2x2();
// Alternate constructor
DoubleMatrix2x2(const double m11, const double m12,
const double m21, const double m22);
// Copy constructor
DoubleMatrix2x2(const DoubleMatrix2x2& m);
// Destructor
virtual ~DoubleMatrix2x2();
// Get methods
double Get(const int i, const int j) const;
// Operators
DoubleMatrix2x2& operator=(const DoubleMatrix2x2& m);
DoubleMatrix2x2 operator-() const;
DoubleMatrix2x2 operator+(const DoubleMatrix2x2& m) const;
DoubleMatrix2x2 operator-(const DoubleMatrix2x2& m) const;
// Other public methods
void Multiply(const double d);
double Determinant() const;
DoubleMatrix2x2 Inverse() const;
// Friends
friend std::ostream& operator<<(std::ostream& output,
const DoubleMatrix2x2& z);
private:
// Private data members
// We can store the data members as a 1D array:
// M[i][j] = mMatrix[2 * i + j]
double mMatrix[4];
};
#endif /* DOUBLEMATRIX2X2_HPP_ */
Event Timeline
Log In to Comment