00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CJNP_EIGENVALDUMP_H_
00021 #define _CJNP_EIGENVALDUMP_H_ 1
00022
00023 #include <string>
00024 #include <stdexcept>
00025 #include "CjNP_LoggableBase.hh"
00026
00027 namespace jmitie {
00028 namespace corelib {
00029 class CjNP_eigenvalDump : public CjNP_LoggableBase {
00030
00031 public:
00032 std::string getName() const { return getName_static(); }
00033 static std::string getName_static() { return "eigenvalDump"; }
00034 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00035 static std::string getProperty_static(const std::string & opt) {
00036 if(opt=="desc") return "Prints the sorted eigenvalues of the adjacency matrix of the topology";
00037 if(opt=="usage") return getProperty_static("desc") + "\nAvailable common logging options:\n" + CjNP_LoggableBase::getProperty_static(opt) + \
00038 "Additionally the following options:\n[count=integer],[prec=integer],(asc|desc),(adj|comb_lap|sign_lap|norm_lap)\nWhere:\n" + \
00039 "[count=integer]\tOutputs only first integer number of eigenvalues\n" + \
00040 "[prec=integer]\tSets the number of decimal places to print when outputting the eigenvalues" + \
00041 "asc|desc\tSorts the eigenvalues in ascending or descending order prior to output.\n" + \
00042 "adj\ttakes the eigenvalue of the adjacency matrix where adj(i,j) is 1.0 if i and j are connected, 0.0 otherwise.\n" + \
00043 "comb_lap\ttakes the eigenvalue of the combinatorial laplacian adjacency matrix where adj(i,j) is -1.0 if i and j are connected, adj(i,i) is the degree of node i, and 0.0 otherwise.\n" + \
00044 "sign_lap\ttakes the eigenvalue of the sign-less combinatorial laplacian adjacency matrix where adj(i,j) is 1.0 if i and j are connected, adj(i,i) is the degree of node i, and 0.0 otherwise.\n" + \
00045 "norm_lap\ttakes the eigenvalue of the normalised laplacian adjacency matrix where adj(i,j) is -( (deg(i)*deg(j))^-0.5 ) if i and j are connected, adj(i,i) is 1.0, and 0.0 otherwise.\n";
00046
00047 throw std::invalid_argument("CjNP_adjLDump::getProperty_static(" + opt + "): Unknown property requested.");
00048 }
00049
00050 CjNP_eigenvalDump(const std::string & args, const ctor_va_t & var_arg );
00051 virtual void performAction( const action_va_t & opts );
00052
00053 ~CjNP_eigenvalDump();
00054
00055 protected:
00056 enum mat_preproc_t { NONE, ADJ, COMBLAP, NOSIGNLAP, NORMLAP };
00057 mat_preproc_t m_mat_type;
00058 unsigned int m_count;
00059 unsigned int m_prec;
00060 bool m_desc_asc;
00061
00062 };
00063 }
00064 }
00065
00066 #endif // _CJNP_EIGENVALDUMP_H_