Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3327 in orxonox.OLD for orxonox/branches/parenting/src/matrix.cc


Ignore:
Timestamp:
Jan 3, 2005, 6:57:01 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/parenting: added Class UPointCurve. It is so Bad, I can't even believe it myself… you can see the behaviour of this curve in this revision. have fun

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/matrix.cc

    r3326 r3327  
    2121#include "matrix.h"
    2222
    23 inline Matrix::Matrix (size_t row, size_t col)
     23Matrix::Matrix (size_t row, size_t col)
    2424{
    2525  _m = new base_mat( row, col, 0);
     
    2727
    2828// copy constructor
    29 inline Matrix::Matrix (const Matrix& m)
     29Matrix::Matrix (const Matrix& m)
    3030{
    3131    _m = m._m;
     
    3434
    3535// Internal copy constructor
    36 inline void Matrix::clone ()
     36void Matrix::clone ()
    3737{
    3838    _m->Refcnt--;
     
    4141
    4242// destructor
    43 inline Matrix::~Matrix ()
     43Matrix::~Matrix ()
    4444{
    4545   if (--_m->Refcnt == 0) delete _m;
     
    4747
    4848// assignment operator
    49 inline Matrix& Matrix::operator = (const Matrix& m)
     49Matrix& Matrix::operator = (const Matrix& m)
    5050{
    5151    m._m->Refcnt++;
     
    5656
    5757//  reallocation method
    58 inline void Matrix::realloc (size_t row, size_t col)
     58void Matrix::realloc (size_t row, size_t col)
    5959{
    6060   if (row == _m->RowSiz && col == _m->ColSiz)
     
    8080
    8181// public method for resizing Matrix
    82 inline void Matrix::SetSize (size_t row, size_t col)
     82void Matrix::SetSize (size_t row, size_t col)
    8383{
    8484   size_t i,j;
     
    101101
    102102// subscript operator to get/set individual elements
    103 inline float& Matrix::operator () (size_t row, size_t col)
     103float& Matrix::operator () (size_t row, size_t col)
    104104{
    105105   if (row >= _m->Row || col >= _m->Col)
     
    110110
    111111// subscript operator to get/set individual elements
    112 inline float Matrix::operator () (size_t row, size_t col) const
     112float Matrix::operator () (size_t row, size_t col) const
    113113{
    114114   if (row >= _m->Row || col >= _m->Col)
     
    118118
    119119// input stream function
    120 inline istream& operator >> (istream& istrm, Matrix& m)
     120istream& operator >> (istream& istrm, Matrix& m)
    121121{
    122122   for (size_t i=0; i < m.RowNo(); i++)
     
    131131
    132132// output stream function
    133 inline ostream& operator << (ostream& ostrm, const Matrix& m)
     133ostream& operator << (ostream& ostrm, const Matrix& m)
    134134{
    135135   for (size_t i=0; i < m.RowNo(); i++)
     
    147147
    148148// logical equal-to operator
    149 inline bool operator == (const Matrix& m1, const Matrix& m2)
     149bool operator == (const Matrix& m1, const Matrix& m2)
    150150{
    151151   if (m1.RowNo() != m2.RowNo() || m1.ColNo() != m2.ColNo())
     
    161161
    162162// logical no-equal-to operator
    163 inline bool operator != (const Matrix& m1, const Matrix& m2)
     163bool operator != (const Matrix& m1, const Matrix& m2)
    164164{
    165165    return (m1 == m2) ? false : true;
     
    167167
    168168// combined addition and assignment operator
    169 inline Matrix& Matrix::operator += (const Matrix& m)
     169Matrix& Matrix::operator += (const Matrix& m)
    170170{
    171171   if (_m->Row != m._m->Row || _m->Col != m._m->Col)
     
    179179
    180180// combined subtraction and assignment operator
    181 inline Matrix& Matrix::operator -= (const Matrix& m)
     181Matrix& Matrix::operator -= (const Matrix& m)
    182182{
    183183   if (_m->Row != m._m->Row || _m->Col != m._m->Col)
     
    191191
    192192// combined scalar multiplication and assignment operator
    193  inline Matrix&
     193 Matrix&
    194194Matrix::operator *= (const float& c)
    195195{
     
    202202
    203203// combined Matrix multiplication and assignment operator
    204  inline Matrix&
     204 Matrix&
    205205Matrix::operator *= (const Matrix& m)
    206206{
     
    223223
    224224// combined scalar division and assignment operator
    225  inline Matrix&
     225 Matrix&
    226226Matrix::operator /= (const float& c)
    227227{
     
    235235
    236236// combined power and assignment operator
    237  inline Matrix&
     237 Matrix&
    238238Matrix::operator ^= (const size_t& pow)
    239239{
     
    247247
    248248// unary negation operator
    249  inline Matrix
     249 Matrix
    250250Matrix::operator - ()
    251251{
     
    260260
    261261// binary addition operator
    262  inline Matrix
     262 Matrix
    263263operator + (const Matrix& m1, const Matrix& m2)
    264264{
     
    269269
    270270// binary subtraction operator
    271  inline Matrix
     271 Matrix
    272272operator - (const Matrix& m1, const Matrix& m2)
    273273{
     
    278278
    279279// binary scalar multiplication operator
    280  inline Matrix
     280 Matrix
    281281operator * (const Matrix& m, const float& no)
    282282{
     
    288288
    289289// binary scalar multiplication operator
    290  inline Matrix
     290 Matrix
    291291operator * (const float& no, const Matrix& m)
    292292{
     
    295295
    296296// binary Matrix multiplication operator
    297  inline Matrix
     297 Matrix
    298298operator * (const Matrix& m1, const Matrix& m2)
    299299{
     
    304304
    305305// binary scalar division operator
    306  inline Matrix
     306 Matrix
    307307operator / (const Matrix& m, const float& no)
    308308{
     
    312312
    313313// binary scalar division operator
    314  inline Matrix
     314 Matrix
    315315operator / (const float& no, const Matrix& m)
    316316{
     
    319319
    320320// binary Matrix division operator
    321  inline Matrix
     321 Matrix
    322322operator / (const Matrix& m1, const Matrix& m2)
    323323{
     
    326326
    327327// binary power operator
    328  inline Matrix
     328 Matrix
    329329operator ^ (const Matrix& m, const size_t& pow)
    330330{
     
    335335
    336336// unary transpose operator
    337  inline Matrix
     337 Matrix
    338338operator ~ (const Matrix& m)
    339339{
     
    350350
    351351// unary inversion operator
    352  inline Matrix
     352 Matrix
    353353operator ! (const Matrix m)
    354354{
     
    358358
    359359// inversion function
    360  inline Matrix
     360 Matrix
    361361Matrix::Inv ()
    362362{
     
    405405
    406406// solve simultaneous equation
    407  inline Matrix
     407 Matrix
    408408Matrix::Solve (const Matrix& v) const
    409409{
     
    451451
    452452// set zero to all elements of this Matrix
    453  inline void
     453 void
    454454Matrix::Null (const size_t& row, const size_t& col)
    455455{
     
    467467
    468468// set zero to all elements of this Matrix
    469  inline void
     469 void
    470470Matrix::Null()
    471471{
     
    478478
    479479// set this Matrix to unity
    480  inline void
     480 void
    481481Matrix::Unit (const size_t& row)
    482482{
     
    494494
    495495// set this Matrix to unity
    496  inline void
     496 void
    497497Matrix::Unit ()
    498498{
     
    508508
    509509// private partial pivoting method
    510  inline int
     510 int
    511511Matrix::pivot (size_t row)
    512512{
     
    534534
    535535// calculate the determinant of a Matrix
    536  inline float
     536 float
    537537Matrix::Det () const
    538538{
     
    565565
    566566// calculate the norm of a Matrix
    567  inline float
     567 float
    568568Matrix::Norm ()
    569569{
     
    579579
    580580// calculate the condition number of a Matrix
    581  inline float
     581 float
    582582Matrix::Cond ()
    583583{
     
    587587
    588588// calculate the cofactor of a Matrix for a given element
    589  inline float
     589 float
    590590Matrix::Cofact (size_t row, size_t col)
    591591{
     
    622622
    623623// calculate adjoin of a Matrix
    624  inline Matrix
     624 Matrix
    625625Matrix::Adj ()
    626626{
     
    637637
    638638// Determine if the Matrix is singular
    639  inline bool
     639 bool
    640640Matrix::IsSingular ()
    641641{
     
    646646
    647647// Determine if the Matrix is diagonal
    648  inline bool
     648 bool
    649649Matrix::IsDiagonal ()
    650650{
     
    659659
    660660// Determine if the Matrix is scalar
    661  inline bool
     661 bool
    662662Matrix::IsScalar ()
    663663{
     
    672672
    673673// Determine if the Matrix is a unit Matrix
    674  inline bool
     674 bool
    675675Matrix::IsUnit ()
    676676{
     
    681681
    682682// Determine if this is a null Matrix
    683  inline bool
     683 bool
    684684Matrix::IsNull ()
    685685{
     
    692692
    693693// Determine if the Matrix is symmetric
    694  inline bool
     694 bool
    695695Matrix::IsSymmetric ()
    696696{
     
    705705           
    706706// Determine if the Matrix is skew-symmetric
    707  inline bool
     707 bool
    708708Matrix::IsSkewSymmetric ()
    709709{
     
    718718   
    719719// Determine if the Matrix is upper triangular
    720  inline bool
     720 bool
    721721Matrix::IsUpperTriangular ()
    722722{
     
    731731
    732732// Determine if the Matrix is lower triangular
    733  inline bool
     733 bool
    734734Matrix::IsLowerTriangular ()
    735735{
Note: See TracChangeset for help on using the changeset viewer.