summaryrefslogtreecommitdiff
path: root/src/CuTNetLib/cuCompDisc.h
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2014-04-14 11:15:21 +0800
committerJoe Zhao <ztuowen@gmail.com>2014-04-14 11:15:21 +0800
commit0653afe62c109f333677f9fd90d19d4727e7cca5 (patch)
treecb9398f27458348c9f1b43fb1a734ded16a5507a /src/CuTNetLib/cuCompDisc.h
parent094828d59df3931dfced69c59cbb538d6b0f1d99 (diff)
downloadtnet-0653afe62c109f333677f9fd90d19d4727e7cca5.tar.gz
tnet-0653afe62c109f333677f9fd90d19d4727e7cca5.tar.bz2
tnet-0653afe62c109f333677f9fd90d19d4727e7cca5.zip
Supporting const rev.
Diffstat (limited to 'src/CuTNetLib/cuCompDisc.h')
-rw-r--r--src/CuTNetLib/cuCompDisc.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/CuTNetLib/cuCompDisc.h b/src/CuTNetLib/cuCompDisc.h
index 5b3232e..937b785 100644
--- a/src/CuTNetLib/cuCompDisc.h
+++ b/src/CuTNetLib/cuCompDisc.h
@@ -110,12 +110,12 @@ namespace TNet {
void ReadFromStream(std::istream& rIn);
void WriteToStream(std::ostream& rOut);
- int GetInSect()
+ int GetInSect() const
{
return inID.size();
}
- int GetOutSect()
+ int GetOutSect() const
{
return outID.size();
}
@@ -139,31 +139,31 @@ namespace TNet {
}
/// IO Data getters
- CuMatrix<BaseFloat>& GetInput(int pos=0)
+ const CuMatrix<BaseFloat>& GetInput(int pos=0)
{
if (preComp!=NULL)
return preComp->GetOutput(pos);
return *mpInput;
}
- CuMatrix<BaseFloat>& GetOutput(int pos=0)
+ const CuMatrix<BaseFloat>& GetOutput(int pos=0)
{
CuComponent* pComp=FindOutput(pos);
return pComp->GetOutput(pos);
}
- CuMatrix<BaseFloat>& GetErrorInput(int pos=0)
+ const CuMatrix<BaseFloat>& GetErrorInput(int pos=0)
{
if (nxtComp!=NULL)
return nxtComp->GetErrorOutput(pos);
return *mpErrorInput;
}
- CuMatrix<BaseFloat>& GetErrorOutput(int pos=0)
+ const CuMatrix<BaseFloat>& GetErrorOutput(int pos=0)
{
CuComponent* pComp=FindInput(pos);
return pComp->GetErrorOutput(pos);
}
/// Set input vector (bind with the preceding NetworkComponent)
- void SetInput(CuMatrix<BaseFloat>& rInput,int pos=0)
+ void SetInput(const CuMatrix<BaseFloat>& rInput,int pos=0)
{
if (pos==0)
mpInput=&rInput;
@@ -171,7 +171,7 @@ namespace TNet {
pComp->SetInput(rInput,pos);
}
/// Set error input vector (bind with the following NetworkComponent)
- void SetErrorInput(CuMatrix<BaseFloat>& rErrorInput,int pos=0)
+ void SetErrorInput(const CuMatrix<BaseFloat>& rErrorInput,int pos=0)
{
if (pos==0)
mpErrorInput=&rErrorInput;
@@ -238,8 +238,8 @@ namespace TNet {
void ReadFromStream(std::istream& rIn);
void WriteToStream(std::ostream& rOut);
- void PropagateF(CuMatrix<BaseFloat>& X, CuMatrix<BaseFloat>& Y);
- void BackpropagateF(CuMatrix<BaseFloat>& X, CuMatrix<BaseFloat>& Y);
+ void PropagateF(const CuMatrix<BaseFloat>& X, CuMatrix<BaseFloat>& Y);
+ void BackpropagateF(const CuMatrix<BaseFloat>& X, CuMatrix<BaseFloat>& Y);
protected: