Question: Using Julia, code a function that checks whether an input vector u R n is a basic solution of a polyhedron given in inequality form:
Using Julia, code a function that checks whether an input vector u R n is a basic solution of a polyhedron given in inequality form: P = {x R n : Ax b}. The function takes as input A, b and u, and returns true if u is a basic solution of P and false otherwise.
Here's the provided skeleton code:
function is_basic_solution(A, b, u) m = size(A, 1) n = size(A, 2) # check if inputs are consistent if length(b) != m || length(u) != n @warn("Input data is inconsistent!") return false end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
