SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMatrix Class Referenceabstract

#include <linalg.h>

Inherited by TFullColMatrix, TNGraphMtx, TSparseColMatrix, TSparseRowMatrix, and TUNGraphMtx.

Public Member Functions

 TMatrix ()
 
virtual ~TMatrix ()
 
void Multiply (const TFltVV &B, int ColId, TFltV &Result) const
 
void Multiply (const TFltV &Vec, TFltV &Result) const
 
void MultiplyT (const TFltVV &B, int ColId, TFltV &Result) const
 
void MultiplyT (const TFltV &Vec, TFltV &Result) const
 
int GetRows () const
 
int GetCols () const
 
void Transpose ()
 

Protected Member Functions

virtual void PMultiply (const TFltVV &B, int ColId, TFltV &Result) const =0
 
virtual void PMultiply (const TFltV &Vec, TFltV &Result) const =0
 
virtual void PMultiplyT (const TFltVV &B, int ColId, TFltV &Result) const =0
 
virtual void PMultiplyT (const TFltV &Vec, TFltV &Result) const =0
 
virtual int PGetRows () const =0
 
virtual int PGetCols () const =0
 

Private Attributes

bool Transposed
 

Detailed Description

Definition at line 8 of file linalg.h.

Constructor & Destructor Documentation

TMatrix::TMatrix ( )
inline

Definition at line 20 of file linalg.h.

20 : Transposed(false) {}
bool Transposed
Definition: linalg.h:10
virtual TMatrix::~TMatrix ( )
inlinevirtual

Definition at line 21 of file linalg.h.

21 { }

Member Function Documentation

int TMatrix::GetCols ( ) const
inline

Definition at line 47 of file linalg.h.

47 { return Transposed ? PGetRows() : PGetCols(); }
virtual int PGetRows() const =0
virtual int PGetCols() const =0
bool Transposed
Definition: linalg.h:10
int TMatrix::GetRows ( ) const
inline

Definition at line 45 of file linalg.h.

45 { return Transposed ? PGetCols() : PGetRows(); }
virtual int PGetRows() const =0
virtual int PGetCols() const =0
bool Transposed
Definition: linalg.h:10
void TMatrix::Multiply ( const TFltVV B,
int  ColId,
TFltV Result 
) const
inline

Definition at line 24 of file linalg.h.

24  {
25  if (Transposed) { PMultiplyT(B, ColId, Result); }
26  else { PMultiply(B, ColId, Result); }
27  }
virtual void PMultiplyT(const TFltVV &B, int ColId, TFltV &Result) const =0
virtual void PMultiply(const TFltVV &B, int ColId, TFltV &Result) const =0
bool Transposed
Definition: linalg.h:10
void TMatrix::Multiply ( const TFltV Vec,
TFltV Result 
) const
inline

Definition at line 29 of file linalg.h.

29  {
30  if (Transposed) { PMultiplyT(Vec, Result); }
31  else { PMultiply(Vec, Result); }
32  }
virtual void PMultiplyT(const TFltVV &B, int ColId, TFltV &Result) const =0
virtual void PMultiply(const TFltVV &B, int ColId, TFltV &Result) const =0
bool Transposed
Definition: linalg.h:10
void TMatrix::MultiplyT ( const TFltVV B,
int  ColId,
TFltV Result 
) const
inline

Definition at line 34 of file linalg.h.

34  {
35  if (Transposed) { PMultiply(B, ColId, Result); }
36  else { PMultiplyT(B, ColId, Result); }
37  }
virtual void PMultiplyT(const TFltVV &B, int ColId, TFltV &Result) const =0
virtual void PMultiply(const TFltVV &B, int ColId, TFltV &Result) const =0
bool Transposed
Definition: linalg.h:10
void TMatrix::MultiplyT ( const TFltV Vec,
TFltV Result 
) const
inline

Definition at line 39 of file linalg.h.

39  {
40  if (Transposed) { PMultiply(Vec, Result); }
41  else { PMultiplyT(Vec, Result); }
42  }
virtual void PMultiplyT(const TFltVV &B, int ColId, TFltV &Result) const =0
virtual void PMultiply(const TFltVV &B, int ColId, TFltV &Result) const =0
bool Transposed
Definition: linalg.h:10
virtual int TMatrix::PGetCols ( ) const
protectedpure virtual
virtual int TMatrix::PGetRows ( ) const
protectedpure virtual
virtual void TMatrix::PMultiply ( const TFltVV B,
int  ColId,
TFltV Result 
) const
protectedpure virtual
virtual void TMatrix::PMultiply ( const TFltV Vec,
TFltV Result 
) const
protectedpure virtual
virtual void TMatrix::PMultiplyT ( const TFltVV B,
int  ColId,
TFltV Result 
) const
protectedpure virtual
virtual void TMatrix::PMultiplyT ( const TFltV Vec,
TFltV Result 
) const
protectedpure virtual
void TMatrix::Transpose ( )
inline

Definition at line 49 of file linalg.h.

49 { Transposed = !Transposed; }
bool Transposed
Definition: linalg.h:10

Member Data Documentation

bool TMatrix::Transposed
private

Definition at line 10 of file linalg.h.


The documentation for this class was generated from the following file: