Subversion Repositories gelsvn

Rev

Rev 117 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 117 Rev 561
Line 387... Line 387...
387
      os << "]";
387
      os << "]";
388
      return os;
388
      return os;
389
    }
389
    }
390
 
390
 
391
  /// Get from operator for ArithVec descendants. 
391
  /// Get from operator for ArithVec descendants. 
392
  template <class T,class V, unsigned int N>
392
    template <class T,class V, unsigned int N>
393
    inline std::istream& operator>>(std::istream&is, ArithVec<T,V,N>& v)
393
    inline std::istream& operator>>(std::istream&is, ArithVec<T,V,N>& v)
394
    {
394
    {
-
 
395
        is >> std::ws;
-
 
396
        if (is.peek() == '[')
-
 
397
            is.ignore();
-
 
398
        else
-
 
399
        {
-
 
400
            is.setstate(std::ios::badbit);
-
 
401
            return is;
-
 
402
        }
-
 
403
        is >> std::ws;
-
 
404
        for (int c=0; c<N; ++c)
-
 
405
        {
-
 
406
            is >> v(c) >> std::ws;
-
 
407
        }
-
 
408
        if (is.peek() == ']')
-
 
409
            is.ignore();
-
 
410
        else
-
 
411
        {
-
 
412
            is.setstate(std::ios::badbit);
-
 
413
            return is;
-
 
414
        }
-
 
415
        return is;
-
 
416
 
-
 
417
        //OLD VERSION
395
      for(unsigned int i=0;i<N;i++) is>>v[i];
418
        //for(unsigned int i=0;i<N;i++) is>>v[i];
396
      return is;
419
        //    return is;
397
    }
420
    }
398
 
421
 
399
 
422
 
400
  /** Dot product for two vectors. The `*' operator is 
423
  /** Dot product for two vectors. The `*' operator is 
401
      reserved for coordinatewise	multiplication of vectors. */
424
      reserved for coordinatewise	multiplication of vectors. */