Learn R Programming

stokes (version 1.2-1)

rform: Random kforms and ktensors

Description

Random \(k\)-form objects and \(k\)-tensors, intended as quick “get you going” examples

Usage

rform(terms=9,k=3,n=7,coeffs,ensure=TRUE)
rtensor(terms=9,k=3,n=7,coeffs)

Value

All functions documented here return an object of class kform or

ktensor.

Arguments

terms

Number of distinct terms

k,n

A \(k\)-form maps \(V^k\) to \(\mathbb{R}\), where \(V=\mathbb{R}^n\)

coeffs

The coefficients of the form; if missing use seq_len(terms)

ensure

Boolean with default TRUE meaning to ensure that the dovs() of the returned value is in fact equal to n. If FALSE, sometimes the dovs() is strictly less than n because of random sampling

Author

Robin K. S. Hankin

Details

What you see is what you get, basically.

Note that argument terms is an upper bound, as the index matrix might contain repeats which are combined.

Examples

Run this code

rform()
rform() ^ rform()

rtensor() %X% rtensor()

rform() ^ dx
rform() ^ dx ^ dy

Run the code above in your browser using DataLab