This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as NP | |
import casadi as C | |
def qpsolve(H,g,lbx,ubx,A=NP.zeros((0,0)),lba=NP.zeros(0),uba=NP.zeros(0)): | |
# Convert to CasADi types | |
H = C.DMatrix(H) | |
g = C.DMatrix(g) | |
lbx = C.DMatrix(lbx) | |
ubx = C.DMatrix(ubx) | |
A = C.DMatrix(A) | |
A = A.reshape((A.size1(),H.size1())) # Make sure matching dimensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
classdef Circle < Shape | |
methods | |
function self = Circle(varargin) | |
self@Shape('_swigCreate',uint64(0),false); | |
if nargin==3 && ischar(varargin{1}) && strcmp(varargin{1},'_swigCreate') | |
self.swigCPtr = varargin{2}; | |
self.swigOwn = varargin{3}; | |
else | |
% How to get working on C side? Commented out, replaed by hack below | |
%self.swigCPtr = example_wrap('new_Circle',varargin{:}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <ctime> | |
#include <iomanip> | |
#include <symbolic/casadi.hpp> | |
#include <symbolic/stl_vector_tools.hpp> | |
using namespace CasADi; | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This file is part of CasADi. | |
* | |
* CasADi -- A symbolic framework for dynamic optimization. | |
* Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved. | |
* | |
* CasADi is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 3 of the License, or (at your option) any later version. |
NewerOlder