00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MATRIXLINKER_H
00021 #define MATRIXLINKER_H
00022
00026 #include "types.h"
00027 #include "linker.h"
00028
00029 namespace nnfw {
00030
00056 class NNFW_API MatrixLinker : public Linker {
00057 public:
00060
00063 MatrixLinker( Cluster* from, Cluster* to, const char* name = "unnamed" );
00064
00067 MatrixLinker( PropertySettings& prop );
00068
00071 virtual ~MatrixLinker();
00072
00074
00076
00079 u_int rows() {
00080 return nrows;
00081 };
00082
00085 u_int cols() {
00086 return ncols;
00087 };
00088
00091 u_int size() const;
00092
00095 virtual void randomize( Real min, Real max );
00096
00099 virtual void setWeight( u_int from, u_int to, Real weight );
00100
00103 virtual Real getWeight( u_int from, u_int to );
00104
00107 RealMat& matrix() {
00108 return w;
00109 };
00110
00112 const RealMat& matrix() const {
00113 return w;
00114 };
00115
00118 Variant matrixP() {
00119 return Variant( &w );
00120 };
00121
00124 void setMatrix( const RealMat& mat );
00125
00128 bool setMatrix( const Variant& v );
00129
00131
00132 private:
00134 u_int nrows, ncols;
00136 RealMat w;
00137 };
00138
00139 }
00140
00141 #endif