예제 #1
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            try
            {
                if (!constraints.ContainsKey(ineqId.name))
                {
                    throw new Exception("Constraint " + ineqId.name + " is not defined in 000.txt");
                }

                Definition      c       = constraints[ineqId.name];
                HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
                if (element == null)
                {
                    throw new Exception(
                              String.Format("Element with the index {0} is not found for the domain {1}", ineqId.index, c.domain));
                }

                return(hypermap.FindElementIndex(c.set, element));
            }
            catch (Exception e)
            {
                throw new Exception(
                          String.Format("Inequality {0} problem: {1}", ineqId.name, e.Message));
            }
        }
예제 #2
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            Definition      c       = constraints[ineqId.name];
            HypermapElement element = hypermap.Translate(c.domain, ineqId.index);

            return(hypermap.FindElementIndex(c.set, element));
        }
예제 #3
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            try
            {
                if (!constraints.ContainsKey(ineqId.name))
                    throw new Exception("Constraint " + ineqId.name + " is not defined in 000.txt");

                Definition c = constraints[ineqId.name];
                HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
                if (element == null)
                {
                    throw new Exception(
                           String.Format("Element with the index {0} is not found for the domain {1}", ineqId.index, c.domain));
                }

                return hypermap.FindElementIndex(c.set, element);
            }
            catch (Exception e)
            {
                throw new Exception(
                    String.Format("Inequality {0} problem: {1}", ineqId.name, e.Message));
            }
        }
예제 #4
0
 public int FindIneqIndex(ListHyp hypermap, Label ineqId)
 {
     Definition c = constraints[ineqId.name];
     HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
     return hypermap.FindElementIndex(c.set, element);
 }