Compuets the Hessian in block form
@param jacLeft (Input) Left side of Jacobian
@param jacRight (Input) Right side of Jacobian
776373
@Override
	public void computeHessian(DMatrixRMaj jacLeft , DMatrixRMaj jacRight) {
		A.reshape(jacLeft.numCols,jacLeft.numCols);
		B.reshape(jacLeft.numCols,jacRight.numCols);
		D.reshape(jacRight.numCols,jacRight.numCols);

		// take advantage of the inner product's symmetry when possible to reduce
		// the number of calculations
		MatrixMultProduct_DDRM.inner_reorder_lower(jacLeft,A);
		CommonOps_DDRM.symmLowerToFull(A);
		CommonOps_DDRM.multTransA(jacLeft,jacRight,B);
		MatrixMultProduct_DDRM.inner_reorder_lower(jacRight,D);
		CommonOps_DDRM.symmLowerToFull(D);
	}
18220
private static void calculateThresholdForBlock(byte[] luminances,
                                                 int subWidth,
                                                 int subHeight,
                                                 int width,
                                                 int height,
                                                 int[][] blackPoints,
                                                 BitMatrix matrix) {
    int maxYOffset = height - BLOCK_SIZE;
    int maxXOffset = width - BLOCK_SIZE;
    for (int y = 0; y < subHeight; y++) {
      int yoffset = y << BLOCK_SIZE_POWER;
      if (yoffset > maxYOffset) {
        yoffset = maxYOffset;
      }
      int top = cap(y, 2, subHeight - 3);
      for (int x = 0; x < subWidth; x++) {
        int xoffset = x << BLOCK_SIZE_POWER;
        if (xoffset > maxXOffset) {
          xoffset = maxXOffset;
        }
        int left = cap(x, 2, subWidth - 3);
        int sum = 0;
        for (int z = -2; z <= 2; z++) {
          int[] blackRow = blackPoints[top + z];
          sum += blackRow[left - 2] + blackRow[left - 1] + blackRow[left] + blackRow[left + 1] + blackRow[left + 2];
        }
        int average = sum / 25;
        thresholdBlock(luminances, xoffset, yoffset, average, width, matrix);
      }
    }
  }
1099946
private void rightFringe(
    DeleteStack.Linearizer       lxx,
    DeleteStack.FringeNote      xx,
    InsertStack   istack,
    GBSNode       f,
    GBSNode       g,
    boolean       gLeft)
  {

    GBSNode w = f.leftChild();     /* The left brother of delete fringe     */
    GBSNode s = f.rightChild();    /* t0 fringe from which we deleted       */
    int fbalance = f.balance();
    f.clearBalance();
    if (w == null)                 /* There is no left brother              */
      {
        boolean bLeft = true;
        if (g.rightChild() == f) {
          bLeft = false;
        }
        f.setRightChild(linearize(lxx, s));
        int maxBal = f.kFactor() - 1;
        if (maxBal < 3) {
          maxBal = 3;
        }
        istack.start(g, "GBSDeleteFringe.rightFringe");
        istack.setNode(1, null);
        istack.resetBalancePointIndex();
        int fpidx = 1;
        GBSInsertFringe.singleInstance().balance(
                      g.kFactor(), istack, f, fpidx, maxBal);
        xx.newg = g;
        if (bLeft) {
          xx.newf = g.leftChild();
        }
        else {
          xx.newf = g.rightChild();
        }
        xx.depthDecrease = true;
      }
    else                           /* There is a left brother               */
      {                            /* Elevate the left brother to the       */
        xx.newg = g;               /*  position of the current father.      */
        if (g.leftChild() == f) {  /*  This is an LL rotation to make up    */
          g.setLeftChild(w);       /*  for the disappearance of the         */
        }                          /*  right brother.                       */
        else {
          g.setRightChild(w);
        }
        f.setLeftChild(null);
        GBSNode p = w.rightMostChild();
        f.setRightChild(linearize(lxx, s));/* [f, s]                        */
        combine(p, f);             /* Now [w, f, s]. lastFringe cleans up   */
        xx.newf = w;               /* Remember new father                   */
        rightDepth(xx, fbalance);  /* Check for depth decrease              */
      }
  }
391509
def jacobian(expr, symbols):
    
    jac = []
    for symbol in symbols:
        # Differentiate to every param
        f = sympy.diff(expr, symbol)
        jac.append(f)
    return jac
1286958
function(x,y,z){
        this.linearVelocity.init();
        this.angularVelocity.init();
        this.position.init(x*OIMO.INV_SCALE,y*OIMO.INV_SCALE,z*OIMO.INV_SCALE);
        this.awake();
    }
842137
public void EBEsMat3DL_iRig_jRig(int e) throws JMetalException{
    // The element element 3D than form rigid matrix in the local coordinates
    // i: rigid
    // j: rigid
    // esfuerzos en nudo j por reacciÃƒÂ³n de desplazamientos en i + esfuerzo en i
    // double [][]Kii = new double [5][5];
    // Elements
    // the Element long
    double Lij=Element_[e][L_];
    // Secction
    int idx = (int)Element_[e][INDEX_];
    double S=Groups_[idx][AREA];
    // inertia in axis local z
    double Iz=Groups_[idx][Iz_];
    // inertia in axis local y
    double Iy=Groups_[idx][Iy_];
    // inertia torsion
    double Ip=Groups_[idx][It_];
    // elastic modulus (Young)
    double E=Groups_[idx][E_];
    //  elastic transversal modulus
    double G=Groups_[idx][G_];
    // esfuerzos en nudo j por reacciÃƒÂ³n de desplazamientos en i + esfuerzo en i
    Kii[0][0] = E * S / Lij;
    Kii[0][1] = 0;
    Kii[0][2] = 0;
    Kii[0][3] = 0;
    Kii[0][4] = 0;
    Kii[0][5] = 0;
    Kii[1][0] = 0;
    Kii[1][1] = 12 * E * Iz / Math.pow(Lij, 3);
    Kii[1][2] = 0;
    Kii[1][3] = 0;
    Kii[1][4] = 0;
    Kii[1][5] = -6 * E * Iz / Math.pow(Lij, 2);
    Kii[2][0] = 0;
    Kii[2][1] = 0;
    Kii[2][2] = 12 * E * Iy / Math.pow(Lij, 3);
    Kii[2][3] = 0;
    Kii[2][4] = 6 * E * Iy / Math.pow(Lij, 2);
    Kii[2][5] = 0;
    Kii[3][0] = 0;
    Kii[3][1] = 0;
    Kii[3][2] = 0;
    Kii[3][3] = G * Ip / Lij;
    Kii[3][4] = 0;
    Kii[3][5] = 0;
    Kii[4][0] = 0;
    Kii[4][1] = 0;
    Kii[4][2] = 6 * E * Iy / Math.pow(Lij, 2);
    Kii[4][3] = 0;
    Kii[4][4] = 4 * E * Iy / Lij;
    Kii[4][5] = 0;
    Kii[5][0] = 0;
    Kii[5][1] = -6 * E * Iz / Math.pow(Lij, 2);
    Kii[5][2] = 0;
    Kii[5][3] = 0;
    Kii[5][4] = 0;
    Kii[5][5] = 4 * E * Iz / Lij;

    // esfuerzos en nudo i por reacciÃƒÂ³n de desplazamientos en j
    Kij[0][0] = E * S / Lij;
    Kij[0][1] = 0;
    Kij[0][2] = 0;
    Kij[0][3] = 0;
    Kij[0][4] = 0;
    Kij[0][5] = 0;
    Kij[1][0] = 0;
    Kij[1][1] = 12 * E * Iz / Math.pow(Lij, 3);
    Kij[1][2] = 0;
    Kij[1][3] = 0;
    Kij[1][4] = 0;
    Kij[1][5] = -6 * E * Iz / Math.pow(Lij, 2);
    Kij[2][0] = 0;
    Kij[2][1] = 0;
    Kij[2][2] = -12 * E * Iy / Math.pow(Lij, 3);
    Kij[2][3] = 0;
    Kij[2][4] = -6 * E * Iy / Math.pow(Lij, 2);
    Kij[2][5] = 0;
    Kij[3][0] = 0;
    Kij[3][1] = 0;
    Kij[3][2] = 0;
    Kij[3][3] = G * Ip / Lij;
    Kij[3][4] = 0;
    Kij[3][5] = 0;
    Kij[4][0] = 0;
    Kij[4][1] = 0;
    Kij[4][2] = -6 * E * Iy / Math.pow(Lij, 2);
    Kij[4][3] = 0;
    Kij[4][4] = -2 * E * Iy / Lij;
    Kij[4][5] = 0;
    Kij[5][0] = 0;
    Kij[5][1] = -6 * E * Iz / Math.pow(Lij, 2);
    Kij[5][2] = 0;
    Kij[5][3] = 0;
    Kij[5][4] = 0;
    Kij[5][5] = 2 * E * Iz / Lij;

    // esfuerzos en nudo j por reacciÃƒÂ³n de desplazamientos en i
    Kji[0][0] = E * S / Lij;
    Kji[0][1] = 0;
    Kji[0][2] = 0;
    Kji[0][3] = 0;
    Kji[0][4] = 0;
    Kji[0][5] = 0;
    Kji[1][0] = 0;
    Kji[1][1] = 12 * E * Iz / Math.pow(Lij, 3);
    Kji[1][2] = 0;
    Kji[1][3] = 0;
    Kji[1][4] = 0;
    Kji[1][5] = -6 * E * Iz / Math.pow(Lij, 2);
    Kji[2][0] = 0;
    Kji[2][1] = 0;
    Kji[2][2] = -12 * E * Iy / Math.pow(Lij, 3);
    Kji[2][3] = 0;
    Kji[2][4] = -6 * E * Iy / Math.pow(Lij, 2);
    Kji[2][5] = 0;
    Kji[3][0] = 0;
    Kji[3][1] = 0;
    Kji[3][2] = 0;
    Kji[3][3] = G * Ip / Lij;
    Kji[3][4] = 0;
    Kji[3][5] = 0;
    Kji[4][0] = 0;
    Kji[4][1] = 0;
    Kji[4][2] = -6 * E * Iy / Math.pow(Lij, 2);
    Kji[4][3] = 0;
    Kji[4][4] = -2 * E * Iy / Lij;
    Kji[4][5] = 0;
    Kji[5][0] = 0;
    Kji[5][1] = -6 * E * Iz / Math.pow(Lij, 2);
    Kji[5][2] = 0;
    Kji[5][3] = 0;
    Kji[5][4] = 0;
    Kji[5][5] = 2 * E * Iz / Lij;

    // esfuerzos en nudo i por reacciÃƒÂ³n de desplazamientos en j + esfuerzo en j
    Kjj[0][0] = E * S / Lij;
    Kjj[0][1] = 0;
    Kjj[0][2] = 0;
    Kjj[0][3] = 0;
    Kjj[0][4] = 0;
    Kjj[0][5] = 0;
    Kjj[1][0] = 0;
    Kjj[1][1] = 12 * E * Iz / Math.pow(Lij, 3);
    Kjj[1][2] = 0;
    Kjj[1][3] = 0;
    Kjj[1][4] = 0;
    Kjj[1][5] = -6 * E * Iz / Math.pow(Lij, 2);
    Kjj[2][0] = 0;
    Kjj[2][1] = 0;
    Kjj[2][2] = 12 * E * Iy / Math.pow(Lij, 3);
    Kjj[2][3] = 0;
    Kjj[2][4] = 6 * E * Iy / Math.pow(Lij, 2);
    Kjj[2][5] = 0;
    Kjj[3][0] = 0;
    Kjj[3][1] = 0;
    Kjj[3][2] = 0;
    Kjj[3][3] = G * Ip / Lij;
    Kjj[3][4] = 0;
    Kjj[3][5] = 0;
    Kjj[4][0] = 0;
    Kjj[4][1] = 0;
    Kjj[4][2] = 6 * E * Iy / Math.pow(Lij, 2);
    Kjj[4][3] = 0;
    Kjj[4][4] = 4 * E * Iy / Lij;
    Kjj[4][5] = 0;
    Kjj[5][0] = 0;
    Kjj[5][1] = -6 * E * Iz / Math.pow(Lij, 2);
    Kjj[5][2] = 0;
    Kjj[5][3] = 0;
    Kjj[5][4] = 0;
    Kjj[5][5] = 4 * E * Iz / Lij;

    // PrintArchTxtMKLB(e);

  }
427087
private void jTreeGraph1MouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jTreeGraph1MouseClicked
    {//GEN-HEADEREND:event_jTreeGraph1MouseClicked
        if (evt.getClickCount() == 2) {
            TreePath[] paths = jTreeGraph1.getSelectionPaths();
            if (paths != null && paths.length == 1) {
                if (paths[0].getPath().length == 3) {
                    addItemsToComposite(paths);
                }
            }
        }
    }
886626
@Override
    public void setExpectedMaxSize( int numRows , int numCols ) {
        super.setExpectedMaxSize(numRows,numCols);

        // if the matrix that is being decomposed is smaller than the block we really don't
        // see the B matrix.
        if( numRows < blockWidth)
            B = new DMatrixRMaj(0,0);
        else
            B = new DMatrixRMaj(blockWidth,maxWidth);

        chol = new CholeskyBlockHelper_DDRM(blockWidth);
    }
319073
private void jCheckBoxPaintGradientActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jCheckBoxPaintGradientActionPerformed
    {//GEN-HEADEREND:event_jCheckBoxPaintGradientActionPerformed
        parent.getGraphPanelChart().getChartSettings().setDrawGradient(jCheckBoxPaintGradient.isSelected());
        refreshGraphPreview();
    }
943293
public void vertex(double x, double y) {
        MODE = LINES;
        this.x.add(x);
        this.y.add(y);
        colors.add(this.strokeColor);
        calcG();
    }
472941
def jac(x,a):
    
    return (x-a) / np.sqrt(((x-a)**2).sum(1))[:,np.newaxis]
89135
public void init( DMatrixRMaj A ) {
        if( A.numRows != A.numCols)
            throw new IllegalArgumentException("Must be square");

        if( A.numCols != N ) {
            N = A.numCols;
            QT.reshape(N,N, false);

            if( w.length < N ) {
                w = new double[ N ];
                gammas = new double[N];
                b = new double[N];
            }
        }

        // just copy the top right triangle
        QT.set(A);
    }
1179147
public void setTrifocal(TrifocalTensor tensor ) {
		this.tensor = tensor;
		extract.setTensor(tensor);
		extract.extractFundmental(F21,F31);
	}
1179920
public static void multTransA_vecCol(final int blockLength ,
                                         DSubmatrixD1 A , DSubmatrixD1 B ,
                                         DSubmatrixD1 C )
    {
        int widthA = A.col1 - A.col0;
        if( widthA > blockLength )
            throw new IllegalArgumentException("A is expected to be at most one block wide.");

        for( int j = B.col0; j < B.col1; j += blockLength ) {
            int widthB = Math.min( blockLength , B.col1 - j );

            int indexC = C.row0*C.original.numCols + (j-B.col0+C.col0)*widthA;

            for( int k = A.row0; k < A.row1; k += blockLength ) {
                int heightA = Math.min( blockLength , A.row1 - k );

                int indexA = k*A.original.numCols + A.col0*heightA;
                int indexB = (k-A.row0+B.row0)*B.original.numCols + j*heightA;

                if( k == A.row0 )
                    multTransABlockSet_lowerTriag(A.original.data,B.original.data,C.original.data,
                            indexA,indexB,indexC,heightA,widthA,widthB);
                else
                    InnerMultiplication_DDRB.blockMultPlusTransA(A.original.data,B.original.data,C.original.data,
                            indexA,indexB,indexC,heightA,widthA,widthB);
            }
        }
    }
121916
def check_diag(self, jac, name):
        
        system = self.system
        pos = []
        names = []
        pairs = ''
        size = jac.size
        diag = jac[0:size[0] ** 2:size[0] + 1]

        for idx in range(size[0]):
            if abs(diag[idx]) <= 1e-8:
                pos.append(idx)

        for idx in pos:
            names.append(system.varname.__dict__[name][idx])

        if len(names) > 0:
            for i, j in zip(pos, names):
                pairs += '{0}: {1}\n'.format(i, j)
            logger.debug('Jacobian diagonal check:')
            logger.debug(pairs)
135948
@Override
	public void setFirstAxis(Vector3D axis) {
		setFirstAxis(axis.getX(), axis.getY(), axis.getZ(), getFirstAxisExtent());
	}
224217
public Matrix4 setToRotation (float angle, float x, float y, float z) {
        float c = FloatMath.cos(angle), s = FloatMath.sin(angle), omc = 1f - c;
        float xs = x*s, ys = y*s, zs = z*s, xy = x*y, xz = x*z, yz = y*z;
        return set(x*x*omc + c, xy*omc - zs, xz*omc + ys, 0f,
                   xy*omc + zs, y*y*omc + c, yz*omc - xs, 0f,
                   xz*omc - ys, yz*omc + xs, z*z*omc + c, 0f,
                   0f, 0f, 0f, 1f);
    }