-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNormalizeElement.java
More file actions
27 lines (23 loc) · 813 Bytes
/
NormalizeElement.java
File metadata and controls
27 lines (23 loc) · 813 Bytes
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
package operations;
public class NormalizeElement extends AbstractOperation{
/*
Operation E[i][j] represents multiplying element by normalization factor.
M[i][j] = factor*M[i][j]
*/
private final int column;
public NormalizeElement(double[][] matrix, Double[][] eliminationFactors, Double[] normalizationFactors, int sourceRow, int column){
super(matrix, eliminationFactors, normalizationFactors);
this.sourceRow = sourceRow;
this.column = column;
this.operationSymbol = 'E';
}
@Override
public Void call() {
matrix[sourceRow][column] *= normalizationFactors[sourceRow];
return null;
}
@Override
public String toString(){
return "%c(%d, %d)".formatted(operationSymbol, sourceRow, column);
}
}