parse.polyMatrix: Parse polynomial matrix from strings

Description Usage Arguments Details Value See Also Examples

View source: R/parser.R

Description

This is a convenient way to input a polynomial matrix.

Usage

1

Arguments

...

string or strings to parse

var

variable character. Only lower latin characters are allowed except 'e' which is reseved for numbers

Details

Space and tabulation characters are ignored.

Row should be divided by new line "\n" or backslash "\" (TeX style).

Elements in each row can be divided by ",", ";" or "&" (TeX style)

For convenience, this function can accept multiple string. In this case each string will be treated as a new row.

This function accepts TeX matrix format.

Value

new polynomial matrix of polyMatrix class

See Also

parse.polynomial()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
parse.polyMatrix("       1, 2 + x",
                 "2 + 2x^2,    x^3")

# The function can suggest mistake position in case of invalid format
## Not run: 
parse.polyMatrix(
    "1 + y &    2\\
        -2 &  x^2"
)
## Fail to parse polyMatrix: invalid term at position 2 in item [1, 1]

## End(Not run)

polyMatrix documentation built on July 18, 2021, 5:06 p.m.