# Optimal: Optimal In rcss: Convex Switching Systems

## Description

Find the maximising tangent at each grid point.

## Usage

 `1` ```Optimal(grid, tangent) ```

## Arguments

 `grid` Matrix representing the grid. The i-th row corresponds to i-th point of the grid. The j-th column captures the dimensions. The first column must equal to 1. `tangent` Matrix representing the collection of tangents, where the intercept [i,1] and slope [i,-1] describes a tangent at grid point i.

## Value

Matrix representing the maximum of the tangents at each grid point, where the intercept [i,1] and slope [i,-1] describes the maximising tangent at grid point i.

Jeremy Yee

## Examples

 ```1 2 3``` ```grid <- as.matrix(cbind(rep(1, 81), c(seq(20, 60, length = 91)))) tangent <- matrix(rnorm(81 * 2), ncol = 2) Optimal(grid, tangent) ```

### Example output

```Warning message:
In cbind(rep(1, 81), c(seq(20, 60, length = 91))) :
number of rows of result is not a multiple of vector length (arg 1)
[,1]     [,2]
[1,] -0.1459793 2.462599
[2,] -0.1459793 2.462599
[3,] -0.1459793 2.462599
[4,] -0.1459793 2.462599
[5,] -0.1459793 2.462599
[6,] -0.1459793 2.462599
[7,] -0.1459793 2.462599
[8,] -0.1459793 2.462599
[9,] -0.1459793 2.462599
[10,] -0.1459793 2.462599
[11,] -0.1459793 2.462599
[12,] -0.1459793 2.462599
[13,] -0.1459793 2.462599
[14,] -0.1459793 2.462599
[15,] -0.1459793 2.462599
[16,] -0.1459793 2.462599
[17,] -0.1459793 2.462599
[18,] -0.1459793 2.462599
[19,] -0.1459793 2.462599
[20,] -0.1459793 2.462599
[21,] -0.1459793 2.462599
[22,] -0.1459793 2.462599
[23,] -0.1459793 2.462599
[24,] -0.1459793 2.462599
[25,] -0.1459793 2.462599
[26,] -0.1459793 2.462599
[27,] -0.1459793 2.462599
[28,] -0.1459793 2.462599
[29,] -0.1459793 2.462599
[30,] -0.1459793 2.462599
[31,] -0.1459793 2.462599
[32,] -0.1459793 2.462599
[33,] -0.1459793 2.462599
[34,] -0.1459793 2.462599
[35,] -0.1459793 2.462599
[36,] -0.1459793 2.462599
[37,] -0.1459793 2.462599
[38,] -0.1459793 2.462599
[39,] -0.1459793 2.462599
[40,] -0.1459793 2.462599
[41,] -0.1459793 2.462599
[42,] -0.1459793 2.462599
[43,] -0.1459793 2.462599
[44,] -0.1459793 2.462599
[45,] -0.1459793 2.462599
[46,] -0.1459793 2.462599
[47,] -0.1459793 2.462599
[48,] -0.1459793 2.462599
[49,] -0.1459793 2.462599
[50,] -0.1459793 2.462599
[51,] -0.1459793 2.462599
[52,] -0.1459793 2.462599
[53,] -0.1459793 2.462599
[54,] -0.1459793 2.462599
[55,] -0.1459793 2.462599
[56,] -0.1459793 2.462599
[57,] -0.1459793 2.462599
[58,] -0.1459793 2.462599
[59,] -0.1459793 2.462599
[60,] -0.1459793 2.462599
[61,] -0.1459793 2.462599
[62,] -0.1459793 2.462599
[63,] -0.1459793 2.462599
[64,] -0.1459793 2.462599
[65,] -0.1459793 2.462599
[66,] -0.1459793 2.462599
[67,] -0.1459793 2.462599
[68,] -0.1459793 2.462599
[69,] -0.1459793 2.462599
[70,] -0.1459793 2.462599
[71,] -0.1459793 2.462599
[72,] -0.1459793 2.462599
[73,] -0.1459793 2.462599
[74,] -0.1459793 2.462599
[75,] -0.1459793 2.462599
[76,] -0.1459793 2.462599
[77,] -0.1459793 2.462599
[78,] -0.1459793 2.462599
[79,] -0.1459793 2.462599
[80,] -0.1459793 2.462599
[81,] -0.1459793 2.462599
[82,] -0.1459793 2.462599
[83,] -0.1459793 2.462599
[84,] -0.1459793 2.462599
[85,] -0.1459793 2.462599
[86,] -0.1459793 2.462599
[87,] -0.1459793 2.462599
[88,] -0.1459793 2.462599
[89,] -0.1459793 2.462599
[90,] -0.1459793 2.462599
[91,] -0.1459793 2.462599
```

rcss documentation built on May 1, 2019, 10:13 p.m.