Example #1
0
	/* Reset the solver to the empty starting condition.

	This method resets the internal solver state to the empty starting
	condition, as if no constraints or edit variables have been added.
	This can be faster than deleting the solver and creating a new one
	when the entire system must change, since it can avoid unecessary
	heap (de)allocations.

	*/
	public void reset()
	{
		clearRows();
		m_cns.Clear();
		m_vars.Clear();
		m_edits.Clear();
		m_infeasible_rows.Clear();
		m_objective= new Row() ;
		m_artificial=null;
		m_id_tick = 1;
	}
Example #2
0
        private void Map(VarMap varMap)
        {
            var newVarMap = new VarMap();

            foreach (var kv in varMap)
            {
                var newVar = Map(kv.Value);
                newVarMap.Add(kv.Key, newVar);
            }
            varMap.Clear();
            foreach (var kv in newVarMap)
            {
                varMap.Add(kv.Key, kv.Value);
            }
        }
Example #3
0
        private void Map(VarMap varMap)
        {
            VarMap varMap1 = new VarMap();

            foreach (KeyValuePair <Var, Var> var1 in (Dictionary <Var, Var>)varMap)
            {
                Var var2 = this.Map(var1.Value);
                varMap1.Add(var1.Key, var2);
            }
            varMap.Clear();
            foreach (KeyValuePair <Var, Var> keyValuePair in (Dictionary <Var, Var>)varMap1)
            {
                varMap.Add(keyValuePair.Key, keyValuePair.Value);
            }
        }
        private void Map(VarMap varMap)
        {
            VarMap newVarMap = new VarMap();

            foreach (KeyValuePair <Var, Var> kv in varMap)
            {
                Var newVar = Map(kv.Value);
                newVarMap.Add(kv.Key, newVar);
            }
            varMap.Clear();
            foreach (KeyValuePair <Var, Var> kv in newVarMap)
            {
                varMap.Add(kv.Key, kv.Value);
            }
        }
Example #5
0
 private void Map(VarMap varMap)
 {
     VarMap newVarMap = new VarMap();
     foreach (KeyValuePair<Var, Var> kv in varMap)
     {
         Var newVar = Map(kv.Value);
         newVarMap.Add(kv.Key, newVar);
     }
     varMap.Clear();
     foreach (KeyValuePair<Var, Var> kv in newVarMap)
     {
         varMap.Add(kv.Key, kv.Value);
     }
 }
Example #6
0
 private void Map(VarMap varMap)
 {
     var newVarMap = new VarMap();
     foreach (var kv in varMap)
     {
         var newVar = Map(kv.Value);
         newVarMap.Add(kv.Key, newVar);
     }
     varMap.Clear();
     foreach (var kv in newVarMap)
     {
         varMap.Add(kv.Key, kv.Value);
     }
 }