* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with selector. If not, see <http://www.gnu.org/licenses/>.
+ * along with svrt. If not, see <http://www.gnu.org/licenses/>.
*
*/
return log(x)/log(2.0);
}
+template <class T>
+void grow(int *nb_max, int nb, T** current, int factor) {
+ ASSERT(*nb_max > 0);
+ if(nb == *nb_max) {
+ T *tmp = new T[*nb_max * factor];
+ memcpy(tmp, *current, *nb_max * sizeof(T));
+ delete[] *current;
+ *current = tmp;
+ *nb_max *= factor;
+ }
+}
+
#endif