]> www.ginac.de Git - ginac.git/blobdiff - ginac/remember.cpp
Fix the compliation error *for real* ... and restore performance
[ginac.git] / ginac / remember.cpp
index 37e403c43db45dada3389ecc2faf5caff9bb47e9..1fd51b6198de08c1aeded497d0fb2882c7cee793 100644 (file)
@@ -4,7 +4,7 @@
  *  in GiNaC functions */
 
 /*
- *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <stdexcept>
-
 #include "function.h"
 #include "utils.h"
 #include "remember.h"
 
+#include <stdexcept>
+
 namespace GiNaC {
 
 //////////
@@ -44,8 +44,8 @@ bool remember_table_entry::is_equal(function const & f) const
 {
        GINAC_ASSERT(f.seq.size()==seq.size());
        if (f.gethash()!=hashvalue) return false;
-       unsigned num = seq.size();
-       for (unsigned i=0; i<num; ++i)
+       size_t num = seq.size();
+       for (size_t i=0; i<num; ++i)
                if (!seq[i].is_equal(f.seq[i])) return false;
        ++last_access = access_counter;
        ++successful_hits;
@@ -168,23 +168,23 @@ void remember_table::add_entry(function const & f, ex const & result)
        operator[](entry).add_entry(f,result);
 }        
 
-void remember_table::clear_all_entries(void)
+void remember_table::clear_all_entries()
 {
        clear();
        init_table();
 }
 
-void remember_table::init_table(void)
+void remember_table::init_table()
 {
        reserve(table_size);
        for (unsigned i=0; i<table_size; ++i)
                push_back(remember_table_list(max_assoc_size,remember_strategy));
 }
 
-std::vector<remember_table> & remember_table::remember_tables(void)
+std::vector<remember_table> & remember_table::remember_tables()
 {
-       static std::vector<remember_table> * rt = new std::vector<remember_table>;
-       return *rt;
+       static std::vector<remember_table> rt = std::vector<remember_table>();
+       return rt;
 }
 
 } // namespace GiNaC