Basics unit tests found some bugs!
This commit is contained in:
parent
1f01de6393
commit
a5f451a120
3 changed files with 72 additions and 68 deletions
|
@ -165,7 +165,7 @@ bool
|
|||
Matrix<N,M>::operator==(const Matrix<N,M>& rhs)
|
||||
const
|
||||
{
|
||||
for (int i = 0; i < N*M; i++) {
|
||||
for (UInt i = 0; i < N*M; i++) {
|
||||
/* TODO: Use NearlyEqual. */
|
||||
if (mData[i] != rhs.mData[i]) {
|
||||
return false;
|
||||
|
@ -254,7 +254,7 @@ Matrix<N,M>::operator*(Matrix<M,P> rhs)
|
|||
/* Each cell is Sigma(k=0, M)(lhs[ik] * rhs[kj]) */
|
||||
result(i, j) = 0.0;
|
||||
for (UInt k = 0; k < M; k++) {
|
||||
result(i, j) += mData[i*N + k] * rhs(k*P, j);
|
||||
result(i, j) += mData[i*N + k] * rhs(k, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ Vector4
|
|||
Vector4::operator*(const Double& rhs)
|
||||
const
|
||||
{
|
||||
return static_cast<Vector4&&>(*this * rhs);
|
||||
return static_cast<Matrix<4,1>>(*this) * rhs;
|
||||
}
|
||||
|
||||
|
||||
|
@ -182,7 +182,7 @@ Double
|
|||
Vector4::Dot(const Vector4& rhs)
|
||||
const
|
||||
{
|
||||
return mData[0] * rhs.mData[0] + mData[1] * rhs.mData[1] + mData[2] + rhs.mData[2];
|
||||
return mData[0] * rhs.mData[0] + mData[1] * rhs.mData[1] + mData[2] * rhs.mData[2];
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue