Go to the documentation of this file.
43 static const QString
infinity =
"\u221E" ;
45 static const QString
infinity = QString(
"\xE2\x88\x9E") ;
66 cell=
new (nothrow) qreal [m_cols=cols];
68 for (
int i=0;i<m_cols; i++) {
79 cell=
new (nothrow) qreal[m_cols=a.
m_cols];
82 for (
int i=0;i<m_cols; i++) {
94 qreal& operator [] (
const int k) {
return cell[k]; }
108 cell=
new (nothrow) qreal[m_cols=cols];
110 for (
int i=0;i<m_cols; i++) {
130 Matrix (
int rowDim=0,
int colDim=0) ;
138 void resize (
const int m,
const int n) ;
140 qreal item(
int r,
int c ) ;
142 void setItem(
const int r,
const int c,
const qreal elem );
145 qreal operator () (
const int r,
const int c) {
return row[r].column(c); }
147 MatrixRow& operator [] (
const int &r) {
return row[r]; }
149 void clearItem(
int r,
int c ) ;
155 int size() {
return m_rows * m_cols; }
157 void findMinMaxValues(qreal&min, qreal&max,
bool &hasRealNumbers);
159 void NeighboursNearestFarthest(qreal&min,qreal&max,
160 int &imin,
int &jmin,
161 int &imax,
int &jmax);
163 void deleteRowColumn(
int i);
165 void identityMatrix (
int dim);
167 void zeroMatrix (
const int m,
const int n);
169 void fillMatrix (qreal value );
171 Matrix& subtractFromI () ;
178 void operator +=(
Matrix & b);
185 void operator *=(
Matrix & b);
187 void product(
Matrix &A,
Matrix & B,
bool symmetry=
false) ;
191 void swapRows(
int rowA,
int rowB);
193 void multiplyScalar(
const qreal &f);
194 void multiplyRow(
int row, qreal value);
196 void productByVector (
199 const bool &leftMultiply=
false);
201 Matrix & pow (
int n,
bool symmetry=
false) ;
204 qreal distanceManhattan(
208 qreal distanceEuclidean(
212 void powerIteration (
219 const qreal eps,
const int &maxIter);
223 Matrix& laplacianMatrix();
227 Matrix& cocitationMatrix();
234 bool solve(qreal b[]);
236 bool ludcmp (
Matrix &a,
const int &n,
int indx[], qreal &d ) ;
238 void lubksb (
Matrix &a,
const int &n,
int indx[], qreal b[]);
241 Matrix& distancesMatrix(
const int &metric,
242 const QString varLocation,
243 const bool &diagonal,
244 const bool &considerWeights);
248 const QString varLocation=
"Rows",
249 const bool &diagonal=
false,
250 const bool &considerWeights=
true);
254 const QString &varLocation=
"Rows",
255 const bool &diagonal=
false);
259 bool printHTMLTable(QTextStream& os,
260 const bool markDiag=
false,
261 const bool &plain=
false,
262 const bool &printInfinity=
true);
263 bool printMatrixConsole(
bool debug=
true);
static const int METRIC_PEARSON_COEFFICIENT
Definition: matrix.h:56
static const int METRIC_JACCARD_INDEX
Definition: matrix.h:51
int m_rows
Definition: matrix.h:269
static const int METRIC_COSINE_SIMILARITY
Definition: matrix.h:53
int size()
Definition: matrix.h:155
MatrixRow(int cols=0)
Definition: matrix.h:65
static const int METRIC_MANHATTAN_DISTANCE
Definition: matrix.h:55
int cols()
Definition: matrix.h:151
MatrixRow * row
Definition: matrix.h:268
static const int METRIC_CHEBYSHEV_MAXIMUM
Definition: matrix.h:57
static const int METRIC_EUCLIDEAN_DISTANCE
Definition: matrix.h:54
int m_cols
Definition: matrix.h:121
int rows()
Definition: matrix.h:153
~MatrixRow()
Definition: matrix.h:73
void resize(int cols)
Definition: matrix.h:106
qreal column(int c) const
Definition: matrix.h:89
qreal * cell
Definition: matrix.h:120
void clearColumn(int index)
Definition: matrix.h:101
int m_cols
Definition: matrix.h:270
static const int METRIC_SIMPLE_MATCHING
Definition: matrix.h:50
static const int METRIC_NONE
Definition: matrix.h:49
void setColumn(int index, qreal elem)
Definition: matrix.h:97
static const int METRIC_HAMMING_DISTANCE
Definition: matrix.h:52
QTextStream & operator<<(QTextStream &os, Matrix &m)
Prints matrix m to given textstream.
Definition: matrix.cpp:2382
void setSize(int cols)
Definition: matrix.h:115
static const QString infinity
Definition: matrix.h:45