MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TestHSolve.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** copyright (C) 2003-2007 Upinder S. Bhalla, Niraj Dudani and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _TEST_HSOLVE_H
11 #define _TEST_HSOLVE_H
12 
13 void makeFullMatrix(
14  const vector< TreeNodeStruct >& tree,
15  double dt,
16  vector< vector< double > >& matrix );
17 
18 template< class T >
19 void permute(
20  vector< T >& g,
21  const vector< unsigned int >& permutation )
22 {
23  assert( g.size() == permutation.size() );
24 
25  vector< T > copy( g.size() );
26 
27  for ( unsigned int i = 0; i < g.size(); i++ )
28  copy[ permutation[ i ] ] = g[ i ];
29 
30  for ( unsigned int i = 0; i < g.size(); i++ )
31  g[ i ] = copy[ i ];
32 }
33 
34 #endif // _TEST_HSOLVE_H
void makeFullMatrix(const vector< TreeNodeStruct > &tree, double dt, vector< vector< double > > &matrix)
void permute(vector< T > &g, const vector< unsigned int > &permutation)
Definition: TestHSolve.h:19