-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestHSolve.h
34 lines (27 loc) · 971 Bytes
/
TestHSolve.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**********************************************************************
** This program is part of 'MOOSE', the
** Messaging Object Oriented Simulation Environment.
** copyright (C) 2003-2007 Upinder S. Bhalla, Niraj Dudani and NCBS
** It is made available under the terms of the
** GNU Lesser General Public License version 2.1
** See the file COPYING.LIB for the full notice.
**********************************************************************/
#ifndef _TEST_HSOLVE_H
#define _TEST_HSOLVE_H
void makeFullMatrix(
const vector< TreeNodeStruct >& tree,
double dt,
vector< vector< double > >& matrix );
template< class T >
void permute(
vector< T >& g,
const vector< unsigned int >& permutation )
{
assert( g.size() == permutation.size() );
vector< T > copy( g.size() );
for ( unsigned int i = 0; i < g.size(); i++ )
copy[ permutation[ i ] ] = g[ i ];
for ( unsigned int i = 0; i < g.size(); i++ )
g[ i ] = copy[ i ];
}
#endif // _TEST_HSOLVE_H