cern.jet.math.tfcomplex.FComplexPlusMultSecond Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parallelcolt Show documentation
Show all versions of parallelcolt Show documentation
Parallel Colt is a multithreaded version of Colt - a library for high performance scientific computing in Java. It contains efficient algorithms for data analysis, linear algebra, multi-dimensional arrays, Fourier transforms, statistics and histogramming.
The newest version!
package cern.jet.math.tfcomplex;
/**
* Only for performance tuning of compute intensive linear algebraic
* computations. Constructs functions that return one of
*
* - a + b*constant
*
- a - b*constant
*
- a + b/constant
*
- a - b/constant
*
* a and b are variables, constant is fixed, but for
* performance reasons publicly accessible. Intended to be passed to
* matrix.assign(otherMatrix,function) methods.
*/
public class FComplexPlusMultSecond implements cern.colt.function.tfcomplex.FComplexFComplexFComplexFunction {
/**
* Public read/write access to avoid frequent object construction.
*/
public float[] multiplicator;
/**
* Insert the method's description here. Creation date: (8/10/99 19:12:09)
*/
protected FComplexPlusMultSecond(final float[] multiplicator) {
this.multiplicator = multiplicator;
}
/**
* Returns the result of the function evaluation.
*/
public final float[] apply(float[] a, float[] b) {
float[] z = new float[2];
z[0] = b[0] * multiplicator[0] - b[1] * multiplicator[1];
z[1] = b[1] * multiplicator[0] + b[0] * multiplicator[1];
z[0] += a[0];
z[1] += a[1];
return z;
}
/**
* a - b/constant.
*/
public static FComplexPlusMultSecond minusDiv(final float[] constant) {
return new FComplexPlusMultSecond(FComplex.neg(FComplex.inv(constant)));
}
/**
* a - b*constant.
*/
public static FComplexPlusMultSecond minusMult(final float[] constant) {
return new FComplexPlusMultSecond(FComplex.neg(constant));
}
/**
* a + b/constant.
*/
public static FComplexPlusMultSecond plusDiv(final float[] constant) {
return new FComplexPlusMultSecond(FComplex.inv(constant));
}
/**
* a + b*constant.
*/
public static FComplexPlusMultSecond plusMult(final float[] constant) {
return new FComplexPlusMultSecond(constant);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy