Skip to content

Commit 13b9f56

Browse files
committed
remove trailing whitespace
1 parent dada3a2 commit 13b9f56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+459
-460
lines changed

AUTHORS

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ Contributors:
111111
R interface with examples, all files in directory (and subdirectory of)
112112

113113
contrib/RInterface
114-
114+
115115
- Tony Kelman (Berkeley)
116116
improvements to Matlab interface
117-
117+
118118
Ipopt/contrib/MatlabInterface
119119

120120
- Gabriel Hackebeil
121121
improved use compound component spaces
122-
122+
123123
- Nai-Yuan Chiang and Victor M. Zavala Tejeda (Argonne National Laboratory)
124124
inertia free curvature test in solution of primal-dual system (full approach)
125125

126126
- Brad Bell
127127
recursive NLP example
128-
128+
129129
examples/recursive_nlp/recursive_nlp.cpp
130130

131131
- Mitchell Clement

ChangeLog

+4-4
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ commit history.
439439
- fix a memory allocation in Java interface in cases where jint
440440
has a different size than int [r2513]
441441
- the buildsystem now tries the Accelerate framework instead of
442-
vecLib for finding Blas/Lapack on MacOS X
442+
vecLib for finding Blas/Lapack on MacOS X
443443

444444
2014-08-16 releases/3.11.9
445445
- fix compilation issue of Java interface on systems where Index
@@ -583,12 +583,12 @@ commit history.
583583
of internally within the mex code (replace Matlab call to ipopt with
584584
ipopt_auxdata if using auxiliary data in any callbacks) [r2282]
585585
- exposed more intermediate Ipopt information to iterfunc callback [r2283]
586-
586+
587587
- fixes to JIpopt buildsystem (now may work on windows and uses libtool)
588588
- JIpopt now reads options file ipopt.opt by default, if present
589589
- removed predefined KEY_ strings in JIpopt
590590
- renamed API functions that retrieve solution values in JIpopt
591-
591+
592592
- simplified installation of R interface
593593

594594
2013-05-05 releases/3.10.4
@@ -796,7 +796,7 @@ commit history.
796796
(no longer in include/ipopt)
797797
- default for dual_inf_tol is now 1 (instead of 1e-4)
798798
- In matlab interface, here the text from Peter Carbonetto:
799-
There have been several significant changes made to the MATLAB interface since the last release. The most important two changes are: 1) Following the "warm start" feature of IPOPT, you may pass in initial estimates for the Lagrange multipliers. 2) Callback routines for computing the objective, gradient (etc.) are now specified using function handles instead of strings. (Thanks to Marcus Brubaker at the University of Toronto for the initial suggestion.)
799+
There have been several significant changes made to the MATLAB interface since the last release. The most important two changes are: 1) Following the "warm start" feature of IPOPT, you may pass in initial estimates for the Lagrange multipliers. 2) Callback routines for computing the objective, gradient (etc.) are now specified using function handles instead of strings. (Thanks to Marcus Brubaker at the University of Toronto for the initial suggestion.)
800800

801801
2007-09-25 releases/3.3.3
802802
- minor changes, bug fixes

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ fi
357357
if test "$enable_java" != no ; then
358358
# the following macros can make configure stop with an error
359359
# we could work around that, but having javac and no jar, java, or javadoc would be odd anyway
360-
360+
361361
# look for jar: required to pack Java interface
362362
AX_PROG_JAR
363363
# look for more java to run tests and examples and do documentation
@@ -577,7 +577,7 @@ if test "$use_sipopt" = yes ; then
577577
fi
578578

579579
# under Windows, the Makevars file for the R Interface need to be named Makevars.win
580-
case $build in
580+
case $build in
581581
*-cygwin* | *-mingw* | *-msys* )
582582
AC_CONFIG_FILES([contrib/RInterface/src/Makevars.win:contrib/RInterface/src/Makevars.in])
583583
;;

contrib/RInterface/CHANGELOG

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
R> res$constraints
1414
R> res$lambda
1515

16-
* Removed ipoptr_environment as argument in ipoptr because it wasn't useful and it caused undesired behaviour in
16+
* Removed ipoptr_environment as argument in ipoptr because it wasn't useful and it caused undesired behaviour in
1717
combination with the data.table package (thanks to Florian Oswald for reporting).
18-
18+
1919
20 November 2011, version 0.8.3:
2020

2121
* Added #include <assert.h> to src/IpoptRNLP.hpp

contrib/RInterface/R/get.option.types.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Author: Jelmer Ypma
66
# Date: 18 April 2010
77
#
8-
# This function converts a list with ipopt options into
9-
# three sub-lists, where the options are sorted into
8+
# This function converts a list with ipopt options into
9+
# three sub-lists, where the options are sorted into
1010
# the different value types (integer, numeric, string).
1111
#
1212
# Input: list of ipopt options and their values
@@ -175,14 +175,14 @@ get.option.types <- function(opts) {
175175
"wsmp_singularity_threshold"="numeric"
176176
)
177177

178-
178+
179179

180180
# initialize list with options sorted by type
181181
converted.opts <- list( "integer"=list(), "string"=list(), "numeric"=list() )
182182

183183
is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) abs(x - round(x)) < tol
184184

185-
# check if we have at least 1 element in the list, otherwise the
185+
# check if we have at least 1 element in the list, otherwise the
186186
# loop runs from 1 to down 0 and we get errors
187187
if ( length( opts ) > 0 ) {
188188

@@ -200,7 +200,7 @@ get.option.types <- function(opts) {
200200
}
201201
cat( paste( "Warning: ", names(opts)[i], " is not a recognized option, we try to pass it to Ipopt as ", tmp.type, "\n" ) )
202202
}
203-
203+
204204
if ( tmp.type=="string" ) {
205205
converted.opts$string[[ names(opts)[i] ]] <- as.character(opts[[i]])
206206
} else if ( tmp.type=="integer" ) {

contrib/RInterface/R/ipoptr.R

+37-37
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#
88
# Changelog:
99
# 09/03/2012: Added outputs, z_L, z_U, constraints, lambda (thanks to Michael Schedl)
10-
# 09/03/2012: Removed ipoptr_environment because this caused a bug in combination with
10+
# 09/03/2012: Removed ipoptr_environment because this caused a bug in combination with
1111
# data.table and it wasn't useful (thanks to Florian Oswald for reporting)
1212
#
13-
# Input:
13+
# Input:
1414
# x0 : vector with initial values
1515
# eval_f : function to evaluate objective function
1616
# eval_grad_f : function to evaluate gradient of objective function
@@ -39,39 +39,39 @@
3939
# lambda : final values for the Lagrange mulipliers
4040

4141
ipoptr <-
42-
function( x0,
43-
eval_f,
44-
eval_grad_f,
45-
lb = NULL,
46-
ub = NULL,
47-
eval_g = function( x ) { return( numeric(0) ) },
48-
eval_jac_g = function( x ) { return( numeric(0) ) },
42+
function( x0,
43+
eval_f,
44+
eval_grad_f,
45+
lb = NULL,
46+
ub = NULL,
47+
eval_g = function( x ) { return( numeric(0) ) },
48+
eval_jac_g = function( x ) { return( numeric(0) ) },
4949
eval_jac_g_structure = list(),
50-
constraint_lb = numeric(0),
50+
constraint_lb = numeric(0),
5151
constraint_ub = numeric(0),
5252
eval_h = NULL,
5353
eval_h_structure = NULL,
5454
opts = list(),
5555
... ) {
56-
56+
5757
# define 'infinite' lower and upper bounds of the control if they haven't been set
5858
if ( is.null( lb ) ) { lb <- rep( -Inf, length(x0) ) }
5959
if ( is.null( ub ) ) { ub <- rep( Inf, length(x0) ) }
6060

6161
# internal function to check the arguments of the functions
6262
checkFunctionArguments <- function( fun, arglist, funname ) {
6363
if( !is.function(fun) ) stop(paste(funname, " must be a function\n", sep = ""))
64-
64+
6565
# determine function arguments
6666
fargs <- formals(fun)
67-
67+
6868
if ( length(fargs) > 1 ) {
6969
# determine argument names user-defined function
7070
argnames_udf <- names(fargs)[2:length(fargs)] # remove first argument, which is x
71-
71+
7272
# determine argument names that where supplied to ipoptr()
7373
argnames_supplied <- names(arglist)
74-
74+
7575
# determine which arguments where required but not supplied
7676
m1 = match(argnames_udf, argnames_supplied)
7777
if( any(is.na(m1)) ){
@@ -80,7 +80,7 @@ function( x0,
8080
stop(paste(funname, " requires argument '", argnames_udf[mx1], "' but this has not been passed to the 'ipoptr' function.\n", sep = ""))
8181
}
8282
}
83-
83+
8484
# determine which arguments where supplied but not required
8585
m2 = match(argnames_supplied, argnames_udf)
8686
if( any(is.na(m2)) ){
@@ -92,28 +92,28 @@ function( x0,
9292
}
9393
return( 0 )
9494
}
95-
95+
9696
# extract list of additional arguments and check user-defined functions
9797
arglist <- list(...)
9898
checkFunctionArguments( eval_f, arglist, 'eval_f' )
9999
checkFunctionArguments( eval_grad_f, arglist, 'eval_grad_f' )
100-
100+
101101
num.constraints <- length( constraint_lb )
102102
if ( num.constraints > 0 ) {
103103
checkFunctionArguments( eval_g, arglist, 'eval_g' )
104104
checkFunctionArguments( eval_jac_g, arglist, 'eval_jac_g' )
105105
}
106-
106+
107107
# write wrappers around user-defined functions to pass additional arguments
108108
eval_f_wrapper = function(x){ eval_f(x, ...) }
109109
eval_grad_f_wrapper = function(x){ eval_grad_f(x, ...) }
110-
110+
111111
if ( num.constraints > 0 ) {
112112
eval_g_wrapper = function( x ) { eval_g(x, ...) }
113113
eval_jac_g_wrapper = function( x ) { eval_jac_g(x, ...) }
114114
} else {
115-
eval_g_wrapper = function( x ) { return( numeric(0) ) }
116-
eval_jac_g_wrapper = function( x ) { return( numeric(0) ) }
115+
eval_g_wrapper = function( x ) { return( numeric(0) ) }
116+
eval_jac_g_wrapper = function( x ) { return( numeric(0) ) }
117117
}
118118

119119
# approximate Hessian
@@ -127,32 +127,32 @@ function( x0,
127127

128128

129129
# build ipoptr object
130-
ret <- list( "x0"=x0,
131-
"eval_f"=eval_f_wrapper,
132-
"eval_grad_f"=eval_grad_f_wrapper,
133-
"lower_bounds"=lb,
134-
"upper_bounds"=ub,
135-
"eval_g"=eval_g_wrapper,
136-
"eval_jac_g"=eval_jac_g_wrapper,
137-
"constraint_lower_bounds"=constraint_lb,
138-
"constraint_upper_bounds"=constraint_ub,
130+
ret <- list( "x0"=x0,
131+
"eval_f"=eval_f_wrapper,
132+
"eval_grad_f"=eval_grad_f_wrapper,
133+
"lower_bounds"=lb,
134+
"upper_bounds"=ub,
135+
"eval_g"=eval_g_wrapper,
136+
"eval_jac_g"=eval_jac_g_wrapper,
137+
"constraint_lower_bounds"=constraint_lb,
138+
"constraint_upper_bounds"=constraint_ub,
139139
"eval_jac_g_structure"=eval_jac_g_structure,
140140
"eval_h"=eval_h_wrapper,
141141
"eval_h_structure"=eval_h_structure,
142142
"options"=get.option.types(opts),
143143
"environment" = new.env() )
144-
144+
145145
attr(ret, "class") <- "ipoptr"
146-
146+
147147
# add the current call to the list
148148
ret$call <- match.call()
149-
149+
150150
# check whether we have a correctly formed ipoptr object
151151
is.ipoptr( ret )
152-
152+
153153
# pass ipoptr object to C code
154154
solution <- .Call( IpoptRSolve, ret )
155-
155+
156156
# add solution variables to object
157157
ret$status <- solution$status
158158
ret$message <- solution$message
@@ -163,6 +163,6 @@ function( x0,
163163
ret$z_U <- solution$z_U
164164
ret$constraints <- solution$constraints
165165
ret$lambda <- solution$lambda
166-
166+
167167
return( ret )
168168
}

contrib/RInterface/R/is.ipoptr.R

+17-17
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,69 @@
99
# Output: bool telling whether the object is an ipoptr or not
1010
#
1111
# Changelog:
12-
# 09/03/2012: Removed ipoptr_environment because this caused a bug in combination with
12+
# 09/03/2012: Removed ipoptr_environment because this caused a bug in combination with
1313
# data.table and it wasn't useful (thanks to Florian Oswald for reporting)
1414

1515
is.ipoptr <- function(x) {
16-
16+
1717
# Check whether the object exists and is a list
1818
if( is.null(x) ) { return( FALSE ) }
1919
if( !is.list(x) ) { return( FALSE ) }
20-
20+
2121
# Define local flag defining whether we approximate the Hessian or not
2222
flag_hessian_approximation = FALSE
2323
if ( !is.null( x$options$string$hessian_approximation ) ) {
2424
flag_hessian_approximation = ( x$options$string$hessian_approximation == "limited-memory" )
2525
}
26-
26+
2727
# Check whether the needed functions are supplied
2828
stopifnot( is.function(x$eval_f) )
2929
stopifnot( is.function(x$eval_grad_f) )
3030
stopifnot( is.function(x$eval_g) )
3131
stopifnot( is.function(x$eval_jac_g) )
3232
if ( !flag_hessian_approximation ) { stopifnot( is.function(x$eval_h) ) }
33-
33+
3434
# Check whether bounds are defined for all controls
3535
stopifnot( length( x$x0 ) == length( x$lower_bounds ) )
3636
stopifnot( length( x$x0 ) == length( x$upper_bounds ) )
37-
37+
3838
# Check whether the initial value is within the bounds
3939
stopifnot( all( x$x0 >= x$lower_bounds ) )
4040
stopifnot( all( x$x0 <= x$upper_bounds ) )
41-
41+
4242
num.controls <- length( x$x0 )
4343
num.constraints <- length( x$constraint_lower_bounds )
44-
44+
4545
# Check the length of some return values
4646
stopifnot( length(x$eval_f( x$x0 ))==1 )
4747
stopifnot( length(x$eval_grad_f( x$x0 ))==num.controls )
4848
stopifnot( length(x$eval_g( x$x0 ))==num.constraints )
4949
stopifnot( length(x$eval_jac_g( x$x0 ))==length(unlist(x$eval_jac_g_structure)) ) # the number of non-zero elements in the Jacobian
50-
if ( !flag_hessian_approximation ) {
50+
if ( !flag_hessian_approximation ) {
5151
stopifnot( length(x$eval_h( x$x0, 1, rep(1,num.constraints) ))==length(unlist(x$eval_h_structure)) ) # the number of non-zero elements in the Hessian
5252
}
53-
53+
5454
# Check the whether we don't have NA's in initial values
5555
stopifnot( all(!is.na(x$eval_f( x$x0 ))) )
5656
stopifnot( all(!is.na(x$eval_grad_f( x$x0 ))) )
5757
stopifnot( all(!is.na(x$eval_g( x$x0 ))) )
5858
stopifnot( all(!is.na(x$eval_jac_g( x$x0 ))) ) # the number of non-zero elements in the Jacobian
59-
if ( !flag_hessian_approximation ) {
59+
if ( !flag_hessian_approximation ) {
6060
stopifnot( all(!is.na(x$eval_h( x$x0, 1, rep(1,num.constraints) ))) ) # the number of non-zero elements in the Hessian
6161
}
62-
62+
6363
# Check whether a correct structure was supplied, and check the size
6464
stopifnot( is.list(x$eval_jac_g_structure) )
65-
65+
6666
stopifnot( length(x$eval_jac_g_structure)==num.constraints )
6767
if ( !flag_hessian_approximation ) {
6868
stopifnot( length(x$eval_h_structure)==num.controls )
6969
stopifnot( is.list(x$eval_h_structure) )
7070
}
71-
71+
7272
# Check the number of non-linear constraints
7373
stopifnot( length(x$constraint_lower_bounds)==length(x$constraint_upper_bounds) )
74-
74+
7575
# Check whether none of the non-zero indices are larger than the number of controls
7676
# Also, the smallest index should be bigger than 0
7777
if ( length( x$eval_jac_g_structure ) > 0 ) {
@@ -82,7 +82,7 @@ is.ipoptr <- function(x) {
8282
stopifnot( max(unlist(x$eval_h_structure)) <= num.controls )
8383
stopifnot( min(unlist(x$eval_h_structure)) > 0 )
8484
}
85-
85+
8686
# Check whether option to approximate hessian and eval_h are both set
8787
# If we approximate the hessian, then we don't want to set eval_h
8888
if ( flag_hessian_approximation ) {
@@ -93,7 +93,7 @@ is.ipoptr <- function(x) {
9393
warning("Option supplied to approximate hessian, but eval_h_structure is defined.\nSolution: remove option hessian_approximation=limited-memory to use analytic derivatives.")
9494
}
9595
}
96-
96+
9797

9898
return( TRUE )
9999
}

0 commit comments

Comments
 (0)