/** * Assigns the element in the Matrix to the specified value. Performs a bounds check to make sure * the requested element is part of the matrix. * * @param row The row of the element. * @param col The column of the element. * @param value The element's new value. */ public void set( int row , int col , double value ) { mat.set(row,col,value); }
public static void setMatrixFromOneBasedArray(DenseMatrix64F ret, double[] oneBasedArray) { for (int i = 0; i < oneBasedArray.length - 1; i++) { ret.set(i, 0, oneBasedArray[i + 1]); } }
private void setDoubleDerivativeConstraint(int row, double xValue, double yValue) { double x_n = 1.0; constraintMatrix.set(row, coefficients.length - 1, 0.0); constraintMatrix.set(row, coefficients.length - 2, 0.0); for (int column = coefficients.length - 3; column >= 0; column--) { constraintMatrix.set(row, column, (coefficients.length - column - 1) * (coefficients.length - column - 2) * x_n); x_n *= xValue; } constraintVector.set(row, yValue); }
@Override public void invert(DenseMatrix64F A_inv) { A_inv.set(pseudoInverse); }
/** * This function performs sanity check on the input for decompose and sets up the QR matrix. * * @param A */ protected void commonSetup(DenseMatrix64F A) { setExpectedMaxSize(A.numRows,A.numCols); QR.set(A); }
public static void numericallyDifferentiate(DenseMatrix64F derivativeToPack, DenseMatrix64F previousMatrixToUpdate, DenseMatrix64F newMatrix, double dt) { derivativeToPack.set(newMatrix); CommonOps.subtractEquals(derivativeToPack, previousMatrixToUpdate); CommonOps.scale(1.0 / dt, derivativeToPack); previousMatrixToUpdate.set(newMatrix); }
public static void setDenseMatrixFromMatrix3d(int startRow, int startColumn, Matrix3d fromMatrix3d, DenseMatrix64F denseMatrix) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { denseMatrix.set(i + startRow, j + startColumn, fromMatrix3d.getElement(i, j)); } } }
@Override public void getConfigurationMatrix(DenseMatrix64F matrix, int rowStart) { RotationTools.convertQuaternionToYawPitchRoll(jointRotation, yawPitchRoll); int index = rowStart; matrix.set(index++, 0, yawPitchRoll[1]); matrix.set(index++, 0, jointTranslation.getX()); matrix.set(index++, 0, jointTranslation.getZ()); }
/** {@inheritDoc} */ @Override public boolean setA(DenseMatrix64F A) { this.A.set(A); matrixSize = A.getNumRows(); return true; }
public static void setMatrixColumnToVector(int columnIndex, DenseMatrix64F Matrix, DenseMatrix64F vector) { for (int i = 0; i < Matrix.getNumRows(); i++) { Matrix.set(i, columnIndex, vector.get(i, columnIndex)); } }
public static void getFromYoVariablesMatrix(DenseMatrix64F m, List<List<YoDouble>> yoM) { for (int i = 0; i < m.getNumRows(); i++) { List<YoDouble> row = yoM.get(i); for (int j = 0; j < m.getNumCols(); j++) { m.set(i, j, row.get(j).getDoubleValue()); } } }
public static void getFromYoVariablesMatrix(DenseMatrix64F m, List<List<DoubleYoVariable>> yoM) { for (int i = 0; i < m.getNumRows(); i++) { List<DoubleYoVariable> row = yoM.get(i); for (int j = 0; j < m.getNumCols(); j++) { m.set(i, j, row.get(j).getDoubleValue()); } } }
@Override public boolean decompose(DenseMatrix64F orig) { A.set(orig); symmetric = MatrixFeatures.isSymmetric(A,tol); return symmetric ? symmetricAlg.decompose(A) : generalAlg.decompose(A); }
public static void getFromYoVariables(DenseMatrix64F m, YoDouble[][] yoM) { for (int i = 0; i < m.getNumRows(); i++) { for (int j = 0; j < m.getNumCols(); j++) { m.set(i, j, yoM[i][j].getDoubleValue()); } } }
public static void getFromYoVariables(DenseMatrix64F m, DoubleYoVariable[][] yoM) { for (int i = 0; i < m.getNumRows(); i++) { for (int j = 0; j < m.getNumCols(); j++) { m.set(i, j, yoM[i][j].getDoubleValue()); } } }
@Override public void getVelocityMatrix(DenseMatrix64F matrix, int rowStart) { MathTools.checkIfInRange(matrix.getNumRows(), 1, Integer.MAX_VALUE); MathTools.checkIfInRange(matrix.getNumCols(), 1, Integer.MAX_VALUE); matrix.set(rowStart, 0, qd); }