11 void OK() const { dat
.OK();}
12 int dim() const { return dat
.sz(); }
14 Vector(const Vector
&n
);
19 void insert(Real v
, int i
) {
22 void del(int i
) { dat
.del(i
); }
23 operator String() const;
25 for (int i
=0; i
< dim(); i
++)
29 void operator +=(Vector v
) {
30 assert(v
.dim() == dim());
31 for (int i
=0; i
< dim(); i
++)
35 void operator /=(Real a
) {
39 void operator *=(Real a
) {
40 for (int i
=0; i
< dim(); i
++)
44 void operator -=(Vector v
) {
45 assert(v
.dim() == dim());
46 for (int i
=0; i
< dim(); i
++)
50 Real
&operator()(int i
) { return dat
[i
]; }
51 Real
operator()(int i
) const { return dat
[i
]; }
52 Real
elem(int i
) { return dat
[i
]; }
53 Real
operator *(Vector v
) const {
55 assert(v
.dim() == dim());
56 for (int i
=0; i
< dim(); i
++)
60 Vector
operator-() const;
62 return sqrt(norm_sq() );
65 return ((*this) * (*this));
67 operator svec
<Real
> () { return dat
; }
69 /// set to j-th element of unit-base
70 void set_unit(int j
) ;
73 a vector. Storage is handled in svec, Vector only does the mathematics.
77 operator+(Vector a
, Vector
const &b
) {
83 operator-(Vector a
, Vector
const &b
) {
89 operator*(Vector v
, Real a
) {
95 operator*( Real a
,Vector v
) {
101 operator/(Vector v
,Real a
) {