Package methods

Class AbstractGradientMethod

java.lang.Object
methods.AbstractGradientMethod
All Implemented Interfaces:
Method
Direct Known Subclasses:
ConjugateGradientMethod, FastGradientDescentMethod, GradientDescentMethod

public abstract class AbstractGradientMethod
extends java.lang.Object
implements Method
Abstract class for Gradients methods
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected double epsilon
    Calculation accuracy
    protected boolean log
    Should log result or not
    protected java.io.BufferedWriter out
    Writer for the log
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractGradientMethod​(double epsilon)
    Standard constructor
    AbstractGradientMethod​(double epsilon, boolean log, java.lang.String fileName)
    Full constructor
  • Method Summary

    Modifier and Type Method Description
    protected void log​(double[] x, double[] gradient)
    fucntion for logging method

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface interfaces.Method

    findMinimum
  • Field Details

    • epsilon

      protected final double epsilon
      Calculation accuracy
    • log

      protected final boolean log
      Should log result or not
    • out

      protected final java.io.BufferedWriter out
      Writer for the log
  • Constructor Details

    • AbstractGradientMethod

      public AbstractGradientMethod​(double epsilon, boolean log, java.lang.String fileName) throws java.io.FileNotFoundException
      Full constructor
      Parameters:
      epsilon - epsilon
      log - log
      fileName - output file for out
      Throws:
      java.io.FileNotFoundException
    • AbstractGradientMethod

      public AbstractGradientMethod​(double epsilon)
      Standard constructor
      Parameters:
      epsilon - epsilon
  • Method Details

    • log

      protected void log​(double[] x, double[] gradient) throws java.io.IOException
      fucntion for logging method
      Parameters:
      x - current point
      gradient - current gradient
      Throws:
      java.io.IOException - exception throwed by out