MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FastMatrixElim.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FastMatrixElim
 

Functions

void sortByColumn (vector< unsigned int > &col, vector< double > &entry)
 

Function Documentation

void sortByColumn ( vector< unsigned int > &  col,
vector< double > &  entry 
)

Definition at line 223 of file FastMatrixElim.cpp.

Referenced by FastElim::shuffleRows(), FastMatrixElim::shuffleRows(), and testSorting().

224 {
225  unsigned int num = col.size();
226  assert( num == entry.size() );
227  // Stupid bubble sort, as we only have up to 5 entries and need to
228  // sort both the col and reorder the entries by the same sequence.
229  for ( unsigned int i = 0; i < num; ++i ) {
230  for ( unsigned int j = 1; j < num; ++j ) {
231  if ( col[j] < col[j-1] ) {
232  unsigned int temp = col[j];
233  col[j] = col[j-1];
234  col[j-1] = temp;
235  double v = entry[j];
236  entry[j] = entry[j-1];
237  entry[j-1] = v;
238  }
239  }
240  }
241 }

+ Here is the caller graph for this function: