1 /**********************************************************************
3 FILENAME: uiuc_menu_functions.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: provides common functions used by different menu
10 ----------------------------------------------------------------------
14 ----------------------------------------------------------------------
18 ----------------------------------------------------------------------
20 HISTORY: 04/04/2003 initial release
21 06/30/2003 (RD) replaced istrstream with istringstream
22 to get rid of the annoying warning about
23 using the strstream header
25 ----------------------------------------------------------------------
27 AUTHOR(S): Robert Deters <rdeters@uiuc.edu>
28 Michael Selig <m-selig@uiuc.edu>
30 ----------------------------------------------------------------------
34 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
42 ----------------------------------------------------------------------
44 CALLED BY: uiuc_menu_XX()
46 ----------------------------------------------------------------------
50 ----------------------------------------------------------------------
52 COPYRIGHT: (C) 2003 by Michael Selig
54 This program is free software; you can redistribute it and/or
55 modify it under the terms of the GNU General Public License
56 as published by the Free Software Foundation.
58 This program is distributed in the hope that it will be useful,
59 but WITHOUT ANY WARRANTY; without even the implied warranty of
60 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 GNU General Public License for more details.
63 You should have received a copy of the GNU General Public License
64 along with this program; if not, write to the Free Software
65 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
67 **********************************************************************/
69 #include "uiuc_menu_functions.h"
71 bool check_float( const string &token)
74 istringstream stream(token.c_str());
75 return (stream >> value);
78 void d_2_to_3( double array2D[100][100], double array3D[][100][100], int index3D)
80 for (register int i=0; i<=99; i++)
82 for (register int j=1; j<=99; j++)
84 array3D[index3D][i][j]=array2D[i][j];
89 void d_1_to_2( double array1D[100], double array2D[][100], int index2D)
91 for (register int i=0; i<=99; i++)
93 array2D[index2D][i]=array1D[i];
97 void d_1_to_1( double array1[100], double array2[100] )
99 for (register int i=0; i<=99; i++)
105 void i_1_to_2( int array1D[100], int array2D[][100], int index2D)
107 for (register int i=0; i<=99; i++)
109 array2D[index2D][i]=array1D[i];