Skip to content

Commit 14a27b5

Browse files
author
nofa
committed
regression matrix changes
1 parent c6f4da9 commit 14a27b5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.jdoe.algorithms;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
//Build a regression matrix using a DOE matrix and a list of monomials.
7+
public class BuildRegressionMatrix {
8+
9+
public static List< Integer > grep ( String pattern, String data ) {
10+
String[] dataArray = data.split( "" );
11+
List< Integer > occouranceIndexes = new ArrayList<>();
12+
for ( int i = 0; dataArray.length > i; i++ ) {
13+
if ( data.substring( i, i + pattern.length() ).equalsIgnoreCase( pattern ) ) {
14+
occouranceIndexes.add( i );
15+
}
16+
}
17+
return occouranceIndexes;
18+
}
19+
20+
}

0 commit comments

Comments
 (0)