From e234141188609b033b4a3ff862c0fc619ec19f07 Mon Sep 17 00:00:00 2001 From: Francois Gygi Date: Sat, 17 Mar 2007 01:14:00 +0000 Subject: [PATCH] cleanup namespaces in headers. Reduced dependency on Sample.h. Moved facs, sigmas parameters to ConfinementPotential. git-svn-id: http://qboxcode.org/svn/qb/trunk@489 cba15fb0-1239-40c8-b417-11db7ca47a34 --- src/AndersonMixer.C | 3 ++- src/AndersonMixer.h | 6 ++---- src/AngleConstraint.h | 26 ++++++++++++++------------ src/Atom.h | 16 ++++++++-------- src/AtomCmd.h | 4 +--- src/AtomSet.h | 50 +++++++++++++++++++++++++------------------------- src/AtomSetHandler.h | 9 +++++---- src/BLYPFunctional.h | 13 ++++++------- src/BOSampleStepper.h | 4 ++-- src/Base64Transcoder.h | 10 +++++----- src/Basis.h | 6 +++--- src/CPSampleStepper.h | 3 +-- src/CellStepper.h | 7 ++----- src/ChargeDensity.h | 12 ++++++------ src/ConfinementPotential.h | 11 +++++------ src/Constraint.h | 29 ++++++++++++++--------------- src/ConstraintSet.h | 19 +++++++++---------- src/Context.C | 8 ++++---- src/Context.h | 14 ++++++-------- src/Control.h | 22 +++++++++++----------- src/D3vector.h | 7 +++---- src/DistanceConstraint.h | 23 ++++++++++++----------- src/EnergyFunctional.h | 35 +++++++++++++++++------------------ src/FourierTransform.C | 26 +++++++++++++++----------- src/FourierTransform.h | 53 ++++++++++++++++++++++++++--------------------------- src/IonicStepper.h | 27 ++++++++++++++------------- src/LDAFunctional.h | 11 +++++------ src/MDIonicStepper.C | 3 ++- src/MDIonicStepper.h | 8 ++++---- src/Makefile | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------- src/Matrix.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- src/NameOf.h | 7 +++---- src/NonLocalPotential.h | 40 +++++++++++++++++----------------------- src/PBEFunctional.h | 13 ++++++------- src/Preconditioner.C | 3 ++- src/Preconditioner.h | 7 +++---- src/RunCmd.h | 4 ++-- src/SDAIonicStepper.h | 10 +++++----- src/SDCellStepper.C | 3 ++- src/SDCellStepper.h | 4 ++-- src/SDIonicStepper.C | 3 ++- src/SDIonicStepper.h | 7 ++++--- src/SampleHandler.h | 5 +++-- src/SampleReader.C | 4 ++-- src/SampleReader.h | 10 +++++----- src/SampleStepper.C | 3 ++- src/SampleStepper.h | 12 ++++++------ src/SampleWriter.h | 10 +++++----- src/SlaterDet.h | 31 +++++++++++++++---------------- src/Species.h | 47 +++++++++++++++++++++++------------------------ src/SpeciesHandler.h | 6 +++--- src/SpeciesReader.C | 4 ++-- src/SpeciesReader.h | 7 +++---- src/StrX.h | 5 ++--- src/StructureFactor.C | 3 ++- src/StructureFactor.h | 23 +++++++++++------------ src/StructureHandler.h | 8 +++----- src/StructuredDocumentHandler.C | 4 ++-- src/StructuredDocumentHandler.h | 8 +++----- src/TorsionConstraint.h | 24 ++++++++++++------------ src/UnitCell.h | 11 ++++++----- src/UserInterface.C | 4 ++-- src/UserInterface.h | 15 +++++++-------- src/Wavefunction.h | 23 +++++++++++------------ src/WavefunctionHandler.h | 10 +++++----- src/WavefunctionStepper.h | 5 ++--- src/XCFunctional.h | 5 ++--- src/XCPotential.h | 20 ++++++++++---------- src/XMLGFPreprocessor.C | 5 +++-- src/XMLGFPreprocessor.h | 6 ++---- src/blas.h | 9 ++++----- src/jacobi.h | 3 ++- src/notes | 24 ++++++++++++++++++++++++ src/release.C | 4 ++-- 74 files changed, 578 insertions(+), 577 deletions(-) diff --git a/src/AndersonMixer.C b/src/AndersonMixer.C index 9780cf9..46d055b 100644 --- a/src/AndersonMixer.C +++ b/src/AndersonMixer.C @@ -3,10 +3,11 @@ // AndersonMixer.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: AndersonMixer.C,v 1.3 2004-12-18 23:23:58 fgygi Exp $ +// $Id: AndersonMixer.C,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #include "AndersonMixer.h" #include "blas.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// void AndersonMixer::restart(void) diff --git a/src/AndersonMixer.h b/src/AndersonMixer.h index e57d23f..8488520 100644 --- a/src/AndersonMixer.h +++ b/src/AndersonMixer.h @@ -3,15 +3,13 @@ // AndersonMixer.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: AndersonMixer.h,v 1.3 2004-12-18 23:23:27 fgygi Exp $ +// $Id: AndersonMixer.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef ANDERSONMIXER_H #define ANDERSONMIXER_H #include #include -using namespace std; - #include "Context.h" class AndersonMixer @@ -21,7 +19,7 @@ class AndersonMixer double theta_max_; // maximum extrapolation double theta_nc_; // negative curvature value - valarray flast_; // last residual + std::valarray flast_; // last residual bool extrapolate_; // state variable public: diff --git a/src/AngleConstraint.h b/src/AngleConstraint.h index 51e1b5b..c877240 100644 --- a/src/AngleConstraint.h +++ b/src/AngleConstraint.h @@ -3,7 +3,7 @@ // AngleConstraint.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: AngleConstraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $ +// $Id: AngleConstraint.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef ANGLECONSTRAINT_H #define ANGLECONSTRAINT_H @@ -11,11 +11,12 @@ #include "Constraint.h" #include "D3vector.h" #include + class AtomSet; class AngleConstraint : public Constraint { - string name1_, name2_, name3_; + std::string name1_, name2_, name3_; int ia1_, ia2_, ia3_, is1_, is2_, is3_; double m1_, m2_, m3_, m1_inv_, m2_inv_, m3_inv_; double angle_, velocity_, force_, weight_, tol_; @@ -26,8 +27,9 @@ class AngleConstraint : public Constraint public: - AngleConstraint(string name, string name1, string name2, string name3, - double angle, double velocity, double tolerance): + AngleConstraint(std::string name, std::string name1, + std::string name2, std::string name3, + double angle, double velocity, double tolerance): name1_(name1), name2_(name2), name3_(name3), velocity_(velocity), tol_(tolerance), m1_(0.0), m2_(0.0), m3_(0.0) @@ -42,7 +44,7 @@ class AngleConstraint : public Constraint weight_ = 1.0; } - string type(void) const { return "angle"; } + std::string type(void) const { return "angle"; } double value(void) const { return angle_; } double velocity(void) const { return velocity_; } double force(void) const { return force_; } @@ -61,13 +63,13 @@ class AngleConstraint : public Constraint void setup(const AtomSet& atoms); void update(double dt); - bool enforce_r(const vector > &r0, - vector > &rp) const; - bool enforce_v(const vector > &r0, - vector > &v0) const; - void compute_force(const vector > &r0, - const vector > &f); - ostream& print( ostream& os ); + bool enforce_r(const std::vector > &r0, + std::vector > &rp) const; + bool enforce_v(const std::vector > &r0, + std::vector > &v0) const; + void compute_force(const std::vector > &r0, + const std::vector > &f); + std::ostream& print( std::ostream& os ); }; #endif diff --git a/src/Atom.h b/src/Atom.h index 95ac6c4..1b42e3d 100644 --- a/src/Atom.h +++ b/src/Atom.h @@ -3,29 +3,29 @@ // Atom.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: Atom.h,v 1.2 2003-05-16 16:14:00 fgygi Exp $ +// $Id: Atom.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef ATOM_H #define ATOM_H #include "D3vector.h" #include -using namespace std; class Atom { private: - string name_; - string species_; + std::string name_; + std::string species_; D3vector position_; D3vector velocity_; public: - Atom (string name, string species, D3vector position, D3vector velocity); - string name(void) { return name_; }; - string species(void) { return species_; }; + Atom (std::string name, std::string species, + D3vector position, D3vector velocity); + std::string name(void) { return name_; }; + std::string species(void) { return species_; }; D3vector position(void) { return position_; }; D3vector velocity(void) { return velocity_; }; void set_position(D3vector p) { position_ = p; }; @@ -33,5 +33,5 @@ class Atom void block(void) { velocity_ = D3vector(0.0,0.0,0.0); }; }; -ostream& operator << ( ostream &os, Atom &a ); +std::ostream& operator << ( std::ostream &os, Atom &a ); #endif diff --git a/src/AtomCmd.h b/src/AtomCmd.h index 80afbbb..190cc30 100644 --- a/src/AtomCmd.h +++ b/src/AtomCmd.h @@ -3,7 +3,7 @@ // AtomCmd.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: AtomCmd.h,v 1.6 2005-04-29 18:12:37 fgygi Exp $ +// $Id: AtomCmd.h,v 1.7 2007-03-17 01:14:00 fgygi Exp $ #ifndef ATOMCMD_H #define ATOMCMD_H @@ -11,8 +11,6 @@ #include #include #include -using namespace std; - #include "UserInterface.h" #include "Sample.h" diff --git a/src/AtomSet.h b/src/AtomSet.h index 627f02a..7aa0944 100644 --- a/src/AtomSet.h +++ b/src/AtomSet.h @@ -3,18 +3,18 @@ // AtomSet.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: AtomSet.h,v 1.14 2007-01-27 23:44:59 fgygi Exp $ +// $Id: AtomSet.h,v 1.15 2007-03-17 01:14:00 fgygi Exp $ #ifndef ATOMSET_H #define ATOMSET_H #include "Context.h" #include "Atom.h" -//#include "Species.h" +#include +#include #include #include #include -using namespace std; class Species; @@ -25,45 +25,45 @@ class AtomSet const Context& ctxt_; int nel_; - map na_; // na_[sp_name]: number of atoms of species sp_name - map isp_; // isp_[sp_name]: index of species sp_name - map is_; // is_[atom_name]: is index of atom atom_name - map ia_; // ia_[atom_name]: ia index of atom atom_name - vector spname; // spname[is]: name of species is + std::map na_; // na_[sp_name]: number of at. of spec. sp_name + std::map isp_; // isp_[sp_name]: index of species sp_name + std::map is_; // is_[atom_name]: is index of atom atom_name + std::map ia_; // ia_[atom_name]: ia index of atom atom_name + std::vector spname; // spname[is]: name of species is public: AtomSet(const Context& ctxt) : ctxt_(ctxt), nel_(0) {} - vector > atom_list; // atom_list[is][ia] - vector species_list; // species_list[is] + std::vector > atom_list; // atom_list[is][ia] + std::vector species_list; // species_list[is] const Context& context(void) const { return ctxt_; } bool addAtom(Atom *a); - bool delAtom(string name); - bool addSpecies(Species *sp, string name); - bool delSpecies(string name); + bool delAtom(std::string name); + bool addSpecies(Species *sp, std::string name); + bool delSpecies(std::string name); bool reset(void); // remove all atoms and species - Atom *findAtom(string name) const; - Species *findSpecies(string name) const; + Atom *findAtom(std::string name) const; + Species *findSpecies(std::string name) const; void listAtoms(void) const; void listSpecies(void) const; - int na(const string& spname) const; // number of atoms of species spname + int na(const std::string& spname) const; // number of atoms of species spname int na(int is) const; // number of atoms of species is - int isp(const string& spname) const; // index of species spname - int is(const string& atom_name) const; - int ia(const string& atom_name) const; + int isp(const std::string& spname) const; // index of species spname + int is(const std::string& atom_name) const; + int ia(const std::string& atom_name) const; int nel(void) const { return nel_; }; int nsp(void) const { return species_list.size(); } - void get_positions(vector >& tau) const; - void set_positions(const vector >& tau); - void get_velocities(vector >& vel) const; - void set_velocities(const vector >& vel); + void get_positions(std::vector >& tau) const; + void set_positions(const std::vector >& tau); + void get_velocities(std::vector >& vel) const; + void set_velocities(const std::vector >& vel); void sync(void); void reset_velocities(void); D3vector vcm(void) const; void reset_vcm(void); int size(void) const; -}; -ostream& operator << ( ostream &os, const AtomSet &as ); + }; +std::ostream& operator << ( std::ostream &os, const AtomSet &as ); #endif diff --git a/src/AtomSetHandler.h b/src/AtomSetHandler.h index 03bf5ef..6a48989 100644 --- a/src/AtomSetHandler.h +++ b/src/AtomSetHandler.h @@ -3,13 +3,14 @@ // AtomSetHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: AtomSetHandler.h,v 1.1 2003-05-16 16:14:00 fgygi Exp $ +// $Id: AtomSetHandler.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef ATOMSETHANDLER_H #define ATOMSETHANDLER_H #include "StructureHandler.h" #include "D3vector.h" +#include class AtomSet; class Species; @@ -19,8 +20,8 @@ class AtomSetHandler : public StructureHandler private: AtomSet& as_; - string current_atom_name, current_atom_species; - string current_species_name; + std::string current_atom_name, current_atom_species; + std::string current_species_name; D3vector current_atom_position, current_atom_velocity; Species* current_species; @@ -32,7 +33,7 @@ class AtomSetHandler : public StructureHandler // End of the root element in the structure being handled virtual void endElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, string& content); + const XMLCh* const qname, std::string& content); // start a subhandler virtual StructureHandler* startSubHandler(const XMLCh* const uri, diff --git a/src/BLYPFunctional.h b/src/BLYPFunctional.h index 24e8c51..9d148d1 100644 --- a/src/BLYPFunctional.h +++ b/src/BLYPFunctional.h @@ -3,23 +3,22 @@ // BLYPFunctional.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: BLYPFunctional.h,v 1.2 2004-09-14 22:24:11 fgygi Exp $ +// $Id: BLYPFunctional.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef BLYPFUNCTIONAL_H #define BLYPFUNCTIONAL_H #include "XCFunctional.h" #include -using namespace std; class BLYPFunctional : public XCFunctional { BLYPFunctional(); - vector _exc, _exc_up, _exc_dn; - vector _vxc1, _vxc1_up, _vxc1_dn, + std::vector _exc, _exc_up, _exc_dn; + std::vector _vxc1, _vxc1_up, _vxc1_dn, _vxc2, _vxc2_upup, _vxc2_updn, _vxc2_dnup, _vxc2_dndn; - vector _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3]; + std::vector _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3]; void excblyp(double rho, double grad, double *exc, double *vxc1, double *vxc2); @@ -32,10 +31,10 @@ class BLYPFunctional : public XCFunctional public: - BLYPFunctional(const vector > &rhoe); + BLYPFunctional(const std::vector > &rhoe); bool isGGA() { return true; }; - string name() { return "BLYP"; }; + std::string name() { return "BLYP"; }; void setxc(void); }; #endif diff --git a/src/BOSampleStepper.h b/src/BOSampleStepper.h index 1069f95..d735eb7 100644 --- a/src/BOSampleStepper.h +++ b/src/BOSampleStepper.h @@ -3,7 +3,7 @@ // BOSampleStepper.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: BOSampleStepper.h,v 1.4 2004-10-28 16:54:51 fgygi Exp $ +// $Id: BOSampleStepper.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef BOSAMPLESTEPPER_H #define BOSAMPLESTEPPER_H @@ -12,9 +12,9 @@ #include "EnergyFunctional.h" #include "Sample.h" #include "Wavefunction.h" + class WavefunctionStepper; class IonicStepper; -using namespace std; class BOSampleStepper : public SampleStepper { diff --git a/src/Base64Transcoder.h b/src/Base64Transcoder.h index 5c48671..fe18e13 100644 --- a/src/Base64Transcoder.h +++ b/src/Base64Transcoder.h @@ -3,7 +3,7 @@ // Base64Transcoder.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Base64Transcoder.h,v 1.3 2004-12-08 19:02:10 fgygi Exp $ +// $Id: Base64Transcoder.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef BASE64TRANSCODER_H #define BASE64TRANSCODER_H @@ -11,7 +11,7 @@ #include #include #include -using namespace std; + typedef unsigned char byte; class Base64Transcoder @@ -26,10 +26,10 @@ class Base64Transcoder int decode(int nchars, const char* const from, byte* const to); void byteswap_double(size_t n, double* const x); void byteswap_int(size_t n, int* const x); - int print(int nchars, const char* const buf, ostream& o); - int print(const string buf, ostream& o); + int print(int nchars, const char* const buf, std::ostream& o); + int print(const std::string buf, std::ostream& o); int print(int nchars, const char* const buf, FILE* outfile); - int print(const string buf, FILE* outfile); + int print(const std::string buf, FILE* outfile); // number of chars needed to encode nbytes bytes int nchars(int nbytes) { return 4 * ( ( nbytes + 2 ) / 3 ); } diff --git a/src/Basis.h b/src/Basis.h index 7a8def7..d2d0662 100644 --- a/src/Basis.h +++ b/src/Basis.h @@ -3,7 +3,7 @@ // Basis.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Basis.h,v 1.5 2003-02-04 19:21:30 fgygi Exp $ +// $Id: Basis.h,v 1.6 2007-03-17 01:14:00 fgygi Exp $ #ifndef BASIS_H #define BASIS_H @@ -89,7 +89,7 @@ class Basis ~Basis(void); bool resize(const UnitCell& cell, const UnitCell& refcell, double ecut); - void print(ostream& os); + void print(std::ostream& os); }; -ostream& operator << ( ostream& os, Basis& b ); +std::ostream& operator << ( std::ostream& os, Basis& b ); #endif diff --git a/src/CPSampleStepper.h b/src/CPSampleStepper.h index a8739a1..5bae677 100644 --- a/src/CPSampleStepper.h +++ b/src/CPSampleStepper.h @@ -3,7 +3,7 @@ // CPSampleStepper.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: CPSampleStepper.h,v 1.3 2004-09-14 22:24:11 fgygi Exp $ +// $Id: CPSampleStepper.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef CPSAMPLESTEPPER_H #define CPSAMPLESTEPPER_H @@ -15,7 +15,6 @@ #include "Wavefunction.h" class MDWavefunctionStepper; class MDIonicStepper; -using namespace std; class CPSampleStepper : public SampleStepper { diff --git a/src/CellStepper.h b/src/CellStepper.h index 619fe77..e62a8de 100644 --- a/src/CellStepper.h +++ b/src/CellStepper.h @@ -3,16 +3,13 @@ // CellStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: CellStepper.h,v 1.1 2004-03-11 21:58:10 fgygi Exp $ +// $Id: CellStepper.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef CELLSTEPPER_H #define CELLSTEPPER_H #include "Sample.h" #include -#include -#include -using namespace std; class CellStepper { @@ -27,7 +24,7 @@ class CellStepper CellStepper (Sample& s) : s_(s), atoms_(s.atoms), ekin_(0.0) {} - virtual void compute_new_cell(const valarray& sigma) = 0; + virtual void compute_new_cell(const std::valarray& sigma) = 0; virtual void update_cell(void) = 0; double ekin(void) const { return ekin_; } diff --git a/src/ChargeDensity.h b/src/ChargeDensity.h index 1bcbddf..615e56a 100644 --- a/src/ChargeDensity.h +++ b/src/ChargeDensity.h @@ -3,7 +3,7 @@ // ChargeDensity.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: ChargeDensity.h,v 1.4 2004-11-10 22:31:43 fgygi Exp $ +// $Id: ChargeDensity.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef CHARGEDENSITY_H #define CHARGEDENSITY_H @@ -20,7 +20,7 @@ class Wavefunction; class FourierTransform; class Basis; -typedef map TimerMap; +typedef std::map TimerMap; class ChargeDensity { @@ -31,15 +31,15 @@ class ChargeDensity const Wavefunction& wf_; Basis* vbasis_; FourierTransform* vft_; - vector ft_; // ft_[ikp]; - valarray > rhotmp; + std::vector ft_; // ft_[ikp]; + std::valarray > rhotmp; public: mutable TimerMap tmap; - vector > rhor; // rhor[ispin][i] - vector > > rhog; // rhog[ispin][ig] + std::vector > rhor; // rhor[ispin][i] + std::vector > > rhog; // rhog[ispin][ig] void update_density(void); void update_rhor(void); diff --git a/src/ConfinementPotential.h b/src/ConfinementPotential.h index b7feabf..50c1b00 100644 --- a/src/ConfinementPotential.h +++ b/src/ConfinementPotential.h @@ -3,14 +3,13 @@ // ConfinementPotential.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: ConfinementPotential.h,v 1.2 2007-01-27 23:47:56 fgygi Exp $ +// $Id: ConfinementPotential.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef CONFINEMENTPOTENTIAL_H #define CONFINEMENTPOTENTIAL_H -class Basis; #include -using namespace std; +class Basis; class ConfinementPotential { @@ -18,7 +17,7 @@ class ConfinementPotential double ecuts_, facs_, sigmas_; const Basis& basis_; - valarray fstress_, dfstress_; + std::valarray fstress_, dfstress_; public: @@ -26,8 +25,8 @@ class ConfinementPotential double sigmas(void) const { return sigmas_; } double ecuts(void) const { return ecuts_; } - const valarray& fstress(void) const { return fstress_; } - const valarray& dfstress(void) const { return dfstress_; } + const std::valarray& fstress(void) const { return fstress_; } + const std::valarray& dfstress(void) const { return dfstress_; } void update(void); diff --git a/src/Constraint.h b/src/Constraint.h index 442bf58..e461f61 100644 --- a/src/Constraint.h +++ b/src/Constraint.h @@ -3,7 +3,7 @@ // Constraint.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Constraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $ +// $Id: Constraint.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef CONSTRAINT_H #define CONSTRAINT_H @@ -11,7 +11,6 @@ #include #include #include -using namespace std; class AtomSet; @@ -19,12 +18,12 @@ class Constraint { protected: - string name_; // constraint name - vector names_; // names of atoms involved in the constraint + std::string name_; // constraint name + std::vector names_; // names of atoms involved in the constraint public: - virtual string type(void) const = 0; + virtual std::string type(void) const = 0; virtual double value(void) const = 0; virtual double velocity(void) const = 0; virtual double force(void) const = 0; @@ -32,23 +31,23 @@ class Constraint virtual double tolerance(void) const = 0; virtual void set_value(double value) = 0; virtual void set_velocity(double velocity) = 0; - virtual bool enforce_r(const vector > &r0, - vector > &rp) const = 0; - virtual bool enforce_v(const vector > &r0, - vector > &v0) const = 0; - virtual void compute_force(const vector > &r0, - const vector > &f) = 0; + virtual bool enforce_r(const std::vector > &r0, + std::vector > &rp) const = 0; + virtual bool enforce_v(const std::vector > &r0, + std::vector > &v0) const = 0; + virtual void compute_force(const std::vector > &r0, + const std::vector > &f) = 0; virtual void update(double dt) = 0; virtual void setup(const AtomSet& atoms) = 0; - virtual ostream& print(ostream &os) = 0; - string name(void) const { return name_; } - string names(int i) const + virtual std::ostream& print(std::ostream &os) = 0; + std::string name(void) const { return name_; } + std::string names(int i) const { assert( i >= 0 && i < names_.size() ); return names_[i]; } }; -ostream& operator << ( ostream &os, Constraint &c ); +std::ostream& operator << ( std::ostream &os, Constraint &c ); #endif diff --git a/src/ConstraintSet.h b/src/ConstraintSet.h index 8361354..3abfb7f 100644 --- a/src/ConstraintSet.h +++ b/src/ConstraintSet.h @@ -3,14 +3,13 @@ // ConstraintSet.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: ConstraintSet.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $ +// $Id: ConstraintSet.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef CONSTRAINTSET_H #define CONSTRAINTSET_H #include #include -using namespace std; class Atom; class AtomSet; @@ -22,7 +21,7 @@ class ConstraintSet private: const Context& ctxt_; - vector constraint_list; + std::vector constraint_list; public: @@ -30,15 +29,15 @@ class ConstraintSet bool define_constraint(AtomSet &atoms, int argc, char **argv); bool set_constraint(int argc, char **argv); bool delete_constraint(int argc, char **argv); - void list_constraints(ostream &os); + void list_constraints(std::ostream &os); int size(void) const { return constraint_list.size(); } void enforce(AtomSet& atoms); - void enforce_r(const vector > &r0, - vector > &rp); - void enforce_v(const vector > &r0, - vector > &v0); - void compute_forces(const vector > &r0, - const vector > &f); + void enforce_r(const std::vector > &r0, + std::vector > &rp); + void enforce_v(const std::vector > &r0, + std::vector > &v0); + void compute_forces(const std::vector > &r0, + const std::vector > &f); void update_constraints(double dt); void setup(AtomSet& atoms); }; diff --git a/src/Context.C b/src/Context.C index 7f0b923..4fc5461 100644 --- a/src/Context.C +++ b/src/Context.C @@ -3,20 +3,20 @@ // Context.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: Context.C,v 1.12 2006-03-07 07:03:46 fgygi Exp $ +// $Id: Context.C,v 1.13 2007-03-17 01:14:00 fgygi Exp $ +#include "Context.h" #include #include #include #include -#include -using namespace std; +#include #ifdef SCALAPACK #include "blacs.h" #endif -#include "Context.h" +using namespace std; #ifndef SCALAPACK void Cblacs_pinfo(int *mypnum, int *nprocs) diff --git a/src/Context.h b/src/Context.h index 88d3527..7ad581e 100644 --- a/src/Context.h +++ b/src/Context.h @@ -3,15 +3,13 @@ // Context.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Context.h,v 1.8 2004-11-10 22:34:17 fgygi Exp $ +// $Id: Context.h,v 1.9 2007-03-17 01:14:00 fgygi Exp $ #ifndef CONTEXT_H #define CONTEXT_H #include -#include #include -using namespace std; #if USE_MPI #include @@ -120,9 +118,9 @@ class Context int* a, int lda,int rsrc, int csrc) const; void ibcast_recv(int m, int n, int* a, int lda,int rsrc, int csrc) const; - void string_send(string& s, int rdest, int cdest) const; - void string_recv(string& s, int rsrc, int csrc) const; - void string_bcast(string& s, int isrc) const; + void string_send(std::string& s, int rdest, int cdest) const; + void string_recv(std::string& s, int rsrc, int csrc) const; + void string_bcast(std::string& s, int isrc) const; bool operator==(const Context& ctxt) const; @@ -148,8 +146,8 @@ class Context Context(const Context& ctxt); Context& operator=(const Context& rhs); - void print(ostream& os) const; + void print(std::ostream& os) const; }; -ostream& operator << ( ostream& os, const Context& ctxt ); +std::ostream& operator << ( std::ostream& os, const Context& ctxt ); #endif diff --git a/src/Control.h b/src/Control.h index 87ecad4..a670d7e 100644 --- a/src/Control.h +++ b/src/Control.h @@ -3,7 +3,7 @@ // Control.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: Control.h,v 1.10 2007-01-27 23:47:56 fgygi Exp $ +// $Id: Control.h,v 1.11 2007-03-17 01:14:00 fgygi Exp $ #ifndef CONTROL_H #define CONTROL_H @@ -14,34 +14,34 @@ struct Control { // control variables - string debug, timing; - string wf_dyn, atoms_dyn; // dynamics string flags + std::string debug, timing; + std::string wf_dyn, atoms_dyn; // dynamics string flags int nite; double emass; // electron mass double fermi_temp; // temperature of Fermi distribution double ecutprec; - string wf_diag; + std::string wf_diag; - string tcp; + std::string tcp; double tcp_rcut; double tcp_sigma; double gms_mix; // mixing factor for generalized minimum spread functions - string thermostat; + std::string thermostat; double th_temp,th_time, th_width; // thermostat control - string stress; - string cell_dyn; - string cell_lock; + std::string stress; + std::string cell_dyn; + std::string cell_lock; double cell_mass; double ecuts; // confinement potential energy cutoff double ext_stress[6]; // external stress tensor: xx,yy,zz,xy,yz,xz - string xc; - string spin; + std::string xc; + std::string spin; int delta_spin; double dt; diff --git a/src/D3vector.h b/src/D3vector.h index 3bd9772..8290cc2 100644 --- a/src/D3vector.h +++ b/src/D3vector.h @@ -5,14 +5,13 @@ // double 3-vectors // //////////////////////////////////////////////////////////////////////////////// -// $ Id: $ +// $Id: D3vector.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef D3VECTOR_H #define D3VECTOR_H #include #include #include -using namespace std; class D3vector { @@ -141,13 +140,13 @@ class D3vector return a / length( a ); } - friend ostream& operator << ( ostream& os, const D3vector& v ) + friend std::ostream& operator << ( std::ostream& os, const D3vector& v ) { os << v.x << " " << v.y << " " << v.z; return os; } - friend istream& operator >> ( istream& is, D3vector& v ) + friend std::istream& operator >> ( std::istream& is, D3vector& v ) { is >> v.x >> v.y >> v.z ; return is; diff --git a/src/DistanceConstraint.h b/src/DistanceConstraint.h index e2e845d..27a6a4d 100644 --- a/src/DistanceConstraint.h +++ b/src/DistanceConstraint.h @@ -3,7 +3,7 @@ // DistanceConstraint.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: DistanceConstraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $ +// $Id: DistanceConstraint.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef DISTANCECONSTRAINT_H #define DISTANCECONSTRAINT_H @@ -11,18 +11,19 @@ #include "Constraint.h" #include #include // fabs + class AtomSet; class DistanceConstraint : public Constraint { - string name1_, name2_; + std::string name1_, name2_; int ia1_, ia2_, is1_, is2_; double m1_, m2_, m1_inv_, m2_inv_; double distance_, velocity_, force_, weight_, tol_; public: - DistanceConstraint(string name, string name1, string name2, + DistanceConstraint(std::string name, std::string name1, std::string name2, double distance, double velocity, double tolerance): name1_(name1), name2_(name2), distance_(distance), velocity_(velocity), tol_(tolerance), m1_(0.0), m2_(0.0) @@ -35,7 +36,7 @@ class DistanceConstraint : public Constraint weight_ = 1.0; } - string type(void) const { return "distance"; } + std::string type(void) const { return "distance"; } double value(void) const { return distance_; } double velocity(void) const { return velocity_; } double force(void) const { return force_; } @@ -52,13 +53,13 @@ class DistanceConstraint : public Constraint void setup(const AtomSet& atoms); void update(double dt); - bool enforce_r(const vector > &r0, - vector > &rp) const; - bool enforce_v(const vector > &r0, - vector > &v0) const; - void compute_force(const vector > &r0, - const vector > &f); - ostream& print( ostream& os ); + bool enforce_r(const std::vector > &r0, + std::vector > &rp) const; + bool enforce_v(const std::vector > &r0, + std::vector > &v0) const; + void compute_force(const std::vector > &r0, + const std::vector > &f); + std::ostream& print( std::ostream& os ); }; #endif diff --git a/src/EnergyFunctional.h b/src/EnergyFunctional.h index bd6f1ed..3a5fc09 100644 --- a/src/EnergyFunctional.h +++ b/src/EnergyFunctional.h @@ -3,7 +3,7 @@ // EnergyFunctional.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: EnergyFunctional.h,v 1.14 2005-06-27 22:24:43 fgygi Exp $ +// $Id: EnergyFunctional.h,v 1.15 2007-03-17 01:14:00 fgygi Exp $ #ifndef ENERGYFUNCTIONAL_H #define ENERGYFUNCTIONAL_H @@ -16,7 +16,6 @@ #include "ChargeDensity.h" #include "StructureFactor.h" #include "Timer.h" -using namespace std; class Sample; class Basis; @@ -28,7 +27,7 @@ class XCPotential; class NonLocalPotential; class ConfinementPotential; -typedef map TimerMap; +typedef std::map TimerMap; class EnergyFunctional { @@ -38,35 +37,35 @@ class EnergyFunctional const ChargeDensity& cd_; Basis* vbasis_; FourierTransform *vft; - vector ft; + std::vector ft; StructureFactor sf; XCPotential* xcp; NonLocalPotential* nlp; - vector cfp; // cfp[ikp] + std::vector cfp; // cfp[ikp] - vector > vps, dvps, rhops; - vector > tmp_r, vion_local_g, dvion_local_g, vlocal_g, - rhopst, rhogt, rhoelg, vtemp; - vector ftmp; + std::vector > vps, dvps, rhops; + std::vector > tmp_r, vion_local_g, + dvion_local_g, vlocal_g, rhopst, rhogt, rhoelg, vtemp; + std::vector ftmp; - vector > tau0, fion_esr; - vector zv_, rcps_; - vector na_; + std::vector > tau0, fion_esr; + std::vector zv_, rcps_; + std::vector na_; int namax_; int nsp_; double ekin_, econf_, eps_, enl_, ehart_, ecoul_, exc_, esr_, eself_, ets_, etotal_; - valarray sigma_ekin,sigma_econf,sigma_eps,sigma_ehart,sigma_exc, + std::valarray sigma_ekin,sigma_econf,sigma_eps,sigma_ehart,sigma_exc, sigma_enl, sigma_esr, sigma; public: - vector > v_r; + std::vector > v_r; mutable TimerMap tmap; double energy(bool compute_hpsi, Wavefunction& dwf, - bool compute_forces, vector >& fion, - bool compute_stress, valarray& sigma); + bool compute_forces, std::vector >& fion, + bool compute_stress, std::valarray& sigma); double etotal(void) const { return etotal_; } double ekin(void) const { return ekin_; } @@ -87,10 +86,10 @@ class EnergyFunctional void atoms_moved(void); void cell_moved(void); - void print(ostream& os) const; + void print(std::ostream& os) const; EnergyFunctional(const Sample& s, const ChargeDensity& cd); ~EnergyFunctional(); }; -ostream& operator << ( ostream& os, const EnergyFunctional& e ); +std::ostream& operator << ( std::ostream& os, const EnergyFunctional& e ); #endif diff --git a/src/FourierTransform.C b/src/FourierTransform.C index 2d65ddf..8d0acc4 100644 --- a/src/FourierTransform.C +++ b/src/FourierTransform.C @@ -3,7 +3,7 @@ // FourierTransform.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: FourierTransform.C,v 1.16 2005-04-26 19:04:36 fgygi Exp $ +// $Id: FourierTransform.C,v 1.17 2007-03-17 01:14:00 fgygi Exp $ // The following macros must be defined: USE_FFTW, USE_ESSL, USE_ESSL_2DFFT @@ -14,7 +14,6 @@ #include #include #include -using namespace std; #include #if USE_MPI @@ -28,16 +27,17 @@ typedef int MPI_Comm; #ifdef ADD_ #define zdscal zdscal_ #endif -extern "C" void zdscal(int *n,double *alpha,complex *x,int *incx); + +extern "C" void zdscal(int *n,double *alpha,std::complex *x,int *incx); #elif USE_ESSL extern "C" { - void dcft_(int *initflag, complex *x, int *inc2x, int *inc3x, - complex *y, int *inc2y, int *inc3y, + void dcft_(int *initflag, std::complex *x, int *inc2x, int *inc3x, + std::complex *y, int *inc2y, int *inc3y, int *length, int *ntrans, int *isign, double *scale, double *aux1, int *naux1, double *aux2, int *naux2); - void dcft2_(int *initflag, complex *x, int *inc1x, int *inc2x, - complex *y, int *inc1y, int *inc2y, + void dcft2_(int *initflag, std::complex *x, int *inc1x, int *inc2x, + std::complex *y, int *inc1y, int *inc2y, int *n1, int *n2, int *isign, double *scale, double *aux1, int *naux1, double *aux2, int *naux2); @@ -45,19 +45,23 @@ extern "C" { } #else #define NO_FFT_LIB 1 -void cfftm ( complex *ain, complex *aout, double scale, - int ntrans, int length, int ainc, int ajmp, int idir ); +void cfftm ( std::complex *ain, std::complex *aout, + double scale, int ntrans, int length, int ainc, int ajmp, int idir ); #endif #if USE_GATHER_SCATTER extern "C" { // zgthr: x(i) = y(indx(i)) - void zgthr_(int* n, complex* y, complex* x, int*indx); + void zgthr_(int* n, std::complex* y, + std::complex* x, int*indx); // zsctr: y(indx(i)) = x(i) - void zsctr_(int* n, complex* x, int* indx, complex* y); + void zsctr_(int* n, std::complex* x, int* indx, + std::complex* y); } #endif +using namespace std; + //////////////////////////////////////////////////////////////////////////////// FourierTransform::~FourierTransform() { diff --git a/src/FourierTransform.h b/src/FourierTransform.h index fa48c9c..0501042 100644 --- a/src/FourierTransform.h +++ b/src/FourierTransform.h @@ -3,14 +3,13 @@ // FourierTransform.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: FourierTransform.h,v 1.9 2005-01-04 22:08:51 fgygi Exp $ +// $Id: FourierTransform.h,v 1.10 2007-03-17 01:14:00 fgygi Exp $ #ifndef FOURIERTRANSFORM_H #define FOURIERTRANSFORM_H #include #include -using namespace std; #if USE_FFTW #include "fftw.h" @@ -34,27 +33,27 @@ class FourierTransform int nvec_; - vector np2_loc_; // np2_loc_[iproc], iproc=0, nprocs_-1 - vector np2_first_; // np2_first_[iproc], iproc=0, nprocs_-1 - vector > zvec_; + std::vector np2_loc_; // np2_loc_[iproc], iproc=0, nprocs_-1 + std::vector np2_first_; // np2_first_[iproc], iproc=0, nprocs_-1 + std::vector > zvec_; - vector scounts, sdispl, rcounts, rdispl; - vector > sbuf, rbuf; + std::vector scounts, sdispl, rcounts, rdispl; + std::vector > sbuf, rbuf; - vector ifftp_, ifftm_; - vector ipack_, iunpack_; + std::vector ifftp_, ifftm_; + std::vector ipack_, iunpack_; void init_lib(void); #if USE_ESSL #if USE_ESSL_2DFFT - vector aux1xyf; - vector aux1xyb; + std::vector aux1xyf; + std::vector aux1xyb; int naux1xy; #else - vector aux1xf, aux1yf, aux1zf; - vector aux1xb, aux1yb, aux1zb; - vector aux2; + std::vector aux1xf, aux1yf, aux1zf; + std::vector aux1xb, aux1yb, aux1zb; + std::vector aux2; int naux1x,naux1y,naux1z,naux2; #endif #elif USE_FFTW || USE_FFTW3 @@ -63,13 +62,13 @@ class FourierTransform // no library #endif - void vector_to_zvec(const complex* c); - void zvec_to_vector(complex* c); - void doublevector_to_zvec(const complex* c1, - const complex *c2); - void zvec_to_doublevector(complex* c1, complex* c2); - void fwd(complex* val); - void bwd(complex* val); + void vector_to_zvec(const std::complex* c); + void zvec_to_vector(std::complex* c); + void doublevector_to_zvec(const std::complex* c1, + const std::complex *c2); + void zvec_to_doublevector(std::complex* c1, std::complex* c2); + void fwd(std::complex* val); + void bwd(std::complex* val); public: @@ -81,16 +80,16 @@ class FourierTransform // forward: Fourier analysis, compute Fourier coefficients // forward transform includes scaling by 1/np012 // single transforms: c -> f, f -> c - void backward (const complex* c, complex* f); + void backward (const std::complex* c, std::complex* f); // Note: forward transforms overwrite the array f - void forward(complex* f, complex* c); + void forward(std::complex* f, std::complex* c); // double transforms: c1 + i*c2 -> f, f -> c1 + i*c2 - void backward (const complex* c1, const complex* c2, - complex* f); + void backward (const std::complex* c1, + const std::complex* c2, std::complex* f); // Note: forward transforms overwrite the array f - void forward(complex* f, - complex* c1, complex* c2); + void forward(std::complex* f, + std::complex* c1, std::complex* c2); int np0() const { return np0_; } int np1() const { return np1_; } diff --git a/src/IonicStepper.h b/src/IonicStepper.h index a08efa3..7bcaa56 100644 --- a/src/IonicStepper.h +++ b/src/IonicStepper.h @@ -3,7 +3,7 @@ // IonicStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: IonicStepper.h,v 1.7 2005-06-27 22:23:51 fgygi Exp $ +// $Id: IonicStepper.h,v 1.8 2007-03-17 01:14:00 fgygi Exp $ #ifndef IONICSTEPPER_H #define IONICSTEPPER_H @@ -11,7 +11,6 @@ #include "Sample.h" #include "Species.h" #include -using namespace std; class IonicStepper { @@ -23,12 +22,12 @@ class IonicStepper double dt_; int nsp_; int ndofs_; - vector na_; // number of atoms per species na_[nsp_] - vector > r0_; // r0_[nsp_][3*na_] - vector > rp_; // rp_[nsp_][3*na_] - vector > rm_; // rm_[nsp_][3*na_] - vector > v0_; // v0_[nsp_][3*na_] - vector pmass_; // pmass_[nsp_] + std::vector na_; // number of atoms per species na_[nsp_] + std::vector > r0_; // r0_[nsp_][3*na_] + std::vector > rp_; // rp_[nsp_][3*na_] + std::vector > rm_; // rm_[nsp_][3*na_] + std::vector > v0_; // v0_[nsp_][3*na_] + std::vector pmass_; // pmass_[nsp_] public: @@ -59,16 +58,18 @@ class IonicStepper double r0(int is, int i) const { return r0_[is][i]; } double v0(int is, int i) const { return v0_[is][i]; } - const vector >& r0(void) const { return r0_; } - const vector >& v0(void) const { return v0_; } - const vector& pmass(void) const { return pmass_; } + const std::vector >& r0(void) const { return r0_; } + const std::vector >& v0(void) const { return v0_; } + const std::vector& pmass(void) const { return pmass_; } void setup_constraints(void) { constraints_.setup(atoms_); } - virtual void compute_r(double e0, const vector >& f0) = 0; - virtual void compute_v(double e0, const vector >& f0) = 0; + virtual void compute_r(double e0, + const std::vector >& f0) = 0; + virtual void compute_v(double e0, + const std::vector >& f0) = 0; virtual void reset(void) {} virtual double ekin(void) const { return 0.0; } virtual double temp(void) const { return 0.0; } diff --git a/src/LDAFunctional.h b/src/LDAFunctional.h index e860656..cac4688 100644 --- a/src/LDAFunctional.h +++ b/src/LDAFunctional.h @@ -3,28 +3,27 @@ // LDAFunctional.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: LDAFunctional.h,v 1.3 2004-09-14 22:24:11 fgygi Exp $ +// $Id: LDAFunctional.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef LDAFUNCTIONAL_H #define LDAFUNCTIONAL_H #include #include -using namespace std; #include "XCFunctional.h" class LDAFunctional : public XCFunctional { void xc_unpolarized(const double rh, double &ee, double &vv); void xc_polarized(const double rh, double &ee, double &vv); - vector _exc; - vector > _vxc; + std::vector _exc; + std::vector > _vxc; LDAFunctional(); public: - LDAFunctional(const vector > &rhoe) + LDAFunctional(const std::vector > &rhoe) { _nspin = rhoe.size(); if ( _nspin > 1 ) assert(rhoe[0].size() == rhoe[1].size()); @@ -53,7 +52,7 @@ class LDAFunctional : public XCFunctional }; bool isGGA() { return false; }; - string name() { return "LDA"; }; + std::string name() { return "LDA"; }; void setxc(void); }; #endif diff --git a/src/MDIonicStepper.C b/src/MDIonicStepper.C index 2fc8cdc..4d4c6e6 100644 --- a/src/MDIonicStepper.C +++ b/src/MDIonicStepper.C @@ -3,9 +3,10 @@ // MDIonicStepper.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: MDIonicStepper.C,v 1.11 2006-11-05 02:06:29 fgygi Exp $ +// $Id: MDIonicStepper.C,v 1.12 2007-03-17 01:14:00 fgygi Exp $ #include "MDIonicStepper.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// void MDIonicStepper::compute_r(double e0, const vector >& f0) diff --git a/src/MDIonicStepper.h b/src/MDIonicStepper.h index bc3f11c..f9378c7 100644 --- a/src/MDIonicStepper.h +++ b/src/MDIonicStepper.h @@ -3,7 +3,7 @@ // MDIonicStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: MDIonicStepper.h,v 1.8 2006-08-22 15:16:10 fgygi Exp $ +// $Id: MDIonicStepper.h,v 1.9 2007-03-17 01:14:00 fgygi Exp $ // // IonicStepper is used in the following way @@ -48,7 +48,7 @@ class MDIonicStepper : public IonicStepper double th_width_; double ekin_; double eta_; - string thermostat_; + std::string thermostat_; void compute_ekin(void); public: @@ -66,8 +66,8 @@ class MDIonicStepper : public IonicStepper compute_ekin(); } - void compute_r(double e0, const vector >& f0); - void compute_v(double e0, const vector >& f0); + void compute_r(double e0, const std::vector >& f0); + void compute_v(double e0, const std::vector >& f0); double eta(void) const { return eta_; } double ekin(void) const { return ekin_; } double temp(void) const diff --git a/src/Makefile b/src/Makefile index 243f4fe..d11c8dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# $Id: Makefile,v 1.41 2006-11-04 20:22:01 fgygi Exp $ +# $Id: Makefile,v 1.42 2007-03-17 01:14:00 fgygi Exp $ #------------------------------------------------------------------------------ # include $(TARGET).mk @@ -32,6 +32,7 @@ OBJECTS=qb.o AtomSet.o Atom.o Species.o \ AndersonMixer.o SDAIonicStepper.o \ ConstraintSet.o Constraint.o DistanceConstraint.o \ AngleConstraint.o TorsionConstraint.o jacobi.o \ + SampleWriter.o \ $(PLTOBJECTS) CXXFLAGS += -DTARGET='"$(TARGET)"' $(EXEC): $(OBJECTS) @@ -56,14 +57,15 @@ CXXFLAGS += -DTARGET='"$(TARGET)"' Base64Transcoder.o ConstraintSet.o DistanceConstraint.o \ AngleConstraint.o TorsionConstraint.o XMLGFPreprocessor.o $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) - bisection: bisection.o \ + bisection: bisection.o jade.o \ Context.o AtomSet.o Atom.o Basis.o SlaterDet.o \ Constraint.o ConstraintSet.o Wavefunction.o UnitCell.o Matrix.o \ SampleReader.o StructuredDocumentHandler.o FourierTransform.o \ Species.o SpeciesReader.o sinft.o spline.o SpeciesHandler.o \ SampleHandler.o WavefunctionHandler.o AtomSetHandler.o \ Base64Transcoder.o ConstraintSet.o DistanceConstraint.o \ - AngleConstraint.o TorsionConstraint.o XMLGFPreprocessor.o + AngleConstraint.o TorsionConstraint.o XMLGFPreprocessor.o \ + SampleWriter.o qbox_xmlns.o isodate.o $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) plotSample: plotSample.o \ Context.o AtomSet.o Atom.o Basis.o SlaterDet.o \ @@ -199,23 +201,25 @@ Basis.o: Basis.h D3vector.h UnitCell.h Context.h Basis.o: D3vector.h UnitCell.h BasisMapping.o: Basis.h D3vector.h UnitCell.h Context.h BasisMapping.h bisection.o: Context.h Sample.h AtomSet.h Atom.h D3vector.h ConstraintSet.h -bisection.o: Wavefunction.h UnitCell.h Control.h SampleReader.h Basis.h -bisection.o: FourierTransform.h Timer.h SlaterDet.h Matrix.h +bisection.o: Wavefunction.h UnitCell.h Control.h SampleReader.h +bisection.o: SampleWriter.h Basis.h FourierTransform.h Timer.h SlaterDet.h +bisection.o: Matrix.h isodate.h BLYPFunctional.o: BLYPFunctional.h XCFunctional.h BLYPFunctional.o: XCFunctional.h -BOSampleStepper.o: BOSampleStepper.h SampleStepper.h Sample.h AtomSet.h -BOSampleStepper.o: Context.h Atom.h D3vector.h ConstraintSet.h Wavefunction.h -BOSampleStepper.o: UnitCell.h Control.h Timer.h EnergyFunctional.h -BOSampleStepper.o: ChargeDensity.h StructureFactor.h SlaterDet.h Basis.h -BOSampleStepper.o: Matrix.h WavefunctionStepper.h SDWavefunctionStepper.h -BOSampleStepper.o: PSDWavefunctionStepper.h PSDAWavefunctionStepper.h -BOSampleStepper.o: SDIonicStepper.h IonicStepper.h Species.h -BOSampleStepper.o: SDAIonicStepper.h AndersonMixer.h MDIonicStepper.h -BOSampleStepper.o: SDCellStepper.h CellStepper.h Preconditioner.h -BOSampleStepper.o: SampleStepper.h Sample.h AtomSet.h Context.h Atom.h +BOSampleStepper.o: BOSampleStepper.h SampleStepper.h Timer.h +BOSampleStepper.o: EnergyFunctional.h ChargeDensity.h Context.h +BOSampleStepper.o: StructureFactor.h Sample.h AtomSet.h Atom.h D3vector.h +BOSampleStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h +BOSampleStepper.o: SlaterDet.h Basis.h Matrix.h WavefunctionStepper.h +BOSampleStepper.o: SDWavefunctionStepper.h PSDWavefunctionStepper.h +BOSampleStepper.o: PSDAWavefunctionStepper.h SDIonicStepper.h IonicStepper.h +BOSampleStepper.o: Species.h SDAIonicStepper.h AndersonMixer.h +BOSampleStepper.o: MDIonicStepper.h SDCellStepper.h CellStepper.h +BOSampleStepper.o: Preconditioner.h +BOSampleStepper.o: SampleStepper.h Timer.h EnergyFunctional.h ChargeDensity.h +BOSampleStepper.o: Context.h StructureFactor.h Sample.h AtomSet.h Atom.h BOSampleStepper.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h -BOSampleStepper.o: Control.h Timer.h EnergyFunctional.h ChargeDensity.h -BOSampleStepper.o: StructureFactor.h +BOSampleStepper.o: Control.h CellDyn.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h ConstraintSet.h CellDyn.o: Wavefunction.h UnitCell.h Control.h SlaterDet.h Basis.h Matrix.h CellDyn.o: Timer.h @@ -244,19 +248,21 @@ ConstraintSet.o: ConstraintSet.h DistanceConstraint.h Constraint.h ConstraintSet.o: AngleConstraint.h D3vector.h TorsionConstraint.h Atom.h ConstraintSet.o: AtomSet.h Context.h Context.o: Context.h -CPSampleStepper.o: CPSampleStepper.h SampleStepper.h Sample.h AtomSet.h -CPSampleStepper.o: Context.h Atom.h D3vector.h ConstraintSet.h Wavefunction.h -CPSampleStepper.o: UnitCell.h Control.h Timer.h EnergyFunctional.h -CPSampleStepper.o: ChargeDensity.h StructureFactor.h SlaterDet.h Basis.h -CPSampleStepper.o: Matrix.h MDWavefunctionStepper.h WavefunctionStepper.h -CPSampleStepper.o: MDIonicStepper.h IonicStepper.h Species.h SDCellStepper.h -CPSampleStepper.o: CellStepper.h -CPSampleStepper.o: SampleStepper.h Sample.h AtomSet.h Context.h Atom.h +CPSampleStepper.o: CPSampleStepper.h SampleStepper.h Timer.h +CPSampleStepper.o: EnergyFunctional.h ChargeDensity.h Context.h +CPSampleStepper.o: StructureFactor.h Sample.h AtomSet.h Atom.h D3vector.h +CPSampleStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h +CPSampleStepper.o: SlaterDet.h Basis.h Matrix.h MDWavefunctionStepper.h +CPSampleStepper.o: WavefunctionStepper.h MDIonicStepper.h IonicStepper.h +CPSampleStepper.o: Species.h SDCellStepper.h CellStepper.h +CPSampleStepper.o: SampleStepper.h Timer.h EnergyFunctional.h ChargeDensity.h +CPSampleStepper.o: Context.h StructureFactor.h Sample.h AtomSet.h Atom.h CPSampleStepper.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h -CPSampleStepper.o: Control.h Timer.h EnergyFunctional.h ChargeDensity.h -CPSampleStepper.o: StructureFactor.h +CPSampleStepper.o: Control.h Debug.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h ConstraintSet.h Debug.o: Wavefunction.h UnitCell.h Control.h +DiagCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h +DiagCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h DistanceCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h DistanceCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h DistanceConstraint.o: DistanceConstraint.h Constraint.h AtomSet.h Context.h @@ -293,7 +299,8 @@ IonicStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h IonicStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h Species.h isodate.o: isodate.h jacobi.o: Context.h Matrix.h blas.h -jade.o: Context.h Matrix.h blas.h +jade-2006-12-14-ok.o: Context.h Matrix.h blas.h Timer.h +jade.o: Context.h Matrix.h blas.h Timer.h LDAFunctional.o: LDAFunctional.h XCFunctional.h LDAFunctional.o: XCFunctional.h ListAtomsCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h @@ -318,12 +325,14 @@ MDIonicStepper.o: IonicStepper.h Sample.h AtomSet.h Context.h Atom.h MDIonicStepper.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h MDIonicStepper.o: Control.h Species.h MDWavefunctionStepper.o: MDWavefunctionStepper.h WavefunctionStepper.h -MDWavefunctionStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -MDWavefunctionStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h -MDWavefunctionStepper.o: Timer.h SlaterDet.h Basis.h Matrix.h -MDWavefunctionStepper.o: WavefunctionStepper.h Sample.h AtomSet.h Context.h -MDWavefunctionStepper.o: Atom.h D3vector.h ConstraintSet.h Wavefunction.h -MDWavefunctionStepper.o: UnitCell.h Control.h Timer.h +MDWavefunctionStepper.o: Timer.h Wavefunction.h D3vector.h UnitCell.h +MDWavefunctionStepper.o: SlaterDet.h Context.h Basis.h Matrix.h Sample.h +MDWavefunctionStepper.o: AtomSet.h Atom.h ConstraintSet.h Control.h +MDWavefunctionStepper.o: WavefunctionStepper.h Timer.h +MLWFTransform.o: MLWFTransform.h Basis.h D3vector.h UnitCell.h SlaterDet.h +MLWFTransform.o: Context.h Matrix.h Timer.h BasisMapping.h jade.h blas.h +MLWFTransform.o: Basis.h D3vector.h UnitCell.h SlaterDet.h Context.h Matrix.h +MLWFTransform.o: Timer.h MoveCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h MoveCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h MultiDistanceConstraint.o: MultiDistanceConstraint.h Constraint.h Atom.h @@ -345,7 +354,7 @@ PBEFunctional.o: XCFunctional.h plotSample.o: Context.h Sample.h AtomSet.h Atom.h D3vector.h ConstraintSet.h plotSample.o: Wavefunction.h UnitCell.h Control.h SampleReader.h Basis.h plotSample.o: FourierTransform.h Timer.h SlaterDet.h Matrix.h Species.h -plotSample.o: atomic_properties.h +plotSample.o: ChargeDensity.h atomic_properties.h Preconditioner.o: Preconditioner.h EnergyFunctional.h ChargeDensity.h Timer.h Preconditioner.o: Context.h StructureFactor.h Sample.h AtomSet.h Atom.h Preconditioner.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h @@ -354,21 +363,16 @@ Preconditioner.o: ConfinementPotential.h PrintCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h PrintCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h PSDAWavefunctionStepper.o: PSDAWavefunctionStepper.h WavefunctionStepper.h -PSDAWavefunctionStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -PSDAWavefunctionStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h -PSDAWavefunctionStepper.o: Control.h Timer.h SlaterDet.h Basis.h Matrix.h +PSDAWavefunctionStepper.o: Timer.h Wavefunction.h D3vector.h UnitCell.h +PSDAWavefunctionStepper.o: SlaterDet.h Context.h Basis.h Matrix.h PSDAWavefunctionStepper.o: Preconditioner.h -PSDAWavefunctionStepper.o: WavefunctionStepper.h Sample.h AtomSet.h Context.h -PSDAWavefunctionStepper.o: Atom.h D3vector.h ConstraintSet.h Wavefunction.h -PSDAWavefunctionStepper.o: UnitCell.h Control.h Timer.h +PSDAWavefunctionStepper.o: WavefunctionStepper.h Timer.h Wavefunction.h +PSDAWavefunctionStepper.o: D3vector.h UnitCell.h PSDWavefunctionStepper.o: PSDWavefunctionStepper.h WavefunctionStepper.h -PSDWavefunctionStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -PSDWavefunctionStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h -PSDWavefunctionStepper.o: Timer.h SlaterDet.h Basis.h Matrix.h +PSDWavefunctionStepper.o: Timer.h Wavefunction.h D3vector.h UnitCell.h +PSDWavefunctionStepper.o: SlaterDet.h Context.h Basis.h Matrix.h PSDWavefunctionStepper.o: Preconditioner.h -PSDWavefunctionStepper.o: WavefunctionStepper.h Sample.h AtomSet.h Context.h -PSDWavefunctionStepper.o: Atom.h D3vector.h ConstraintSet.h Wavefunction.h -PSDWavefunctionStepper.o: UnitCell.h Control.h Timer.h +PSDWavefunctionStepper.o: WavefunctionStepper.h Timer.h qb.o: isodate.h release.h qbox_xmlns.h Context.h UserInterface.h Sample.h qb.o: AtomSet.h Atom.h D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h qb.o: Control.h Timer.h AngleCmd.h AtomCmd.h ConstraintCmd.h DistanceCmd.h @@ -406,17 +410,20 @@ SampleReader.o: SampleReader.h SpeciesReader.h Species.h Basis.h SampleReader.o: FourierTransform.h Timer.h SlaterDet.h Matrix.h SampleReader.o: XMLGFPreprocessor.h SampleReader.o: Context.h -SampleStepper.o: SampleStepper.h Sample.h AtomSet.h Context.h Atom.h +SampleStepper.o: SampleStepper.h Timer.h Sample.h AtomSet.h Context.h Atom.h SampleStepper.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h -SampleStepper.o: Control.h Timer.h Species.h -SampleStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -SampleStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h Timer.h +SampleStepper.o: Control.h Species.h +SampleStepper.o: Timer.h SampleViewer.o: SampleViewer.h D3vector.h Sample.h AtomSet.h Context.h Atom.h SampleViewer.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h SampleViewer.o: D3vector.h +SampleWriter.o: SampleWriter.h Context.h Sample.h AtomSet.h Atom.h D3vector.h +SampleWriter.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h +SampleWriter.o: qbox_xmlns.h +SampleWriter.o: Context.h SaveCmd.o: SaveCmd.h UserInterface.h Sample.h AtomSet.h Context.h Atom.h SaveCmd.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h Control.h -SaveCmd.o: isodate.h release.h qbox_xmlns.h +SaveCmd.o: SampleWriter.h isodate.h release.h SaveCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h SaveCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h scansample.o: Timer.h @@ -438,17 +445,12 @@ SDIonicStepper.o: IonicStepper.h Sample.h AtomSet.h Context.h Atom.h SDIonicStepper.o: D3vector.h ConstraintSet.h Wavefunction.h UnitCell.h SDIonicStepper.o: Control.h Species.h SDWavefunctionStepper.o: SDWavefunctionStepper.h WavefunctionStepper.h -SDWavefunctionStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -SDWavefunctionStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h -SDWavefunctionStepper.o: Timer.h SlaterDet.h Basis.h Matrix.h -SDWavefunctionStepper.o: WavefunctionStepper.h Sample.h AtomSet.h Context.h -SDWavefunctionStepper.o: Atom.h D3vector.h ConstraintSet.h Wavefunction.h -SDWavefunctionStepper.o: UnitCell.h Control.h Timer.h +SDWavefunctionStepper.o: Timer.h Wavefunction.h D3vector.h UnitCell.h +SDWavefunctionStepper.o: SlaterDet.h Context.h Basis.h Matrix.h Sample.h +SDWavefunctionStepper.o: AtomSet.h Atom.h ConstraintSet.h Control.h +SDWavefunctionStepper.o: WavefunctionStepper.h Timer.h SetCmd.o: UserInterface.h Sample.h AtomSet.h Context.h Atom.h D3vector.h SetCmd.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h -ShiftMapping.o: Basis.h D3vector.h UnitCell.h Context.h ShiftMapping.h -ShiftMapping.o: BasisMapping.h -ShiftMapping.o: BasisMapping.h SinCosMapping.o: Basis.h D3vector.h UnitCell.h Context.h SinCosMapping.h SinCosMapping.o: Timer.h SinCosMapping.o: Timer.h @@ -498,8 +500,7 @@ TestHandler.o: StrX.h testjacobi.o: Timer.h Context.h Matrix.h jacobi.h testjade.o: Timer.h Context.h Matrix.h jade.h testLDAFunctional.o: LDAFunctional.h XCFunctional.h -testMapping.o: Basis.h D3vector.h UnitCell.h Context.h ShiftMapping.h -testMapping.o: BasisMapping.h +testMapping.o: Basis.h D3vector.h UnitCell.h Context.h testMatrix.o: Timer.h Context.h Matrix.h testMemParse.o: StrX.h testofstream.o: Context.h @@ -547,8 +548,6 @@ Wavefunction.o: D3vector.h UnitCell.h WavefunctionHandler.o: StructureHandler.h UnitCell.h D3vector.h WavefunctionHandler.o: Wavefunction.h SlaterDet.h Context.h Basis.h Matrix.h WavefunctionHandler.o: Timer.h -WavefunctionStepper.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h -WavefunctionStepper.o: ConstraintSet.h Wavefunction.h UnitCell.h Control.h WavefunctionStepper.o: Timer.h WfDiag.o: Sample.h AtomSet.h Context.h Atom.h D3vector.h ConstraintSet.h WfDiag.o: Wavefunction.h UnitCell.h Control.h diff --git a/src/Matrix.h b/src/Matrix.h index ffe276c..bcf4185 100644 --- a/src/Matrix.h +++ b/src/Matrix.h @@ -3,7 +3,7 @@ // Matrix.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Matrix.h,v 1.11 2005-02-04 21:59:30 fgygi Exp $ +// $Id: Matrix.h,v 1.12 2007-03-17 01:14:00 fgygi Exp $ #ifndef MATRIX_H #define MATRIX_H @@ -14,7 +14,6 @@ class Context; #include #include -using namespace std; class ComplexMatrix; @@ -119,7 +118,7 @@ class DoubleMatrix clear(); } - void print(ostream& os) const; + void print(std::ostream& os) const; explicit DoubleMatrix(const Context& ctxt) : ctxt_(ctxt), m_(0), n_(0), mb_(0), nb_(0), size_(0), reference_(false), val(0) {} @@ -225,7 +224,7 @@ class DoubleMatrix void potri(char uplo); // LU decomposition - void lu(valarray& ipiv); + void lu(std::valarray& ipiv); // compute inverse of a square matrix void inverse(void); @@ -237,28 +236,29 @@ class DoubleMatrix void sygst(int, char, const DoubleMatrix&); // compute eigenvalues and eigenvectors of symmetric matrix *this - void syev(char uplo, valarray& w, DoubleMatrix& z); + void syev(char uplo, std::valarray& w, DoubleMatrix& z); // compute eigenvalues (only) of symmetric matrix *this - void syev(char uplo, valarray& w); + void syev(char uplo, std::valarray& w); // compute eigenvalues and eigenvectors of symmetric matrix *this // using the divide and conquer method of Tisseur and Dongarra - void syevd(char uplo, valarray& w, DoubleMatrix& z); + void syevd(char uplo, std::valarray& w, DoubleMatrix& z); // compute eigenvalues (only) of symmetric matrix *this // using the divide and conquer method of Tisseur and Dongarra - void syevd(char uplo, valarray& w); + void syevd(char uplo, std::valarray& w); // compute eigenvalues and eigenvectors of symmetric matrix *this // using the expert driver - void syevx(char uplo, valarray& w, DoubleMatrix& z, double abstol); + void syevx(char uplo, std::valarray& w, DoubleMatrix& z, + double abstol); // compute eigenvalues (only) of symmetric matrix *this // using the divide and conquer method of Tisseur and Dongarra - //void syevx(char uplo, valarray& w); + //void syevx(char uplo, std::valarray& w); }; -ostream& operator << ( ostream& os, const DoubleMatrix& a ); +std::ostream& operator << ( std::ostream& os, const DoubleMatrix& a ); class ComplexMatrix { @@ -278,14 +278,14 @@ class ComplexMatrix bool active_; bool m_incomplete_, n_incomplete_; // this process has an incomplete block bool reference_; // object was created using the copy constructor - complex* val; + std::complex* val; public: - complex* valptr(int i=0) { return &val[i]; } - const complex* cvalptr(int i=0) const { return &val[i]; } - complex& operator[] (int i) { return val[i]; } - const complex& operator[] (int i) const { return val[i]; } + std::complex* valptr(int i=0) { return &val[i]; } + const std::complex* cvalptr(int i=0) const { return &val[i]; } + std::complex& operator[] (int i) { return val[i]; } + const std::complex& operator[] (int i) const { return val[i]; } const Context& context(void) const { return ctxt_; } int ictxt(void) const { return ictxt_; } int lld(void) const { return lld_; } @@ -298,9 +298,9 @@ class ComplexMatrix int size(void) const { return size_; } // size of local array int localsize(void) const { return mloc_*nloc_; } // local size of val double memsize(void) const - { return (double) m_ * (double) n_ * sizeof(complex); } + { return (double) m_ * (double) n_ * sizeof(std::complex); } double localmemsize(void) const - { return (double) mloc_ * (double) nloc_ * sizeof(complex); } + { return (double) mloc_ * (double) nloc_ * sizeof(std::complex); } const int* desc(void) const { return &desc_[0]; } // local block size of block (l,m) @@ -357,11 +357,11 @@ class ComplexMatrix init_size(m,n,mb,nb); if ( size_ == old_size ) return; delete[] val; - val = new complex[size_]; + val = new std::complex[size_]; clear(); } - void print(ostream& os) const; + void print(std::ostream& os) const; explicit ComplexMatrix(const Context& ctxt) : ctxt_(ctxt), m_(0), n_(0), mb_(0), nb_(0), size_(0), reference_(false), val(0) {} @@ -380,8 +380,8 @@ class ComplexMatrix reference_(false) { init_size(rhs.m(),rhs.n(),rhs.mb(),rhs.nb()); - val = new complex[size_]; - memcpy(val, rhs.val, size_*sizeof(complex)); + val = new std::complex[size_]; + memcpy(val, rhs.val, size_*sizeof(std::complex)); } // reference constructor: create a proxy for a DoubleMatrix rhs @@ -399,40 +399,40 @@ class ComplexMatrix ComplexMatrix& operator-=(const ComplexMatrix& a); ComplexMatrix& operator*=(double a); - ComplexMatrix& operator*=(complex a); + ComplexMatrix& operator*=(std::complex a); - void matgather(complex *a, int lda) const; + void matgather(std::complex *a, int lda) const; - void initdiag(const complex* const a); // initialize diagonal - void init(const complex* const a, int lda); - void set(char uplo, complex x); + void initdiag(const std::complex* const a); // initialize diagonal + void init(const std::complex* const a, int lda); + void set(char uplo, std::complex x); void identity(void); void clear(void); - complex dot(const ComplexMatrix &a) const; // tr A^H * A - complex dotu(const ComplexMatrix &a) const; // tr A^T * A - void axpy(complex alpha, const ComplexMatrix &a); + std::complex dot(const ComplexMatrix &a) const; // tr A^H * A + std::complex dotu(const ComplexMatrix &a) const; // tr A^T * A + void axpy(std::complex alpha, const ComplexMatrix &a); void axpy(double alpha, const ComplexMatrix &a); - void scal(complex alpha); + void scal(std::complex alpha); void scal(double alpha); double nrm2(void) const; double asum(void) const; double amax(void) const; - complex trace(void) const; + std::complex trace(void) const; void symmetrize(char uplo); // rank-1 update: *this += alpha * x(kx) * (y(ky))^T // where x(kx) is row kx of x, and y(ky) is row ky of y - void ger(complex alpha, const ComplexMatrix& x,int kx, + void ger(std::complex alpha, const ComplexMatrix& x,int kx, const ComplexMatrix& y,int ky); - void geru(complex alpha, const ComplexMatrix& x,int kx, + void geru(std::complex alpha, const ComplexMatrix& x,int kx, const ComplexMatrix& y,int ky); - void gerc(complex alpha, const ComplexMatrix& x,int kx, + void gerc(std::complex alpha, const ComplexMatrix& x,int kx, const ComplexMatrix& y,int ky); // symmetric rank-1 update - void her(char uplo, complex alpha, + void her(char uplo, std::complex alpha, const ComplexMatrix& x, int ix, char rowcol); // get submatrix A(ia:ia+m,ja:ja+n) of A @@ -441,38 +441,38 @@ class ComplexMatrix // matrix * matrix // this = alpha*op(A)*op(B)+beta*this void gemm(char transa, char transb, - complex alpha, const ComplexMatrix& a, - const ComplexMatrix& b, complex beta); + std::complex alpha, const ComplexMatrix& a, + const ComplexMatrix& b, std::complex beta); // hermitian_matrix * matrix // *this = alpha * A * B + beta * this void hemm(char side, char uplo, - complex alpha, const ComplexMatrix& a, - const ComplexMatrix& b, complex beta); + std::complex alpha, const ComplexMatrix& a, + const ComplexMatrix& b, std::complex beta); // complex_symmetric_matrix * matrix // *this = alpha * A * B + beta * this void symm(char side, char uplo, - complex alpha, const ComplexMatrix& a, - const ComplexMatrix& b, complex beta); + std::complex alpha, const ComplexMatrix& a, + const ComplexMatrix& b, std::complex beta); // hermitian rank k update // this = beta * this + alpha * A * A^T (trans=='n') // this = beta * this + alpha * A^T * A (trans=='t') void herk(char uplo, char trans, - complex alpha, const ComplexMatrix& a, - complex beta); + std::complex alpha, const ComplexMatrix& a, + std::complex beta); // matrix transpose // this = alpha * transpose(A) + beta * this - void transpose(complex alpha, const ComplexMatrix& a, - complex beta); + void transpose(std::complex alpha, const ComplexMatrix& a, + std::complex beta); void transpose(const ComplexMatrix& a); void trmm(char side, char uplo, char trans, char diag, - complex alpha, const ComplexMatrix& a); + std::complex alpha, const ComplexMatrix& a); void trsm(char side, char uplo, char trans, char diag, - complex alpha, const ComplexMatrix& a); + std::complex alpha, const ComplexMatrix& a); void trtrs(char uplo, char trans, char diag, ComplexMatrix& b) const; // Cholesky decomposition of a hermitian matrix @@ -486,9 +486,9 @@ class ComplexMatrix double pocon(char) const; // compute eigenvalues and eigenvectors of hermitian matrix *this - void heev(char uplo, valarray& w, ComplexMatrix& z); + void heev(char uplo, std::valarray& w, ComplexMatrix& z); // compute eigenvalues (only) of hermitian matrix *this - void heev(char uplo, valarray& w); + void heev(char uplo, std::valarray& w); }; -ostream& operator << ( ostream& os, const ComplexMatrix& a ); +std::ostream& operator << ( std::ostream& os, const ComplexMatrix& a ); #endif diff --git a/src/NameOf.h b/src/NameOf.h index d8ca02f..76236f8 100644 --- a/src/NameOf.h +++ b/src/NameOf.h @@ -3,13 +3,12 @@ // NameOf.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: NameOf.h,v 1.1.1.1 2002-09-27 00:08:39 fgygi Exp $ +// $Id: NameOf.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef NAMEOF_H #define NAMEOF_H #include -using namespace std; // predicate class for searching T* containers by name // T must be a pointer type to something that has a name() member @@ -17,9 +16,9 @@ template class NameOf { public: - string name; + std::string name; - NameOf(string s) : name(s) {}; + NameOf(std::string s) : name(s) {}; bool operator() (T t) const { return t->name() == name; diff --git a/src/NonLocalPotential.h b/src/NonLocalPotential.h index ff450a5..aa23ca4 100644 --- a/src/NonLocalPotential.h +++ b/src/NonLocalPotential.h @@ -3,7 +3,7 @@ // NonLocalPotential.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: NonLocalPotential.h,v 1.5 2005-01-04 22:05:24 fgygi Exp $ +// $Id: NonLocalPotential.h,v 1.6 2007-03-17 01:14:00 fgygi Exp $ #ifndef NONLOCALPOTENTIAL_H #define NONLOCALPOTENTIAL_H @@ -26,25 +26,21 @@ class NonLocalPotential int nsp; // number of species int nspnl; // number of non-local species - vector lmax; // lmax[is] - vector lloc; // lloc[is] - vector na; // na[is] - //vector naloc; // naloc[is] - //vector nalocmax; // nalocmax[is] - vector npr; // npr[is] - vector nprna; // nprna[is] - vector > lproj; // lproj[is][ipr] - vector > wt; // wt[is][ipr] - vector > twnl; // twnl[is][npr*ngwl] - vector > dtwnl; // dtwnl[is][6*npr*ngwl], ij=0,..,5 + std::vector lmax; // lmax[is] + std::vector lloc; // lloc[is] + std::vector na; // na[is] + std::vector npr; // npr[is] + std::vector nprna; // nprna[is] + std::vector > lproj; // lproj[is][ipr] + std::vector > wt; // wt[is][ipr] + std::vector > twnl; // twnl[is][npr*ngwl] + std::vector > dtwnl; // dtwnl[is][6*npr*ngwl],ij=0,..,5 - //vector anl; // anl[is][ipr*ia][ig] - //vector > singr; // singr[is][naloc*2*ngwloc] - //vector > cosgr; // cosgr[is][naloc*2*ngwloc] - - vector nquad; // nquad[is] - vector > rquad; // rquad[is][iquad], iquad = 0, nquad[is]-1 - vector > wquad; // wquad[is][iquad], iquad = 0, nquad[is]-1 + std::vector nquad; // nquad[is] + // rquad[is][iquad], iquad = 0, nquad[is]-1 + std::vector > rquad; + // wquad[is][iquad], iquad = 0, nquad[is]-1 + std::vector > wquad; mutable TimerMap tmap; void init(void); @@ -56,10 +52,8 @@ class NonLocalPotential ~NonLocalPotential(void); void update_twnl(void); - //void update_eigr(vector >& tau); - //void update_anl(void); double energy(bool compute_hpsi, SlaterDet& dsd, - bool compute_forces, vector >& fion, - bool compute_stress, valarray& sigma_enl); + bool compute_forces, std::vector >& fion, + bool compute_stress, std::valarray& sigma_enl); }; #endif diff --git a/src/PBEFunctional.h b/src/PBEFunctional.h index 4a871de..d2bfc99 100644 --- a/src/PBEFunctional.h +++ b/src/PBEFunctional.h @@ -3,23 +3,22 @@ // PBEFunctional.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: PBEFunctional.h,v 1.2 2004-09-14 22:24:11 fgygi Exp $ +// $Id: PBEFunctional.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef PBEFUNCTIONAL_H #define PBEFUNCTIONAL_H #include "XCFunctional.h" #include -using namespace std; class PBEFunctional : public XCFunctional { PBEFunctional(); - vector _exc, _exc_up, _exc_dn; - vector _vxc1, _vxc1_up, _vxc1_dn, + std::vector _exc, _exc_up, _exc_dn; + std::vector _vxc1, _vxc1_up, _vxc1_dn, _vxc2, _vxc2_upup, _vxc2_updn, _vxc2_dnup, _vxc2_dndn; - vector _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3]; + std::vector _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3]; void gcor2(double a, double a1, double b1, double b2, double b3, @@ -36,10 +35,10 @@ class PBEFunctional : public XCFunctional public: - PBEFunctional(const vector > &rhoe); + PBEFunctional(const std::vector > &rhoe); bool isGGA() { return true; }; - string name() { return "PBE"; }; + std::string name() { return "PBE"; }; void setxc(void); }; #endif diff --git a/src/Preconditioner.C b/src/Preconditioner.C index f71de9e..fa280ed 100644 --- a/src/Preconditioner.C +++ b/src/Preconditioner.C @@ -3,7 +3,7 @@ // Preconditioner.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: Preconditioner.C,v 1.3 2004-04-20 22:14:14 fgygi Exp $ +// $Id: Preconditioner.C,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #include "Preconditioner.h" #include "EnergyFunctional.h" @@ -11,6 +11,7 @@ #include "Basis.h" #include "SlaterDet.h" #include "ConfinementPotential.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// Preconditioner::Preconditioner(const Sample& s, const EnergyFunctional& ef) : diff --git a/src/Preconditioner.h b/src/Preconditioner.h index 6b2c785..9417c3f 100644 --- a/src/Preconditioner.h +++ b/src/Preconditioner.h @@ -3,7 +3,7 @@ // Preconditioner.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Preconditioner.h,v 1.1 2004-03-11 21:58:10 fgygi Exp $ +// $Id: Preconditioner.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef PRECONDITIONER_H #define PRECONDITIONER_H @@ -13,7 +13,6 @@ class EnergyFunctional; #include #include -using namespace std; class Preconditioner { @@ -21,13 +20,13 @@ class Preconditioner const Sample& s_; const EnergyFunctional& ef_; - vector > > diag_; // diag_[ispin][ikp][ig] + std::vector > > diag_; // diag_[ispin][ikp][ig] public: void update(void); - const valarray& diag(int ispin, int ikp) const + const std::valarray& diag(int ispin, int ikp) const { return diag_[ispin][ikp]; } Preconditioner(const Sample& s, const EnergyFunctional& ef); diff --git a/src/RunCmd.h b/src/RunCmd.h index 759ff1a..1c1bca2 100644 --- a/src/RunCmd.h +++ b/src/RunCmd.h @@ -3,15 +3,15 @@ // RunCmd.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: RunCmd.h,v 1.2 2004-03-11 21:52:31 fgygi Exp $ +// $Id: RunCmd.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef RUNCMD_H #define RUNCMD_H #include #include "UserInterface.h" -#include "Sample.h" +class Sample; class RunCmd : public Cmd { private: diff --git a/src/SDAIonicStepper.h b/src/SDAIonicStepper.h index c37af0b..11a7fb6 100644 --- a/src/SDAIonicStepper.h +++ b/src/SDAIonicStepper.h @@ -3,7 +3,7 @@ // SDAIonicStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SDAIonicStepper.h,v 1.5 2005-09-16 23:02:49 fgygi Exp $ +// $Id: SDAIonicStepper.h,v 1.6 2007-03-17 01:14:00 fgygi Exp $ #ifndef SDAIONICSTEPPER_H #define SDAIONICSTEPPER_H @@ -15,8 +15,8 @@ class SDAIonicStepper : public IonicStepper { private: - vector f_; - vector fbar_; + std::vector f_; + std::vector fbar_; double theta_; bool first_step_; AndersonMixer mixer_; @@ -33,8 +33,8 @@ class SDAIonicStepper : public IonicStepper //mixer_.set_theta_nc(-0.5); // default: 0.0 } - void compute_r(double e0, const vector >& f0); - void compute_v(double e0, const vector >& f0) {} + void compute_r(double e0, const std::vector >& f0); + void compute_v(double e0, const std::vector >& f0) {} void reset(void) { first_step_ = true; } }; diff --git a/src/SDCellStepper.C b/src/SDCellStepper.C index 4af63e4..01ee845 100644 --- a/src/SDCellStepper.C +++ b/src/SDCellStepper.C @@ -3,9 +3,10 @@ // SDCellStepper.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: SDCellStepper.C,v 1.3 2004-05-04 21:24:11 fgygi Exp $ +// $Id: SDCellStepper.C,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #include "SDCellStepper.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// void SDCellStepper::compute_new_cell(const valarray& sigma) diff --git a/src/SDCellStepper.h b/src/SDCellStepper.h index f2f2fad..e51c117 100644 --- a/src/SDCellStepper.h +++ b/src/SDCellStepper.h @@ -3,7 +3,7 @@ // SDCellStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SDCellStepper.h,v 1.1 2004-03-11 21:58:10 fgygi Exp $ +// $Id: SDCellStepper.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef SDCELLSTEPPER_H #define SDCELLSTEPPER_H @@ -18,7 +18,7 @@ class SDCellStepper : public CellStepper SDCellStepper(Sample& s) : CellStepper(s) {} - void compute_new_cell(const valarray& sigma_eks); + void compute_new_cell(const std::valarray& sigma_eks); void update_cell(void); double ekin(void) const { return 0.0; } }; diff --git a/src/SDIonicStepper.C b/src/SDIonicStepper.C index fa457ce..aecf8b4 100644 --- a/src/SDIonicStepper.C +++ b/src/SDIonicStepper.C @@ -3,9 +3,10 @@ // SDIonicStepper.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: SDIonicStepper.C,v 1.3 2005-06-27 22:20:41 fgygi Exp $ +// $Id: SDIonicStepper.C,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #include "SDIonicStepper.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// void SDIonicStepper::compute_r(double e0, const vector >& f0) diff --git a/src/SDIonicStepper.h b/src/SDIonicStepper.h index 58ae233..52c5a82 100644 --- a/src/SDIonicStepper.h +++ b/src/SDIonicStepper.h @@ -3,12 +3,13 @@ // SDIonicStepper.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SDIonicStepper.h,v 1.4 2005-06-27 22:20:10 fgygi Exp $ +// $Id: SDIonicStepper.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef SDIONICSTEPPER_H #define SDIONICSTEPPER_H #include "IonicStepper.h" +#include class SDIonicStepper : public IonicStepper { @@ -18,8 +19,8 @@ class SDIonicStepper : public IonicStepper SDIonicStepper(Sample& s) : IonicStepper(s) {} - void compute_r(double e0, const vector >& f0); - void compute_v(double e0, const vector >& f0) {} + void compute_r(double e0, const std::vector >& f0); + void compute_v(double e0, const std::vector >& f0) {} }; #endif diff --git a/src/SampleHandler.h b/src/SampleHandler.h index b2e5880..780e344 100644 --- a/src/SampleHandler.h +++ b/src/SampleHandler.h @@ -3,12 +3,13 @@ // SampleHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleHandler.h,v 1.4 2003-09-23 19:03:21 fgygi Exp $ +// $Id: SampleHandler.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef SAMPLEHANDLER_H #define SAMPLEHANDLER_H #include "StructureHandler.h" +#include class DoubleMatrix; class Sample; class Wavefunction; @@ -31,7 +32,7 @@ class SampleHandler : public StructureHandler // End of the root element in the structure being handled virtual void endElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, string& content); + const XMLCh* const qname, std::string& content); // start a subhandler virtual StructureHandler* startSubHandler(const XMLCh* const uri, diff --git a/src/SampleReader.C b/src/SampleReader.C index fa571df..39558c2 100644 --- a/src/SampleReader.C +++ b/src/SampleReader.C @@ -3,7 +3,7 @@ // SampleReader.C: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleReader.C,v 1.16 2005-06-27 22:19:12 fgygi Exp $ +// $Id: SampleReader.C,v 1.17 2007-03-17 01:14:00 fgygi Exp $ #include "Sample.h" @@ -22,7 +22,6 @@ #include #include #include -using namespace std; #if USE_XERCES #include "SampleHandler.h" @@ -36,6 +35,7 @@ using namespace std; #include using namespace xercesc; #endif +using namespace std; //////////////////////////////////////////////////////////////////////////////// SampleReader::SampleReader(const Context& ctxt) : ctxt_(ctxt) {} diff --git a/src/SampleReader.h b/src/SampleReader.h index 3e3ba9f..c202b9e 100644 --- a/src/SampleReader.h +++ b/src/SampleReader.h @@ -3,12 +3,12 @@ // SampleReader.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleReader.h,v 1.2 2003-08-22 18:01:13 fgygi Exp $ +// $Id: SampleReader.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef SAMPLEREADER_H #define SAMPLEREADER_H -#include "Context.h" +class Context; class SampleReader { @@ -19,14 +19,14 @@ class SampleReader public: SampleReader(const Context& ctxt); - void readSample(Sample& s, const string uri, bool serial); + void readSample(Sample& s, const std::string uri, bool serial); }; class SampleReaderException { public: - string msg; - SampleReaderException(string s) : msg(s) {} + std::string msg; + SampleReaderException(std::string s) : msg(s) {} }; #endif diff --git a/src/SampleStepper.C b/src/SampleStepper.C index 069290f..13fd3ff 100644 --- a/src/SampleStepper.C +++ b/src/SampleStepper.C @@ -3,9 +3,10 @@ // SampleStepper.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleStepper.C,v 1.20 2005-09-16 23:08:11 fgygi Exp $ +// $Id: SampleStepper.C,v 1.21 2007-03-17 01:14:00 fgygi Exp $ #include "SampleStepper.h" +#include "Sample.h" #include "Species.h" #include diff --git a/src/SampleStepper.h b/src/SampleStepper.h index 5835ea0..eca3324 100644 --- a/src/SampleStepper.h +++ b/src/SampleStepper.h @@ -3,19 +3,19 @@ // SampleStepper.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleStepper.h,v 1.9 2005-09-16 23:08:11 fgygi Exp $ +// $Id: SampleStepper.h,v 1.10 2007-03-17 01:14:00 fgygi Exp $ #ifndef SAMPLESTEPPER_H #define SAMPLESTEPPER_H -#include "Sample.h" #include "Timer.h" #include #include +#include #include -using namespace std; -typedef map TimerMap; +class Sample; +typedef std::map TimerMap; class SampleStepper { @@ -23,8 +23,8 @@ class SampleStepper Sample& s_; - vector > fion; - valarray sigma_eks, sigma_kin, sigma_ext, sigma; + std::vector > fion; + std::valarray sigma_eks, sigma_kin, sigma_ext, sigma; // Do not allow construction of SampleStepper unrelated to a Sample SampleStepper(void); diff --git a/src/SampleWriter.h b/src/SampleWriter.h index e7e1b71..c238a6f 100644 --- a/src/SampleWriter.h +++ b/src/SampleWriter.h @@ -3,7 +3,7 @@ // SampleWriter.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SampleWriter.h,v 1.1 2007-01-27 23:43:55 fgygi Exp $ +// $Id: SampleWriter.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef SAMPLEWRITER_H #define SAMPLEWRITER_H @@ -20,16 +20,16 @@ class SampleWriter public: SampleWriter(const Context& ctxt); - void writeSample(const Sample& s, const string filename, - string description, + void writeSample(const Sample& s, const std::string filename, + std::string description, bool base64, bool atomsonly); }; class SampleWriterException { public: - string msg; - SampleWriterException(string s) : msg(s) {} + std::string msg; + SampleWriterException(std::string s) : msg(s) {} }; #endif diff --git a/src/SlaterDet.h b/src/SlaterDet.h index 79bc103..6e75e52 100644 --- a/src/SlaterDet.h +++ b/src/SlaterDet.h @@ -3,7 +3,7 @@ // SlaterDet.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SlaterDet.h,v 1.18 2004-11-10 22:42:23 fgygi Exp $ +// $Id: SlaterDet.h,v 1.19 2007-03-17 01:14:00 fgygi Exp $ #ifndef SLATERDET_H #define SLATERDET_H @@ -22,9 +22,8 @@ class FourierTransform; #if USE_CSTDIO_LFS #include #endif -using namespace std; -typedef map TimerMap; +typedef std::map TimerMap; class SlaterDet { @@ -34,8 +33,8 @@ class SlaterDet Context* my_col_ctxt_; Basis* basis_; ComplexMatrix c_; - vector occ_; - vector eig_; + std::vector occ_; + std::vector eig_; void byteswap_double(size_t n, double* x); double fermi(double e, double mu, double fermitemp); @@ -52,8 +51,8 @@ class SlaterDet const D3vector kpoint(void) const { return basis_->kpoint(); } const ComplexMatrix& c(void) const { return c_; } ComplexMatrix& c(void) { return c_; } - const vector& occ(void) const { return occ_; } - const vector& eig(void) const { return eig_; } + const std::vector& occ(void) const { return occ_; } + const std::vector& eig(void) const { return eig_; } int nst(void) const { return c_.n(); } int nstloc(void) const { return c_.nloc(); } void resize(const UnitCell& cell, const UnitCell& refcell, @@ -78,11 +77,11 @@ class SlaterDet double occ(int i) const { return occ_[i]; }; const double* occ_ptr(void) const { return &occ_[0]; } const double* occ_ptr(int i) const { return &occ_[i]; } - void set_occ(vector& occ) + void set_occ(std::vector& occ) { assert(occ_.size()==occ.size()); occ_ = occ; } - void set_eig(vector& eig) + void set_eig(std::vector& eig) { assert(eig_.size()==eig.size()); eig_ = eig; } - void set_eig(valarray& eig) + void set_eig(std::valarray& eig) { assert(eig_.size()==eig.size()); for ( int i = 0; i < eig.size(); i++ ) eig_[i] = eig[i]; @@ -92,18 +91,18 @@ class SlaterDet double memsize(void) const; double localmemsize(void) const; SlaterDet& operator=(SlaterDet& rhs); - void print(ostream& os, string encoding); + void print(std::ostream& os, std::string encoding); #if USE_CSTDIO_LFS - void write(FILE* outfile, string encoding); + void write(FILE* outfile, std::string encoding); #endif - void info(ostream& os); + void info(std::ostream& os); }; -ostream& operator << ( ostream& os, SlaterDet& sd ); +std::ostream& operator << ( std::ostream& os, SlaterDet& sd ); class SlaterDetException { public: - string msg; - SlaterDetException(string s) : msg(s) {} + std::string msg; + SlaterDetException(std::string s) : msg(s) {} }; #endif diff --git a/src/Species.h b/src/Species.h index 26fa84f..04233ec 100644 --- a/src/Species.h +++ b/src/Species.h @@ -3,7 +3,7 @@ // Species.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: Species.h,v 1.4 2003-05-16 16:14:00 fgygi Exp $ +// $Id: Species.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef SPECIES_H #define SPECIES_H @@ -12,7 +12,6 @@ #include #include #include -using namespace std; #include "Context.h" class Species @@ -23,40 +22,40 @@ class Species int nlm_; // number of non-local projectors: int ndft_; - vector > vps_spl_, phi_spl_; - vector gspl_, vlocg_, vlocg_spl; - vector > vnlg_, vnlg_spl; - vector wsg_; // wsg_[l] Kleinman-Bylander weight 1/ + std::vector > vps_spl_, phi_spl_; + std::vector gspl_, vlocg_, vlocg_spl; + std::vector > vnlg_, vnlg_spl; + std::vector wsg_; // wsg_[l] Kleinman-Bylander weight 1/ - vector rps_; // radial linear mesh (same for all l) + std::vector rps_; // radial linear mesh (same for all l) - string name_; // name used to refer to species in current application - string uri_; // uri of the resource defining the pseudopotential + std::string name_; // name used to refer to species in current application + std::string uri_; // uri of the resource defining the pseudopotential - string symbol_; + std::string symbol_; int atomic_number_; double mass_; // mass in a.m.u (Carbon = 12.0) - string description_; // description of the pseudopotential + std::string description_; // description of the pseudopotential int zval_; // valence charge int lmax_; // largest angular momentum int llocal_; // angular momentum taken as local int nquad_; // number of semi-local quadrature points double rquad_; // end of semi-local quadrature interval double deltar_; // mesh spacing for potentials and wavefunctions - vector > vps_; // potentials for each l - vector > phi_; // atomic wavefunctions for each l + std::vector > vps_; // potentials for each l + std::vector > phi_; // atomic wavefunctions for each l double rcps_; // cutoff radius of gaussian pseudocharge public: - Species(const Context& ctxt, string name); + Species(const Context& ctxt, std::string name); const Context& context(void) const { return ctxt_; } - const string& name(void) const { return name_; } - const string& symbol(void) const { return symbol_; } - const string& description(void) const { return description_; } - const string& uri(void) const { return uri_; } + const std::string& name(void) const { return name_; } + const std::string& symbol(void) const { return symbol_; } + const std::string& description(void) const { return description_; } + const std::string& uri(void) const { return uri_; } int atomic_number(void) const { return atomic_number_; } int zval(void) const { return zval_; } double mass(void) const { return mass_; } @@ -84,21 +83,21 @@ class Species double wsg(int l) { return wsg_[l]; }; double rcut_loc(double epsilon); // radius beyond which potential is local - const vector >& vps(void) const { return vps_; } - const vector >& phi(void) const { return phi_; } + const std::vector >& vps(void) const { return vps_; } + const std::vector >& phi(void) const { return phi_; } bool initialize(double rcps); - void info(ostream& os); + void info(std::ostream& os); friend class SpeciesReader; friend class SpeciesHandler; }; -ostream& operator << ( ostream &os, Species &a ); +std::ostream& operator << ( std::ostream &os, Species &a ); class SpeciesInitException { public: - string msg; - SpeciesInitException(string s) : msg(s) {} + std::string msg; + SpeciesInitException(std::string s) : msg(s) {} }; #endif diff --git a/src/SpeciesHandler.h b/src/SpeciesHandler.h index 0ff77e6..d8962a9 100644 --- a/src/SpeciesHandler.h +++ b/src/SpeciesHandler.h @@ -3,7 +3,7 @@ // SpeciesHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: SpeciesHandler.h,v 1.1 2003-05-16 16:14:00 fgygi Exp $ +// $Id: SpeciesHandler.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef SPECIESHANDLER_H #define SPECIESHANDLER_H @@ -18,7 +18,7 @@ class SpeciesHandler : public StructureHandler Species& sp_; int current_l, current_size; - string current_name, current_href; + std::string current_name, current_href; double current_interval; public: @@ -29,7 +29,7 @@ class SpeciesHandler : public StructureHandler // End of an element handled by SpeciesHandler virtual void endElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, string& content); + const XMLCh* const qname, std::string& content); // start a subHandler if possible virtual StructureHandler* startSubHandler(const XMLCh* const uri, diff --git a/src/SpeciesReader.C b/src/SpeciesReader.C index 3410928..7ac9b74 100644 --- a/src/SpeciesReader.C +++ b/src/SpeciesReader.C @@ -3,7 +3,7 @@ // SpeciesReader.C: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SpeciesReader.C,v 1.5 2004-10-04 18:36:10 fgygi Exp $ +// $Id: SpeciesReader.C,v 1.6 2007-03-17 01:14:00 fgygi Exp $ #include "Species.h" #include "SpeciesReader.h" @@ -11,7 +11,6 @@ #include #include #include -using namespace std; #if USE_XERCES #include "StructuredDocumentHandler.h" @@ -27,6 +26,7 @@ using namespace xercesc; #include #include #endif +using namespace std; //////////////////////////////////////////////////////////////////////////////// SpeciesReader::SpeciesReader(const Context& ctxt) : ctxt_(ctxt) {} diff --git a/src/SpeciesReader.h b/src/SpeciesReader.h index 7e04cfb..c07c0a2 100644 --- a/src/SpeciesReader.h +++ b/src/SpeciesReader.h @@ -3,13 +3,12 @@ // SpeciesReader.h: // //////////////////////////////////////////////////////////////////////////////// -// $Id: SpeciesReader.h,v 1.3 2003-05-23 21:51:04 fgygi Exp $ +// $Id: SpeciesReader.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef SPECIESREADER_H #define SPECIESREADER_H #include -using namespace std; #include "Context.h" class SpeciesReader @@ -18,12 +17,12 @@ class SpeciesReader const Context& ctxt_; - string uri_; // uri from which Species is read + std::string uri_; // uri from which Species is read public: SpeciesReader(const Context& ctxt); - void readSpecies(Species& sp, const string uri); + void readSpecies(Species& sp, const std::string uri); void bcastSpecies(Species& sp); }; diff --git a/src/StrX.h b/src/StrX.h index e9e0b07..f8ca8f0 100644 --- a/src/StrX.h +++ b/src/StrX.h @@ -3,7 +3,7 @@ // StrX.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: StrX.h,v 1.2 2003-05-16 16:14:00 fgygi Exp $ +// $Id: StrX.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef STRX_H #define STRX_H @@ -11,7 +11,6 @@ #include #include #include -using namespace std; #include using namespace xercesc; @@ -50,7 +49,7 @@ private : char* fLocalForm; }; -inline ostream& operator<<(ostream& target, const StrX& toDump) +inline std::ostream& operator<<(std::ostream& target, const StrX& toDump) { target << toDump.localForm(); return target; diff --git a/src/StructureFactor.C b/src/StructureFactor.C index 5fa6758..60c033e 100644 --- a/src/StructureFactor.C +++ b/src/StructureFactor.C @@ -3,12 +3,13 @@ // StructureFactor.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: StructureFactor.C,v 1.2 2002-11-08 17:03:23 fgygi Exp $ +// $Id: StructureFactor.C,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #include "StructureFactor.h" #include "Basis.h" #include "UnitCell.h" #include +using namespace std; //////////////////////////////////////////////////////////////////////////////// void StructureFactor::init(const vector >& tau, diff --git a/src/StructureFactor.h b/src/StructureFactor.h index 8d6f690..791ba26 100644 --- a/src/StructureFactor.h +++ b/src/StructureFactor.h @@ -3,7 +3,7 @@ // StructureFactor.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: StructureFactor.h,v 1.1 2002-10-31 00:51:50 fgygi Exp $ +// $Id: StructureFactor.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef STRUCTUREFACTOR_H #define STRUCTUREFACTOR_H @@ -11,7 +11,6 @@ #include #include #include -using namespace std; class Basis; @@ -20,7 +19,7 @@ class StructureFactor private: int _nsp, _ng; - vector _na; + std::vector _na; int _k0max, _k1max, _k2max, _k0min, _k1min, _k2min, @@ -54,16 +53,16 @@ class StructureFactor // ky in [k1min, k1max] // kz in [k2min, k2max] - vector > cos0; // cos0[is][ia*k0range-k0min+kx] - vector > cos1; // cos1[is][ia*k1range-k1min+ky] - vector > cos2; // cos2[is][ia*k2range-k2min+ky] - vector > sin0; // sin0[is][ia*k0range-k0min+kx] - vector > sin1; // sin1[is][ia*k1range-k1min+ky] - vector > sin2; // sin2[is][ia*k2range-k2min+ky] - vector > > sfac; // sfac[is][ig] + std::vector > cos0; // cos0[is][ia*k0range-k0min+kx] + std::vector > cos1; // cos1[is][ia*k1range-k1min+ky] + std::vector > cos2; // cos2[is][ia*k2range-k2min+ky] + std::vector > sin0; // sin0[is][ia*k0range-k0min+kx] + std::vector > sin1; // sin1[is][ia*k1range-k1min+ky] + std::vector > sin2; // sin2[is][ia*k2range-k2min+ky] + std::vector > > sfac; // sfac[is][ig] - void init(const vector >& tau, const Basis& basis); - void update(const vector >& tau, const Basis& basis); + void init(const std::vector >& tau, const Basis& basis); + void update(const std::vector >& tau, const Basis& basis); }; #endif diff --git a/src/StructureHandler.h b/src/StructureHandler.h index 63a4775..7787e67 100644 --- a/src/StructureHandler.h +++ b/src/StructureHandler.h @@ -3,17 +3,15 @@ // StructureHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: StructureHandler.h,v 1.1 2003-05-16 16:14:00 fgygi Exp $ +// $Id: StructureHandler.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef STRUCTUREHANDLER_H #define STRUCTUREHANDLER_H #include #include -using namespace xercesc; - #include -using namespace std; +using namespace xercesc; class StructureHandler { @@ -27,7 +25,7 @@ class StructureHandler // End of an element handled by the StructureHandler virtual void endElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, string& content) = 0; + const XMLCh* const qname, std::string& content) = 0; // start a subhandler virtual StructureHandler* startSubHandler(const XMLCh* const uri, diff --git a/src/StructuredDocumentHandler.C b/src/StructuredDocumentHandler.C index a40b6c1..c882f5c 100644 --- a/src/StructuredDocumentHandler.C +++ b/src/StructuredDocumentHandler.C @@ -3,13 +3,12 @@ // StructuredDocumentHandler.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: StructuredDocumentHandler.C,v 1.4 2004-09-14 22:24:11 fgygi Exp $ +// $Id: StructuredDocumentHandler.C,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #if USE_XERCES #include #include -using namespace xercesc; #include "StructuredDocumentHandler.h" #if TIMING @@ -19,6 +18,7 @@ using namespace xercesc; #include "StrX.h" #include #include +using namespace xercesc; using namespace std; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/StructuredDocumentHandler.h b/src/StructuredDocumentHandler.h index cebd02b..3f79bef 100644 --- a/src/StructuredDocumentHandler.h +++ b/src/StructuredDocumentHandler.h @@ -3,20 +3,18 @@ // StructuredDocumentHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: StructuredDocumentHandler.h,v 1.1 2003-05-16 16:14:00 fgygi Exp $ +// $Id: StructuredDocumentHandler.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #ifndef STRUCTUREDDOCUMENTHANDLER_H #define STRUCTUREDDOCUMENTHANDLER_H #include #include "StrX.h" -using namespace xercesc; #include "StructureHandler.h" #include #include -using namespace std; class StructuredDocumentHandler : public DefaultHandler { @@ -30,11 +28,11 @@ class StructuredDocumentHandler : public DefaultHandler protected: - stack contextStack; + std::stack contextStack; int nestingDepth; int contextDepth; StructureHandler* activeHandler; - string buffer; + std::string buffer; public: diff --git a/src/TorsionConstraint.h b/src/TorsionConstraint.h index 320e1ab..7ff527d 100644 --- a/src/TorsionConstraint.h +++ b/src/TorsionConstraint.h @@ -3,7 +3,7 @@ // TorsionConstraint.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: TorsionConstraint.h,v 1.2 2005-09-16 23:08:11 fgygi Exp $ +// $Id: TorsionConstraint.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ #ifndef TORSIONCONSTRAINT_H #define TORSIONCONSTRAINT_H @@ -15,7 +15,7 @@ class AtomSet; class TorsionConstraint : public Constraint { - string name1_, name2_, name3_, name4_; + std::string name1_, name2_, name3_, name4_; int ia1_, ia2_, ia3_, ia4_, is1_, is2_, is3_, is4_; double m1_, m2_, m3_, m4_, m1_inv_, m2_inv_, m3_inv_, m4_inv_; double angle_, velocity_, force_, weight_, tol_, sin_angle_, cos_angle_; @@ -29,8 +29,8 @@ class TorsionConstraint : public Constraint public: - TorsionConstraint(string name, string name1, string name2, - string name3, string name4, + TorsionConstraint(std::string name, std::string name1, std::string name2, + std::string name3, std::string name4, double angle, double velocity, double tolerance): name1_(name1), name2_(name2), name3_(name3), name4_(name4), velocity_(velocity), @@ -47,7 +47,7 @@ class TorsionConstraint : public Constraint weight_ = 1.0; } - string type(void) const { return "torsion"; } + std::string type(void) const { return "torsion"; } double value(void) const { return angle_; } double velocity(void) const { return velocity_; } double force(void) const { return force_; } @@ -68,13 +68,13 @@ class TorsionConstraint : public Constraint void setup(const AtomSet& atoms); void update(double dt); - bool enforce_r(const vector > &r0, - vector > &rp) const; - bool enforce_v(const vector > &r0, - vector > &v0) const; - void compute_force(const vector > &r0, - const vector > &f); - ostream& print( ostream& os ); + bool enforce_r(const std::vector > &r0, + std::vector > &rp) const; + bool enforce_v(const std::vector > &r0, + std::vector > &v0) const; + void compute_force(const std::vector > &r0, + const std::vector > &f); + std::ostream& print( std::ostream& os ); }; #endif diff --git a/src/UnitCell.h b/src/UnitCell.h index f2ea0dc..e31160e 100644 --- a/src/UnitCell.h +++ b/src/UnitCell.h @@ -3,14 +3,14 @@ // UnitCell.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: UnitCell.h,v 1.4 2004-03-11 21:52:31 fgygi Exp $ +// $Id: UnitCell.h,v 1.5 2007-03-17 01:14:00 fgygi Exp $ #ifndef UNITCELL_H #define UNITCELL_H #include "D3vector.h" #include -using namespace std; +#include class UnitCell { @@ -61,7 +61,8 @@ class UnitCell // where xs[0] = x00, xs[1] = x11, xs[2] = x22, // xs[3] = x10, xs[4] = x21, xs[5] = x20 void smatmult3x3(const double* xs, const double* y, double *z) const; - void compute_deda(const valarray& sigma, valarray& deda) const; + void compute_deda(const std::valarray& sigma, + std::valarray& deda) const; bool in_ws(const D3vector& v) const; void fold_in_ws(D3vector& v) const; @@ -71,9 +72,9 @@ class UnitCell bool encloses(const UnitCell& c) const; bool contains(D3vector v) const; - void print(ostream& os) const; + void print(std::ostream& os) const; bool operator==(const UnitCell& c) const; bool operator!=(const UnitCell& c) const; }; -ostream& operator << ( ostream& os, const UnitCell& cell ); +std::ostream& operator << ( std::ostream& os, const UnitCell& cell ); #endif diff --git a/src/UserInterface.C b/src/UserInterface.C index fa430ba..ad66752 100644 --- a/src/UserInterface.C +++ b/src/UserInterface.C @@ -3,20 +3,20 @@ // UserInterface.C: definition of readCmd and processCmds // //////////////////////////////////////////////////////////////////////////////// -// $Id: UserInterface.C,v 1.3 2004-11-10 22:36:50 fgygi Exp $ +// $Id: UserInterface.C,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #include "UserInterface.h" #include #include #include // isatty #include -using namespace std; #if USE_MPI #include #else typedef int MPI_Comm; #endif +using namespace std; //////////////////////////////////////////////////////////////////////////////// UserInterface::UserInterface(void) : terminate_(false) diff --git a/src/UserInterface.h b/src/UserInterface.h index 4b77527..8d2c379 100644 --- a/src/UserInterface.h +++ b/src/UserInterface.h @@ -13,7 +13,6 @@ #include #include #include -using namespace std; class UserInterface; @@ -32,21 +31,21 @@ class Var UserInterface *ui; virtual char *name ( void ) const = 0; virtual int set ( int argc, char **argv ) = 0; - virtual string print ( void ) const = 0; + virtual std::string print ( void ) const = 0; }; class UserInterface { private: - char *readCmd(char *s, int max, istream &fp, bool echo); + char *readCmd(char *s, int max, std::istream &fp, bool echo); bool terminate_; bool onpe0_; public: - list cmdlist; - list varlist; + std::list cmdlist; + std::list varlist; void addCmd(Cmd *newcmd) { @@ -56,7 +55,7 @@ class UserInterface Cmd *findCmd(char *cmdname) { - list::iterator cmd; + std::list::iterator cmd; for ( cmd = cmdlist.begin(); (cmd != cmdlist.end() && (strcmp((*cmd)->name(),cmdname))); cmd++ ); @@ -79,7 +78,7 @@ class UserInterface Var *findVar(char *varname) { - list::iterator var; + std::list::iterator var; for ( var = varlist.begin(); (var != varlist.end() && (strcmp((*var)->name(),varname))); var++ ); @@ -94,7 +93,7 @@ class UserInterface } }; - void processCmds(istream &cmdstream, char *prompt, bool echo); + void processCmds(std::istream &cmdstream, char *prompt, bool echo); void terminate(void) { terminate_ = true; } diff --git a/src/Wavefunction.h b/src/Wavefunction.h index 4d98ab0..343115f 100644 --- a/src/Wavefunction.h +++ b/src/Wavefunction.h @@ -3,7 +3,7 @@ // Wavefunction.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: Wavefunction.h,v 1.14 2007-01-27 23:53:44 fgygi Exp $ +// $Id: Wavefunction.h,v 1.15 2007-03-17 01:14:00 fgygi Exp $ #ifndef WAVEFUNCTION_H #define WAVEFUNCTION_H @@ -14,7 +14,6 @@ #if USE_CSTDIO_LFS #include #endif -using namespace std; class SlaterDet; class Context; @@ -36,13 +35,13 @@ class Wavefunction UnitCell refcell_ ; // reference cell double ecut_ ; // energy cutoff - vector weight_; // weight[ikp] - vector kpoint_; // kpoint[ikp] + std::vector weight_; // weight[ikp] + std::vector kpoint_; // kpoint[ikp] - vector nst_; // nst_[ispin] - vector spincontext_; // spincontext[ispin] - vector > sdcontext_; // sdcontext_[ispin][ikp] - vector > sd_; // sd[ispin][ikp] + std::vector nst_; // nst_[ispin] + std::vector spincontext_; // spincontext[ispin] + std::vector > sdcontext_; // sdcontext_[ispin][ikp] + std::vector > sd_; // sd[ispin][ikp] void allocate(); // create contexts and allocate SlaterDet's void deallocate(); @@ -101,11 +100,11 @@ class Wavefunction double dot(const Wavefunction& wf) const; - void print(ostream& os, string encoding, string tag) const; + void print(std::ostream& os, std::string encoding, std::string tag) const; #if USE_CSTDIO_LFS - void write(FILE* outfile, string encoding, string tag) const; + void write(FILE* outfile, std::string encoding, std::string tag) const; #endif - void info(ostream& os, string tag) const; + void info(std::ostream& os, std::string tag) const; }; -ostream& operator << ( ostream& os, const Wavefunction& wf ); +std::ostream& operator << ( std::ostream& os, const Wavefunction& wf ); #endif diff --git a/src/WavefunctionHandler.h b/src/WavefunctionHandler.h index 1729146..c58e277 100644 --- a/src/WavefunctionHandler.h +++ b/src/WavefunctionHandler.h @@ -3,7 +3,7 @@ // WavefunctionHandler.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: WavefunctionHandler.h,v 1.7 2004-03-11 21:52:32 fgygi Exp $ +// $Id: WavefunctionHandler.h,v 1.8 2007-03-17 01:14:00 fgygi Exp $ #ifndef WavefunctionHANDLER_H #define WavefunctionHANDLER_H @@ -24,14 +24,14 @@ class WavefunctionHandler : public StructureHandler UnitCell uc; UnitCell ruc; double ecut; - vector dmat; + std::vector dmat; int nx,ny,nz; int current_gf_nx,current_gf_ny,current_gf_nz; - string current_gf_encoding; + std::string current_gf_encoding; int current_ispin,current_ikp,current_n,current_igf; int read_from_gfdata; FourierTransform* ft; - vector > wftmp; + std::vector > wftmp; void byteswap_double(size_t n, double* x); @@ -43,7 +43,7 @@ class WavefunctionHandler : public StructureHandler // End of the root element in the structure being handled virtual void endElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, string& content); + const XMLCh* const qname, std::string& content); // start a subhandler virtual StructureHandler* startSubHandler(const XMLCh* const uri, diff --git a/src/WavefunctionStepper.h b/src/WavefunctionStepper.h index ba06795..f5c520b 100644 --- a/src/WavefunctionStepper.h +++ b/src/WavefunctionStepper.h @@ -3,16 +3,15 @@ // WavefunctionStepper.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: WavefunctionStepper.h,v 1.6 2007-01-27 23:46:31 fgygi Exp $ +// $Id: WavefunctionStepper.h,v 1.7 2007-03-17 01:14:00 fgygi Exp $ #ifndef WAVEFUNCTIONSTEPPER_H #define WAVEFUNCTIONSTEPPER_H #include "Timer.h" #include #include -using namespace std; -typedef map TimerMap; +typedef std::map TimerMap; class Wavefunction; class WavefunctionStepper diff --git a/src/XCFunctional.h b/src/XCFunctional.h index ec14a20..eaa6466 100644 --- a/src/XCFunctional.h +++ b/src/XCFunctional.h @@ -3,7 +3,7 @@ // XCFunctional.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: XCFunctional.h,v 1.2 2004-09-14 22:24:11 fgygi Exp $ +// $Id: XCFunctional.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $ // // Abstract base class for density functionals @@ -43,7 +43,6 @@ #define XCFUNCTIONAL_H #include -using namespace std; class XCFunctional { @@ -60,7 +59,7 @@ class XCFunctional double *vxc2, *vxc2_upup, *vxc2_dndn, *vxc2_updn, *vxc2_dnup; virtual bool isGGA(void) = 0; - virtual string name(void) = 0; + virtual std::string name(void) = 0; int np(void) { return _np; }; int nspin(void) { return _nspin; }; diff --git a/src/XCPotential.h b/src/XCPotential.h index 1e11d51..8eb43fd 100644 --- a/src/XCPotential.h +++ b/src/XCPotential.h @@ -3,7 +3,7 @@ // XCPotential.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: XCPotential.h,v 1.3 2004-09-14 22:24:11 fgygi Exp $ +// $Id: XCPotential.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef XCPOTENTIAL_H #define XCPOTENTIAL_H @@ -12,10 +12,10 @@ #include "LDAFunctional.h" #include "PBEFunctional.h" #include "BLYPFunctional.h" +#include #include #include #include -using namespace std; class Basis; class FourierTransform; @@ -28,9 +28,9 @@ class XCPotential const ChargeDensity& cd_; XCFunctional* xcf_; - vector > vxctmp; // vxctmp[ispin][ir] - vector > tmpr; // tmpr[ir] - vector > tmp1, tmp2; // tmp1[ig], tmp2[ig] + std::vector > vxctmp; // vxctmp[ispin][ir] + std::vector > tmpr; // tmpr[ir] + std::vector > tmp1, tmp2; // tmp1[ig], tmp2[ig] double exc_, dxc_, dxc0_, dxc1_, dxc2_; int nspin_; @@ -43,17 +43,17 @@ class XCPotential public: const XCFunctional* xcf() { return xcf_; } - XCPotential(const ChargeDensity& cd, const string functional_name); + XCPotential(const ChargeDensity& cd, const std::string functional_name); ~XCPotential(); - void update(vector >& vr); - void compute_stress(valarray& sigma_exc); + void update(std::vector >& vr); + void compute_stress(std::valarray& sigma_exc); double exc(void) { return exc_; } }; class XCPotentialException { public: - string msg; - XCPotentialException(string s) : msg(s) {} + std::string msg; + XCPotentialException(std::string s) : msg(s) {} }; #endif diff --git a/src/XMLGFPreprocessor.C b/src/XMLGFPreprocessor.C index e23746f..a0b573e 100644 --- a/src/XMLGFPreprocessor.C +++ b/src/XMLGFPreprocessor.C @@ -3,24 +3,25 @@ // XMLGFPreprocessor.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: XMLGFPreprocessor.C,v 1.8 2006-11-04 20:17:38 fgygi Exp $ +// $Id: XMLGFPreprocessor.C,v 1.9 2007-03-17 01:14:00 fgygi Exp $ #include #include #include #include #include +#include #include #include #include #include -using namespace std; #include "Timer.h" #include "Context.h" #include "Base64Transcoder.h" #include "Matrix.h" #include "XMLGFPreprocessor.h" +using namespace std; //////////////////////////////////////////////////////////////////////////////// // diff --git a/src/XMLGFPreprocessor.h b/src/XMLGFPreprocessor.h index 382d708..bc38716 100644 --- a/src/XMLGFPreprocessor.h +++ b/src/XMLGFPreprocessor.h @@ -3,11 +3,9 @@ // XMLGFPreprocessor.h // //////////////////////////////////////////////////////////////////////////////// -// $Id: XMLGFPreprocessor.h,v 1.1 2003-08-22 18:01:13 fgygi Exp $ +// $Id: XMLGFPreprocessor.h,v 1.2 2007-03-17 01:14:00 fgygi Exp $ #include -using namespace std; - #include "Matrix.h" //////////////////////////////////////////////////////////////////////////////// @@ -29,5 +27,5 @@ class XMLGFPreprocessor public: void process(const char* const filename, - DoubleMatrix& gfdata, string& xmlcontent); + DoubleMatrix& gfdata, std::string& xmlcontent); }; diff --git a/src/blas.h b/src/blas.h index 3acefad..168d59b 100644 --- a/src/blas.h +++ b/src/blas.h @@ -3,13 +3,12 @@ // BLAS Header file // //////////////////////////////////////////////////////////////////////////////// -// $Id: blas.h,v 1.3 2004-08-11 17:56:24 fgygi Exp $ +// $Id: blas.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $ #ifndef BLAS_H #define BLAS_H #include -using namespace std; // default value for most compilers #define FTN_LINK extern "C" @@ -41,8 +40,8 @@ FTN_LINK { void dcopy(int *n, double *x, int *incx, double *y, int *incy ); -void zcopy(int *n, complex *x, int *incx, -complex *y, int *incy ); +void zcopy(int *n, std::complex *x, int *incx, +std::complex *y, int *incy ); void daxpy(int *n, double *alpha, double *x, int *incx, double *y, int *incy ); double ddot(const int *n, const double *a, const int *inca, @@ -65,7 +64,7 @@ int idamax(int *len, double *x, int *incx); void dsyev(char *c1,char *c2,int *n, double *a,int *lda, double *wr, double *wrk,int *lwrk, int *ierr); -void zdscal_(int *n,double *alpha,complex *x,int *incx); +void zdscal_(int *n,double *alpha,std::complex *x,int *incx); void dgbmv(char *trans, int *m, int *n, int *kl, int *ku, double *alpha, double *a, int *lda, double *x, int *incx, double *beta, diff --git a/src/jacobi.h b/src/jacobi.h index 8f0c2b9..b39188e 100644 --- a/src/jacobi.h +++ b/src/jacobi.h @@ -1,2 +1,3 @@ +#include int jacobi(int maxsweep, double tol, DoubleMatrix& a, DoubleMatrix& u, - vector& e); + std::vector& e); diff --git a/src/notes b/src/notes index 1087d03..3444369 100644 --- a/src/notes +++ b/src/notes @@ -23,6 +23,30 @@ Bug in scalapack pdgetri.f (inverse of square matrix) Added bugfix from J.Langou into local modified copy of pdgetri.f Must link to local pdgetri.o before the scalapack lib -------------------------------------------------------------------------------- +rel1_32_0 release candidate +Dt.h, MDIonicStepper.C: modified to allow for negative time step. +Removed Sample.h dependency in WavefunctionStepper and derived classes. +Files affected are +BOSampleStepper.C +SDWavefunctionStepper.C +PSDWavefunctionStepper.C +PSDAWavefunctionStepper.C +EnergyFunctional.C +CPSampleStepper.C +MDWavefunctionStepper.C +WavefunctionStepper.h +SDWavefunctionStepper.h +PSDWavefunctionStepper.h +PSDAWavefunctionStepper.h +MDWavefunctionStepper.h +Removed facs, sigmas from Control.h. Moved vars to ConfinementPotential. +Use hardwired values 2.0 and 0.5 in +BOSampleStepper.C, CPSampleStepper.C +Removed namespace declarations in header files. +-------------------------------------------------------------------------------- +rel1_31_0 +Added class SampleWriter to separate write function from SaveCmd class. +-------------------------------------------------------------------------------- rel1_30_1 Wavefunction.C: typos XMLGFPreprocessor.C: fixed bug in boundary adjustment. diff --git a/src/release.C b/src/release.C index 72d4ecc..615d65e 100644 --- a/src/release.C +++ b/src/release.C @@ -3,10 +3,10 @@ // release.C // //////////////////////////////////////////////////////////////////////////////// -// $Id: release.C,v 1.32 2006-11-04 20:21:37 fgygi Exp $ +// $Id: release.C,v 1.33 2007-03-17 01:14:00 fgygi Exp $ #include "release.h" std::string release(void) { - return std::string("1.30.1"); + return std::string("1.32.0"); } -- libgit2 0.26.0