- Main Page
- Classes
- Files

- File List
- File Members

# contrib/JavaInterface/org/coinor/examples/scalable/Scalable.java

Go to the documentation of this file.

    00001
    00009 package org.coinor.examples.scalable;
    00010
    00011 import org.coinor.Ipopt;
    00012
    00023 public abstract class Scalable extends Ipopt
    00024 {
    00025     // Problem sizes
    00026     int n;
    00027     int m;
    00028     int nnz_jac_g;
    00029     int nnz_h_lag;
    00030
    00031     // The bounds
    00032     double x_l[], x_u[];
    00033     double g_l[], g_u[];
    00034
    00035     // the index style
    00036     int index_style;
    00037
    00038     // The initial guess and solution
    00039     double x[];
    00040
    00041     private String name;
    00042
    00043     protected double gl;
    00044     protected double gu;
    00045
    00051     public Scalable(String name, double gl, double gu)
    00052     {
    00053         this.name = name;
    00054         this.gl = gl;
    00055         this.gu = gu;
    00056     }
    00057
    00058     public String toString()
    00059     {
    00060         return name;
    00061     }
    00062
    00071     abstract public boolean initialize(int n);
    00072
    00076     public void create()
    00077     {
    00078         super.create(n, m, nnz_jac_g, nnz_h_lag, index_style);
    00079     }
    00080
    00081     public double[] getInitialGuess()
    00082     {
    00083         return x;
    00084     }
    00085
    00086     public void print(double[] x, String str)
    00087     {
    00088         System.out.println(str);
    00089         for( int i = 0; i < x.length; ++i )
    00090             System.out.println(x[i]);
    00091         System.out.println();
    00092     }
    00093 }

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines