source: src/verbose.cpp@ 68cb0f

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 68cb0f was 7f3b9d, checked in by Frederik Heber <heber@…>, 17 years ago

Lots of for loops now count in reverse order where it does not matter, some 3 -> NDIM

for(i=0;i<var;i++) is slower than for (i=var;i--;) if the order of the i's is not important (note: i-- is also a value and it stops when on i == 0 automatically)
in builder.cpp there were some remnant 3 actually meant to be NDIM

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[14de469]1#include "molecules.hpp"
2
3/** Prints the tabs according to verbosity stored in the temporary constructed class.
4 * \param &ost stream to extend with tabs
5 * \return &ost stream with tabs
6 */
7ostream& Verbose::print (ostream &ost) const
8{
[7f3b9d]9 for (int i=Verbosity;i--;)
[14de469]10 ost.put('\t');
11 //cout << "Verbose(.) called." << endl;
12 return ost;
13};
14
15/** Operator for the Verbose(arg) call.
16 * Constructs temporary a Verbose class object, wherein the verbosity is stored.
17 * Then << is called, which calls Verbose's print which adds the tabs and returns the stream.
18 * \param &ost stream to extend
19 * \param &m pointer to created Verbose object
20 * \return &ost
21 */
22ostream& operator<<(ostream& ost,const Verbose& m)
23{
24 return m.print(ost);
25};
26
27
28/** Prints the tabs according to verbosity stored in the temporary constructed class.
29 * Note that highest bit is set artificially to give number of bits to print
30 * \param &ost stream to extend with tabs
31 * \return &ost stream with tabs
32 */
33ostream& Binary::print (ostream &ost) const
34{
35 int bits = 1, counter = 1;
36 while ((bits = 1 << counter) < BinaryNumber)
37 counter++;
38 for (int i=0;i<counter-1;i++) {
39 if ((BinaryNumber & (1 << i)) == 0)
40 ost.put('0');
41 else
42 ost.put('1');
43 }
44 ost.put('b');
45 //cout << "Binary(.) called." << endl;
46 return ost;
47};
48
49/** Operator for the Binary(arg) call.
50 * Constructs temporary a Verbose class object, wherein the Binary is stored.
51 * Then << is called, which calls Binary's print which adds the tabs and returns the stream.
52 * \param &ost stream to extend
53 * \param &m pointer to created Binary object
54 * \return &ost
55 */
56ostream& operator<<(ostream& ost,const Binary& m)
57{
58 return m.print(ost);
59};
Note: See TracBrowser for help on using the repository browser.