demomat_JPH {TestJP}R Documentation

様々な種類のわかりやすい行列の作成

Description

様々な種類のわかりやすい行列の作成する。
英語のヘルプ: demomat

Arguments

nr

行の数、または行の数からなるベクトル

nc

# of columns of the matrix to be generated or a vector consisting of the # of columns of each submatrix.

n3

# of the 3d dimension or 0, if any

root

The root character of the elements of the symbolic matrix.
If this is present, a character matrix/array will be created.

vec

= 1 to drop the redundant subscript.

shape

Shape of the resulting matrix:
"sym", "symU", "symL", "diag", "uppert", "lowert"

nodiag

= 1 to set the diagonal elements to 0 when either "upper" or "lower" is specified

list

= 1 to return the array as list when n3 > 2.

fullsymb

= 1 to make the result a fully symbolic matrix

mul

See below.

mul3

See below.

rnroot

root of the row names

cnroot

root of the column names

anroot

root of the third dimension names

supermat

= 1 to create horizontally stacked array
= 2 to create vertically stacked array
= 0 othereize

Details

行列の i,j 要素には mul*i + j という添字が付与される。
The i,j,k elements of an array will be named as mul3*(mul*i + j) + k

When a supermatrix is generated, SMdim attributes will be set
where SMdim is a list of the form
(nrows=nr, ncols=nc, rownames=rn, colnames=cn, anames=an)
where
nr is a vector consisting of the number of rows of each submatrix,
nc is a vector consisting of the number of columns of each submatrix
rn is a vector consisting of the supplemental row names
cn is a vector consisting of the supplemental column names
an is a vector consisting of the names associated with the 3rd dim.
'

Value

行列もしくは 3D 配列
vec=1 が指定されていても、列数もしくは行数が 1 の行列が出力されるため ベクトルがほしい場合には c() を作用させること。

Examples

demomat( 11,3 ) # 数値
demomat( 11,3,root="a" ) # 記号
demomat( 4,1,root="a", vec=1 ) # symbolic matrix

demomat( 4,3,2 ) # numeric array
demomat( 4,3,2, supermat=1 ) # numeric supermatrix (horizontally stacked)
demomat( 4,3,2, supermat=2 ) # numeric supermatrix (vertically stacked)

# Below two creates almost identical super matrices.
demomat( 4,3,2, root="a", supermat=1 )
demomat( 4,c(3,3), root="a" )

# 2 x 2 partitioned matrix
A=demomat( c(4,3),c(3,2), root="a" )




[Package TestJP version 0.0.1 Index]