git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1376 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2008-01-17 17:11:02 +00:00
parent 7a1d7a7f87
commit 83ec8fbde0
3 changed files with 36 additions and 53 deletions

View File

@ -169,12 +169,6 @@ TwoD<numtyp> TwoD<numtyp>::normal() {
return TwoD(y,x*numtyp(-1));
}
template<class numtyp>
numtyp TwoD<numtyp>::dist(const TwoD<numtyp> &two) const {
TwoD diff=*this-two;
return numtyp(sqrt(double(diff.dot(diff))));
}
template<class numtyp>
numtyp TwoD<numtyp>::dist2(const TwoD<numtyp> &two) const {
TwoD diff=*this-two;
@ -293,26 +287,6 @@ template<class numtyp>
ThreeD<numtyp>::ThreeD() {
}
template<class numtyp>
numtyp & ThreeD<numtyp>::operator[](unsigned i) {
switch(i) {
case X: return x;
case Y: return y;
case Z: return z;
}
return x;
}
template<class numtyp>
numtyp ThreeD<numtyp>::operator[](unsigned i) const {
switch(i) {
case X: return x;
case Y: return y;
case Z: return z;
}
return x;
}
template<class numtyp>
void ThreeD<numtyp>::operator = (const ThreeD &two) {
#ifdef NANCHECK
@ -396,11 +370,6 @@ numtyp ThreeD<numtyp>::dot(const ThreeD<numtyp> &two) const {
return (x*two.x+y*two.y+z*two.z);
}
template<class numtyp>
void ThreeD<numtyp>::operator *= (const numtyp &two) {
x*=two; y*=two; z*=two;
}
// Move coordinates into array
template<class numtyp>
void ThreeD<numtyp>::to_array(numtyp *array) {
@ -499,27 +468,12 @@ numtyp ThreeD<numtyp>::norm2() const {
return x*x+y*y+z*z;
}
template <class numtyp>
numtyp ThreeD<numtyp>::dist(const ThreeD<numtyp> &two) {
return (*this-two).norm();
}
template <class numtyp>
numtyp ThreeD<numtyp>::dist2(const ThreeD<numtyp> &two) {
ThreeD diff=*this-two;
return diff.dot(diff);
}
// For normalizing a vector
template<class numtyp>
void ThreeD<numtyp>::normalize() {
numtyp temp=norm();
#ifdef NANCHECK
assert(temp!=0);
#endif
*this/=temp;
}
// Return unit vector
template<class numtyp>
ThreeD<numtyp> ThreeD<numtyp>::unit() {