00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef QMATRIX_H
00022 #define QMATRIX_H
00023
00024 #ifndef QVECTOR_H
00025 #include "qvector.h"
00026 #endif
00027
00028 class QuickMatrix {
00029 public :
00030 QuickMatrix(CUI m_in, CUI n_in);
00031 QuickMatrix(CUI m_in);
00032 QuickMatrix(const QuickMatrix *old);
00033 ~QuickMatrix();
00034
00035
00036
00037
00038 double at(CUI m_a, CUI n_a) const;
00039 bool atPut(CUI m_a, CUI n_a, const double val);
00040 bool atAdd(CUI m_a, CUI n_a, const double val);
00041
00042 bool isSquare() const;
00043
00044 double *&operator[]( const int i ) { return values[i]; }
00045 const double *operator[]( const int i ) const { return values[i]; }
00046
00047 unsigned int size_m() const;
00048 unsigned int size_n() const;
00049
00050
00051
00052
00053 bool scaleRow(CUI m_a, const double scalor);
00054
00055 bool addRowToRow(CUI m_a, CUI m_b);
00056
00057 bool scaleAndAdd(CUI m_a, CUI m_b, const double scalor);
00058 bool partialScaleAndAdd(CUI m_a, CUI m_b, const double scalor);
00059 bool swapRows(CUI m_a, CUI m_b);
00060
00061
00062
00063 double multstep(CUI row, CUI pos, CUI col) const;
00064 double multRowCol(CUI row, CUI col, CUI lim) const;
00065
00066 QuickMatrix *transposeSquare() const;
00067 QuickVector *transposeMult(const QuickVector *operandvec) const;
00068
00069
00070 void fillWithRandom();
00071 void fillWithZero();
00072 double rowsum(CUI m);
00073 double absrowsum(CUI m);
00074 QuickVector *normalizeRows();
00075
00076
00077 QuickMatrix *operator +=(const QuickMatrix *othermat);
00078 QuickMatrix *operator *=(const double y);
00079 QuickMatrix *operator =(const double y);
00080 QuickMatrix *operator =(const QuickMatrix *oldmat);
00081 QuickVector *operator *(const QuickVector *operandvec) const;
00082 QuickMatrix *operator *(const QuickMatrix *operandmat) const;
00083
00084
00085 void dumpToAux() const;
00086
00087 private :
00088
00089 QuickMatrix() {};
00090
00091 void allocator();
00092
00093 unsigned int m, n;
00094 double **values;
00095 };
00096
00097 #endif