20 #pragma warning(disable: 4786)
159 for(
unsigned int i=0;i<
m_Order;i++)
179 for (i=0; i<this->
m_Order; i++)
182 for (j=0; j<currentRow.size(); j++)
200 this->InitializeMatrix(matrixIndex2);
202 for (r=0; r<this->m_Order; r++)
204 this->GetColumnsOfNonZeroMatrixElementsInRow(r, cols, matrixIndex1);
205 for(LinearSystemWrapper::ColumnArray::iterator c=cols.begin(); c != cols.end(); c++)
207 this->SetMatrixValue(r,*c,this->GetMatrixValue(r, *c, matrixIndex1), matrixIndex2);
219 for (r=0; r<this->m_Order; r++)
221 this->GetColumnsOfNonZeroMatrixElementsInRow(r, cols, matrixIndex2);
222 for(LinearSystemWrapper::ColumnArray::iterator c=cols.begin(); c != cols.end(); c++)
224 this->AddMatrixValue(r,*c,this->GetMatrixValue(r, *c, matrixIndex2), matrixIndex1);
231 ::CopyVector(
unsigned int vectorSource,
unsigned int vectorDestination)
234 for (r=0; r<this->m_Order; r++)
236 this->SetVectorValue(r,this->GetVectorValue(r, vectorSource), vectorDestination);
245 for (r=0; r<this->m_Order; r++)
247 this->AddVectorValue(r,this->GetVectorValue(r, vectorIndex2), vectorIndex1);
275 for (i=0; i<this->
m_Order; i++)
278 rowDegree[i] =
static_cast<unsigned int>( currentRow.size() - 1 );
279 reverseMapping[i] = this->
m_Order;
285 unsigned int lowestDegree = rowDegree[0];
287 for (i=1; i<this->
m_Order; i++)
289 if (rowDegree[i] < lowestDegree)
292 lowestDegree = rowDegree[i];
298 unsigned int nextRowNumber = 0;
299 reverseMapping[startingRow] = nextRowNumber++;
304 for (i=0; i<this->
m_Order; i++)
306 newNumbering[ reverseMapping[i] ] = i;
319 ColumnArray::iterator rowBufferIt;
320 ColumnArray::iterator nextRowsIt;
324 if (reverseMapping[rowNumber] > (this->
m_Order-1) )
334 for (nextRowsIt = nextRows.begin(); nextRowsIt != nextRows.end(); ++nextRowsIt)
336 if ( *nextRowsIt == rowNumber )
338 nextRows.erase(nextRowsIt);
344 if (nextRows.size() > 1)
346 for( i=0; i < (int)(nextRows.size()) - 1; i++ )
348 for( j=0; j < (int)(nextRows.size()) - 1 - i; j++ )
350 if ( rowDegree[nextRows[j+1]] < rowDegree[nextRows[j]] )
352 temp = nextRows[j+1];
353 nextRows[j+1] = nextRows[j];
361 while ( (nextRows.size() != 0 ) && (nextRowNumber < this->
m_Order) )
367 for (i=0; i<(int)(nextRows.size()); i++)
369 reverseMapping[ nextRows[i] ] = nextRowNumber++;
374 for (i=0; i<(int)(nextRows.size()); i++)
381 for (rowBufferIt = rowBuffer.begin(); rowBufferIt != rowBuffer.end(); ++rowBufferIt)
383 if (reverseMapping[*rowBufferIt] < this->m_Order )
385 rowBuffer.erase(rowBufferIt);
391 if (rowBuffer.size() > 1)
393 for( k=0; k < (int)(rowBuffer.size()) - 1; k++)
395 for( j=0; j < (int)(rowBuffer.size()) - 1-k; j++)
397 if ( rowDegree[rowBuffer[j+1]] < rowDegree[rowBuffer[j]] )
399 temp = rowBuffer[j+1];
400 rowBuffer[j+1] = rowBuffer[j];
408 unsigned int repeatFlag;
409 for( k=0; k < (int)(rowBuffer.size()); k++)
412 for( j=0; j < (int)(bufferArray.size()); j++)
414 if (bufferArray[j] == rowBuffer[k])
422 bufferArray.push_back(rowBuffer[k]);
429 nextRows = bufferArray;
452 buf <<
"Index of " << moreDescription <<
" out of bounds (" << index1 <<
")";
462 buf <<
"Index out of bounds (" << index1 <<
"," << index2 <<
")";