Learn R Programming

modello (version 0.1.1)

gemm: Genral Matrix Multiplication

Description

Calculates: ans = alpha * op(A).modello$apply.math_op(B) + beta * C where alpha and beta are scalars and A, B, and C are matrices.

Usage

gemm(ta, tb, alpha = NULL, A, B, beta = NULL, C = NULL)

Arguments

ta

if > 1 or TRUE op(A) = A**T else op(A) = A

tb

if > 1 or TRUE op(B) = A**T else op(B) = A

alpha

a reference object of class 'number' with rank 0

A

a reference object of class 'number' with rank 2

B

a reference object of class 'number' with rank 2

beta

a reference object of class 'number' with rank 0

C

a reference number of class 'number' with rank 2

Value

Returns a reference object of class 'number'

Examples

Run this code
# NOT RUN {
modello.init(10, 10, 10, 10)
alpha = number(1, scalar=TRUE)
beta = number(1, scalar=TRUE)
A = number(matrix(rnorm(9), 3, 3))
B = number(matrix(rnorm(9), 3, 3))
C = number(matrix(rnorm(9), 3, 3))
ans1 = gemm(0, 0, alpha, A, B, beta, C)
ans2 = gemm(0, 0, alpha, A, B)
ans3 = gemm(0, 0, NULL, A, B, NULL, C)
ans4 = gemm(0, 0, NULL, A, B, NULL, NULL)
print(ans1)
print(ans1$v)
print(ans2)
print(ans2$v)
print(ans3)
print(ans3$v)
print(ans4)
print(ans4$v)
modello.close()
# }

Run the code above in your browser using DataLab