![]() |
Templates -- Meow
1.1.2
不能,也不應該先編譯成obj-file的templates
|
vector More...
#include "Vector.h"
Public Member Functions | |
Vector () | |
constructor More... | |
Vector (Vector const &v) | |
constructor More... | |
Vector (Matrix< Scalar > const &m) | |
constructor More... | |
Vector (Matrix< Scalar > const &m, size_t i) | |
constructor More... | |
Vector (std::vector< Scalar > const &v) | |
constructor More... | |
Vector (size_t d, Scalar const &e) | |
constructor More... | |
~Vector () | |
destructor More... | |
Vector & | copyFrom (Vector const &v) |
copy from ... More... | |
Vector & | referenceFrom (Vector const &v) |
reference from ... More... | |
Matrix< Scalar > const & | matrix () const |
Return a dimension x 1 matrix form of it. More... | |
size_t | dimension () const |
return dimension More... | |
size_t | dimension (size_t d, Scalar const &s) |
resize the dimension More... | |
bool | valid () const |
Return whether dimension>0 is true or not. More... | |
Scalar | entry (size_t i) const |
return i -th entry More... | |
Scalar | entry (size_t i, Scalar const &s) |
change i -th entry More... | |
void | entries (size_t i, size_t j, Scalar const &s) |
change i -th to j -th entries More... | |
Vector | subVector (size_t i, size_t j) |
subvector form i-th to j-th More... | |
Vector | positive () const |
return +(*this) More... | |
Vector | negative () const |
return -(*this) More... | |
Vector | add (Vector const &v) const |
return (*this)+v More... | |
Vector | sub (Vector const &v) const |
return (*this)-v More... | |
Vector | mul (Scalar const &s) const |
return (*this)*s , where s is a scalar More... | |
Vector | div (Scalar const &s) const |
return (*this)/s , where s is a scalar More... | |
Scalar | dot (Vector const &v) const |
dot More... | |
Scalar | length () const |
sqrt of length2 More... | |
Scalar | length2 () const |
same as (*this).dot(*this) More... | |
Vector | normalize () const |
return a normalize form of itself More... | |
Vector & | normalized () |
Let itself be normalize form. More... | |
Vector & | operator= (Vector const &v) |
same as copyFrom More... | |
Scalar | operator() (size_t i) const |
same as entry(i) More... | |
Vector | operator+ () const |
same as positive() More... | |
Vector | operator- () const |
same as negative() More... | |
Vector | operator+ (Vector const &v) const |
same as add(v) More... | |
Vector | operator- (Vector const &v) const |
same as sub(v) More... | |
Scalar | operator* (Vector const &v) const |
same as dot(v) More... | |
Vector | operator* (Scalar const &s) const |
same as mul(s) More... | |
Vector | operator/ (Scalar const &s) const |
same as div(s) More... | |
vector
|
inline |
constructor
With dimension=0, which means invalid.
|
inline |
constructor
Copy from another vector
[in] | v | another vector |
|
inline |
constructor
From matrix's first column
[in] | m | matrix |
|
inline |
constructor
From matrix's i-th column
[in] | m | matrix |
[in] | i | i-th |
|
inline |
constructor
Copy from another std::vector
[in] | v | vector |
|
inline |
constructor
setup dimension and inital value
[in] | d | dimension |
[in] | e | inital value |
|
inline |
destructor
|
inline |
return (*this)+v
|
inline |
copy from ...
|
inline |
return dimension
|
inline |
resize the dimension
[in] | d | new dimension |
[in] | s | inital entry |
|
inline |
return (*this)/s , where s is a scalar
|
inline |
dot
|
inline |
change i -th to j -th entries
[in] | i | i-th |
[in] | j | j-th |
[in] | s | new value |
|
inline |
return i -th entry
|
inline |
change i -th entry
[in] | i | i-th |
[in] | s | new value |
|
inline |
sqrt of length2
|
inline |
same as (*this).dot(*this)
|
inline |
Return a dimension x 1 matrix form of it.
|
inline |
return (*this)*s , where s is a scalar
|
inline |
return -(*this)
|
inline |
return a normalize form of itself
|
inline |
Let itself be normalize form.
|
inline |
same as entry(i)
|
inline |
same as dot(v)
|
inline |
same as mul(s)
|
inline |
same as positive()
|
inline |
same as add(v)
|
inline |
same as negative()
|
inline |
same as sub(v)
|
inline |
same as div(s)
|
inline |
same as copyFrom
|
inline |
return +(*this)
|
inline |
reference from ...
|
inline |
return (*this)-v
|
inline |
subvector form i-th to j-th
|
inline |
Return whether dimension>0
is true or not.
true/false