Search in sources :

Example 36 with MatrixNd

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);
    }
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) Vector3d(maspack.matrix.Vector3d) MatrixNd(maspack.matrix.MatrixNd)

Example 37 with MatrixNd

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);
}
Also used : MatrixNd(maspack.matrix.MatrixNd) VectorNd(maspack.matrix.VectorNd)

Aggregations

MatrixNd (maspack.matrix.MatrixNd)37 Point3d (maspack.matrix.Point3d)9 VectorNd (maspack.matrix.VectorNd)9 SparseMatrixNd (maspack.matrix.SparseMatrixNd)4 Vector3d (maspack.matrix.Vector3d)4 LUDecomposition (maspack.matrix.LUDecomposition)3 RigidTransform3d (maspack.matrix.RigidTransform3d)2 SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)2 Point (artisynth.core.mechmodels.Point)1 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 PrintStream (java.io.PrintStream)1 StringReader (java.io.StringReader)1 Random (java.util.Random)1 CholeskyDecomposition (maspack.matrix.CholeskyDecomposition)1 DenseMatrix (maspack.matrix.DenseMatrix)1 Matrix (maspack.matrix.Matrix)1 Matrix3d (maspack.matrix.Matrix3d)1 Matrix6d (maspack.matrix.Matrix6d)1 Matrix6dBase (maspack.matrix.Matrix6dBase)1