Home | History | Annotate | Download | only in PBQP

Lines Matching defs:Vector

1 //===- Math.h - PBQP Vector and Matrix classes ------------------*- C++ -*-===//
25 /// \brief PBQP Vector class.
26 class Vector {
27 friend hash_code hash_value(const Vector &);
30 /// \brief Construct a PBQP vector of the given size.
31 explicit Vector(unsigned Length)
34 /// \brief Construct a PBQP vector with initializer.
35 Vector(unsigned Length, PBQPNum InitVal)
40 /// \brief Copy construct a PBQP vector.
41 Vector(const Vector &V)
46 /// \brief Move construct a PBQP vector.
47 Vector(Vector &&V)
53 bool operator==(const Vector &V) const {
54 assert(Length != 0 && Data && "Invalid vector");
60 /// \brief Return the length of the vector
62 assert(Length != 0 && Data && "Invalid vector");
68 assert(Length != 0 && Data && "Invalid vector");
69 assert(Index < Length && "Vector element access out of bounds.");
75 assert(Length != 0 && Data && "Invalid vector");
76 assert(Index < Length && "Vector element access out of bounds.");
80 /// \brief Add another vector to this one.
81 Vector& operator+=(const Vector &V) {
82 assert(Length != 0 && Data && "Invalid vector");
83 assert(Length == V.Length && "Vector length mismatch.");
89 /// \brief Returns the index of the minimum value in this vector
91 assert(Length != 0 && Data && "Invalid vector");
100 /// \brief Return a hash_value for the given vector.
101 inline hash_code hash_value(const Vector &V) {
107 /// \brief Output a textual representation of the given vector on the given
110 OStream& operator<<(OStream &OS, const Vector &V) {
111 assert((V.getLength() != 0) && "Zero-length vector badness.");
187 /// \brief Returns the given row as a vector.
188 Vector getRowAsVector(unsigned R) const {
190 Vector V(Cols);
196 /// \brief Returns the given column as a vector.
197 Vector getColAsVector(unsigned C) const {
199 Vector V(Rows);
256 class MDVector : public Vector {
258 MDVector(const Vector &v) : Vector(v), md(*this) {}
259 MDVector(Vector &&v) : Vector(std::move(v)), md(*this) { }
269 return hash_value(static_cast<const Vector&>(V));