@@ -37,9 +37,10 @@ public class TestNormCSV
3737 } ;
3838
3939 public static TempDir TEMP_DIR = new TempDir ( ) ;
40- public static FileInfo FILENAME = TEMP_DIR . CreateFile ( "norm.csv" ) ;
40+ public static FileInfo FILENAME1 = TEMP_DIR . CreateFile ( "norm1.csv" ) ;
41+ public static FileInfo FILENAME2 = TEMP_DIR . CreateFile ( "norm2.csv" ) ;
4142
42- private void Generate ( )
43+ private void Generate ( string filename )
4344 {
4445 IInputField a ;
4546 IInputField b ;
@@ -59,11 +60,11 @@ private void Generate()
5960 norm . AddOutputField ( new OutputFieldDirect ( c ) ) ;
6061 norm . AddOutputField ( new OutputFieldDirect ( d ) ) ;
6162 norm . AddOutputField ( new OutputFieldDirect ( e ) ) ;
62- norm . Storage = new NormalizationStorageCSV ( FILENAME . ToString ( ) ) ;
63+ norm . Storage = new NormalizationStorageCSV ( filename . ToString ( ) ) ;
6364 norm . Process ( ) ;
6465 }
6566
66- public DataNormalization Create ( double [ ] [ ] outputArray )
67+ public DataNormalization Create ( string filename , double [ ] [ ] outputArray )
6768 {
6869 IInputField a ;
6970 IInputField b ;
@@ -73,12 +74,12 @@ public DataNormalization Create(double[][] outputArray)
7374
7475 var norm = new DataNormalization ( ) ;
7576 norm . Report = new NullStatusReportable ( ) ;
76- norm . Storage = new NormalizationStorageCSV ( FILENAME . ToString ( ) ) ;
77- norm . AddInputField ( a = new InputFieldCSV ( false , FILENAME . ToString ( ) , 0 ) ) ;
78- norm . AddInputField ( b = new InputFieldCSV ( false , FILENAME . ToString ( ) , 1 ) ) ;
79- norm . AddInputField ( c = new InputFieldCSV ( false , FILENAME . ToString ( ) , 2 ) ) ;
80- norm . AddInputField ( d = new InputFieldCSV ( false , FILENAME . ToString ( ) , 3 ) ) ;
81- norm . AddInputField ( e = new InputFieldCSV ( false , FILENAME . ToString ( ) , 4 ) ) ;
77+ norm . Storage = new NormalizationStorageCSV ( filename . ToString ( ) ) ;
78+ norm . AddInputField ( a = new InputFieldCSV ( false , filename . ToString ( ) , 0 ) ) ;
79+ norm . AddInputField ( b = new InputFieldCSV ( false , filename . ToString ( ) , 1 ) ) ;
80+ norm . AddInputField ( c = new InputFieldCSV ( false , filename . ToString ( ) , 2 ) ) ;
81+ norm . AddInputField ( d = new InputFieldCSV ( false , filename . ToString ( ) , 3 ) ) ;
82+ norm . AddInputField ( e = new InputFieldCSV ( false , filename . ToString ( ) , 4 ) ) ;
8283 norm . AddOutputField ( new OutputFieldRangeMapped ( a , 0.1 , 0.9 ) ) ;
8384 norm . AddOutputField ( new OutputFieldRangeMapped ( b , 0.1 , 0.9 ) ) ;
8485 norm . AddOutputField ( new OutputFieldRangeMapped ( c , 0.1 , 0.9 ) ) ;
@@ -92,8 +93,8 @@ public DataNormalization Create(double[][] outputArray)
9293 public void TestGenerateAndLoad ( )
9394 {
9495 var outputArray = EngineArray . AllocateDouble2D ( 2 , 5 ) ;
95- Generate ( ) ;
96- DataNormalization norm = Create ( outputArray ) ;
96+ Generate ( FILENAME1 . ToString ( ) ) ;
97+ DataNormalization norm = Create ( FILENAME1 . ToString ( ) , outputArray ) ;
9798 norm . Process ( ) ;
9899 Check ( norm ) ;
99100 }
@@ -102,8 +103,8 @@ public void TestGenerateAndLoad()
102103 public void TestGenerateAndLoadSerial ( )
103104 {
104105 double [ ] [ ] outputArray = EngineArray . AllocateDouble2D ( 2 , 5 ) ;
105- Generate ( ) ;
106- DataNormalization norm = Create ( outputArray ) ;
106+ Generate ( FILENAME2 . ToString ( ) ) ;
107+ DataNormalization norm = Create ( FILENAME2 . ToString ( ) , outputArray ) ;
107108 norm = ( DataNormalization ) SerializeRoundTrip . RoundTrip ( norm ) ;
108109 norm . Process ( ) ;
109110 Check ( norm ) ;
0 commit comments