General Purpose Geodetic Library
SgVector.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #include <SgVector.h>
25 
26 
27 const SgVector vZero(1);
28 
29 
30 /*=======================================================================================================
31 *
32 * FRIENDS:
33 *
34 *======================================================================================================*/
35 std::ostream &operator<<(std::ostream& s, const SgVector& v)
36 {
37 // there is no need to be a friend to vector
38  unsigned int n=v.n();
39  s << "(";
40  if (n>0)
41  {
42  for(unsigned int i=0; i<n-1; i++)
43  s << v.getElement(i) << ", ";
44  s << v.getElement(n-1);
45  };
46  return s << ")";
47 };
48 /*=====================================================================================================*/
const SgVector vZero(1)
std::ostream & operator<<(std::ostream &s, const SgVector &v)
Definition: SgVector.cpp:35
unsigned int n() const
Definition: SgVector.h:327
double getElement(unsigned int i) const
Definition: SgVector.h:362