All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cern.jet.math.tfcomplex.FComplexPlusMultFirst Maven / Gradle / Ivy

Go to download

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*constant + b *
  • a*constant - b *
  • a/constant + b *
  • a/constant - b *
* 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 FComplexPlusMultFirst 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 FComplexPlusMultFirst(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] = a[0] * multiplicator[0] - a[1] * multiplicator[1]; z[1] = a[1] * multiplicator[0] + a[0] * multiplicator[1]; z[0] += b[0]; z[1] += b[1]; return z; } /** * a - b/constant. */ public static FComplexPlusMultFirst minusDiv(final float[] constant) { return new FComplexPlusMultFirst(FComplex.neg(FComplex.inv(constant))); } /** * a - b*constant. */ public static FComplexPlusMultFirst minusMult(final float[] constant) { return new FComplexPlusMultFirst(FComplex.neg(constant)); } /** * a + b/constant. */ public static FComplexPlusMultFirst plusDiv(final float[] constant) { return new FComplexPlusMultFirst(FComplex.inv(constant)); } /** * a + b*constant. */ public static FComplexPlusMultFirst plusMult(final float[] constant) { return new FComplexPlusMultFirst(constant); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy