Ignore:
Timestamp:
Jun 7, 2005, 4:41:25 PM (16 years ago)
Author:
Jari Häkkinen
Message:

Added exceptions for tracing file format problems when reading vectors.
Changed implentation for reading ints and doubles into stl vectors, now
unexpected characters are skipped instead of treated as zeros.
Some other minor things.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/gslapi/vector.h

    r334 r341  
    99
    1010#include <gsl/gsl_vector.h>
     11#include <c++_tools/utility/Exception.h>
    1112
    1213namespace theplu {
     
    8283    /// end of input to the vector is at end of file marker.
    8384    ///
    84     explicit vector(std::istream &);
     85    explicit vector(std::istream &) throw (utility::IO_error,std::exception);
    8586
    8687    ///
     
    309310    double operator*( const vector &other ) const;
    310311
     312    ///
     313    /// Vector with scalar multiplication.
     314    ///
     315    /// @note This operator is not implemented!
     316    ///
     317    vector operator*(const double d) const;
     318
    311319    ///
    312320    /// Vector addition.
     
    315323    ///
    316324    vector operator+( const vector& other ) const;
     325
     326    ///
     327    /// Vector subtraction.
     328    ///
     329    /// @return The resulting vector.
     330    ///
     331    vector operator-( const vector& other ) const;
     332
     333    ///
     334    /// Comparison operator. Takes linear time.
     335    ///
     336    /// @return True if the sequence of the elements in the vectors
     337    /// are element/wise equal.
     338    ///
     339    bool operator==(const vector&) const;
     340
     341    ///
     342    /// The assignment operator. There is no requirements on
     343    /// dimensions.
     344    ///
     345    vector& operator=(const vector&);
    317346
    318347    ///
     
    324353    { gsl_vector_add(v_,other.v_); return *this; }
    325354
    326 
    327     ///
    328     /// Vector subtraction.
    329     ///
    330     /// @return The resulting vector.
    331     ///
    332     vector operator-( const vector& other ) const;
    333 
    334355    ///
    335356    /// Subtract and assign operator.
     
    341362
    342363    ///
    343     /// The assignment operator. There is no requirements on
    344     /// dimensions.
    345     ///
    346     vector& operator=(const vector&);
    347 
    348     ///
    349364    /// Multiply with scalar and assign operator.
    350365    ///
    351366    vector& operator*=(const double d) { gsl_vector_scale(v_,d); return *this; }
    352 
    353     ///
    354     /// Vector with scalar multiplication.
    355     ///
    356     /// \note This operator is not implemented!
    357     ///
    358     vector operator*(const double d) const;
    359367
    360368
Note: See TracChangeset for help on using the changeset viewer.