mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
minor regularization of vectors and matrices
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user