MATH: Make some global functions static function members.
This commit is contained in:
parent
59d219c955
commit
1ae91bd8a9
2 changed files with 22 additions and 21 deletions
|
@ -46,6 +46,11 @@ public:
|
|||
inline void setValue(int i, float val) { value(i) = val; }
|
||||
inline float getValue(int i) const { return value(i); }
|
||||
|
||||
template<int d>
|
||||
inline static float dotProduct(const Vector(d) &v1, const Vector(d) &v2) {
|
||||
return v1.getDotProduct(v2);
|
||||
}
|
||||
|
||||
protected:
|
||||
MatrixType() : MatrixBase<dim, 1>() { }
|
||||
MatrixType(float *data) : MatrixBase<dim, 1>(data) { }
|
||||
|
@ -98,11 +103,6 @@ float MatrixType<dim, 1>::getDotProduct(const Vector(dim) &v) const {
|
|||
return result;
|
||||
}
|
||||
|
||||
template<int dim>
|
||||
inline float dot(const Vector(dim) &v1, const Vector(dim) &v2) {
|
||||
return v1.getDotProduct(v2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<int dim>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue