Ipopt  3.12.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Scalable.java
Go to the documentation of this file.
1 
9 package org.coinor.examples.scalable;
10 
11 import org.coinor.Ipopt;
12 
23 public abstract class Scalable extends Ipopt
24 {
25  // Problem sizes
26  int n;
27  int m;
28  int nnz_jac_g;
29  int nnz_h_lag;
30 
31  // The bounds
32  double x_l[], x_u[];
33  double g_l[], g_u[];
34 
35  // the index style
36  int index_style;
37 
38  // The initial guess and solution
39  double x[];
40 
41  private String name;
42 
43  protected double gl;
44  protected double gu;
45 
51  public Scalable(String name, double gl, double gu)
52  {
53  this.name = name;
54  this.gl = gl;
55  this.gu = gu;
56  }
57 
58  public String toString()
59  {
60  return name;
61  }
62 
71  abstract public boolean initialize(int n);
72 
76  public void create()
77  {
78  super.create(n, m, nnz_jac_g, nnz_h_lag, index_style);
79  }
80 
81  public double[] getInitialGuess()
82  {
83  return x;
84  }
85 
86  public void print(double[] x, String str)
87  {
88  System.out.println(str);
89  for( int i = 0; i < x.length; ++i )
90  System.out.println(x[i]);
91  System.out.println();
92  }
93 }
void print(double[] x, String str)
Definition: Scalable.java:86
Abstract class for the scalable problems.
Definition: Scalable.java:23
abstract boolean initialize(int n)
In this function all problem sizes, bounds and initial guess should be initialized.
Scalable(String name, double gl, double gu)
Definition: Scalable.java:51
A Java Native Interface for the Ipopt optimization solver.
Definition: Ipopt.java:47
void create()
Creates the problem based on the already computed problem sizes and bounds.
Definition: Scalable.java:76