| SNAP Library 2.0, Developer Reference
    2013-05-13 16:33:57
    SNAP, a general purpose, high performance system for analysis and manipulation of large networks | 
#include <kronecker.h>

| Classes | |
| class | TFEval | 
| Public Member Functions | |
| TKronMaxLL (const PNGraph &GraphPt, const TKronMtx &StartParam) | |
| void | SetPerm (const char &PermId) | 
| void | GradDescent (const int &NIter, const double &LrnRate, const double &MnStep, const double &MxStep, const double &WarmUp, const double &NSamples) | 
| Static Public Member Functions | |
| static void | RoundTheta (const TFltV &ThetaV, TFltV &NewThetaV) | 
| static void | RoundTheta (const TFltV &ThetaV, TKronMtx &Kronecker) | 
| static void | Test () | 
| Private Attributes | |
| THash< TKronMtx, TFEval > | FEvalH | 
| TKroneckerLL | KronLL | 
Definition at line 265 of file kronecker.h.
| TKronMaxLL::TKronMaxLL | ( | const PNGraph & | GraphPt, | 
| const TKronMtx & | StartParam | ||
| ) |  [inline] | 
Definition at line 283 of file kronecker.h.
: KronLL(GraphPt, StartParam) { }
| void TKronMaxLL::GradDescent | ( | const int & | NIter, | 
| const double & | LrnRate, | ||
| const double & | MnStep, | ||
| const double & | MxStep, | ||
| const double & | WarmUp, | ||
| const double & | NSamples | ||
| ) | 
| void TKronMaxLL::RoundTheta | ( | const TFltV & | ThetaV, | 
| TFltV & | NewThetaV | ||
| ) |  [static] | 
Definition at line 2354 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Gen(), TVec< TVal, TSizeTy >::Len(), and TMath::Round().
                                                                 {
  NewThetaV.Gen(ThetaV.Len());
  for (int i = 0; i < ThetaV.Len(); i++) {
    NewThetaV[i] = TMath::Round(ThetaV[i], 3); }
}

| void TKronMaxLL::RoundTheta | ( | const TFltV & | ThetaV, | 
| TKronMtx & | Kronecker | ||
| ) |  [static] | 
Definition at line 2361 of file kronecker.cpp.
References TKronMtx::At(), TKronMtx::GenMtx(), TVec< TVal, TSizeTy >::Len(), and TMath::Round().
                                                                    {
  Kronecker.GenMtx((int)sqrt((double)ThetaV.Len()));
  for (int i = 0; i < ThetaV.Len(); i++) {
    Kronecker.At(i) = TMath::Round(ThetaV[i], 3); }
}

| void TKronMaxLL::SetPerm | ( | const char & | PermId | ) | 
Definition at line 2297 of file kronecker.cpp.
References FailR, KronLL, TKroneckerLL::SetDegPerm(), TKroneckerLL::SetOrderPerm(), and TKroneckerLL::SetRndPerm().
Referenced by Test().
                                           {
  if (PermId == 'o') KronLL.SetOrderPerm();
  else if (PermId == 'd') KronLL.SetDegPerm();
  else if (PermId == 'r') KronLL.SetRndPerm();
  else FailR("Unknown permutation type (o,d,r)");
}


| void TKronMaxLL::Test | ( | ) |  [static] | 
Definition at line 2367 of file kronecker.cpp.
References TKronMtx::GenFastKronecker(), TKronMtx::GetMtx(), TVec< TFlt >::GetV(), TKronMtx::PutRndSeed(), and SetPerm().
                      {
  TKronMtx::PutRndSeed(1);
  TKronMtx KronParam = TKronMtx::GetMtx("0.8 0.7; 0.6 0.5");
  PNGraph Graph  = TKronMtx::GenFastKronecker(KronParam, 8, true, 1);
  TKronMaxLL KronMaxLL(Graph, TFltV::GetV(0.9, 0.7, 0.5, 0.3));
  KronMaxLL.SetPerm('d');
  //KronMaxLL.MaximizeLL(10000, 50000);
  /*TKroneckerLL KronLL(Graph, *TKronMtx::GetMtx("0.9 0.7; 0.5 0.3"));
  KronLL.SetDegPerm();
  KronLL.GradDescent(0.005/double(Graph->GetNodes()));*/
}

| THash<TKronMtx, TFEval> TKronMaxLL::FEvalH  [private] | 
Definition at line 280 of file kronecker.h.
| TKroneckerLL TKronMaxLL::KronLL  [private] | 
Definition at line 281 of file kronecker.h.
Referenced by SetPerm().