Skip to content
Snippets Groups Projects
Commit 9479e6a1 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Fixed bugs after changing kinds of types from 4-bytes to *_4neuro

parent d3744eba
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ module connection_m
class(neuron_t), pointer, intent(in) :: output_neuron
real(kind=real_4neuro) :: weight
type(connection_t), pointer :: new_obj
integer(kind=integer_4neuro) :: values(8) !< values(8) is used as seed
integer(kind=4) :: values(8) !< values(8) is used as seed
#ifdef TIME_PROFILING
real :: start_time
......@@ -251,7 +251,7 @@ module connection_m
!! @return Weight of the connection (type real)
function get_weight_impl(this) result (weight)
class(connection_t), intent(in) :: this
real :: weight
real(kind=real_4neuro) :: weight
#ifdef TIME_PROFILING
real :: start_time
call time_profiling_start(start_time)
......@@ -357,7 +357,7 @@ module connection_m
class(neuron_t), pointer, intent(in) :: output_neuron
real(kind=real_4neuro) :: weight
type(interval_connection_t), pointer :: new_obj
integer(kind=integer_4neuro) :: values(8)
integer(kind=4) :: values(8)
#ifdef TIME_PROFILING
real :: start_time
call time_profiling_start(start_time)
......
......@@ -26,7 +26,7 @@ setup
n1_p => mock_neuron_t()
n2_p => mock_neuron_t()
write(*,*) 'Creating an instance of the class interval_connection_t...'
con => connection_t(n1_p, n2_p, 5.25)
con => connection_t(n1_p, n2_p, real(5.25, real_4neuro))
nullify(dummy_p)
write(*,*) 'Ready for test.'
end setup
......@@ -57,7 +57,7 @@ test getters_setters
! Test of get_weight
assert_real_equal(con%get_weight(), 5.25e+0)
! Test of adjust_weight
call con%adjust_weight(1.0)
call con%adjust_weight(real(1.0, real_4neuro))
assert_real_equal(con%get_weight(), 6.25e+0)
write(*,*) '... finished +++'
end test
......
......@@ -97,7 +97,7 @@ module neuron_m
type, extends(neuron_t) :: binary_neuron_t
private
real :: threshold !< When neuron potential exceeds this value, neuron becomes excited
real(kind=real_4neuro) :: threshold !< When neuron potential exceeds this value, neuron becomes excited
contains
......@@ -132,8 +132,8 @@ module neuron_m
private
!! Coefficients for the linear activation function in format 'f(x)=a*x + b'
real :: a_coef !> The coefficient 'a' in the activation function f(x)=a*x + b
real :: b_coef !> The coefficient 'b' in the activation function f(x)=a*x + b
real(kind=real_4neuro) :: a_coef !> The coefficient 'a' in the activation function f(x)=a*x + b
real(kind=real_4neuro) :: b_coef !> The coefficient 'b' in the activation function f(x)=a*x + b
contains
......@@ -163,7 +163,7 @@ module neuron_m
type, extends(neuron_t) :: logistic_neuron_t
private
real :: alpha_coef
real(kind=real_4neuro) :: alpha_coef
contains
......@@ -366,7 +366,7 @@ module neuron_m
!! @return Pointer to the instance of the class binary_neuron_t
function new_binary_neuron() result(new_obj)
type(binary_neuron_t), pointer :: new_obj
integer(kind=integer_4neuro) :: values(8)
integer(kind=4) :: values(8)
#ifdef TIME_PROFILING
real :: start_time
call time_profiling_start(start_time)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment