We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6f4da9 commit 14a27b5Copy full SHA for 14a27b5
1 file changed
src/main/java/com/jdoe/algorithms/BuildRegressionMatrix.java
@@ -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