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

cern.jet.math.tdcomplex.DComplexPlusMultFirst 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.tdcomplex;

/**
 * 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 DComplexPlusMultFirst implements cern.colt.function.tdcomplex.DComplexDComplexDComplexFunction { /** * Public read/write access to avoid frequent object construction. */ public double[] multiplicator; /** * Insert the method's description here. Creation date: (8/10/99 19:12:09) */ protected DComplexPlusMultFirst(final double[] multiplicator) { this.multiplicator = multiplicator; } /** * Returns the result of the function evaluation. */ public final double[] apply(double[] a, double[] b) { double[] z = new double[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 DComplexPlusMultFirst minusDiv(final double[] constant) { return new DComplexPlusMultFirst(DComplex.neg(DComplex.inv(constant))); } /** * a - b*constant. */ public static DComplexPlusMultFirst minusMult(final double[] constant) { return new DComplexPlusMultFirst(DComplex.neg(constant)); } /** * a + b/constant. */ public static DComplexPlusMultFirst plusDiv(final double[] constant) { return new DComplexPlusMultFirst(DComplex.inv(constant)); } /** * a + b*constant. */ public static DComplexPlusMultFirst plusMult(final double[] constant) { return new DComplexPlusMultFirst(constant); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy