Package org.apache.commons.math3.analysis.differentiation

Examples of org.apache.commons.math3.analysis.differentiation.DerivativeStructure.multiply()


            throw new NoDataException(LocalizedFormats.EMPTY_POLYNOMIALS_COEFFICIENTS_ARRAY);
        }
        DerivativeStructure result =
                new DerivativeStructure(t.getFreeParameters(), t.getOrder(), coefficients[n - 1]);
        for (int j = n - 2; j >= 0; j--) {
            result = result.multiply(t).add(coefficients[j]);
        }
        return result;
    }

    /**
 
View Full Code Here


        Arrays.fill(value, x.getField().getZero());
        DerivativeStructure valueCoeff = x.getField().getOne();
        for (int i = 0; i < topDiagonal.size(); ++i) {
            double[] dividedDifference = topDiagonal.get(i);
            for (int k = 0; k < value.length; ++k) {
                value[k] = value[k].add(valueCoeff.multiply(dividedDifference[k]));
            }
            final DerivativeStructure deltaX = x.subtract(abscissae.get(i));
            valueCoeff = valueCoeff.multiply(deltaX);
        }
View Full Code Here

            /** {@inheritDoc} */
            public DerivativeStructure value(final DerivativeStructure t) {
                DerivativeStructure r = f[0].value(t);
                for (int i = 1; i < f.length; i++) {
                    r = r.multiply(f[i].value(t));
                }
                return r;
            }

        };
View Full Code Here

        DerivativeStructure sum = variables[0].getField().getZero();
        for (int i = 0; i < n; ++i) {
            sum = sum.add(variables[i].multiply(i + 1));
        }
        for (int i = 0; i < m; ++i) {
            f[i] = sum.multiply(i + 1).subtract(1);
        }
        return f;
    }

  }
View Full Code Here

        DerivativeStructure sum = variables[0].getField().getZero();
      for (int i = 1; i < (n - 1); ++i) {
          sum = sum.add(variables[i].multiply(i + 1));
      }
      for (int i = 0; i < (m - 1); ++i) {
        f[i] = sum.multiply(i).subtract(1);
      }
      f[m - 1] = variables[0].getField().getOne().negate();
      return f;
    }
View Full Code Here

        DerivativeStructure[] f = new DerivativeStructure[m];
      for (int i = 0; i < m; ++i) {
        double tmp1 = i + 1;
        double tmp2 = 15 - i;
        double tmp3 = (i <= 7) ? tmp1 : tmp2;
        f[i] = x1.add(x2.multiply(tmp2).add(x3.multiply(tmp3)).reciprocal().multiply(tmp1)).negate().add(y[i]);
      }
      return f;
    }

    private static final double[] y = {
View Full Code Here

        for (int i = 0; i < (m - 2); ++i) {
            double div = (i + 1) / 29.0;
            DerivativeStructure s1 = variables[0].getField().getZero();
            DerivativeStructure dx = variables[0].getField().getOne();
            for (int j = 1; j < n; ++j) {
                s1 = s1.add(dx.multiply(j).multiply(variables[j]));
                dx = dx.multiply(div);
            }
            DerivativeStructure s2 = variables[0].getField().getZero();
            dx = variables[0].getField().getOne();
            for (int j = 0; j < n; ++j) {
View Full Code Here

            double div = (i + 1) / 29.0;
            DerivativeStructure s1 = variables[0].getField().getZero();
            DerivativeStructure dx = variables[0].getField().getOne();
            for (int j = 1; j < n; ++j) {
                s1 = s1.add(dx.multiply(j).multiply(variables[j]));
                dx = dx.multiply(div);
            }
            DerivativeStructure s2 = variables[0].getField().getZero();
            dx = variables[0].getField().getOne();
            for (int j = 0; j < n; ++j) {
                s2 = s2.add(dx.multiply(variables[j]));
View Full Code Here

            dx = variables[0].getField().getOne();
            for (int j = 0; j < n; ++j) {
                s2 = s2.add(dx.multiply(variables[j]));
                dx = dx.multiply(div);
            }
            f[i] = s1.subtract(s2.multiply(s2)).subtract(1);
        }

        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        f[m - 2] = x1;
View Full Code Here

        DerivativeStructure x3 = variables[2];
        DerivativeStructure[] f = new DerivativeStructure[m];
      for (int i = 0; i < m; ++i) {
        double tmp = (i + 1) / 10.0;
        f[i] = x1.multiply(-tmp).exp().subtract(x2.multiply(-tmp).exp()).add(
                  x3.multiply(FastMath.exp(-i - 1) - FastMath.exp(-tmp)));
      }
      return f;
    }

  }
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.