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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!