You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function "read" of matrix computes the matrix parameter by itself.
For example, we cannot set customized stride for ell matrices when reading mtx file.
However, when we convert Dense matrix to another matrix format, we can set the custom initial parameters of the matrix.
How about we also allow custom initial parameters for function "read"?
The text was updated successfully, but these errors were encountered:
Not sure I get what you mean. Are you referring to the global read function, or the read method of the ReadableFromMtx interface.
If it is the global function, then you can pass extra parameters to it - the method has a stream from which the matrix will be read, and a list of parameters passed to the create method of the matrix. Then, the method will create a new matrix using create and forwarding the extra parameters, call read_raw on the stream to obtain a mtx_data object, and finally call the method read of the matrix with that object to pass it in.
So, to set a custom stride for the ELL matrix you could do something like (assuming ELL's read method doesn't override the parameters set in the constructor):
auto A = gko::read(std::cin, exec, gko::dim<2>{}, elem_per_row, my_stride);
If you're talking about the read method from ReadableFromMtx interface, we cannot really add parameters to it, as it is an implementation of a polymorphic interface. What we can do is try to preserve as many parameters set in the constructor as possible when calling read. In a way, the extra parameters for the function are then stored in the implicitly passed this object.
gflegar
added
mod:core
This is related to the core module.
is:idea
Just a thought - if it's good, it could evolve into a proposal.
labels
Aug 3, 2018
I am mainly talking about the read method from ReadableFromMatrix.
The read method from ReadableFromMatrix of each format overrides the parameter list, so the resulting matrix from gko::read losses the parameter list.
The way you mentioned in the last is okay for me.
The function "read" of matrix computes the matrix parameter by itself.
For example, we cannot set customized stride for ell matrices when reading mtx file.
However, when we convert Dense matrix to another matrix format, we can set the custom initial parameters of the matrix.
How about we also allow custom initial parameters for function "read"?
The text was updated successfully, but these errors were encountered: