由买买提看人间百态

topics

全部话题 - 话题: ceq
(共0页)
i*****r
发帖数: 1302
1
非线性等式限制ceq有多个怎么表示法?
[c,ceq] = ....
c=...
ceq=[a;
b;
c]
是这样么?
p****e
发帖数: 3548
2
来自主题: JobHunting版 - leetcode出了新题word ladder
发个不用'a'-'z'的方法,第一题
class Solution {
public:
bool diff1(string &s1, string &s2)
{
int diff = 0;
//if(s1.size() != s2.size()) return false;
for(int i = 0; i < s1.size(); ++i)
{
if(s1[i] != s2[i])
{
if(diff) return false;
++diff;
}
}
if(diff) return true;
return false;
}

int ladderLength(string start, string end, unordered_set &dict) {
// St... 阅读全帖
p****e
发帖数: 3548
3
来自主题: JobHunting版 - leetcode出了新题word ladder
发个不用'a'-'z'的方法,第一题
class Solution {
public:
bool diff1(string &s1, string &s2)
{
int diff = 0;
//if(s1.size() != s2.size()) return false;
for(int i = 0; i < s1.size(); ++i)
{
if(s1[i] != s2[i])
{
if(diff) return false;
++diff;
}
}
if(diff) return true;
return false;
}

int ladderLength(string start, string end, unordered_set &dict) {
// St... 阅读全帖
c**i
发帖数: 6973
4
来自主题: Taiwan版 - China's Foreign Reserve
is "officially valued at just under $2,000bn."
"According to research published in the China Economic Quarterly by Brad
Setser, a specialist in sovereign wealth at the Council on Foreign Relations
in New York," however, the real reserve of China is "currently worth
roughly $2,500bn" or $2.5 trillion.
CEQ Staff, CEQ on FT.com: China’s cash box. Financial Times, Oct. 31, 2008.
http://www.ft.com/cms/s/0/e28f280a-a716-11dd-865e-000077b07658,s01=1.html
My comment:
(1) CEQ stands for China Economic Qu
r******n
发帖数: 351
5
来自主题: Computation版 - Matlab 中的 fmincon 函数
用 fmincon 优化
x = fmincon(&myfun,x0,[],[],[],[],[],[],&mycon)
非线性的约束条件做成函数.
function [c,ceq] = mycon(x)
c = ... % Compute nonlinear inequalities at x.
ceq = x(1)+x(2)-b % Compute nonlinear equalities at x.
现在的问题是,这个约束条件mycon里有一个需要不断改变的参数b。怎么能把这个参数
从外面传到这个约束条件的函数mycon里面。
o****r
发帖数: 57
6
来自主题: Computation版 - Matlab 中的 fmincon 函数
function [c,ceq] = mycon(x,b)
......
fmincon(@mycon,[x0]........,b)
l*****i
发帖数: 3929
(共0页)