Ignore:
Timestamp:
Feb 22, 2008, 4:29:56 PM (14 years ago)
Author:
Peter
Message:

fixes #308

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Matrix.h

    r1120 r1121  
    6262  /// superdiagonals.
    6363  ///
    64   class matrix
     64  class Matrix
    6565  {
    6666  public:
     
    9595       structures.
    9696    */
    97     matrix(void);
     97    Matrix(void);
    9898
    9999    /**
     
    103103       \throw GSL_error if memory allocation fails.
    104104    */
    105     matrix(const size_t& r, const size_t& c, double init_value=0);
     105    Matrix(const size_t& r, const size_t& c, double init_value=0);
    106106
    107107    /**
     
    111111       fails.
    112112    */
    113     matrix(const matrix&);
     113    Matrix(const Matrix&);
    114114
    115115    /**
     
    127127       unexpected input is found in the input stream.
    128128    */
    129     explicit matrix(std::istream &, char sep='\0')
     129    explicit Matrix(std::istream &, char sep='\0')
    130130      throw(utility::IO_error, std::exception);
    131131
     
    133133       \brief The destructor.
    134134    */
    135     ~matrix(void);
     135    ~Matrix(void);
    136136
    137137    ///
     
    206206       \throw GSL_error if dimensions mis-match.
    207207    */
    208     void div(const matrix& b);
     208    void div(const Matrix& b);
    209209
    210210    /**
     
    247247       \see operator== and operator!=
    248248    */
    249     bool equal(const matrix&, const double precision=0) const;
     249    bool equal(const Matrix&, const double precision=0) const;
    250250
    251251    ///
     
    260260
    261261    /**
    262        Multiply the elements of matrix \a b with the elements of the
    263        calling matrix ,\f$ a_{ij} = a_{ij} * b_{ij} \; \forall i,j
    264        \f$. The result is stored into the calling matrix.
     262       Multiply the elements of Matrix \a b with the elements of the
     263       calling Matrix ,\f$ a_{ij} = a_{ij} * b_{ij} \; \forall i,j
     264       \f$. The result is stored into the calling Matrix.
    265265
    266266       \throw GSL_error if dimensions mis-match.
    267267    */
    268     void mul(const matrix& b);
    269 
    270     /**
    271        \brief Resize matrix
     268    void mul(const Matrix& b);
     269
     270    /**
     271       \brief Resize Matrix
    272272       
    273273       All elements are set to @a init_value.
    274274
    275275       \note underlying GSL matrix is destroyed and views into this
    276        matrix becomes invalid.
     276       Matrix becomes invalid.
    277277    */
    278278    void resize(size_t, size_t, double init_value=0);
     
    303303       \brief Swap row \a i and column \a j.
    304304
    305        The matrix must be square.
     305       The Matrix must be square.
    306306
    307307       \throw GSL_error if either index is out of bounds, or if matrix
     
    359359       \see equal
    360360    */
    361     bool operator==(const matrix& other) const;
     361    bool operator==(const Matrix& other) const;
    362362
    363363    /**
     
    372372       \see equal
    373373    */
    374     bool operator!=(const matrix& other) const;
     374    bool operator!=(const Matrix& other) const;
    375375
    376376    /**
    377377       \brief The assignment operator.
    378378
    379        \return A const reference to the resulting matrix.
    380     */
    381     const matrix& operator=(const matrix& other);
     379       \return A const reference to the resulting Matrix.
     380    */
     381    const Matrix& operator=(const Matrix& other);
    382382
    383383    /**
    384384       \brief Add and assign operator.
    385385
    386        Elementwise addition of the elements of matrix \a b to the left
    387        hand side matrix ,\f$ a_{ij} = a_{ij} + b_{ij} \; \forall i,j
     386       Elementwise addition of the elements of Matrix \a b to the left
     387       hand side Matrix ,\f$ a_{ij} = a_{ij} + b_{ij} \; \forall i,j
    388388       \f$.
    389389
    390        \return A const reference to the resulting matrix.
     390       \return A const reference to the resulting Matrix.
    391391
    392392       \throw GSL_error if dimensions mis-match.
    393393    */
    394     const matrix& operator+=(const matrix& b);
     394    const Matrix& operator+=(const Matrix& b);
    395395
    396396    /**
    397397       \brief Add and assign operator
    398398
    399        Add the scalar value \a d to the left hand side matrix, \f$
     399       Add the scalar value \a d to the left hand side Matrix, \f$
    400400       a_{ij} = a_{ij} + d \; \forall i,j \f$.
    401401    */
    402     const matrix& operator+=(const double d);
     402    const Matrix& operator+=(const double d);
    403403
    404404    /**
    405405       \brief Subtract and assign operator.
    406406
    407        Elementwise subtraction of the elements of matrix \a b to the
    408        left hand side matrix ,\f$ a_{ij} = a_{ij} + b_{ij} \; \forall
     407       Elementwise subtraction of the elements of Matrix \a b to the
     408       left hand side Matrix ,\f$ a_{ij} = a_{ij} + b_{ij} \; \forall
    409409       i,j \f$.
    410410
    411        \return A const reference to the resulting matrix.
     411       \return A const reference to the resulting Matrix.
    412412
    413413       \throw GSL_error if dimensions mis-match.
    414414    */
    415     const matrix& operator-=(const matrix&);
     415    const Matrix& operator-=(const Matrix&);
    416416
    417417    /**
    418418       \brief Subtract and assign operator
    419419
    420        Subtract the scalar value \a d to the left hand side matrix,
     420       Subtract the scalar value \a d to the left hand side Matrix,
    421421       \f$ a_{ij} = a_{ij} + d \; \forall i,j \f$.
    422422    */
    423     const matrix& operator-=(const double d);
     423    const Matrix& operator-=(const double d);
    424424
    425425    /**
    426426       \brief Multiply and assigment operator.
    427427
    428        \return Const reference to the resulting matrix.
     428       \return Const reference to the resulting Matrix.
    429429
    430430       \throw GSL_error if memory allocation fails.
    431431    */
    432     const matrix& operator*=(const matrix&);
     432    const Matrix& operator*=(const Matrix&);
    433433
    434434    /**
    435435       \brief Multiply and assignment operator
    436436
    437        Multiply the elements of the left hand side matrix with a
     437       Multiply the elements of the left hand side Matrix with a
    438438       scalar \a d, \f$ a_{ij} = d * a_{ij} \; \forall i,j \f$.
    439439
    440440       \throw GSL_error if memory allocation fails.
    441441    */
    442     const matrix& operator*=(double d);
     442    const Matrix& operator*=(double d);
    443443
    444444  private:
     
    473473
    474474  /**
    475      \brief Check if all elements of the matrix are zero.
    476 
    477      \return True if all elements in the matrix is zero, false
     475     \brief Check if all elements of the Matrix are zero.
     476
     477     \return True if all elements in the Matrix is zero, false
    478478     othwerwise.
    479479  */
    480   bool isnull(const matrix&);
    481 
    482   /**
    483      \brief Get the maximum value of the matrix.
    484 
    485      \return The maximum value of the matrix.
    486   */
    487   double max(const matrix&);
    488 
    489   /**
    490      \brief Get the minimum value of the matrix.
    491 
    492      \return The minimum value of the matrix.
    493   */
    494   double min(const matrix&);
    495 
    496   /**
    497      \brief Locate the maximum and minumum element in the matrix.
     480  bool isnull(const Matrix&);
     481
     482  /**
     483     \brief Get the maximum value of the Matrix.
     484
     485     \return The maximum value of the Matrix.
     486  */
     487  double max(const Matrix&);
     488
     489  /**
     490     \brief Get the minimum value of the Matrix.
     491
     492     \return The minimum value of the Matrix.
     493  */
     494  double min(const Matrix&);
     495
     496  /**
     497     \brief Locate the maximum and minumum element in the Matrix.
    498498
    499499     \return The indecies to the element with the minimum and maximum
    500      values of the matrix, respectively.
     500     values of the Matrix, respectively.
    501501
    502502     \note Lower index has precedence (searching in row-major order).
    503503  */
    504   void minmax_index(const matrix&,
     504  void minmax_index(const Matrix&,
    505505                    std::pair<size_t,size_t>& min,
    506506                    std::pair<size_t,size_t>& max);
    507507
    508508  /**
    509      \brief Create a matrix \a flag indicating NaN's in another matrix
     509     \brief Create a Matrix \a flag indicating NaN's in another Matrix
    510510     \a templat.
    511511
    512      The \a flag matrix is changed to contain 1's and 0's only. A 1
    513      means that the corresponding element in the \a templat matrix is
     512     The \a flag Matrix is changed to contain 1's and 0's only. A 1
     513     means that the corresponding element in the \a templat Matrix is
    514514     valid and a zero means that the corresponding element is a NaN.
    515515
    516      \note Space for matrix \a flag is reallocated to fit the size of
    517      matrix \a templat if sizes mismatch.
    518 
    519      \return True if the \a templat matrix contains at least one NaN.
    520   */
    521   bool nan(const matrix& templat, matrix& flag);
     516     \note Space for Matrix \a flag is reallocated to fit the size of
     517     Matrix \a templat if sizes mismatch.
     518
     519     \return True if the \a templat Matrix contains at least one NaN.
     520  */
     521  bool nan(const Matrix& templat, Matrix& flag);
    522522
    523523  /**
     
    528528     \throw GSL_error if either index is out of bounds.
    529529  */
    530   void swap(matrix&, matrix&);
    531 
    532   /**
    533      \brief The output operator for the matrix class.
    534   */
    535   std::ostream& operator<< (std::ostream& s, const matrix&);
    536 
    537   /**
    538      \brief vector matrix multiplication
     530  void swap(Matrix&, Matrix&);
     531
     532  /**
     533     \brief The output operator for the Matrix class.
     534  */
     535  std::ostream& operator<< (std::ostream& s, const Matrix&);
     536
     537  /**
     538     \brief vector Matrix multiplication
    539539   */
    540   Vector operator*(const matrix&, const VectorBase&);
    541 
    542   /**
    543      \brief matrix vector multiplication
     540  Vector operator*(const Matrix&, const VectorBase&);
     541
     542  /**
     543     \brief Matrix vector multiplication
    544544   */
    545   Vector operator*(const VectorBase&, const matrix&);
     545  Vector operator*(const VectorBase&, const Matrix&);
    546546
    547547}}} // of namespace utility, yat, and theplu
Note: See TracChangeset for help on using the changeset viewer.