#include <APPSPACK_Vector.hpp>
Definition at line 47 of file APPSPACK_Vector.hpp.
Public Member Functions | |
| Vector () | |
| Constructor -- creates vector of length 0. | |
| Vector (int n) | |
| Constructor -- creates vector of length n. | |
| Vector (int n, double val) | |
| Constructor -- creates vector of length n, each element assigned the value val. | |
| Vector (int n, double *x) | |
| Constructor -- creates a vector by copying the first n elements pointed by x. | |
| Vector (const Vector &x) | |
| Copy constructor. | |
| Vector (const vector< double > &x) | |
| Copy constructor. | |
| ~Vector () | |
| Destructor. | |
Memory allocating/altering methods. | |
| void | resize (int n) |
| Resizes vector length. | |
| void | reserve (int n) |
| Sets the capacity of the vector to at least n. | |
| void | push_back (double a) |
| Appends a to the end of the vector, increasing vector length by 1. | |
| void | assign (int n, double alpha) |
| Reset vector to size n and all values to value alpha. | |
| void | append (const Vector &x) |
| Appends x to end of the vector. | |
| void | append (int n, double alpha) |
| Appends n copies of alpha to the end of the vector. | |
| void | erase (int i) |
| Deletes the ith element from the vector, decreasing the length by 1. | |
| Vector & | operator= (const Vector &x) |
| Copies x. | |
Data access methods. | |
| int | size () const |
| Returns the length of the vector. | |
| bool | empty () const |
| Return true if vector is size zero, false otherwise. | |
| const vector< double > & | getStlVector () const |
| Returns an equivalent STL vector. | |
| double | operator[] (int i) const |
| Returns the ith element of the vector. | |
| bool | operator== (const Vector &x) const |
| Returns true if two vectors are equal, false otherwise. | |
| bool | operator!= (const Vector &x) const |
| Returns true if two vectors are not equal, false otherwise. | |
| void | copyToBool (vector< bool > &b) const |
| On exit, b[i] = true if the ith element of the vector is nonzero, false otherwise. | |
| ostream & | leftshift (ostream &stream) const |
| Prints out vector to specified stream. | |
| ostream & | leftshift (ostream &stream, int precision) const |
| Prints out vector to specified stream. | |
Vector mathematics. | |
| void | zero () |
| Sets all entries of the vector to zero. | |
| void | scale (double alpha) |
| Scales all elements of the vector by scalar alpha. | |
| void | scale (const Vector &s) |
| On exit, the ith element is scaled by s[i]. | |
| double | norm () const |
| Returns the two norm of the vector. | |
| double | min () const |
| Returns the smallest element of the vector. | |
| double | max () const |
| Returns the largest element of the vector. | |
| double | dot (const Vector &x) const |
| Compute the dot product between v (this vector) and x. | |
| Vector & | operator+= (const Vector &x) |
| Adds x to this vector. | |
| Vector & | operator-= (const Vector &x) |
| Substracts x from this vector. | |
| double & | operator[] (int i) |
| Returns a reference to the ith element. | |
Private Attributes | |
| vector< double > | vec |
| The vector. | |
|
|
Constructor -- creates vector of length 0.
Definition at line 43 of file APPSPACK_Vector.cpp. |
|
|
Constructor -- creates vector of length n.
Definition at line 47 of file APPSPACK_Vector.cpp. |
|
||||||||||||
|
Constructor -- creates vector of length n, each element assigned the value val.
Definition at line 51 of file APPSPACK_Vector.cpp. |
|
||||||||||||
|
Constructor -- creates a vector by copying the first n elements pointed by x.
Definition at line 55 of file APPSPACK_Vector.cpp. |
|
|
Copy constructor.
Definition at line 59 of file APPSPACK_Vector.cpp. |
|
|
Copy constructor.
Definition at line 63 of file APPSPACK_Vector.cpp. |
|
|
Destructor.
Definition at line 67 of file APPSPACK_Vector.cpp. |
|
|
|
Sets the capacity of the vector to at least n.
Definition at line 76 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Matrix::copyToFortranVector(). |
|
|
Appends a to the end of the vector, increasing vector length by 1.
Definition at line 81 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Matrix::addRow(), APPSPACK::Matrix::copyToFortranVector(), APPSPACK::Constraints::Linear::formSnapSystem(), APPSPACK::Directions::getDirectionIndices(), APPSPACK::Matrix::getRowPointers(), APPSPACK::Cache::Manager::processInputLine(), APPSPACK::Evaluator::SystemCall::readOutputFile(), APPSPACK::Constraints::Linear::setupScaledSystem(), and APPSPACK::Constraints::Linear::setupScaling(). |
|
||||||||||||
|
Reset vector to size n and all values to value alpha.
Definition at line 86 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Solver::initializeBestPointPtr(), APPSPACK::Constraints::Linear::setupBounds(), APPSPACK::Constraints::Linear::setupRhs(), APPSPACK::Directions::updateDirectionInfo(), and zero(). |
|
|
Appends x to end of the vector.
Definition at line 91 of file APPSPACK_Vector.cpp. Referenced by APPSPACK::Matrix::copyToFortranVector(), and APPSPACK::Directions::updateDirectionInfo(). |
|
||||||||||||
|
Appends n copies of alpha to the end of the vector.
Definition at line 97 of file APPSPACK_Vector.cpp. References vec. |
|
|
Deletes the ith element from the vector, decreasing the length by 1.
Definition at line 102 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Matrix::deleteRow(), APPSPACK::Constraints::Linear::formSnapSystem(), and APPSPACK::Matrix::pruneDependentRows(). |
|
|
Copies x.
Definition at line 107 of file APPSPACK_Vector.cpp. References vec. |
|
|
|
Return true if vector is size zero, false otherwise.
Definition at line 118 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Constraints::Linear::setupBounds(), and APPSPACK::Constraints::Linear::setupScaling(). |
|
|
Returns an equivalent STL vector.
Definition at line 123 of file APPSPACK_Vector.cpp. Referenced by APPSPACK::Solver::getBestVecF(), and APPSPACK::Solver::getBestX(). |
|
|
Returns the ith element of the vector.
Definition at line 128 of file APPSPACK_Vector.cpp. References vec. |
|
|
Returns true if two vectors are equal, false otherwise.
Definition at line 133 of file APPSPACK_Vector.cpp. References vec. |
|
|
Returns true if two vectors are not equal, false otherwise.
Definition at line 138 of file APPSPACK_Vector.cpp. References vec. |
|
|
On exit, b[i] = true if the ith element of the vector is nonzero, false otherwise. b is automatically resized to have appropriate length. Definition at line 143 of file APPSPACK_Vector.cpp. Referenced by APPSPACK::Constraints::Linear::setupBounds(). |
|
|
Prints out vector to specified stream.
Definition at line 150 of file APPSPACK_Vector.cpp. References APPSPACK::Print::formatDouble(), and vec. Referenced by operator<<(), and APPSPACK::Cache::Manager::writeToOutputFile(). |
|
||||||||||||
|
Prints out vector to specified stream.
Definition at line 159 of file APPSPACK_Vector.cpp. References APPSPACK::Print::formatDouble(), and vec. |
|
|
Sets all entries of the vector to zero.
Definition at line 176 of file APPSPACK_Vector.cpp. Referenced by APPSPACK::Matrix::multVecWithoutBlas(), and APPSPACK::Matrix::setToIdentity(). |
|
|
Scales all elements of the vector by scalar alpha.
Definition at line 181 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Matrix::addMatrix(), APPSPACK::Matrix::addRow(), and APPSPACK::Matrix::normalize(). |
|
|
On exit, the ith element is scaled by s[i].
Definition at line 187 of file APPSPACK_Vector.cpp. |
|
|
Returns the two norm of the vector.
Definition at line 199 of file APPSPACK_Vector.cpp. Referenced by APPSPACK::Matrix::addUniqueRows(), APPSPACK::Constraints::Linear::getEqState(), norm(), APPSPACK::Matrix::normalize(), and APPSPACK::Constraints::Linear::setupScaledSystem(). |
|
|
Returns the smallest element of the vector.
Definition at line 207 of file APPSPACK_Vector.cpp. References vec. |
|
|
Returns the largest element of the vector.
Definition at line 221 of file APPSPACK_Vector.cpp. References vec. Referenced by APPSPACK::Directions::getSmallestStep(). |
|
|
Compute the dot product between v (this vector) and x.
Definition at line 235 of file APPSPACK_Vector.cpp. References APPSPACK::DDOT_F77(), size(), and vec. Referenced by APPSPACK::Constraints::Linear::getEqState(), and APPSPACK::Constraints::Linear::getIneqState(). |
|
|
Adds x to this vector.
Definition at line 260 of file APPSPACK_Vector.cpp. |
|
|
Substracts x from this vector.
Definition at line 274 of file APPSPACK_Vector.cpp. |
|
|
Returns a reference to the ith element.
Definition at line 288 of file APPSPACK_Vector.cpp. References vec. |
|
|
The vector.
Definition at line 169 of file APPSPACK_Vector.hpp. Referenced by append(), assign(), copyToBool(), dot(), empty(), erase(), leftshift(), max(), min(), norm(), operator!=(), operator+=(), operator-=(), operator=(), operator==(), operator[](), push_back(), reserve(), resize(), scale(), size(), and zero(). |
![]()
© Sandia Corporation | Site Contact | Privacy and Security
![]()
Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by
1.3.9.1 written by Dimitri van Heesch,
© 1997-2002