Package org.apache.commons.math3.complex

Examples of org.apache.commons.math3.complex.Complex.subtract()


    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        return new DerivativeStructure[] {
            x2.subtract(x1.multiply(x1)).multiply(10),
            x1.negate().add(1)
        };
    }

  }
View Full Code Here


            }
        }
        DerivativeStructure tmp2 = x1.multiply(x1).add(x2.multiply(x2)).sqrt();
        return new DerivativeStructure[] {
            x3.subtract(tmp1.multiply(10)).multiply(10),
            tmp2.subtract(1).multiply(10),
            x3
        };
    }

    private static final double twoPi = 2.0 * FastMath.PI;
 
View Full Code Here

        }

        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        f[m - 2] = x1;
        f[m - 1] = x2.subtract(x1.multiply(x1)).subtract(1);

        return f;

    }
View Full Code Here

        prod = prod.multiply(variables[j]);
      }
      for (int i = 0; i < n; ++i) {
        f[i] = variables[i].add(sum);
      }
      f[n - 1] = prod.subtract(1);
      return f;
    }

  }
View Full Code Here

        }

        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        f[m - 2] = x1;
        f[m - 1] = x2.subtract(x1.multiply(x1)).subtract(1);

        return f;

    }
View Full Code Here

        prod = prod.multiply(variables[j]);
      }
      for (int i = 0; i < n; ++i) {
        f[i] = variables[i].add(sum);
      }
      f[n - 1] = prod.subtract(1);
      return f;
    }

  }
View Full Code Here

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        return new DerivativeStructure[] {
            x2.subtract(x1.multiply(x1)).multiply(10),
            x1.negate().add(1)
        };
    }

  }
View Full Code Here

            }
        }
        DerivativeStructure tmp2 = x1.multiply(x1).add(x2.multiply(x2)).sqrt();
        return new DerivativeStructure[] {
            x3.subtract(tmp1.multiply(10)).multiply(10),
            tmp2.subtract(1).multiply(10),
            x3
        };
    }

    private static final double twoPi = 2.0 * FastMath.PI;
 
View Full Code Here

        Complex a = complexFormat.parse(stackAnswer.pop());
        Complex b = complexFormat.parse(stackAnswer.pop());
        if (token.equals("+")) {
          stackAnswer.push(complexFormat.format(b.add(a)));
        } else if (token.equals("-")) {
          stackAnswer.push(complexFormat.format(b.subtract(a)));
        } else if (token.equals("*")) {
          stackAnswer.push(complexFormat.format(b.multiply(a)));
        } else if (token.equals("/")) {
          stackAnswer.push(complexFormat.format(b.divide(a)));
        }
View Full Code Here

            /* Make adjustments for sign */
            if (x < 0.0) {
                if (y > 0.0)
                    refdfp = field.getPi().add(refdfp);
                else
                    refdfp = refdfp.subtract(field.getPi());
            }

            double ref = refdfp.toDouble();
            double err = (tst - ref) / ref;

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.