Skip to content
New issue

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

Horace Replicate Command #12694

Closed
OwenArnold opened this issue May 27, 2015 · 1 comment
Closed

Horace Replicate Command #12694

OwenArnold opened this issue May 27, 2015 · 1 comment
Assignees
Labels
Direct Inelastic Issues and pull requests related to direct inelastic Vates
Milestone

Comments

@OwenArnold
Copy link
Contributor

This issue was originally TRAC 11856

This ticket is blocks : TRAC11231

Do we really need this? http://horace.isis.rl.ac.uk/Reshaping_etc#replicate

This can be achieved by hand, at the moment, but maybe that's too much work? A python algorithm might be a good start for this.

1 man-week effort

Planned procedure for implementing this

  1. Locate Data in Shape
    1. Pre-checks. size's extents, names, etc. All the n+1 rules for Shape over Data should be OK.
    2. Transpose Data into Shapes n-1 dimension set, in the exact order. Use TransposeMD.
    3. In the same step as the above, collapse down any integrated dimensions in the Data. The reshaped-data should be truly m-1 dimensions.
  2. Clone the Shape workspace to make the Output Workspace
  3. Let p, q, r, s be the size of the dimensions in the output. Since we are replicating over the last dimension, we need to shift by (pxqxr) in each our our Output Workspace arrays.
    1. So, using the scheme above, we can do a std::copy(transposed_data.getSignalArray(), output_workspace.getSignalArray() + i_(pxqxr), output_workspace.getSignalArray() + (i+1)_(pxqxr) ),
    2. Or we could do he equivalent with the MDHistoWorkspace iterator. Create x iterators where x is the number of bins in the last dimension and jump each one forward by (pxqxr).
    3. Or we could create iterators to loop over the Data Workspace, and for each iterator we access i x (pxqxr) in the output workspace and write the same value to each slice point.

    Keywords: vates-cli
@OwenArnold OwenArnold added Direct Inelastic Issues and pull requests related to direct inelastic Vates labels Jun 3, 2015
@OwenArnold OwenArnold self-assigned this Jun 3, 2015
@OwenArnold OwenArnold added this to the Release 3.5 milestone Jun 3, 2015
@OwenArnold
Copy link
Contributor Author

Re-requested by Russell Ewings. on the 25th August. Important for background correction.

OwenArnold added a commit that referenced this issue Aug 27, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
The performance tests currently run in 1.65 seconds on my development machine.
OwenArnold added a commit that referenced this issue Sep 8, 2015
Use index utils instead of hand-rolled approach. This reduced performance test times by 66%.
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
No auto conversion beween unique_ptr<T> and shared_ptr<T>. Handle explicitly.
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
OwenArnold added a commit that referenced this issue Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Direct Inelastic Issues and pull requests related to direct inelastic Vates
Projects
None yet
Development

No branches or pull requests

1 participant