ds.matrixMult {dsBaseClient} | R Documentation |

Calculates the matrix product of two matrices and writes output to serverside

ds.matrixMult(M1 = NULL, M2 = NULL, newobj = NULL, datasources = NULL)

`M1` |
A character string specifying the name of the first matrix (M1) |

`M2` |
A character string specifying the name of the second matrix (M2) |

`newobj` |
A character string specifying the name of the matrix to which the output is to be written. If no <newobj> argument is specified, the output matrix names defaults to "M1_M2" where <M1> is the first argument of the function and <M2> is the second argument of the function. |

`datasources` |
specifies the particular opal object(s) to use. If the <datasources> argument is not specified the default set of opals will be used. The default opals are called default.opals and the default can be set using the function ds.setDefaultOpals. If the <datasources> is to be specified, it should be set without inverted commas: e.g. datasources=opals.em or datasources=default.opals. If you wish to apply the function solely to e.g. the second opal server in a set of three, the argument can be specified as: e.g. datasources=opals.em[2]. If you wish to specify the first and third opal servers in a set you specify: e.g. datasources=opals.em[c(1,3)] |

Undertakes standard matrix multiplication where with input matrices A and B with dimensions A: mxn and B: nxp the output C has dimensions mxp and each elemnt C[i,j] has value equal to the dot product of row i of A and column j of B where the dot product is obtained as sum(A[i,1]*B[1,j] + A[i,2]*B[2,j] + .... + A[i,n]*B[n,j]). This calculation is only valid if the number of columns of A is the same as the number of rows of B

the object specified by the <newobj> argument (or default name <M1>_<M2>) which is written to the serverside. In addition, two validity messages are returned indicating whether <newobj> has been created in each data source and if so whether it is in a valid form. If its form is not valid in at least one study - e.g. because a disclosure trap was tripped and creation of the full output object was blocked - ds.matrixMult also returns any studysideMessages that can explain the error in creating the full output object. As well as appearing on the screen at run time,if you wish to see the relevant studysideMessages at a later date you can use the ds.message function. If you type ds.message("newobj") it will print out the relevant studysideMessage from any datasource in which there was an error in creating <newobj> and a studysideMessage was saved. If there was no error and <newobj> was created without problems no studysideMessage will have been saved and ds.message("newobj") will return the message: "ALL OK: there are no studysideMessage(s) on this datasource".

Paul Burton for DataSHIELD Development Team

[Package *dsBaseClient* version 5.0.0 ]