## org.apache.commons.math.optimization.linear
Class LinearObjectiveFunction

    java.lang.Object
      org.apache.commons.math.optimization.linear.LinearObjectiveFunction

All Implemented Interfaces:
  java.io.Serializable

    public class LinearObjectiveFunction

extends java.lang.Object
implements java.io.Serializable

An objective function for a linear optimization problem.

A linear objective function has one the form:

     c1x1 + ... cnxn + d

The ci and d are the coefficients of the equation, the xi are the coordinates of the current point.

Since:
  2.0
Version:
  $Revision: 922713 $ $Date: 2010-03-13 20:26:13 -0500 (Sat, 13 Mar 2010) $
See Also:
  Serialized Form

Field Summary
`private RealVector` `coefficients` Coefficients of the constraint (ci).
`private double` `constantTerm` Constant term of the linear equation.
`private static long` `serialVersionUID` Serializable version identifier.

Constructor Summary
`LinearObjectiveFunction(double[] coefficients, double constantTerm)`
`LinearObjectiveFunction(RealVector coefficients, double constantTerm)`

Method Summary
`boolean` `equals(java.lang.Object other)`
`RealVector` `getCoefficients()` Get the coefficients of the linear equation being optimized.
`double` `getConstantTerm()` Get the constant of the linear equation being optimized.
`double` `getValue(double[] point)` Compute the value of the linear equation at the current point
`double` `getValue(RealVector point)` Compute the value of the linear equation at the current point
`int` `hashCode()`
`private void` `readObject(java.io.ObjectInputStream ois)` Deserialize the instance.
`private void` `writeObject(java.io.ObjectOutputStream oos)` Serialize the instance.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    private static final long serialVersionUID

  Serializable version identifier.

  See Also:
    Constant Field Values

### coefficients

    private final transient RealVector coefficients

  Coefficients of the constraint (ci).

### constantTerm

    private final double constantTerm

  Constant term of the linear equation.

Constructor Detail

### LinearObjectiveFunction

    public LinearObjectiveFunction(double[] coefficients,
                                   double constantTerm)

Parameters:
  `coefficients` - The coefficients for the linear equation being optimized
  `constantTerm` - The constant term of the linear equation

### LinearObjectiveFunction

    public LinearObjectiveFunction(RealVector coefficients,
                                   double constantTerm)

Parameters:
  `coefficients` - The coefficients for the linear equation being optimized
  `constantTerm` - The constant term of the linear equation

Method Detail

### getCoefficients

    public RealVector getCoefficients()

  Get the coefficients of the linear equation being optimized.

  Returns:
    coefficients of the linear equation being optimized

### getConstantTerm

    public double getConstantTerm()

  Get the constant of the linear equation being optimized.

  Returns:
    constant of the linear equation being optimized

### getValue

    public double getValue(double[] point)

  Compute the value of the linear equation at the current point

  Parameters:
    `point` - point at which linear equation must be evaluated
  Returns:
    value of the linear equation at the current point

### getValue

    public double getValue(RealVector point)

  Compute the value of the linear equation at the current point

  Parameters:
    `point` - point at which linear equation must be evaluated
  Returns:
    value of the linear equation at the current point

### equals

    public boolean equals(java.lang.Object other)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### writeObject

    private void writeObject(java.io.ObjectOutputStream oos)
                      throws java.io.IOException

  Serialize the instance.

  Parameters:
    `oos` - stream where object should be written
  Throws:
    `java.io.IOException` - if object cannot be written to stream

### readObject

    private void readObject(java.io.ObjectInputStream ois)
                     throws java.lang.ClassNotFoundException,
                            java.io.IOException

  Deserialize the instance.

  Parameters:
    `ois` - stream from which the object should be read
  Throws:
    `java.lang.ClassNotFoundException` - if a class in the stream cannot be found
    `java.io.IOException` - if object cannot be read from the stream

Copyright (c) 2003-2011 Apache Software Foundation