Class LogTranslator

  extended by org.opensha.commons.param.translate.LogTranslator
All Implemented Interfaces:

public class LogTranslator
extends java.lang.Object
implements TranslatorAPI

Title: LogTranslator

Description: Translates values into the log space and back. Throws translate errors when trying to take the log of negative or zero values.

Implementation of a translation framework. These concrete TranslatorAPI classes can be passed into a TranslatedParameter, then the parameter will use this class to translate values when getting and setting values in the parameter.

This one instance is used to let users deal with the log of a value in the IMRTesterApplet, but the IMR when it does it's calculation it uses the normal space values.

Steven W. Rock

Constructor Summary
Method Summary
 double reverse(double val)
          Takes the inverse log of a number, i.e.
 double translate(double val)
          Takes the log of a positive value > 0, else throws TranslateException.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public LogTranslator()
Method Detail


public double translate(double val)
Takes the log of a positive value > 0, else throws TranslateException. Translates values from normal to log space.

Specified by:
translate in interface TranslatorAPI


public double reverse(double val)
Takes the inverse log of a number, i.e. Math.exp(val). Translates values from log space to normal space.

Specified by:
reverse in interface TranslatorAPI