use of maspack.matrix.MatrixNd in project artisynth_core by artisynth.
the class SphericalJointForceBound method frameToGlobal.
/**
* Transforms the bound vectors back into global coordinates.
*/
protected void frameToGlobal() {
N = new MatrixNd(NFrame.rowSize(), 3);
RigidTransform3d R = frame.getPose();
for (int i = 0; i < NFrame.rowSize(); i++) {
// Get the values from the i'th row of NFrame
double[] d = new double[3];
NFrame.getRow(i, d);
// Create a vector from the row and transform it back to global
Vector3d vGlobal = new Vector3d(d);
vGlobal.transform(R);
// Add it to N (which is used to solve)
N.setRow(i, vGlobal);
}
}
use of maspack.matrix.MatrixNd in project artisynth_core by artisynth.
the class LeastSquaresSolver method resizeVariables.
public void resizeVariables(int costRowSize, int conRowSize, int exSize) {
this.costRowSize = costRowSize;
this.conRowSize = conRowSize;
this.exSize = exSize;
Q = new MatrixNd(exSize, exSize);
f = new VectorNd(exSize);
x = new VectorNd(exSize);
x0 = new VectorNd(exSize);
int boundsSize = resetBounds();
A = new MatrixNd(boundsSize, exSize);
b = new VectorNd(boundsSize);
}
Aggregations