28 #ifndef _math_scmat_vector3_h
29 #define _math_scmat_vector3_h
34 #include <util/misc/exenv.h>
35 #include <util/keyval/keyval.h>
51 _v[0] = p[0]; _v[1] = p[1]; _v[2] = p[2];
53 SCVector3(
double d) { _v[0] = d; _v[1] = d; _v[2] = d; }
55 _v[0] = x; _v[1] = y; _v[2] = z;
58 _v[0] = p._v[0]; _v[1] = p._v[1]; _v[2] = p._v[2];
66 void operator = (
const double *x) {
76 void operator = (
double d) { _v[0] = d; _v[1] = d; _v[2] = d; }
87 void operator *= (
double m) { _v[0] *= m; _v[1] *= m; _v[2] *= m; }
90 result._v[0] = _v[0] + v._v[0];
91 result._v[1] = _v[1] + v._v[1];
92 result._v[2] = _v[2] + v._v[2];
97 result._v[0] = _v[0] - v._v[0];
98 result._v[1] = _v[1] - v._v[1];
99 result._v[2] = _v[2] - v._v[2];
103 return _v[0]*v._v[0] + _v[1]*v._v[1] + _v[2]*v._v[2]; }
107 void spherical_coord(
double theta,
double phi,
109 void spherical_to_cartesian(
SCVector3&cart)
const;
110 double maxabs()
const;
114 double norm()
const {
return sqrt(this->dot(*
this)); }
115 double& elem(
int xyz) {
return _v[xyz]; }
116 const double& elem(
int xyz)
const {
return _v[xyz]; }
117 double& operator [] (
int i) {
return _v[i]; }
118 const double& operator [] (
int i)
const {
return _v[i]; }
119 double& operator () (
int i) {
return _v[i]; }
120 const double& operator () (
int i)
const {
return _v[i]; }
121 const double* data()
const {
return _v; }
122 double* data() {
return _v; }
123 double& x() {
return _v[0]; }
124 double& y() {
return _v[1]; }
125 double& z() {
return _v[2]; }
126 const double& x()
const {
return _v[0]; }
127 const double& y()
const {
return _v[1]; }
128 const double& z()
const {
return _v[2]; }
129 double& r() {
return _v[0]; }
130 double& theta() {
return _v[1]; }
131 double& phi() {
return _v[2]; }
132 const double& r()
const {
return _v[0]; }
133 const double& theta()
const {
return _v[1]; }
134 const double& phi()
const {
return _v[2]; }
146 #ifdef INLINE_FUNCTIONS
147 #include <math/scmat/vector3_i.h>
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &A, const Ref< GaussianBasisSet > &B)
Nonmember operator+ is more convenient to use than the member operator+.
A template class that maintains references counts.
Definition: ref.h:361
bool operator!=(const Atom &a, const Atom &b)
Definition: atom.h:170
std::vector< unsigned int > operator<<(const GaussianBasisSet &B, const GaussianBasisSet &A)
computes a map from basis functions in A to the equivalent basis functions in B.
void normalize(matrix< T > &a)
Normalize matrix.
Definition: matrix.hpp:216
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
a 3-element version of SCVector
Definition: vector3.h:43
double norm(ci::Vector &V, const std::vector< mpqc::range > &local, const MPI::Comm &comm)
Compute CI vector norm.
Definition: vector.hpp:160
static std::ostream & out0()
Return an ostream that writes from node 0.
bool operator==(const Atom &a, const Atom &b)
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:24:00 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.