SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <linalg.h>
Public Member Functions | |
TFullColMatrix () | |
TFullColMatrix (const TStr &MatlabMatrixFNm) | |
void | Save (TSOut &SOut) |
void | Load (TSIn &SIn) |
Public Attributes | |
int | RowN |
int | ColN |
TVec< TFltV > | ColV |
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 |
TFullColMatrix::TFullColMatrix | ( | ) | [inline] |
TFullColMatrix::TFullColMatrix | ( | const TStr & | MatlabMatrixFNm | ) |
Definition at line 125 of file linalg.cpp.
References ColN, ColV, TStr::Fmt(), IAssertR, TVec< TVal >::Len(), TLAMisc::LoadMatlabTFltVV(), and RowN.
: TMatrix() { TLAMisc::LoadMatlabTFltVV(MatlabMatrixFNm, ColV); RowN=ColV[0].Len(); ColN=ColV.Len(); for (int i = 0; i < ColN; i++) { IAssertR(ColV[i].Len() == RowN, TStr::Fmt("%d != %d", ColV[i].Len(), RowN)); } }
void TFullColMatrix::Load | ( | TSIn & | SIn | ) | [inline] |
int TFullColMatrix::PGetCols | ( | ) | const [inline, protected, virtual] |
int TFullColMatrix::PGetRows | ( | ) | const [inline, protected, virtual] |
void TFullColMatrix::PMultiply | ( | const TFltVV & | B, |
int | ColId, | ||
TFltV & | Result | ||
) | const [protected, virtual] |
Implements TMatrix.
Definition at line 147 of file linalg.cpp.
References TLinAlg::AddVec(), Assert, ColN, ColV, TVVec< TVal >::GetRows(), TVec< TVal >::Len(), and RowN.
{ Assert(B.GetRows() >= ColN && Result.Len() >= RowN); for (int i = 0; i < RowN; i++) { Result[i] = 0.0; } for (int i = 0; i < ColN; i++) { TLinAlg::AddVec(B(i, ColId), ColV[i], Result, Result); } }
void TFullColMatrix::PMultiply | ( | const TFltV & | Vec, |
TFltV & | Result | ||
) | const [protected, virtual] |
Implements TMatrix.
Definition at line 155 of file linalg.cpp.
References TLinAlg::AddVec(), Assert, ColN, ColV, TVec< TVal >::Len(), and RowN.
{ Assert(Vec.Len() >= ColN && Result.Len() >= RowN); for (int i = 0; i < RowN; i++) { Result[i] = 0.0; } for (int i = 0; i < ColN; i++) { TLinAlg::AddVec(Vec[i], ColV[i], Result, Result); } }
void TFullColMatrix::PMultiplyT | ( | const TFltVV & | B, |
int | ColId, | ||
TFltV & | Result | ||
) | const [protected, virtual] |
Implements TMatrix.
Definition at line 133 of file linalg.cpp.
References Assert, ColN, ColV, TLinAlg::DotProduct(), TVVec< TVal >::GetRows(), TVec< TVal >::Len(), and RowN.
{ Assert(B.GetRows() >= RowN && Result.Len() >= ColN); for (int i = 0; i < ColN; i++) { Result[i] = TLinAlg::DotProduct(B, ColId, ColV[i]); } }
void TFullColMatrix::PMultiplyT | ( | const TFltV & | Vec, |
TFltV & | Result | ||
) | const [protected, virtual] |
Implements TMatrix.
Definition at line 140 of file linalg.cpp.
References Assert, ColN, ColV, TLinAlg::DotProduct(), TVec< TVal >::Len(), and RowN.
{ Assert(Vec.Len() >= RowN && Result.Len() >= ColN); for (int i = 0; i < ColN; i++) { Result[i] = TLinAlg::DotProduct(Vec, ColV[i]); } }
void TFullColMatrix::Save | ( | TSOut & | SOut | ) | [inline] |
Definition at line 129 of file linalg.h.
Referenced by PGetCols(), PMultiply(), PMultiplyT(), and TFullColMatrix().
Definition at line 131 of file linalg.h.
Referenced by Load(), PMultiply(), PMultiplyT(), Save(), and TFullColMatrix().
Definition at line 129 of file linalg.h.
Referenced by PGetRows(), PMultiply(), PMultiplyT(), and TFullColMatrix().