[Pkg-electronics-commits] [gnucap] 05/17: precalc cleanup. init/setup/precalc is now before allocation was after

felix salfelder felix-guest at moszumanska.debian.org
Fri Jul 29 11:08:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository gnucap.

commit b15e45db2e5c6d9fdce16c5014a9de713a0b3b0e
Author: al davis <ad211 at freeelectron.net>
Date:   Mon Mar 28 16:51:28 2016 -0400

    precalc cleanup.
    init/setup/precalc is now before allocation
    was after
---
 apps/Make.depend   | 14 +++++++-------
 apps/s__init.cc    | 26 +++++++++++++-------------
 apps/s_ac.cc       | 35 ++++++++++++++++++++---------------
 apps/s_fo.cc       | 11 ++++++-----
 include/patchlev.h |  2 +-
 5 files changed, 47 insertions(+), 41 deletions(-)

diff --git a/apps/Make.depend b/apps/Make.depend
index 3e05dba..10f6f76 100644
--- a/apps/Make.depend
+++ b/apps/Make.depend
@@ -554,13 +554,13 @@ c_system.o: c_system.cc ../include/c_comand.h ../include/e_card.h \
  ../include/io_error.h ../include/globals.h ../include/l_dispatcher.h \
  ../include/l_stlextra.h ../include/u_opt.h ../include/mode.h \
  ../include/io_.h ../include/l_lib.h ../include/ap.h
-s__init.o: s__init.cc ../include/u_status.h ../include/mode.h \
- ../include/io_.h ../include/l_lib.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/l_timer.h \
- ../include/u_sim_data.h ../include/constant.h ../include/l_compar.h \
- ../include/u_opt.h ../include/m_matrix.h ../include/l_stlextra.h \
- ../include/s__.h ../include/c_comand.h ../include/e_card.h \
- ../include/e_base.h
+s__init.o: s__init.cc ../include/e_cardlist.h ../include/md.h \
+ ../include/io_trace.h ../include/io_error.h ../include/u_status.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/l_timer.h ../include/u_sim_data.h ../include/constant.h \
+ ../include/l_compar.h ../include/u_opt.h ../include/m_matrix.h \
+ ../include/l_stlextra.h ../include/s__.h ../include/c_comand.h \
+ ../include/e_card.h ../include/e_base.h
 s__out.o: s__out.cc ../include/u_sim_data.h ../include/constant.h \
  ../include/md.h ../include/io_trace.h ../include/io_error.h \
  ../include/l_compar.h ../include/u_opt.h ../include/mode.h \
diff --git a/apps/s__init.cc b/apps/s__init.cc
index 3209a03..75adf4a 100644
--- a/apps/s__init.cc
+++ b/apps/s__init.cc
@@ -1,4 +1,4 @@
-/* $Id: s__init.cc 2016/03/23 al $ -*- C++ -*-
+/* $Id: s__init.cc 2016/03/28 al $ -*- C++ -*-
  * Copyright (C) 2001 Albert Davis
  * Author: Albert Davis <aldavis at gnu.org>
  *
@@ -33,20 +33,20 @@ void SIM::command_base(CS& cmd)
   reset_timers();
   _sim->reset_iteration_counter(_sim->_mode);
   _sim->reset_iteration_counter(iPRINTSTEP);
-  
-  _sim->init();
-  _sim->alloc_vectors();  
-  _sim->_aa.reallocate();
-  _sim->_aa.dezero(OPT::gmin);
-  _sim->_aa.set_min_pivot(OPT::pivtol);  
-  _sim->_lu.reallocate();
-  _sim->_lu.dezero(OPT::gmin);
-  _sim->_lu.set_min_pivot(OPT::pivtol);
-  
-  assert(_sim->_nstat);
+
   try {
     setup(cmd);
+    _sim->init();
     CARD_LIST::card_list.precalc_last();
+
+    _sim->alloc_vectors();
+    _sim->_aa.reallocate();
+    _sim->_aa.dezero(OPT::gmin);
+    _sim->_aa.set_min_pivot(OPT::pivtol);
+    _sim->_lu.reallocate();
+    _sim->_lu.dezero(OPT::gmin);
+    _sim->_lu.set_min_pivot(OPT::pivtol);
+    assert(_sim->_nstat);
     ::status.set_up.stop();
 
     switch (ENV::run_mode) {
@@ -56,7 +56,7 @@ void SIM::command_base(CS& cmd)
     case rSCRIPT:	sweep();	break;
     case rPRESET:	/*nothing*/	break;
     }
-   }catch (Exception& e) {
+  }catch (Exception& e) {
     error(bDANGER, e.message() + '\n');
     _sim->count_iterations(iTOTAL);
     _sim->_lu.unallocate();
diff --git a/apps/s_ac.cc b/apps/s_ac.cc
index 23deacc..cef10a8 100644
--- a/apps/s_ac.cc
+++ b/apps/s_ac.cc
@@ -1,4 +1,4 @@
-/*$Id: s_ac.cc 2016/03/23 al $ -*- C++ -*-
+/*$Id: s_ac.cc 2016/03/28 al $ -*- C++ -*-
  * Copyright (C) 2001 Albert Davis
  * Author: Albert Davis <aldavis at gnu.org>
  *
@@ -73,24 +73,29 @@ void AC::do_it(CS& Cmd, CARD_LIST* Scope)
   reset_timers();
   ::status.ac.reset().start();
 
-  _sim->init();
-  _sim->alloc_vectors();
-  _sim->_acx.reallocate();
-  _sim->_acx.set_min_pivot(OPT::pivtol);
-  
-  setup(Cmd);
-  CARD_LIST::card_list.precalc_last();
+  try {
+    setup(Cmd);
+    _sim->init();
+    CARD_LIST::card_list.precalc_last();
+
+    _sim->alloc_vectors();
+    _sim->_acx.reallocate();
+    _sim->_acx.set_min_pivot(OPT::pivtol);
+    ::status.set_up.stop();
 
-  ::status.set_up.stop();
-  switch (ENV::run_mode) {
-  case rPRE_MAIN:	unreachable();	break;
-  case rBATCH:		itested();
-  case rINTERACTIVE:	itested();
-  case rSCRIPT:		sweep();	break;
-  case rPRESET:		/*nothing*/	break;
+    switch (ENV::run_mode) {
+    case rPRE_MAIN:	unreachable();	break;
+    case rBATCH:		itested();
+    case rINTERACTIVE:	itested();
+    case rSCRIPT:		sweep();	break;
+    case rPRESET:		/*nothing*/	break;
+    }
+  }catch (Exception& e) {untested();
+    error(bDANGER, e.message() + '\n');
   }
   _sim->_acx.unallocate();
   _sim->unalloc_vectors();
+
   _sim->_has_op = s_AC;
   _scope = NULL;
   
diff --git a/apps/s_fo.cc b/apps/s_fo.cc
index 9b77595..7d6785e 100644
--- a/apps/s_fo.cc
+++ b/apps/s_fo.cc
@@ -1,4 +1,4 @@
-/*$Id: s_fo.cc 2016/03/23 al $ -*- C++ -*-
+/*$Id: s_fo.cc 2016/03/28 al $ -*- C++ -*-
  * Copyright (C) 2001 Albert Davis
  * Author: Albert Davis <aldavis at gnu.org>
  *
@@ -77,7 +77,10 @@ void FOURIER::do_it(CS& Cmd, CARD_LIST* Scope)
   ::status.four.reset().start();
   
   try {
+    setup(Cmd);
     _sim->init();
+    CARD_LIST::card_list.precalc_last();
+
     _sim->alloc_vectors();    
     _sim->_aa.reallocate();
     _sim->_aa.dezero(OPT::gmin);
@@ -85,11 +88,9 @@ void FOURIER::do_it(CS& Cmd, CARD_LIST* Scope)
     _sim->_lu.reallocate();
     _sim->_lu.dezero(OPT::gmin);
     _sim->_lu.set_min_pivot(OPT::pivtol);
-    
-    setup(Cmd);
     fftallocate();
-    
     ::status.set_up.stop();
+
     switch (ENV::run_mode) {
     case rPRE_MAIN:	unreachable();		break;
     case rBATCH:	untested();
@@ -100,11 +101,11 @@ void FOURIER::do_it(CS& Cmd, CARD_LIST* Scope)
   }catch (Exception& e) {untested();
     error(bDANGER, e.message() + '\n');
   }
-  
   fftunallocate();
   _sim->unalloc_vectors();
   _sim->_lu.unallocate();
   _sim->_aa.unallocate();
+
   _sim->_has_op = s_FOURIER;
   _scope = NULL;
 
diff --git a/include/patchlev.h b/include/patchlev.h
index df7c6dd..c59c915 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "precalc_last-2 2016-03-25"
+#define PATCHLEVEL "precalc_last-2 2016-03-28"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git



More information about the Pkg-electronics-commits mailing list