de.jtem.jtao
Class TaoApplication

java.lang.Object
  extended by de.jtem.jpetsc.PrimitivNative
      extended by de.jtem.jpetsc.Native
          extended by de.jtem.jtao.TaoApplication

public abstract class TaoApplication
extends Native


Nested Class Summary
static class TaoApplication.ComputeHessianResult
          Result class for computeHessian(de.jtem.jpetsc.Vec)
 
Field Summary
 
Fields inherited from class de.jtem.jpetsc.PrimitivNative
destroyNative
 
Constructor Summary
TaoApplication()
           
TaoApplication(int comm)
           
 
Method Summary
 void computeGradient(Vec X, Vec f)
          Compute the gradient of the objective function using the
routine set by TaoApplicationSetGradientRoutine().
 TaoApplication.ComputeHessianResult computeHessian(Vec X)
          Compute the Hessian of the objective function using the
routine set by TaoApplicationSetGradientRoutine().
 void defaultComputeGradient(Vec X, Vec G)
          computes the gradient using finite differences
 void destroy()
          Destroy the PETSc application
and all of the vectors and matrices associated with it.
 Vec getFunctionVec()
          Get the Vec that used to store the constraint function.
 Vec getSolutionVec()
          Get the vector with the
solution in the current application.
protected  void nativeCreate()
           
 void queryRemoveObject(java.lang.String key)
          add an object from to the Tao Application.
 void setDefaultSolutionVec(Vec xx)
          Sets the vector representing the variables
and an initial guess.
 void setFromOptions()
          Sets various TAO parameters from user options
 void setFunctionVec(Vec r)
          Set the Vec that will be used to store the constraint function.
protected  void setGradientFunction()
           
protected  void setHessianFunction()
           
 void setHessianMat(Mat H, Mat HP)
          Sets the matrix representing the Hessian
and the matrix used to precondition it.
 void setInitialSolutionVec(Vec xx)
          Sets the vector representing the variables
and an initial guess.
 void setJacobianMat(Mat J, Mat JP)
          Sets the matrix to be used for the Jacobian.
protected  void setObjectiveAndGradientFunction()
           
protected  void setObjectiveFunction()
           
 void setRelativeTolerance(double grtol)
          Set convergence tolerance
 void setVariableBounds(Vec XL, Vec XU)
          Set bounds on the variables.
protected  void TaoApplicationCreate(int comm)
           
 
Methods inherited from class de.jtem.jpetsc.PrimitivNative
finalize, getNativeObjectToString, load, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TaoApplication

public TaoApplication()

TaoApplication

public TaoApplication(int comm)
Method Detail

nativeCreate

protected void nativeCreate()
Specified by:
nativeCreate in class Native

TaoApplicationCreate

protected void TaoApplicationCreate(int comm)

setObjectiveFunction

protected void setObjectiveFunction()

setGradientFunction

protected void setGradientFunction()

setObjectiveAndGradientFunction

protected void setObjectiveAndGradientFunction()

setHessianFunction

protected void setHessianFunction()

setRelativeTolerance

public void setRelativeTolerance(double grtol)
Set convergence tolerance

Parameters:
grtol - relative tolerance

computeGradient

public void computeGradient(Vec X,
                            Vec f)
Compute the gradient of the objective function using the
routine set by TaoApplicationSetGradientRoutine().

Parameters:
X - the point where the objective should be evaluated
f -
See Also:
computeGradient(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), #computeObjectiveAndGradient

computeHessian

public TaoApplication.ComputeHessianResult computeHessian(Vec X)
Compute the Hessian of the objective function using the
routine set by TaoApplicationSetGradientRoutine().

Parameters:
X - the variable vector
Returns:
TaoApplication.ComputeHessianResult
See Also:
#computeObjectiveAndGradient

setHessianMat

public void setHessianMat(Mat H,
                          Mat HP)
Sets the matrix representing the Hessian
and the matrix used to precondition it.

Parameters:
H - the matrix used for the Hessian
HP - the matrix used to precondition the Hessian matrix.
See Also:
#setHessianRoutine

setVariableBounds

public void setVariableBounds(Vec XL,
                              Vec XU)
Set bounds on the variables.

Parameters:
XL - vector of lower bounds upon the solution vector
XU - vector of upper bounds upon the solution vector
See Also:
#TaoGetVariableBoundVecs, #setVariableBoundsRoutine

setFunctionVec

public void setFunctionVec(Vec r)
Set the Vec that will be used to store the constraint function.

Parameters:
r - vector to constrainf function values
See Also:
setJacobianMat(de.jtem.jpetsc.Mat, de.jtem.jpetsc.Mat), #setConstraintRoutine

getFunctionVec

public Vec getFunctionVec()
Get the Vec that used to store the constraint function.

See Also:
setJacobianMat(de.jtem.jpetsc.Mat, de.jtem.jpetsc.Mat), #setConstraintRoutine

setJacobianMat

public void setJacobianMat(Mat J,
                           Mat JP)
Sets the matrix to be used for the Jacobian.

Parameters:
J - Jacobian matrix
JP - Preconditioner for Jacobian
See Also:
#setJacobianRoutine, setFunctionVec(de.jtem.jpetsc.Vec)

destroy

public void destroy()
Destroy the PETSc application
and all of the vectors and matrices associated with it.

See Also:
#licationCreate, #TaoDestroy

setInitialSolutionVec

public void setInitialSolutionVec(Vec xx)
Sets the vector representing the variables
and an initial guess.

Parameters:
xx - variable vector that stores the solution
See Also:
getSolutionVec(), #setObjectiveRoutine

setDefaultSolutionVec

public void setDefaultSolutionVec(Vec xx)
Sets the vector representing the variables
and an initial guess.

Parameters:
xx - variable vector that stores the solution
See Also:
getSolutionVec(), #setObjectiveRoutine, setInitialSolutionVec(de.jtem.jpetsc.Vec)

getSolutionVec

public Vec getSolutionVec()
Get the vector with the
solution in the current application.

Returns:
the solution vector

queryRemoveObject

public void queryRemoveObject(java.lang.String key)
add an object from to the Tao Application.

Parameters:
key - string used to ID this object
See Also:
#queryForObject

setFromOptions

public void setFromOptions()
Sets various TAO parameters from user options

See Also:
#TaoSetFromOptions

defaultComputeGradient

public void defaultComputeGradient(Vec X,
                                   Vec G)
computes the gradient using finite differences

Parameters:
X - compute gradient at this point
G -
See Also:
defaultComputeGradient(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), #setGradientRoutine