Learn R Programming

modello (version 0.1.1)

ger: Genral Vector Outer Product

Description

Calculates: ans = alpha * A.B**T + C where alpha is a scalar and A, B, are vectors and C is a matrix.

Usage

ger(alpha = NULL, A, B, C = NULL)

Arguments

alpha

a reference object of class 'number' with rank 0

A

a reference object of class 'number' with rank 1

B

a reference object of class 'number' with rank 1

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)
A = number(rnorm(3))
B = number(rnorm(3))
C = number(matrix(rnorm(9), 3, 3))
ans1 = ger(alpha, A, B, C)
ans2 = ger(NULL, A, B, C)
ans3 = ger(NULL, A, B, NULL)
print(ans1)
print(ans1$v)
print(ans2)
print(ans2$v)
print(ans3)
print(ans3$v)
modello.close()
# }

Run the code above in your browser using DataLab