コード例 #1
0
 private void AddRowConstraint(double[] row, lpsolve_constr_types type = lpsolve_constr_types.EQ, double val = 0)
 {
     Rows++;
     if (!LpSolvePointer.add_constraint(row, type, val))
     {
         throw new InvalidOperationException();
     }
 }
コード例 #2
0
 /// <summary>
 /// addConstraint({{0,10},{1,5}}, lpsolve.lpsolve_constr_types.LE, 100) means:
 /// 10x + 5y <= 100
 /// </summary>
 /// <param name="cfPerVarIdx">
 /// Each tuple contains variable index, and it's coefficient in this constraint.
 /// </param>
 public void addConstraint(List <Tuple <int, double> > cfPerVarIdx, lpsolve_constr_types constraintType, double rhs)
 {
     for (int j = 0; j < cfPerVarIdx.Count; ++j)
     {
         colno[j] = 1 + cfPerVarIdx[j].Item1; /* first column */
         row[j]   = cfPerVarIdx[j].Item2;
     }
     /* add the row to lpsolve */
     lpsolve.add_constraintex(lp, cfPerVarIdx.Count, row, colno, constraintType, rhs);
 }
コード例 #3
0
 public static extern bool add_lag_con(IntPtr lp, double[] row, lpsolve_constr_types con_type, double rhs);
コード例 #4
0
ファイル: lpsolve55.cs プロジェクト: rachmadvwp/NOCulator
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool set_constr_type(int lp, int row, lpsolve_constr_types con_type);
コード例 #5
0
 public static extern bool add_constraint(IntPtr lp, double[] row, lpsolve_constr_types constr_type, double rh);
コード例 #6
0
ファイル: LpSolve.cs プロジェクト: zhangbo27/LpSolveDotNet
 public bool set_constr_type(int row, lpsolve_constr_types con_type)
 {
     return(Interop.set_constr_type(_lp, row, con_type));
 }
コード例 #7
0
ファイル: lpsolve55.cs プロジェクト: ivan-alles/poker-acpc
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool add_constraint(int lp, double[] row, lpsolve_constr_types constr_type, double rh);
コード例 #8
0
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool str_add_constraint(IntPtr lp, string row_string, lpsolve_constr_types constr_type, double rh);
コード例 #9
0
ファイル: LpSolve.cs プロジェクト: zhangbo27/LpSolveDotNet
 public bool add_constraintex(int count, double[] row, int[] colno, lpsolve_constr_types constr_type, double rh)
 {
     return(Interop.add_constraintex(_lp, count, row, colno, constr_type, rh));
 }
コード例 #10
0
 public static extern byte set_constr_type(int lp, int row, lpsolve_constr_types con_type);
コード例 #11
0
 public static extern byte str_add_constraint(int lp, string row_string, lpsolve_constr_types constr_type, double rh);
コード例 #12
0
 public static extern byte add_constraintex(int lp, int count, ref double row, ref int colno, lpsolve_constr_types constr_type, double rh);
コード例 #13
0
 public static extern byte add_lag_con(int lp, ref double row, lpsolve_constr_types con_type, double rhs);
コード例 #14
0
 internal static extern byte add_constraintex(int lp, int count, double[] row, int[] colno, lpsolve_constr_types constr_type, double rh);
コード例 #15
0
 internal static extern byte add_constraint(int lp, double[] row, lpsolve_constr_types constr_type, double rh);
コード例 #16
0
ファイル: Interop.cs プロジェクト: zhangbo27/LpSolveDotNet
 public static extern bool str_add_constraint(IntPtr lp, [MarshalAs(UnmanagedType.LPStr)] string row_string, lpsolve_constr_types constr_type, double rh);
コード例 #17
0
 public static extern bool str_add_constraint(IntPtr lp, string row_string, lpsolve_constr_types constr_type, double rh);
コード例 #18
0
 public static extern byte str_add_lag_con(int lp, string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #19
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool add_constraint(int lp, ref double row, lpsolve_constr_types constr_type, double rh);
コード例 #20
0
ファイル: lpsolve55.cs プロジェクト: hirous/test
 [DllImport("lpsolve55.dll", SetLastError=true)] public static extern bool add_constraintex(int lp, int count, ref double row, ref int colno, lpsolve_constr_types constr_type, double rh);
コード例 #21
0
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool add_constraintex(IntPtr lp, int count, double[] row, int[] colno, lpsolve_constr_types constr_type, double rh);
コード例 #22
0
ファイル: lpsolve55.cs プロジェクト: hirous/test
 [DllImport("lpsolve55.dll", SetLastError=true)] public static extern bool set_constr_type(int lp, int row, lpsolve_constr_types con_type);
コード例 #23
0
ファイル: LpSolve.cs プロジェクト: zhangbo27/LpSolveDotNet
 public bool str_add_constraint(string row_string, lpsolve_constr_types constr_type, double rh)
 {
     return(Interop.str_add_constraint(_lp, row_string, constr_type, rh));
 }
コード例 #24
0
ファイル: lpsolve55.cs プロジェクト: hirous/test
 [DllImport("lpsolve55.dll", SetLastError=true)] public static extern bool str_add_lag_con(int lp, string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #25
0
 private void AddRowConstraint(double[] row, lpsolve_constr_types type = lpsolve_constr_types.EQ, double val = 0)
 {
     Rows++;
     if (!LpSolvePointer.add_constraint(row, type, val))
     {
         throw new InvalidOperationException();
     }
 }
コード例 #26
0
ファイル: FluxBalance.cs プロジェクト: fbergmann/FluxBalance
 private static string ToFbcString(lpsolve_constr_types op)
 {
     switch (op)
       {
     case lpsolve_constr_types.LE:
       return "lessEqual";
     case lpsolve_constr_types.EQ:
     default:
       return "equal";
     case lpsolve_constr_types.GE:
       return "greaterEqual";
       }
 }
コード例 #27
0
ファイル: lpsolve55.cs プロジェクト: rachmadvwp/NOCulator
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool add_constraintex(int lp, int count, ref double row, ref int colno, lpsolve_constr_types constr_type, double rh);
コード例 #28
0
 public LPsolveConstraint(XmlElement item)
 {
     _sbmlId = item.GetAttribute("reaction", FluxBalance.STR_FBA_NAMESPACE);
     _value = Convert.ToDouble(item.GetAttribute("value", FluxBalance.STR_FBA_NAMESPACE));
     _Operator = GetOperator(item.GetAttribute("operation", FluxBalance.STR_FBA_NAMESPACE));
 }
コード例 #29
0
ファイル: lpsolve55.cs プロジェクト: rachmadvwp/NOCulator
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool str_add_lag_con(int lp, string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #30
0
 public LPsolveConstraint(string sbmlId, lpsolve_constr_types sOperator, double value)
 {
     _sbmlId = sbmlId;
     _Operator = sOperator;
     _value = value;
 }
コード例 #31
0
 public static extern bool add_constraintex(IntPtr lp, int count, double[] row, int[] colno, lpsolve_constr_types constr_type, double rh);
コード例 #32
0
 private string GetOperationString(lpsolve_constr_types type)
 {
     switch (type)
     {
         case lpsolve_constr_types.LE:
             return "less";
         case lpsolve_constr_types.EQ:
             return "equal";
         case lpsolve_constr_types.GE:
         default:
             return "greater";
     }
 }
コード例 #33
0
 public static extern bool set_constr_type(IntPtr lp, int row, lpsolve_constr_types con_type);
コード例 #34
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool add_lag_con(int lp, ref double row, lpsolve_constr_types con_type, double rhs);
コード例 #35
0
 public static extern bool str_add_lag_con(IntPtr lp, string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #36
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool str_add_constraint(int lp, string row_string, lpsolve_constr_types constr_type,
                                              double rh);
コード例 #37
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool add_constraintex(int lp, int count, ref double row, ref int colno,
                                            lpsolve_constr_types constr_type, double rh);
コード例 #38
0
 [DllImport("lpsolve55.dll", SetLastError = true)] public static extern bool add_lag_con(IntPtr lp, double[] row, lpsolve_constr_types con_type, double rhs);
コード例 #39
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool set_constr_type(int lp, int row, lpsolve_constr_types con_type);
コード例 #40
0
 public static extern byte str_add_lag_con(IntPtr lp, [MarshalAs(UnmanagedType.LPStr)] string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #41
0
ファイル: LPsolve.cs プロジェクト: fbergmann/FluxBalance
 public static extern bool str_add_lag_con(int lp, string row_string, lpsolve_constr_types con_type, double rhs);
コード例 #42
0
ファイル: LpSolve.cs プロジェクト: zhangbo27/LpSolveDotNet
 public bool add_constraint(double[] row, lpsolve_constr_types constr_type, double rh)
 {
     return(Interop.add_constraint(_lp, row, constr_type, rh));
 }