nus-yam/ex-repair huggingface dataset:
Program: 57223
Project: 57223
Buggy source:
/** 
 * Add he contribution of a boundary facet.
 * @param facet boundary facet
 * @param reversed if true, the facet has the inside on its plus side
 */
private void addContribution(final SubHyperplane<Euclidean3D> facet,final boolean reversed){
  final Region<Euclidean2D> polygon=((SubPlane)facet).getRemainingRegion();
  final double area=polygon.getSize();
  if (Double.isInfinite(area)) {
    setSize(Double.POSITIVE_INFINITY);
    setBarycenter(Vector3D.NaN);
  }
 else {
    final Plane plane=(Plane)facet.getHyperplane();
    final Vector3D facetB=plane.toSpace(polygon.getBarycenter());
    double scaled=area * facetB.dotProduct(plane.getNormal());
    if (reversed) {
      scaled=-scaled;
    }
    setSize(getSize() + scaled);
    setBarycenter(new Vector3D(1.0,(Vector3D)getBarycenter(),scaled,facetB));
  }
}

Fixed version (ground truth):
/** 
 * Add he contribution of a boundary facet.
 * @param facet boundary facet
 * @param reversed if true, the facet has the inside on its plus side
 */
private void addContribution(final SubHyperplane<Euclidean3D> facet,final boolean reversed){
  final Region<Euclidean2D> polygon=((SubPlane)facet).getRemainingRegion();
  final double area=polygon.getSize();
  if (Double.isInfinite(area)) {
    setSize(Double.POSITIVE_INFINITY);
    setBarycenter((Point<Euclidean3D>)Vector3D.NaN);
  }
 else {
    final Plane plane=(Plane)facet.getHyperplane();
    final Vector3D facetB=plane.toSpace(polygon.getBarycenter());
    double scaled=area * facetB.dotProduct(plane.getNormal());
    if (reversed) {
      scaled=-scaled;
    }
    setSize(getSize() + scaled);
    setBarycenter((Point<Euclidean3D>)new Vector3D(1.0,(Vector3D)getBarycenter(),scaled,facetB));
  }
}
Program: 57224
Project: 57224
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void computeGeometricalProperties(){
  getTree(true).visit(new FacetsContributionVisitor());
  if (getSize() < 0) {
    setSize(Double.POSITIVE_INFINITY);
    setBarycenter(Vector3D.NaN);
  }
 else {
    setSize(getSize() / 3.0);
    setBarycenter(new Vector3D(1.0 / (4 * getSize()),(Vector3D)getBarycenter()));
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void computeGeometricalProperties(){
  getTree(true).visit(new FacetsContributionVisitor());
  if (getSize() < 0) {
    setSize(Double.POSITIVE_INFINITY);
    setBarycenter((Point<Euclidean3D>)Vector3D.NaN);
  }
 else {
    setSize(getSize() / 3.0);
    setBarycenter((Point<Euclidean3D>)new Vector3D(1.0 / (4 * getSize()),(Vector3D)getBarycenter()));
  }
}
Program: 57225
Project: 57225
Buggy source:
/** 
 * Check if a point belongs to the boundary part of a node.
 * @param point point to check
 * @param node node containing the boundary facet to check
 * @return the boundary facet this points belongs to (or null if itdoes not belong to any boundary facet)
 */
private SubHyperplane<Euclidean3D> boundaryFacet(final Vector3D point,final BSPTree<Euclidean3D> node){
  final Vector2D point2D=((Plane)node.getCut().getHyperplane()).toSubSpace(point);
  @SuppressWarnings("String_Node_Str") final BoundaryAttribute<Euclidean3D> attribute=(BoundaryAttribute<Euclidean3D>)node.getAttribute();
  if ((attribute.getPlusOutside() != null) && (((SubPlane)attribute.getPlusOutside()).getRemainingRegion().checkPoint(point2D) == Location.INSIDE)) {
    return attribute.getPlusOutside();
  }
  if ((attribute.getPlusInside() != null) && (((SubPlane)attribute.getPlusInside()).getRemainingRegion().checkPoint(point2D) == Location.INSIDE)) {
    return attribute.getPlusInside();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Check if a point belongs to the boundary part of a node.
 * @param point point to check
 * @param node node containing the boundary facet to check
 * @return the boundary facet this points belongs to (or null if itdoes not belong to any boundary facet)
 */
private SubHyperplane<Euclidean3D> boundaryFacet(final Vector3D point,final BSPTree<Euclidean3D> node){
  final Vector2D point2D=((Plane)node.getCut().getHyperplane()).toSubSpace((Point<Euclidean3D>)point);
  @SuppressWarnings("String_Node_Str") final BoundaryAttribute<Euclidean3D> attribute=(BoundaryAttribute<Euclidean3D>)node.getAttribute();
  if ((attribute.getPlusOutside() != null) && (((SubPlane)attribute.getPlusOutside()).getRemainingRegion().checkPoint(point2D) == Location.INSIDE)) {
    return attribute.getPlusOutside();
  }
  if ((attribute.getPlusInside() != null) && (((SubPlane)attribute.getPlusInside()).getRemainingRegion().checkPoint(point2D) == Location.INSIDE)) {
    return attribute.getPlusInside();
  }
  return null;
}
Program: 57226
Project: 57226
Buggy source:
/** 
 * Build an interval set from two points.
 * @param start start point
 * @param end end point
 * @return an interval set
 * @exception MathIllegalArgumentException if the points are equal
 */
private static IntervalsSet buildIntervalSet(final Vector3D start,final Vector3D end) throws MathIllegalArgumentException {
  final Line line=new Line(start,end);
  return new IntervalsSet(line.toSubSpace(start).getX(),line.toSubSpace(end).getX());
}

Fixed version (ground truth):
/** 
 * Build an interval set from two points.
 * @param start start point
 * @param end end point
 * @return an interval set
 * @exception MathIllegalArgumentException if the points are equal
 */
private static IntervalsSet buildIntervalSet(final Vector3D start,final Vector3D end) throws MathIllegalArgumentException {
  final Line line=new Line(start,end);
  return new IntervalsSet(line.toSubSpace((Point<Euclidean3D>)start).getX(),line.toSubSpace((Point<Euclidean3D>)end).getX());
}
Program: 57227
Project: 57227
Buggy source:
/** 
 * Get the intersection of the instance and another sub-line. <p> This method is related to the   {@link Line#intersection(Line) intersection} method in the {@link Line Line} class, but in additionto compute the point along infinite lines, it also checks the point lies on both sub-line ranges. </p>
 * @param subLine other sub-line which may intersect instance
 * @param includeEndPoints if true, endpoints are considered to belong toinstance (i.e. they are closed sets) and may be returned, otherwise endpoints are considered to not belong to instance (i.e. they are open sets) and intersection occurring on endpoints lead to null being returned
 * @return the intersection point if there is one, null if the sub-lines don't intersect
 */
public Vector3D intersection(final SubLine subLine,final boolean includeEndPoints){
  Vector3D v1D=line.intersection(subLine.line);
  if (v1D == null) {
    return null;
  }
  Location loc1=remainingRegion.checkPoint(line.toSubSpace(v1D));
  Location loc2=subLine.remainingRegion.checkPoint(subLine.line.toSubSpace(v1D));
  if (includeEndPoints) {
    return ((loc1 != Location.OUTSIDE) && (loc2 != Location.OUTSIDE)) ? v1D : null;
  }
 else {
    return ((loc1 == Location.INSIDE) && (loc2 == Location.INSIDE)) ? v1D : null;
  }
}

Fixed version (ground truth):
/** 
 * Get the intersection of the instance and another sub-line. <p> This method is related to the   {@link Line#intersection(Line) intersection} method in the {@link Line Line} class, but in additionto compute the point along infinite lines, it also checks the point lies on both sub-line ranges. </p>
 * @param subLine other sub-line which may intersect instance
 * @param includeEndPoints if true, endpoints are considered to belong toinstance (i.e. they are closed sets) and may be returned, otherwise endpoints are considered to not belong to instance (i.e. they are open sets) and intersection occurring on endpoints lead to null being returned
 * @return the intersection point if there is one, null if the sub-lines don't intersect
 */
public Vector3D intersection(final SubLine subLine,final boolean includeEndPoints){
  Vector3D v1D=line.intersection(subLine.line);
  if (v1D == null) {
    return null;
  }
  Location loc1=remainingRegion.checkPoint((Point<Euclidean1D>)line.toSubSpace((Point<Euclidean3D>)v1D));
  Location loc2=subLine.remainingRegion.checkPoint((Point<Euclidean1D>)subLine.line.toSubSpace((Point<Euclidean3D>)v1D));
  if (includeEndPoints) {
    return ((loc1 != Location.OUTSIDE) && (loc2 != Location.OUTSIDE)) ? v1D : null;
  }
 else {
    return ((loc1 == Location.INSIDE) && (loc2 == Location.INSIDE)) ? v1D : null;
  }
}
Program: 57228
Project: 57228
Buggy source:
/** 
 * Get the endpoints of the sub-line. <p> A subline may be any arbitrary number of disjoints segments, so the endpoints are provided as a list of endpoint pairs. Each element of the list represents one segment, and each segment contains a start point at index 0 and an end point at index 1. If the sub-line is unbounded in the negative infinity direction, the start point of the first segment will have infinite coordinates. If the sub-line is unbounded in the positive infinity direction, the end point of the last segment will have infinite coordinates. So a sub-line covering the whole line will contain just one row and both elements of this row will have infinite coordinates. If the sub-line is empty, the returned list will contain 0 segments. </p>
 * @return list of segments endpoints
 */
public List<Segment> getSegments(){
  final List<Interval> list=remainingRegion.asList();
  final List<Segment> segments=new ArrayList<Segment>(list.size());
  for (  final Interval interval : list) {
    final Vector3D start=line.toSpace(new Vector1D(interval.getInf()));
    final Vector3D end=line.toSpace(new Vector1D(interval.getSup()));
    segments.add(new Segment(start,end,line));
  }
  return segments;
}

Fixed version (ground truth):
/** 
 * Get the endpoints of the sub-line. <p> A subline may be any arbitrary number of disjoints segments, so the endpoints are provided as a list of endpoint pairs. Each element of the list represents one segment, and each segment contains a start point at index 0 and an end point at index 1. If the sub-line is unbounded in the negative infinity direction, the start point of the first segment will have infinite coordinates. If the sub-line is unbounded in the positive infinity direction, the end point of the last segment will have infinite coordinates. So a sub-line covering the whole line will contain just one row and both elements of this row will have infinite coordinates. If the sub-line is empty, the returned list will contain 0 segments. </p>
 * @return list of segments endpoints
 */
public List<Segment> getSegments(){
  final List<Interval> list=remainingRegion.asList();
  final List<Segment> segments=new ArrayList<Segment>(list.size());
  for (  final Interval interval : list) {
    final Vector3D start=line.toSpace((Point<Euclidean1D>)new Vector1D(interval.getInf()));
    final Vector3D end=line.toSpace((Point<Euclidean1D>)new Vector1D(interval.getSup()));
    segments.add(new Segment(start,end,line));
  }
  return segments;
}
Program: 57229
Project: 57229
Buggy source:
@Test public void testNextPoissonConsistency(){
  for (int i=1; i < 100; i++) {
    checkNextPoissonConsistency(i);
  }
  for (int i=1; i < 10; i++) {
    checkNextPoissonConsistency(randomData.nextUniform(1,1000));
  }
  for (int i=1; i < 10; i++) {
    checkNextPoissonConsistency(randomData.nextUniform(1000,3000));
  }
}

Fixed version (ground truth):
@Test public void testNextPoissonConsistency(){
  for (int i=1; i < 100; i++) {
    checkNextPoissonConsistency(i);
  }
  for (int i=1; i < 10; i++) {
    checkNextPoissonConsistency(randomData.nextUniform(1,1000));
  }
  for (int i=1; i < 10; i++) {
    checkNextPoissonConsistency(randomData.nextUniform(1000,10000));
  }
}
Program: 57233
Project: 57233
Buggy source:
/** 
 * Performs an operation on the addressable elements of the array.
 * @param f Function to be applied on this array.
 * @return the result.
 * @since 3.1
 */
public double compute(MathArrays.Function f){
  return f.evaluate(internalArray,startIndex,numElements);
}

Fixed version (ground truth):
/** 
 * Performs an operation on the addressable elements of the array.
 * @param f Function to be applied on this array.
 * @return the result.
 * @since 3.1
 */
public double compute(MathArrays.Function f){
  final double[] array;
  final int start;
  final int num;
synchronized (this) {
    array=internalArray;
    start=startIndex;
    num=numElements;
  }
  return f.evaluate(array,start,num);
}
Program: 57234
Project: 57234
Buggy source:
/** 
 * Fit a mixture model to the data supplied to the constructor. The quality of the fit depends on the concavity of the data provided to the constructor and the initial mixture provided to this function. If the data has many local optima, multiple runs of the fitting function with different initial mixtures may be required to find the optimal solution. If a SingularMatrixException is encountered, it is possible that another initialization would work.
 * @param initialMixture Model containing initial values of weights andmultivariate normals
 * @throws SingularMatrixException if any component's covariance matrix issingular during fitting
 * @throws NotStrictlyPositiveException if numComponents is less than one orthreshold is less than Double.MIN_VALUE
 * @see #estimateMultivariateNormalMixtureModelDistribution
 */
public void fit(MixtureMultivariateNormalDistribution initialMixture) throws SingularMatrixException, NotStrictlyPositiveException {
  fit(initialMixture,defaultMaxIterations,defaultThreshold);
}

Fixed version (ground truth):
/** 
 * Fit a mixture model to the data supplied to the constructor. The quality of the fit depends on the concavity of the data provided to the constructor and the initial mixture provided to this function. If the data has many local optima, multiple runs of the fitting function with different initial mixtures may be required to find the optimal solution. If a SingularMatrixException is encountered, it is possible that another initialization would work.
 * @param initialMixture Model containing initial values of weights andmultivariate normals
 * @throws SingularMatrixException if any component's covariance matrix issingular during fitting
 * @throws NotStrictlyPositiveException if numComponents is less than one orthreshold is less than Double.MIN_VALUE
 */
public void fit(MixtureMultivariateNormalDistribution initialMixture) throws SingularMatrixException, NotStrictlyPositiveException {
  fit(initialMixture,defaultMaxIterations,defaultThreshold);
}
Program: 57236
Project: 57236
Buggy source:
/** 
 * Runs the K-means++ clustering algorithm.
 * @param points the points to cluster
 * @return a list of clusters containing the points
 * @throws MathIllegalArgumentException if the data points are null or the numberof clusters is larger than the number of data points
 * @throws ConvergenceException if an empty cluster is encountered and the{@link #emptyStrategy} is set to {@code ERROR}
 */
public List<CentroidCluster<T>> cluster(final Collection<T> points) throws MathIllegalArgumentException, ConvergenceException {
  List<CentroidCluster<T>> best=null;
  double bestVarianceSum=Double.POSITIVE_INFINITY;
  for (int i=0; i < numTrials; ++i) {
    List<CentroidCluster<T>> clusters=clusterer.cluster(points);
    double varianceSum=0.0;
    for (    final CentroidCluster<T> cluster : clusters) {
      if (!cluster.getPoints().isEmpty()) {
        final Clusterable center=cluster.getCenter();
        final Variance stat=new Variance();
        for (        final T point : cluster.getPoints()) {
          stat.increment(distance(point,center));
        }
        varianceSum+=stat.getResult();
      }
    }
    if (varianceSum <= bestVarianceSum) {
      best=clusters;
      bestVarianceSum=varianceSum;
    }
  }
  return best;
}

Fixed version (ground truth):
/** 
 * Runs the K-means++ clustering algorithm.
 * @param points the points to cluster
 * @return a list of clusters containing the points
 * @throws MathIllegalArgumentException if the data points are null or the numberof clusters is larger than the number of data points
 * @throws ConvergenceException if an empty cluster is encountered and theunderlying  {@link KMeansPlusPlusClusterer} has its{@link KMeansPlusPlusClusterer.EmptyClusterStrategy} is set to {@code ERROR}.
 */
public List<CentroidCluster<T>> cluster(final Collection<T> points) throws MathIllegalArgumentException, ConvergenceException {
  List<CentroidCluster<T>> best=null;
  double bestVarianceSum=Double.POSITIVE_INFINITY;
  for (int i=0; i < numTrials; ++i) {
    List<CentroidCluster<T>> clusters=clusterer.cluster(points);
    double varianceSum=0.0;
    for (    final CentroidCluster<T> cluster : clusters) {
      if (!cluster.getPoints().isEmpty()) {
        final Clusterable center=cluster.getCenter();
        final Variance stat=new Variance();
        for (        final T point : cluster.getPoints()) {
          stat.increment(distance(point,center));
        }
        varianceSum+=stat.getResult();
      }
    }
    if (varianceSum <= bestVarianceSum) {
      best=clusters;
      bestVarianceSum=varianceSum;
    }
  }
  return best;
}
Program: 57237
Project: 57237
Buggy source:
/** 
 * Create a discrete distribution using the given random number generator and probability mass function definition.
 * @param rng random number generator.
 * @param singletons array of random variable values.
 * @param probabilities array of probabilities.
 * @throws DimensionMismatchException if{@code singletons.length != probabilities.length}
 * @throws NotPositiveException if probability of at least one value isnegative.
 * @throws MathArithmeticException if the probabilities sum to zero.
 * @throws MathIllegalArgumentException if probability of at least one valueis infinite.
 */
public DiscreteIntegerDistribution(final RandomGenerator rng,final int[] singletons,final double[] probabilities) throws DimensionMismatchException, NotPositiveException, MathArithmeticException, MathIllegalArgumentException {
  super(rng);
  if (singletons.length != probabilities.length) {
    throw new DimensionMismatchException(probabilities.length,singletons.length);
  }
  final List<Pair<Integer,Double>> samples=new ArrayList<Pair<Integer,Double>>(singletons.length);
  for (int i=0; i < singletons.length; i++) {
    samples.add(new Pair<Integer,Double>(singletons[i],probabilities[i]));
  }
  innerDistribution=new DiscreteDistribution<Integer>(rng,samples);
}

Fixed version (ground truth):
/** 
 * Create a discrete distribution using the given random number generator and probability mass function definition.
 * @param rng random number generator.
 * @param singletons array of random variable values.
 * @param probabilities array of probabilities.
 * @throws DimensionMismatchException if {@code singletons.length != probabilities.length}
 * @throws NotPositiveException if probability of at least one value is negative.
 * @throws MathArithmeticException if the probabilities sum to zero.
 * @throws MathIllegalArgumentException if probability of at least one value is infinite.
 */
public DiscreteIntegerDistribution(final RandomGenerator rng,final int[] singletons,final double[] probabilities) throws DimensionMismatchException, NotPositiveException, MathArithmeticException, MathIllegalArgumentException {
  super(rng);
  if (singletons.length != probabilities.length) {
    throw new DimensionMismatchException(probabilities.length,singletons.length);
  }
  final List<Pair<Integer,Double>> samples=new ArrayList<Pair<Integer,Double>>(singletons.length);
  for (int i=0; i < singletons.length; i++) {
    samples.add(new Pair<Integer,Double>(singletons[i],probabilities[i]));
  }
  innerDistribution=new DiscreteDistribution<Integer>(rng,samples);
}
Program: 57238
Project: 57238
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int sample(){
  return innerDistribution.sample();
}

Fixed version (ground truth):
@Override public int sample(){
  return innerDistribution.sample();
}
Program: 57239
Project: 57239
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public double probability(final double x){
  return innerDistribution.probability(x);
}

Fixed version (ground truth):
@Override public double probability(final double x){
  return innerDistribution.probability(x);
}
Program: 57240
Project: 57240
Buggy source:
/** 
 * Create a discrete distribution using the given random number generator and probability mass function definition.
 * @param rng random number generator.
 * @param singletons array of random variable values.
 * @param probabilities array of probabilities.
 * @throws DimensionMismatchException if{@code singletons.length != probabilities.length}
 * @throws NotPositiveException if probability of at least one value isnegative.
 * @throws MathArithmeticException if the probabilities sum to zero.
 * @throws MathIllegalArgumentException if probability of at least one valueis infinite.
 */
public DiscreteRealDistribution(final RandomGenerator rng,final double[] singletons,final double[] probabilities) throws DimensionMismatchException, NotPositiveException, MathArithmeticException, MathIllegalArgumentException {
  super(rng);
  if (singletons.length != probabilities.length) {
    throw new DimensionMismatchException(probabilities.length,singletons.length);
  }
  List<Pair<Double,Double>> samples=new ArrayList<Pair<Double,Double>>(singletons.length);
  for (int i=0; i < singletons.length; i++) {
    samples.add(new Pair<Double,Double>(singletons[i],probabilities[i]));
  }
  innerDistribution=new DiscreteDistribution<Double>(rng,samples);
}

Fixed version (ground truth):
/** 
 * Create a discrete distribution using the given random number generator and probability mass function definition.
 * @param rng random number generator.
 * @param singletons array of random variable values.
 * @param probabilities array of probabilities.
 * @throws DimensionMismatchException if {@code singletons.length != probabilities.length}
 * @throws NotPositiveException if probability of at least one value is negative.
 * @throws MathArithmeticException if the probabilities sum to zero.
 * @throws MathIllegalArgumentException if probability of at least one value is infinite.
 */
public DiscreteRealDistribution(final RandomGenerator rng,final double[] singletons,final double[] probabilities) throws DimensionMismatchException, NotPositiveException, MathArithmeticException, MathIllegalArgumentException {
  super(rng);
  if (singletons.length != probabilities.length) {
    throw new DimensionMismatchException(probabilities.length,singletons.length);
  }
  List<Pair<Double,Double>> samples=new ArrayList<Pair<Double,Double>>(singletons.length);
  for (int i=0; i < singletons.length; i++) {
    samples.add(new Pair<Double,Double>(singletons[i],probabilities[i]));
  }
  innerDistribution=new DiscreteDistribution<Double>(rng,samples);
}
Program: 57241
Project: 57241
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public double sample(){
  return innerDistribution.sample();
}

Fixed version (ground truth):
@Override public double sample(){
  return innerDistribution.sample();
}
Program: 57242
Project: 57242
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public DiagonalMatrix copy(){
  return new DiagonalMatrix(data);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public RealMatrix copy(){
  return new DiagonalMatrix(data);
}
Program: 57243
Project: 57243
Buggy source:
@Test public void testCopy(){
  final double[] d={-1.2,3.4,5};
  final DiagonalMatrix m=new DiagonalMatrix(d,false);
  final DiagonalMatrix p=m.copy();
  for (int i=0; i < m.getRowDimension(); ++i) {
    Assert.assertEquals(m.getEntry(i,i),p.getEntry(i,i),1.0e-20);
  }
}

Fixed version (ground truth):
@Test public void testCopy(){
  final double[] d={-1.2,3.4,5};
  final DiagonalMatrix m=new DiagonalMatrix(d,false);
  final DiagonalMatrix p=(DiagonalMatrix)m.copy();
  for (int i=0; i < m.getRowDimension(); ++i) {
    Assert.assertEquals(m.getEntry(i,i),p.getEntry(i,i),1.0e-20);
  }
}
Program: 57244
Project: 57244
Buggy source:
/** 
 * Calculates the QR-decomposition of the given matrix.
 * @param matrix The matrix to decompose.
 * @param threshold Singularity threshold.
 */
public RRQRDecomposition(RealMatrix matrix,double threshold){
  super(matrix,threshold);
}

Fixed version (ground truth):
/** 
 * Calculates the QR-decomposition of the given matrix.
 * @param matrix The matrix to decompose.
 * @param threshold Singularity threshold.
 * @see #RRQRDecomposition(RealMatrix)
 */
public RRQRDecomposition(RealMatrix matrix,double threshold){
  super(matrix,threshold);
}
Program: 57245
Project: 57245
Buggy source:
/** 
 * Compute a linear combination accurately. <p> This method computes a<sub>1</sub>&times;b<sub>1</sub> + a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> + a<sub>4</sub>&times;b<sub>4</sub> to high accuracy. It does so by using specific multiplication and addition algorithms to preserve accuracy and reduce cancellation effects. It is based on the 2005 paper <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547"> Accurate Sum and Dot Product</a> by Takeshi Ogita, Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput. </p> <p> Note that the instance is only used as a prototype to get proper elements dimensions. Its value is not used, only the parameters values are used. </p>
 * @param a1 first factor of the first term
 * @param b1 second factor of the first term
 * @param a2 first factor of the second term
 * @param b2 second factor of the second term
 * @param a3 first factor of the third term
 * @param b3 second factor of the third term
 * @param a4 first factor of the third term
 * @param b4 second factor of the third term
 * @return a<sub>1</sub>&times;b<sub>1</sub> +a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> + a<sub>4</sub>&times;b<sub>4</sub>
 * @see #linearCombination(double,T,double,T)
 * @see #linearCombination(double,T,double,T,double,T)
 * @since 3.2
 */
T linearCombination(double a1,T b1,double a2,T b2,double a3,T b3,double a4,T b4);

Fixed version (ground truth):
/** 
 * Compute a linear combination accurately. <p> This method computes a<sub>1</sub>&times;b<sub>1</sub> + a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> + a<sub>4</sub>&times;b<sub>4</sub> to high accuracy. It does so by using specific multiplication and addition algorithms to preserve accuracy and reduce cancellation effects. It is based on the 2005 paper <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547"> Accurate Sum and Dot Product</a> by Takeshi Ogita, Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput. </p> <p> Note that the instance is only used as a prototype to get proper elements dimensions. Its value is not used, only the parameters values are used. </p>
 * @param a1 first factor of the first term
 * @param b1 second factor of the first term
 * @param a2 first factor of the second term
 * @param b2 second factor of the second term
 * @param a3 first factor of the third term
 * @param b3 second factor of the third term
 * @param a4 first factor of the third term
 * @param b4 second factor of the third term
 * @return a<sub>1</sub>&times;b<sub>1</sub> +a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> + a<sub>4</sub>&times;b<sub>4</sub>
 * @see #linearCombination(double,Object,double,Object)
 * @see #linearCombination(double,Object,double,Object,double,Object)
 * @since 3.2
 */
T linearCombination(double a1,T b1,double a2,T b2,double a3,T b3,double a4,T b4);
Program: 57246
Project: 57246
Buggy source:
/** 
 * Get the closest long to instance value.
 * @return closest long to {@link #getValue()}
 */
long round();

Fixed version (ground truth):
/** 
 * Get the closest long to instance value.
 * @return closest long to {@link #getReal()}
 */
long round();
Program: 57247
Project: 57247
Buggy source:
/** 
 * Get the normalized axis of the rotation.
 * @return normalized axis of the rotation
 * @see #Rotation(FieldVector3D,T)
 */
public FieldVector3D<T> getAxis(){
  final T squaredSine=q1.multiply(q1).add(q2.multiply(q2)).add(q3.multiply(q3));
  if (squaredSine.getReal() == 0) {
    final Field<T> field=squaredSine.getField();
    return new FieldVector3D<T>(field.getOne(),field.getZero(),field.getZero());
  }
 else   if (q0.getReal() < 0) {
    T inverse=squaredSine.sqrt().reciprocal();
    return new FieldVector3D<T>(q1.multiply(inverse),q2.multiply(inverse),q3.multiply(inverse));
  }
  final T inverse=squaredSine.sqrt().reciprocal().negate();
  return new FieldVector3D<T>(q1.multiply(inverse),q2.multiply(inverse),q3.multiply(inverse));
}

Fixed version (ground truth):
/** 
 * Get the normalized axis of the rotation.
 * @return normalized axis of the rotation
 * @see #FieldRotation(FieldVector3D,ExtendedFieldElement)
 */
public FieldVector3D<T> getAxis(){
  final T squaredSine=q1.multiply(q1).add(q2.multiply(q2)).add(q3.multiply(q3));
  if (squaredSine.getReal() == 0) {
    final Field<T> field=squaredSine.getField();
    return new FieldVector3D<T>(field.getOne(),field.getZero(),field.getZero());
  }
 else   if (q0.getReal() < 0) {
    T inverse=squaredSine.sqrt().reciprocal();
    return new FieldVector3D<T>(q1.multiply(inverse),q2.multiply(inverse),q3.multiply(inverse));
  }
  final T inverse=squaredSine.sqrt().reciprocal().negate();
  return new FieldVector3D<T>(q1.multiply(inverse),q2.multiply(inverse),q3.multiply(inverse));
}
Program: 57248
Project: 57248
Buggy source:
/** 
 * Get the angle of the rotation.
 * @return angle of the rotation (between 0 and &pi;)
 * @see #Rotation(FieldVector3D,T)
 */
public T getAngle(){
  if ((q0.getReal() < -0.1) || (q0.getReal() > 0.1)) {
    return q1.multiply(q1).add(q2.multiply(q2)).add(q3.multiply(q3)).sqrt().asin().multiply(2);
  }
 else   if (q0.getReal() < 0) {
    return q0.negate().acos().multiply(2);
  }
  return q0.acos().multiply(2);
}

Fixed version (ground truth):
/** 
 * Get the angle of the rotation.
 * @return angle of the rotation (between 0 and &pi;)
 * @see #FieldRotation(FieldVector3D,ExtendedFieldElement)
 */
public T getAngle(){
  if ((q0.getReal() < -0.1) || (q0.getReal() > 0.1)) {
    return q1.multiply(q1).add(q2.multiply(q2)).add(q3.multiply(q3)).sqrt().asin().multiply(2);
  }
 else   if (q0.getReal() < 0) {
    return q0.negate().acos().multiply(2);
  }
  return q0.acos().multiply(2);
}
Program: 57249
Project: 57249
Buggy source:
/** 
 * Get the elevation of the vector.
 * @return elevation (&delta;) of the vector, between -&pi;/2 and +&pi;/2
 * @see #Vector3D(T,T)
 */
public T getDelta(){
  return z.divide(getNorm()).asin();
}

Fixed version (ground truth):
/** 
 * Get the elevation of the vector.
 * @return elevation (&delta;) of the vector, between -&pi;/2 and +&pi;/2
 * @see #FieldVector3D(ExtendedFieldElement,ExtendedFieldElement)
 */
public T getDelta(){
  return z.divide(getNorm()).asin();
}
Program: 57250
Project: 57250
Buggy source:
/** 
 * Get the azimuth of the vector.
 * @return azimuth (&alpha;) of the vector, between -&pi; and +&pi;
 * @see #Vector3D(T,T)
 */
public T getAlpha(){
  return y.atan2(x);
}

Fixed version (ground truth):
/** 
 * Get the azimuth of the vector.
 * @return azimuth (&alpha;) of the vector, between -&pi; and +&pi;
 * @see #FieldVector3D(ExtendedFieldElement,ExtendedFieldElement)
 */
public T getAlpha(){
  return y.atan2(x);
}
Program: 57251
Project: 57251
Buggy source:
/** 
 * Get the vector coordinates as a dimension 3 array.
 * @return vector coordinates
 * @see #Vector3D(T[])
 */
public T[] toArray(){
  final T[] array=MathArrays.buildArray(x.getField(),3);
  array[0]=x;
  array[1]=y;
  array[2]=z;
  return array;
}

Fixed version (ground truth):
/** 
 * Get the vector coordinates as a dimension 3 array.
 * @return vector coordinates
 * @see #FieldVector3D(ExtendedFieldElement[])
 */
public T[] toArray(){
  final T[] array=MathArrays.buildArray(x.getField(),3);
  array[0]=x;
  array[1]=y;
  array[2]=z;
  return array;
}
Program: 57252
Project: 57252
Buggy source:
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see #Vector3D(T,T,T)
 */
public T getX(){
  return x;
}

Fixed version (ground truth):
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see #FieldVector3D(ExtendedFieldElement,ExtendedFieldElement,ExtendedFieldElement)
 */
public T getX(){
  return x;
}
Program: 57253
Project: 57253
Buggy source:
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see #Vector3D(T,T,T)
 */
public T getY(){
  return y;
}

Fixed version (ground truth):
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see #FieldVector3D(ExtendedFieldElement,ExtendedFieldElement,ExtendedFieldElement)
 */
public T getY(){
  return y;
}
Program: 57254
Project: 57254
Buggy source:
/** 
 * Get the height of the vector.
 * @return height of the vector
 * @see #Vector3D(T,T,T)
 */
public T getZ(){
  return z;
}

Fixed version (ground truth):
/** 
 * Get the height of the vector.
 * @return height of the vector
 * @see #FieldVector3D(ExtendedFieldElement,ExtendedFieldElement,ExtendedFieldElement)
 */
public T getZ(){
  return z;
}
Program: 57255
Project: 57255
Buggy source:
/** 
 * Test for the equality of two 3D vectors. <p> If all coordinates of two 3D vectors are exactly the same, and none are <code>T.NaN</code>, the two 3D vectors are considered to be equal. </p> <p> <code>NaN</code> coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or all) coordinates of the 3D vector are equal to <code>T.NaN</code>, the 3D vector is equal to  {@link #NaN}. </p>
 * @param other Object to test for equality to this
 * @return true if two 3D vector objects are equal, false ifobject is null, not an instance of Vector3D, or not equal to this Vector3D instance
 */
@Override public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (other instanceof FieldVector3D) {
    @SuppressWarnings("String_Node_Str") final FieldVector3D<T> rhs=(FieldVector3D<T>)other;
    if (rhs.isNaN()) {
      return this.isNaN();
    }
    return x.equals(rhs.x) && y.equals(rhs.y) && z.equals(rhs.z);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Test for the equality of two 3D vectors. <p> If all coordinates of two 3D vectors are exactly the same, and none of their  {@link ExtendedFieldElement#getReal() real part} are <code>NaN</code>, thetwo 3D vectors are considered to be equal. </p> <p> <code>NaN</code> coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or all) real part of the coordinates of the 3D vector are <code>NaN</code>, the 3D vector is <code>NaN</code>. </p>
 * @param other Object to test for equality to this
 * @return true if two 3D vector objects are equal, false ifobject is null, not an instance of Vector3D, or not equal to this Vector3D instance
 */
@Override public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (other instanceof FieldVector3D) {
    @SuppressWarnings("String_Node_Str") final FieldVector3D<T> rhs=(FieldVector3D<T>)other;
    if (rhs.isNaN()) {
      return this.isNaN();
    }
    return x.equals(rhs.x) && y.equals(rhs.y) && z.equals(rhs.z);
  }
  return false;
}
Program: 57256
Project: 57256
Buggy source:
/** 
 * {@inheritDoc} 
 */
public String toString(final NumberFormat format){
  return new Vector3DFormat(format).format(toVector3D());
}

Fixed version (ground truth):
/** 
 * Get a string representation of this vector.
 * @param format the custom format for components
 * @return a string representation of this vector
 */
public String toString(final NumberFormat format){
  return new Vector3DFormat(format).format(toVector3D());
}
Program: 57257
Project: 57257
Buggy source:
/** 
 * Scans the list of (required and optional) optimization data that characterize the problem.
 * @param optData Optimization data.The following data will be looked for: <ul> <li> {@link InitialStep}</li> </ul>
 */
@Override protected void parseOptimizationData(OptimizationData... optData){
  super.parseOptimizationData(optData);
  for (  OptimizationData data : optData) {
    if (data instanceof BracketingStep) {
      initialStep=((BracketingStep)data).getBracketingStep();
      break;
    }
  }
  checkParameters();
}

Fixed version (ground truth):
/** 
 * Scans the list of (required and optional) optimization data that characterize the problem.
 * @param optData Optimization data.The following data will be looked for: <ul> <li> {@link BracketingStep}</li> </ul>
 */
@Override protected void parseOptimizationData(OptimizationData... optData){
  super.parseOptimizationData(optData);
  for (  OptimizationData data : optData) {
    if (data instanceof BracketingStep) {
      initialStep=((BracketingStep)data).getBracketingStep();
      break;
    }
  }
  checkParameters();
}
Program: 57258
Project: 57258
Buggy source:
/** 
 * {@inheritDoc}
 * @param optData Optimization data. In addition to those documented in{@link MultivariateOptimizer#parseOptimizationData(OptimizationData[]) MultivariateOptimizer}, this method will register the following data: <ul> <li>  {@link ModelFunctionJacobian}</li> </ul>
 * @return {@inheritDoc}
 * @throws TooManyEvaluationsException if the maximal number ofevaluations is exceeded.
 * @throws DimensionMismatchException if the initial guess, target, and weightarguments have inconsistent dimensions.
 */
@Override public PointVectorValuePair optimize(OptimizationData... optData) throws TooManyEvaluationsException, DimensionMismatchException {
  return super.optimize(optData);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param optData Optimization data. In addition to those documented in{@link MultivariateVectorOptimizer#optimize(OptimizationData)}MultivariateOptimizer}, this method will register the following data: <ul> <li>  {@link ModelFunctionJacobian}</li> </ul>
 * @return {@inheritDoc}
 * @throws TooManyEvaluationsException if the maximal number ofevaluations is exceeded.
 * @throws DimensionMismatchException if the initial guess, target, and weightarguments have inconsistent dimensions.
 */
@Override public PointVectorValuePair optimize(OptimizationData... optData) throws TooManyEvaluationsException, DimensionMismatchException {
  return super.optimize(optData);
}
Program: 57259
Project: 57259
Buggy source:
/** 
 * Returns a pseudorandom, uniformly distributed <tt>long</tt> value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
 * @param n the bound on the random number to be returned.  Must bepositive.
 * @return  a pseudorandom, uniformly distributed <tt>long</tt>value between 0 (inclusive) and n (exclusive).
 * @throws IllegalArgumentException  if n is not positive.
 */
private static long nextLong(final SecureRandom rng,final long n) throws IllegalArgumentException {
  if (n > 0) {
    final byte[] byteArray=new byte[8];
    long bits;
    long val;
    do {
      rng.nextBytes(byteArray);
      bits=0;
      for (      final byte b : byteArray) {
        bits=(bits << 8) | (((long)b) & 0xffL);
      }
      bits=bits & 0x7fffffffffffffffL;
      val=bits % n;
    }
 while (bits - val + (n - 1) < 0);
    return val;
  }
  throw new NotStrictlyPositiveException(n);
}

Fixed version (ground truth):
/** 
 * Returns a pseudorandom, uniformly distributed <tt>long</tt> value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
 * @param rng random generator to use
 * @param n the bound on the random number to be returned.  Must bepositive.
 * @return  a pseudorandom, uniformly distributed <tt>long</tt>value between 0 (inclusive) and n (exclusive).
 * @throws IllegalArgumentException  if n is not positive.
 */
private static long nextLong(final SecureRandom rng,final long n) throws IllegalArgumentException {
  if (n > 0) {
    final byte[] byteArray=new byte[8];
    long bits;
    long val;
    do {
      rng.nextBytes(byteArray);
      bits=0;
      for (      final byte b : byteArray) {
        bits=(bits << 8) | (((long)b) & 0xffL);
      }
      bits=bits & 0x7fffffffffffffffL;
      val=bits % n;
    }
 while (bits - val + (n - 1) < 0);
    return val;
  }
  throw new NotStrictlyPositiveException(n);
}
Program: 57260
Project: 57260
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Constant(0);
}
Program: 57261
Project: 57261
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Sinh();
}
Program: 57262
Project: 57262
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Constant(1);
}
Program: 57263
Project: 57263
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Constant(-1);
}
Program: 57264
Project: 57264
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Cos();
}
Program: 57265
Project: 57265
Buggy source:
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public UnivariateFunction derivative(){
  return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
 */
@Deprecated public DifferentiableUnivariateFunction derivative(){
  return new Cosh();
}
Program: 57266
Project: 57266
Buggy source:
/** 
 * Creates a new EmpiricalDistribution with default bin count using the provided   {@link RandomDataImpl} as the source of random data.
 * @param randomData random data generator (may be null, resulting in default JDK generator)
 * @since 3.0
 */
public EmpiricalDistribution(RandomDataImpl randomData){
  this(DEFAULT_BIN_COUNT,randomData);
}

Fixed version (ground truth):
/** 
 * Creates a new EmpiricalDistribution with default bin count using the provided   {@link RandomDataImpl} as the source of random data.
 * @param randomData random data generator (may be null, resulting in default JDK generator)
 * @since 3.0
 */
public EmpiricalDistribution(RandomDataGenerator randomData){
  this(DEFAULT_BIN_COUNT,randomData);
}
Program: 57267
Project: 57267
Buggy source:
/** 
 * Construct a ValueServer instance using a RandomDataImpl as its source of random data.
 * @param randomData the RandomDataImpl instance used to source random data
 * @since 3.0
 */
public ValueServer(RandomDataImpl randomData){
  this.randomData=randomData;
}

Fixed version (ground truth):
/** 
 * Construct a ValueServer instance using a RandomDataImpl as its source of random data.
 * @param randomData the RandomDataImpl instance used to source random data
 * @since 3.0
 */
public ValueServer(RandomDataGenerator randomData){
  this.randomData=randomData;
}
Program: 57270
Project: 57270
Buggy source:
/** 
 * Returns whether the calculated eigen values are complex or real. <p>The method performs a zero check for each element of the  {@link #getImagEigenvalues()} array and returns {@code true} if anyelement is not equal to zero.
 * @return {@code true} if the eigen values are complex, {@code false} otherwise
 * @since 3.1
 */
public boolean hasComplexEigenvalues(){
  for (int i=0; i < imagEigenvalues.length; i++) {
    if (!Precision.equals(imagEigenvalues[i],0.0,epsilon)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the calculated eigen values are complex or real. <p>The method performs a zero check for each element of the  {@link #getImagEigenvalues()} array and returns {@code true} if anyelement is not equal to zero.
 * @return {@code true} if the eigen values are complex, {@code false} otherwise
 * @since 3.1
 */
public boolean hasComplexEigenvalues(){
  for (int i=0; i < imagEigenvalues.length; i++) {
    if (!Precision.equals(imagEigenvalues[i],0.0,EPSILON)) {
      return true;
    }
  }
  return false;
}
Program: 57271
Project: 57271
Buggy source:
/** 
 * Transforms the matrix to Schur form and calculates the eigenvalues.
 * @param matrix Matrix to transform.
 * @return the {@link SchurTransform} for this matrix
 */
private SchurTransformer transformToSchur(final RealMatrix matrix){
  final SchurTransformer schurTransform=new SchurTransformer(matrix);
  final double[][] matT=schurTransform.getT().getData();
  realEigenvalues=new double[matT.length];
  imagEigenvalues=new double[matT.length];
  for (int i=0; i < realEigenvalues.length; i++) {
    if (i == (realEigenvalues.length - 1) || Precision.equals(matT[i + 1][i],0.0,epsilon)) {
      realEigenvalues[i]=matT[i][i];
    }
 else {
      final double x=matT[i + 1][i + 1];
      final double p=0.5 * (matT[i][i] - x);
      final double z=FastMath.sqrt(FastMath.abs(p * p + matT[i + 1][i] * matT[i][i + 1]));
      realEigenvalues[i]=x + p;
      imagEigenvalues[i]=z;
      realEigenvalues[i + 1]=x + p;
      imagEigenvalues[i + 1]=-z;
      i++;
    }
  }
  return schurTransform;
}

Fixed version (ground truth):
/** 
 * Transforms the matrix to Schur form and calculates the eigenvalues.
 * @param matrix Matrix to transform.
 * @return the {@link SchurTransform} for this matrix
 */
private SchurTransformer transformToSchur(final RealMatrix matrix){
  final SchurTransformer schurTransform=new SchurTransformer(matrix);
  final double[][] matT=schurTransform.getT().getData();
  realEigenvalues=new double[matT.length];
  imagEigenvalues=new double[matT.length];
  for (int i=0; i < realEigenvalues.length; i++) {
    if (i == (realEigenvalues.length - 1) || Precision.equals(matT[i + 1][i],0.0,EPSILON)) {
      realEigenvalues[i]=matT[i][i];
    }
 else {
      final double x=matT[i + 1][i + 1];
      final double p=0.5 * (matT[i][i] - x);
      final double z=FastMath.sqrt(FastMath.abs(p * p + matT[i + 1][i] * matT[i][i + 1]));
      realEigenvalues[i]=x + p;
      imagEigenvalues[i]=z;
      realEigenvalues[i + 1]=x + p;
      imagEigenvalues[i + 1]=-z;
      i++;
    }
  }
  return schurTransform;
}