diff --git a/DbNeuralNet.pro b/DbNeuralNet.pro index 0529f9f..6dfbb50 100644 --- a/DbNeuralNet.pro +++ b/DbNeuralNet.pro @@ -1,35 +1,6 @@ -QT += core -QT -= gui widgets +TEMPLATE = subdirs -DBLIBS += +SUBDIRS += neuralnetdemo \ + neuralnetlib -TARGET = neuralnet - -PROJECT_ROOT = .. - -SOURCES += main.cpp \ - neuron.cpp \ - neurallayer.cpp \ - neuralnet.cpp \ - neuralfactor.cpp \ - debug.cpp - -HEADERS += \ - neuralfactor.h \ - interfaces/ineuronreceptor.h \ - interfaces/ineuronsignal.h \ - interfaces/ineuron.h \ - interfaces/ineurallayer.h \ - interfaces/ineuralnet.h \ - neuron.h \ - neurallayer.h \ - neuralnet.h \ - debug.h - -FORMS += - -RESOURCES += - -TRANSLATIONS += - -include($${PROJECT_ROOT}/app.pri) +neuralnetdemo.depends += neuralnetlib diff --git a/main.cpp b/neuralnetdemo/main.cpp similarity index 100% rename from main.cpp rename to neuralnetdemo/main.cpp diff --git a/neuralnetdemo/neuralnetdemo.pro b/neuralnetdemo/neuralnetdemo.pro new file mode 100644 index 0000000..f547e61 --- /dev/null +++ b/neuralnetdemo/neuralnetdemo.pro @@ -0,0 +1,18 @@ +QT += core +QT -= gui widgets + +DBLIBS += neuralnetlib + +PROJECT_ROOT = ../.. + +SOURCES += main.cpp + +HEADERS += + +FORMS += + +RESOURCES += + +TRANSLATIONS += + +include($${PROJECT_ROOT}/app.pri) diff --git a/debug.cpp b/neuralnetlib/debug.cpp similarity index 100% rename from debug.cpp rename to neuralnetlib/debug.cpp diff --git a/debug.h b/neuralnetlib/debug.h similarity index 57% rename from debug.h rename to neuralnetlib/debug.h index 38aa42e..b2e05ce 100644 --- a/debug.h +++ b/neuralnetlib/debug.h @@ -1,9 +1,6 @@ -#ifndef DEBUG_H -#define DEBUG_H +#pragma once class QString; bool initDebug(); void debug(const QString &line); - -#endif // DEBUG_H diff --git a/interfaces/ineurallayer.h b/neuralnetlib/interfaces/ineurallayer.h similarity index 82% rename from interfaces/ineurallayer.h rename to neuralnetlib/interfaces/ineurallayer.h index 8f944f7..c0255bf 100644 --- a/interfaces/ineurallayer.h +++ b/neuralnetlib/interfaces/ineurallayer.h @@ -1,5 +1,4 @@ -#ifndef INEURALLAYER_H -#define INEURALLAYER_H +#pragma once #include @@ -17,5 +16,3 @@ public: virtual QList &neurons() = 0; virtual const QList &neurons() const = 0; }; - -#endif // INEURALLAYER_H diff --git a/interfaces/ineuralnet.h b/neuralnetlib/interfaces/ineuralnet.h similarity index 87% rename from interfaces/ineuralnet.h rename to neuralnetlib/interfaces/ineuralnet.h index ae11c4c..75d3ca5 100644 --- a/interfaces/ineuralnet.h +++ b/neuralnetlib/interfaces/ineuralnet.h @@ -1,5 +1,4 @@ -#ifndef INEURALNET_H -#define INEURALNET_H +#pragma once #include @@ -19,5 +18,3 @@ public: virtual const INeuralLayer *hiddenLayer() const = 0; virtual const INeuralLayer *outputLayer() const = 0; }; - -#endif // INEURALNET_H diff --git a/interfaces/ineuron.h b/neuralnetlib/interfaces/ineuron.h similarity index 89% rename from interfaces/ineuron.h rename to neuralnetlib/interfaces/ineuron.h index ead0a76..6673bf0 100644 --- a/interfaces/ineuron.h +++ b/neuralnetlib/interfaces/ineuron.h @@ -1,5 +1,4 @@ -#ifndef INEURON_H -#define INEURON_H +#pragma once #include "ineuronsignal.h" #include "ineuronreceptor.h" @@ -20,5 +19,3 @@ public: virtual NeuralFactor *bias() = 0; virtual const NeuralFactor *bias() const = 0; }; - -#endif // INEURON_H diff --git a/interfaces/ineuronreceptor.h b/neuralnetlib/interfaces/ineuronreceptor.h similarity index 76% rename from interfaces/ineuronreceptor.h rename to neuralnetlib/interfaces/ineuronreceptor.h index d1a2550..d286e29 100644 --- a/interfaces/ineuronreceptor.h +++ b/neuralnetlib/interfaces/ineuronreceptor.h @@ -1,5 +1,4 @@ -#ifndef INEURONRECEPTOR_H -#define INEURONRECEPTOR_H +#pragma once template class QMap; @@ -12,5 +11,3 @@ public: virtual QMap &input() = 0; virtual const QMap &input() const = 0; }; - -#endif // INEURONRECEPTOR_H diff --git a/interfaces/ineuronsignal.h b/neuralnetlib/interfaces/ineuronsignal.h similarity index 65% rename from interfaces/ineuronsignal.h rename to neuralnetlib/interfaces/ineuronsignal.h index ae188b9..eb494de 100644 --- a/interfaces/ineuronsignal.h +++ b/neuralnetlib/interfaces/ineuronsignal.h @@ -1,5 +1,4 @@ -#ifndef INEURONSIGNAL_H -#define INEURONSIGNAL_H +#pragma once #include @@ -9,5 +8,3 @@ public: virtual qreal output() const = 0; virtual void setOutput(qreal output) = 0; }; - -#endif // INEURONSIGNAL_H diff --git a/neuralfactor.cpp b/neuralnetlib/neuralfactor.cpp similarity index 100% rename from neuralfactor.cpp rename to neuralnetlib/neuralfactor.cpp diff --git a/neuralfactor.h b/neuralnetlib/neuralfactor.h similarity index 90% rename from neuralfactor.h rename to neuralnetlib/neuralfactor.h index 3b2f04b..66e3468 100644 --- a/neuralfactor.h +++ b/neuralnetlib/neuralfactor.h @@ -1,5 +1,4 @@ -#ifndef NEURALFACTOR_H -#define NEURALFACTOR_H +#pragma once #include #include @@ -32,5 +31,3 @@ private: qreal m_weight; qreal m_delta; }; - -#endif // NEURALFACTOR_H diff --git a/neurallayer.cpp b/neuralnetlib/neurallayer.cpp similarity index 100% rename from neurallayer.cpp rename to neuralnetlib/neurallayer.cpp diff --git a/neurallayer.h b/neuralnetlib/neurallayer.h similarity index 89% rename from neurallayer.h rename to neuralnetlib/neurallayer.h index f680c04..efa6fea 100644 --- a/neurallayer.h +++ b/neuralnetlib/neurallayer.h @@ -1,5 +1,4 @@ -#ifndef NEURALLAYER_H -#define NEURALLAYER_H +#pragma once #include #include @@ -29,5 +28,3 @@ private: NeuralNet *m_neuralNet; QList m_neurons; }; - -#endif // NEURALLAYER_H diff --git a/neuralnet.cpp b/neuralnetlib/neuralnet.cpp similarity index 100% rename from neuralnet.cpp rename to neuralnetlib/neuralnet.cpp diff --git a/neuralnet.h b/neuralnetlib/neuralnet.h similarity index 96% rename from neuralnet.h rename to neuralnetlib/neuralnet.h index e9babbb..0c37910 100644 --- a/neuralnet.h +++ b/neuralnetlib/neuralnet.h @@ -1,5 +1,4 @@ -#ifndef NEURALNET_H -#define NEURALNET_H +#pragma once #include @@ -48,5 +47,3 @@ private: INeuralLayer *m_hiddenLayer; INeuralLayer *m_outputLayer; }; - -#endif // NEURALNET_H diff --git a/neuralnetlib/neuralnetlib.pro b/neuralnetlib/neuralnetlib.pro new file mode 100644 index 0000000..6775f62 --- /dev/null +++ b/neuralnetlib/neuralnetlib.pro @@ -0,0 +1,33 @@ +QT += core +QT -= gui widgets + +DBLIBS += + +PROJECT_ROOT = ../.. + +SOURCES += \ + neuron.cpp \ + neurallayer.cpp \ + neuralnet.cpp \ + neuralfactor.cpp \ + debug.cpp + +HEADERS += \ + neuralfactor.h \ + neuron.h \ + neurallayer.h \ + neuralnet.h \ + debug.h \ + interfaces/ineuronreceptor.h \ + interfaces/ineuronsignal.h \ + interfaces/ineuron.h \ + interfaces/ineurallayer.h \ + interfaces/ineuralnet.h + +FORMS += + +RESOURCES += + +TRANSLATIONS += + +include($${PROJECT_ROOT}/lib.pri) diff --git a/neuron.cpp b/neuralnetlib/neuron.cpp similarity index 100% rename from neuron.cpp rename to neuralnetlib/neuron.cpp diff --git a/neuron.h b/neuralnetlib/neuron.h similarity index 96% rename from neuron.h rename to neuralnetlib/neuron.h index d2b271e..0e9789c 100644 --- a/neuron.h +++ b/neuralnetlib/neuron.h @@ -1,5 +1,4 @@ -#ifndef NEURON_H -#define NEURON_H +#pragma once #include #include @@ -55,5 +54,3 @@ private: qreal m_error; NeuralFactor *m_bias; }; - -#endif // NEURON_H