JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
AffParamMatrix.java
Go to the documentation of this file.
1 package jarmos.affine;
2 
3 import org.apache.commons.math.linear.Array2DRowRealMatrix;
4 import org.apache.commons.math.linear.ArrayRealVector;
5 import org.apache.commons.math.linear.RealMatrix;
6 import org.apache.commons.math.linear.RealVector;
7 
18 public class AffParamMatrix {
19 
20  private RealMatrix matrices;
21  private IAffineCoefficients coeffs;
22  private int rowsize;
23 
24  public boolean isTimeDependent() {
25  return coeffs.isTimeDependent();
26  }
27 
28  public AffParamMatrix(RealMatrix matrices, int rowsize, IAffineCoefficients coeffs) {
29  this.matrices = matrices;
30  this.coeffs = coeffs;
31  this.rowsize = rowsize;
32  }
33 
43  public RealMatrix compose(double t, double[] mu) {
44  double[] c = coeffs.evaluateCoefficients(t, mu);
45  RealVector comp = new ArrayRealVector(matrices.operate(c));
46  int cols = comp.getDimension() / this.rowsize;
47  Array2DRowRealMatrix res = new Array2DRowRealMatrix(rowsize, cols);
48  for (int i = 0; i < cols; i++) {
49  RealVector tmp = comp.getSubVector(i * rowsize, rowsize);
50  res.setColumnVector(i, tmp);
51  }
52  return res;
53  }
54 }
RealMatrix compose(double t, double[] mu)
Performs the composition of the affine matrix given a time t and parameter .
Base class for implementation of a series of time/parameter-dependent affine coefficients.
AffParamMatrix(RealMatrix matrices, int rowsize, IAffineCoefficients coeffs)
Affine parametric matrix class.