Interface LinearOperations
access this type via: io.compute.apps.LinearOperations (provides, requires or uses)
A set of functions to allow the user to execute many fundamental linear operations on vectors and matrices
Functions
LinearOperations()
int[] vectorScaleInt(int A[], int S)
dec[] vectorScaleDec(dec A[], dec S)
int vectorDotInt(int A[], int B[])
dec vectorDotDec(dec A[], dec B[])
int[] vectorCombinationInt(int A[], int B[])
dec[] vectorCombinationDec(dec A[], dec B[])
dec[] linearTransform(dec T[][], dec V[])
dec[][] transpose(dec M[][])
dec[][] matrixMultiply(dec A[][], dec B[][])
LinearOperations()
Allows the implementing component to initlise any external compute device it intends to use
Takes two integer vectors and adds them together such that: A = [a1, ..., an] and B = [b1, ..., bn] returns [a1+b1, ..., an+bn]. How vectors with unequal lengths are handled is left up to the implementing component
Takes two decimal vectors and adds them together such that: A = [a1, ..., an] and B = [b1, ..., bn] returns [a1+b1, ..., an+bn]. How vectors with unequal lengths are handled is left up to the implementing component
int[] vectorScaleInt(int A[], int S)
Takes an integer vector and an integer scalar and returns the vector scaled by the scalar such that: A = [a1, ..., an] and S returns [a1*S, ..., an*S]. How vectors with unequal lengths are handled is left up to the implementing component
dec[] vectorScaleDec(dec A[], dec S)
Takes an decimal vector and an decimal scalar and returns the vector scaled by the scalar such that: A = [a1, ..., an] and S returns [a1*S, ..., an*S]. How vectors with unequal lengths are handled is left up to the implementing component
int vectorDotInt(int A[], int B[])
Takes two integer vectors and returns their dot product such that: A = [a1, ..., an] and B = [b1, ..., bn] returns the sum of a1*b1, ..., an*bn. How vectors with unequal lengths are handled is left up to the implementing component
dec vectorDotDec(dec A[], dec B[])
Takes two decimal vectors and returns their dot product such that: A = [a1, ..., an] and B = [b1, ..., bn] returns the sum of a1*b1, ..., an*bn. How vectors with unequal lengths are handled is left up to the implementing component
int[] vectorCombinationInt(int A[], int B[])
Takes two integer vectors and returns their combination such that: A = [a1, ..., an] and B = [b1, ..., bn] returns [a1*b1, ..., an*bn]. How vectors with unequal lengths are handled is left up to the implementing component
dec[] vectorCombinationDec(dec A[], dec B[])
Takes two decimal vectors and returns their combination such that: A = [a1, ..., an] and B = [b1, ..., bn] returns [a1*b1, ..., an*bn]. How vectors with unequal lengths are handled is left up to the implementing component
dec[] linearTransform(dec T[][], dec V[])
Takes a decimal vector and transforms it according to the basis vectors described in the given matrix. How vectors with more elements than the matrix has rows are handled is left up to the implementing component
dec[][] transpose(dec M[][])
Takes an N x M matrix and returns an M x N matrix where Mt[n, m] = M[m, n]
dec[][] matrixMultiply(dec A[][], dec B[][])
Takes two matrices and returns a new matrix populated by the values of the dot products of the rows in A and the columns in B. How matricies where the number of columns in A do not match the number of rows in B are handled is left up to the implimenting component