2019-06-19 14:34:30 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright © 2004-2011 Ondra Kamenik
|
|
|
|
|
* Copyright © 2019 Dynare Team
|
|
|
|
|
*
|
|
|
|
|
* This file is part of Dynare.
|
|
|
|
|
*
|
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2009-09-08 15:55:19 +02:00
|
|
|
|
|
|
|
|
|
#ifndef VECTOR_H
|
|
|
|
|
#define VECTOR_H
|
|
|
|
|
|
2019-03-27 19:22:35 +01:00
|
|
|
|
/* NOTE: Vector and ConstVector have not common super class in order
|
|
|
|
|
to avoid running virtual method invokation mechanism. Some
|
|
|
|
|
members, and methods are thus duplicated */
|
2009-09-08 15:55:19 +02:00
|
|
|
|
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
#include <complex>
|
2019-05-20 18:35:16 +02:00
|
|
|
|
#include <utility>
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
|
|
|
|
|
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
|
|
|
|
|
# include <dynmex.h>
|
|
|
|
|
#endif
|
2009-09-08 15:55:19 +02:00
|
|
|
|
|
|
|
|
|
class GeneralMatrix;
|
|
|
|
|
class ConstVector;
|
|
|
|
|
|
2017-05-16 16:30:27 +02:00
|
|
|
|
class Vector
|
|
|
|
|
{
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
friend class ConstVector;
|
2009-09-08 15:55:19 +02:00
|
|
|
|
protected:
|
2019-01-09 15:58:45 +01:00
|
|
|
|
int len{0};
|
2019-03-27 19:22:35 +01:00
|
|
|
|
int s{1}; // stride (also called “skip” in some places)
|
2019-02-14 11:29:18 +01:00
|
|
|
|
double *data;
|
|
|
|
|
bool destroy{true};
|
2009-09-08 15:55:19 +02:00
|
|
|
|
public:
|
2019-02-14 11:29:18 +01:00
|
|
|
|
Vector() : data{nullptr}, destroy{false}
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
Vector(int l) : len{l}, data{new double[l]}
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
Vector(Vector &v) : len{v.len}, s{v.s}, data{v.data}, destroy{false}
|
2017-05-16 16:30:27 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
Vector(const Vector &v);
|
2019-05-20 18:35:16 +02:00
|
|
|
|
Vector(Vector &&v) : len{std::exchange(v.len, 0)}, s{v.s},
|
|
|
|
|
data{std::exchange(v.data, nullptr)},
|
|
|
|
|
destroy{std::exchange(v.destroy, false)}
|
2019-02-14 11:29:18 +01:00
|
|
|
|
{
|
|
|
|
|
}
|
2019-03-27 19:22:35 +01:00
|
|
|
|
// We don't want implict conversion from ConstVector, since it’s expensive
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
explicit Vector(const ConstVector &v);
|
2019-02-14 11:29:18 +01:00
|
|
|
|
Vector(double *d, int l)
|
|
|
|
|
: len(l), data{d}, destroy{false}
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
Vector(Vector &v, int off_arg, int l);
|
|
|
|
|
Vector(const Vector &v, int off_arg, int l);
|
|
|
|
|
Vector(Vector &v, int off_arg, int skip, int l);
|
|
|
|
|
Vector(const Vector &v, int off_arg, int skip, int l);
|
|
|
|
|
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
|
|
|
|
|
explicit Vector(mxArray *p);
|
|
|
|
|
#endif
|
2019-01-15 18:55:09 +01:00
|
|
|
|
Vector &operator=(const Vector &v);
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
Vector &operator=(Vector &&v);
|
2019-01-15 18:55:09 +01:00
|
|
|
|
Vector &operator=(const ConstVector &v);
|
2017-05-16 16:30:27 +02:00
|
|
|
|
double &
|
|
|
|
|
operator[](int i)
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data[s*i];
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
const double &
|
|
|
|
|
operator[](int i) const
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data[s*i];
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
const double *
|
|
|
|
|
base() const
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data;
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
double *
|
|
|
|
|
base()
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data;
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
int
|
|
|
|
|
length() const
|
|
|
|
|
{
|
|
|
|
|
return len;
|
|
|
|
|
}
|
|
|
|
|
int
|
|
|
|
|
skip() const
|
|
|
|
|
{
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-27 19:22:35 +01:00
|
|
|
|
// Exact equality.
|
2017-05-16 16:30:27 +02:00
|
|
|
|
bool operator==(const Vector &y) const;
|
|
|
|
|
bool operator!=(const Vector &y) const;
|
2019-03-27 19:22:35 +01:00
|
|
|
|
// Lexicographic ordering.
|
2017-05-16 16:30:27 +02:00
|
|
|
|
bool operator<(const Vector &y) const;
|
|
|
|
|
bool operator<=(const Vector &y) const;
|
|
|
|
|
bool operator>(const Vector &y) const;
|
|
|
|
|
bool operator>=(const Vector &y) const;
|
|
|
|
|
|
2019-02-14 11:29:18 +01:00
|
|
|
|
virtual ~Vector()
|
|
|
|
|
{
|
|
|
|
|
if (destroy)
|
|
|
|
|
delete[] data;
|
|
|
|
|
}
|
2017-05-16 16:30:27 +02:00
|
|
|
|
void zeros();
|
|
|
|
|
void nans();
|
|
|
|
|
void infs();
|
|
|
|
|
void rotatePair(double alpha, double beta1, double beta2, int i);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Computes this = this + r·v
|
2017-05-16 16:30:27 +02:00
|
|
|
|
void add(double r, const Vector &v);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Computes this = this + r·v
|
2017-05-16 16:30:27 +02:00
|
|
|
|
void add(double r, const ConstVector &v);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Computes this = this + z·v (where this and v are intepreted as complex vectors)
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
void addComplex(const std::complex<double> &z, const Vector &v);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Computes this = this + z·v (where this and v are intepreted as complex vectors)
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
void addComplex(const std::complex<double> &z, const ConstVector &v);
|
2017-05-16 16:30:27 +02:00
|
|
|
|
void mult(double r);
|
|
|
|
|
double getNorm() const;
|
|
|
|
|
double getMax() const;
|
|
|
|
|
double getNorm1() const;
|
|
|
|
|
double dot(const Vector &y) const;
|
|
|
|
|
bool isFinite() const;
|
|
|
|
|
void print() const;
|
|
|
|
|
|
2019-03-28 18:56:46 +01:00
|
|
|
|
/* Computes:
|
|
|
|
|
⎛x₁⎞ ⎛ α −β₁⎞ ⎛b₁⎞
|
|
|
|
|
⎢ ⎥=⎢ ⎥⊗I·⎢ ⎥
|
|
|
|
|
⎝x₂⎠ ⎝−β₂ α ⎠ ⎝b₂⎠
|
2017-05-16 16:30:27 +02:00
|
|
|
|
*/
|
|
|
|
|
static void mult2(double alpha, double beta1, double beta2,
|
|
|
|
|
Vector &x1, Vector &x2,
|
|
|
|
|
const Vector &b1, const Vector &b2);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
/* Computes:
|
|
|
|
|
⎛x₁⎞ ⎛x₁⎞ ⎛ α −β₁⎞ ⎛b₁⎞
|
|
|
|
|
⎢ ⎥=⎢ ⎥+⎢ ⎥⊗I·⎢ ⎥
|
|
|
|
|
⎝x₂⎠ ⎝x₂⎠ ⎝−β₂ α ⎠ ⎝b₂⎠
|
|
|
|
|
*/
|
2017-05-16 16:30:27 +02:00
|
|
|
|
static void mult2a(double alpha, double beta1, double beta2,
|
|
|
|
|
Vector &x1, Vector &x2,
|
|
|
|
|
const Vector &b1, const Vector &b2);
|
2019-03-28 18:56:46 +01:00
|
|
|
|
/* Computes:
|
|
|
|
|
⎛x₁⎞ ⎛x₁⎞ ⎛ α −β₁⎞ ⎛b₁⎞
|
|
|
|
|
⎢ ⎥=⎢ ⎥−⎢ ⎥⊗I·⎢ ⎥
|
|
|
|
|
⎝x₂⎠ ⎝x₂⎠ ⎝−β₂ α ⎠ ⎝b₂⎠
|
|
|
|
|
*/
|
2017-05-16 16:30:27 +02:00
|
|
|
|
static void
|
|
|
|
|
mult2s(double alpha, double beta1, double beta2,
|
|
|
|
|
Vector &x1, Vector &x2,
|
|
|
|
|
const Vector &b1, const Vector &b2)
|
|
|
|
|
{
|
|
|
|
|
mult2a(-alpha, -beta1, -beta2, x1, x2, b1, b2);
|
|
|
|
|
}
|
2009-09-08 15:55:19 +02:00
|
|
|
|
private:
|
2017-05-16 16:30:27 +02:00
|
|
|
|
void copy(const double *d, int inc);
|
2009-09-08 15:55:19 +02:00
|
|
|
|
};
|
|
|
|
|
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
class ConstGeneralMatrix;
|
|
|
|
|
|
|
|
|
|
class ConstVector
|
2017-05-16 16:30:27 +02:00
|
|
|
|
{
|
2019-01-25 15:27:20 +01:00
|
|
|
|
friend class Vector;
|
2009-09-08 15:55:19 +02:00
|
|
|
|
protected:
|
2017-05-16 16:30:27 +02:00
|
|
|
|
int len;
|
2019-03-28 18:56:46 +01:00
|
|
|
|
int s{1}; // stride (also called “skip” in some places)
|
2019-02-14 11:29:18 +01:00
|
|
|
|
const double *data;
|
2009-09-08 15:55:19 +02:00
|
|
|
|
public:
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Implicit conversion from Vector is ok, since it’s cheap
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
ConstVector(const Vector &v);
|
|
|
|
|
ConstVector(const ConstVector &v) = default;
|
|
|
|
|
ConstVector(ConstVector &&v) = default;
|
2019-02-14 11:29:18 +01:00
|
|
|
|
ConstVector(const double *d, int l) : len{l}, data{d}
|
2017-05-16 16:30:27 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
ConstVector(const ConstVector &v, int off_arg, int l);
|
|
|
|
|
ConstVector(const ConstVector &v, int off_arg, int skip, int l);
|
2019-02-14 11:29:18 +01:00
|
|
|
|
ConstVector(const double *d, int skip, int l);
|
Dynare++ / sylvester equation solver: refactor Vector and ConstVector classes
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
2019-01-22 16:07:44 +01:00
|
|
|
|
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
|
|
|
|
|
explicit ConstVector(const mxArray *p);
|
|
|
|
|
#endif
|
|
|
|
|
virtual ~ConstVector() = default;
|
|
|
|
|
ConstVector &operator=(const ConstVector &v) = delete;
|
|
|
|
|
ConstVector &operator=(ConstVector &&v) = delete;
|
2017-05-16 16:30:27 +02:00
|
|
|
|
const double &
|
|
|
|
|
operator[](int i) const
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data[s*i];
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
const double *
|
|
|
|
|
base() const
|
|
|
|
|
{
|
2019-02-14 11:29:18 +01:00
|
|
|
|
return data;
|
2017-05-16 16:30:27 +02:00
|
|
|
|
}
|
|
|
|
|
int
|
|
|
|
|
length() const
|
|
|
|
|
{
|
|
|
|
|
return len;
|
|
|
|
|
}
|
|
|
|
|
int
|
|
|
|
|
skip() const
|
|
|
|
|
{
|
|
|
|
|
return s;
|
|
|
|
|
}
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Exact equality
|
2017-05-16 16:30:27 +02:00
|
|
|
|
bool operator==(const ConstVector &y) const;
|
|
|
|
|
bool
|
|
|
|
|
operator!=(const ConstVector &y) const
|
|
|
|
|
{
|
|
|
|
|
return !operator==(y);
|
|
|
|
|
}
|
2019-03-28 18:56:46 +01:00
|
|
|
|
// Lexicographic ordering
|
2017-05-16 16:30:27 +02:00
|
|
|
|
bool operator<(const ConstVector &y) const;
|
|
|
|
|
bool
|
|
|
|
|
operator<=(const ConstVector &y) const
|
|
|
|
|
{
|
|
|
|
|
return operator<(y) || operator==(y);
|
|
|
|
|
}
|
|
|
|
|
bool
|
|
|
|
|
operator>(const ConstVector &y) const
|
|
|
|
|
{
|
|
|
|
|
return !operator<=(y);
|
|
|
|
|
}
|
|
|
|
|
bool
|
|
|
|
|
operator>=(const ConstVector &y) const
|
|
|
|
|
{
|
|
|
|
|
return !operator<(y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double getNorm() const;
|
|
|
|
|
double getMax() const;
|
|
|
|
|
double getNorm1() const;
|
|
|
|
|
double dot(const ConstVector &y) const;
|
|
|
|
|
bool isFinite() const;
|
|
|
|
|
void print() const;
|
2009-09-08 15:55:19 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* VECTOR_H */
|