Coder Social home page Coder Social logo

Comments (3)

bqpd avatar bqpd commented on July 22, 2024

RE: 'matrix of exponents associated with each constant in each constraint'

I think the GP class should have a 'constants' attribute that it applies to its purely symbolic representation of the cost and constraints before solving, and an 'update' function. This would look something like:

GP = gpkit.GP(cost, slf+other_constraints, constants)
sol1 = GP.solve()['solution']
# change the constraints...
GP.update(constraints = new_constraints)
sol2 = GP.solve()['solution']  # also stored at GP.solution
# change the constants...
GP.update(constants = new_constants)
sol3 = GP.solve()['solution']
# change the cost function and merge with another GP
GP.update(new_cost, new_GP.constraints, new_GP.constants)
# the GP class will have automatically generated and efficiently kept up-to-date:
#    - a sparse A matrix (called F by CVXopt)
#    - a c vector (called g by CVXopt)
#    - a map vector for MOSEK
#    - a 'k' vector for CVXopt, because I can't see of a clean way to do without it
sol4 = GP.solve()['solution']

from gpkit.

whoburg avatar whoburg commented on July 22, 2024

yes, like everything we're outlining here.

from gpkit.

bqpd avatar bqpd commented on July 22, 2024

I implemented it just as above except that GP.solve() does not return a dictionary, but the primal solution. Everything in the original request has been covered...

from gpkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.