// ********************************************************************* // // Vector: a C++ class of a vector // // Last updated 25/05/2000 // Abdon Pijpelink, abdon@its.chem.uva.nl // // In the case of overloaded mathematical operators, no size-checks are // performed to gain speed. // // Variables: // cv array of Complex objects // size length of the vector // // ********************************************************************* #include "DVector.h" #include #include #include // ================================================================ DVector::DVector(int sz) { init(0, sz); } // ================================================================ DVector::DVector(const double *array, int sz) { init(array, sz); } // ================================================================ DVector::DVector(const DVector &cV) { init(cV.cv, cV.size); } // ================================================================ void DVector::clear() { for (int f1=0; f1vector C // = Vector A times vector B to generate new vector C where C[i]=A[i]*B[i] DVector DVector::operator % (DVector &vector) { DVector result(3); result[0]=cv[0]*vector[0]; result[1]=cv[1]*vector[1]; result[2]=cv[2]*vector[2]; return result; } //======Multiplication by a double constant DVector DVector::operator * (double dblnum) { DVector result(3); // cout <<"dblnum="<< dblnum<<"\n"; for (int f=0; f