/* 582 */ int index = this.currentIndex;
/* 583 */ long time_basis = this.readings[index].time;
/* */
/* 586 */ time -= time_basis;
/* */
/* 588 */ GMatrix A = new GMatrix(num_readings, order + 1);
/* */
/* 590 */ for (int i = 0; i < num_readings; i++) {
/* 591 */ A.setElement(i, 0, 1.0D);
/* 592 */ long tempTime = lastTimeRelative(num_readings - i - 1, index, time_basis);
/* 593 */ A.setElement(i, 1, tempTime);
/* 594 */ for (int j = 2; j <= order; j++)
/* */ {
/* 596 */ A.setElement(i, j, powerAndDiv(tempTime, j));
/* */ }
/* */ }
/* */
/* 600 */ GMatrix A_Transpose = new GMatrix(A);
/* 601 */ A_Transpose.transpose();
/* 602 */ GMatrix M = new GMatrix(order + 1, order + 1);
/* 603 */ M.mul(A_Transpose, A);
/* */ try {
/* 605 */ M.invert();
/* */ } catch (SingularMatrixException e) {
/* 607 */ System.out.println("SINGULAR MATRIX EXCEPTION in prediction");
/* 608 */ System.out.println(M);
/* */ }
/* */
/* 612 */ double[] transformArray = new double[16];
/* 613 */ GMatrix solMatrix = new GMatrix(order + 1, num_readings);
/* 614 */ solMatrix.mul(M, A_Transpose);
/* */
/* 616 */ GVector P = new GVector(order + 1);
/* */
/* 619 */ GVector predTimeVec = new GVector(order + 1);
/* 620 */ predTimeVec.setElement(0, 1.0D);