We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In my code i need to know how many instances there are in a file (before enumerating them) to size some multi dimensional arrays.
As the methods get a reader as parameter, there is no way to re-open the reader.
So I added following two methods, to reset the ArffReader's stream and to return the instances count.
/// <summary> /// Reset StreamReader to beginning. /// </summary> public void Reset() { streamReader.BaseStream.Position = 0; arffHeader = null; } /// <summary> /// Returns the Instance Count. /// </summary> /// <returns></returns> public Int64 Count() { Reset(); ReadHeader(); Int64 count = 0; while (ReadInstance() != null) { count += 1; } return count; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In my code i need to know how many instances there are in a file (before enumerating them) to size some multi dimensional arrays.
As the methods get a reader as parameter, there is no way to re-open the reader.
So I added following two methods, to reset the ArffReader's stream and to return the instances count.
The text was updated successfully, but these errors were encountered: