solve_interval_partition_no_k: solve_interval_partition interval partition problem, no boun...

View source: R/RcppExports.R

solve_interval_partition_no_kR Documentation

solve_interval_partition interval partition problem, no boun on the number of steps.

Description

Not working yet.

Usage

solve_interval_partition_no_k(x)

Arguments

x

square NumericMatix, for j>=i x(i,j) is the cost of partition element [i,...,j] (inclusive).

Details

Solve a for a minimal cost partition of the integers [1,...,nrow(x)] problem where for j>=i x(i,j). is the cost of choosing the partition element [i,...,j]. Returned solution is an ordered vector v of length k where: v[1]==1, v[k]==nrow(x)+1, and the partition is of the form [v[i], v[i+1]) (intervals open on the right).

Value

dynamic program solution.

Examples


costs <- matrix(c(1.5, NA ,NA ,1 ,0 , NA, 5, -1, 1), nrow = 3)
solve_interval_partition(costs, nrow(costs))


RcppDynProg documentation built on Aug. 20, 2023, 9:07 a.m.