From 05eeb09f365cd80b2cff70ac9542f5f9c308fca5 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 21 Feb 2014 16:11:49 -0500 Subject: [PATCH] Constify --- Base/include/MatrixBase.h | 2 +- Base/include/VectorBase.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Base/include/MatrixBase.h b/Base/include/MatrixBase.h index 9562766..ba431c1 100644 --- a/Base/include/MatrixBase.h +++ b/Base/include/MatrixBase.h @@ -73,7 +73,7 @@ namespace FasTC { // Matrix multiplication template - MatrixBase operator*(const MatrixBase<_T, nCols, nTarget> &m) { + MatrixBase MultiplyMatrix(const MatrixBase<_T, nCols, nTarget> &m) const { MatrixBase result; for(int r = 0; r < nRows; r++) for(int c = 0; c < nTarget; c++) { diff --git a/Base/include/VectorBase.h b/Base/include/VectorBase.h index c3df4b4..e313b90 100644 --- a/Base/include/VectorBase.h +++ b/Base/include/VectorBase.h @@ -198,7 +198,7 @@ namespace FasTC { MultSwitch(const TypeOne &a, const TypeTwo &b) : m_A(a), m_B(b) { } - ResultType GetMultiplication() { return m_A * m_B; } + ResultType GetMultiplication() const { return m_A * m_B; } }; template @@ -216,7 +216,7 @@ namespace FasTC { MultSwitch(const TypeOne &a, const TypeTwo &b) : m_A(a), m_B(b) { } - ResultType GetMultiplication() { return ScalarMultiply(m_B, m_A); } + ResultType GetMultiplication() const { return ScalarMultiply(m_B, m_A); } }; template @@ -234,7 +234,7 @@ namespace FasTC { MultSwitch(const TypeOne &a, const TypeTwo &b) : m_A(a), m_B(b) { } - ResultType GetMultiplication() { return ScalarMultiply(m_A, m_B); } + ResultType GetMultiplication() const { return ScalarMultiply(m_A, m_B); } }; template @@ -252,7 +252,7 @@ namespace FasTC { MultSwitch(const TypeOne &a, const TypeTwo &b) : m_A(a), m_B(b) { } - ResultType GetMultiplication() { return m_A.Dot(m_B); } + ResultType GetMultiplication() const { return m_A.Dot(m_B); } }; template