SNAP Library 2.0, User Reference  2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFullColMatrix Class Reference

#include <linalg.h>

Inherits TMatrix.

List of all members.

Public Member Functions

 TFullColMatrix ()
 TFullColMatrix (const TStr &MatlabMatrixFNm)
void Save (TSOut &SOut)
void Load (TSIn &SIn)

Public Attributes

int RowN
int ColN
TVec< TFltVColV

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

Detailed Description

Definition at line 126 of file linalg.h.


Constructor & Destructor Documentation

Definition at line 146 of file linalg.h.

: TMatrix() {}
TFullColMatrix::TFullColMatrix ( const TStr MatlabMatrixFNm)

Definition at line 125 of file linalg.cpp.

                                                         : 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));
    }
}

Member Function Documentation

void TFullColMatrix::Load ( TSIn SIn) [inline]

Definition at line 151 of file linalg.h.

{ ColV.Load(SIn); }
int TFullColMatrix::PGetCols ( ) const [inline, protected, virtual]

Implements TMatrix.

Definition at line 143 of file linalg.h.

{ return ColN; }
int TFullColMatrix::PGetRows ( ) const [inline, protected, virtual]

Implements TMatrix.

Definition at line 142 of file linalg.h.

{ return RowN; }
void TFullColMatrix::PMultiply ( const TFltVV B,
int  ColId,
TFltV Result 
) const [protected, virtual]

Implements TMatrix.

Definition at line 147 of file linalg.cpp.

                                                                              {
    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.

                                                                    {
    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.

                                                                               {
    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.

                                                                     {
    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 150 of file linalg.h.

{ ColV.Save(SOut); }

Member Data Documentation

Definition at line 129 of file linalg.h.

Definition at line 131 of file linalg.h.

Definition at line 129 of file linalg.h.


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