![]()  | 
  
    RobWorkProject
    23.9.11-
    
   | 
 
Configuration vector. More...
#include <Q.hpp>
Public Types | |
| typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | Base | 
| Eigen vector used as internal datastructure.  | |
| typedef double | value_type | 
| Value type.  | |
Public Member Functions | |
| Q (size_t dim) | |
| A configuration of vector of length dim.  | |
| Q (const Q &q) | |
| Q () | |
| Default constructor.  More... | |
| Q (const std::vector< double > &r) | |
| Construct a configuration vector from a std::vector expression.  More... | |
| template<typename... ARGS> | |
| Q (size_t n, ARGS... args) | |
| Creates a Q initialized with values from values.  More... | |
| template<typename... ARGS> | |
| Q (int n, ARGS... args) | |
| Creates a Q initialized with values from values.  More... | |
| template<typename... ARGS> | |
| Q (double arg0, ARGS... args) | |
| Creates a Q initialized with values from values.  More... | |
| Q (const Base &q) | |
| Construct from Eigen base.  More... | |
| virtual | ~Q () | 
| Destructor.  | |
| size_t | size () const | 
| The dimension of the configuration vector.  | |
| bool | empty () const | 
| True if the configuration is of dimension zero.  | |
| const Base & | e () const | 
| Accessor for the internal Eigen vector state.  | |
| Base & | e () | 
| Accessor for the internal Eigen vector state.  | |
| const Q | getSubPart (size_t start, size_t cnt) const | 
| Extracts a sub part (range) of this Q.  More... | |
| void | setSubPart (size_t index, const Q &part) | 
| Set subpart of vector.  More... | |
| double | norm2 () const | 
| Returns the Euclidean norm (2-norm) of the configuration.  More... | |
| double | norm1 () const | 
| Returns the Manhatten norm (1-norm) of the configuration.  More... | |
| double | normInf () const | 
| Returns the infinte norm ( \(\inf\)-norm) of the configuration.  More... | |
| const double & | operator() (size_t i) const | 
| Returns reference to vector element.  More... | |
| double & | operator() (size_t i) | 
| Returns reference to vector element.  More... | |
| const double & | operator[] (size_t i) const | 
| Returns reference to vector element.  More... | |
| double & | operator[] (size_t i) | 
| Returns reference to vector element.  More... | |
| const Q | operator/ (double s) const | 
| Scalar division.  | |
| const Q | operator* (double s) const | 
| Scalar multiplication.  | |
| const Q | operator- (const Q &b) const | 
| Vector subtraction.  | |
| const Q | operator+ (const Q &b) const | 
| Vector addition.  | |
| bool | operator== (const Q &q2) const | 
| Compares this and q2 for equality.  More... | |
| bool | operator!= (const Q &q2) const | 
| Inequality operator The inverse of operator==().  | |
| Q & | operator*= (double s) | 
| Scalar multiplication.  | |
| Q & | operator/= (double s) | 
| Scalar division.  | |
| Q & | operator+= (const Q &v) | 
| Vector addition.  | |
| Q & | operator-= (const Q &v) | 
| Vector subtraction.  | |
| Q | operator- () const | 
| Unary minus.  | |
| bool | operator< (const Q &q) const | 
| Compares whether this is less than q.  More... | |
| void | toStdVector (std::vector< double > &v) const | 
| Convert to a standard vector.  More... | |
| std::vector< double > | toStdVector () const | 
| Convert to a standard vector.  More... | |
| template<> | |
| Q (size_t n, double *values) | |
| Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.  More... | |
| template<> | |
| Q (size_t n, const double *values) | |
| Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.  More... | |
| template<> | |
| Q (int n, double *values) | |
| Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.  More... | |
| template<> | |
| Q (int n, const double *values) | |
| Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.  More... | |
| template<> | |
| Q (int n, double values) | |
| Creates a Q of length n and initialize all values in Q to value.  More... | |
| template<> | |
| Q (size_t n, double values) | |
| Creates a Q of length n and initialize all values in Q to value.  More... | |
Static Public Member Functions | |
| static Q | zero (std::size_t n) | 
| Returns Q of length n initialized with 0's.  | |
Friends | |
| const Q | operator* (double s, const Q &v) | 
| Scalar multiplication.  | |
| const Q | operator/ (double s, const Q &v) | 
| Scalar division.  | |
Related Functions | |
(Note that these are not member functions.)  | |
| std::ostream & | operator<< (std::ostream &out, const Q &v) | 
| Streaming operator.  | |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &out, const Pose6D< T > &v) | 
| Streaming operator.  | |
| std::istream & | operator>> (std::istream &in, Q &q) | 
| Input streaming operator.  More... | |
| double | dot (const Q &a, const Q &b) | 
| The dot product (inner product) of a and b.  | |
| template<> | |
| void | write (const rw::math::Q &sobject, rw::common::OutputArchive &oarchive, const std::string &id) | 
| template<> | |
| void | read (rw::math::Q &sobject, rw::common::InputArchive &iarchive, const std::string &id) | 
| template<class Archive > | |
| void | serialize (Archive &archive, rw::math::Q &q, const unsigned int version) | 
| Boost serialization.  More... | |
| template<class Archive > | |
| void | save (Archive &archive, const rw::math::Q &q, const unsigned int version) | 
| Boost serialization.  More... | |
| template<class Archive > | |
| void | load (Archive &archive, rw::math::Q &q, const unsigned int version) | 
| Boost serialization.  More... | |
Configuration vector.
      
  | 
  inline | 
Default constructor.
The vector will be of dimension zero.
| Q | ( | const std::vector< double > & | r | ) | 
Construct a configuration vector from a std::vector expression.
| r | [in] An expression for a vector of doubles | 
      
  | 
  inlineexplicit | 
Creates a Q initialized with values from values.
| n | [in] this value describes the length of the conficuration. This behavior is depreacted. if RW_Q_USE_NEW_CONSTRUCTOR is not defined an exception is thrown if the number of extra arguments doesn't match the value. if RW_Q_USE_NEW_CONSTRUCTOR is defined n is counted as a value unless it matches the extra number of arguments. | 
| args | [in] the values of the configuration | 
      
  | 
  inlineexplicit | 
Creates a Q initialized with values from values.
| n | [in] this value describes the length of the conficuration. This behavior is depreacted. if RW_Q_USE_NEW_CONSTRUCTOR is not defined an exception is thrown if the number of extra arguments doesn't match the value. if RW_Q_USE_NEW_CONSTRUCTOR is defined n is counted as a value unless it matches the extra number of arguments. | 
| args | [in] the values of the configuration | 
      
  | 
  inlineexplicit | 
Creates a Q initialized with values from values.
| arg0 | [in] first value | 
| args | [in] the values of the configuration | 
| Q | ( | size_t | n, | 
| double * | values | ||
| ) | 
Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.
| n | [in] Length of q. | 
| values | [in] Values to initialize with | 
| Q | ( | size_t | n, | 
| const double * | values | ||
| ) | 
Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.
| n | [in] Length of q. | 
| values | [in] Values to initialize with | 
| Q | ( | int | n, | 
| double * | values | ||
| ) | 
Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.
| n | [in] Length of q. | 
| values | [in] Values to initialize with | 
| Q | ( | int | n, | 
| const double * | values | ||
| ) | 
Creates a Q of length n and initialized with values from values The method reads n values from values and do not check whether reading out of bounds.
| n | [in] Length of q. | 
| values | [in] Values to initialize with | 
| Q | ( | int | n, | 
| double | values | ||
| ) | 
| Q | ( | size_t | n, | 
| double | values | ||
| ) | 
      
  | 
  inline | 
Extracts a sub part (range) of this Q.
| start | [in] Start index | 
| cnt | [in] the number of elements to include | 
      
  | 
  inline | 
Returns the Manhatten norm (1-norm) of the configuration.
      
  | 
  inline | 
Returns the Euclidean norm (2-norm) of the configuration.
      
  | 
  inline | 
Returns the infinte norm ( \(\inf\)-norm) of the configuration.
      
  | 
  inline | 
Returns reference to vector element.
| i | [in] index in the vector | 
      
  | 
  inline | 
Returns reference to vector element.
| i | [in] index in the vector | 
      
  | 
  inline | 
Compares whether this is less than q.
The less operator is defined such that the first index is the most significant. That is if (*this)[0] < q[0] then true is returned. If (*this)[0] > q[0] false is returned and only if (*this)[0] == q[0] is the next index considered.
| bool operator== | ( | const Q & | q2 | ) | const | 
Compares this and q2 for equality.
this and q2 are considered equal if and only if they have equal length and if q1(i) == q2(i) for all i.
| q2 | [in] | 
      
  | 
  inline | 
Returns reference to vector element.
| i | [in] index in the vector | 
      
  | 
  inline | 
Returns reference to vector element.
| i | [in] index in the vector | 
      
  | 
  inline | 
Set subpart of vector.
| index | [in] the initial index. | 
| part | [in] the part to insert beginning from index. | 
      
  | 
  inline | 
Convert to a standard vector.
      
  | 
  inline | 
Convert to a standard vector.
| v | [out] the result. | 
      
  | 
  related | 
Boost serialization.
| archive | [in] the boost archive to read from. | 
| q | [out] the vector to read. | 
| version | [in] class version (currently version 0). | 
      
  | 
  related | 
Input streaming operator.
Parse input stream according to how operator<< streams out
| in | [in] Input stream | 
| q | [in] Target of q read in | 
      
  | 
  related | 
Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.
| sobject | [out] the object in which the data should be streamed into | 
| iarchive | [in] the InputArchive from which to read data. | 
| id | [in] The id of the serialized sobject. | 
      
  | 
  related | 
Boost serialization.
| archive | [in] the boost archive to write to. | 
| q | [in] the vector to write. | 
| version | [in] class version (currently version 0). | 
      
  | 
  related | 
Boost serialization.
| archive | [in] the boost archive to read from or write to. | 
| q | [in/out] the vector to read/write. | 
| version | [in] class version (currently version 0). | 
      
  | 
  related | 
Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.
| sobject | [in] the object from which the data should be streamed. | 
| oarchive | [out] the OutputArchive in which data should be written. | 
| id | [in] The id of the serialized sobject. |