Dear all,
Now I want to create new variable.
I wrote
double myEpochLength;
in LinearClassifier.h
And, I wrote
myEpochLength = Parameter( "EpochLength" );
in LinearClassifier.cpp
(LinearClassifier::Initialize)
However, "myEpochLength" have an incorrect value.
Next, I wrote
myEpochLength = 500;
in LinearClassifier.cpp
(LinearClassifier::Initialize)
However, "myEpochLength" have an incorrect value, too.
Thanks for your attention
Kind regards
Takanori
I cannot create new variable.
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Re: I cannot create new variable.
Hi,
with that modification, without declaring the additional parameter in the LinearClassifier constructor, you should get an error message when accessing it in Initialize().
Also, you should initialize the new variable in the LinearClassifier constructor's initializer list (before the first brace). Otherwise, it will have a random value.
Where and how do you check the value of myEpochLength?
Regards,
Juergen
with that modification, without declaring the additional parameter in the LinearClassifier constructor, you should get an error message when accessing it in Initialize().
Also, you should initialize the new variable in the LinearClassifier constructor's initializer list (before the first brace). Otherwise, it will have a random value.
Where and how do you check the value of myEpochLength?
Regards,
Juergen
-
yyy
- Posts: 3
- Joined: 29 Feb 2012, 02:38
Re: I cannot create new variable.
Hi Juergen,
I am a beginner in programming.
``initialize the new variable in the LinearClassifier constructor's initializer list'' is this?
LinearClassifier::LinearClassifier()
:myEpochLength( 0 ) //myEpochLength is the new variabl.
{
BEGIN_PARAMETER_DEFINITIONS
"Filtering matrix Classifier= 2 "
"[ input%20channel input%20element%20(bin) output%20channel weight ] "
" 1 4 1 1 "
" 1 6 2 1 "
" % % // Linear classification matrix in sparse representation",
END_PARAMETER_DEFINITIONS
}
I checked the value of myEpochLength at LinearClassifier::Initialize(const SignalProperties& , const SignalProperties&).
And, I checked it while debug.
Regards,
Takanori
I am a beginner in programming.
``initialize the new variable in the LinearClassifier constructor's initializer list'' is this?
LinearClassifier::LinearClassifier()
:myEpochLength( 0 ) //myEpochLength is the new variabl.
{
BEGIN_PARAMETER_DEFINITIONS
"Filtering matrix Classifier= 2 "
"[ input%20channel input%20element%20(bin) output%20channel weight ] "
" 1 4 1 1 "
" 1 6 2 1 "
" % % // Linear classification matrix in sparse representation",
END_PARAMETER_DEFINITIONS
}
I checked the value of myEpochLength at LinearClassifier::Initialize(const SignalProperties& , const SignalProperties&).
And, I checked it while debug.
Regards,
Takanori
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Re: I cannot create new variable.
Hi,
It appears you do not declare the new parameter, so it will not be found, and myEpochLength cannot be assigned any value. Parameters need to be declared before they can be used. Please read the tutorial on how to write a signal processing filter at
http://www.bci2000.org/wiki/index.php/P ... ing_Filter
Best regards,
Juergen
exactly, yes.``initialize the new variable in the LinearClassifier constructor's initializer list'' is this?
It appears you do not declare the new parameter, so it will not be found, and myEpochLength cannot be assigned any value. Parameters need to be declared before they can be used. Please read the tutorial on how to write a signal processing filter at
http://www.bci2000.org/wiki/index.php/P ... ing_Filter
Best regards,
Juergen
Who is online
Users browsing this forum: No registered users and 0 guests
