Templates -- Meow
1.1.2
不能,也不應該先編譯成obj-file的templates
LinearTransformation.h
Go to the documentation of this file.
1
#ifndef math_LinearTransformation_H__
2
#define math_LinearTransformation_H__
3
4
#include "
Transformation.h
"
5
#include "
Matrix.h
"
6
7
#include <cstdlib>
8
9
namespace
meow {
10
19
template
<
class
Scalar>
20
class
LinearTransformation
:
public
Transformation
<Scalar> {
21
private
:
22
Matrix<Scalar>
matrix_;
23
protected
:
27
LinearTransformation
(
size_t
inputRows
,
size_t
outputRows
,
size_t
psize):
28
Transformation
<Scalar>(inputRows, 1u, outputRows, 1u, psize),
29
matrix_(outputRows, inputRows, Scalar(0.0)) {
30
}
31
35
LinearTransformation
(
size_t
inputRows
,
size_t
outputRows
,
size_t
psize,
36
Matrix<Scalar>
const
& m):
37
Transformation
<Scalar>(inputRows, 1u, outputRows, 1u, psize),
38
matrix_(m) {
39
}
40
46
LinearTransformation
(
LinearTransformation
const
& b):
47
Transformation
<Scalar>(b),
48
matrix_(b.matrix_) {
49
}
50
56
LinearTransformation
&
copyFrom
(
LinearTransformation
const
& b) {
57
Transformation<Scalar>::copyFrom
(b);
58
matrix_.
copyFrom
(b.matrix_);
59
return
*
this
;
60
}
61
67
LinearTransformation
&
referenceFrom
(
LinearTransformation
const
& b) {
68
Transformation<Scalar>::referenceFrom
(b);
69
matrix_.
referenceFrom
(b.matrix_);
70
return
*
this
;
71
}
72
79
Matrix<Scalar>
const
&
matrix
(
Matrix<Scalar>
const
& m) {
80
matrix_.
copyFrom
(m);
81
return
matrix_;
82
}
83
public
:
87
virtual
~LinearTransformation
() {
88
}
89
95
virtual
Matrix<Scalar>
const
&
matrix
()
const
{
96
return
matrix_;
97
}
98
104
virtual
Matrix<Scalar>
matrixInv
()
const
{
105
return
matrix_.
inverse
();
106
}
107
};
108
109
}
110
111
#endif // math_LinearTransformation_H__
meowpp
math
LinearTransformation.h
Generated on Fri Jun 6 2014 17:51:46 for Templates -- Meow by
1.8.3.1