Commit a5c3f860 authored by gonciarz's avatar gonciarz

Removed unnecessary 'else' statements

parent e5d24100
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
......@@ -95,9 +95,7 @@ class ObjectProperties implements Runnable {
if (sz == 1) {
return regionPerimeter2D(aRegion, aRegions);
}
else {
return regionPerimeter3D(aRegion, aRegions);
}
return regionPerimeter3D(aRegion, aRegions);
}
private double regionPerimeter2D(Region aRegion, short[][][] aRegions) {
......
......@@ -377,13 +377,9 @@ public class ClusterSession {
if (f.getAbsolutePath().equals(tmp_dir + "Job" + JobID) == true) {
return true;
}
else {
return false;
}
}
else {
return true;
return false;
}
return true;
}
return false;
}
......
......@@ -91,10 +91,7 @@ public class FileClusterProfile extends GeneralProfile {
if (meta.replace("*", getUsername()) == null) {
return csv.getMetaInformation("run_dir") + File.separator;
}
else {
return meta.replace("*", getUsername()) + File.separator;
}
return meta.replace("*", getUsername()) + File.separator;
}
@Override
......@@ -127,9 +124,7 @@ public class FileClusterProfile extends GeneralProfile {
if (has_cp.equals("true")) {
return true;
}
else {
return false;
}
return false;
}
/**
......
......@@ -172,9 +172,7 @@ class LSFBatch implements BatchInterface {
if (unparse_last == true) {
return elements[elements.length - 1];
}
else {
return new String("");
}
return new String("");
}
private void updateJobStatus(JobStatus[] jobs, Vector<String> vt, int ja_id) {
......@@ -225,13 +223,11 @@ class LSFBatch implements BatchInterface {
if (tmp == 0) {
return str;
}
else {
if (AJobID == 0) {
AJobID = tmp;
}
System.out.println("get Job ID: " + AJobID);
return "";
if (AJobID == 0) {
AJobID = tmp;
}
System.out.println("get Job ID: " + AJobID);
return "";
}
return "";
}
......
......@@ -105,10 +105,8 @@ public class MaskOnSpaceMapper {
if (!iIsSthToCrop) {
return true;
}
else {
if (iInputIterator.isInBound(iNextPointWithNoOffset.add(iPointOffset))) {
return true;
}
if (iInputIterator.isInBound(iNextPointWithNoOffset.add(iPointOffset))) {
return true;
}
}
return false;
......
......@@ -172,14 +172,10 @@ public class MosaicUtils {
return cg.chooseFile("Choose segmentation", "Found multiple segmentations", PossibleFile);
}
else {
if (PossibleFile.size() == 1) {
return PossibleFile.get(0);
}
else {
return null;
}
if (PossibleFile.size() == 1) {
return PossibleFile.get(0);
}
return null;
}
/**
......@@ -221,10 +217,8 @@ public class MosaicUtils {
if (plugin == null) {
return true;
}
else {
if (sg[i].getName().equals(plugin)) {
return true;
}
if (sg[i].getName().equals(plugin)) {
return true;
}
}
}
......
......@@ -31,9 +31,7 @@ public class ShellCommand {
// we can use bash
return new String[] { "bash", "-c", cmd };
}
else {
return new String[] { "cmd", cmd };
}
return new String[] { "cmd", cmd };
}
/**
......
......@@ -39,24 +39,20 @@ class FitFunction extends AbstractObjectiveFunction {
if (iPotential.getType() == PotentialType.NONPARAM) {
return true;
}
else {
MinMaxMean mmmDistanceGrid = StatisticsUtils.getMinMaxMean(iDistancesGrid);
MinMaxMean mmmNNDistances = StatisticsUtils.getMinMaxMean(iNearestNeighborDistances);
// Check if epsilon/strenght and threshold/scale have reasonable values to not overflow calculations.
if (x[0] >= MachineEpsilon && x[0] <= 50 &&
MinMaxMean mmmDistanceGrid = StatisticsUtils.getMinMaxMean(iDistancesGrid);
MinMaxMean mmmNNDistances = StatisticsUtils.getMinMaxMean(iNearestNeighborDistances);
// Check if epsilon/strenght and threshold/scale have reasonable values to not overflow calculations.
if (x[0] >= MachineEpsilon && x[0] <= 50 &&
x[1] >= Math.max(Math.min(mmmDistanceGrid.min, mmmNNDistances.min), MachineEpsilon) &&
x[1] <= Math.max(mmmDistanceGrid.max, mmmNNDistances.max))
{
// 50 is aribtrary. but log(Double.MAXVAL)= log((2-(2^-52))*(2^1023))= 709.7827
return true;
}
else {
return false;
}
{
// 50 is aribtrary. but log(Double.MAXVAL)= log((2-(2^-52))*(2^1023))= 709.7827
return true;
}
return false;
}
@Override
public double valueOf(double[] x) {
if (iPotential.getType() == PotentialType.NONPARAM) {
......
......@@ -62,12 +62,9 @@ class HypothesisTesting {
}
return true;
}
else {
IJ.showMessage("Null hypothesis accepted, rank: " + i + " out of " + iNumOfMcRuns + " MC runs with alpha= " + iAlpha + " p-value: " + ((double) iNumOfMcRuns - i) / iNumOfMcRuns);
System.out.println("Null hypothesis: No interaction - Accepted, rank: " + i + " out of " + iNumOfMcRuns + " MC runs with alpha= " + iAlpha + " p-value: " + ((double) iNumOfMcRuns - i) / iNumOfMcRuns);
return false;
}
IJ.showMessage("Null hypothesis accepted, rank: " + i + " out of " + iNumOfMcRuns + " MC runs with alpha= " + iAlpha + " p-value: " + ((double) iNumOfMcRuns - i) / iNumOfMcRuns);
System.out.println("Null hypothesis: No interaction - Accepted, rank: " + i + " out of " + iNumOfMcRuns + " MC runs with alpha= " + iAlpha + " p-value: " + ((double) iNumOfMcRuns - i) / iNumOfMcRuns);
return false;
}
private void calculateT(double[] DRand, double[] T) {
......
......@@ -181,9 +181,7 @@ public class Potentials {
if (di < threshold) {
return -1d;
}
else {
return 0d;
}
return 0d;
}
@Override
......@@ -228,9 +226,7 @@ public class Potentials {
if (z > 0) {
return -1 / (1 + z);
}
else {
return -1 * (1 - z);
}
return -1 * (1 - z);
}
@Override
......@@ -275,9 +271,7 @@ public class Potentials {
if (z > 1) {
return 0;
}
else {
return -1 * (1 - z);
}
return -1 * (1 - z);
}
@Override
......@@ -372,9 +366,7 @@ public class Potentials {
if (z > 0) {
return -1 * Math.pow(1 + z * z, -.5);
}
else {
return -1;
}
return -1;
}
@Override
......@@ -419,9 +411,7 @@ public class Potentials {
if (z != 0) {
return 1 / (z * z);
}
else {
return Math.sqrt(Double.MAX_VALUE); // this is a hack.
}
return Math.sqrt(Double.MAX_VALUE); // this is a hack.
}
@Override
......
......@@ -217,13 +217,11 @@ public class InteractionAnalysisGui extends InteractionAnalysisGuiBase {
{
return true;
}
else {
System.out.println(iImgX.getWidth() + "," + iImgY.getWidth() + "," + iImgX.getHeight() + "," + iImgY.getHeight() + "," + iImgX.getStackSize() + "," + iImgY.getStackSize() + ","
+ imgxc.pixelDepth + "," + imgyc.pixelDepth + "," + imgxc.pixelHeight + "," + imgyc.pixelHeight + "," + imgxc.pixelWidth + "," + imgyc.pixelWidth + "," + imgxc.getUnit() + ","
+ imgyc.getUnit());
System.out.println(iImgX.getWidth() + "," + iImgY.getWidth() + "," + iImgX.getHeight() + "," + iImgY.getHeight() + "," + iImgX.getStackSize() + "," + iImgY.getStackSize() + ","
+ imgxc.pixelDepth + "," + imgyc.pixelDepth + "," + imgxc.pixelHeight + "," + imgyc.pixelHeight + "," + imgxc.pixelWidth + "," + imgyc.pixelWidth + "," + imgxc.getUnit() + ","
+ imgyc.getUnit());
return false;
}
return false;
}
private void generateMask() {
......
......@@ -325,32 +325,29 @@ public class ResultsWindow extends Frame implements FocusListener, ActionListene
IJ.run("Properties...");
return;
}
else {
// All provided data are correct! Get it and recalculate if
// needed.
pixelDimensions = width;
timeInterval = interval;
// Convert dimension unit to meters
if (unit.equals("nm")) {
pixelDimensions /= 1000000000; // convert from nm to m
}
else if (unit.equals(IJ.micronSymbol + "m") || unit.equals("um")) {
pixelDimensions /= 1000000; // convert from um to m
}
else if (unit.equals("mm")) {
pixelDimensions /= 1000; // convert from mm to nm
}
// convert time unit to seconds
if (intervalUnit.equals(IJ.micronSymbol + "s") || intervalUnit.equals("us")) {
timeInterval /= 1000000; // convert from us to s
}
else if (intervalUnit.equals("ms")) {
timeInterval /= 1000; // convert from ms to s
}
// All provided data are correct! Get it and recalculate if
// needed.
pixelDimensions = width;
timeInterval = interval;
// Convert dimension unit to meters
if (unit.equals("nm")) {
pixelDimensions /= 1000000000; // convert from nm to m
}
else if (unit.equals(IJ.micronSymbol + "m") || unit.equals("um")) {
pixelDimensions /= 1000000; // convert from um to m
}
else if (unit.equals("mm")) {
pixelDimensions /= 1000; // convert from mm to nm
}
// convert time unit to seconds
if (intervalUnit.equals(IJ.micronSymbol + "s") || intervalUnit.equals("us")) {
timeInterval /= 1000000; // convert from us to s
}
else if (intervalUnit.equals("ms")) {
timeInterval /= 1000; // convert from ms to s
}
}
......
......@@ -428,18 +428,16 @@ public class PSF_Tool implements PlugInFilter, MouseListener, ActionListener, Wi
if (PSF[0]< d) {
return 0.0;
}
else{
int v = 0;
while (PSF[v] > d){
v++;
}
final double p0 = PSF[v-1];
final double p1 = PSF[v];
final double r0 = rad[v-1];
final double r1 = rad[v];
whm = r0 + (r1-r0)/(p1-p0)*(d-p0);
return whm;
int v = 0;
while (PSF[v] > d){
v++;
}
final double p0 = PSF[v-1];
final double p1 = PSF[v];
final double r0 = rad[v-1];
final double r1 = rad[v];
whm = r0 + (r1-r0)/(p1-p0)*(d-p0);
return whm;
}
......
......@@ -220,10 +220,8 @@ public class ParticleTracker3DModular_ implements PlugInFilter, Measurements, Pr
IJ.error("You must load an Image Sequence or Movie first");
return DONE;
}
else {
vFI = iInputImage.getOriginalFileInfo();
create_bck_image = false;
}
vFI = iInputImage.getOriginalFileInfo();
create_bck_image = false;
// Check if there are segmentation information
if (MosaicUtils.checkSegmentationInfo(aInputImage, null)) {
......@@ -839,9 +837,7 @@ public class ParticleTracker3DModular_ implements PlugInFilter, Measurements, Pr
// Added by Guy Levy, 18.08.06 - A change form original implementation
// If this particle is linked to a "real" particle that is already linked, stop building the trajectory
}
else {
break;
}
break;
}
}
if (found == -1) {
......@@ -1213,10 +1209,8 @@ public class ParticleTracker3DModular_ implements PlugInFilter, Measurements, Pr
IJ.error("One moment please ..., we are computing the image");
return;
}
else {
IJ.error("An internal error has occurred we are not able to compute the result image");
return;
}
IJ.error("An internal error has occurred we are not able to compute the result image");
return;
}
// if there is no image to generate the view on:
......
......@@ -137,9 +137,7 @@ public class Region_Competition implements PlugInFilter {
if (inputImageChosenByUser != null && originalInputImage == null) {
return NO_IMAGE_REQUIRED;
}
else {
return DOES_ALL + NO_CHANGES;
}
return DOES_ALL + NO_CHANGES;
}
@Override
......@@ -155,9 +153,7 @@ public class Region_Competition implements PlugInFilter {
// Finish - nothing to do more here...
return;
}
else {
runRegionCompetion();
}
runRegionCompetion();
// ================= Save segmented image and statistics ==========
//
......
......@@ -28,9 +28,7 @@ abstract class GUImeMore {
if (gd.wasCanceled()) {
return;
}
else {
process();
}
process();
}
/**
......
......@@ -99,9 +99,7 @@ public class GenericDialogGUI {
gd.actionPerformed(new ActionEvent(cancel, 0, "Cancel pressed"));
return;
}
else {
roi = inputImage.getRoi();
}
roi = inputImage.getRoi();
if (roi == null) {
IJ.showMessage("You have chosen initialization type to ROI.\nPlease add ROI region(s) to plugin input image (" + inputImage.getTitle() + ").");
inputImage.show();
......@@ -733,9 +731,7 @@ class TextAreaListener implements DropTargetListener, TextListener, FocusListene
if (elem.startsWith("file")) {
break;
}
else {
elem = "";
}
elem = "";
}
textArea.setText(elem);
ta.setText(null);
......
......@@ -90,23 +90,19 @@ public class E_Deconvolution extends ExternalEnergy {
return values.get((values.size() + 1) / 2 - 1);
}
else {
final float lower = values.get(values.size() / 2 - 1);
final float upper = values.get(values.size() / 2);
if (Float.isInfinite(lower) || Float.isInfinite(upper)) {
int i = values.size() / 2;
for (; i >= 0; i--) {
if (Float.isInfinite(values.get(i)) == false) {
break;
}
final float lower = values.get(values.size() / 2 - 1);
final float upper = values.get(values.size() / 2);
if (Float.isInfinite(lower) || Float.isInfinite(upper)) {
int i = values.size() / 2;
for (; i >= 0; i--) {
if (Float.isInfinite(values.get(i)) == false) {
break;
}
return values.get(i);
}
else {
return (lower + upper) / 2.0f;
}
return values.get(i);
}
return (lower + upper) / 2.0f;
}
public void GenerateModelImage(LabelImage aLabelImage, HashMap<Integer, LabelStatistics> labelMap) {
......
......@@ -83,9 +83,7 @@ public class RCWWin extends JDialog implements MouseListener, Runnable {
if (ask.wasCanceled()) {
return -1;
}
else {
return ask.getNextNumber();
}
return ask.getNextNumber();
}
private String[] GetROI() {
......@@ -107,12 +105,10 @@ public class RCWWin extends JDialog implements MouseListener, Runnable {
if (container instanceof JButton) {
return (JButton) container;
}
else {
final Component[] components = container.getComponents();
for (final Component component : components) {
if (component instanceof Container) {
return getButtonSubComponent((Container) component);
}
final Component[] components = container.getComponents();
for (final Component component : components) {
if (component instanceof Container) {
return getButtonSubComponent((Container) component);
}
}
return null;
......
......@@ -82,10 +82,10 @@ public class Debug { // NO_UCD (code used only for debugging)
// cannot go deeper
return;
} else {
aOutputBuffer.append("[" + (len) + "]");
}
aOutputBuffer.append("[" + (len) + "]");
Object deepElement = Array.get(aArrayObj, 0);
if (deepElement != null) {
Class<?> deepClass = deepElement.getClass();
......
......@@ -30,15 +30,13 @@ public class MathOps {
return ans1 / ans2;
}
else {
final double z = 8.0 / ax;
final double y = z * z;
final double xx = ax - 0.785398164;
final double ans1 = 1.0 + y * (-0.1098628627e-2 + y * (0.2734510407e-4 + y * (-0.2073370639e-5 + y * 0.2093887211e-6)));
final double ans2 = -0.1562499995e-1 + y * (0.1430488765e-3 + y * (-0.6911147651e-5 + y * (0.7621095161e-6 - y * 0.934935152e-7)));
return Math.sqrt(0.636619772 / ax) * (Math.cos(xx) * ans1 - z * Math.sin(xx) * ans2);
}
final double z = 8.0 / ax;
final double y = z * z;
final double xx = ax - 0.785398164;
final double ans1 = 1.0 + y * (-0.1098628627e-2 + y * (0.2734510407e-4 + y * (-0.2073370639e-5 + y * 0.2093887211e-6)));
final double ans2 = -0.1562499995e-1 + y * (0.1430488765e-3 + y * (-0.6911147651e-5 + y * (0.7621095161e-6 - y * 0.934935152e-7)));
return Math.sqrt(0.636619772 / ax) * (Math.cos(xx) * ans1 - z * Math.sin(xx) * ans2);
}
/**
......@@ -56,18 +54,17 @@ public class MathOps {
ans2 = 144725228442.0 + y * (2300535178.0 + y * (18583304.74 + y * (99447.43394 + y * (376.9991397 + y * 1.0))));
return ans1 / ans2;
}
else {
final double z = 8.0 / ax;
final double xx = ax - 2.356194491;
y = z * z;
ans1 = 1.0 + y * (0.183105e-2 + y * (-0.3516396496e-4 + y * (0.2457520174e-5 + y * (-0.240337019e-6))));
ans2 = 0.04687499995 + y * (-0.2002690873e-3 + y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));
double ans = Math.sqrt(0.636619772 / ax) * (Math.cos(xx) * ans1 - z * Math.sin(xx) * ans2);
if (aX < 0.0) {
ans = -ans;
}
return ans;
final double z = 8.0 / ax;
final double xx = ax - 2.356194491;
y = z * z;
ans1 = 1.0 + y * (0.183105e-2 + y * (-0.3516396496e-4 + y * (0.2457520174e-5 + y * (-0.240337019e-6))));
ans2 = 0.04687499995 + y * (-0.2002690873e-3 + y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));
double ans = Math.sqrt(0.636619772 / ax) * (Math.cos(xx) * ans1 - z * Math.sin(xx) * ans2);
if (aX < 0.0) {
ans = -ans;
}
return ans;
}
}
......@@ -138,13 +138,12 @@ public class StatisticsUtils {
if (intPos == size - 1) {
return sorted[size - 1];
}
else {
final double diff = realPos - intPos;
final double lower = sorted[intPos];
final double upper = sorted[intPos + 1];
// return linear interpolation based on diff value
return lower + diff * (upper - lower);
}
final double diff = realPos - intPos;
final double lower = sorted[intPos];
final double upper = sorted[intPos + 1];
// return linear interpolation based on diff value
return lower + diff * (upper - lower);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment