Go to the documentation of this file.
44 #ifndef GNSSTK_VECTOR_BASE_OPERATORS_HPP
45 #define GNSSTK_VECTOR_BASE_OPERATORS_HPP
68 template <
class T,
class E>
71 std::ofstream savefmt;
74 for (i=0; i< a.
size(); i++) {
75 s << std::setw(1) <<
' ';
83 template <
class T,
class BaseClass>
88 for (i = 0; i < l.
size(); i++)
96 template <
class T,
class BaseClass>
101 VectorException e(
"Can't find the minabs of an empty vector");
106 for (i = 1; i < l.
size(); i++)
115 template <
class T,
class BaseClass>
120 VectorException e(
"Can't find the min of an empty vector");
125 for (i = 1; i < l.
size(); i++)
132 template <
class T,
class BaseClass>
137 VectorException e(
"Can't find the maxabs of an empty vector");
142 for (i = 1; i < l.
size(); i++)
149 template <
class T,
class BaseClass>
154 VectorException e(
"Can't find the max of an empty vector");
159 for (i = 1; i < l.
size(); i++)
166 template <
class T,
class BaseClass,
class BaseClass2>
172 for (i = 0; i < n; i++)
180 template <
class T,
class BaseClass>
185 for (i = 0; i < l.
size(); i++)
193 template <
class T,
class BaseClass>
198 for (i = 0; i < r.
size(); i++)
206 template <
class T,
class BaseClass>
210 if(v.
size()==0)
return mag;
212 for(
size_t i=1; i<v.
size(); i++) {
214 mag *=
SQRT(T(1)+(v(i)/mag)*(v(i)/mag));
215 else if(
ABS(v(i)) > mag)
216 mag =
ABS(v(i))*
SQRT(T(1)+(mag/v(i))*(mag/v(i)));
224 template <
class T,
class BaseClass,
class BaseClass2>
230 VectorException e(
"Minkowski requires vector length 4");
233 return (v(0)*w(0)+v(1)*w(1)+v(2)*w(2)-v(3)*w(3));
237 template <
class T,
class BaseClass1,
class BaseClass2>
243 for(i=0; i<n; i++) c += (a(i)/na)*(b(i)/nb);
251 #define VecShortwireComparisonOperator(func, op) \
253 template <class T, class BaseClass, class BaseClass2> \
254 inline bool func(const ConstVectorBase<T, BaseClass>& l, \
255 const ConstVectorBase<T, BaseClass2>& r) \
257 size_t len = (l.size() < r.size()) ? l.size() : r.size(); \
259 for(i = 0; i < len; i++) \
260 if ( !(l[i] op r[i]) ) \
265 template <class T, class BaseClass> \
266 inline bool func(const ConstVectorBase<T, BaseClass>& l, const T r) \
268 size_t len = l.size(); \
270 for(i = 0; i < len; i++) \
271 if ( !(l[i] op r) ) \
276 template <class T, class BaseClass> \
277 inline bool func(const T l, const ConstVectorBase<T, BaseClass>& r) \
279 size_t len = r.size(); \
281 for(i = 0; i < len; i++) \
282 if ( !(l op r[i]) ) \
298 #endif // GNSSTK_VECTOR_BASE_OPERATORS_HPP
VecShortwireComparisonOperator(eq,==) VecShortwireComparisonOperator(ne
T dot(const SparseVector< T > &SL, const SparseVector< T > &SR)
dot (SparseVector, SparseVector)
T max(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
T sum(const ConstVectorBase< T, BaseClass > &l)
T maxabs(const SparseMatrix< T > &SM)
Maximum absolute value - return 0 if empty.
T minabs(const SparseMatrix< T > &SM)
Minimum absolute value - return 0 if empty.
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
T Minkowski(const ConstVectorBase< T, BaseClass > &v, const ConstVectorBase< T, BaseClass2 > &w)
T min(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
T cosVec(const SparseVector< T > &S1, const SparseVector< T > &S2)
size_t size() const
Returns the size of the base class.
#define GNSSTK_THROW(exc)
T norm(const SparseVector< T > &SV)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42