Added scale() and add() for VectorValues with a matlab interface
parent
6e026959ac
commit
22f028ab51
3
gtsam.h
3
gtsam.h
|
@ -1095,6 +1095,9 @@ class VectorValues {
|
||||||
void resize(size_t nVars, size_t varDim);
|
void resize(size_t nVars, size_t varDim);
|
||||||
void setZero();
|
void setZero();
|
||||||
|
|
||||||
|
gtsam::VectorValues add(const gtsam::VectorValues& c) const;
|
||||||
|
gtsam::VectorValues scale(double a, const gtsam::VectorValues& c) const;
|
||||||
|
|
||||||
//FIXME: Parse errors with vector()
|
//FIXME: Parse errors with vector()
|
||||||
//const Vector& vector() const;
|
//const Vector& vector() const;
|
||||||
//Vector& vector();
|
//Vector& vector();
|
||||||
|
|
|
@ -303,6 +303,15 @@ namespace gtsam {
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
/// @name Matlab syntactic sugar for linear algebra operations
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
inline VectorValues add(const VectorValues& c) const { return *this + c; }
|
||||||
|
inline VectorValues scale(const double a, const VectorValues& c) const { return a * (*this); }
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Throw an exception if j does not exist
|
// Throw an exception if j does not exist
|
||||||
void checkExists(Index j) const {
|
void checkExists(Index j) const {
|
||||||
|
|
Loading…
Reference in New Issue