gemm: Genral Matrix Multiplication

Description Usage Arguments Value Author(s) Examples

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

1
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'

Author(s)

Filippo Monari

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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()

modello documentation built on Feb. 2, 2021, 9:06 a.m.

Related to gemm in modello...