Multiply

From MantidProject

Jump to: navigation, search

Contents

Summary

The Multiply algorithm will multiply the data values and calculate the corresponding error values of two compatible workspaces.

Properties

Order Name Direction Type Default Description
1 LHSWorkspace Input Workspace Mandatory The first input workspace to use, this can be considered to be the workspace on the left hand side of the \times.
2 RHSWorkspace Input Workspace Mandatory The srcond input workspace to use, this can be considered to be the workspace on the right hand side of the \times.
3 OutputWorkspace Output Workspace Mandatory The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service.

Description

The algorithm multiply will multiply the data and associated errors from any two compatible workspaces. Workspaces are compatible if:

  • The sizes of the two workspaces are compatible (see below)
  • If the two workspaces contain Y bins then the values in these must be identical
  • the units of the axes match
  • the distribution status/counts units match

Compatible Sizes

Workspaces are compatible if they are identically sized in which case the values of each cell within each histogram are multiplied individually. The green arrows shows the order in which the data is multiplied.
They are also compatible if they match the size dimension horizontally, in which case the same values are multiplied in each histogram in the workspace.
If they match in size vertically then the data values will be multiplied in each bin of the histogram.

Finally a workspace containing a single value is compatible to any workspace, in which case the same value will be multiplied uniformly for every bin in each histogram.

Usage

Python

Multiply("w1","w2","output")

C++ Within an Algorithm
The usage of basic workspace mathematical operations has been specially simplified for use within algorithms

//w1 and w2 are workspaces
Workspace output = w1 * w2;

Source Code

Header Multiply.h

Source Multiply.cpp

Personal tools
Create a book