|
SNAP Library , User Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <linalg.h>
Inherits TMatrix.
Public Member Functions | |
| TSparseColMatrix () | |
| TSparseColMatrix (TVec< TIntFltKdV > _ColSpVV) | |
| TSparseColMatrix (TVec< TIntFltKdV > _ColSpVV, const int &_RowN, const int &_ColN) | |
| void | Save (TSOut &SOut) |
| void | Load (TSIn &SIn) |
Public Attributes | |
| int | RowN |
| int | ColN |
| TVec< TIntFltKdV > | ColSpVV |
Protected Member Functions | |
| virtual void | PMultiply (const TFltVV &B, int ColId, TFltV &Result) const |
| virtual void | PMultiply (const TFltV &Vec, TFltV &Result) const |
| virtual void | PMultiplyT (const TFltVV &B, int ColId, TFltV &Result) const |
| virtual void | PMultiplyT (const TFltV &Vec, TFltV &Result) const |
| int | PGetRows () const |
| int | PGetCols () const |
| TSparseColMatrix::TSparseColMatrix | ( | ) | [inline] |
| TSparseColMatrix::TSparseColMatrix | ( | TVec< TIntFltKdV > | _ColSpVV | ) | [inline] |
| TSparseColMatrix::TSparseColMatrix | ( | TVec< TIntFltKdV > | _ColSpVV, |
| const int & | _RowN, | ||
| const int & | _ColN | ||
| ) | [inline] |
| void TSparseColMatrix::Load | ( | TSIn & | SIn | ) | [inline] |
| int TSparseColMatrix::PGetCols | ( | ) | const [inline, protected, virtual] |
| int TSparseColMatrix::PGetRows | ( | ) | const [inline, protected, virtual] |
| void TSparseColMatrix::PMultiply | ( | const TFltVV & | B, |
| int | ColId, | ||
| TFltV & | Result | ||
| ) | const [protected, virtual] |
Implements TMatrix.
Definition at line 3 of file linalg.cpp.
{
Assert(B.GetRows() >= ColN && Result.Len() >= RowN);
int i, j; TFlt *ResV = Result.BegI();
for (i = 0; i < RowN; i++) ResV[i] = 0.0;
for (j = 0; j < ColN; j++) {
const TIntFltKdV& ColV = ColSpVV[j]; int len = ColV.Len();
for (i = 0; i < len; i++) {
ResV[ColV[i].Key] += ColV[i].Dat * B(j,ColId);
}
}
}
| void TSparseColMatrix::PMultiply | ( | const TFltV & | Vec, |
| TFltV & | Result | ||
| ) | const [protected, virtual] |
Implements TMatrix.
Definition at line 15 of file linalg.cpp.
| void TSparseColMatrix::PMultiplyT | ( | const TFltVV & | B, |
| int | ColId, | ||
| TFltV & | Result | ||
| ) | const [protected, virtual] |
Implements TMatrix.
Definition at line 27 of file linalg.cpp.
| void TSparseColMatrix::PMultiplyT | ( | const TFltV & | Vec, |
| TFltV & | Result | ||
| ) | const [protected, virtual] |
Implements TMatrix.
Definition at line 39 of file linalg.cpp.
| void TSparseColMatrix::Save | ( | TSOut & | SOut | ) | [inline] |