Ignore:
Timestamp:
02/03/05 18:59:17 (19 years ago)
Author:
kil064
Message:

add function addEntry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MathUtils2.cc

    r209 r364  
    8989  }
    9090}
     91
     92template <class T>
     93uInt mathutil::addEntry (Vector<T>& list, T val)
     94{
     95   uInt n = list.nelements();
     96   if (n>0) {
     97      for (uInt i=0; i<n; i++) {
     98         if (near(list[i],val)) {
     99            return i;
     100         }
     101      }
     102   }
     103//
     104   n++;
     105   list.resize(n,True);
     106   list(n-1) = val;
     107   return n-1;
     108}
     109
     110
     111 
     112
     113
     114
Note: See TracChangeset for help on using the changeset viewer.