#include <Vector.h>
Inheritance diagram for Vector:

Public Member Functions | |
| Vector (void) | |
| Vector (BigReal newx, BigReal newy, BigReal newz) | |
| Vector (BigReal newv) | |
| Vector (const FloatVector &v) | |
| BigReal & | operator[] (int i) |
| Vector & | operator= (const BigReal &v2) |
| void | operator+= (const Vector &v2) |
| void | operator-= (const Vector &v2) |
| void | operator *= (const BigReal &v2) |
| void | operator/= (const BigReal &v2) |
| BigReal | length (void) const |
| BigReal | length2 (void) const |
| BigReal | rlength (void) |
| Vector | unit (void) const |
| void | cross (const Vector &v2) |
| BigReal | dot (const Vector &v2) |
| Bool | set (const char *s) |
Public Attributes | |
| BigReal | x |
| BigReal | y |
| BigReal | z |
Friends | |
| int | operator== (const Vector &v1, const Vector &v2) |
| int | operator!= (const Vector &v1, const Vector &v2) |
| Vector | operator+ (const Vector &v1, const Vector &v2) |
| Vector | operator- (const Vector &v1) |
| Vector | operator- (const Vector &v1, const Vector &v2) |
| BigReal | operator * (const Vector &v1, const Vector &v2) |
| Vector | operator * (const BigReal &f, const Vector &v1) |
| Vector | operator * (const Vector &v1, const BigReal &f) |
| Vector | operator/ (const Vector &v1, const BigReal &f) |
| Vector | cross (const Vector &v1, const Vector &v2) |
| Vector | cross (const Real &k, const Vector &v1, const Vector &v2) |
| Vector | cross (const BigReal &k, const Vector &v1, const Vector &v2) |
|
|
Definition at line 68 of file Vector.h.
|
|
||||||||||||||||
|
Definition at line 71 of file Vector.h.
|
|
|
Definition at line 74 of file Vector.h.
|
|
|
Definition at line 77 of file Vector.h.
|
|
|
Definition at line 209 of file Vector.h. References BigReal, x, y, and z. 00209 {
00210 BigReal xx = y*v2.z-v2.y*z;
00211 // BigReal yy = -x*v2.z+v2.x*z;
00212 BigReal yy = v2.x*z-x*v2.z;
00213 z = x*v2.y-v2.x*y;
00214 y=yy;
00215 x=xx;
00216 }
|
|
|
Definition at line 219 of file Vector.h. References BigReal, x, y, and z. Referenced by ComputeStir::doForce().
|
|
|
Definition at line 166 of file Vector.h. References BigReal. Referenced by Sequencer::addRotDragToPosition(), ImproperElem::computeForce(), CrosstermElem::computeForce(), BondElem::computeForce(), AngleElem::computeForce(), ComputeStir::doForce(), ComputeNonbondedPair::doForce(), ComputeConsTorque::doForce(), GridforceGrid::initialize(), Sequencer::maximumMove(), Lattice::set(), and vec_rotation_matrix(). 00166 {
00167 return sqrt(x*x+y*y+z*z);
00168 }
|
|
|
Definition at line 170 of file Vector.h. References BigReal. Referenced by BondElem::computeForce(), Controller::correctMomentum(), ComputeRestraints::doForce(), HomePatch::doPairlistCheck(), Sequencer::maximumMove(), Sequencer::submitHalfstep(), Sequencer::submitReductions(), and Lattice::wrap_nearest_delta().
|
|
|
Definition at line 110 of file Vector.h.
|
|
|
Definition at line 96 of file Vector.h.
|
|
|
Definition at line 103 of file Vector.h.
|
|
|
Definition at line 117 of file Vector.h. References BigReal, and namd_reciprocal. 00117 {
00118 BigReal v2_recip = namd_reciprocal(v2);
00119 x *= v2_recip;
00120 y *= v2_recip;
00121 z *= v2_recip;
00122 }
|
|
|
Definition at line 88 of file Vector.h.
|
|
|
Definition at line 79 of file Vector.h. References BigReal, and NAMD_die(). 00079 {
00080 return i==0 ? x
00081 :i==1 ? y
00082 :i==2 ? z
00083 :(NAMD_die("Vector reference out of bounds."), x);
00084
00085 }
|
|
|
Definition at line 174 of file Vector.h. References BigReal, and namd_rsqrt. Referenced by DihedralElem::computeForce(), and AngleElem::computeForce(). 00174 {
00175 return namd_rsqrt (x*x + y*y + z*z);
00176 }
|
|
|
Definition at line 225 of file Vector.h. References Bool. Referenced by ParseOptions::get(). 00225 {
00226 double a[3]; // read into doubles, since I don't know what
00227 char tmp[100]; // a "BigReal" is in real life
00228 // cheap way to get commas, etc. a poor regex
00229 int i=sscanf(s, "%lf%99[ \t,]%lf%99[ \t,]%lf%99s",
00230 a, tmp, a+1, tmp, a+2, tmp);
00231 if (i != 5) return FALSE;
00232 const char *t = s; // now count commas (for "1,,,,2, , 3")
00233 int flg = 0; // and check for "1 2,,3"
00234 i = 0;
00235 for (;*t;t++) {
00236 if (*t == ',') {
00237 if (flg == 0) { // expecting non-whitespace
00238 return FALSE; // so error
00239 }
00240 flg = 0; // now expect non-whitespace
00241 i++; // and increment comma counter
00242 }
00243 else if (*t != ' ' && *t != '\t') { // got non-whitespace
00244 flg = 1; // so the next can be whitespace or commas
00245 }
00246 }
00247 if (i == 0 || i == 2) { // allow "1 2 3" or "1, 2,3" forms
00248 x = a[0]; y = a[1]; z = a[2];
00249 return TRUE;
00250 }
00251 return FALSE;
00252 }
|
|
|
Definition at line 179 of file Vector.h. Referenced by ComputeStir::ComputeStir(), ComputeStir::doForce(), HomePatch::doMarginCheck(), ComputePmeMgr::initialize(), ComputePmeMgr::initialize_pencils(), settle1(), settlev(), and PatchMap::sizeGrid().
|
|
||||||||||||||||
|
Definition at line 201 of file Vector.h. 00201 {
00202 return Vector( k*(v1.y*v2.z-v2.y*v1.z),
00203 // k*(-v1.x*v2.z+v2.x*v1.z),
00204 k*(v2.x*v1.z-v1.x*v2.z),
00205 k*(v1.x*v2.y-v2.x*v1.y) );
00206 }
|
|
||||||||||||||||
|
Definition at line 194 of file Vector.h. 00194 {
00195 return Vector( k*(v1.y*v2.z-v2.y*v1.z),
00196 // k*(-v1.x*v2.z+v2.x*v1.z),
00197 k*(v2.x*v1.z-v1.x*v2.z),
00198 k*(v1.x*v2.y-v2.x*v1.y) );
00199 }
|
|
||||||||||||
|
Definition at line 185 of file Vector.h. 00185 {
00186 return Vector( v1.y*v2.z-v2.y*v1.z,
00187 // -v1.x*v2.z+v2.x*v1.z,
00188 v2.x*v1.z-v1.x*v2.z,
00189 v1.x*v2.y-v2.x*v1.y );
00190 }
|
|
||||||||||||
|
Definition at line 155 of file Vector.h.
|
|
||||||||||||
|
Definition at line 151 of file Vector.h.
|
|
||||||||||||
|
Definition at line 147 of file Vector.h.
|
|
||||||||||||
|
Definition at line 127 of file Vector.h. 00127 {
00128 // return !(v1.x == v2.x && v1.y == v2.y && v1.z == v2.z);
00129 return v1.x != v2.x || v1.y != v2.y || v1.z != v2.z;
00130 }
|
|
||||||||||||
|
Definition at line 133 of file Vector.h.
|
|
||||||||||||
|
Definition at line 143 of file Vector.h.
|
|
|
Definition at line 138 of file Vector.h.
|
|
||||||||||||
|
Definition at line 159 of file Vector.h. 00159 {
00160 // if (!f)
00161 // NAMD_die("Division by 0 on a vector operation.");
00162 return Vector(v1.x/f, v1.y/f, v1.z/f);
00163 }
|
|
||||||||||||
|
Definition at line 124 of file Vector.h.
|
|
|
|
1.3.9.1