mathematical-optimization

Memory optimization while using CPLEX library in Java

本秂侑毒 提交于 2019-12-24 14:24:39
问题 I am using IBM CPLEX library for an optimization problem in Java. Since main memory was not enough for the application I found a property of CPLEX : "Memory emphasis: letting the optimizer use disk for storage". Default value for Memory Emphasis is 0. How can I change this property in Java? for (int i = 0; i < GreenOverlayGlobals.numNodes; i++) { for (int j = 0; j < GreenOverlayGlobals.numNodes; j++) { IloLinearNumExpr expr2 = cplex.linearNumExpr(); for (int p = 0; p < GreenOverlayGlobals

Getting trace to store a value in R

旧时模样 提交于 2019-12-24 13:35:01
问题 I am running the nloptr package in R which is a package for nonlinear optimization. Within the nloptr package I am using the cobyla() command to perform my optimization. Now, I can specify the maximim number of iterations of the algorithm using the maxeval parameter, but when cobyla() command executes it only allows me to see the output for the final evaluation. However, I would like to be able to see all of the outputs at every iteration of the method. Someone recommended to me that I use

Minimizing SSE using Scipy.optimize minimize

家住魔仙堡 提交于 2019-12-24 12:43:35
问题 I am trying to optimize SSE (sum of squared error) of a function using scipy.optimize . To test with, I created a simple problem as below code. But the optimized parameters output by scipy never makes SSE=0. Can someone help me to understand, where am I going wrong. I tried to cross check with the SSE calculated by my code with the one computed in excel. It matched. Then I used minimize function to minimize that SSE function, the ones computed by Scipy is not matching with the hand calculated

Approximating Gaussian Blur Using Extended Box Blur

末鹿安然 提交于 2019-12-24 12:27:25
问题 The problem is a s following, how to approximate a Gaussian Blur Filter with a given STD using Box Blur / Extended Box Blur. More specifically, I know this is the way Photoshop applies its Gaussian Blur. First, an article about "Extended Box Blur can be seen here - Theoretical Foundations of Gaussian Convolution by Extended Box Filtering. The problem I'm having is with Figure 2 in the article. The best way to explain this would be using an example. Let's say we need to approximate a Gaussian

How does this integer encoding work?

北慕城南 提交于 2019-12-24 09:03:54
问题 In this code golf question, there is a python answer that encodes the lengths of all integers from 1 to 99 in english to a big number: 7886778663788677866389978897746775667552677566755267756675527886778663788677866355644553301220112001 To get the length of n , you just have to calculate 3 + (the_big_number / (10**n)) % 10 . How does this work? 回答1: (the_big_number / (10^n)) % 10 pulls out the n th least significant digit of the big number, so the lengths are just stored starting with the

Matlab use fminsearch to optimize multi variables

耗尽温柔 提交于 2019-12-24 07:32:28
问题 I am using Matlab fminsearch to minimize a equation with two variables sum((interval-5).^2, 2)*factor The interval is a vector contains 5 values. They can be only picked sequentially from value 1 to 30 with step size is 1. The factor is a value from 0.1 to 0.9. The code is below. I think the interval values are correct but factor value is wrong. Interval value: [3 4 5 6 7] factor value: 0.6 Final Output: 6 I think the factor value should be 0.1 and final output should be 1 as global minimum.

How to find the optimal sum

邮差的信 提交于 2019-12-24 07:06:49
问题 Imagine this set of values: A B C LINE1 2 1 1 LINE2 1 4 1 LINE3 3 1 3 LINE4 6 5 4 I can choose one value per line from 1 to 3. If I choose a value from a specific column, I need to sum the value from line 4. Example: 2 (LINE1, COLUMN A) 1 (LINE2, COLUMN A) 3 (LINE3, COLUMN C) So, as I chose values from COLUMN A, I need to sum both of them with the value of LINE 4. Final result: A B C LINE1 2 - - LINE2 1 - - LINE3 - - 3 LINE4 6 - 4 2 + 1 + 6 = 9 3 + 4 = 7 TOTAL: 16 The fact is: I need to

How to find the optimal sum

五迷三道 提交于 2019-12-24 07:05:15
问题 Imagine this set of values: A B C LINE1 2 1 1 LINE2 1 4 1 LINE3 3 1 3 LINE4 6 5 4 I can choose one value per line from 1 to 3. If I choose a value from a specific column, I need to sum the value from line 4. Example: 2 (LINE1, COLUMN A) 1 (LINE2, COLUMN A) 3 (LINE3, COLUMN C) So, as I chose values from COLUMN A, I need to sum both of them with the value of LINE 4. Final result: A B C LINE1 2 - - LINE2 1 - - LINE3 - - 3 LINE4 6 - 4 2 + 1 + 6 = 9 3 + 4 = 7 TOTAL: 16 The fact is: I need to

linear goal programming in R unable to find solutions

空扰寡人 提交于 2019-12-24 06:33:31
问题 I have the following linear goal programming problem that I'm trying to solve using R : I tried formulating using R in the following matrix format: Below is the reproducible example: library("lpSolve") a <- matrix(c(1,2,5, 1/2,1,3, 1/5,1/3,1),nrow=3,byrow=T) f.obj <- c(rep(1,6),rep(0,3)) f.cons <- matrix(c(c(1,-1,0,0,0,0,1,-1,0, 0,0,1,-1,0,0,1,0,-1, 0,0,0,0,1,-1,0,1,-1, 1,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0, 0,0,0,1,0,0,0,0,0, 0,0,0,0,1,0,0,0,0, 0,0,0,0,0,1,0,0,0, 0,0,0,0,0

why do i get fminsearch undefined function error [closed]

时间秒杀一切 提交于 2019-12-24 06:29:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . I'm trying to optimize a function with 2 inputs. Trying to use fminsearch but it keeps saying undefined function or variable although it is already defined. I have already defined the function in a separate script that is in the same directory with my main script. I have a classroom license which includes