float (version 0.2-3)

matmult: matmult

Description

Matrix multiplication for numeric/float matrices.

Usage

# S4 method for float32,float32
%*%(x, y)

# S4 method for float32,matrix %*%(x, y)

# S4 method for matrix,float32 %*%(x, y)

Arguments

x, y

Numeric/float matrices.

Value

A matrix of the same type as the highest precision input.

Details

If a numeric matrix is multiplied against a float matrix, then if the "numeric" matrix is integers, the integers are promoted to floats. Otherwise, the float matrix is promoted to doubles.

Examples

Run this code
# NOT RUN {
library(float)

s1 = flrunif(5, 5)
s2 = flrunif(5, 2)
x = matrix(1:25, 5)

s1 %*% s2 # float

storage.mode(x) # integer
x %*% s2 # float

storage.mode(x) = "double"
x %*% s2 # double

# }

Run the code above in your browser using DataLab