minor regularization of vectors and matrices

This commit is contained in:
Mathew Sutcliffe
2013-08-19 17:44:33 +01:00
parent f9f35f27d5
commit 5f267e8245
9 changed files with 72 additions and 177 deletions

View File

@@ -40,20 +40,6 @@ template<class ImplMatrix, int Rows, int Columns> void CMatrixBase<ImplMatrix, R
if (!valid) throw std::range_error("Row or column invalid");
}
/*
* All values to random value
*/
template<class ImplMatrix, int Rows, int Columns> void CMatrixBase<ImplMatrix, Rows, Columns>::setRandom()
{
for (int r = 0; r < Rows; r++)
{
for (int c = 0; c < Columns; c++)
{
this->m_matrix(r, c) = (qrand() % 101); // 0...100
}
}
}
/*
* All values zero?
*/
@@ -87,7 +73,7 @@ template<class ImplMatrix, int Rows, int Columns> void CMatrixBase<ImplMatrix, R
/*
* To list
*/
template<class ImplMatrix, int Rows, int Columns> const QList<double> CMatrixBase<ImplMatrix, Rows, Columns>::toList() const
template<class ImplMatrix, int Rows, int Columns> QList<double> CMatrixBase<ImplMatrix, Rows, Columns>::toList() const
{
QList<double> list;
for (int r = 0; r < Rows; r++)
@@ -116,22 +102,6 @@ template<class ImplMatrix, int Rows, int Columns> void CMatrixBase<ImplMatrix, R
}
}
/*
* All values equal?
*/
template<class ImplMatrix, int Rows, int Columns> bool CMatrixBase<ImplMatrix, Rows, Columns>::allValuesEqual() const
{
double v = this->getElement(0, 0);
for (int r = 0; r < Rows; r++)
{
for (int c = 0; c < Columns; c++)
{
if (this->m_matrix(r, c) != v) return false;
}
}
return true;
}
/*
* Round all values
*/