org.opensha.commons.param.translate
Class LogTranslator

java.lang.Object
  extended by org.opensha.commons.param.translate.LogTranslator
All Implemented Interfaces:
TranslatorAPI

public class LogTranslator
extends 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.

Version:
1.0
Author:
Steven W. Rock

Constructor Summary
LogTranslator()
           
 
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

LogTranslator

public LogTranslator()
Method Detail

translate

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

reverse

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