@ContinuousIntegrationTest(estimatedDuration = 0.3) @Test(timeout=300000) public void testBackAndForthMatrix() { List<List<YoDouble>> yoArray = new ArrayList<List<YoDouble>>(); int nRows = 50; int nColumns = 60; String prefix = "test"; YoVariableRegistry registry = new YoVariableRegistry("test"); DenseMatrix64F matrix = new DenseMatrix64F(nRows, nColumns); Random random = new Random(1235612L); RandomMatrices.setRandom(matrix, random); DenseMatrix64F matrixBack = new DenseMatrix64F(nRows, nColumns); MatrixYoVariableConversionTools.populateYoVariablesMatrix(yoArray, nRows, nColumns, prefix, registry); MatrixYoVariableConversionTools.storeInYoVariablesMatrix(matrix, yoArray); MatrixYoVariableConversionTools.getFromYoVariablesMatrix(matrixBack, yoArray); EjmlUnitTests.assertEquals(matrix, matrixBack, 1e-12); }
public void configure(DenseMatrix64F F, DenseMatrix64F G, DenseMatrix64F H) { nStates.set(F.getNumRows()); nInputs.set(G.getNumCols()); nMeasurements.set(H.getNumRows()); if (doChecks) { MatrixTools.checkMatrixDimensions(F, nStates.getIntegerValue(), nStates.getIntegerValue()); MatrixTools.checkMatrixDimensions(G, nStates.getIntegerValue(), nInputs.getIntegerValue()); MatrixTools.checkMatrixDimensions(H, nMeasurements.getIntegerValue(), nStates.getIntegerValue()); } populateYoVariablesMatrix(yoF, F.getNumRows(), F.getNumCols(), "F", registry); populateYoVariablesMatrix(yoG, G.getNumRows(), G.getNumCols(), "G", registry); populateYoVariablesMatrix(yoH, H.getNumRows(), H.getNumCols(), "H", registry); populateYoVariablesVector(yoX, nStates.getIntegerValue(), "x", registry); populateYoVariablesSymmetricMatrix(yoP, nStates.getIntegerValue(), "P", registry); storeInYoVariablesMatrix(F, yoF); storeInYoVariablesMatrix(G, yoG); storeInYoVariablesMatrix(H, yoH); }
public void configure(DenseMatrix64F F, DenseMatrix64F G, DenseMatrix64F H) { nStates.set(F.getNumRows()); nInputs.set(G.getNumCols()); nMeasurements.set(H.getNumRows()); if (doChecks) { MatrixTools.checkMatrixDimensions(F, nStates.getIntegerValue(), nStates.getIntegerValue()); MatrixTools.checkMatrixDimensions(G, nStates.getIntegerValue(), nInputs.getIntegerValue()); MatrixTools.checkMatrixDimensions(H, nMeasurements.getIntegerValue(), nStates.getIntegerValue()); } populateYoVariablesMatrix(yoF, F.getNumRows(), F.getNumCols(), "F", registry); populateYoVariablesMatrix(yoG, G.getNumRows(), G.getNumCols(), "G", registry); populateYoVariablesMatrix(yoH, H.getNumRows(), H.getNumCols(), "H", registry); populateYoVariablesVector(yoX, nStates.getIntegerValue(), "x", registry); populateYoVariablesSymmetricMatrix(yoP, nStates.getIntegerValue(), "P", registry); storeInYoVariablesMatrix(F, yoF); storeInYoVariablesMatrix(G, yoG); storeInYoVariablesMatrix(H, yoH); }