Package org.jquantlib.math.matrixutilities

Examples of org.jquantlib.math.matrixutilities.Array.dotProduct()


            x_ = lineSearch_.lastX();
            // New function value
            P.setFunctionValue(lineSearch_.lastFunctionValue());
            // New gradient and search direction vectors
            gdiff = gold.sub(lineSearch_.lastGradient());
            normdiff = Math.sqrt(gdiff.dotProduct(gdiff));
            gold = lineSearch_.lastGradient();
            lineSearch_.setSearchDirection(gold.mul(-1));
            // New gradient squared norm
            P.setGradientNormValue(lineSearch_.lastGradientNormNorm2());
View Full Code Here


        // compute its values
        lsp_.targetAndValue(x, target, fct2fit);
        // do the difference
        final Array diff = target.sub(fct2fit);
        // and compute the scalar product (square of the norm)
        return diff.dotProduct(diff);
    }

    @Override
    public void gradient(final Array grad_f, final Array x) {
        // size of target and function to fit vectors
View Full Code Here

        final Array diff = target.sub(fct2fit);
        // compute derivative
        // FIXME: transpost implementation ?!!!!!!!!!!!!!!
        // grad_f = -2.0*(transpose(grad_fct2fit)*diff);
        // and compute the scalar product (square of the norm)
        return diff.dotProduct(diff);
    }

    @Override
    public Array values(final Array x) {
        throw new UnsupportedOperationException("Work in progress");
View Full Code Here

        }
    center.mulAssign(1.0 / vertices.size());
    double result = 0;
    for (int i = 0; i < vertices.size(); ++i) {
      final Array temp = vertices.get(i).sub(center);
      result += Math.sqrt(temp.dotProduct(temp));
    }
    return result / vertices.size();
  }

  public double extrapolate(final Problem P, final int iHighest, double factor) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.