public DenseMatrix64F getState() { int nStates = this.nStates.getIntegerValue(); x.reshape(nStates, 1); getFromYoVariablesVector(x, yoX); return x; }
public DenseMatrix64F getState() { int nStates = this.nStates.getIntegerValue(); x.reshape(nStates, 1); getFromYoVariablesVector(x, yoX); return x; }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout=300000) public void testBackAndForthVector() { List<YoDouble> yoArray = new ArrayList<YoDouble>(); int size = 50; String prefix = "test"; YoVariableRegistry registry = new YoVariableRegistry("test"); DenseMatrix64F matrix = new DenseMatrix64F(size, 1); Random random = new Random(1235612L); RandomMatrices.setRandom(matrix, random); DenseMatrix64F matrixBack = new DenseMatrix64F(size, 1); MatrixYoVariableConversionTools.populateYoVariablesVector(yoArray, size, prefix, registry); MatrixYoVariableConversionTools.storeInYoVariablesVector(matrix, yoArray); MatrixYoVariableConversionTools.getFromYoVariablesVector(matrixBack, yoArray); EjmlUnitTests.assertEquals(matrix, matrixBack, 1e-12); }
private void getVariablesForUpdateFromYoVariables() { int nMeasurements = this.nMeasurements.getIntegerValue(); int nStates = this.nStates.getIntegerValue(); H.reshape(nMeasurements, nStates); R.reshape(nMeasurements, nMeasurements); x.reshape(nStates, 1); P.reshape(nStates, nStates); getFromYoVariablesMatrix(H, yoH); getFromYoVariablesSymmetric(R, yoR); getFromYoVariablesVector(x, yoX); getFromYoVariablesSymmetric(P, yoP); }
private void getVariablesForUpdateFromYoVariables() { int nMeasurements = this.nMeasurements.getIntegerValue(); int nStates = this.nStates.getIntegerValue(); H.reshape(nMeasurements, nStates); R.reshape(nMeasurements, nMeasurements); x.reshape(nStates, 1); P.reshape(nStates, nStates); getFromYoVariablesMatrix(H, yoH); getFromYoVariablesSymmetric(R, yoR); getFromYoVariablesVector(x, yoX); getFromYoVariablesSymmetric(P, yoP); }
private void getVariablesForPredictFromYoVariables() { int nStates = this.nStates.getIntegerValue(); int nInputs = this.nInputs.getIntegerValue(); F.reshape(nStates, nStates); G.reshape(nStates, nInputs); Q.reshape(nStates, nStates); x.reshape(nStates, 1); P.reshape(nStates, nStates); getFromYoVariablesMatrix(F, yoF); getFromYoVariablesMatrix(G, yoG); getFromYoVariablesSymmetric(Q, yoQ); getFromYoVariablesVector(x, yoX); getFromYoVariablesSymmetric(P, yoP); }
private void getVariablesForPredictFromYoVariables() { int nStates = this.nStates.getIntegerValue(); int nInputs = this.nInputs.getIntegerValue(); F.reshape(nStates, nStates); G.reshape(nStates, nInputs); Q.reshape(nStates, nStates); x.reshape(nStates, 1); P.reshape(nStates, nStates); getFromYoVariablesMatrix(F, yoF); getFromYoVariablesMatrix(G, yoG); getFromYoVariablesSymmetric(Q, yoQ); getFromYoVariablesVector(x, yoX); getFromYoVariablesSymmetric(P, yoP); }