[ARITHMETIC OP][IMPLEMENTATION] rectifie dthe implementation of the unary - operator
This commit is contained in:
parent
ee3197a0a6
commit
721550d0f8
3 changed files with 6 additions and 5 deletions
|
|
@ -44,7 +44,7 @@ namespace rotgen
|
|||
|
||||
matrix_impl64& operator+=(matrix_impl64 const& rhs);
|
||||
matrix_impl64& operator-=(matrix_impl64 const& rhs);
|
||||
matrix_impl64& operator-();
|
||||
matrix_impl64 operator-() const;
|
||||
matrix_impl64& operator*=(matrix_impl64 const& rhs);
|
||||
matrix_impl64& operator*=(double d);
|
||||
matrix_impl64& operator/=(double d);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ namespace rotgen
|
|||
if constexpr(Cols != -1) assert(c == Cols && "Mismatched between dynamic and static column size");
|
||||
}
|
||||
|
||||
matrix(parent const& base) : parent(base) {}
|
||||
|
||||
matrix(std::initializer_list<std::initializer_list<Scalar>> init) : parent(init)
|
||||
{
|
||||
if constexpr(Rows != -1) assert(init.size() == Rows && "Mismatched between dynamic and static row size");
|
||||
|
|
@ -75,9 +77,9 @@ namespace rotgen
|
|||
return *this;
|
||||
}
|
||||
|
||||
matrix& operator-()
|
||||
matrix operator-() const
|
||||
{
|
||||
return static_cast<parent const&>(*this).operator-();
|
||||
return matrix(static_cast<parent const&>(*this).operator-());
|
||||
}
|
||||
|
||||
matrix& operator*=(matrix const& rhs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue