- fixed creation and deletion of stack and layers
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@652 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -298,8 +298,6 @@ MainComponent::MainComponent ()
|
|||||||
|
|
||||||
|
|
||||||
//[UserPreSize]
|
//[UserPreSize]
|
||||||
m_rbmSelect->addItem(String(0), 1);
|
|
||||||
m_rbmSelect->setSelectedId(1, dontSendNotification);
|
|
||||||
m_progressBarSlider->setValue(100);
|
m_progressBarSlider->setValue(100);
|
||||||
//[/UserPreSize]
|
//[/UserPreSize]
|
||||||
|
|
||||||
@@ -513,13 +511,16 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
else if (buttonThatWasClicked == createButton)
|
else if (buttonThatWasClicked == createButton)
|
||||||
{
|
{
|
||||||
//[UserButtonCode_createButton] -- add your button handler code here..
|
//[UserButtonCode_createButton] -- add your button handler code here..
|
||||||
|
int next_index = m_rbmSelect->getNumItems();
|
||||||
int numVisX = numVisibleLabel->getText().getIntValue();
|
int numVisX = numVisibleLabel->getText().getIntValue();
|
||||||
int numVisY = numVisibleYLabel->getText().getIntValue();
|
int numVisY = numVisibleYLabel->getText().getIntValue();
|
||||||
int numHid = numHiddenLabel->getText().getIntValue();
|
int numHid = numHiddenLabel->getText().getIntValue();
|
||||||
m_stack = new Stack(std::string(projectNameLabel->getText().getCharPointer()));
|
if (!m_stack)
|
||||||
m_stack->addLayer(onConstruct("Layer", 0, numVisX, numVisY, numHid));
|
{
|
||||||
m_rbmSelect->clear(dontSendNotification);
|
m_stack = new Stack(std::string(projectNameLabel->getText().getCharPointer()));
|
||||||
m_rbmSelect->addItem(String(0), 0+1);
|
}
|
||||||
|
m_stack->addLayer(onConstruct("Layer", next_index, numVisX, numVisY, numHid));
|
||||||
|
m_rbmSelect->addItem(String(next_index), next_index+1);
|
||||||
m_rbmSelect->setSelectedId(1, sendNotification);
|
m_rbmSelect->setSelectedId(1, sendNotification);
|
||||||
// addTraining(arma::zeros(1, numVisX*numVisY));
|
// addTraining(arma::zeros(1, numVisX*numVisY));
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -28,7 +28,15 @@ Stack::Stack(const Stack& orig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Stack::~Stack()
|
Stack::~Stack()
|
||||||
{ }
|
{
|
||||||
|
Layer *pLayer = m_pLayers;
|
||||||
|
while(pLayer)
|
||||||
|
{
|
||||||
|
Layer *pNextLayer = pLayer->next;
|
||||||
|
delete pLayer;
|
||||||
|
pLayer = pNextLayer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size_t Stack::numLayers()
|
size_t Stack::numLayers()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user