全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1104 1
2012-12-16
Here is an example using customer building function that return multiple values to optmodel.

options cmplib=sasuser.funcs2;

****test subroutine return values to optmodel;
proc fcmp outlib=sasuser.funcs2.profit;
     subroutine test (a,b1,b2,b3);
       outargs b1-b3
          ;     
       b1=a*1;
       b2=a**2;
       b3=a**3;
        ;

ENDSUB;

run;

proc optmodel;
      set I init 1..4;
      set J init 1..3;
      
      number a{p in I, q in J} init p, q;
      number x{p in I} init p;

       print x a;

      for {p in I} call test(x[p], a[p,1], a[p,2], a[p,3]);

      print a;
      quit;

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-12-19 19:50:32
楼主能略加详细吗
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群