#include "monty.h"
#include "fusion_p.h"

template<typename T> struct _checked_ptr_1
{
  T * ptr;
  size_t sz;
  _checked_ptr_1<T>(T * ptr, size_t sz) : ptr(ptr), sz(sz) {}
  T & operator[](ptrdiff_t i) { assert(i >= 0 && i < sz); return ptr[i]; }
  const T & operator[](ptrdiff_t i) const { assert(i >= 0 && i < sz); return ptr[i]; }
  void update(T * ptr_, size_t sz_) { ptr = ptr_; sz = sz_; }
};

template<typename T> struct _checked_ptr_2
{
  T * ptr;
  size_t sz0, sz1;
  _checked_ptr_2<T>(T * ptr, size_t sz0, size_t sz1) : ptr(ptr), sz0(sz0),sz1(sz1) {}
  T & operator()(ptrdiff_t i0, ptrdiff_t i1) { assert(i0 >= 0 && i0 < sz0 && i1 >= 0 && i1 < sz1); return ptr[i0 * sz1 + i1]; }
  const T & operator()(ptrdiff_t i0, ptrdiff_t i1) const { assert(i0 >= 0 && i0 < sz0 && i1 >= 0 && i1 < sz1); return ptr[i0 * sz1 + i1]; }
  void update(T * ptr_, size_t sz0_, size_t sz1_) { ptr = ptr_; sz0 = sz0_; sz1 = sz1_; }
};

// See http://www.cplusplus.com/articles/DE18T05o/
//                 A      && ( (       B      && B1 && B2      ) || (      C      &&   C1 &&   C2  ) )
// A a and b a have different signs
// B, B1, B2 a and b are both non-negative, r is less than both a and b
// C, C1, C2 a and b are both negative, r is greater than both a and b

struct InternalNumericOverflow {};

template<typename T>
static inline T checked_add(T a, T b, bool & overflow) {
  int r = a+b;
  overflow = ((a ^ b) >= 0) && ( (( (a & b) >= 0) && r < a && r < b) || ( ((a & b) < 0) && a < r && b < r) );
  return r;
}

template<typename T>
static inline T safe_add_(T a, T b) {
  bool overflow;
  T r = checked_add(a,b,overflow);
  if (overflow)
    throw InternalNumericOverflow();
  else
    return r;
}

static inline int      safe_add(int32_t a, int32_t b) { return safe_add_<int64_t>(a,b); }
static inline int64_t  safe_add(int64_t a, int64_t b) { return safe_add_<int64_t>(a,b); }
static inline int64_t  safe_add(int32_t a, int64_t b) { return safe_add_<int64_t>(a,b); }
static inline int64_t  safe_add(int64_t a, int32_t b) { return safe_add_<int64_t>(a,b); }

template<typename T>
static inline T checked_mul(T a, T b, bool & overflow) {
  T r = a * b;
  overflow = b != 0 && (((a ^ b) >= 0 && a > std::numeric_limits<T>::max() / b) || ((a ^ b) < 0 && a < std::numeric_limits<T>::min() / b));
  return r;
}

template<typename T>
static inline T safe_mul_(T a, T b) {
  bool overflow;
  T r = checked_mul(a,b,overflow);
  if (overflow)
    throw InternalNumericOverflow();
  else
    return r;
}

static inline           int safe_mul(int a, int b) { return safe_mul_<int64_t>(a,b); }
static inline int64_t safe_mul(int64_t a, int64_t b) { return safe_mul_<int64_t>(a,b); }
static inline int64_t safe_mul(int a, int64_t b) { return safe_mul_<int64_t>(a,b); }
static inline int64_t safe_mul(int64_t a, int b) { return safe_mul_<int64_t>(a,b); }

std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::DJCDomainType val)
{
  switch (val)
  {
    case DJCDomainType::EqualTo: os << "DJCDomainType::EqualTo"; break;
    case DJCDomainType::LessThan: os << "DJCDomainType::LessThan"; break;
    case DJCDomainType::GreaterThan: os << "DJCDomainType::GreaterThan"; break;
    case DJCDomainType::IsFree: os << "DJCDomainType::IsFree"; break;
    case DJCDomainType::InRange: os << "DJCDomainType::InRange"; break;
    case DJCDomainType::InQCone: os << "DJCDomainType::InQCone"; break;
    case DJCDomainType::InRotatedQCone: os << "DJCDomainType::InRotatedQCone"; break;
    case DJCDomainType::InPExpCone: os << "DJCDomainType::InPExpCone"; break;
    case DJCDomainType::InPPowCone: os << "DJCDomainType::InPPowCone"; break;
    case DJCDomainType::InDExpCone: os << "DJCDomainType::InDExpCone"; break;
    case DJCDomainType::InDPowCone: os << "DJCDomainType::InDPowCone"; break;
    case DJCDomainType::InOneNormCone: os << "DJCDomainType::InOneNormCone"; break;
    case DJCDomainType::InInfNormCone: os << "DJCDomainType::InInfNormCone"; break;
    case DJCDomainType::InPGeoMeanCone: os << "DJCDomainType::InPGeoMeanCone"; break;
    case DJCDomainType::InDGeoMeanCone: os << "DJCDomainType::InDGeoMeanCone"; break;
    case DJCDomainType::InPSDCone: os << "DJCDomainType::InPSDCone"; break;
    default: os << "DJCDomainType.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::StatusKey val)
{
  switch (val)
  {
    case StatusKey::Unknown: os << "StatusKey::Unknown"; break;
    case StatusKey::Basic: os << "StatusKey::Basic"; break;
    case StatusKey::SuperBasic: os << "StatusKey::SuperBasic"; break;
    case StatusKey::OnBound: os << "StatusKey::OnBound"; break;
    case StatusKey::Infinity: os << "StatusKey::Infinity"; break;
    default: os << "StatusKey.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::SolutionType val)
{
  switch (val)
  {
    case SolutionType::Default: os << "SolutionType::Default"; break;
    case SolutionType::Basic: os << "SolutionType::Basic"; break;
    case SolutionType::Interior: os << "SolutionType::Interior"; break;
    case SolutionType::Integer: os << "SolutionType::Integer"; break;
    default: os << "SolutionType.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::SolverStatus val)
{
  switch (val)
  {
    case SolverStatus::OK: os << "SolverStatus::OK"; break;
    case SolverStatus::Error: os << "SolverStatus::Error"; break;
    case SolverStatus::LostRace: os << "SolverStatus::LostRace"; break;
    default: os << "SolverStatus.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::ProblemStatus val)
{
  switch (val)
  {
    case ProblemStatus::Unknown: os << "ProblemStatus::Unknown"; break;
    case ProblemStatus::PrimalAndDualFeasible: os << "ProblemStatus::PrimalAndDualFeasible"; break;
    case ProblemStatus::PrimalFeasible: os << "ProblemStatus::PrimalFeasible"; break;
    case ProblemStatus::DualFeasible: os << "ProblemStatus::DualFeasible"; break;
    case ProblemStatus::PrimalInfeasible: os << "ProblemStatus::PrimalInfeasible"; break;
    case ProblemStatus::DualInfeasible: os << "ProblemStatus::DualInfeasible"; break;
    case ProblemStatus::PrimalAndDualInfeasible: os << "ProblemStatus::PrimalAndDualInfeasible"; break;
    case ProblemStatus::IllPosed: os << "ProblemStatus::IllPosed"; break;
    case ProblemStatus::PrimalInfeasibleOrUnbounded: os << "ProblemStatus::PrimalInfeasibleOrUnbounded"; break;
    default: os << "ProblemStatus.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::AccSolutionStatus val)
{
  switch (val)
  {
    case AccSolutionStatus::Anything: os << "AccSolutionStatus::Anything"; break;
    case AccSolutionStatus::Optimal: os << "AccSolutionStatus::Optimal"; break;
    case AccSolutionStatus::Feasible: os << "AccSolutionStatus::Feasible"; break;
    case AccSolutionStatus::Certificate: os << "AccSolutionStatus::Certificate"; break;
    default: os << "AccSolutionStatus.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::SolutionStatus val)
{
  switch (val)
  {
    case SolutionStatus::Undefined: os << "SolutionStatus::Undefined"; break;
    case SolutionStatus::Unknown: os << "SolutionStatus::Unknown"; break;
    case SolutionStatus::Optimal: os << "SolutionStatus::Optimal"; break;
    case SolutionStatus::Feasible: os << "SolutionStatus::Feasible"; break;
    case SolutionStatus::Certificate: os << "SolutionStatus::Certificate"; break;
    case SolutionStatus::IllposedCert: os << "SolutionStatus::IllposedCert"; break;
    default: os << "SolutionStatus.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::ObjectiveSense val)
{
  switch (val)
  {
    case ObjectiveSense::Undefined: os << "ObjectiveSense::Undefined"; break;
    case ObjectiveSense::Minimize: os << "ObjectiveSense::Minimize"; break;
    case ObjectiveSense::Maximize: os << "ObjectiveSense::Maximize"; break;
    default: os << "ObjectiveSense.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::QConeKey val)
{
  switch (val)
  {
    case QConeKey::InQCone: os << "QConeKey::InQCone"; break;
    case QConeKey::InRotatedQCone: os << "QConeKey::InRotatedQCone"; break;
    case QConeKey::InPExpCone: os << "QConeKey::InPExpCone"; break;
    case QConeKey::InPPowCone: os << "QConeKey::InPPowCone"; break;
    case QConeKey::InDExpCone: os << "QConeKey::InDExpCone"; break;
    case QConeKey::InDPowCone: os << "QConeKey::InDPowCone"; break;
    case QConeKey::InPGeoMeanCone: os << "QConeKey::InPGeoMeanCone"; break;
    case QConeKey::InDGeoMeanCone: os << "QConeKey::InDGeoMeanCone"; break;
    case QConeKey::Positive: os << "QConeKey::Positive"; break;
    case QConeKey::Negative: os << "QConeKey::Negative"; break;
    case QConeKey::Unbounded: os << "QConeKey::Unbounded"; break;
    case QConeKey::Zero: os << "QConeKey::Zero"; break;
    case QConeKey::InPSDCone: os << "QConeKey::InPSDCone"; break;
    case QConeKey::InSVecPSDCone: os << "QConeKey::InSVecPSDCone"; break;
    default: os << "QConeKey.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::PSDKey val)
{
  switch (val)
  {
    case PSDKey::IsSymPSD: os << "PSDKey::IsSymPSD"; break;
    case PSDKey::IsTrilPSD: os << "PSDKey::IsTrilPSD"; break;
    default: os << "PSDKey.<invalid>"; break;
  }
  return os;
}
std::ostream & mosek::fusion::operator<<(std::ostream & os,mosek::fusion::RelationKey val)
{
  switch (val)
  {
    case RelationKey::EqualsTo: os << "RelationKey::EqualsTo"; break;
    case RelationKey::LessThan: os << "RelationKey::LessThan"; break;
    case RelationKey::GreaterThan: os << "RelationKey::GreaterThan"; break;
    case RelationKey::IsFree: os << "RelationKey::IsFree"; break;
    case RelationKey::InRange: os << "RelationKey::InRange"; break;
    default: os << "RelationKey.<invalid>"; break;
  }
  return os;
}
// class Disjunction { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:350:4-355:5
mosek::fusion::Disjunction::Disjunction(mosek::fusion::p_Disjunction *_impl) : _impl(_impl) { /*std::cout << "Disjunction() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Disjunction::~Disjunction() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Disjunction::p_Disjunction
  (::mosek::fusion::Disjunction * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.Disjunction.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:352:6-354:7
mosek::fusion::Disjunction::t mosek::fusion::p_Disjunction::_new_Disjunction
  (int64_t _7_id)
{ return new mosek::fusion::Disjunction(_7_id); }
mosek::fusion::Disjunction::Disjunction
  (int64_t _7_id) : 
   Disjunction(new mosek::fusion::p_Disjunction(this))
{ mosek::fusion::p_Disjunction::_get_impl(this)->_initialize(_7_id); }
void mosek::fusion::p_Disjunction::_initialize  (int64_t _7_id)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Disjunction::_get_impl(::mosek::fusion::Disjunction::t(_pubthis))->id = _7_id;
  }
}
// mosek.fusion.Disjunction.ctor

void mosek::fusion::p_Disjunction::destroy()
{
}
void mosek::fusion::Disjunction::destroy() { mosek::fusion::p_Disjunction::_get_impl(this)->destroy(); }
// } class Disjunction
// class DisjunctionTerms { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:321:4-345:5
mosek::fusion::DisjunctionTerms::DisjunctionTerms(mosek::fusion::p_DisjunctionTerms *_impl) : _impl(_impl) { /*std::cout << "DisjunctionTerms() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::DisjunctionTerms::~DisjunctionTerms() { delete _impl; _impl = nullptr; }
mosek::fusion::p_DisjunctionTerms::p_DisjunctionTerms
  (::mosek::fusion::DisjunctionTerms * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:344:6-97
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _8_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _9_term)
{ return new mosek::fusion::DisjunctionTerms(_8_terms1,_9_term); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _8_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _9_term) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_8_terms1,_9_term); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _8_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _9_term)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_DisjunctionTerms::_initialize(_8_terms1,::mosek::fusion::p_DJC::term(_9_term));
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:343:6-98
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _10_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _11_term)
{ return new mosek::fusion::DisjunctionTerms(_10_terms1,_11_term); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _10_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _11_term) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_10_terms1,_11_term); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _10_terms1,
    monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _11_term)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_DisjunctionTerms::_initialize(_10_terms1,::mosek::fusion::p_DJC::term(_11_term));
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:340:6-342:7
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _12_terms1,
    monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _13_term2)
{ return new mosek::fusion::DisjunctionTerms(_12_terms1,_13_term2); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _12_terms1,
    monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _13_term2) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_12_terms1,_13_term2); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _12_terms1,
    monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _13_term2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_DisjunctionTerms::_initialize(_12_terms1,mosek::fusion::p_DisjunctionTerms::_get_impl(_13_term2)->terms);
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:334:6-339:7
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _14_term1,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _15_term2)
{ return new mosek::fusion::DisjunctionTerms(_14_term1,_15_term2); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _14_term1,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _15_term2) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_14_term1,_15_term2); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _14_term1,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _15_term2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    int32_t _16_n1 = (int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_14_term1)->terms)->size(0));
    terms = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(safe_add( (int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_14_term1)->terms)->size(0)),(int)((_15_term2)->size(0)) ))));
    {
      int32_t _17_i = (int)0;
      for(;(_17_i < (int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_14_term1)->terms)->size(0)));++ _17_i)
      {
        {
          ((*terms)(_17_i)) = ((*mosek::fusion::p_DisjunctionTerms::_get_impl(_14_term1)->terms)(_17_i));
        }
      }
    }
    {
      int32_t _18_i = (int)0;
      for(;(_18_i < (int)((_15_term2)->size(0)));++ _18_i)
      {
        {
          ((*terms)(safe_add( _18_i,_16_n1 ))) = ((*_15_term2)(_18_i));
        }
      }
    }
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:329:6-333:7
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _19_term1,
    monty::rc_ptr< ::mosek::fusion::Term > _20_term2)
{ return new mosek::fusion::DisjunctionTerms(_19_term1,_20_term2); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _19_term1,
    monty::rc_ptr< ::mosek::fusion::Term > _20_term2) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_19_term1,_20_term2); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _19_term1,
    monty::rc_ptr< ::mosek::fusion::Term > _20_term2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    terms = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(safe_add( (int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_19_term1)->terms)->size(0)),(int)1 ))));
    {
      int32_t _21_i = (int)0;
      for(;(_21_i < (int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_19_term1)->terms)->size(0)));++ _21_i)
      {
        {
          ((*terms)(_21_i)) = ((*mosek::fusion::p_DisjunctionTerms::_get_impl(_19_term1)->terms)(_21_i));
        }
      }
    }
    ((*terms)((int)((mosek::fusion::p_DisjunctionTerms::_get_impl(_19_term1)->terms)->size(0)))) = _20_term2;
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:326:6-328:7
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _22_terms)
{ return new mosek::fusion::DisjunctionTerms(_22_terms); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _22_terms) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_22_terms); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _22_terms)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    std::vector<monty::rc_ptr< ::mosek::fusion::Term >> _9189_;
    for (int32_t _23_i = (int)0, _9190_ = (int)((_22_terms)->size(0)); _23_i < _9190_ ; ++_23_i)
    {
      _9189_.push_back(((*_22_terms)(_23_i)));
    }
    auto _9191_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(_9189_.size()),_9189_.begin(),_9189_.end()));
    mosek::fusion::p_DisjunctionTerms::_get_impl(::mosek::fusion::DisjunctionTerms::t(_pubthis))->terms = _9191_;
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:325:6-79
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _24_term)
{ return new mosek::fusion::DisjunctionTerms(_24_term); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _24_term) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_24_term); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _24_term)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    terms = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(::mosek::fusion::p_DJC::term(_24_term).get())});
  }
}
// mosek.fusion.DisjunctionTerms.ctor

// mosek.fusion.DisjunctionTerms.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:323:6-80
mosek::fusion::DisjunctionTerms::t mosek::fusion::p_DisjunctionTerms::_new_DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _25_term)
{ return new mosek::fusion::DisjunctionTerms(_25_term); }
mosek::fusion::DisjunctionTerms::DisjunctionTerms
  (monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _25_term) : 
   DisjunctionTerms(new mosek::fusion::p_DisjunctionTerms(this))
{ mosek::fusion::p_DisjunctionTerms::_get_impl(this)->_initialize(_25_term); }
void mosek::fusion::p_DisjunctionTerms::_initialize  (monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _25_term)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    terms = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(::mosek::fusion::p_DJC::term(_25_term).get())});
  }
}
// mosek.fusion.DisjunctionTerms.ctor

void mosek::fusion::p_DisjunctionTerms::destroy()
{
  terms.reset();
}
void mosek::fusion::DisjunctionTerms::destroy() { mosek::fusion::p_DisjunctionTerms::_get_impl(this)->destroy(); }
// } class DisjunctionTerms
// class Term { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:243:4-317:5
mosek::fusion::Term::Term(mosek::fusion::p_Term *_impl) : _impl(_impl) { /*std::cout << "Term() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Term::~Term() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Term::p_Term
  (::mosek::fusion::Term * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.Term.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:261:6-269:7
mosek::fusion::Term::t mosek::fusion::p_Term::_new_Term
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _26_elist,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > > _27_dlist)
{ return new mosek::fusion::Term(_26_elist,_27_dlist); }
mosek::fusion::Term::Term
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _26_elist,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > > _27_dlist) : 
   Term(new mosek::fusion::p_Term(this))
{ mosek::fusion::p_Term::_get_impl(this)->_initialize(_26_elist,_27_dlist); }
void mosek::fusion::p_Term::_initialize  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _26_elist,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > > _27_dlist)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    int32_t _28_n = (int)((_26_elist)->size(0));
    exprs = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_28_n)));
    domains = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 >(monty::shape(_28_n)));
    int32_t _9192_ = (int)0;
    int32_t _9193_ = _28_n;
    for (int32_t _29_i = _9192_; _29_i < _9193_; ++_29_i)
    {
      {
        ((*exprs)(_29_i)) = ((*_26_elist)(_29_i));
        ((*domains)(_29_i)) = ((*_27_dlist)(_29_i));
      }
    }
  }
}
// mosek.fusion.Term.ctor

// mosek.fusion.Term.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:259:6-90
mosek::fusion::Term::t mosek::fusion::p_Term::_new_Term
  (monty::rc_ptr< ::mosek::fusion::Expression > _30_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _31_d)
{ return new mosek::fusion::Term(_30_e,_31_d); }
mosek::fusion::Term::Term
  (monty::rc_ptr< ::mosek::fusion::Expression > _30_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _31_d) : 
   Term(new mosek::fusion::p_Term(this))
{ mosek::fusion::p_Term::_get_impl(this)->_initialize(_30_e,_31_d); }
void mosek::fusion::p_Term::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _30_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _31_d)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    exprs = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_30_e.get())});
    domains = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 >{::monty::rc_ptr<::mosek::fusion::DJCDomain>(_31_d.get())});
  }
}
// mosek.fusion.Term.ctor

// mosek.fusion.Term.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:247:6-255:7
mosek::fusion::Term::t mosek::fusion::p_Term::_new_Term
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > > _32_t)
{ return new mosek::fusion::Term(_32_t); }
mosek::fusion::Term::Term
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > > _32_t) : 
   Term(new mosek::fusion::p_Term(this))
{ mosek::fusion::p_Term::_get_impl(this)->_initialize(_32_t); }
void mosek::fusion::p_Term::_initialize  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > > _32_t)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    int32_t _33_n = (int)((_32_t)->size(0));
    exprs = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_33_n)));
    domains = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 >(monty::shape(_33_n)));
    int32_t _9194_ = (int)0;
    int32_t _9195_ = _33_n;
    for (int32_t _34_i = _9194_; _34_i < _9195_; ++_34_i)
    {
      {
        ((*exprs)(_34_i)) = ((*mosek::fusion::p_Term::_get_impl(((*_32_t)(_34_i)))->exprs)((int)0));
        ((*domains)(_34_i)) = ((*mosek::fusion::p_Term::_get_impl(((*_32_t)(_34_i)))->domains)((int)0));
      }
    }
  }
}
// mosek.fusion.Term.ctor

// Begin mosek.fusion.Term.numaccterms
// Method mosek.fusion.Term.numaccterms @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:316:6-128
int32_t mosek::fusion::p_Term::numaccterms()
{
  int32_t _35_n = (int)0;
  int32_t _9196_ = (int)0;
  int32_t _9197_ = (int)((domains)->size(0));
  for (int32_t _36_i = _9196_; _36_i < _9197_; ++_36_i)
  {
    {
      _35_n += mosek::fusion::p_DJCDomain::_get_impl(((*domains)(_36_i)).get())->numaccterms();
    }
  }
  return _35_n;
}
// End mosek.fusion.Term.numaccterms

// Begin mosek.fusion.Term.numaccrows
// Method mosek.fusion.Term.numaccrows @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:315:6-127
int32_t mosek::fusion::p_Term::numaccrows()
{
  int32_t _37_n = (int)0;
  int32_t _9198_ = (int)0;
  int32_t _9199_ = (int)((domains)->size(0));
  for (int32_t _38_i = _9198_; _38_i < _9199_; ++_38_i)
  {
    {
      _37_n += mosek::fusion::p_DJCDomain::_get_impl(((*domains)(_38_i)).get())->numaccrows();
    }
  }
  return _37_n;
}
// End mosek.fusion.Term.numaccrows

// Begin mosek.fusion.Term.num
// Method mosek.fusion.Term.num @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:314:6-67
int32_t mosek::fusion::p_Term::num()
{
  return (int)((domains)->size(0));
}
// End mosek.fusion.Term.num

// Begin mosek.fusion.Term.size
// Method mosek.fusion.Term.size @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:313:6-121
int32_t mosek::fusion::Term :: size() { return mosek::fusion::p_Term::_get_impl(this)->size(); }
int32_t mosek::fusion::p_Term::size()
{
  int32_t _39_s = (int)0;
  int32_t _9200_ = (int)0;
  int32_t _9201_ = (int)((domains)->size(0));
  for (int32_t _40_i = _9200_; _40_i < _9201_; ++_40_i)
  {
    {
      _39_s += ((*domains)(_40_i))->size();
    }
  }
  return _39_s;
}
// End mosek.fusion.Term.size

// Begin mosek.fusion.Term.toDJCTerm
// Method mosek.fusion.Term.toDJCTerm @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:257:6-53
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::Term :: __mosek_2fusion_2Term__toDJCTerm() { return mosek::fusion::p_Term::_get_impl(this)->__mosek_2fusion_2Term__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::Term::toDJCTerm() { return __mosek_2fusion_2Term__toDJCTerm(); }
/* override: mosek.fusion.ExprDomain.toDJCTerm*/
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::Term::__mosek_2fusion_2ExprDomain__toDJCTerm() { return __mosek_2fusion_2Term__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_Term::__mosek_2fusion_2Term__toDJCTerm()
{
  return ::mosek::fusion::Term::t(_pubthis);
}
// End mosek.fusion.Term.toDJCTerm

void mosek::fusion::p_Term::destroy()
{
  domains.reset();
  exprs.reset();
}
void mosek::fusion::Term::destroy() { mosek::fusion::p_Term::_get_impl(this)->destroy(); }
// } class Term
// class SimpleTerm { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:228:4-230:5
mosek::fusion::SimpleTerm::SimpleTerm(mosek::fusion::p_SimpleTerm *_impl) : mosek::fusion::Term(_impl) { /*std::cout << "SimpleTerm()" << this << std::endl; */ }
mosek::fusion::SimpleTerm::~SimpleTerm() {  /* std::cout << "~SimpleTerm()" << this << std::endl << std::flush; */ }
mosek::fusion::p_SimpleTerm::p_SimpleTerm
  (::mosek::fusion::SimpleTerm * _pubthis) :     mosek::fusion::p_Term(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.SimpleTerm.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:229:6-64
mosek::fusion::SimpleTerm::t mosek::fusion::p_SimpleTerm::_new_SimpleTerm
  (monty::rc_ptr< ::mosek::fusion::Expression > _41_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _42_d)
{ return new mosek::fusion::SimpleTerm(_41_e,_42_d); }
mosek::fusion::SimpleTerm::SimpleTerm
  (monty::rc_ptr< ::mosek::fusion::Expression > _41_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _42_d) : 
   SimpleTerm(new mosek::fusion::p_SimpleTerm(this))
{ mosek::fusion::p_SimpleTerm::_get_impl(this)->_initialize(_41_e,_42_d); }
void mosek::fusion::p_SimpleTerm::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _41_e,
    monty::rc_ptr< ::mosek::fusion::DJCDomain > _42_d)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Term::_initialize(_41_e,_42_d);
  }
}
// mosek.fusion.SimpleTerm.ctor

void mosek::fusion::p_SimpleTerm::destroy()
{
}
void mosek::fusion::SimpleTerm::destroy() { mosek::fusion::p_SimpleTerm::_get_impl(this)->destroy(); }
// } class SimpleTerm
// class DJCDomain { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:171:4-217:5
mosek::fusion::DJCDomain::DJCDomain(mosek::fusion::p_DJCDomain *_impl) : _impl(_impl) { /*std::cout << "DJCDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::DJCDomain::~DJCDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_DJCDomain::p_DJCDomain
  (::mosek::fusion::DJCDomain * _pubthis) :     _pubthis(_pubthis)
{}
mosek::fusion::DJCDomainType mosek::fusion::DJCDomain::get_dom() { return _impl->dom; }
void mosek::fusion::DJCDomain::set_dom(mosek::fusion::DJCDomainType _val) { _impl->dom = _val; }
int32_t mosek::fusion::DJCDomain::get_conedim() { return _impl->conedim; }
void mosek::fusion::DJCDomain::set_conedim(int32_t _val) { _impl->conedim = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::DJCDomain::get_shape() { return _impl->shape; }
void mosek::fusion::DJCDomain::set_shape(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->shape = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::DJCDomain::get_par() { return _impl->par; }
void mosek::fusion::DJCDomain::set_par(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->par = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::DJCDomain::get_b() { return _impl->b; }
void mosek::fusion::DJCDomain::set_b(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->b = _val; }
// mosek.fusion.DJCDomain.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:190:6-199:7
mosek::fusion::DJCDomain::t mosek::fusion::p_DJCDomain::_new_DJCDomain
  (std::shared_ptr< monty::ndarray< double,1 > > _43_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _44_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _45_shape_,
    mosek::fusion::DJCDomainType _46_dom_)
{ return new mosek::fusion::DJCDomain(_43_b_,_44_par_,_45_shape_,_46_dom_); }
mosek::fusion::DJCDomain::DJCDomain
  (std::shared_ptr< monty::ndarray< double,1 > > _43_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _44_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _45_shape_,
    mosek::fusion::DJCDomainType _46_dom_) : 
   DJCDomain(new mosek::fusion::p_DJCDomain(this))
{ mosek::fusion::p_DJCDomain::_get_impl(this)->_initialize(_43_b_,_44_par_,_45_shape_,_46_dom_); }
void mosek::fusion::p_DJCDomain::_initialize  (std::shared_ptr< monty::ndarray< double,1 > > _43_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _44_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _45_shape_,
    mosek::fusion::DJCDomainType _46_dom_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__43_b_(_43_b_ ? _43_b_->raw() : nullptr, _43_b_ ? _43_b_->size(0) : 0);
    _checked_ptr_1<double> _ptr__44_par_(_44_par_ ? _44_par_->raw() : nullptr, _44_par_ ? _44_par_->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__45_shape_(_45_shape_ ? _45_shape_->raw() : nullptr, _45_shape_ ? _45_shape_->size(0) : 0);
    b = _43_b_;
    par = _44_par_;
    shape = _45_shape_;
    dom = _46_dom_;
    conedim = ((int)((_45_shape_)->size(0)) - (int)1);
  }
}
// mosek.fusion.DJCDomain.ctor

// mosek.fusion.DJCDomain.ctor @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:178:6-188:7
mosek::fusion::DJCDomain::t mosek::fusion::p_DJCDomain::_new_DJCDomain
  (std::shared_ptr< monty::ndarray< double,1 > > _47_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _48_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _49_shape_,
    int32_t _50_conedim_,
    mosek::fusion::DJCDomainType _51_dom_)
{ return new mosek::fusion::DJCDomain(_47_b_,_48_par_,_49_shape_,_50_conedim_,_51_dom_); }
mosek::fusion::DJCDomain::DJCDomain
  (std::shared_ptr< monty::ndarray< double,1 > > _47_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _48_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _49_shape_,
    int32_t _50_conedim_,
    mosek::fusion::DJCDomainType _51_dom_) : 
   DJCDomain(new mosek::fusion::p_DJCDomain(this))
{ mosek::fusion::p_DJCDomain::_get_impl(this)->_initialize(_47_b_,_48_par_,_49_shape_,_50_conedim_,_51_dom_); }
void mosek::fusion::p_DJCDomain::_initialize  (std::shared_ptr< monty::ndarray< double,1 > > _47_b_,
    std::shared_ptr< monty::ndarray< double,1 > > _48_par_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _49_shape_,
    int32_t _50_conedim_,
    mosek::fusion::DJCDomainType _51_dom_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__47_b_(_47_b_ ? _47_b_->raw() : nullptr, _47_b_ ? _47_b_->size(0) : 0);
    _checked_ptr_1<double> _ptr__48_par_(_48_par_ ? _48_par_->raw() : nullptr, _48_par_ ? _48_par_->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__49_shape_(_49_shape_ ? _49_shape_->raw() : nullptr, _49_shape_ ? _49_shape_->size(0) : 0);
    b = _47_b_;
    par = _48_par_;
    shape = _49_shape_;
    dom = _51_dom_;
    conedim = _50_conedim_;
  }
}
// mosek.fusion.DJCDomain.ctor

// Begin mosek.fusion.DJCDomain.numaccterms
// Method mosek.fusion.DJCDomain.numaccterms @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:211:6-216:7
int32_t mosek::fusion::p_DJCDomain::numaccterms()
{
  if ((dom == ::mosek::fusion::DJCDomainType::InRange))
  {
    {
      return (int)2;
    }
  }
  else
  {
    {
      return (int)1;
    }
  }
}
// End mosek.fusion.DJCDomain.numaccterms

// Begin mosek.fusion.DJCDomain.numaccrows
// Method mosek.fusion.DJCDomain.numaccrows @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:205:6-210:7
int32_t mosek::fusion::p_DJCDomain::numaccrows()
{
  if ((dom == ::mosek::fusion::DJCDomainType::InRange))
  {
    {
      return safe_mul( _pubthis->size(),(int)2 );
    }
  }
  else
  {
    {
      return _pubthis->size();
    }
  }
}
// End mosek.fusion.DJCDomain.numaccrows

// Begin mosek.fusion.DJCDomain.size
// Method mosek.fusion.DJCDomain.size @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:201:6-204:7
int32_t mosek::fusion::DJCDomain :: size() { return mosek::fusion::p_DJCDomain::_get_impl(this)->size(); }
int32_t mosek::fusion::p_DJCDomain::size()
{
  int32_t _52_s = (int)1;
  int32_t _9202_ = (int)0;
  int32_t _9203_ = (int)((shape)->size(0));
  for (int32_t _53_i = _9202_; _53_i < _9203_; ++_53_i)
  {
    {
      _52_s *= ((*shape)(_53_i));
    }
  }
  return _52_s;
}
// End mosek.fusion.DJCDomain.size

void mosek::fusion::p_DJCDomain::destroy()
{
  shape.reset();
  par.reset();
  b.reset();
}
void mosek::fusion::DJCDomain::destroy() { mosek::fusion::p_DJCDomain::_get_impl(this)->destroy(); }
// } class DJCDomain
// class DJC { // @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:32:4-139:5
mosek::fusion::DJC::DJC(mosek::fusion::p_DJC *_impl) : _impl(_impl) { /*std::cout << "DJC() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::DJC::~DJC() { delete _impl; _impl = nullptr; }
mosek::fusion::p_DJC::p_DJC
  (::mosek::fusion::DJC * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.DJC.ANDFromTerms
// Method mosek.fusion.DJC.ANDFromTerms @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:121:6-137:7
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::ANDFromTerms
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _54_tlist) { return mosek::fusion::p_DJC::ANDFromTerms(_54_tlist); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::ANDFromTerms(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _54_tlist)
{
  int32_t _55_n = (int)0;
  int32_t _9204_ = (int)0;
  int32_t _9205_ = (int)((_54_tlist)->size(0));
  for (int32_t _56_i = _9204_; _56_i < _9205_; ++_56_i)
  {
    {
      _55_n += mosek::fusion::p_Term::_get_impl(((*_54_tlist)(_56_i)).get())->num();
    }
  }
  std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _57_el = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_55_n)));
  std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > > _58_dl = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::DJCDomain >,1 >(monty::shape(_55_n)));
  _55_n = (int)0;
  int32_t _9206_ = (int)0;
  int32_t _9207_ = (int)((_54_tlist)->size(0));
  for (int32_t _59_i = _9206_; _59_i < _9207_; ++_59_i)
  {
    {
      int32_t _9208_ = (int)0;
      int32_t _9209_ = mosek::fusion::p_Term::_get_impl(((*_54_tlist)(_59_i)).get())->num();
      for (int32_t _60_j = _9208_; _60_j < _9209_; ++_60_j)
      {
        {
          ((*_57_el)(_55_n)) = ((*mosek::fusion::p_Term::_get_impl(((*_54_tlist)(_59_i)))->exprs)(_60_j));
          ((*_58_dl)(_55_n)) = ((*mosek::fusion::p_Term::_get_impl(((*_54_tlist)(_59_i)))->domains)(_60_j));
          _55_n += (int)1;
        }
      }
    }
  }
  return ::mosek::fusion::p_Term::_new_Term(_57_el,_58_dl);
}
// End mosek.fusion.DJC.ANDFromTerms

// Begin mosek.fusion.DJC.AND
// Method mosek.fusion.DJC.AND @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:116:6-136
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::AND
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _61_elist) { return mosek::fusion::p_DJC::AND(_61_elist); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::AND(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _61_elist)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Term >> _9210_;
  for (int32_t _62_i = (int)0, _9211_ = (int)((_61_elist)->size(0)); _62_i < _9211_ ; ++_62_i)
  {
    _9210_.push_back(((*_61_elist)(_62_i))->__mosek_2fusion_2ExprDomain__toDJCTerm());
  }
  auto _9212_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(_9210_.size()),_9210_.begin(),_9210_.end()));
  return ::mosek::fusion::p_DJC::ANDFromTerms(_9212_);
}
// End mosek.fusion.DJC.AND

// Begin mosek.fusion.DJC.AND
// Method mosek.fusion.DJC.AND @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:114:6-114
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::AND
  ( monty::rc_ptr< ::mosek::fusion::SimpleTerm > _63_s1,
    monty::rc_ptr< ::mosek::fusion::SimpleTerm > _64_s2,
    monty::rc_ptr< ::mosek::fusion::SimpleTerm > _65_s3) { return mosek::fusion::p_DJC::AND(_63_s1,_64_s2,_65_s3); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::AND(monty::rc_ptr< ::mosek::fusion::SimpleTerm > _63_s1,monty::rc_ptr< ::mosek::fusion::SimpleTerm > _64_s2,monty::rc_ptr< ::mosek::fusion::SimpleTerm > _65_s3)
{
  return ::mosek::fusion::p_DJC::AND(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 >{::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_63_s1.get()),::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_64_s2.get()),::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_65_s3.get())}));
}
// End mosek.fusion.DJC.AND

// Begin mosek.fusion.DJC.AND
// Method mosek.fusion.DJC.AND @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:113:6-96
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::AND
  ( monty::rc_ptr< ::mosek::fusion::SimpleTerm > _66_s1,
    monty::rc_ptr< ::mosek::fusion::SimpleTerm > _67_s2) { return mosek::fusion::p_DJC::AND(_66_s1,_67_s2); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::AND(monty::rc_ptr< ::mosek::fusion::SimpleTerm > _66_s1,monty::rc_ptr< ::mosek::fusion::SimpleTerm > _67_s2)
{
  return ::mosek::fusion::p_DJC::AND(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 >{::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_66_s1.get()),::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_67_s2.get())}));
}
// End mosek.fusion.DJC.AND

// Begin mosek.fusion.DJC.AND
// Method mosek.fusion.DJC.AND @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:112:6-78
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::AND
  ( monty::rc_ptr< ::mosek::fusion::SimpleTerm > _68_s1) { return mosek::fusion::p_DJC::AND(_68_s1); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::AND(monty::rc_ptr< ::mosek::fusion::SimpleTerm > _68_s1)
{
  return ::mosek::fusion::p_DJC::AND(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 >{::monty::rc_ptr<::mosek::fusion::SimpleTerm>(_68_s1.get())}));
}
// End mosek.fusion.DJC.AND

// Begin mosek.fusion.DJC.AND
// Method mosek.fusion.DJC.AND @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:111:6-84
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::DJC::AND
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > > _69_slist) { return mosek::fusion::p_DJC::AND(_69_slist); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_DJC::AND(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::SimpleTerm >,1 > > _69_slist)
{
  return ::mosek::fusion::p_Term::_new_Term(_69_slist);
}
// End mosek.fusion.DJC.AND

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:80:6-109:7
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::Expression > _70_expr,
    monty::rc_ptr< ::mosek::fusion::RangeDomain > _71_dom) { return mosek::fusion::p_DJC::term(_70_expr,_71_dom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::Expression > _70_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _71_dom)
{
  if ((NULL != mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->sparsity.get()))
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Sparse domain is not acceptable in disjunctive constraints"));
    }
  }
  {}
  if (mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->cardinal_flag)
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Integer domain is not acceptable in disjunctive constraints"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< double,1 > > _72_domlb = mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->lb;
  _checked_ptr_1<double> _ptr__72_domlb(_72_domlb ? _72_domlb->raw() : nullptr,_72_domlb ? _72_domlb->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _73_domub = mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->ub;
  _checked_ptr_1<double> _ptr__73_domub(_73_domub ? _73_domub->raw() : nullptr,_73_domub ? _73_domub->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _74_eshape = _70_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__74_eshape(_74_eshape ? _74_eshape->raw() : nullptr,_74_eshape ? _74_eshape->size(0) : 0);
  int64_t _75_esize = _70_expr->getSize();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _76_shape = mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__76_shape(_76_shape ? _76_shape->raw() : nullptr,_76_shape ? _76_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _77_bl;
  _checked_ptr_1<double> _ptr__77_bl(_77_bl ? _77_bl->raw() : nullptr,_77_bl ? _77_bl->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _78_bu;
  _checked_ptr_1<double> _ptr__78_bu(_78_bu ? _78_bu->raw() : nullptr,_78_bu ? _78_bu->size(0) : 0);
  if ((NULL == _76_shape.get()))
  {
    {
      _76_shape = _74_eshape;
      _ptr__76_shape.update(_76_shape ? _76_shape->raw() : nullptr, _76_shape ? _76_shape->size(0) : 0);
    }
  }
  else
  {
    {
      if (((int)((_76_shape)->size(0)) != (int)((_74_eshape)->size(0))))
      {
        {
          throw ::mosek::fusion::DomainError(std::string ("Mismatching shapes"));
        }
      }
      else
      {
        {
          int32_t _9213_ = (int)0;
          int32_t _9214_ = (int)((_76_shape)->size(0));
          for (int32_t _79_i = _9213_; _79_i < _9214_; ++_79_i)
          {
            {
              if ((_ptr__76_shape[_79_i] != _ptr__74_eshape[_79_i]))
              {
                {
                  throw ::mosek::fusion::DomainError(std::string ("Mismatching shapes"));
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  if (mosek::fusion::p_RangeDomain::_get_impl(_71_dom)->scalable)
  {
    {
      std::vector<double> _9215_;
      for (int64_t _80_i = (int)0, _9216_ = _75_esize; _80_i < _9216_ ; ++_80_i)
      {
        _9215_.push_back(_ptr__72_domlb[(int)0]);
      }
      auto _9217_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9215_.size()),_9215_.begin(),_9215_.end()));
      _77_bl = _9217_;
      _ptr__77_bl.update(_77_bl ? _77_bl->raw() : nullptr, _77_bl ? _77_bl->size(0) : 0);
      std::vector<double> _9218_;
      for (int64_t _81_i = (int)0, _9219_ = _75_esize; _81_i < _9219_ ; ++_81_i)
      {
        _9218_.push_back(_ptr__73_domub[(int)0]);
      }
      auto _9220_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9218_.size()),_9218_.begin(),_9218_.end()));
      _78_bu = _9220_;
      _ptr__78_bu.update(_78_bu ? _78_bu->raw() : nullptr, _78_bu ? _78_bu->size(0) : 0);
    }
  }
  else
  {
    {
      _77_bl = _72_domlb;
      _ptr__77_bl.update(_77_bl ? _77_bl->raw() : nullptr, _77_bl ? _77_bl->size(0) : 0);
      _78_bu = _73_domub;
      _ptr__78_bu.update(_78_bu ? _78_bu->raw() : nullptr, _78_bu ? _78_bu->size(0) : 0);
    }
  }
  return ::mosek::fusion::p_SimpleTerm::_new_SimpleTerm(_70_expr,::mosek::fusion::p_DJCDomain::_new_DJCDomain(_77_bl,_78_bu,_76_shape,::mosek::fusion::DJCDomainType::InRange));
}
// End mosek.fusion.DJC.term

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:78:6-105
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::Variable > _82_x,
    monty::rc_ptr< ::mosek::fusion::RangeDomain > _83_dom) { return mosek::fusion::p_DJC::term(_82_x,_83_dom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::Variable > _82_x,monty::rc_ptr< ::mosek::fusion::RangeDomain > _83_dom)
{
  return ::mosek::fusion::p_DJC::term(_82_x->__mosek_2fusion_2Variable__asExpr(),_83_dom);
}
// End mosek.fusion.DJC.term

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:76:6-110
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _84_exprdom) { return mosek::fusion::p_DJC::term(_84_exprdom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _84_exprdom)
{
  return ::mosek::fusion::p_DJC::term(mosek::fusion::p_ExprRangeDomain::_get_impl(_84_exprdom)->expr,mosek::fusion::p_ExprRangeDomain::_get_impl(_84_exprdom)->dom);
}
// End mosek.fusion.DJC.term

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:41:6-73:7
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::Expression > _85_expr,
    monty::rc_ptr< ::mosek::fusion::LinearDomain > _86_dom) { return mosek::fusion::p_DJC::term(_85_expr,_86_dom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::Expression > _85_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _86_dom)
{
  if ((NULL != mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->sparsity.get()))
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Sparse domain is not acceptable in disjunctive constraints"));
    }
  }
  {}
  if (mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->cardinal_flag)
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Integer domain is not acceptable in disjunctive constraints"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< double,1 > > _87_dombnd = mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->bnd;
  _checked_ptr_1<double> _ptr__87_dombnd(_87_dombnd ? _87_dombnd->raw() : nullptr,_87_dombnd ? _87_dombnd->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _88_eshape = _85_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__88_eshape(_88_eshape ? _88_eshape->raw() : nullptr,_88_eshape ? _88_eshape->size(0) : 0);
  int64_t _89_esize = _85_expr->getSize();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _90_shape = mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__90_shape(_90_shape ? _90_shape->raw() : nullptr,_90_shape ? _90_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _91_b;
  _checked_ptr_1<double> _ptr__91_b(_91_b ? _91_b->raw() : nullptr,_91_b ? _91_b->size(0) : 0);
  if ((NULL == _90_shape.get()))
  {
    {
      _90_shape = _88_eshape;
      _ptr__90_shape.update(_90_shape ? _90_shape->raw() : nullptr, _90_shape ? _90_shape->size(0) : 0);
    }
  }
  else
  {
    {
      if (((int)((_90_shape)->size(0)) != (int)((_88_eshape)->size(0))))
      {
        {
          throw ::mosek::fusion::DomainError(std::string ("Mismatching shapes"));
        }
      }
      else
      {
        {
          int32_t _9221_ = (int)0;
          int32_t _9222_ = (int)((_90_shape)->size(0));
          for (int32_t _92_i = _9221_; _92_i < _9222_; ++_92_i)
          {
            {
              if ((_ptr__90_shape[_92_i] != _ptr__88_eshape[_92_i]))
              {
                {
                  throw ::mosek::fusion::DomainError(std::string ("Mismatching shapes"));
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  if ((NULL == mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->bnd.get()))
  {
    {
      _91_b = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_89_esize)));
      _ptr__91_b.update(_91_b ? _91_b->raw() : nullptr, _91_b ? _91_b->size(0) : 0);
    }
  }
  else if(mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->scalable)
  {
    {
      std::vector<double> _9223_;
      for (int64_t _93_i = (int)0, _9224_ = _89_esize; _93_i < _9224_ ; ++_93_i)
      {
        _9223_.push_back(_ptr__87_dombnd[(int)0]);
      }
      auto _9225_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9223_.size()),_9223_.begin(),_9223_.end()));
      _91_b = _9225_;
      _ptr__91_b.update(_91_b ? _91_b->raw() : nullptr, _91_b ? _91_b->size(0) : 0);
    }
  }
  else if(mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->empty)
  {
    {
      _91_b = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_89_esize)));
      _ptr__91_b.update(_91_b ? _91_b->raw() : nullptr, _91_b ? _91_b->size(0) : 0);
    }
  }
  else
  {
    {
      _91_b = _87_dombnd;
      _ptr__91_b.update(_91_b ? _91_b->raw() : nullptr, _91_b ? _91_b->size(0) : 0);
    }
  }
  if ((mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->key == ::mosek::fusion::RelationKey::EqualsTo))
  {
    {
      return ::mosek::fusion::p_SimpleTerm::_new_SimpleTerm(_85_expr,::mosek::fusion::p_DJCDomain::_new_DJCDomain(_91_b,nullptr,_90_shape,::mosek::fusion::DJCDomainType::EqualTo));
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->key == ::mosek::fusion::RelationKey::LessThan))
  {
    {
      return ::mosek::fusion::p_SimpleTerm::_new_SimpleTerm(_85_expr,::mosek::fusion::p_DJCDomain::_new_DJCDomain(_91_b,nullptr,_90_shape,::mosek::fusion::DJCDomainType::LessThan));
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->key == ::mosek::fusion::RelationKey::GreaterThan))
  {
    {
      return ::mosek::fusion::p_SimpleTerm::_new_SimpleTerm(_85_expr,::mosek::fusion::p_DJCDomain::_new_DJCDomain(_91_b,nullptr,_90_shape,::mosek::fusion::DJCDomainType::GreaterThan));
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_86_dom)->key == ::mosek::fusion::RelationKey::IsFree))
  {
    {
      return ::mosek::fusion::p_SimpleTerm::_new_SimpleTerm(_85_expr,::mosek::fusion::p_DJCDomain::_new_DJCDomain(_91_b,nullptr,_90_shape,::mosek::fusion::DJCDomainType::IsFree));
    }
  }
  else
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Invalid linear domain"));
    }
  }
}
// End mosek.fusion.DJC.term

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:36:6-111
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _94_exprdom) { return mosek::fusion::p_DJC::term(_94_exprdom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _94_exprdom)
{
  return ::mosek::fusion::p_DJC::term(mosek::fusion::p_ExprLinearDomain::_get_impl(_94_exprdom)->expr,mosek::fusion::p_ExprLinearDomain::_get_impl(_94_exprdom)->dom);
}
// End mosek.fusion.DJC.term

// Begin mosek.fusion.DJC.term
// Method mosek.fusion.DJC.term @ bld/docker-win/final/default/src/fusion/Disjunction.mbi:33:6-105
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::DJC::term
  ( monty::rc_ptr< ::mosek::fusion::Variable > _95_x,
    monty::rc_ptr< ::mosek::fusion::LinearDomain > _96_dom) { return mosek::fusion::p_DJC::term(_95_x,_96_dom); }
monty::rc_ptr< ::mosek::fusion::SimpleTerm > mosek::fusion::p_DJC::term(monty::rc_ptr< ::mosek::fusion::Variable > _95_x,monty::rc_ptr< ::mosek::fusion::LinearDomain > _96_dom)
{
  return ::mosek::fusion::p_DJC::term(_95_x->__mosek_2fusion_2Variable__asExpr(),_96_dom);
}
// End mosek.fusion.DJC.term

void mosek::fusion::p_DJC::destroy()
{
}
void mosek::fusion::DJC::destroy() { mosek::fusion::p_DJC::_get_impl(this)->destroy(); }
// } class DJC
// class Sort { // @ bld/docker-win/final/default/src/fusion/Sort.mbi:6:4-262:5
mosek::fusion::Sort::Sort(mosek::fusion::p_Sort *_impl) : _impl(_impl) { /*std::cout << "Sort() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Sort::~Sort() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Sort::p_Sort
  (::mosek::fusion::Sort * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Sort.argTransposeSort
// Method mosek.fusion.Sort.argTransposeSort @ bld/docker-win/final/default/src/fusion/Sort.mbi:249:6-261:7
void mosek::fusion::Sort::argTransposeSort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _303_perm,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _304_ptrb,
    int32_t _305_m,
    int32_t _306_n,
    int32_t _307_p,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _308_val) { mosek::fusion::p_Sort::argTransposeSort(_303_perm,_304_ptrb,_305_m,_306_n,_307_p,_308_val); }
void mosek::fusion::p_Sort::argTransposeSort(std::shared_ptr< monty::ndarray< int64_t,1 > > _303_perm,std::shared_ptr< monty::ndarray< int64_t,1 > > _304_ptrb,int32_t _305_m,int32_t _306_n,int32_t _307_p,std::shared_ptr< monty::ndarray< int64_t,1 > > _308_val)
{
  _checked_ptr_1<int64_t> _ptr__303_perm(_303_perm ? _303_perm->raw() : nullptr, _303_perm ? _303_perm->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__304_ptrb(_304_ptrb ? _304_ptrb->raw() : nullptr, _304_ptrb ? _304_ptrb->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__308_val(_308_val ? _308_val->raw() : nullptr, _308_val ? _308_val->size(0) : 0);
  int32_t _9226_ = (int)0;
  int32_t _9227_ = safe_add( safe_mul( _305_m,_307_p ),(int)1 );
  for (int32_t _309_q = _9226_; _309_q < _9227_; ++_309_q)
  {
    {
      _ptr__304_ptrb[_309_q] = (int)0;
    }
  }
  int32_t _9228_ = (int)0;
  int32_t _9229_ = (int)((_308_val)->size(0));
  for (int32_t _310_q = _9228_; _310_q < _9229_; ++_310_q)
  {
    {
      ++ _ptr__304_ptrb[safe_add( safe_add( safe_mul( (_ptr__308_val[_ptr__303_perm[_310_q]] / safe_mul( _306_n,_307_p )),_307_p ),(_ptr__308_val[_ptr__303_perm[_310_q]] % _307_p) ),(int)1 )];
    }
  }
  int32_t _9230_ = (int)0;
  int32_t _9231_ = safe_mul( _305_m,_307_p );
  for (int32_t _311_i = _9230_; _311_i < _9231_; ++_311_i)
  {
    {
      _ptr__304_ptrb[safe_add( _311_i,(int)1 )] = safe_add( _ptr__304_ptrb[safe_add( _311_i,(int)1 )],_ptr__304_ptrb[_311_i] );
    }
  }
  std::vector<int64_t> _9232_;
  for (int32_t _313_i = (int)0, _9233_ = (int)((_303_perm)->size(0)); _313_i < _9233_ ; ++_313_i)
  {
    _9232_.push_back(_ptr__303_perm[_313_i]);
  }
  auto _9234_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9232_.size()),_9232_.begin(),_9232_.end()));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _312_per2 = _9234_;
  _checked_ptr_1<int64_t> _ptr__312_per2(_312_per2 ? _312_per2->raw() : nullptr,_312_per2 ? _312_per2->size(0) : 0);
  int64_t _9235_ = (int64_t)0;
  int64_t _9236_ = (int64_t)((_308_val)->size(0));
  for (int64_t _314_q = _9235_; _314_q < _9236_; ++_314_q)
  {
    {
      int64_t _315_k = safe_add( safe_mul( (_ptr__308_val[_ptr__312_per2[_314_q]] / safe_mul( _306_n,_307_p )),_307_p ),(_ptr__308_val[_ptr__312_per2[_314_q]] % _307_p) );
      _ptr__303_perm[_ptr__304_ptrb[_315_k]] = _ptr__312_per2[_314_q];
      ++ _ptr__304_ptrb[_315_k];
    }
  }
}
// End mosek.fusion.Sort.argTransposeSort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:207:6-210:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _316_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _317_vals1) { mosek::fusion::p_Sort::argsort(_316_idx,_317_vals1); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _316_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _317_vals1)
{
  _checked_ptr_1<int64_t> _ptr__316_idx(_316_idx ? _316_idx->raw() : nullptr, _316_idx ? _316_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__317_vals1(_317_vals1 ? _317_vals1->raw() : nullptr, _317_vals1 ? _317_vals1->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_316_idx,_317_vals1,(int64_t)((int)0),(int64_t)((int)((_316_idx)->size(0))),false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:202:6-205:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _318_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _319_vals1) { mosek::fusion::p_Sort::argsort(_318_idx,_319_vals1); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _318_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _319_vals1)
{
  _checked_ptr_1<int64_t> _ptr__318_idx(_318_idx ? _318_idx->raw() : nullptr, _318_idx ? _318_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__319_vals1(_319_vals1 ? _319_vals1->raw() : nullptr, _319_vals1 ? _319_vals1->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_318_idx,_319_vals1,(int64_t)((int)0),(int64_t)((int)((_318_idx)->size(0))),false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:197:6-200:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _320_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _321_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _322_vals2) { mosek::fusion::p_Sort::argsort(_320_idx,_321_vals1,_322_vals2); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _320_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _321_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _322_vals2)
{
  _checked_ptr_1<int64_t> _ptr__320_idx(_320_idx ? _320_idx->raw() : nullptr, _320_idx ? _320_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__321_vals1(_321_vals1 ? _321_vals1->raw() : nullptr, _321_vals1 ? _321_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__322_vals2(_322_vals2 ? _322_vals2->raw() : nullptr, _322_vals2 ? _322_vals2->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_320_idx,_321_vals1,_322_vals2,(int64_t)((int)0),(int64_t)((int)((_320_idx)->size(0))),false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:193:6-196:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _323_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _324_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _325_vals2) { mosek::fusion::p_Sort::argsort(_323_idx,_324_vals1,_325_vals2); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _323_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _324_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _325_vals2)
{
  _checked_ptr_1<int64_t> _ptr__323_idx(_323_idx ? _323_idx->raw() : nullptr, _323_idx ? _323_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__324_vals1(_324_vals1 ? _324_vals1->raw() : nullptr, _324_vals1 ? _324_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__325_vals2(_325_vals2 ? _325_vals2->raw() : nullptr, _325_vals2 ? _325_vals2->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_323_idx,_324_vals1,_325_vals2,(int64_t)((int)0),(int64_t)((int)((_323_idx)->size(0))),false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:188:6-191:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _326_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _327_vals1,
    int64_t _328_first,
    int64_t _329_last) { mosek::fusion::p_Sort::argsort(_326_idx,_327_vals1,_328_first,_329_last); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _326_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _327_vals1,int64_t _328_first,int64_t _329_last)
{
  _checked_ptr_1<int64_t> _ptr__326_idx(_326_idx ? _326_idx->raw() : nullptr, _326_idx ? _326_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__327_vals1(_327_vals1 ? _327_vals1->raw() : nullptr, _327_vals1 ? _327_vals1->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_326_idx,_327_vals1,_328_first,_329_last,false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:183:6-186:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _330_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _331_vals1,
    int64_t _332_first,
    int64_t _333_last) { mosek::fusion::p_Sort::argsort(_330_idx,_331_vals1,_332_first,_333_last); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _330_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _331_vals1,int64_t _332_first,int64_t _333_last)
{
  _checked_ptr_1<int64_t> _ptr__330_idx(_330_idx ? _330_idx->raw() : nullptr, _330_idx ? _330_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__331_vals1(_331_vals1 ? _331_vals1->raw() : nullptr, _331_vals1 ? _331_vals1->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_330_idx,_331_vals1,_332_first,_333_last,false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:178:6-181:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _334_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _335_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _336_vals2,
    int64_t _337_first,
    int64_t _338_last) { mosek::fusion::p_Sort::argsort(_334_idx,_335_vals1,_336_vals2,_337_first,_338_last); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _334_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _335_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _336_vals2,int64_t _337_first,int64_t _338_last)
{
  _checked_ptr_1<int64_t> _ptr__334_idx(_334_idx ? _334_idx->raw() : nullptr, _334_idx ? _334_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__335_vals1(_335_vals1 ? _335_vals1->raw() : nullptr, _335_vals1 ? _335_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__336_vals2(_336_vals2 ? _336_vals2->raw() : nullptr, _336_vals2 ? _336_vals2->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_334_idx,_335_vals1,_336_vals2,_337_first,_338_last,false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:174:6-177:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _339_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _340_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _341_vals2,
    int64_t _342_first,
    int64_t _343_last) { mosek::fusion::p_Sort::argsort(_339_idx,_340_vals1,_341_vals2,_342_first,_343_last); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _339_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _340_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _341_vals2,int64_t _342_first,int64_t _343_last)
{
  _checked_ptr_1<int64_t> _ptr__339_idx(_339_idx ? _339_idx->raw() : nullptr, _339_idx ? _339_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__340_vals1(_340_vals1 ? _340_vals1->raw() : nullptr, _340_vals1 ? _340_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__341_vals2(_341_vals2 ? _341_vals2->raw() : nullptr, _341_vals2 ? _341_vals2->size(0) : 0);
  ::mosek::fusion::p_Sort::argsort(_339_idx,_340_vals1,_341_vals2,_342_first,_343_last,false);
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:156:6-171:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _344_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _345_vals1,
    int64_t _346_first,
    int64_t _347_last,
    bool _348_check) { mosek::fusion::p_Sort::argsort(_344_idx,_345_vals1,_346_first,_347_last,_348_check); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _344_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _345_vals1,int64_t _346_first,int64_t _347_last,bool _348_check)
{
  _checked_ptr_1<int64_t> _ptr__344_idx(_344_idx ? _344_idx->raw() : nullptr, _344_idx ? _344_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__345_vals1(_345_vals1 ? _345_vals1->raw() : nullptr, _345_vals1 ? _345_vals1->size(0) : 0);
  if (((!_348_check) || ((_347_last - _346_first) < (int)16)))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_344_idx,_345_vals1,_346_first,_347_last);
    }
  }
  else if((!::mosek::fusion::p_Sort::issorted(_344_idx,_345_vals1,_346_first,_347_last,_348_check)))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _349_minmax = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)4)));
      _checked_ptr_1<int64_t> _ptr__349_minmax(_349_minmax ? _349_minmax->raw() : nullptr,_349_minmax ? _349_minmax->size(0) : 0);
      int32_t _350_scale = (int)2;
      ::mosek::fusion::p_Sort::getminmax(_344_idx,_345_vals1,nullptr,_346_first,_347_last,_349_minmax);
      if (((_ptr__349_minmax[(int)1] - _ptr__349_minmax[(int)0]) < safe_mul( _350_scale,(_347_last - _346_first) )))
      {
        {
          ::mosek::fusion::p_Sort::argbucketsort(_344_idx,_345_vals1,_346_first,_347_last,_ptr__349_minmax[(int)0],_ptr__349_minmax[(int)1]);
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::argsort(_344_idx,_345_vals1,_346_first,_347_last);
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:137:6-154:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _351_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _352_vals1,
    int64_t _353_first,
    int64_t _354_last,
    bool _355_check) { mosek::fusion::p_Sort::argsort(_351_idx,_352_vals1,_353_first,_354_last,_355_check); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _351_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _352_vals1,int64_t _353_first,int64_t _354_last,bool _355_check)
{
  _checked_ptr_1<int64_t> _ptr__351_idx(_351_idx ? _351_idx->raw() : nullptr, _351_idx ? _351_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__352_vals1(_352_vals1 ? _352_vals1->raw() : nullptr, _352_vals1 ? _352_vals1->size(0) : 0);
  if (((!_355_check) || ((_354_last - _353_first) < (int)16)))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_351_idx,_352_vals1,_353_first,_354_last);
    }
  }
  else if((!::mosek::fusion::p_Sort::issorted(_351_idx,_352_vals1,_353_first,_354_last,_355_check)))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _356_minmax = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)4)));
      _checked_ptr_1<int32_t> _ptr__356_minmax(_356_minmax ? _356_minmax->raw() : nullptr,_356_minmax ? _356_minmax->size(0) : 0);
      int32_t _357_scale = (int)2;
      ::mosek::fusion::p_Sort::getminmax(_351_idx,_352_vals1,nullptr,_353_first,_354_last,_356_minmax);
      if (((_ptr__356_minmax[(int)1] - _ptr__356_minmax[(int)0]) < safe_mul( _357_scale,(_354_last - _353_first) )))
      {
        {
          ::mosek::fusion::p_Sort::argbucketsort(_351_idx,_352_vals1,_353_first,_354_last,_ptr__356_minmax[(int)0],_ptr__356_minmax[(int)1]);
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::argsort(_351_idx,_352_vals1,_353_first,_354_last);
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:116:6-135:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _358_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _359_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _360_vals2,
    int64_t _361_first,
    int64_t _362_last,
    bool _363_check) { mosek::fusion::p_Sort::argsort(_358_idx,_359_vals1,_360_vals2,_361_first,_362_last,_363_check); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _358_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _359_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _360_vals2,int64_t _361_first,int64_t _362_last,bool _363_check)
{
  _checked_ptr_1<int64_t> _ptr__358_idx(_358_idx ? _358_idx->raw() : nullptr, _358_idx ? _358_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__359_vals1(_359_vals1 ? _359_vals1->raw() : nullptr, _359_vals1 ? _359_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__360_vals2(_360_vals2 ? _360_vals2->raw() : nullptr, _360_vals2 ? _360_vals2->size(0) : 0);
  if (((!_363_check) || ((_362_last - _361_first) < (int)16)))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_358_idx,_359_vals1,_360_vals2,_361_first,_362_last);
    }
  }
  else if((!::mosek::fusion::p_Sort::issorted(_358_idx,_359_vals1,_360_vals2,_361_first,_362_last,_363_check)))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _364_minmax = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)4)));
      _checked_ptr_1<int64_t> _ptr__364_minmax(_364_minmax ? _364_minmax->raw() : nullptr,_364_minmax ? _364_minmax->size(0) : 0);
      int32_t _365_scale = (int)2;
      ::mosek::fusion::p_Sort::getminmax(_358_idx,_359_vals1,_360_vals2,_361_first,_362_last,_364_minmax);
      if ((((_ptr__364_minmax[(int)1] - _ptr__364_minmax[(int)0]) < safe_mul( _365_scale,(_362_last - _361_first) )) && ((_ptr__364_minmax[(int)3] - _ptr__364_minmax[(int)2]) < safe_mul( _365_scale,(_362_last - _361_first) ))))
      {
        {
          ::mosek::fusion::p_Sort::argbucketsort(_358_idx,_360_vals2,_361_first,_362_last,_ptr__364_minmax[(int)2],_ptr__364_minmax[(int)3]);
          ::mosek::fusion::p_Sort::argbucketsort(_358_idx,_359_vals1,_361_first,_362_last,_ptr__364_minmax[(int)0],_ptr__364_minmax[(int)1]);
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::argsort(_358_idx,_359_vals1,_360_vals2,_361_first,_362_last);
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argsort
// Method mosek.fusion.Sort.argsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:95:6-114:7
void mosek::fusion::Sort::argsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _366_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _367_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _368_vals2,
    int64_t _369_first,
    int64_t _370_last,
    bool _371_check) { mosek::fusion::p_Sort::argsort(_366_idx,_367_vals1,_368_vals2,_369_first,_370_last,_371_check); }
void mosek::fusion::p_Sort::argsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _366_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _367_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _368_vals2,int64_t _369_first,int64_t _370_last,bool _371_check)
{
  _checked_ptr_1<int64_t> _ptr__366_idx(_366_idx ? _366_idx->raw() : nullptr, _366_idx ? _366_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__367_vals1(_367_vals1 ? _367_vals1->raw() : nullptr, _367_vals1 ? _367_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__368_vals2(_368_vals2 ? _368_vals2->raw() : nullptr, _368_vals2 ? _368_vals2->size(0) : 0);
  if (((!_371_check) || ((_370_last - _369_first) < (int)16)))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_366_idx,_367_vals1,_368_vals2,_369_first,_370_last);
    }
  }
  else if((!::mosek::fusion::p_Sort::issorted(_366_idx,_367_vals1,_368_vals2,_369_first,_370_last,_371_check)))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _372_minmax = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)4)));
      _checked_ptr_1<int32_t> _ptr__372_minmax(_372_minmax ? _372_minmax->raw() : nullptr,_372_minmax ? _372_minmax->size(0) : 0);
      int32_t _373_scale = (int)2;
      ::mosek::fusion::p_Sort::getminmax(_366_idx,_367_vals1,_368_vals2,_369_first,_370_last,_372_minmax);
      if ((((_ptr__372_minmax[(int)1] - _ptr__372_minmax[(int)0]) < safe_mul( _373_scale,(_370_last - _369_first) )) && ((_ptr__372_minmax[(int)3] - _ptr__372_minmax[(int)2]) < safe_mul( _373_scale,(_370_last - _369_first) ))))
      {
        {
          ::mosek::fusion::p_Sort::argbucketsort(_366_idx,_368_vals2,_369_first,_370_last,_ptr__372_minmax[(int)2],_ptr__372_minmax[(int)3]);
          ::mosek::fusion::p_Sort::argbucketsort(_366_idx,_367_vals1,_369_first,_370_last,_ptr__372_minmax[(int)0],_ptr__372_minmax[(int)1]);
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::argsort(_366_idx,_367_vals1,_368_vals2,_369_first,_370_last);
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.argsort

// Begin mosek.fusion.Sort.argbucketsort
// Method mosek.fusion.Sort.argbucketsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:90:6-93:7
void mosek::fusion::Sort::argbucketsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _374_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _375_vals,
    int64_t _376_first,
    int64_t _377_last,
    int64_t _378_minv,
    int64_t _379_maxv) { mosek::fusion::p_Sort::argbucketsort(_374_idx,_375_vals,_376_first,_377_last,_378_minv,_379_maxv); }
void mosek::fusion::p_Sort::argbucketsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _374_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _375_vals,int64_t _376_first,int64_t _377_last,int64_t _378_minv,int64_t _379_maxv)
{
  _checked_ptr_1<int64_t> _ptr__374_idx(_374_idx ? _374_idx->raw() : nullptr, _374_idx ? _374_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__375_vals(_375_vals ? _375_vals->raw() : nullptr, _375_vals ? _375_vals->size(0) : 0);
  ::mosek::fusion::Utils::Tools::bucketsort(_374_idx,_376_first,_377_last,_375_vals,_378_minv,_379_maxv);
}
// End mosek.fusion.Sort.argbucketsort

// Begin mosek.fusion.Sort.argbucketsort
// Method mosek.fusion.Sort.argbucketsort @ bld/docker-win/final/default/src/fusion/Sort.mbi:85:6-88:7
void mosek::fusion::Sort::argbucketsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _380_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _381_vals,
    int64_t _382_first,
    int64_t _383_last,
    int32_t _384_minv,
    int32_t _385_maxv) { mosek::fusion::p_Sort::argbucketsort(_380_idx,_381_vals,_382_first,_383_last,_384_minv,_385_maxv); }
void mosek::fusion::p_Sort::argbucketsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _380_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _381_vals,int64_t _382_first,int64_t _383_last,int32_t _384_minv,int32_t _385_maxv)
{
  _checked_ptr_1<int64_t> _ptr__380_idx(_380_idx ? _380_idx->raw() : nullptr, _380_idx ? _380_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__381_vals(_381_vals ? _381_vals->raw() : nullptr, _381_vals ? _381_vals->size(0) : 0);
  ::mosek::fusion::Utils::Tools::bucketsort(_380_idx,_382_first,_383_last,_381_vals,_384_minv,_385_maxv);
}
// End mosek.fusion.Sort.argbucketsort

// Begin mosek.fusion.Sort.getminmax
// Method mosek.fusion.Sort.getminmax @ bld/docker-win/final/default/src/fusion/Sort.mbi:61:6-80:7
void mosek::fusion::Sort::getminmax
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _386_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _387_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _388_vals2,
    int64_t _389_first,
    int64_t _390_last,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _391_res) { mosek::fusion::p_Sort::getminmax(_386_idx,_387_vals1,_388_vals2,_389_first,_390_last,_391_res); }
void mosek::fusion::p_Sort::getminmax(std::shared_ptr< monty::ndarray< int64_t,1 > > _386_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _387_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _388_vals2,int64_t _389_first,int64_t _390_last,std::shared_ptr< monty::ndarray< int64_t,1 > > _391_res)
{
  _checked_ptr_1<int64_t> _ptr__386_idx(_386_idx ? _386_idx->raw() : nullptr, _386_idx ? _386_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__387_vals1(_387_vals1 ? _387_vals1->raw() : nullptr, _387_vals1 ? _387_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__388_vals2(_388_vals2 ? _388_vals2->raw() : nullptr, _388_vals2 ? _388_vals2->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__391_res(_391_res ? _391_res->raw() : nullptr, _391_res ? _391_res->size(0) : 0);
  _ptr__391_res[(int)0] = _ptr__387_vals1[_ptr__386_idx[_389_first]];
  _ptr__391_res[(int)1] = _ptr__387_vals1[_ptr__386_idx[_389_first]];
  int64_t _9237_ = safe_add( _389_first,(int)1 );
  int64_t _9238_ = _390_last;
  for (int64_t _392_i = _9237_; _392_i < _9238_; ++_392_i)
  {
    {
      if ((_ptr__391_res[(int)0] > _ptr__387_vals1[_ptr__386_idx[_392_i]]))
      {
        {
          _ptr__391_res[(int)0] = _ptr__387_vals1[_ptr__386_idx[_392_i]];
        }
      }
      {}
      if ((_ptr__391_res[(int)1] < _ptr__387_vals1[_ptr__386_idx[_392_i]]))
      {
        {
          _ptr__391_res[(int)1] = _ptr__387_vals1[_ptr__386_idx[_392_i]];
        }
      }
      {}
    }
  }
  if ((NULL != _388_vals2.get()))
  {
    {
      _ptr__391_res[(int)2] = _ptr__388_vals2[_ptr__386_idx[_389_first]];
      _ptr__391_res[(int)3] = _ptr__388_vals2[_ptr__386_idx[_389_first]];
      int64_t _9239_ = safe_add( _389_first,(int)1 );
      int64_t _9240_ = _390_last;
      for (int64_t _393_i = _9239_; _393_i < _9240_; ++_393_i)
      {
        {
          if ((_ptr__391_res[(int)2] > _ptr__388_vals2[_ptr__386_idx[_393_i]]))
          {
            {
              _ptr__391_res[(int)2] = _ptr__388_vals2[_ptr__386_idx[_393_i]];
            }
          }
          {}
          if ((_ptr__391_res[(int)3] < _ptr__388_vals2[_ptr__386_idx[_393_i]]))
          {
            {
              _ptr__391_res[(int)3] = _ptr__388_vals2[_ptr__386_idx[_393_i]];
            }
          }
          {}
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.getminmax

// Begin mosek.fusion.Sort.getminmax
// Method mosek.fusion.Sort.getminmax @ bld/docker-win/final/default/src/fusion/Sort.mbi:40:6-59:7
void mosek::fusion::Sort::getminmax
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _394_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _395_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _396_vals2,
    int64_t _397_first,
    int64_t _398_last,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _399_res) { mosek::fusion::p_Sort::getminmax(_394_idx,_395_vals1,_396_vals2,_397_first,_398_last,_399_res); }
void mosek::fusion::p_Sort::getminmax(std::shared_ptr< monty::ndarray< int64_t,1 > > _394_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _395_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _396_vals2,int64_t _397_first,int64_t _398_last,std::shared_ptr< monty::ndarray< int32_t,1 > > _399_res)
{
  _checked_ptr_1<int64_t> _ptr__394_idx(_394_idx ? _394_idx->raw() : nullptr, _394_idx ? _394_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__395_vals1(_395_vals1 ? _395_vals1->raw() : nullptr, _395_vals1 ? _395_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__396_vals2(_396_vals2 ? _396_vals2->raw() : nullptr, _396_vals2 ? _396_vals2->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__399_res(_399_res ? _399_res->raw() : nullptr, _399_res ? _399_res->size(0) : 0);
  _ptr__399_res[(int)0] = _ptr__395_vals1[_ptr__394_idx[_397_first]];
  _ptr__399_res[(int)1] = _ptr__395_vals1[_ptr__394_idx[_397_first]];
  int64_t _9241_ = safe_add( _397_first,(int)1 );
  int64_t _9242_ = _398_last;
  for (int64_t _400_i = _9241_; _400_i < _9242_; ++_400_i)
  {
    {
      if ((_ptr__399_res[(int)0] > _ptr__395_vals1[_ptr__394_idx[_400_i]]))
      {
        {
          _ptr__399_res[(int)0] = _ptr__395_vals1[_ptr__394_idx[_400_i]];
        }
      }
      {}
      if ((_ptr__399_res[(int)1] < _ptr__395_vals1[_ptr__394_idx[_400_i]]))
      {
        {
          _ptr__399_res[(int)1] = _ptr__395_vals1[_ptr__394_idx[_400_i]];
        }
      }
      {}
    }
  }
  if ((NULL != _396_vals2.get()))
  {
    {
      _ptr__399_res[(int)2] = _ptr__396_vals2[_ptr__394_idx[_397_first]];
      _ptr__399_res[(int)3] = _ptr__396_vals2[_ptr__394_idx[_397_first]];
      int64_t _9243_ = safe_add( _397_first,(int)1 );
      int64_t _9244_ = _398_last;
      for (int64_t _401_i = _9243_; _401_i < _9244_; ++_401_i)
      {
        {
          if ((_ptr__399_res[(int)2] > _ptr__396_vals2[_ptr__394_idx[_401_i]]))
          {
            {
              _ptr__399_res[(int)2] = _ptr__396_vals2[_ptr__394_idx[_401_i]];
            }
          }
          {}
          if ((_ptr__399_res[(int)3] < _ptr__396_vals2[_ptr__394_idx[_401_i]]))
          {
            {
              _ptr__399_res[(int)3] = _ptr__396_vals2[_ptr__394_idx[_401_i]];
            }
          }
          {}
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Sort.getminmax

// Begin mosek.fusion.Sort.issorted
// Method mosek.fusion.Sort.issorted @ bld/docker-win/final/default/src/fusion/Sort.mbi:32:6-38:7
bool mosek::fusion::Sort::issorted
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _402_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _403_vals1,
    int64_t _404_first,
    int64_t _405_last,
    bool _406_check) { return mosek::fusion::p_Sort::issorted(_402_idx,_403_vals1,_404_first,_405_last,_406_check); }
bool mosek::fusion::p_Sort::issorted(std::shared_ptr< monty::ndarray< int64_t,1 > > _402_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _403_vals1,int64_t _404_first,int64_t _405_last,bool _406_check)
{
  _checked_ptr_1<int64_t> _ptr__402_idx(_402_idx ? _402_idx->raw() : nullptr, _402_idx ? _402_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__403_vals1(_403_vals1 ? _403_vals1->raw() : nullptr, _403_vals1 ? _403_vals1->size(0) : 0);
  int64_t _9245_ = _404_first;
  int64_t _9246_ = (_405_last - (int)1);
  for (int64_t _407_i = _9245_; _407_i < _9246_; ++_407_i)
  {
    {
      if ((_ptr__403_vals1[_ptr__402_idx[_407_i]] > _ptr__403_vals1[_ptr__402_idx[safe_add( _407_i,(int)1 )]]))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.Sort.issorted

// Begin mosek.fusion.Sort.issorted
// Method mosek.fusion.Sort.issorted @ bld/docker-win/final/default/src/fusion/Sort.mbi:24:6-30:7
bool mosek::fusion::Sort::issorted
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _408_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _409_vals1,
    int64_t _410_first,
    int64_t _411_last,
    bool _412_check) { return mosek::fusion::p_Sort::issorted(_408_idx,_409_vals1,_410_first,_411_last,_412_check); }
bool mosek::fusion::p_Sort::issorted(std::shared_ptr< monty::ndarray< int64_t,1 > > _408_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _409_vals1,int64_t _410_first,int64_t _411_last,bool _412_check)
{
  _checked_ptr_1<int64_t> _ptr__408_idx(_408_idx ? _408_idx->raw() : nullptr, _408_idx ? _408_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__409_vals1(_409_vals1 ? _409_vals1->raw() : nullptr, _409_vals1 ? _409_vals1->size(0) : 0);
  int64_t _9247_ = _410_first;
  int64_t _9248_ = (_411_last - (int)1);
  for (int64_t _413_i = _9247_; _413_i < _9248_; ++_413_i)
  {
    {
      if ((_ptr__409_vals1[_ptr__408_idx[_413_i]] > _ptr__409_vals1[_ptr__408_idx[safe_add( _413_i,(int)1 )]]))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.Sort.issorted

// Begin mosek.fusion.Sort.issorted
// Method mosek.fusion.Sort.issorted @ bld/docker-win/final/default/src/fusion/Sort.mbi:16:6-22:7
bool mosek::fusion::Sort::issorted
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _414_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _415_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _416_vals2,
    int64_t _417_first,
    int64_t _418_last,
    bool _419_check) { return mosek::fusion::p_Sort::issorted(_414_idx,_415_vals1,_416_vals2,_417_first,_418_last,_419_check); }
bool mosek::fusion::p_Sort::issorted(std::shared_ptr< monty::ndarray< int64_t,1 > > _414_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _415_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _416_vals2,int64_t _417_first,int64_t _418_last,bool _419_check)
{
  _checked_ptr_1<int64_t> _ptr__414_idx(_414_idx ? _414_idx->raw() : nullptr, _414_idx ? _414_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__415_vals1(_415_vals1 ? _415_vals1->raw() : nullptr, _415_vals1 ? _415_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__416_vals2(_416_vals2 ? _416_vals2->raw() : nullptr, _416_vals2 ? _416_vals2->size(0) : 0);
  int64_t _9249_ = _417_first;
  int64_t _9250_ = (_418_last - (int)1);
  for (int64_t _420_i = _9249_; _420_i < _9250_; ++_420_i)
  {
    {
      if (((_ptr__415_vals1[_ptr__414_idx[_420_i]] > _ptr__415_vals1[_ptr__414_idx[safe_add( _420_i,(int)1 )]]) || ((_ptr__415_vals1[_ptr__414_idx[safe_add( _420_i,(int)1 )]] == _ptr__415_vals1[_ptr__414_idx[_420_i]]) && (_ptr__416_vals2[_ptr__414_idx[_420_i]] > _ptr__416_vals2[_ptr__414_idx[safe_add( _420_i,(int)1 )]]))))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.Sort.issorted

// Begin mosek.fusion.Sort.issorted
// Method mosek.fusion.Sort.issorted @ bld/docker-win/final/default/src/fusion/Sort.mbi:8:6-14:7
bool mosek::fusion::Sort::issorted
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _421_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _422_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _423_vals2,
    int64_t _424_first,
    int64_t _425_last,
    bool _426_check) { return mosek::fusion::p_Sort::issorted(_421_idx,_422_vals1,_423_vals2,_424_first,_425_last,_426_check); }
bool mosek::fusion::p_Sort::issorted(std::shared_ptr< monty::ndarray< int64_t,1 > > _421_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _422_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _423_vals2,int64_t _424_first,int64_t _425_last,bool _426_check)
{
  _checked_ptr_1<int64_t> _ptr__421_idx(_421_idx ? _421_idx->raw() : nullptr, _421_idx ? _421_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__422_vals1(_422_vals1 ? _422_vals1->raw() : nullptr, _422_vals1 ? _422_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__423_vals2(_423_vals2 ? _423_vals2->raw() : nullptr, _423_vals2 ? _423_vals2->size(0) : 0);
  int64_t _9251_ = _424_first;
  int64_t _9252_ = (_425_last - (int)1);
  for (int64_t _427_i = _9251_; _427_i < _9252_; ++_427_i)
  {
    {
      if (((_ptr__422_vals1[_ptr__421_idx[_427_i]] > _ptr__422_vals1[_ptr__421_idx[safe_add( _427_i,(int)1 )]]) || ((_ptr__422_vals1[_ptr__421_idx[_427_i]] == _ptr__422_vals1[_ptr__421_idx[safe_add( _427_i,(int)1 )]]) && (_ptr__423_vals2[_ptr__421_idx[_427_i]] > _ptr__423_vals2[_ptr__421_idx[safe_add( _427_i,(int)1 )]]))))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.Sort.issorted

void mosek::fusion::p_Sort::destroy()
{
}
void mosek::fusion::Sort::destroy() { mosek::fusion::p_Sort::_get_impl(this)->destroy(); }
// } class Sort
// class IndexCounter { // @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:448:4-525:5
mosek::fusion::IndexCounter::IndexCounter(mosek::fusion::p_IndexCounter *_impl) : _impl(_impl) { /*std::cout << "IndexCounter() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::IndexCounter::~IndexCounter() { delete _impl; _impl = nullptr; }
mosek::fusion::p_IndexCounter::p_IndexCounter
  (::mosek::fusion::IndexCounter * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.IndexCounter.ctor @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:488:6-498:7
mosek::fusion::IndexCounter::t mosek::fusion::p_IndexCounter::_new_IndexCounter
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _428_shape)
{ return new mosek::fusion::IndexCounter(_428_shape); }
mosek::fusion::IndexCounter::IndexCounter
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _428_shape) : 
   IndexCounter(new mosek::fusion::p_IndexCounter(this))
{ mosek::fusion::p_IndexCounter::_get_impl(this)->_initialize(_428_shape); }
void mosek::fusion::p_IndexCounter::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _428_shape)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__428_shape(_428_shape ? _428_shape->raw() : nullptr, _428_shape ? _428_shape->size(0) : 0);
    n = (int)((_428_shape)->size(0));
    ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(n)));
    st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(n)));
    start = (int64_t)0;
    strides = ::mosek::fusion::p_Set::strides(_428_shape);
    std::vector<int32_t> _9253_;
    for (int32_t _429_i = (int)0, _9254_ = (int)((_428_shape)->size(0)); _429_i < _9254_ ; ++_429_i)
    {
      _9253_.push_back(_ptr__428_shape[_429_i]);
    }
    auto _9255_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9253_.size()),_9253_.begin(),_9253_.end()));
    dims = _9255_;
  }
}
// mosek.fusion.IndexCounter.ctor

// mosek.fusion.IndexCounter.ctor @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:473:6-486:7
mosek::fusion::IndexCounter::t mosek::fusion::p_IndexCounter::_new_IndexCounter
  (int64_t _430_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _431_dims_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _432_shape)
{ return new mosek::fusion::IndexCounter(_430_start_,_431_dims_,_432_shape); }
mosek::fusion::IndexCounter::IndexCounter
  (int64_t _430_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _431_dims_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _432_shape) : 
   IndexCounter(new mosek::fusion::p_IndexCounter(this))
{ mosek::fusion::p_IndexCounter::_get_impl(this)->_initialize(_430_start_,_431_dims_,_432_shape); }
void mosek::fusion::p_IndexCounter::_initialize  (int64_t _430_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _431_dims_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _432_shape)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__431_dims_(_431_dims_ ? _431_dims_->raw() : nullptr, _431_dims_ ? _431_dims_->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__432_shape(_432_shape ? _432_shape->raw() : nullptr, _432_shape ? _432_shape->size(0) : 0);
    int32_t _433_nd = (int)((_432_shape)->size(0));
    n = (int)((_431_dims_)->size(0));
    ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(n)));
    st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(n)));
    int32_t _9256_ = (int)0;
    int32_t _9257_ = n;
    for (int32_t _434_i = _9256_; _434_i < _9257_; ++_434_i)
    {
      {
        ((*st)(_434_i)) = _430_start_;
      }
    }
    strides = ::mosek::fusion::p_Set::strides(_432_shape);
    dims = _431_dims_;
    start = _430_start_;
  }
}
// mosek.fusion.IndexCounter.ctor

// mosek.fusion.IndexCounter.ctor @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:459:6-471:7
mosek::fusion::IndexCounter::t mosek::fusion::p_IndexCounter::_new_IndexCounter
  (int64_t _435_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _436_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _437_strides_)
{ return new mosek::fusion::IndexCounter(_435_start_,_436_dims_,_437_strides_); }
mosek::fusion::IndexCounter::IndexCounter
  (int64_t _435_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _436_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _437_strides_) : 
   IndexCounter(new mosek::fusion::p_IndexCounter(this))
{ mosek::fusion::p_IndexCounter::_get_impl(this)->_initialize(_435_start_,_436_dims_,_437_strides_); }
void mosek::fusion::p_IndexCounter::_initialize  (int64_t _435_start_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _436_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _437_strides_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__436_dims_(_436_dims_ ? _436_dims_->raw() : nullptr, _436_dims_ ? _436_dims_->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__437_strides_(_437_strides_ ? _437_strides_->raw() : nullptr, _437_strides_ ? _437_strides_->size(0) : 0);
    n = (int)((_436_dims_)->size(0));
    ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(n)));
    st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(n)));
    int32_t _9258_ = (int)0;
    int32_t _9259_ = n;
    for (int32_t _438_i = _9258_; _438_i < _9259_; ++_438_i)
    {
      {
        ((*st)(_438_i)) = _435_start_;
      }
    }
    strides = _437_strides_;
    dims = _436_dims_;
    start = _435_start_;
  }
}
// mosek.fusion.IndexCounter.ctor

// Begin mosek.fusion.IndexCounter.atEnd
// Method mosek.fusion.IndexCounter.atEnd @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:524:6-66
bool mosek::fusion::IndexCounter :: atEnd() { return mosek::fusion::p_IndexCounter::_get_impl(this)->atEnd(); }
bool mosek::fusion::p_IndexCounter::atEnd()
{
  return (((*ii)((n - (int)1))) >= ((*dims)((n - (int)1))));
}
// End mosek.fusion.IndexCounter.atEnd

// Begin mosek.fusion.IndexCounter.getIndex
// Method mosek.fusion.IndexCounter.getIndex @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:522:6-54
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::IndexCounter :: getIndex() { return mosek::fusion::p_IndexCounter::_get_impl(this)->getIndex(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_IndexCounter::getIndex()
{
  return ii;
}
// End mosek.fusion.IndexCounter.getIndex

// Begin mosek.fusion.IndexCounter.next
// Method mosek.fusion.IndexCounter.next @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:521:6-68
int64_t mosek::fusion::IndexCounter :: next() { return mosek::fusion::p_IndexCounter::_get_impl(this)->next(); }
int64_t mosek::fusion::p_IndexCounter::next()
{
  int64_t _439_r = _pubthis->get();
  _pubthis->inc();
  return _439_r;
}
// End mosek.fusion.IndexCounter.next

// Begin mosek.fusion.IndexCounter.get
// Method mosek.fusion.IndexCounter.get @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:519:6-49
int64_t mosek::fusion::IndexCounter :: get() { return mosek::fusion::p_IndexCounter::_get_impl(this)->get(); }
int64_t mosek::fusion::p_IndexCounter::get()
{
  return ((*st)((int)0));
}
// End mosek.fusion.IndexCounter.get

// Begin mosek.fusion.IndexCounter.inc
// Method mosek.fusion.IndexCounter.inc @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:505:6-517:7
void mosek::fusion::IndexCounter :: inc() { mosek::fusion::p_IndexCounter::_get_impl(this)->inc(); }
void mosek::fusion::p_IndexCounter::inc()
{
  ++ ((*ii)((int)0));
  ((*st)((int)0)) = safe_add( ((*st)((int)0)),((*strides)((n - (int)1))) );
  int32_t _440_i;
  {
    _440_i = (int)0;
    for(;((_440_i < (n - (int)1)) && (((*ii)(_440_i)) == ((*dims)(((n - _440_i) - (int)1)))));++ _440_i)
    {
      {
        ((*ii)(_440_i)) = (int)0;
        ++ ((*ii)(safe_add( _440_i,(int)1 )));
        ((*st)(safe_add( _440_i,(int)1 ))) = safe_add( ((*st)(safe_add( _440_i,(int)1 ))),((*strides)(((n - _440_i) - (int)2))) );
      }
    }
  }
  int32_t _9260_ = (int)0;
  int32_t _9261_ = _440_i;
  for (int32_t _441_j = _9260_; _441_j < _9261_; ++_441_j)
  {
    {
      ((*st)(_441_j)) = ((*st)(_440_i));
    }
  }
}
// End mosek.fusion.IndexCounter.inc

// Begin mosek.fusion.IndexCounter.reset
// Method mosek.fusion.IndexCounter.reset @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:500:6-503:7
void mosek::fusion::IndexCounter :: reset() { mosek::fusion::p_IndexCounter::_get_impl(this)->reset(); }
void mosek::fusion::p_IndexCounter::reset()
{
  st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(n)));
  int32_t _9262_ = (int)0;
  int32_t _9263_ = n;
  for (int32_t _442_i = _9262_; _442_i < _9263_; ++_442_i)
  {
    {
      ((*st)(_442_i)) = start;
    }
  }
}
// End mosek.fusion.IndexCounter.reset

void mosek::fusion::p_IndexCounter::destroy()
{
  dims.reset();
  strides.reset();
  st.reset();
  ii.reset();
}
void mosek::fusion::IndexCounter::destroy() { mosek::fusion::p_IndexCounter::_get_impl(this)->destroy(); }
// } class IndexCounter
// class CommonTools { // @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:6:4-445:5
mosek::fusion::CommonTools::CommonTools(mosek::fusion::p_CommonTools *_impl) : _impl(_impl) { /*std::cout << "CommonTools() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::CommonTools::~CommonTools() { delete _impl; _impl = nullptr; }
mosek::fusion::p_CommonTools::p_CommonTools
  (::mosek::fusion::CommonTools * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.CommonTools.resize
// Method mosek.fusion.CommonTools.resize @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:433:6-444:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::CommonTools::resize
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _443_values,
    int32_t _444_newsize) { return mosek::fusion::p_CommonTools::resize(_443_values,_444_newsize); }
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_CommonTools::resize(std::shared_ptr< monty::ndarray< int64_t,1 > > _443_values,int32_t _444_newsize)
{
  _checked_ptr_1<int64_t> _ptr__443_values(_443_values ? _443_values->raw() : nullptr, _443_values ? _443_values->size(0) : 0);
  if ((_444_newsize == (int)((_443_values)->size(0))))
  {
    {
      return _443_values;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _445_newvals = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_444_newsize)));
      _checked_ptr_1<int64_t> _ptr__445_newvals(_445_newvals ? _445_newvals->raw() : nullptr,_445_newvals ? _445_newvals->size(0) : 0);
      if ((_444_newsize > (int)((_443_values)->size(0))))
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_443_values,(int)0,_445_newvals,(int)0,(int)((_443_values)->size(0)));
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_443_values,(int)0,_445_newvals,(int)0,_444_newsize);
        }
      }
      return _445_newvals;
    }
  }
}
// End mosek.fusion.CommonTools.resize

// Begin mosek.fusion.CommonTools.resize
// Method mosek.fusion.CommonTools.resize @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:421:6-432:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::CommonTools::resize
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _446_values,
    int32_t _447_newsize) { return mosek::fusion::p_CommonTools::resize(_446_values,_447_newsize); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_CommonTools::resize(std::shared_ptr< monty::ndarray< int32_t,1 > > _446_values,int32_t _447_newsize)
{
  _checked_ptr_1<int32_t> _ptr__446_values(_446_values ? _446_values->raw() : nullptr, _446_values ? _446_values->size(0) : 0);
  if ((_447_newsize == (int)((_446_values)->size(0))))
  {
    {
      return _446_values;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _448_newvals = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_447_newsize)));
      _checked_ptr_1<int32_t> _ptr__448_newvals(_448_newvals ? _448_newvals->raw() : nullptr,_448_newvals ? _448_newvals->size(0) : 0);
      if ((_447_newsize > (int)((_446_values)->size(0))))
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_446_values,(int)0,_448_newvals,(int)0,(int)((_446_values)->size(0)));
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_446_values,(int)0,_448_newvals,(int)0,_447_newsize);
        }
      }
      return _448_newvals;
    }
  }
}
// End mosek.fusion.CommonTools.resize

// Begin mosek.fusion.CommonTools.resize
// Method mosek.fusion.CommonTools.resize @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:409:6-420:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::CommonTools::resize
  ( std::shared_ptr< monty::ndarray< double,1 > > _449_values,
    int32_t _450_newsize) { return mosek::fusion::p_CommonTools::resize(_449_values,_450_newsize); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_CommonTools::resize(std::shared_ptr< monty::ndarray< double,1 > > _449_values,int32_t _450_newsize)
{
  _checked_ptr_1<double> _ptr__449_values(_449_values ? _449_values->raw() : nullptr, _449_values ? _449_values->size(0) : 0);
  if ((_450_newsize == (int)((_449_values)->size(0))))
  {
    {
      return _449_values;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _451_newvals = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_450_newsize)));
      _checked_ptr_1<double> _ptr__451_newvals(_451_newvals ? _451_newvals->raw() : nullptr,_451_newvals ? _451_newvals->size(0) : 0);
      if ((_450_newsize > (int)((_449_values)->size(0))))
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_449_values,(int)0,_451_newvals,(int)0,(int)((_449_values)->size(0)));
        }
      }
      else
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(_449_values,(int)0,_451_newvals,(int)0,_450_newsize);
        }
      }
      return _451_newvals;
    }
  }
}
// End mosek.fusion.CommonTools.resize

// Begin mosek.fusion.CommonTools.binarySearch
// Method mosek.fusion.CommonTools.binarySearch @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:391:6-407:7
int32_t mosek::fusion::CommonTools::binarySearch
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _452_values,
    int32_t _453_target) { return mosek::fusion::p_CommonTools::binarySearch(_452_values,_453_target); }
int32_t mosek::fusion::p_CommonTools::binarySearch(std::shared_ptr< monty::ndarray< int32_t,1 > > _452_values,int32_t _453_target)
{
  _checked_ptr_1<int32_t> _ptr__452_values(_452_values ? _452_values->raw() : nullptr, _452_values ? _452_values->size(0) : 0);
  int32_t _454_i0 = (int)0;
  int32_t _455_i1 = (int)((_452_values)->size(0));
  if ((_ptr__452_values[_454_i0] == _453_target))
  {
    {
      return _454_i0;
    }
  }
  else if((_ptr__452_values[(_455_i1 - (int)1)] == _453_target))
  {
    {
      return (_455_i1 - (int)1);
    }
  }
  {}
  while ( (_454_i0 < (_455_i1 - (int)1)) )
  {
    {
      int32_t _456_p = ((_455_i1 - _454_i0) / (int)2);
      if ((_453_target < _ptr__452_values[_456_p]))
      {
        {
          _454_i0 = safe_add( _456_p,(int)1 );
        }
      }
      else if((_453_target > _ptr__452_values[_456_p]))
      {
        {
          _455_i1 = _456_p;
        }
      }
      else
      {
        {
          return _456_p;
        }
      }
    }
  }
  return (-(int)1);
}
// End mosek.fusion.CommonTools.binarySearch

// Begin mosek.fusion.CommonTools.binarySearch
// Method mosek.fusion.CommonTools.binarySearch @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:383:6-389:7
int32_t mosek::fusion::CommonTools::binarySearch
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _457_values,
    int64_t _458_target) { return mosek::fusion::p_CommonTools::binarySearch(_457_values,_458_target); }
int32_t mosek::fusion::p_CommonTools::binarySearch(std::shared_ptr< monty::ndarray< int64_t,1 > > _457_values,int64_t _458_target)
{
  _checked_ptr_1<int64_t> _ptr__457_values(_457_values ? _457_values->raw() : nullptr, _457_values ? _457_values->size(0) : 0);
  int32_t _459_i = ::mosek::fusion::p_CommonTools::binarySearchL(_457_values,_458_target);
  if (((_459_i < (int)((_457_values)->size(0))) && (_ptr__457_values[_459_i] == _458_target)))
  {
    {
      return _459_i;
    }
  }
  else
  {
    {
      return (-(int)1);
    }
  }
}
// End mosek.fusion.CommonTools.binarySearch

// Begin mosek.fusion.CommonTools.binarySearchR
// Method mosek.fusion.CommonTools.binarySearchR @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:367:6-381:7
int32_t mosek::fusion::CommonTools::binarySearchR
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _460_values,
    int64_t _461_target) { return mosek::fusion::p_CommonTools::binarySearchR(_460_values,_461_target); }
int32_t mosek::fusion::p_CommonTools::binarySearchR(std::shared_ptr< monty::ndarray< int64_t,1 > > _460_values,int64_t _461_target)
{
  _checked_ptr_1<int64_t> _ptr__460_values(_460_values ? _460_values->raw() : nullptr, _460_values ? _460_values->size(0) : 0);
  int32_t _462_i0 = (int)0;
  int32_t _463_i1 = (int)((_460_values)->size(0));
  if ((_ptr__460_values[_462_i0] > _461_target))
  {
    {
      return _462_i0;
    }
  }
  {}
  while ( (_462_i0 < (_463_i1 - (int)1)) )
  {
    {
      int32_t _464_p = (safe_add( _463_i1,_462_i0 ) / (int)2);
      if ((_461_target >= _ptr__460_values[_464_p]))
      {
        {
          _462_i0 = _464_p;
        }
      }
      else
      {
        {
          _463_i1 = _464_p;
        }
      }
    }
  }
  return _463_i1;
}
// End mosek.fusion.CommonTools.binarySearchR

// Begin mosek.fusion.CommonTools.binarySearchL
// Method mosek.fusion.CommonTools.binarySearchL @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:350:6-364:7
int32_t mosek::fusion::CommonTools::binarySearchL
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _465_values,
    int64_t _466_target) { return mosek::fusion::p_CommonTools::binarySearchL(_465_values,_466_target); }
int32_t mosek::fusion::p_CommonTools::binarySearchL(std::shared_ptr< monty::ndarray< int64_t,1 > > _465_values,int64_t _466_target)
{
  _checked_ptr_1<int64_t> _ptr__465_values(_465_values ? _465_values->raw() : nullptr, _465_values ? _465_values->size(0) : 0);
  int32_t _467_i0 = (int)0;
  int32_t _468_i1 = (int)((_465_values)->size(0));
  if ((_466_target <= _ptr__465_values[_467_i0]))
  {
    {
      return _467_i0;
    }
  }
  {}
  while ( (_467_i0 < (_468_i1 - (int)1)) )
  {
    {
      int32_t _469_p = (safe_add( _468_i1,_467_i0 ) / (int)2);
      if ((_ptr__465_values[_469_p] < _466_target))
      {
        {
          _467_i0 = _469_p;
        }
      }
      else
      {
        {
          _468_i1 = _469_p;
        }
      }
    }
  }
  return _468_i1;
}
// End mosek.fusion.CommonTools.binarySearchL

// Begin mosek.fusion.CommonTools.ndIncr
// Method mosek.fusion.CommonTools.ndIncr @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:337:6-346:7
void mosek::fusion::CommonTools::ndIncr
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _470_ndidx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _471_first,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _472_last) { mosek::fusion::p_CommonTools::ndIncr(_470_ndidx,_471_first,_472_last); }
void mosek::fusion::p_CommonTools::ndIncr(std::shared_ptr< monty::ndarray< int32_t,1 > > _470_ndidx,std::shared_ptr< monty::ndarray< int32_t,1 > > _471_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _472_last)
{
  _checked_ptr_1<int32_t> _ptr__470_ndidx(_470_ndidx ? _470_ndidx->raw() : nullptr, _470_ndidx ? _470_ndidx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__471_first(_471_first ? _471_first->raw() : nullptr, _471_first ? _471_first->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__472_last(_472_last ? _472_last->raw() : nullptr, _472_last ? _472_last->size(0) : 0);
  int32_t _473_i = ((int)((_470_ndidx)->size(0)) - (int)1);
  ++ _ptr__470_ndidx[_473_i];
  while ( ((_473_i > (int)0) && (_ptr__470_ndidx[_473_i] >= _ptr__472_last[_473_i])) )
  {
    {
      _ptr__470_ndidx[_473_i] = _ptr__471_first[_473_i];
      ++ _ptr__470_ndidx[(_473_i - (int)1)];
    }
  }
}
// End mosek.fusion.CommonTools.ndIncr

// Begin mosek.fusion.CommonTools.transposeTriplets
// Method mosek.fusion.CommonTools.transposeTriplets @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:290:6-335:7
void mosek::fusion::CommonTools::transposeTriplets
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _474_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _475_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _476_val,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int64_t,1 > >,1 > > _477_tsubi_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int64_t,1 > >,1 > > _478_tsubj_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _479_tval_,
    int64_t _480_nelm,
    int32_t _481_dimi,
    int32_t _482_dimj) { mosek::fusion::p_CommonTools::transposeTriplets(_474_subi,_475_subj,_476_val,_477_tsubi_,_478_tsubj_,_479_tval_,_480_nelm,_481_dimi,_482_dimj); }
void mosek::fusion::p_CommonTools::transposeTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _474_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _475_subj,std::shared_ptr< monty::ndarray< double,1 > > _476_val,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int64_t,1 > >,1 > > _477_tsubi_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int64_t,1 > >,1 > > _478_tsubj_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _479_tval_,int64_t _480_nelm,int32_t _481_dimi,int32_t _482_dimj)
{
  _checked_ptr_1<int32_t> _ptr__474_subi(_474_subi ? _474_subi->raw() : nullptr, _474_subi ? _474_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__475_subj(_475_subj ? _475_subj->raw() : nullptr, _475_subj ? _475_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__476_val(_476_val ? _476_val->raw() : nullptr, _476_val ? _476_val->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _483_rptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _481_dimi,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__483_rptrb(_483_rptrb ? _483_rptrb->raw() : nullptr,_483_rptrb ? _483_rptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _484_cptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _482_dimj,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__484_cptrb(_484_cptrb ? _484_cptrb->raw() : nullptr,_484_cptrb ? _484_cptrb->size(0) : 0);
  {
    int64_t _485_i = (int64_t)0;
    for(;(_485_i < _480_nelm);++ _485_i)
    {
      {
        _ptr__484_cptrb[safe_add( _ptr__475_subj[_485_i],(int)2 )] = safe_add( _ptr__484_cptrb[safe_add( _ptr__475_subj[_485_i],(int)2 )],(int)1 );
        _ptr__483_rptrb[safe_add( _ptr__474_subi[_485_i],(int)2 )] = safe_add( _ptr__483_rptrb[safe_add( _ptr__474_subi[_485_i],(int)2 )],(int)1 );
      }
    }
  }
  {
    int32_t _486_i = (int)1;
    for(;(_486_i < _481_dimi);++ _486_i)
    {
      {
        _ptr__483_rptrb[safe_add( _486_i,(int)1 )] = safe_add( _ptr__483_rptrb[safe_add( _486_i,(int)1 )],_ptr__483_rptrb[_486_i] );
      }
    }
  }
  {
    int32_t _487_i = (int)1;
    for(;(_487_i < _482_dimj);++ _487_i)
    {
      {
        _ptr__484_cptrb[safe_add( _487_i,(int)1 )] = safe_add( _ptr__484_cptrb[safe_add( _487_i,(int)1 )],_ptr__484_cptrb[_487_i] );
      }
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _488_tsubi = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_480_nelm)));
  _checked_ptr_1<int64_t> _ptr__488_tsubi(_488_tsubi ? _488_tsubi->raw() : nullptr,_488_tsubi ? _488_tsubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _489_tsubj = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_480_nelm)));
  _checked_ptr_1<int64_t> _ptr__489_tsubj(_489_tsubj ? _489_tsubj->raw() : nullptr,_489_tsubj ? _489_tsubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _490_tval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_480_nelm)));
  _checked_ptr_1<double> _ptr__490_tval(_490_tval ? _490_tval->raw() : nullptr,_490_tval ? _490_tval->size(0) : 0);
  int32_t _9264_ = (int)0;
  int32_t _9265_ = _481_dimi;
  for (int32_t _491_i = _9264_; _491_i < _9265_; ++_491_i)
  {
    {
      {
        int64_t _492_k = _ptr__483_rptrb[_491_i];
        for(;(_492_k < _ptr__483_rptrb[safe_add( _491_i,(int)1 )]);++ _492_k)
        {
          {
            int32_t _493_j = _ptr__475_subj[_492_k];
            int64_t _494_cidx = _ptr__484_cptrb[_493_j];
            _ptr__488_tsubi[_494_cidx] = _491_i;
            _ptr__489_tsubj[_494_cidx] = _493_j;
            _ptr__490_tval[_494_cidx] = _ptr__476_val[_492_k];
            _ptr__484_cptrb[_493_j] = safe_add( _494_cidx,(int)1 );
          }
        }
      }
    }
  }
  ((*_477_tsubi_)((int)0)) = _489_tsubj;
  ((*_478_tsubj_)((int)0)) = _488_tsubi;
  ((*_479_tval_)((int)0)) = _490_tval;
}
// End mosek.fusion.CommonTools.transposeTriplets

// Begin mosek.fusion.CommonTools.transposeTriplets
// Method mosek.fusion.CommonTools.transposeTriplets @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:242:6-287:7
void mosek::fusion::CommonTools::transposeTriplets
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _495_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _496_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _497_val,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _498_tsubi_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _499_tsubj_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _500_tval_,
    int64_t _501_nelm,
    int32_t _502_dimi,
    int32_t _503_dimj) { mosek::fusion::p_CommonTools::transposeTriplets(_495_subi,_496_subj,_497_val,_498_tsubi_,_499_tsubj_,_500_tval_,_501_nelm,_502_dimi,_503_dimj); }
void mosek::fusion::p_CommonTools::transposeTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _495_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _496_subj,std::shared_ptr< monty::ndarray< double,1 > > _497_val,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _498_tsubi_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _499_tsubj_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _500_tval_,int64_t _501_nelm,int32_t _502_dimi,int32_t _503_dimj)
{
  _checked_ptr_1<int32_t> _ptr__495_subi(_495_subi ? _495_subi->raw() : nullptr, _495_subi ? _495_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__496_subj(_496_subj ? _496_subj->raw() : nullptr, _496_subj ? _496_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__497_val(_497_val ? _497_val->raw() : nullptr, _497_val ? _497_val->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _504_rptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _502_dimi,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__504_rptrb(_504_rptrb ? _504_rptrb->raw() : nullptr,_504_rptrb ? _504_rptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _505_cptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _503_dimj,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__505_cptrb(_505_cptrb ? _505_cptrb->raw() : nullptr,_505_cptrb ? _505_cptrb->size(0) : 0);
  {
    int64_t _506_i = (int64_t)0;
    for(;(_506_i < _501_nelm);++ _506_i)
    {
      {
        _ptr__505_cptrb[safe_add( _ptr__496_subj[_506_i],(int)2 )] = safe_add( _ptr__505_cptrb[safe_add( _ptr__496_subj[_506_i],(int)2 )],(int)1 );
        _ptr__504_rptrb[safe_add( _ptr__495_subi[_506_i],(int)2 )] = safe_add( _ptr__504_rptrb[safe_add( _ptr__495_subi[_506_i],(int)2 )],(int)1 );
      }
    }
  }
  {
    int32_t _507_i = (int)1;
    for(;(_507_i < _502_dimi);++ _507_i)
    {
      {
        _ptr__504_rptrb[safe_add( _507_i,(int)1 )] = safe_add( _ptr__504_rptrb[safe_add( _507_i,(int)1 )],_ptr__504_rptrb[_507_i] );
      }
    }
  }
  {
    int32_t _508_i = (int)1;
    for(;(_508_i < _503_dimj);++ _508_i)
    {
      {
        _ptr__505_cptrb[safe_add( _508_i,(int)1 )] = safe_add( _ptr__505_cptrb[safe_add( _508_i,(int)1 )],_ptr__505_cptrb[_508_i] );
      }
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _509_tsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_501_nelm)));
  _checked_ptr_1<int32_t> _ptr__509_tsubi(_509_tsubi ? _509_tsubi->raw() : nullptr,_509_tsubi ? _509_tsubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _510_tsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_501_nelm)));
  _checked_ptr_1<int32_t> _ptr__510_tsubj(_510_tsubj ? _510_tsubj->raw() : nullptr,_510_tsubj ? _510_tsubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _511_tval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_501_nelm)));
  _checked_ptr_1<double> _ptr__511_tval(_511_tval ? _511_tval->raw() : nullptr,_511_tval ? _511_tval->size(0) : 0);
  {
    int32_t _512_i = (int)0;
    for(;(_512_i < _502_dimi);++ _512_i)
    {
      {
        int64_t _9266_ = _ptr__504_rptrb[_512_i];
        int64_t _9267_ = _ptr__504_rptrb[safe_add( _512_i,(int)1 )];
        for (int64_t _513_k = _9266_; _513_k < _9267_; ++_513_k)
        {
          {
            int32_t _514_j = _ptr__496_subj[_513_k];
            int64_t _515_cidx = _ptr__505_cptrb[_514_j];
            _ptr__509_tsubi[_515_cidx] = _512_i;
            _ptr__510_tsubj[_515_cidx] = _514_j;
            _ptr__511_tval[_515_cidx] = _ptr__497_val[_513_k];
            _ptr__505_cptrb[_514_j] = safe_add( _515_cidx,(int)1 );
          }
        }
      }
    }
  }
  ((*_498_tsubi_)((int)0)) = _510_tsubj;
  ((*_499_tsubj_)((int)0)) = _509_tsubi;
  ((*_500_tval_)((int)0)) = _511_tval;
}
// End mosek.fusion.CommonTools.transposeTriplets

// Begin mosek.fusion.CommonTools.tripletSort
// Method mosek.fusion.CommonTools.tripletSort @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:115:6-214:7
void mosek::fusion::CommonTools::tripletSort
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _516_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _517_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _518_val,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _519_tsubi_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _520_tsubj_,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _521_tval_,
    int64_t _522_nelm,
    int32_t _523_dimi,
    int32_t _524_dimj) { mosek::fusion::p_CommonTools::tripletSort(_516_subi,_517_subj,_518_val,_519_tsubi_,_520_tsubj_,_521_tval_,_522_nelm,_523_dimi,_524_dimj); }
void mosek::fusion::p_CommonTools::tripletSort(std::shared_ptr< monty::ndarray< int32_t,1 > > _516_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _517_subj,std::shared_ptr< monty::ndarray< double,1 > > _518_val,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _519_tsubi_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _520_tsubj_,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _521_tval_,int64_t _522_nelm,int32_t _523_dimi,int32_t _524_dimj)
{
  _checked_ptr_1<int32_t> _ptr__516_subi(_516_subi ? _516_subi->raw() : nullptr, _516_subi ? _516_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__517_subj(_517_subj ? _517_subj->raw() : nullptr, _517_subj ? _517_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__518_val(_518_val ? _518_val->raw() : nullptr, _518_val ? _518_val->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _525_cols = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_522_nelm)));
  _checked_ptr_1<int32_t> _ptr__525_cols(_525_cols ? _525_cols->raw() : nullptr,_525_cols ? _525_cols->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _526_cptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _524_dimj,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__526_cptrb(_526_cptrb ? _526_cptrb->raw() : nullptr,_526_cptrb ? _526_cptrb->size(0) : 0);
  int64_t _9268_ = (int64_t)0;
  int64_t _9269_ = _522_nelm;
  for (int64_t _527_i = _9268_; _527_i < _9269_; ++_527_i)
  {
    {
      _ptr__526_cptrb[safe_add( _ptr__517_subj[_527_i],(int)2 )] = safe_add( _ptr__526_cptrb[safe_add( _ptr__517_subj[_527_i],(int)2 )],(int)1 );
    }
  }
  int32_t _9270_ = (int)1;
  int32_t _9271_ = _524_dimj;
  for (int32_t _528_i = _9270_; _528_i < _9271_; ++_528_i)
  {
    {
      _ptr__526_cptrb[safe_add( _528_i,(int)1 )] = safe_add( _ptr__526_cptrb[safe_add( _528_i,(int)1 )],_ptr__526_cptrb[_528_i] );
    }
  }
  int32_t _9272_ = (int)0;
  int32_t _9273_ = (int32_t)_522_nelm;
  for (int32_t _529_i = _9272_; _529_i < _9273_; ++_529_i)
  {
    {
      int32_t _530_cidx = _ptr__517_subj[_529_i];
      _ptr__525_cols[_ptr__526_cptrb[safe_add( _530_cidx,(int)1 )]] = _529_i;
      _ptr__526_cptrb[safe_add( _530_cidx,(int)1 )] = safe_add( _ptr__526_cptrb[safe_add( _530_cidx,(int)1 )],(int)1 );
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _531_rptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _523_dimi,(int)2 ))));
  _checked_ptr_1<int64_t> _ptr__531_rptrb(_531_rptrb ? _531_rptrb->raw() : nullptr,_531_rptrb ? _531_rptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _532_rows = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_522_nelm)));
  _checked_ptr_1<int32_t> _ptr__532_rows(_532_rows ? _532_rows->raw() : nullptr,_532_rows ? _532_rows->size(0) : 0);
  {
    int32_t _533_i = (int)0;
    for(;(_533_i < _522_nelm);++ _533_i)
    {
      {
        _ptr__531_rptrb[safe_add( _ptr__516_subi[_533_i],(int)2 )] = safe_add( _ptr__531_rptrb[safe_add( _ptr__516_subi[_533_i],(int)2 )],(int)1 );
      }
    }
  }
  {
    int32_t _534_i = (int)1;
    for(;(_534_i < _523_dimi);++ _534_i)
    {
      {
        _ptr__531_rptrb[safe_add( _534_i,(int)1 )] = safe_add( _ptr__531_rptrb[safe_add( _534_i,(int)1 )],_ptr__531_rptrb[_534_i] );
      }
    }
  }
  {
    int32_t _535_j = (int)0;
    for(;(_535_j < _524_dimj);++ _535_j)
    {
      {
        {
          int64_t _536_i = _ptr__526_cptrb[_535_j];
          for(;(_536_i < _ptr__526_cptrb[safe_add( _535_j,(int)1 )]);++ _536_i)
          {
            {
              int32_t _537_ridx = _ptr__516_subi[_ptr__525_cols[_536_i]];
              _ptr__532_rows[_ptr__531_rptrb[safe_add( _537_ridx,(int)1 )]] = _ptr__525_cols[_536_i];
              _ptr__531_rptrb[safe_add( _537_ridx,(int)1 )] = safe_add( _ptr__531_rptrb[safe_add( _537_ridx,(int)1 )],(int)1 );
            }
          }
        }
      }
    }
  }
  int32_t _538_nunique = (int)1;
  {
    int32_t _539_si = _ptr__516_subi[_ptr__532_rows[(int)0]];
    int32_t _540_sj = _ptr__517_subj[_ptr__532_rows[(int)0]];
    {
      int32_t _541_i = (int)1;
      for(;(_541_i < _522_nelm);++ _541_i)
      {
        {
          int32_t _542_idx = _ptr__532_rows[_541_i];
          if (((_539_si != _ptr__516_subi[_542_idx]) || (_540_sj != _ptr__517_subj[_542_idx])))
          {
            {
              _539_si = _ptr__516_subi[_542_idx];
              _540_sj = _ptr__517_subj[_542_idx];
              ++ _538_nunique;
            }
          }
          {}
        }
      }
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _543_tsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_538_nunique)));
  _checked_ptr_1<int32_t> _ptr__543_tsubi(_543_tsubi ? _543_tsubi->raw() : nullptr,_543_tsubi ? _543_tsubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _544_tsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_538_nunique)));
  _checked_ptr_1<int32_t> _ptr__544_tsubj(_544_tsubj ? _544_tsubj->raw() : nullptr,_544_tsubj ? _544_tsubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _545_tval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_538_nunique)));
  _checked_ptr_1<double> _ptr__545_tval(_545_tval ? _545_tval->raw() : nullptr,_545_tval ? _545_tval->size(0) : 0);
  {
    int32_t _546_idx = _ptr__532_rows[(int)0];
    _ptr__543_tsubi[(int)0] = _ptr__516_subi[_546_idx];
    _ptr__544_tsubj[(int)0] = _ptr__517_subj[_546_idx];
    _ptr__545_tval[(int)0] = _ptr__518_val[_546_idx];
  }
  int32_t _547_di = (int)1;
  int32_t _9274_ = (int)1;
  int64_t _9275_ = _522_nelm;
  for (int64_t _548_i = _9274_; _548_i < _9275_; ++_548_i)
  {
    {
      int32_t _549_idx = _ptr__532_rows[_548_i];
      if (((_ptr__543_tsubi[(_547_di - (int)1)] == _ptr__516_subi[_549_idx]) && (_ptr__544_tsubj[(_547_di - (int)1)] == _ptr__517_subj[_549_idx])))
      {
        {
          _ptr__545_tval[(_547_di - (int)1)] = (_ptr__545_tval[(_547_di - (int)1)] + _ptr__518_val[_549_idx]);
        }
      }
      else
      {
        {
          _ptr__543_tsubi[_547_di] = _ptr__516_subi[_549_idx];
          _ptr__544_tsubj[_547_di] = _ptr__517_subj[_549_idx];
          _ptr__545_tval[_547_di] = _ptr__518_val[_549_idx];
          ++ _547_di;
        }
      }
    }
  }
  ((*_519_tsubi_)((int)0)) = _543_tsubi;
  ((*_520_tsubj_)((int)0)) = _544_tsubj;
  ((*_521_tval_)((int)0)) = _545_tval;
}
// End mosek.fusion.CommonTools.tripletSort

// Begin mosek.fusion.CommonTools.argMSort
// Method mosek.fusion.CommonTools.argMSort @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:67:6-87:7
void mosek::fusion::CommonTools::argMSort
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _550_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _551_vals) { mosek::fusion::p_CommonTools::argMSort(_550_idx,_551_vals); }
void mosek::fusion::p_CommonTools::argMSort(std::shared_ptr< monty::ndarray< int32_t,1 > > _550_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _551_vals)
{
  _checked_ptr_1<int32_t> _ptr__550_idx(_550_idx ? _550_idx->raw() : nullptr, _550_idx ? _550_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__551_vals(_551_vals ? _551_vals->raw() : nullptr, _551_vals ? _551_vals->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _552_temp = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)((_550_idx)->size(0)))));
  _checked_ptr_1<int32_t> _ptr__552_temp(_552_temp ? _552_temp->raw() : nullptr,_552_temp ? _552_temp->size(0) : 0);
  bool _553_alt = false;
  {
    int32_t _554_intvlen = (int)1;
    for(;(_554_intvlen < (int)((_550_idx)->size(0)));_554_intvlen *= (int)2)
    {
      {
        _553_alt = (!_553_alt);
        int32_t _9276_ = (int)0;
        int32_t _9277_ = (int)((_550_idx)->size(0));
        int32_t _9278_ = safe_mul( _554_intvlen,(int)2 );
        for (int32_t _555_i = _9276_; _555_i < _9277_; _555_i += _9278_)
        {
          {
            if (_553_alt)
            {
              {
                ::mosek::fusion::p_CommonTools::mergeInto(_550_idx,_552_temp,_551_vals,_555_i,safe_add( _555_i,_554_intvlen ),safe_add( _555_i,safe_mul( (int)2,_554_intvlen ) ));
              }
            }
            else
            {
              {
                ::mosek::fusion::p_CommonTools::mergeInto(_552_temp,_550_idx,_551_vals,_555_i,safe_add( _555_i,_554_intvlen ),safe_add( _555_i,safe_mul( (int)2,_554_intvlen ) ));
              }
            }
          }
        }
      }
    }
  }
  if (_553_alt)
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(_552_temp,(int)0,_550_idx,(int)0,(int)((_550_idx)->size(0)));
    }
  }
  {}
}
// End mosek.fusion.CommonTools.argMSort

// Begin mosek.fusion.CommonTools.mergeInto
// Method mosek.fusion.CommonTools.mergeInto @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:29:6-54:7
void mosek::fusion::p_CommonTools::mergeInto(std::shared_ptr< monty::ndarray< int32_t,1 > > _556_src,std::shared_ptr< monty::ndarray< int32_t,1 > > _557_tgt,std::shared_ptr< monty::ndarray< int32_t,1 > > _558_vals,int32_t _559_si0,int32_t _560_si1_,int32_t _561_si2_)
{
  _checked_ptr_1<int32_t> _ptr__556_src(_556_src ? _556_src->raw() : nullptr, _556_src ? _556_src->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__557_tgt(_557_tgt ? _557_tgt->raw() : nullptr, _557_tgt ? _557_tgt->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__558_vals(_558_vals ? _558_vals->raw() : nullptr, _558_vals ? _558_vals->size(0) : 0);
  int32_t _9279_;
  bool _9280_ = (_561_si2_ > (int)((_556_src)->size(0)));
  if (_9280_)
  {
    _9279_ = (int)((_556_src)->size(0));
  }
  else
  {
    _9279_ = _561_si2_;
  }
  int32_t _562_si2 = _9279_;
  int32_t _9281_;
  bool _9282_ = (_560_si1_ > _562_si2);
  if (_9282_)
  {
    _9281_ = _562_si2;
  }
  else
  {
    _9281_ = _560_si1_;
  }
  int32_t _563_si1 = _9281_;
  if ((_563_si1 == _562_si2))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(_556_src,_559_si0,_557_tgt,_559_si0,(_563_si1 - _559_si0));
    }
  }
  else
  {
    {
      int32_t _564_i0 = _559_si0;
      int32_t _565_i1 = _563_si1;
      int32_t _566_i;
      {
        _566_i = _559_si0;
        for(;((_564_i0 < _563_si1) && (_565_i1 < _562_si2));++ _566_i)
        {
          {
            if ((_ptr__558_vals[_ptr__556_src[_564_i0]] < _ptr__558_vals[_ptr__556_src[_565_i1]]))
            {
              {
                _ptr__557_tgt[_566_i] = _ptr__556_src[_564_i0];
                ++ _564_i0;
              }
            }
            else
            {
              {
                _ptr__557_tgt[_566_i] = _ptr__556_src[_565_i1];
                ++ _565_i1;
              }
            }
          }
        }
      }
      while ( (_564_i0 < _563_si1) )
      {
        {
          _ptr__557_tgt[_566_i] = _ptr__556_src[_564_i0];
          ++ _564_i0;
          ++ _566_i;
        }
      }
      while ( (_565_i1 < _562_si2) )
      {
        {
          _ptr__557_tgt[_566_i] = _ptr__556_src[_565_i1];
          ++ _565_i1;
          ++ _566_i;
        }
      }
    }
  }
}
// End mosek.fusion.CommonTools.mergeInto

// Begin mosek.fusion.CommonTools.argQsort
// Method mosek.fusion.CommonTools.argQsort @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:16:6-22:7
void mosek::fusion::CommonTools::argQsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _567_idx,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _568_vals1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _569_vals2,
    int64_t _570_first,
    int64_t _571_last) { mosek::fusion::p_CommonTools::argQsort(_567_idx,_568_vals1,_569_vals2,_570_first,_571_last); }
void mosek::fusion::p_CommonTools::argQsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _567_idx,std::shared_ptr< monty::ndarray< int64_t,1 > > _568_vals1,std::shared_ptr< monty::ndarray< int64_t,1 > > _569_vals2,int64_t _570_first,int64_t _571_last)
{
  _checked_ptr_1<int64_t> _ptr__567_idx(_567_idx ? _567_idx->raw() : nullptr, _567_idx ? _567_idx->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__568_vals1(_568_vals1 ? _568_vals1->raw() : nullptr, _568_vals1 ? _568_vals1->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__569_vals2(_569_vals2 ? _569_vals2->raw() : nullptr, _569_vals2 ? _569_vals2->size(0) : 0);
  if ((NULL == _569_vals2.get()))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_567_idx,_568_vals1,_570_first,_571_last);
    }
  }
  else
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_567_idx,_568_vals1,_569_vals2,_570_first,_571_last);
    }
  }
}
// End mosek.fusion.CommonTools.argQsort

// Begin mosek.fusion.CommonTools.argQsort
// Method mosek.fusion.CommonTools.argQsort @ bld/docker-win/final/default/src/fusion/CommonUtil.mbi:8:6-14:7
void mosek::fusion::CommonTools::argQsort
  ( std::shared_ptr< monty::ndarray< int64_t,1 > > _572_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _573_vals1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _574_vals2,
    int64_t _575_first,
    int64_t _576_last) { mosek::fusion::p_CommonTools::argQsort(_572_idx,_573_vals1,_574_vals2,_575_first,_576_last); }
void mosek::fusion::p_CommonTools::argQsort(std::shared_ptr< monty::ndarray< int64_t,1 > > _572_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _573_vals1,std::shared_ptr< monty::ndarray< int32_t,1 > > _574_vals2,int64_t _575_first,int64_t _576_last)
{
  _checked_ptr_1<int64_t> _ptr__572_idx(_572_idx ? _572_idx->raw() : nullptr, _572_idx ? _572_idx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__573_vals1(_573_vals1 ? _573_vals1->raw() : nullptr, _573_vals1 ? _573_vals1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__574_vals2(_574_vals2 ? _574_vals2->raw() : nullptr, _574_vals2 ? _574_vals2->size(0) : 0);
  if ((NULL == _574_vals2.get()))
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_572_idx,_573_vals1,_575_first,_576_last);
    }
  }
  else
  {
    {
      ::mosek::fusion::Utils::Tools::argsort(_572_idx,_573_vals1,_574_vals2,_575_first,_576_last);
    }
  }
}
// End mosek.fusion.CommonTools.argQsort

void mosek::fusion::p_CommonTools::destroy()
{
}
void mosek::fusion::CommonTools::destroy() { mosek::fusion::p_CommonTools::_get_impl(this)->destroy(); }
// } class CommonTools
// class SolutionStruct { // @ bld/docker-win/final/default/src/fusion/Model.mbi:5522:4-5857:5
mosek::fusion::SolutionStruct::SolutionStruct(mosek::fusion::p_SolutionStruct *_impl) : _impl(_impl) { /*std::cout << "SolutionStruct() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::SolutionStruct::~SolutionStruct() { delete _impl; _impl = nullptr; }
mosek::fusion::p_SolutionStruct::p_SolutionStruct
  (::mosek::fusion::SolutionStruct * _pubthis) :     _pubthis(_pubthis)
{}
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_accy() { return _impl->accy; }
void mosek::fusion::SolutionStruct::set_accy(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->accy = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_accx() { return _impl->accx; }
void mosek::fusion::SolutionStruct::set_accx(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->accx = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::SolutionStruct::get_accptr() { return _impl->accptr; }
void mosek::fusion::SolutionStruct::set_accptr(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->accptr = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_yx() { return _impl->yx; }
void mosek::fusion::SolutionStruct::set_yx(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->yx = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_sux() { return _impl->sux; }
void mosek::fusion::SolutionStruct::set_sux(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->sux = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_slx() { return _impl->slx; }
void mosek::fusion::SolutionStruct::set_slx(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->slx = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_bars() { return _impl->bars; }
void mosek::fusion::SolutionStruct::set_bars(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->bars = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_barx() { return _impl->barx; }
void mosek::fusion::SolutionStruct::set_barx(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->barx = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_y() { return _impl->y; }
void mosek::fusion::SolutionStruct::set_y(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->y = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_suc() { return _impl->suc; }
void mosek::fusion::SolutionStruct::set_suc(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->suc = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_slc() { return _impl->slc; }
void mosek::fusion::SolutionStruct::set_slc(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->slc = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_xx() { return _impl->xx; }
void mosek::fusion::SolutionStruct::set_xx(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->xx = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SolutionStruct::get_xc() { return _impl->xc; }
void mosek::fusion::SolutionStruct::set_xc(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->xc = _val; }
double mosek::fusion::SolutionStruct::get_dobj() { return _impl->dobj; }
void mosek::fusion::SolutionStruct::set_dobj(double _val) { _impl->dobj = _val; }
double mosek::fusion::SolutionStruct::get_pobj() { return _impl->pobj; }
void mosek::fusion::SolutionStruct::set_pobj(double _val) { _impl->pobj = _val; }
mosek::fusion::ProblemStatus mosek::fusion::SolutionStruct::get_probstatus() { return _impl->probstatus; }
void mosek::fusion::SolutionStruct::set_probstatus(mosek::fusion::ProblemStatus _val) { _impl->probstatus = _val; }
mosek::fusion::SolutionStatus mosek::fusion::SolutionStruct::get_dstatus() { return _impl->dstatus; }
void mosek::fusion::SolutionStruct::set_dstatus(mosek::fusion::SolutionStatus _val) { _impl->dstatus = _val; }
mosek::fusion::SolutionStatus mosek::fusion::SolutionStruct::get_pstatus() { return _impl->pstatus; }
void mosek::fusion::SolutionStruct::set_pstatus(mosek::fusion::SolutionStatus _val) { _impl->pstatus = _val; }
int32_t mosek::fusion::SolutionStruct::get_sol_numbarvar() { return _impl->sol_numbarvar; }
void mosek::fusion::SolutionStruct::set_sol_numbarvar(int32_t _val) { _impl->sol_numbarvar = _val; }
int32_t mosek::fusion::SolutionStruct::get_sol_numaccelm() { return _impl->sol_numaccelm; }
void mosek::fusion::SolutionStruct::set_sol_numaccelm(int32_t _val) { _impl->sol_numaccelm = _val; }
int32_t mosek::fusion::SolutionStruct::get_sol_numacc() { return _impl->sol_numacc; }
void mosek::fusion::SolutionStruct::set_sol_numacc(int32_t _val) { _impl->sol_numacc = _val; }
int32_t mosek::fusion::SolutionStruct::get_sol_numvar() { return _impl->sol_numvar; }
void mosek::fusion::SolutionStruct::set_sol_numvar(int32_t _val) { _impl->sol_numvar = _val; }
int32_t mosek::fusion::SolutionStruct::get_sol_numcon() { return _impl->sol_numcon; }
void mosek::fusion::SolutionStruct::set_sol_numcon(int32_t _val) { _impl->sol_numcon = _val; }
// mosek.fusion.SolutionStruct.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:5797:6-5856:7
mosek::fusion::SolutionStruct::t mosek::fusion::p_SolutionStruct::_new_SolutionStruct
  (int32_t _577_numvar,
    int32_t _578_numcon,
    int32_t _579_numbarvar,
    int32_t _580_numacc,
    int32_t _581_numaccelm)
{ return new mosek::fusion::SolutionStruct(_577_numvar,_578_numcon,_579_numbarvar,_580_numacc,_581_numaccelm); }
mosek::fusion::SolutionStruct::SolutionStruct
  (int32_t _577_numvar,
    int32_t _578_numcon,
    int32_t _579_numbarvar,
    int32_t _580_numacc,
    int32_t _581_numaccelm) : 
   SolutionStruct(new mosek::fusion::p_SolutionStruct(this))
{ mosek::fusion::p_SolutionStruct::_get_impl(this)->_initialize(_577_numvar,_578_numcon,_579_numbarvar,_580_numacc,_581_numaccelm); }
void mosek::fusion::p_SolutionStruct::_initialize  (int32_t _577_numvar,
    int32_t _578_numcon,
    int32_t _579_numbarvar,
    int32_t _580_numacc,
    int32_t _581_numaccelm)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    pobj = 0.0;
    dobj = 0.0;
    pstatus = ::mosek::fusion::SolutionStatus::Unknown;
    dstatus = ::mosek::fusion::SolutionStatus::Unknown;
    probstatus = ::mosek::fusion::ProblemStatus::Unknown;
    sol_numvar = _577_numvar;
    sol_numcon = _578_numcon;
    sol_numbarvar = _579_numbarvar;
    sol_numacc = _580_numacc;
    sol_numaccelm = _581_numaccelm;
    slx = nullptr;
    sux = nullptr;
    xx = nullptr;
    yx = nullptr;
    slc = nullptr;
    suc = nullptr;
    y = nullptr;
    xc = nullptr;
    barx = nullptr;
    bars = nullptr;
    accx = nullptr;
    accy = nullptr;
    accptr = nullptr;
    if ((_577_numvar > (int)0))
    {
      {
        slx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_577_numvar)));
        sux = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_577_numvar)));
        xx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_577_numvar)));
        yx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_577_numvar)));
      }
    }
    {}
    if ((_579_numbarvar > (int)0))
    {
      {
        barx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_579_numbarvar)));
        bars = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_579_numbarvar)));
      }
    }
    {}
    if ((_578_numcon > (int)0))
    {
      {
        slc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_578_numcon)));
        suc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_578_numcon)));
        y = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_578_numcon)));
        xc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_578_numcon)));
      }
    }
    {}
    if ((_580_numacc > (int)0))
    {
      {
        accx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_581_numaccelm)));
        accy = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_581_numaccelm)));
        accptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _580_numacc,(int)1 ))));
      }
    }
    {}
  }
}
// mosek.fusion.SolutionStruct.ctor

// mosek.fusion.SolutionStruct.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:5764:6-5794:7
mosek::fusion::SolutionStruct::t mosek::fusion::p_SolutionStruct::_new_SolutionStruct
  (monty::rc_ptr< ::mosek::fusion::SolutionStruct > _582_that)
{ return new mosek::fusion::SolutionStruct(_582_that); }
mosek::fusion::SolutionStruct::SolutionStruct
  (monty::rc_ptr< ::mosek::fusion::SolutionStruct > _582_that) : 
   SolutionStruct(new mosek::fusion::p_SolutionStruct(this))
{ mosek::fusion::p_SolutionStruct::_get_impl(this)->_initialize(_582_that); }
void mosek::fusion::p_SolutionStruct::_initialize  (monty::rc_ptr< ::mosek::fusion::SolutionStruct > _582_that)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    sol_numcon = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sol_numcon;
    sol_numvar = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sol_numvar;
    sol_numbarvar = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sol_numbarvar;
    sol_numacc = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sol_numacc;
    sol_numaccelm = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sol_numaccelm;
    pstatus = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->pstatus;
    dstatus = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->dstatus;
    probstatus = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->probstatus;
    pobj = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->pobj;
    dobj = mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->dobj;
    std::shared_ptr< monty::ndarray< double,1 > > _9283_;
    bool _9284_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->xc.get());
    if (_9284_)
    {
      _9283_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->xc);
    }
    else
    {
      _9283_ = nullptr;
    }
    xc = _9283_;
    std::shared_ptr< monty::ndarray< double,1 > > _9285_;
    bool _9286_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->xx.get());
    if (_9286_)
    {
      _9285_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->xx);
    }
    else
    {
      _9285_ = nullptr;
    }
    xx = _9285_;
    std::shared_ptr< monty::ndarray< double,1 > > _9287_;
    bool _9288_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->yx.get());
    if (_9288_)
    {
      _9287_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->yx);
    }
    else
    {
      _9287_ = nullptr;
    }
    yx = _9287_;
    std::shared_ptr< monty::ndarray< double,1 > > _9289_;
    bool _9290_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->slc.get());
    if (_9290_)
    {
      _9289_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->slc);
    }
    else
    {
      _9289_ = nullptr;
    }
    slc = _9289_;
    std::shared_ptr< monty::ndarray< double,1 > > _9291_;
    bool _9292_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->suc.get());
    if (_9292_)
    {
      _9291_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->suc);
    }
    else
    {
      _9291_ = nullptr;
    }
    suc = _9291_;
    std::shared_ptr< monty::ndarray< double,1 > > _9293_;
    bool _9294_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->y.get());
    if (_9294_)
    {
      _9293_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->y);
    }
    else
    {
      _9293_ = nullptr;
    }
    y = _9293_;
    std::shared_ptr< monty::ndarray< double,1 > > _9295_;
    bool _9296_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->barx.get());
    if (_9296_)
    {
      _9295_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->barx);
    }
    else
    {
      _9295_ = nullptr;
    }
    barx = _9295_;
    std::shared_ptr< monty::ndarray< double,1 > > _9297_;
    bool _9298_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->bars.get());
    if (_9298_)
    {
      _9297_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->bars);
    }
    else
    {
      _9297_ = nullptr;
    }
    bars = _9297_;
    std::shared_ptr< monty::ndarray< double,1 > > _9299_;
    bool _9300_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->slx.get());
    if (_9300_)
    {
      _9299_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->slx);
    }
    else
    {
      _9299_ = nullptr;
    }
    slx = _9299_;
    std::shared_ptr< monty::ndarray< double,1 > > _9301_;
    bool _9302_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sux.get());
    if (_9302_)
    {
      _9301_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->sux);
    }
    else
    {
      _9301_ = nullptr;
    }
    sux = _9301_;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9303_;
    bool _9304_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accptr.get());
    if (_9304_)
    {
      _9303_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accptr);
    }
    else
    {
      _9303_ = nullptr;
    }
    accptr = _9303_;
    std::shared_ptr< monty::ndarray< double,1 > > _9305_;
    bool _9306_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accx.get());
    if (_9306_)
    {
      _9305_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accx);
    }
    else
    {
      _9305_ = nullptr;
    }
    accx = _9305_;
    std::shared_ptr< monty::ndarray< double,1 > > _9307_;
    bool _9308_ = (NULL != mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accy.get());
    if (_9308_)
    {
      _9307_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_582_that)->accy);
    }
    else
    {
      _9307_ = nullptr;
    }
    accy = _9307_;
  }
}
// mosek.fusion.SolutionStruct.ctor

// Begin mosek.fusion.SolutionStruct.clone
// Method mosek.fusion.SolutionStruct.clone @ bld/docker-win/final/default/src/fusion/Model.mbi:5795:6-79
monty::rc_ptr< ::mosek::fusion::SolutionStruct > mosek::fusion::SolutionStruct :: __mosek_2fusion_2SolutionStruct__clone() { return mosek::fusion::p_SolutionStruct::_get_impl(this)->__mosek_2fusion_2SolutionStruct__clone(); }
monty::rc_ptr< ::mosek::fusion::SolutionStruct > mosek::fusion::SolutionStruct::clone() { return __mosek_2fusion_2SolutionStruct__clone(); }
monty::rc_ptr< ::mosek::fusion::SolutionStruct > mosek::fusion::p_SolutionStruct::__mosek_2fusion_2SolutionStruct__clone()
{
  return ::mosek::fusion::p_SolutionStruct::_new_SolutionStruct(::mosek::fusion::SolutionStruct::t(_pubthis));
}
// End mosek.fusion.SolutionStruct.clone

// Begin mosek.fusion.SolutionStruct.resize
// Method mosek.fusion.SolutionStruct.resize @ bld/docker-win/final/default/src/fusion/Model.mbi:5589:6-5759:7
void mosek::fusion::SolutionStruct :: resize(int32_t _583_numvar,int32_t _584_numcon,int32_t _585_numbarvar,int32_t _586_numacc,int32_t _587_numaccelm) { mosek::fusion::p_SolutionStruct::_get_impl(this)->resize(_583_numvar,_584_numcon,_585_numbarvar,_586_numacc,_587_numaccelm); }
void mosek::fusion::p_SolutionStruct::resize(int32_t _583_numvar,int32_t _584_numcon,int32_t _585_numbarvar,int32_t _586_numacc,int32_t _587_numaccelm)
{
  if ((_586_numacc <= (int)0))
  {
    {
      sol_numacc = (int)0;
    }
  }
  else if((_586_numacc <= ((int)((accptr)->size(0)) - (int)1)))
  {
    {
      sol_numacc = _586_numacc;
    }
  }
  else
  {
    {
      int32_t _588_newnum = safe_mul( ((int)((accptr)->size(0)) - (int)1),(int)2 );
      if ((_588_newnum < _586_numacc))
      {
        {
          _588_newnum = _586_numacc;
        }
      }
      {}
      std::shared_ptr< monty::ndarray< int32_t,1 > > _589_new_accptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _588_newnum,(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__589_new_accptr(_589_new_accptr ? _589_new_accptr->raw() : nullptr,_589_new_accptr ? _589_new_accptr->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(accptr,(int)0,_589_new_accptr,(int)0,safe_add( _586_numacc,(int)1 ));
      accptr = _589_new_accptr;
      sol_numacc = _586_numacc;
    }
  }
  if ((_587_numaccelm <= (int)0))
  {
    {
      sol_numaccelm = (int)0;
    }
  }
  else if((_587_numaccelm > (int)((accx)->size(0))))
  {
    {
      sol_numaccelm = _587_numaccelm;
    }
  }
  else
  {
    {
      int32_t _590_newnum = safe_mul( (int)((accx)->size(0)),(int)2 );
      if ((_590_newnum < _587_numaccelm))
      {
        {
          _590_newnum = _587_numaccelm;
        }
      }
      {}
      std::shared_ptr< monty::ndarray< double,1 > > _591_new_accx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_590_newnum)));
      _checked_ptr_1<double> _ptr__591_new_accx(_591_new_accx ? _591_new_accx->raw() : nullptr,_591_new_accx ? _591_new_accx->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _592_new_accy = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_590_newnum)));
      _checked_ptr_1<double> _ptr__592_new_accy(_592_new_accy ? _592_new_accy->raw() : nullptr,_592_new_accy ? _592_new_accy->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(accx,(int)0,_591_new_accx,(int)0,_587_numaccelm);
      ::mosek::fusion::Utils::Tools::arraycopy(accy,(int)0,_592_new_accy,(int)0,_587_numaccelm);
      accx = _591_new_accx;
      accy = _592_new_accy;
      sol_numaccelm = _587_numaccelm;
    }
  }
  if ((_585_numbarvar < (int)0))
  {
    {
    }
  }
  else if((_585_numbarvar <= sol_numbarvar))
  {
    {
      sol_numbarvar = _585_numbarvar;
    }
  }
  else if((_585_numbarvar <= (int)((barx)->size(0))))
  {
    {
    }
  }
  else
  {
    {
      int32_t _593_newsize;
      if ((safe_mul( sol_numbarvar,(int)2 ) > safe_add( _585_numbarvar,(int)100 )))
      {
        {
          _593_newsize = safe_mul( sol_numbarvar,(int)2 );
        }
      }
      else
      {
        {
          _593_newsize = safe_add( _585_numbarvar,(int)100 );
        }
      }
      barx = ::mosek::fusion::p_CommonTools::resize(barx,_593_newsize);
      bars = ::mosek::fusion::p_CommonTools::resize(bars,_593_newsize);
      sol_numbarvar = _593_newsize;
    }
  }
  if ((_583_numvar < (int)0))
  {
    {
    }
  }
  else if((_583_numvar <= sol_numvar))
  {
    {
      sol_numvar = _583_numvar;
    }
  }
  else if((_583_numvar <= (int)((xx)->size(0))))
  {
    {
      int32_t _9309_ = sol_numvar;
      int32_t _9310_ = _583_numvar;
      for (int32_t _594_i = _9309_; _594_i < _9310_; ++_594_i)
      {
        {
          ((*slx)(_594_i)) = 0.0;
          ((*sux)(_594_i)) = 0.0;
          ((*xx)(_594_i)) = 0.0;
          ((*yx)(_594_i)) = 0.0;
        }
      }
      sol_numvar = _583_numvar;
    }
  }
  else
  {
    {
      int32_t _595_newsize;
      if ((safe_mul( sol_numvar,(int)2 ) > safe_add( _583_numvar,(int)100 )))
      {
        {
          _595_newsize = safe_mul( sol_numvar,(int)2 );
        }
      }
      else
      {
        {
          _595_newsize = safe_add( _583_numvar,(int)100 );
        }
      }
      std::shared_ptr< monty::ndarray< double,1 > > _596_newslx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_595_newsize)));
      _checked_ptr_1<double> _ptr__596_newslx(_596_newslx ? _596_newslx->raw() : nullptr,_596_newslx ? _596_newslx->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(slx,(int)0,_596_newslx,(int)0,(int)((slx)->size(0)));
      slx = _596_newslx;
      std::shared_ptr< monty::ndarray< double,1 > > _597_newsux = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_595_newsize)));
      _checked_ptr_1<double> _ptr__597_newsux(_597_newsux ? _597_newsux->raw() : nullptr,_597_newsux ? _597_newsux->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(sux,(int)0,_597_newsux,(int)0,(int)((sux)->size(0)));
      sux = _597_newsux;
      std::shared_ptr< monty::ndarray< double,1 > > _598_newxx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_595_newsize)));
      _checked_ptr_1<double> _ptr__598_newxx(_598_newxx ? _598_newxx->raw() : nullptr,_598_newxx ? _598_newxx->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(xx,(int)0,_598_newxx,(int)0,(int)((xx)->size(0)));
      xx = _598_newxx;
      std::shared_ptr< monty::ndarray< double,1 > > _599_newyx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_595_newsize)));
      _checked_ptr_1<double> _ptr__599_newyx(_599_newyx ? _599_newyx->raw() : nullptr,_599_newyx ? _599_newyx->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(yx,(int)0,_599_newyx,(int)0,(int)((yx)->size(0)));
      yx = _599_newyx;
      {
        int32_t _600_i = sol_numvar;
        for(;(_600_i < _583_numvar);++ _600_i)
        {
          {
            ((*slx)(_600_i)) = 0.0;
            ((*sux)(_600_i)) = 0.0;
            ((*xx)(_600_i)) = 0.0;
          }
        }
      }
      sol_numvar = _583_numvar;
    }
  }
  if ((_584_numcon < (int)0))
  {
    {
    }
  }
  else if((_584_numcon <= sol_numcon))
  {
    {
      sol_numcon = _584_numcon;
    }
  }
  else if((_584_numcon <= (int)((xx)->size(0))))
  {
    {
      int32_t _9311_ = sol_numcon;
      int32_t _9312_ = _584_numcon;
      for (int32_t _601_i = _9311_; _601_i < _9312_; ++_601_i)
      {
        {
          ((*slc)(_601_i)) = 0.0;
          ((*suc)(_601_i)) = 0.0;
          ((*xc)(_601_i)) = 0.0;
          ((*y)(_601_i)) = 0.0;
        }
      }
      sol_numcon = _584_numcon;
    }
  }
  else
  {
    {
      int32_t _602_newsize;
      if ((safe_mul( sol_numcon,(int)2 ) > safe_add( _584_numcon,(int)100 )))
      {
        {
          _602_newsize = safe_mul( sol_numcon,(int)2 );
        }
      }
      else
      {
        {
          _602_newsize = safe_add( _584_numcon,(int)100 );
        }
      }
      std::shared_ptr< monty::ndarray< double,1 > > _603_newslc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_602_newsize)));
      _checked_ptr_1<double> _ptr__603_newslc(_603_newslc ? _603_newslc->raw() : nullptr,_603_newslc ? _603_newslc->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(slc,(int)0,_603_newslc,(int)0,(int)((slc)->size(0)));
      slc = _603_newslc;
      std::shared_ptr< monty::ndarray< double,1 > > _604_newsuc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_602_newsize)));
      _checked_ptr_1<double> _ptr__604_newsuc(_604_newsuc ? _604_newsuc->raw() : nullptr,_604_newsuc ? _604_newsuc->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(suc,(int)0,_604_newsuc,(int)0,(int)((suc)->size(0)));
      suc = _604_newsuc;
      std::shared_ptr< monty::ndarray< double,1 > > _605_newxc = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_602_newsize)));
      _checked_ptr_1<double> _ptr__605_newxc(_605_newxc ? _605_newxc->raw() : nullptr,_605_newxc ? _605_newxc->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(xc,(int)0,_605_newxc,(int)0,(int)((xc)->size(0)));
      xc = _605_newxc;
      std::shared_ptr< monty::ndarray< double,1 > > _606_newy = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_602_newsize)));
      _checked_ptr_1<double> _ptr__606_newy(_606_newy ? _606_newy->raw() : nullptr,_606_newy ? _606_newy->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(y,(int)0,_606_newy,(int)0,(int)((y)->size(0)));
      y = _606_newy;
      int32_t _9313_ = sol_numcon;
      int32_t _9314_ = _584_numcon;
      for (int32_t _607_i = _9313_; _607_i < _9314_; ++_607_i)
      {
        {
          ((*slc)(_607_i)) = 0.0;
          ((*suc)(_607_i)) = 0.0;
          ((*xc)(_607_i)) = 0.0;
          ((*y)(_607_i)) = 0.0;
        }
      }
      sol_numcon = _584_numcon;
    }
  }
}
// End mosek.fusion.SolutionStruct.resize

// Begin mosek.fusion.SolutionStruct.isDualAcceptable
// Method mosek.fusion.SolutionStruct.isDualAcceptable @ bld/docker-win/final/default/src/fusion/Model.mbi:5584:6-5587:7
bool mosek::fusion::SolutionStruct :: isDualAcceptable(mosek::fusion::AccSolutionStatus _608_acceptable_sol) { return mosek::fusion::p_SolutionStruct::_get_impl(this)->isDualAcceptable(_608_acceptable_sol); }
bool mosek::fusion::p_SolutionStruct::isDualAcceptable(mosek::fusion::AccSolutionStatus _608_acceptable_sol)
{
  return isAcceptable(dstatus,_608_acceptable_sol);
}
// End mosek.fusion.SolutionStruct.isDualAcceptable

// Begin mosek.fusion.SolutionStruct.isPrimalAcceptable
// Method mosek.fusion.SolutionStruct.isPrimalAcceptable @ bld/docker-win/final/default/src/fusion/Model.mbi:5579:6-5582:7
bool mosek::fusion::SolutionStruct :: isPrimalAcceptable(mosek::fusion::AccSolutionStatus _609_acceptable_sol) { return mosek::fusion::p_SolutionStruct::_get_impl(this)->isPrimalAcceptable(_609_acceptable_sol); }
bool mosek::fusion::p_SolutionStruct::isPrimalAcceptable(mosek::fusion::AccSolutionStatus _609_acceptable_sol)
{
  return isAcceptable(pstatus,_609_acceptable_sol);
}
// End mosek.fusion.SolutionStruct.isPrimalAcceptable

// Begin mosek.fusion.SolutionStruct.isAcceptable
// Method mosek.fusion.SolutionStruct.isAcceptable @ bld/docker-win/final/default/src/fusion/Model.mbi:5553:6-5577:7
bool mosek::fusion::p_SolutionStruct::isAcceptable(mosek::fusion::SolutionStatus _610_stat,mosek::fusion::AccSolutionStatus _611_accstat)
{
  if ((_611_accstat == ::mosek::fusion::AccSolutionStatus::Anything))
  {
    {
      return true;
    }
  }
  else if((_611_accstat == ::mosek::fusion::AccSolutionStatus::Optimal))
  {
    {
      return (_610_stat == ::mosek::fusion::SolutionStatus::Optimal);
    }
  }
  else if((_611_accstat == ::mosek::fusion::AccSolutionStatus::Feasible))
  {
    {
      return ((_610_stat == ::mosek::fusion::SolutionStatus::Optimal) || (_610_stat == ::mosek::fusion::SolutionStatus::Feasible));
    }
  }
  else if((_611_accstat == ::mosek::fusion::AccSolutionStatus::Certificate))
  {
    {
      return (_610_stat == ::mosek::fusion::SolutionStatus::Certificate);
    }
  }
  {}
  return false;
}
// End mosek.fusion.SolutionStruct.isAcceptable

void mosek::fusion::p_SolutionStruct::destroy()
{
  accy.reset();
  accx.reset();
  accptr.reset();
  yx.reset();
  sux.reset();
  slx.reset();
  bars.reset();
  barx.reset();
  y.reset();
  suc.reset();
  slc.reset();
  xx.reset();
  xc.reset();
}
void mosek::fusion::SolutionStruct::destroy() { mosek::fusion::p_SolutionStruct::_get_impl(this)->destroy(); }
// } class SolutionStruct
// class RowBlockManager { // @ bld/docker-win/final/default/src/fusion/Model.mbi:5107:4-5517:5
mosek::fusion::RowBlockManager::RowBlockManager(mosek::fusion::p_RowBlockManager *_impl) : _impl(_impl) { /*std::cout << "RowBlockManager() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::RowBlockManager::~RowBlockManager() { delete _impl; _impl = nullptr; }
mosek::fusion::p_RowBlockManager::p_RowBlockManager
  (::mosek::fusion::RowBlockManager * _pubthis) :     _pubthis(_pubthis)
{}
int32_t mosek::fusion::RowBlockManager::get_varidx_used() { return _impl->varidx_used; }
void mosek::fusion::RowBlockManager::set_varidx_used(int32_t _val) { _impl->varidx_used = _val; }
int32_t mosek::fusion::RowBlockManager::get_code_used() { return _impl->code_used; }
void mosek::fusion::RowBlockManager::set_code_used(int32_t _val) { _impl->code_used = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::RowBlockManager::get_cconst() { return _impl->cconst; }
void mosek::fusion::RowBlockManager::set_cconst(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->cconst = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::RowBlockManager::get_code() { return _impl->code; }
void mosek::fusion::RowBlockManager::set_code(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->code = _val; }
int32_t mosek::fusion::RowBlockManager::get_first_free_codeitem() { return _impl->first_free_codeitem; }
void mosek::fusion::RowBlockManager::set_first_free_codeitem(int32_t _val) { _impl->first_free_codeitem = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::RowBlockManager::get_param_code_sizes() { return _impl->param_code_sizes; }
void mosek::fusion::RowBlockManager::set_param_code_sizes(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->param_code_sizes = _val; }
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::RowBlockManager::get_param_varidx() { return _impl->param_varidx; }
void mosek::fusion::RowBlockManager::set_param_varidx(std::shared_ptr< monty::ndarray< int64_t,1 > > _val) { _impl->param_varidx = _val; }
int32_t mosek::fusion::RowBlockManager::get_first_free_entry() { return _impl->first_free_entry; }
void mosek::fusion::RowBlockManager::set_first_free_entry(int32_t _val) { _impl->first_free_entry = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::RowBlockManager::get_row_code_ptr() { return _impl->row_code_ptr; }
void mosek::fusion::RowBlockManager::set_row_code_ptr(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->row_code_ptr = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::RowBlockManager::get_row_param_ptre() { return _impl->row_param_ptre; }
void mosek::fusion::RowBlockManager::set_row_param_ptre(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->row_param_ptre = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::RowBlockManager::get_row_param_ptrb() { return _impl->row_param_ptrb; }
void mosek::fusion::RowBlockManager::set_row_param_ptrb(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->row_param_ptrb = _val; }
monty::rc_ptr< ::mosek::fusion::LinkedBlocks > mosek::fusion::RowBlockManager::get_blocks() { return _impl->blocks; }
void mosek::fusion::RowBlockManager::set_blocks(monty::rc_ptr< ::mosek::fusion::LinkedBlocks > _val) { _impl->blocks = _val; }
// mosek.fusion.RowBlockManager.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:5170:6-5186:7
mosek::fusion::RowBlockManager::t mosek::fusion::p_RowBlockManager::_new_RowBlockManager
  (monty::rc_ptr< ::mosek::fusion::RowBlockManager > _612_that)
{ return new mosek::fusion::RowBlockManager(_612_that); }
mosek::fusion::RowBlockManager::RowBlockManager
  (monty::rc_ptr< ::mosek::fusion::RowBlockManager > _612_that) : 
   RowBlockManager(new mosek::fusion::p_RowBlockManager(this))
{ mosek::fusion::p_RowBlockManager::_get_impl(this)->_initialize(_612_that); }
void mosek::fusion::p_RowBlockManager::_initialize  (monty::rc_ptr< ::mosek::fusion::RowBlockManager > _612_that)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    blocks = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->blocks);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9315_;
    bool _9316_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_param_ptrb.get());
    if (_9316_)
    {
      _9315_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_param_ptrb);
    }
    else
    {
      _9315_ = nullptr;
    }
    row_param_ptrb = _9315_;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9317_;
    bool _9318_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_param_ptre.get());
    if (_9318_)
    {
      _9317_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_param_ptre);
    }
    else
    {
      _9317_ = nullptr;
    }
    row_param_ptre = _9317_;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9319_;
    bool _9320_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_code_ptr.get());
    if (_9320_)
    {
      _9319_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->row_code_ptr);
    }
    else
    {
      _9319_ = nullptr;
    }
    row_code_ptr = _9319_;
    first_free_entry = mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->first_free_entry;
    std::shared_ptr< monty::ndarray< int64_t,1 > > _9321_;
    bool _9322_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->param_varidx.get());
    if (_9322_)
    {
      _9321_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->param_varidx);
    }
    else
    {
      _9321_ = nullptr;
    }
    param_varidx = _9321_;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9323_;
    bool _9324_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->param_code_sizes.get());
    if (_9324_)
    {
      _9323_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->param_code_sizes);
    }
    else
    {
      _9323_ = nullptr;
    }
    param_code_sizes = _9323_;
    first_free_codeitem = mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->first_free_codeitem;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _9325_;
    bool _9326_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->code.get());
    if (_9326_)
    {
      _9325_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->code);
    }
    else
    {
      _9325_ = nullptr;
    }
    code = _9325_;
    std::shared_ptr< monty::ndarray< double,1 > > _9327_;
    bool _9328_ = (NULL != mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->cconst.get());
    if (_9328_)
    {
      _9327_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->cconst);
    }
    else
    {
      _9327_ = nullptr;
    }
    cconst = _9327_;
    code_used = mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->code_used;
    varidx_used = mosek::fusion::p_RowBlockManager::_get_impl(_612_that)->varidx_used;
  }
}
// mosek.fusion.RowBlockManager.ctor

// mosek.fusion.RowBlockManager.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:5154:6-5168:7
mosek::fusion::RowBlockManager::t mosek::fusion::p_RowBlockManager::_new_RowBlockManager
  ()
{ return new mosek::fusion::RowBlockManager(); }
mosek::fusion::RowBlockManager::RowBlockManager
  () : 
   RowBlockManager(new mosek::fusion::p_RowBlockManager(this))
{ mosek::fusion::p_RowBlockManager::_get_impl(this)->_initialize(); }
void mosek::fusion::p_RowBlockManager::_initialize  ()
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    blocks = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks();
    row_param_ptrb = nullptr;
    row_param_ptre = nullptr;
    row_code_ptr = nullptr;
    first_free_entry = (int)0;
    param_varidx = nullptr;
    param_code_sizes = nullptr;
    first_free_codeitem = (int)0;
    code = nullptr;
    cconst = nullptr;
    code_used = (int)0;
    varidx_used = (int)0;
  }
}
// mosek.fusion.RowBlockManager.ctor

// Begin mosek.fusion.RowBlockManager.num_parameterized
// Method mosek.fusion.RowBlockManager.num_parameterized @ bld/docker-win/final/default/src/fusion/Model.mbi:5516:6-69
int32_t mosek::fusion::RowBlockManager :: num_parameterized() { return mosek::fusion::p_RowBlockManager::_get_impl(this)->num_parameterized(); }
int32_t mosek::fusion::p_RowBlockManager::num_parameterized()
{
  return varidx_used;
}
// End mosek.fusion.RowBlockManager.num_parameterized

// Begin mosek.fusion.RowBlockManager.is_parameterized
// Method mosek.fusion.RowBlockManager.is_parameterized @ bld/docker-win/final/default/src/fusion/Model.mbi:5515:6-69
bool mosek::fusion::RowBlockManager :: is_parameterized() { return mosek::fusion::p_RowBlockManager::_get_impl(this)->is_parameterized(); }
bool mosek::fusion::p_RowBlockManager::is_parameterized()
{
  return (code_used > (int)0);
}
// End mosek.fusion.RowBlockManager.is_parameterized

// Begin mosek.fusion.RowBlockManager.blocksize
// Method mosek.fusion.RowBlockManager.blocksize @ bld/docker-win/final/default/src/fusion/Model.mbi:5514:6-79
int32_t mosek::fusion::RowBlockManager :: blocksize(int32_t _613_id) { return mosek::fusion::p_RowBlockManager::_get_impl(this)->blocksize(_613_id); }
int32_t mosek::fusion::p_RowBlockManager::blocksize(int32_t _613_id)
{
  return blocks->blocksize(_613_id);
}
// End mosek.fusion.RowBlockManager.blocksize

// Begin mosek.fusion.RowBlockManager.block_capacity
// Method mosek.fusion.RowBlockManager.block_capacity @ bld/docker-win/final/default/src/fusion/Model.mbi:5513:6-79
int32_t mosek::fusion::RowBlockManager :: block_capacity() { return mosek::fusion::p_RowBlockManager::_get_impl(this)->block_capacity(); }
int32_t mosek::fusion::p_RowBlockManager::block_capacity()
{
  return blocks->block_capacity();
}
// End mosek.fusion.RowBlockManager.block_capacity

// Begin mosek.fusion.RowBlockManager.capacity
// Method mosek.fusion.RowBlockManager.capacity @ bld/docker-win/final/default/src/fusion/Model.mbi:5512:6-67
int32_t mosek::fusion::RowBlockManager :: capacity() { return mosek::fusion::p_RowBlockManager::_get_impl(this)->capacity(); }
int32_t mosek::fusion::p_RowBlockManager::capacity()
{
  return blocks->capacity();
}
// End mosek.fusion.RowBlockManager.capacity

// Begin mosek.fusion.RowBlockManager.get
// Method mosek.fusion.RowBlockManager.get @ bld/docker-win/final/default/src/fusion/Model.mbi:5511:6-102
void mosek::fusion::RowBlockManager :: get(int32_t _614_id,std::shared_ptr< monty::ndarray< int32_t,1 > > _615_target,int32_t _616_offset) { mosek::fusion::p_RowBlockManager::_get_impl(this)->get(_614_id,_615_target,_616_offset); }
void mosek::fusion::p_RowBlockManager::get(int32_t _614_id,std::shared_ptr< monty::ndarray< int32_t,1 > > _615_target,int32_t _616_offset)
{
  _checked_ptr_1<int32_t> _ptr__615_target(_615_target ? _615_target->raw() : nullptr, _615_target ? _615_target->size(0) : 0);
  blocks->get(_614_id,_615_target,_616_offset);
}
// End mosek.fusion.RowBlockManager.get

// Begin mosek.fusion.RowBlockManager.evaluate
// Method mosek.fusion.RowBlockManager.evaluate @ bld/docker-win/final/default/src/fusion/Model.mbi:5443:6-5509:7
void mosek::fusion::RowBlockManager :: evaluate(monty::rc_ptr< ::mosek::fusion::WorkStack > _617_xs,std::shared_ptr< monty::ndarray< double,1 > > _618_param_value,std::shared_ptr< monty::ndarray< int32_t,1 > > _619_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _620_subj,std::shared_ptr< monty::ndarray< double,1 > > _621_val) { mosek::fusion::p_RowBlockManager::_get_impl(this)->evaluate(_617_xs,_618_param_value,_619_subi,_620_subj,_621_val); }
void mosek::fusion::p_RowBlockManager::evaluate(monty::rc_ptr< ::mosek::fusion::WorkStack > _617_xs,std::shared_ptr< monty::ndarray< double,1 > > _618_param_value,std::shared_ptr< monty::ndarray< int32_t,1 > > _619_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _620_subj,std::shared_ptr< monty::ndarray< double,1 > > _621_val)
{
  _checked_ptr_1<double> _ptr__618_param_value(_618_param_value ? _618_param_value->raw() : nullptr, _618_param_value ? _618_param_value->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__619_subi(_619_subi ? _619_subi->raw() : nullptr, _619_subi ? _619_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__620_subj(_620_subj ? _620_subj->raw() : nullptr, _620_subj ? _620_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__621_val(_621_val ? _621_val->raw() : nullptr, _621_val ? _621_val->size(0) : 0);
  int32_t _622_stack = _617_xs->allocf64(code_used);
  int32_t _623_stackp = (int)0;
  std::shared_ptr< monty::ndarray< double,1 > > _624_xf64 = mosek::fusion::p_WorkStack::_get_impl(_617_xs)->f64;
  _checked_ptr_1<double> _ptr__624_xf64(_624_xf64 ? _624_xf64->raw() : nullptr,_624_xf64 ? _624_xf64->size(0) : 0);
  int32_t _625_idx = (int)0;
  int32_t _9329_ = (int)0;
  int32_t _9330_ = (int)((row_param_ptrb)->size(0));
  for (int32_t _626_i = _9329_; _626_i < _9330_; ++_626_i)
  {
    {
      if ((((*row_param_ptrb)(_626_i)) < ((*row_param_ptre)(_626_i))))
      {
        {
          int32_t _627_k = ((*row_code_ptr)(_626_i));
          int32_t _9331_ = ((*row_param_ptrb)(_626_i));
          int32_t _9332_ = ((*row_param_ptre)(_626_i));
          for (int32_t _628_j = _9331_; _628_j < _9332_; ++_628_j)
          {
            {
              int32_t _9333_ = (int)0;
              int32_t _9334_ = ((*param_code_sizes)(_628_j));
              for (int32_t _629_l = _9333_; _629_l < _9334_; ++_629_l)
              {
                {
                  if ((((*code)(_627_k)) == 0))
                  {
                    {
                    }
                  }
                  else
                  {
                    {
                      if ((((*code)(_627_k)) == 1))
                      {
                        {
                          _ptr__624_xf64[safe_add( _622_stack,_623_stackp )] = _ptr__618_param_value[(int32_t)((*cconst)(_627_k))];
                          ++ _623_stackp;
                        }
                      }
                      else
                      {
                        {
                          if ((((*code)(_627_k)) == 2))
                          {
                            {
                              _ptr__624_xf64[safe_add( _622_stack,_623_stackp )] = ((*cconst)(_627_k));
                              ++ _623_stackp;
                            }
                          }
                          else
                          {
                            {
                              if ((((*code)(_627_k)) == 3))
                              {
                                {
                                  _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)2)] += _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)];
                                  -- _623_stackp;
                                }
                              }
                              else
                              {
                                {
                                  if ((((*code)(_627_k)) == 4))
                                  {
                                    {
                                      _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)] = (-_ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)]);
                                    }
                                  }
                                  else
                                  {
                                    {
                                      if ((((*code)(_627_k)) == 5))
                                      {
                                        {
                                          _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)2)] *= _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)];
                                          -- _623_stackp;
                                        }
                                      }
                                      else
                                      {
                                        {
                                          if ((((*code)(_627_k)) == 6))
                                          {
                                            {
                                              _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)] = (1.0 / _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)]);
                                            }
                                          }
                                          else
                                          {
                                            {
                                              if ((((*code)(_627_k)) == 8))
                                              {
                                                {
                                                  double _630_v = 0.0;
                                                  int32_t _9335_ = (int)0;
                                                  int32_t _9336_ = (int32_t)((*cconst)(_627_k));
                                                  for (int32_t _631_i = _9335_; _631_i < _9336_; ++_631_i)
                                                  {
                                                    {
                                                      _630_v += _ptr__624_xf64[(safe_add( _622_stack,_623_stackp ) - (int)1)];
                                                      -- _623_stackp;
                                                    }
                                                  }
                                                  _ptr__624_xf64[safe_add( _622_stack,_623_stackp )] = _630_v;
                                                  ++ _623_stackp;
                                                }
                                              }
                                              else
                                              {
                                                {
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  ++ _627_k;
                }
              }
              _ptr__619_subi[_625_idx] = _626_i;
              _ptr__620_subj[_625_idx] = (int32_t)((*param_varidx)(_628_j));
              _ptr__621_val[_625_idx] = _ptr__624_xf64[_622_stack];
              _623_stackp = (int)0;
              ++ _625_idx;
            }
          }
        }
      }
      {}
    }
  }
  _617_xs->popf64(code_used);
}
// End mosek.fusion.RowBlockManager.evaluate

// Begin mosek.fusion.RowBlockManager.replace_row_code
// Method mosek.fusion.RowBlockManager.replace_row_code @ bld/docker-win/final/default/src/fusion/Model.mbi:5330:6-5441:7
void mosek::fusion::RowBlockManager :: replace_row_code(monty::rc_ptr< ::mosek::fusion::WorkStack > _632_rs,std::shared_ptr< monty::ndarray< int32_t,1 > > _633_nativeidxs,int32_t _634_ptr,int32_t _635_nidxs,int32_t _636_codeptr,int32_t _637_code_p,int32_t _638_cconst_p) { mosek::fusion::p_RowBlockManager::_get_impl(this)->replace_row_code(_632_rs,_633_nativeidxs,_634_ptr,_635_nidxs,_636_codeptr,_637_code_p,_638_cconst_p); }
void mosek::fusion::p_RowBlockManager::replace_row_code(monty::rc_ptr< ::mosek::fusion::WorkStack > _632_rs,std::shared_ptr< monty::ndarray< int32_t,1 > > _633_nativeidxs,int32_t _634_ptr,int32_t _635_nidxs,int32_t _636_codeptr,int32_t _637_code_p,int32_t _638_cconst_p)
{
  _checked_ptr_1<int32_t> _ptr__633_nativeidxs(_633_nativeidxs ? _633_nativeidxs->raw() : nullptr, _633_nativeidxs ? _633_nativeidxs->size(0) : 0);
  int32_t _639_nelem = (int)((_633_nativeidxs)->size(0));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _640_ri32 = mosek::fusion::p_WorkStack::_get_impl(_632_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__640_ri32(_640_ri32 ? _640_ri32->raw() : nullptr,_640_ri32 ? _640_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _641_ri64 = mosek::fusion::p_WorkStack::_get_impl(_632_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__641_ri64(_641_ri64 ? _641_ri64->raw() : nullptr,_641_ri64 ? _641_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _642_rf64 = mosek::fusion::p_WorkStack::_get_impl(_632_rs)->f64;
  _checked_ptr_1<double> _ptr__642_rf64(_642_rf64 ? _642_rf64->raw() : nullptr,_642_rf64 ? _642_rf64->size(0) : 0);
  bool _643_ok = true;
  {
    int32_t _644_numop = (int)0;
    int32_t _645_nentry = (int)0;
    {
      int32_t _9337_ = (int)0;
      int32_t _9338_ = _639_nelem;
      for (int32_t _646_i = _9337_; _646_i < _9338_; ++_646_i)
      {
        {
          int32_t _9339_ = _ptr__640_ri32[safe_add( _634_ptr,_646_i )];
          int32_t _9340_ = _ptr__640_ri32[safe_add( safe_add( _634_ptr,_646_i ),(int)1 )];
          for (int32_t _647_j = _9339_; _647_j < _9340_; ++_647_j)
          {
            {
              if ((((_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_647_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_647_j )]) == (int)1) && ((_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_647_j )] )] == 10) || (_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_647_j )] )] == 2))))
              {
                {
                }
              }
              else
              {
                {
                  ++ _645_nentry;
                  _644_numop += (_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_647_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_647_j )]);
                }
              }
            }
          }
        }
      }
      _pubthis->clear_row_code(_633_nativeidxs);
    }
    ensure_code_cap(_645_nentry,_644_numop);
    code_used += _644_numop;
    varidx_used += _645_nentry;
  }
  if ((first_free_codeitem > safe_mul( code_used,(int)2 )))
  {
    {
      compress();
    }
  }
  {}
  {
    int32_t _9341_ = (int)0;
    int32_t _9342_ = _639_nelem;
    for (int32_t _648_i = _9341_; _648_i < _9342_; ++_648_i)
    {
      {
        int32_t _649_subi = _ptr__633_nativeidxs[_648_i];
        int32_t _650_cnnz = (int)0;
        int32_t _651_rncodeatom = (int)0;
        int32_t _9343_ = _ptr__640_ri32[safe_add( _634_ptr,_648_i )];
        int32_t _9344_ = _ptr__640_ri32[safe_add( safe_add( _634_ptr,_648_i ),(int)1 )];
        for (int32_t _652_j = _9343_; _652_j < _9344_; ++_652_j)
        {
          {
            if ((((_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_652_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_652_j )]) == (int)1) && ((_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_652_j )] )] == 10) || (_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_652_j )] )] == 2))))
            {
              {
              }
            }
            else
            {
              {
                ++ _650_cnnz;
                _651_rncodeatom += (_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_652_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_652_j )]);
              }
            }
          }
        }
        int32_t _653_ni = _ptr__633_nativeidxs[_648_i];
        int32_t _654_n = (((*row_param_ptre)(_653_ni)) - ((*row_param_ptrb)(_653_ni)));
        if ((_650_cnnz > (int)0))
        {
          {
            ((*row_param_ptrb)(_649_subi)) = first_free_entry;
            ((*row_param_ptre)(_649_subi)) = safe_add( first_free_entry,_650_cnnz );
            ((*row_code_ptr)(_649_subi)) = first_free_codeitem;
            first_free_entry += _650_cnnz;
            first_free_codeitem += _651_rncodeatom;
          }
        }
        {}
      }
    }
  }
  int32_t _9345_ = (int)0;
  int32_t _9346_ = _639_nelem;
  for (int32_t _655_i = _9345_; _655_i < _9346_; ++_655_i)
  {
    {
      int32_t _656_subi = _ptr__633_nativeidxs[_655_i];
      int32_t _657_codei = ((*row_code_ptr)(_656_subi));
      int32_t _658_elmi = ((*row_param_ptrb)(_656_subi));
      int32_t _9347_ = _ptr__640_ri32[safe_add( _634_ptr,_655_i )];
      int32_t _9348_ = _ptr__640_ri32[safe_add( safe_add( _634_ptr,_655_i ),(int)1 )];
      for (int32_t _659_j = _9347_; _659_j < _9348_; ++_659_j)
      {
        {
          if ((((_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_659_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_659_j )]) == (int)1) && ((_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_659_j )] )] == 10) || (_ptr__640_ri32[safe_add( _637_code_p,_ptr__640_ri32[safe_add( _636_codeptr,_659_j )] )] == 2))))
          {
            {
            }
          }
          else
          {
            {
              int32_t _9349_ = _ptr__640_ri32[safe_add( _636_codeptr,_659_j )];
              int32_t _9350_ = _ptr__640_ri32[safe_add( safe_add( _636_codeptr,_659_j ),(int)1 )];
              for (int32_t _660_k = _9349_; _660_k < _9350_; ++_660_k)
              {
                {
                  ((*code)(_657_codei)) = _ptr__640_ri32[safe_add( _637_code_p,_660_k )];
                  ((*cconst)(_657_codei)) = _ptr__642_rf64[safe_add( _638_cconst_p,_660_k )];
                  ++ _657_codei;
                }
              }
              ((*param_code_sizes)(_658_elmi)) = (_ptr__640_ri32[safe_add( safe_add( _636_codeptr,_659_j ),(int)1 )] - _ptr__640_ri32[safe_add( _636_codeptr,_659_j )]);
              ((*param_varidx)(_658_elmi)) = _ptr__641_ri64[safe_add( _635_nidxs,_659_j )];
              _643_ok = (_643_ok && (_ptr__641_ri64[safe_add( _635_nidxs,_659_j )] >= (int)0));
              ++ _658_elmi;
            }
          }
        }
      }
    }
  }
  if ((!_643_ok))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Expression contains parameterized SDP non-zero"));
    }
  }
  {}
}
// End mosek.fusion.RowBlockManager.replace_row_code

// Begin mosek.fusion.RowBlockManager.clear_row_code
// Method mosek.fusion.RowBlockManager.clear_row_code @ bld/docker-win/final/default/src/fusion/Model.mbi:5303:6-5319:7
void mosek::fusion::RowBlockManager :: clear_row_code(std::shared_ptr< monty::ndarray< int32_t,1 > > _661_nativeidxs) { mosek::fusion::p_RowBlockManager::_get_impl(this)->clear_row_code(_661_nativeidxs); }
void mosek::fusion::p_RowBlockManager::clear_row_code(std::shared_ptr< monty::ndarray< int32_t,1 > > _661_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__661_nativeidxs(_661_nativeidxs ? _661_nativeidxs->raw() : nullptr, _661_nativeidxs ? _661_nativeidxs->size(0) : 0);
  if ((NULL != row_param_ptrb.get()))
  {
    {
      int32_t _9351_ = (int)0;
      int32_t _9352_ = (int)((_661_nativeidxs)->size(0));
      for (int32_t _662_i = _9351_; _662_i < _9352_; ++_662_i)
      {
        {
          int32_t _9353_ = ((*row_param_ptrb)(_ptr__661_nativeidxs[_662_i]));
          int32_t _9354_ = ((*row_param_ptre)(_ptr__661_nativeidxs[_662_i]));
          for (int32_t _663_j = _9353_; _663_j < _9354_; ++_663_j)
          {
            {
              code_used -= ((*param_code_sizes)(_663_j));
            }
          }
          varidx_used -= (((*row_param_ptre)(_ptr__661_nativeidxs[_662_i])) - ((*row_param_ptrb)(_ptr__661_nativeidxs[_662_i])));
          ((*row_param_ptrb)(_ptr__661_nativeidxs[_662_i])) = (int)0;
          ((*row_param_ptre)(_ptr__661_nativeidxs[_662_i])) = (int)0;
        }
      }
    }
  }
  {}
}
// End mosek.fusion.RowBlockManager.clear_row_code

// Begin mosek.fusion.RowBlockManager.compress
// Method mosek.fusion.RowBlockManager.compress @ bld/docker-win/final/default/src/fusion/Model.mbi:5259:6-5301:7
void mosek::fusion::p_RowBlockManager::compress()
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _664_newcode = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(code_used)));
  _checked_ptr_1<int32_t> _ptr__664_newcode(_664_newcode ? _664_newcode->raw() : nullptr,_664_newcode ? _664_newcode->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _665_newcconst = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(code_used)));
  _checked_ptr_1<double> _ptr__665_newcconst(_665_newcconst ? _665_newcconst->raw() : nullptr,_665_newcconst ? _665_newcconst->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _666_newvaridx = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(first_free_entry)));
  _checked_ptr_1<int64_t> _ptr__666_newvaridx(_666_newvaridx ? _666_newvaridx->raw() : nullptr,_666_newvaridx ? _666_newvaridx->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _667_newcodesizes = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(first_free_entry)));
  _checked_ptr_1<int32_t> _ptr__667_newcodesizes(_667_newcodesizes ? _667_newcodesizes->raw() : nullptr,_667_newcodesizes ? _667_newcodesizes->size(0) : 0);
  int32_t _668_tgtptr = (int)0;
  int32_t _669_tgtcptr = (int)0;
  int32_t _9355_ = (int)0;
  int32_t _9356_ = (int)((row_param_ptrb)->size(0));
  for (int32_t _670_i = _9355_; _670_i < _9356_; ++_670_i)
  {
    {
      int32_t _671_codesize = (int)0;
      int32_t _672_n = (((*row_param_ptre)(_670_i)) - ((*row_param_ptrb)(_670_i)));
      ::mosek::fusion::Utils::Tools::arraycopy(param_varidx,((*row_param_ptrb)(_670_i)),_666_newvaridx,_668_tgtptr,_672_n);
      ::mosek::fusion::Utils::Tools::arraycopy(param_code_sizes,((*row_param_ptrb)(_670_i)),_667_newcodesizes,_668_tgtptr,_672_n);
      int32_t _9357_ = ((*row_param_ptrb)(_670_i));
      int32_t _9358_ = ((*row_param_ptre)(_670_i));
      for (int32_t _673_j = _9357_; _673_j < _9358_; ++_673_j)
      {
        {
          _671_codesize += ((*param_code_sizes)(_673_j));
        }
      }
      ::mosek::fusion::Utils::Tools::arraycopy(code,((*row_code_ptr)(_670_i)),_664_newcode,_669_tgtcptr,_671_codesize);
      ::mosek::fusion::Utils::Tools::arraycopy(cconst,((*row_code_ptr)(_670_i)),_665_newcconst,_669_tgtcptr,_671_codesize);
      ((*row_param_ptrb)(_670_i)) = _668_tgtptr;
      ((*row_param_ptre)(_670_i)) = safe_add( _668_tgtptr,_672_n );
      ((*row_code_ptr)(_670_i)) = _669_tgtcptr;
      _669_tgtcptr += _671_codesize;
      _668_tgtptr += _672_n;
    }
  }
  ::mosek::fusion::Utils::Tools::arraycopy(_666_newvaridx,(int)0,param_varidx,(int)0,_668_tgtptr);
  ::mosek::fusion::Utils::Tools::arraycopy(_667_newcodesizes,(int)0,param_code_sizes,(int)0,_668_tgtptr);
  ::mosek::fusion::Utils::Tools::arraycopy(_664_newcode,(int)0,code,(int)0,_669_tgtcptr);
  ::mosek::fusion::Utils::Tools::arraycopy(_665_newcconst,(int)0,cconst,(int)0,_669_tgtcptr);
  first_free_codeitem = _669_tgtcptr;
  first_free_entry = _668_tgtptr;
}
// End mosek.fusion.RowBlockManager.compress

// Begin mosek.fusion.RowBlockManager.ensure_code_cap
// Method mosek.fusion.RowBlockManager.ensure_code_cap @ bld/docker-win/final/default/src/fusion/Model.mbi:5223:6-5257:7
void mosek::fusion::p_RowBlockManager::ensure_code_cap(int32_t _674_nentry,int32_t _675_codesize)
{
  if ((NULL == row_code_ptr.get()))
  {
    {
      int32_t _676_n = (int)128;
      while ( (_676_n < _674_nentry) )
      {
        {
          _676_n *= (int)2;
        }
      }
      int32_t _677_m = (int)128;
      while ( (_677_m < _675_codesize) )
      {
        {
          _677_m *= (int)2;
        }
      }
      row_param_ptrb = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      row_param_ptre = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      row_code_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      param_varidx = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_676_n)));
      param_code_sizes = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_676_n)));
      code = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_677_m)));
      cconst = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_677_m)));
    }
  }
  else
  {
    {
      if ((_674_nentry > ((int)((param_varidx)->size(0)) - first_free_entry)))
      {
        {
          int32_t _678_n = (int)((param_varidx)->size(0));
          while ( ((_678_n - first_free_entry) < _674_nentry) )
          {
            {
              _678_n *= (int)2;
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _679_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_678_n)));
          _checked_ptr_1<int32_t> _ptr__679_ptr(_679_ptr ? _679_ptr->raw() : nullptr,_679_ptr ? _679_ptr->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _680_varidx = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_678_n)));
          _checked_ptr_1<int64_t> _ptr__680_varidx(_680_varidx ? _680_varidx->raw() : nullptr,_680_varidx ? _680_varidx->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _681_code_sizes = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_678_n)));
          _checked_ptr_1<int32_t> _ptr__681_code_sizes(_681_code_sizes ? _681_code_sizes->raw() : nullptr,_681_code_sizes ? _681_code_sizes->size(0) : 0);
          ::mosek::fusion::Utils::Tools::arraycopy(param_varidx,(int)0,_680_varidx,(int)0,first_free_entry);
          ::mosek::fusion::Utils::Tools::arraycopy(param_code_sizes,(int)0,_681_code_sizes,(int)0,first_free_entry);
          param_varidx = _680_varidx;
          param_code_sizes = _681_code_sizes;
        }
      }
      {}
      if ((_675_codesize > ((int)((code)->size(0)) - first_free_codeitem)))
      {
        {
          int32_t _682_n = (int)((code)->size(0));
          while ( (_675_codesize > (_682_n - first_free_codeitem)) )
          {
            {
              _682_n *= (int)2;
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _683_tcode = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_682_n)));
          _checked_ptr_1<int32_t> _ptr__683_tcode(_683_tcode ? _683_tcode->raw() : nullptr,_683_tcode ? _683_tcode->size(0) : 0);
          ::mosek::fusion::Utils::Tools::arraycopy(code,(int)0,_683_tcode,(int)0,first_free_codeitem);
          std::shared_ptr< monty::ndarray< double,1 > > _684_tcconst = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_682_n)));
          _checked_ptr_1<double> _ptr__684_tcconst(_684_tcconst ? _684_tcconst->raw() : nullptr,_684_tcconst ? _684_tcconst->size(0) : 0);
          ::mosek::fusion::Utils::Tools::arraycopy(cconst,(int)0,_684_tcconst,(int)0,first_free_codeitem);
          code = _683_tcode;
          cconst = _684_tcconst;
        }
      }
      {}
    }
  }
}
// End mosek.fusion.RowBlockManager.ensure_code_cap

// Begin mosek.fusion.RowBlockManager.release
// Method mosek.fusion.RowBlockManager.release @ bld/docker-win/final/default/src/fusion/Model.mbi:5210:6-5221:7
void mosek::fusion::RowBlockManager :: release(int32_t _685_id,std::shared_ptr< monty::ndarray< int32_t,1 > > _686_nativeidxs) { mosek::fusion::p_RowBlockManager::_get_impl(this)->release(_685_id,_686_nativeidxs); }
void mosek::fusion::p_RowBlockManager::release(int32_t _685_id,std::shared_ptr< monty::ndarray< int32_t,1 > > _686_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__686_nativeidxs(_686_nativeidxs ? _686_nativeidxs->raw() : nullptr, _686_nativeidxs ? _686_nativeidxs->size(0) : 0);
  int32_t _687_num = blocks->blocksize(_685_id);
  blocks->get(_685_id,_686_nativeidxs,(int)0);
  blocks->free(_685_id);
  if ((NULL != row_code_ptr.get()))
  {
    {
      int32_t _9359_ = (int)0;
      int32_t _9360_ = _687_num;
      for (int32_t _688_i = _9359_; _688_i < _9360_; ++_688_i)
      {
        {
          int32_t _689_ni = _ptr__686_nativeidxs[_688_i];
          code_used -= (((*row_param_ptre)(_689_ni)) - ((*row_param_ptrb)(_689_ni)));
          ((*row_param_ptre)(_689_ni)) = (int)0;
          ((*row_param_ptrb)(_689_ni)) = (int)0;
        }
      }
    }
  }
  {}
}
// End mosek.fusion.RowBlockManager.release

// Begin mosek.fusion.RowBlockManager.allocate
// Method mosek.fusion.RowBlockManager.allocate @ bld/docker-win/final/default/src/fusion/Model.mbi:5192:6-5208:7
int32_t mosek::fusion::RowBlockManager :: allocate(std::shared_ptr< monty::ndarray< int32_t,1 > > _690_nativeidxs) { return mosek::fusion::p_RowBlockManager::_get_impl(this)->allocate(_690_nativeidxs); }
int32_t mosek::fusion::p_RowBlockManager::allocate(std::shared_ptr< monty::ndarray< int32_t,1 > > _690_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__690_nativeidxs(_690_nativeidxs ? _690_nativeidxs->raw() : nullptr, _690_nativeidxs ? _690_nativeidxs->size(0) : 0);
  int32_t _691_num = (int)((_690_nativeidxs)->size(0));
  int32_t _692_id = blocks->alloc(_691_num);
  blocks->get(_692_id,_690_nativeidxs,(int)0);
  if (((NULL != row_code_ptr.get()) && (blocks->capacity() > (int)((row_param_ptrb)->size(0)))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _693_ptrb = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      _checked_ptr_1<int32_t> _ptr__693_ptrb(_693_ptrb ? _693_ptrb->raw() : nullptr,_693_ptrb ? _693_ptrb->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(row_param_ptrb,(int)0,_693_ptrb,(int)0,(int)((row_param_ptrb)->size(0)));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _694_ptre = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      _checked_ptr_1<int32_t> _ptr__694_ptre(_694_ptre ? _694_ptre->raw() : nullptr,_694_ptre ? _694_ptre->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(row_param_ptre,(int)0,_694_ptre,(int)0,(int)((row_param_ptre)->size(0)));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _695_cptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      _checked_ptr_1<int32_t> _ptr__695_cptr(_695_cptr ? _695_cptr->raw() : nullptr,_695_cptr ? _695_cptr->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(row_code_ptr,(int)0,_695_cptr,(int)0,(int)((row_code_ptr)->size(0)));
      row_param_ptrb = _693_ptrb;
      row_param_ptre = _694_ptre;
      row_code_ptr = _695_cptr;
    }
  }
  {}
  return _692_id;
}
// End mosek.fusion.RowBlockManager.allocate

// Begin mosek.fusion.RowBlockManager.row_is_parameterized
// Method mosek.fusion.RowBlockManager.row_is_parameterized @ bld/docker-win/final/default/src/fusion/Model.mbi:5188:6-5190:7
bool mosek::fusion::RowBlockManager :: row_is_parameterized(int32_t _696_i) { return mosek::fusion::p_RowBlockManager::_get_impl(this)->row_is_parameterized(_696_i); }
bool mosek::fusion::p_RowBlockManager::row_is_parameterized(int32_t _696_i)
{
  return ((NULL != row_param_ptrb.get()) && (((*row_param_ptrb)(_696_i)) < ((*row_param_ptre)(_696_i))));
}
// End mosek.fusion.RowBlockManager.row_is_parameterized

void mosek::fusion::p_RowBlockManager::destroy()
{
  cconst.reset();
  code.reset();
  param_code_sizes.reset();
  param_varidx.reset();
  row_code_ptr.reset();
  row_param_ptre.reset();
  row_param_ptrb.reset();
  blocks.reset();
}
void mosek::fusion::RowBlockManager::destroy() { mosek::fusion::p_RowBlockManager::_get_impl(this)->destroy(); }
// } class RowBlockManager
// class Model { // @ bld/docker-win/final/default/src/fusion/Model.mbi:351:4-5104:5
mosek::fusion::Model::Model(mosek::fusion::p_Model *_impl) : mosek::fusion::BaseModel(_impl) { /*std::cout << "Model()" << this << std::endl; */ }
mosek::fusion::Model::~Model() {  /* std::cout << "~Model()" << this << std::endl << std::flush; */ }
mosek::fusion::p_Model::p_Model
  (::mosek::fusion::Model * _pubthis) :     mosek::fusion::p_BaseModel(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.Model.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:576:6-643:7
mosek::fusion::Model::t mosek::fusion::p_Model::_new_Model
  (monty::rc_ptr< ::mosek::fusion::Model > _697_m)
{ return new mosek::fusion::Model(_697_m); }
mosek::fusion::Model::Model
  (monty::rc_ptr< ::mosek::fusion::Model > _697_m) : 
   Model(new mosek::fusion::p_Model(this))
{ mosek::fusion::p_Model::_get_impl(this)->_initialize(_697_m); }
void mosek::fusion::p_Model::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _697_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseModel::_initialize(_697_m);
    monty::rc_ptr< ::mosek::fusion::Model > _698_self = ::mosek::fusion::Model::t(_pubthis);
    model_name = mosek::fusion::p_Model::_get_impl(_697_m)->model_name;
    acceptable_sol = mosek::fusion::p_Model::_get_impl(_697_m)->acceptable_sol;
    solutionptr = mosek::fusion::p_Model::_get_impl(_697_m)->solutionptr;
    monty::rc_ptr< ::mosek::fusion::SolutionStruct > _9361_;
    bool _9362_ = (NULL != mosek::fusion::p_Model::_get_impl(_697_m)->sol_itr.get());
    if (_9362_)
    {
      _9361_ = mosek::fusion::p_Model::_get_impl(_697_m)->sol_itr->__mosek_2fusion_2SolutionStruct__clone();
    }
    else
    {
      _9361_ = nullptr;
    }
    sol_itr = _9361_;
    monty::rc_ptr< ::mosek::fusion::SolutionStruct > _9363_;
    bool _9364_ = (NULL != mosek::fusion::p_Model::_get_impl(_697_m)->sol_itg.get());
    if (_9364_)
    {
      _9363_ = mosek::fusion::p_Model::_get_impl(_697_m)->sol_itg->__mosek_2fusion_2SolutionStruct__clone();
    }
    else
    {
      _9363_ = nullptr;
    }
    sol_itg = _9363_;
    monty::rc_ptr< ::mosek::fusion::SolutionStruct > _9365_;
    bool _9366_ = (NULL != mosek::fusion::p_Model::_get_impl(_697_m)->sol_bas.get());
    if (_9366_)
    {
      _9365_ = mosek::fusion::p_Model::_get_impl(_697_m)->sol_bas->__mosek_2fusion_2SolutionStruct__clone();
    }
    else
    {
      _9365_ = nullptr;
    }
    sol_bas = _9365_;
    num_task_afe = mosek::fusion::p_Model::_get_impl(_697_m)->num_task_afe;
    num_task_con = mosek::fusion::p_Model::_get_impl(_697_m)->num_task_con;
    num_task_acc = mosek::fusion::p_Model::_get_impl(_697_m)->num_task_acc;
    con_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager(mosek::fusion::p_Model::_get_impl(_697_m)->con_blocks);
    afe_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager(mosek::fusion::p_Model::_get_impl(_697_m)->afe_blocks);
    obj_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager(mosek::fusion::p_Model::_get_impl(_697_m)->obj_blocks);
    acc_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks(mosek::fusion::p_Model::_get_impl(_697_m)->acc_block_map);
    acon_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks(mosek::fusion::p_Model::_get_impl(_697_m)->acon_block_map);
    acon_acc = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_acc);
    acon_afe = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_afe);
    acon_elm_accid = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_elm_accid);
    acon_elm_scale = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_elm_scale);
    acon_elm_ofs = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_elm_ofs);
    acon_elm_afe = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->acon_elm_afe);
    task_numaferow = mosek::fusion::p_Model::_get_impl(_697_m)->task_numaferow;
    var_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks(mosek::fusion::p_Model::_get_impl(_697_m)->var_block_map);
    var_block_acc_id = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->var_block_acc_id);
    var_elm_acc_idx = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->var_elm_acc_idx);
    var_elm_acc_ofs = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->var_elm_acc_ofs);
    barvar_num = (int)0;
    barvar_dim = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_dim);
    barvar_block_ptr = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_ptr);
    barvar_block_dim = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_dim);
    barvar_block_elm_ptr = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_elm_ptr);
    barvar_block_elm_barj = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_elm_barj);
    barvar_block_elm_i = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_elm_i);
    barvar_block_elm_j = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->barvar_block_elm_j);
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9367_;
    for (int32_t _699_i = (int)0, _9368_ = (int)((mosek::fusion::p_Model::_get_impl(_697_m)->vars)->size(0)); _699_i < _9368_ ; ++_699_i)
    {
      monty::rc_ptr< ::mosek::fusion::ModelVariable > _9369_;
      bool _9370_ = (NULL != ((*mosek::fusion::p_Model::_get_impl(_697_m)->vars)(_699_i)).get());
      if (_9370_)
      {
        _9369_ = mosek::fusion::p_ModelVariable::_get_impl(((*mosek::fusion::p_Model::_get_impl(_697_m)->vars)(_699_i)).get())->__mosek_2fusion_2ModelVariable__clone(_698_self);
      }
      else
      {
        _9369_ = nullptr;
      }
      _9367_.push_back(_9369_);
    }
    auto _9371_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9367_.size()),_9367_.begin(),_9367_.end()));
    vars = _9371_;
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9372_;
    for (int32_t _700_i = (int)0, _9373_ = (int)((mosek::fusion::p_Model::_get_impl(_697_m)->barvars)->size(0)); _700_i < _9373_ ; ++_700_i)
    {
      monty::rc_ptr< ::mosek::fusion::ModelVariable > _9374_;
      bool _9375_ = (NULL != ((*mosek::fusion::p_Model::_get_impl(_697_m)->barvars)(_700_i)).get());
      if (_9375_)
      {
        _9374_ = mosek::fusion::p_ModelVariable::_get_impl(((*mosek::fusion::p_Model::_get_impl(_697_m)->barvars)(_700_i)).get())->__mosek_2fusion_2ModelVariable__clone(_698_self);
      }
      else
      {
        _9374_ = nullptr;
      }
      _9372_.push_back(_9374_);
    }
    auto _9376_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9372_.size()),_9372_.begin(),_9372_.end()));
    barvars = _9376_;
    var_map = mosek::fusion::p_Model::_get_impl(_697_m)->var_map->__mosek_2fusion_2Utils_2StringIntMap__clone();
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9377_;
    for (int32_t _701_i = (int)0, _9378_ = (int)((mosek::fusion::p_Model::_get_impl(_697_m)->cons)->size(0)); _701_i < _9378_ ; ++_701_i)
    {
      monty::rc_ptr< ::mosek::fusion::ModelConstraint > _9379_;
      bool _9380_ = (NULL != ((*mosek::fusion::p_Model::_get_impl(_697_m)->cons)(_701_i)).get());
      if (_9380_)
      {
        _9379_ = mosek::fusion::p_ModelConstraint::_get_impl(((*mosek::fusion::p_Model::_get_impl(_697_m)->cons)(_701_i)).get())->__mosek_2fusion_2ModelConstraint__clone(_698_self);
      }
      else
      {
        _9379_ = nullptr;
      }
      _9377_.push_back(_9379_);
    }
    auto _9381_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9377_.size()),_9377_.begin(),_9377_.end()));
    cons = _9381_;
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9382_;
    for (int32_t _702_i = (int)0, _9383_ = (int)((mosek::fusion::p_Model::_get_impl(_697_m)->acons)->size(0)); _702_i < _9383_ ; ++_702_i)
    {
      monty::rc_ptr< ::mosek::fusion::ModelConstraint > _9384_;
      bool _9385_ = (NULL != ((*mosek::fusion::p_Model::_get_impl(_697_m)->acons)(_702_i)).get());
      if (_9385_)
      {
        _9384_ = mosek::fusion::p_ModelConstraint::_get_impl(((*mosek::fusion::p_Model::_get_impl(_697_m)->acons)(_702_i)).get())->__mosek_2fusion_2ModelConstraint__clone(_698_self);
      }
      else
      {
        _9384_ = nullptr;
      }
      _9382_.push_back(_9384_);
    }
    auto _9386_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9382_.size()),_9382_.begin(),_9382_.end()));
    acons = _9386_;
    con_map = mosek::fusion::p_Model::_get_impl(_697_m)->con_map->__mosek_2fusion_2Utils_2StringIntMap__clone();
    numparameter = mosek::fusion::p_Model::_get_impl(_697_m)->numparameter;
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _9387_;
    bool _9388_ = (NULL == mosek::fusion::p_Model::_get_impl(_697_m)->parameters.get());
    if (_9388_)
    {
      _9387_ = nullptr;
    }
    else
    {
      std::vector<monty::rc_ptr< ::mosek::fusion::Parameter >> _9389_;
      for (int32_t _703_i = (int)0, _9390_ = (int)((mosek::fusion::p_Model::_get_impl(_697_m)->parameters)->size(0)); _703_i < _9390_ ; ++_703_i)
      {
        monty::rc_ptr< ::mosek::fusion::Parameter > _9391_;
        bool _9392_ = (NULL != ((*mosek::fusion::p_Model::_get_impl(_697_m)->parameters)(_703_i)).get());
        if (_9392_)
        {
          _9391_ = ((*mosek::fusion::p_Model::_get_impl(_697_m)->parameters)(_703_i))->__mosek_2fusion_2Parameter__clone(_698_self);
        }
        else
        {
          _9391_ = nullptr;
        }
        _9389_.push_back(_9391_);
      }
      auto _9393_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >(monty::shape(_9389_.size()),_9389_.begin(),_9389_.end()));
      _9387_ = _9393_;
    }
    parameters = _9387_;
    par_map = mosek::fusion::p_Model::_get_impl(_697_m)->par_map->__mosek_2fusion_2Utils_2StringIntMap__clone();
    param_num = mosek::fusion::p_Model::_get_impl(_697_m)->param_num;
    std::shared_ptr< monty::ndarray< double,1 > > _9394_;
    bool _9395_ = (NULL != mosek::fusion::p_Model::_get_impl(_697_m)->param_value.get());
    if (_9395_)
    {
      _9394_ = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Model::_get_impl(_697_m)->param_value);
    }
    else
    {
      _9394_ = nullptr;
    }
    param_value = _9394_;
    initsol_xx = nullptr;
    initsol_xx_flag = nullptr;
    bfixidx = mosek::fusion::p_Model::_get_impl(_697_m)->bfixidx;
    rs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
    ws = ::mosek::fusion::p_WorkStack::_new_WorkStack();
    xs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
  }
}
// mosek.fusion.Model.ctor

// mosek.fusion.Model.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:498:6-573:7
mosek::fusion::Model::t mosek::fusion::p_Model::_new_Model
  (const std::string &  _704_name,
    int32_t _705_basesize)
{ return new mosek::fusion::Model(_704_name,_705_basesize); }
mosek::fusion::Model::Model
  (const std::string &  _704_name,
    int32_t _705_basesize) : 
   Model(new mosek::fusion::p_Model(this))
{ mosek::fusion::p_Model::_get_impl(this)->_initialize(_704_name,_705_basesize); }
void mosek::fusion::p_Model::_initialize  (const std::string &  _704_name,
    int32_t _705_basesize)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseModel::_initialize(_704_name,std::string (""));
    model_name = _704_name;
    acceptable_sol = ::mosek::fusion::AccSolutionStatus::Optimal;
    solutionptr = ::mosek::fusion::SolutionType::Default;
    sol_itr = nullptr;
    sol_itg = nullptr;
    sol_bas = nullptr;
    num_task_afe = (int)0;
    num_task_con = (int)0;
    num_task_acc = (int)0;
    con_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager();
    afe_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager();
    obj_blocks = ::mosek::fusion::p_RowBlockManager::_new_RowBlockManager();
    acc_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks();
    acon_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks();
    task_numaferow = (int)0;
    acon_acc = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(acon_block_map->block_capacity())));
    acon_afe = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(acon_block_map->block_capacity())));
    acon_elm_accid = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(acon_block_map->capacity())));
    std::vector<double> _9396_;
    for (int32_t _706_i = (int)0, _9397_ = acon_block_map->capacity(); _706_i < _9397_ ; ++_706_i)
    {
      _9396_.push_back(1.0);
    }
    auto _9398_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9396_.size()),_9396_.begin(),_9396_.end()));
    acon_elm_scale = _9398_;
    acon_elm_ofs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(acon_block_map->capacity())));
    acon_elm_afe = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(acon_block_map->capacity())));
    var_block_map = ::mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks();
    var_block_acc_id = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(var_block_map->block_capacity())));
    var_elm_acc_idx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(var_block_map->capacity())));
    var_elm_acc_ofs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(var_block_map->capacity())));
    barvar_num = (int)0;
    barvar_dim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_705_basesize)));
    barvar_block_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _705_basesize,(int)1 ))));
    barvar_block_dim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_705_basesize)));
    barvar_block_elm_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _705_basesize,(int)1 ))));
    barvar_block_elm_barj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_705_basesize)));
    barvar_block_elm_i = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_705_basesize)));
    barvar_block_elm_j = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_705_basesize)));
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9399_;
    for (int32_t _707_i = (int)0, _9400_ = safe_mul( _705_basesize,(int)8 ); _707_i < _9400_ ; ++_707_i)
    {
      _9399_.push_back(nullptr);
    }
    auto _9401_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9399_.size()),_9399_.begin(),_9399_.end()));
    vars = _9401_;
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9402_;
    for (int32_t _708_i = (int)0, _9403_ = _705_basesize; _708_i < _9403_ ; ++_708_i)
    {
      _9402_.push_back(nullptr);
    }
    auto _9404_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9402_.size()),_9402_.begin(),_9402_.end()));
    barvars = _9404_;
    var_map = ::mosek::fusion::Utils::p_StringIntMap::_new_StringIntMap();
    initsol_xx = nullptr;
    initsol_xx_flag = nullptr;
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9405_;
    for (int32_t _709_i = (int)0, _9406_ = safe_mul( _705_basesize,(int)8 ); _709_i < _9406_ ; ++_709_i)
    {
      _9405_.push_back(nullptr);
    }
    auto _9407_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9405_.size()),_9405_.begin(),_9405_.end()));
    cons = _9407_;
    std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9408_;
    for (int32_t _710_i = (int)0, _9409_ = safe_mul( _705_basesize,(int)8 ); _710_i < _9409_ ; ++_710_i)
    {
      _9408_.push_back(nullptr);
    }
    auto _9410_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9408_.size()),_9408_.begin(),_9408_.end()));
    acons = _9410_;
    con_map = ::mosek::fusion::Utils::p_StringIntMap::_new_StringIntMap();
    numparameter = (int)0;
    parameters = nullptr;
    par_map = ::mosek::fusion::Utils::p_StringIntMap::_new_StringIntMap();
    param_num = (int)0;
    param_value = nullptr;
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _711_natvarbfixidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)1)));
      _checked_ptr_1<int32_t> _ptr__711_natvarbfixidx(_711_natvarbfixidx ? _711_natvarbfixidx->raw() : nullptr,_711_natvarbfixidx ? _711_natvarbfixidx->size(0) : 0);
      int32_t _712_bfixvarid = linearvar_alloc((int)1,_711_natvarbfixidx);
      bfixidx = _ptr__711_natvarbfixidx[(int)0];
    }
    task_var_putboundlist_fx(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(bfixidx)}),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(1.0)}));
    task_var_name(bfixidx,std::string ("1.0"));
    task_append_domain_empty();
    rs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
    ws = ::mosek::fusion::p_WorkStack::_new_WorkStack();
    xs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
  }
}
// mosek.fusion.Model.ctor

// mosek.fusion.Model.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:490:6-58
mosek::fusion::Model::t mosek::fusion::p_Model::_new_Model
  (int32_t _713_basesize)
{ return new mosek::fusion::Model(_713_basesize); }
mosek::fusion::Model::Model
  (int32_t _713_basesize) : 
   Model(new mosek::fusion::p_Model(this))
{ mosek::fusion::p_Model::_get_impl(this)->_initialize(_713_basesize); }
void mosek::fusion::p_Model::_initialize  (int32_t _713_basesize)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Model::_initialize(std::string (""),_713_basesize);
  }
}
// mosek.fusion.Model.ctor

// mosek.fusion.Model.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:484:6-53
mosek::fusion::Model::t mosek::fusion::p_Model::_new_Model
  (const std::string &  _714_name)
{ return new mosek::fusion::Model(_714_name); }
mosek::fusion::Model::Model
  (const std::string &  _714_name) : 
   Model(new mosek::fusion::p_Model(this))
{ mosek::fusion::p_Model::_get_impl(this)->_initialize(_714_name); }
void mosek::fusion::p_Model::_initialize  (const std::string &  _714_name)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Model::_initialize(_714_name,(int)128);
  }
}
// mosek.fusion.Model.ctor

// mosek.fusion.Model.ctor @ bld/docker-win/final/default/src/fusion/Model.mbi:478:6-33
mosek::fusion::Model::t mosek::fusion::p_Model::_new_Model
  ()
{ return new mosek::fusion::Model(); }
mosek::fusion::Model::Model
  () : 
   Model(new mosek::fusion::p_Model(this))
{ mosek::fusion::p_Model::_get_impl(this)->_initialize(); }
void mosek::fusion::p_Model::_initialize  ()
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Model::_initialize(std::string (""));
  }
}
// mosek.fusion.Model.ctor

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4985:6-5103:7
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _715_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _716_terms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_715_name,_716_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _715_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _716_terms) { return __mosek_2fusion_2Model__disjunction(_715_name,_716_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _715_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _716_terms)
{
  int32_t _717_n = (int)((_716_terms)->size(0));
  int32_t _718_nrows = (int)0;
  int32_t _719_nterms = (int)0;
  int32_t _720_naccterms = (int)0;
  int32_t _721_naccrows = (int)0;
  int32_t _9411_ = (int)0;
  int32_t _9412_ = _717_n;
  for (int32_t _722_i = _9411_; _722_i < _9412_; ++_722_i)
  {
    {
      _718_nrows += ((*_716_terms)(_722_i))->size();
      _719_nterms += mosek::fusion::p_Term::_get_impl(((*_716_terms)(_722_i)).get())->num();
      _721_naccrows += mosek::fusion::p_Term::_get_impl(((*_716_terms)(_722_i)).get())->numaccrows();
      _720_naccterms += mosek::fusion::p_Term::_get_impl(((*_716_terms)(_722_i)).get())->numaccterms();
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _723_afeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_718_nrows)));
  _checked_ptr_1<int32_t> _ptr__723_afeidxs(_723_afeidxs ? _723_afeidxs->raw() : nullptr,_723_afeidxs ? _723_afeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _724_accafeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_721_naccrows)));
  _checked_ptr_1<int32_t> _ptr__724_accafeidxs(_724_accafeidxs ? _724_accafeidxs->raw() : nullptr,_724_accafeidxs ? _724_accafeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _725_accb = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_721_naccrows)));
  _checked_ptr_1<double> _ptr__725_accb(_725_accb ? _725_accb->raw() : nullptr,_725_accb ? _725_accb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _726_domidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_720_naccterms)));
  _checked_ptr_1<int64_t> _ptr__726_domidxs(_726_domidxs ? _726_domidxs->raw() : nullptr,_726_domidxs ? _726_domidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _727_termsize = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_717_n)));
  _checked_ptr_1<int64_t> _ptr__727_termsize(_727_termsize ? _727_termsize->raw() : nullptr,_727_termsize ? _727_termsize->size(0) : 0);
  int32_t _728_afeblockid = afe_allocate(_723_afeidxs);
  int32_t _729_term_index = (int)0;
  int32_t _730_acctermptr = (int)0;
  int32_t _731_afetgtptr = (int)0;
  int32_t _732_afeptr = (int)0;
  int32_t _9413_ = (int)0;
  int32_t _9414_ = _717_n;
  for (int32_t _733_term_i = _9413_; _733_term_i < _9414_; ++_733_term_i)
  {
    {
      int32_t _9415_ = (int)0;
      int32_t _9416_ = mosek::fusion::p_Term::_get_impl(((*_716_terms)(_733_term_i)).get())->num();
      for (int32_t _734_simpterm_i = _9415_; _734_simpterm_i < _9416_; ++_734_simpterm_i)
      {
        {
          monty::rc_ptr< ::mosek::fusion::DJCDomain > _735_dom = ((*mosek::fusion::p_Term::_get_impl(((*_716_terms)(_733_term_i)))->domains)(_734_simpterm_i));
          monty::rc_ptr< ::mosek::fusion::ExprDense > _736_e = ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(((*mosek::fusion::p_Term::_get_impl(((*_716_terms)(_733_term_i)))->exprs)(_734_simpterm_i)))).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
          _736_e->eval(rs,ws,xs);
          rs->pop_expr();
          std::shared_ptr< monty::ndarray< int32_t,1 > > _737_ri32 = mosek::fusion::p_WorkStack::_get_impl(rs)->i32;
          _checked_ptr_1<int32_t> _ptr__737_ri32(_737_ri32 ? _737_ri32->raw() : nullptr,_737_ri32 ? _737_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _738_ri64 = mosek::fusion::p_WorkStack::_get_impl(rs)->i64;
          _checked_ptr_1<int64_t> _ptr__738_ri64(_738_ri64 ? _738_ri64->raw() : nullptr,_738_ri64 ? _738_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _739_rf64 = mosek::fusion::p_WorkStack::_get_impl(rs)->f64;
          _checked_ptr_1<double> _ptr__739_rf64(_739_rf64 ? _739_rf64->raw() : nullptr,_739_rf64 ? _739_rf64->size(0) : 0);
          int32_t _740_nd = mosek::fusion::p_WorkStack::_get_impl(rs)->nd;
          int32_t _741_shape_base = mosek::fusion::p_WorkStack::_get_impl(rs)->shape_base;
          int32_t _742_nelem = mosek::fusion::p_WorkStack::_get_impl(rs)->nelem;
          int32_t _743_nnz = mosek::fusion::p_WorkStack::_get_impl(rs)->nnz;
          int32_t _744_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(rs)->ncodeatom;
          bool _745_hassp = mosek::fusion::p_WorkStack::_get_impl(rs)->hassp;
          int32_t _746_ptr_base = mosek::fusion::p_WorkStack::_get_impl(rs)->ptr_base;
          int32_t _747_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(rs)->nidxs_base;
          int32_t _748_cof_base = mosek::fusion::p_WorkStack::_get_impl(rs)->cof_base;
          int32_t _749_code = mosek::fusion::p_WorkStack::_get_impl(rs)->code_base;
          int32_t _750_codeptr = mosek::fusion::p_WorkStack::_get_impl(rs)->codeptr_base;
          int32_t _751_cconst = mosek::fusion::p_WorkStack::_get_impl(rs)->cconst_base;
          std::vector<int32_t> _9417_;
          for (int32_t _753_i = (int)0, _9418_ = _740_nd; _753_i < _9418_ ; ++_753_i)
          {
            _9417_.push_back(_ptr__737_ri32[safe_add( _741_shape_base,_753_i )]);
          }
          auto _9419_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9417_.size()),_9417_.begin(),_9417_.end()));
          std::shared_ptr< monty::ndarray< int32_t,1 > > _752_shape = _9419_;
          _checked_ptr_1<int32_t> _ptr__752_shape(_752_shape ? _752_shape->raw() : nullptr,_752_shape ? _752_shape->size(0) : 0);
          putfrows(_723_afeidxs,_732_afeptr,rs,_742_nelem,_743_nnz,_746_ptr_base,_747_nidxs_base,_748_cof_base);
          if ((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::InRange))
          {
            {
              std::shared_ptr< monty::ndarray< double,1 > > _754_lb = mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->b;
              _checked_ptr_1<double> _ptr__754_lb(_754_lb ? _754_lb->raw() : nullptr,_754_lb ? _754_lb->size(0) : 0);
              std::shared_ptr< monty::ndarray< double,1 > > _755_ub = mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->par;
              _checked_ptr_1<double> _ptr__755_ub(_755_ub ? _755_ub->raw() : nullptr,_755_ub ? _755_ub->size(0) : 0);
              int32_t _9420_ = (int)0;
              int32_t _9421_ = _742_nelem;
              for (int32_t _756_i = _9420_; _756_i < _9421_; ++_756_i)
              {
                {
                  _ptr__724_accafeidxs[safe_add( _731_afetgtptr,_756_i )] = _ptr__723_afeidxs[safe_add( _732_afeptr,_756_i )];
                  _ptr__724_accafeidxs[safe_add( safe_add( _731_afetgtptr,_742_nelem ),_756_i )] = _ptr__723_afeidxs[safe_add( _732_afeptr,_756_i )];
                  _ptr__725_accb[safe_add( _731_afetgtptr,_756_i )] = _ptr__754_lb[_756_i];
                  _ptr__725_accb[safe_add( safe_add( _731_afetgtptr,_742_nelem ),_756_i )] = _ptr__755_ub[_756_i];
                }
              }
              _ptr__726_domidxs[_730_acctermptr] = task_append_domain_rpos(_742_nelem);
              _ptr__726_domidxs[safe_add( _730_acctermptr,(int)1 )] = task_append_domain_rneg(_742_nelem);
              _ptr__727_termsize[_733_term_i] += (int)2;
              _730_acctermptr += (int)2;
              _731_afetgtptr += safe_mul( _742_nelem,(int)2 );
            }
          }
          else if(((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::EqualTo) || ((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::LessThan) || ((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::GreaterThan) || (mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::IsFree)))))
          {
            {
              std::shared_ptr< monty::ndarray< double,1 > > _757_b = mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->b;
              _checked_ptr_1<double> _ptr__757_b(_757_b ? _757_b->raw() : nullptr,_757_b ? _757_b->size(0) : 0);
              int32_t _9422_ = (int)0;
              int32_t _9423_ = _742_nelem;
              for (int32_t _758_i = _9422_; _758_i < _9423_; ++_758_i)
              {
                {
                  _ptr__724_accafeidxs[safe_add( _731_afetgtptr,_758_i )] = _ptr__723_afeidxs[safe_add( _732_afeptr,_758_i )];
                  _ptr__725_accb[safe_add( _731_afetgtptr,_758_i )] = _ptr__757_b[_758_i];
                }
              }
              if ((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::EqualTo))
              {
                {
                  _ptr__726_domidxs[_730_acctermptr] = task_append_domain_rzero(_742_nelem);
                }
              }
              else if((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::LessThan))
              {
                {
                  _ptr__726_domidxs[_730_acctermptr] = task_append_domain_rneg(_742_nelem);
                }
              }
              else if((mosek::fusion::p_DJCDomain::_get_impl(_735_dom)->dom == ::mosek::fusion::DJCDomainType::GreaterThan))
              {
                {
                  _ptr__726_domidxs[_730_acctermptr] = task_append_domain_rpos(_742_nelem);
                }
              }
              else
              {
                {
                  _ptr__726_domidxs[_730_acctermptr] = task_append_domain_r(_742_nelem);
                }
              }
              _ptr__727_termsize[_733_term_i] += (int)1;
              _730_acctermptr += (int)1;
              _731_afetgtptr += _742_nelem;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Not implemented: Non-linear conic DJC constraints"));
            }
          }
          if ((_744_ncodeatom > (int)0))
          {
            {
              std::vector<int32_t> _9424_;
              for (int32_t _759_i = (int)0, _9425_ = _742_nelem; _759_i < _9425_ ; ++_759_i)
              {
                _9424_.push_back(_ptr__723_afeidxs[safe_add( _732_afeptr,_759_i )]);
              }
              auto _9426_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9424_.size()),_9424_.begin(),_9424_.end()));
              afe_blocks->replace_row_code(rs,_9426_,_746_ptr_base,_747_nidxs_base,_750_codeptr,_749_code,_751_cconst);
            }
          }
          {}
          _732_afeptr += _742_nelem;
          ++ _729_term_index;
        }
      }
    }
  }
  int64_t _760_djcidx = task_append_djc((int64_t)((int)1));
  std::vector<int64_t> _9427_;
  for (int32_t _761_i = (int)0, _9428_ = (int)((_724_accafeidxs)->size(0)); _761_i < _9428_ ; ++_761_i)
  {
    _9427_.push_back(_ptr__724_accafeidxs[_761_i]);
  }
  auto _9429_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9427_.size()),_9427_.begin(),_9427_.end()));
  task_putdjcslice(_760_djcidx,safe_add( _760_djcidx,(int)1 ),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >{(int64_t)((int64_t)_717_n)}),_727_termsize,_726_domidxs,_9429_,_725_accb);
  if (((int)((_715_name).size()) > (int)0))
  {
    {
      task_djc_name(_760_djcidx,::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(_715_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"))->toString());
    }
  }
  {}
  return ::mosek::fusion::p_Disjunction::_new_Disjunction(_760_djcidx);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4984:6-92
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _762_terms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_762_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _762_terms) { return __mosek_2fusion_2Model__disjunction(_762_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > > _762_terms)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),_762_terms);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4982:6-111
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _763_djcterms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_763_djcterms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _763_djcterms) { return __mosek_2fusion_2Model__disjunction(_763_djcterms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _763_djcterms)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(mosek::fusion::p_DisjunctionTerms::_get_impl(_763_djcterms)->terms);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4980:6-129
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _764_name,monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _765_djcterms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_764_name,_765_djcterms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _764_name,monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _765_djcterms) { return __mosek_2fusion_2Model__disjunction(_764_name,_765_djcterms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _764_name,monty::rc_ptr< ::mosek::fusion::DisjunctionTerms > _765_djcterms)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(_764_name,mosek::fusion::p_DisjunctionTerms::_get_impl(_765_djcterms)->terms);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4978:6-157
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _766_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _767_terms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_766_name,_767_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _766_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _767_terms) { return __mosek_2fusion_2Model__disjunction(_766_name,_767_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _766_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _767_terms)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Term >> _9430_;
  for (int32_t _768_i = (int)0, _9431_ = (int)((_767_terms)->size(0)); _768_i < _9431_ ; ++_768_i)
  {
    _9430_.push_back(((*_767_terms)(_768_i))->__mosek_2fusion_2ExprDomain__toDJCTerm());
  }
  auto _9432_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(_9430_.size()),_9430_.begin(),_9430_.end()));
  return _pubthis->__mosek_2fusion_2Model__disjunction(_766_name,_9432_);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4976:6-142
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _769_terms) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_769_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _769_terms) { return __mosek_2fusion_2Model__disjunction(_769_terms); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ExprDomain >,1 > > _769_terms)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Term >> _9433_;
  for (int32_t _770_i = (int)0, _9434_ = (int)((_769_terms)->size(0)); _770_i < _9434_ ; ++_770_i)
  {
    _9433_.push_back(((*_769_terms)(_770_i))->__mosek_2fusion_2ExprDomain__toDJCTerm());
  }
  auto _9435_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >(monty::shape(_9433_.size()),_9433_.begin(),_9433_.end()));
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),_9435_);
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4974:6-128
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _771_name,monty::rc_ptr< ::mosek::fusion::ExprDomain > _772_term) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_771_name,_772_term); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _771_name,monty::rc_ptr< ::mosek::fusion::ExprDomain > _772_term) { return __mosek_2fusion_2Model__disjunction(_771_name,_772_term); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _771_name,monty::rc_ptr< ::mosek::fusion::ExprDomain > _772_term)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(_771_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_772_term->__mosek_2fusion_2ExprDomain__toDJCTerm().get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4972:6-113
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::ExprDomain > _773_term) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_773_term); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(monty::rc_ptr< ::mosek::fusion::ExprDomain > _773_term) { return __mosek_2fusion_2Model__disjunction(_773_term); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::ExprDomain > _773_term)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_773_term->__mosek_2fusion_2ExprDomain__toDJCTerm().get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4969:6-115
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _774_t1,monty::rc_ptr< ::mosek::fusion::Term > _775_t2,monty::rc_ptr< ::mosek::fusion::Term > _776_t3) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_774_t1,_775_t2,_776_t3); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(monty::rc_ptr< ::mosek::fusion::Term > _774_t1,monty::rc_ptr< ::mosek::fusion::Term > _775_t2,monty::rc_ptr< ::mosek::fusion::Term > _776_t3) { return __mosek_2fusion_2Model__disjunction(_774_t1,_775_t2,_776_t3); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _774_t1,monty::rc_ptr< ::mosek::fusion::Term > _775_t2,monty::rc_ptr< ::mosek::fusion::Term > _776_t3)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_774_t1.get()),::monty::rc_ptr<::mosek::fusion::Term>(_775_t2.get()),::monty::rc_ptr<::mosek::fusion::Term>(_776_t3.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4968:6-103
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _777_t1,monty::rc_ptr< ::mosek::fusion::Term > _778_t2) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_777_t1,_778_t2); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(monty::rc_ptr< ::mosek::fusion::Term > _777_t1,monty::rc_ptr< ::mosek::fusion::Term > _778_t2) { return __mosek_2fusion_2Model__disjunction(_777_t1,_778_t2); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _777_t1,monty::rc_ptr< ::mosek::fusion::Term > _778_t2)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_777_t1.get()),::monty::rc_ptr<::mosek::fusion::Term>(_778_t2.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4967:6-91
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _779_t1) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_779_t1); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(monty::rc_ptr< ::mosek::fusion::Term > _779_t1) { return __mosek_2fusion_2Model__disjunction(_779_t1); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(monty::rc_ptr< ::mosek::fusion::Term > _779_t1)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(std::string (""),std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_779_t1.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4965:6-129
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _780_name,monty::rc_ptr< ::mosek::fusion::Term > _781_t1,monty::rc_ptr< ::mosek::fusion::Term > _782_t2,monty::rc_ptr< ::mosek::fusion::Term > _783_t3) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_780_name,_781_t1,_782_t2,_783_t3); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _780_name,monty::rc_ptr< ::mosek::fusion::Term > _781_t1,monty::rc_ptr< ::mosek::fusion::Term > _782_t2,monty::rc_ptr< ::mosek::fusion::Term > _783_t3) { return __mosek_2fusion_2Model__disjunction(_780_name,_781_t1,_782_t2,_783_t3); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _780_name,monty::rc_ptr< ::mosek::fusion::Term > _781_t1,monty::rc_ptr< ::mosek::fusion::Term > _782_t2,monty::rc_ptr< ::mosek::fusion::Term > _783_t3)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(_780_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_781_t1.get()),::monty::rc_ptr<::mosek::fusion::Term>(_782_t2.get()),::monty::rc_ptr<::mosek::fusion::Term>(_783_t3.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4964:6-117
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _784_name,monty::rc_ptr< ::mosek::fusion::Term > _785_t1,monty::rc_ptr< ::mosek::fusion::Term > _786_t2) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_784_name,_785_t1,_786_t2); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _784_name,monty::rc_ptr< ::mosek::fusion::Term > _785_t1,monty::rc_ptr< ::mosek::fusion::Term > _786_t2) { return __mosek_2fusion_2Model__disjunction(_784_name,_785_t1,_786_t2); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _784_name,monty::rc_ptr< ::mosek::fusion::Term > _785_t1,monty::rc_ptr< ::mosek::fusion::Term > _786_t2)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(_784_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_785_t1.get()),::monty::rc_ptr<::mosek::fusion::Term>(_786_t2.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.disjunction
// Method mosek.fusion.Model.disjunction @ bld/docker-win/final/default/src/fusion/Model.mbi:4963:6-105
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model :: __mosek_2fusion_2Model__disjunction(const std::string & _787_name,monty::rc_ptr< ::mosek::fusion::Term > _788_t1) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__disjunction(_787_name,_788_t1); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::Model::disjunction(const std::string &  _787_name,monty::rc_ptr< ::mosek::fusion::Term > _788_t1) { return __mosek_2fusion_2Model__disjunction(_787_name,_788_t1); }
monty::rc_ptr< ::mosek::fusion::Disjunction > mosek::fusion::p_Model::__mosek_2fusion_2Model__disjunction(const std::string & _787_name,monty::rc_ptr< ::mosek::fusion::Term > _788_t1)
{
  return _pubthis->__mosek_2fusion_2Model__disjunction(_787_name,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Term >,1 >{::monty::rc_ptr<::mosek::fusion::Term>(_788_t1.get())}));
}
// End mosek.fusion.Model.disjunction

// Begin mosek.fusion.Model.formstConstr
// Method mosek.fusion.Model.formstConstr @ bld/docker-win/final/default/src/fusion/Model.mbi:4958:6-4961:7
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::p_Model::__mosek_2fusion_2Model__formstConstr(monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _789_sb,std::shared_ptr< monty::ndarray< int32_t,1 > > _790_shape,std::shared_ptr< monty::ndarray< int32_t,1 > > _791_idxs)
{
  _checked_ptr_1<int32_t> _ptr__790_shape(_790_shape ? _790_shape->raw() : nullptr, _790_shape ? _790_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__791_idxs(_791_idxs ? _791_idxs->raw() : nullptr, _791_idxs ? _791_idxs->size(0) : 0);
  return _789_sb;
}
// End mosek.fusion.Model.formstConstr

// Begin mosek.fusion.Model.acon_release
// Method mosek.fusion.Model.acon_release @ bld/docker-win/final/default/src/fusion/Model.mbi:4848:6-4867:7
void mosek::fusion::p_Model::acon_release(int32_t _792_id)
{
  int32_t _793_num = acon_block_map->blocksize(_792_id);
  if ((_793_num >= (int)0))
  {
    {
      int32_t _794_numcone = acc_block_map->blocksize(((*acon_acc)(_792_id)));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _795_accidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_794_numcone)));
      _checked_ptr_1<int32_t> _ptr__795_accidxs(_795_accidxs ? _795_accidxs->raw() : nullptr,_795_accidxs ? _795_accidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _796_afeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_793_num)));
      _checked_ptr_1<int32_t> _ptr__796_afeidxs(_796_afeidxs ? _796_afeidxs->raw() : nullptr,_796_afeidxs ? _796_afeidxs->size(0) : 0);
      acc_block_map->get(((*acon_acc)(_792_id)),_795_accidxs,(int)0);
      acc_block_map->free(((*acon_acc)(_792_id)));
      afe_blocks->get(((*acon_afe)(_792_id)),_796_afeidxs,(int)0);
      afe_release(((*acon_afe)(_792_id)));
      acon_block_map->free(_792_id);
      std::vector<int64_t> _9436_;
      for (int32_t _797_i = (int)0, _9437_ = _793_num; _797_i < _9437_ ; ++_797_i)
      {
        _9436_.push_back(_ptr__796_afeidxs[_797_i]);
      }
      auto _9438_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9436_.size()),_9436_.begin(),_9436_.end()));
      task_clearafelist(_9438_);
      std::vector<int64_t> _9439_;
      for (int32_t _798_i = (int)0, _9440_ = _794_numcone; _798_i < _9440_ ; ++_798_i)
      {
        _9439_.push_back(_ptr__795_accidxs[_798_i]);
      }
      auto _9441_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9439_.size()),_9439_.begin(),_9439_.end()));
      std::vector<int64_t> _9442_;
      for (int32_t _799_i = (int)0, _9443_ = _794_numcone; _799_i < _9443_ ; ++_799_i)
      {
        _9442_.push_back((int)0);
      }
      auto _9444_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9442_.size()),_9442_.begin(),_9442_.end()));
      task_putacclist(_9441_,_9444_,std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0))));
    }
  }
  {}
}
// End mosek.fusion.Model.acon_release

// Begin mosek.fusion.Model.acon_allocate
// Method mosek.fusion.Model.acon_allocate @ bld/docker-win/final/default/src/fusion/Model.mbi:4767:6-4846:7
int32_t mosek::fusion::p_Model::acon_allocate(int64_t _800_domidx,int32_t _801_conesize,int32_t _802_numcone,std::shared_ptr< monty::ndarray< double,1 > > _803_g,std::shared_ptr< monty::ndarray< int32_t,1 > > _804_afeidxs,std::shared_ptr< monty::ndarray< int32_t,1 > > _805_accidxs)
{
  _checked_ptr_1<double> _ptr__803_g(_803_g ? _803_g->raw() : nullptr, _803_g ? _803_g->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__804_afeidxs(_804_afeidxs ? _804_afeidxs->raw() : nullptr, _804_afeidxs ? _804_afeidxs->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__805_accidxs(_805_accidxs ? _805_accidxs->raw() : nullptr, _805_accidxs ? _805_accidxs->size(0) : 0);
  int32_t _806_n = safe_mul( _802_numcone,_801_conesize );
  std::shared_ptr< monty::ndarray< int32_t,1 > > _807_aconidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_806_n)));
  _checked_ptr_1<int32_t> _ptr__807_aconidxs(_807_aconidxs ? _807_aconidxs->raw() : nullptr,_807_aconidxs ? _807_aconidxs->size(0) : 0);
  int32_t _808_aconid = acon_block_map->alloc(_806_n);
  int32_t _809_accid = acc_block_map->alloc(_802_numcone);
  int32_t _810_afeid = afe_allocate(_804_afeidxs);
  acon_block_map->get(_808_aconid,_807_aconidxs,(int)0);
  acc_block_map->get(_809_accid,_805_accidxs,(int)0);
  int32_t _811_acon_block_cap = acon_block_map->block_capacity();
  int32_t _812_acon_cap = acon_block_map->capacity();
  if ((_811_acon_block_cap > (int)((acon_acc)->size(0))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _813_tmpacc = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_811_acon_block_cap)));
      _checked_ptr_1<int32_t> _ptr__813_tmpacc(_813_tmpacc ? _813_tmpacc->raw() : nullptr,_813_tmpacc ? _813_tmpacc->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _814_tmpafe = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_811_acon_block_cap)));
      _checked_ptr_1<int32_t> _ptr__814_tmpafe(_814_tmpafe ? _814_tmpafe->raw() : nullptr,_814_tmpafe ? _814_tmpafe->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(acon_acc,(int)0,_813_tmpacc,(int)0,(int)((acon_acc)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(acon_afe,(int)0,_814_tmpafe,(int)0,(int)((acon_afe)->size(0)));
      acon_acc = _813_tmpacc;
      acon_afe = _814_tmpafe;
    }
  }
  {}
  ((*acon_acc)(_808_aconid)) = _809_accid;
  ((*acon_afe)(_808_aconid)) = _810_afeid;
  if ((_808_aconid >= (int)((acons)->size(0))))
  {
    {
      std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9445_;
      for (int32_t _816_i = (int)0, _9446_ = safe_mul( (int)((acons)->size(0)),(int)2 ); _816_i < _9446_ ; ++_816_i)
      {
        _9445_.push_back(nullptr);
      }
      auto _9447_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9445_.size()),_9445_.begin(),_9445_.end()));
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > > _815_newacons = _9447_;
      int32_t _9448_ = (int)0;
      int32_t _9449_ = (int)((acons)->size(0));
      for (int32_t _817_i = _9448_; _817_i < _9449_; ++_817_i)
      {
        {
          ((*_815_newacons)(_817_i)) = ((*acons)(_817_i));
        }
      }
      acons = _815_newacons;
    }
  }
  {}
  if ((_812_acon_cap > (int)((acon_elm_accid)->size(0))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _818_tmp_accid = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_812_acon_cap)));
      _checked_ptr_1<int32_t> _ptr__818_tmp_accid(_818_tmp_accid ? _818_tmp_accid->raw() : nullptr,_818_tmp_accid ? _818_tmp_accid->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _819_tmp_scale = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_812_acon_cap)));
      _checked_ptr_1<double> _ptr__819_tmp_scale(_819_tmp_scale ? _819_tmp_scale->raw() : nullptr,_819_tmp_scale ? _819_tmp_scale->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _820_tmp_ofs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_812_acon_cap)));
      _checked_ptr_1<int32_t> _ptr__820_tmp_ofs(_820_tmp_ofs ? _820_tmp_ofs->raw() : nullptr,_820_tmp_ofs ? _820_tmp_ofs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _821_tmp_afe = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_812_acon_cap)));
      _checked_ptr_1<int32_t> _ptr__821_tmp_afe(_821_tmp_afe ? _821_tmp_afe->raw() : nullptr,_821_tmp_afe ? _821_tmp_afe->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(acon_elm_accid,(int)0,_818_tmp_accid,(int)0,(int)((acon_elm_accid)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(acon_elm_scale,(int)0,_819_tmp_scale,(int)0,(int)((acon_elm_scale)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(acon_elm_ofs,(int)0,_820_tmp_ofs,(int)0,(int)((acon_elm_ofs)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(acon_elm_afe,(int)0,_821_tmp_afe,(int)0,(int)((acon_elm_afe)->size(0)));
      acon_elm_accid = _818_tmp_accid;
      acon_elm_ofs = _820_tmp_ofs;
      acon_elm_afe = _821_tmp_afe;
      acon_elm_scale = _819_tmp_scale;
    }
  }
  {}
  int32_t _822_maxaccidx = (int)0;
  int32_t _9450_ = (int)0;
  int32_t _9451_ = (int)((_805_accidxs)->size(0));
  for (int32_t _823_i = _9450_; _823_i < _9451_; ++_823_i)
  {
    {
      if ((_ptr__805_accidxs[_823_i] > _822_maxaccidx))
      {
        {
          _822_maxaccidx = _ptr__805_accidxs[_823_i];
        }
      }
      {}
    }
  }
  _822_maxaccidx += (int)1;
  int32_t _824_nacc = task_numacc();
  if ((_824_nacc < _822_maxaccidx))
  {
    {
      task_append_accs((int64_t)0,(_822_maxaccidx - _824_nacc),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0))));
    }
  }
  {}
  std::vector<int64_t> _9452_;
  for (int32_t _825_i = (int)0, _9453_ = (int)((_805_accidxs)->size(0)); _825_i < _9453_ ; ++_825_i)
  {
    _9452_.push_back(_ptr__805_accidxs[_825_i]);
  }
  auto _9454_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9452_.size()),_9452_.begin(),_9452_.end()));
  std::vector<int64_t> _9455_;
  for (int32_t _826_i = (int)0, _9456_ = (int)((_805_accidxs)->size(0)); _826_i < _9456_ ; ++_826_i)
  {
    _9455_.push_back(_800_domidx);
  }
  auto _9457_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9455_.size()),_9455_.begin(),_9455_.end()));
  std::vector<int64_t> _9458_;
  for (int32_t _827_i = (int)0, _9459_ = (int)((_804_afeidxs)->size(0)); _827_i < _9459_ ; ++_827_i)
  {
    _9458_.push_back(_ptr__804_afeidxs[_827_i]);
  }
  auto _9460_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9458_.size()),_9458_.begin(),_9458_.end()));
  task_putacclist(_9454_,_9457_,_9460_,_803_g);
  {
    int32_t _828_k = (int)0;
    int32_t _9461_ = (int)0;
    int32_t _9462_ = _802_numcone;
    for (int32_t _829_i = _9461_; _829_i < _9462_; ++_829_i)
    {
      {
        int32_t _9463_ = (int)0;
        int32_t _9464_ = _801_conesize;
        for (int32_t _830_j = _9463_; _830_j < _9464_; ++_830_j)
        {
          {
            ((*acon_elm_accid)(_ptr__807_aconidxs[_828_k])) = _ptr__805_accidxs[_829_i];
            ((*acon_elm_ofs)(_ptr__807_aconidxs[_828_k])) = _830_j;
            ((*acon_elm_afe)(_ptr__807_aconidxs[_828_k])) = _ptr__804_afeidxs[_828_k];
            ((*acon_elm_scale)(_ptr__807_aconidxs[_828_k])) = 1.0;
            ++ _828_k;
          }
        }
      }
    }
  }
  return _808_aconid;
}
// End mosek.fusion.Model.acon_allocate

// Begin mosek.fusion.Model.afe_release
// Method mosek.fusion.Model.afe_release @ bld/docker-win/final/default/src/fusion/Model.mbi:4759:6-4765:7
void mosek::fusion::p_Model::afe_release(int32_t _831_id)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _832_nidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(afe_blocks->blocksize(_831_id))));
  _checked_ptr_1<int32_t> _ptr__832_nidxs(_832_nidxs ? _832_nidxs->raw() : nullptr,_832_nidxs ? _832_nidxs->size(0) : 0);
  afe_blocks->release(_831_id,_832_nidxs);
  std::vector<int64_t> _9465_;
  for (int32_t _833_i = (int)0, _9466_ = (int)((_832_nidxs)->size(0)); _833_i < _9466_ ; ++_833_i)
  {
    _9465_.push_back(_ptr__832_nidxs[_833_i]);
  }
  auto _9467_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9465_.size()),_9465_.begin(),_9465_.end()));
  task_clearafelist(_9467_);
}
// End mosek.fusion.Model.afe_release

// Begin mosek.fusion.Model.afe_allocate
// Method mosek.fusion.Model.afe_allocate @ bld/docker-win/final/default/src/fusion/Model.mbi:4744:6-4757:7
int32_t mosek::fusion::p_Model::afe_allocate(std::shared_ptr< monty::ndarray< int32_t,1 > > _834_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__834_nativeidxs(_834_nativeidxs ? _834_nativeidxs->raw() : nullptr, _834_nativeidxs ? _834_nativeidxs->size(0) : 0);
  int32_t _835_afeid = afe_blocks->allocate(_834_nativeidxs);
  if (((int)((_834_nativeidxs)->size(0)) > (int)0))
  {
    {
      int32_t _836_tasknum = task_numafe();
      int32_t _837_maxidx = _ptr__834_nativeidxs[(int)0];
      int32_t _9468_ = (int)1;
      int32_t _9469_ = (int)((_834_nativeidxs)->size(0));
      for (int32_t _838_i = _9468_; _838_i < _9469_; ++_838_i)
      {
        {
          if ((_ptr__834_nativeidxs[_838_i] > _837_maxidx))
          {
            {
              _837_maxidx = _ptr__834_nativeidxs[_838_i];
            }
          }
          {}
        }
      }
      if ((safe_add( _837_maxidx,(int)1 ) > _836_tasknum))
      {
        {
          int32_t _839_n = (safe_add( _837_maxidx,(int)1 ) - _836_tasknum);
          task_append_afes((int64_t)(_839_n));
          task_numaferow += _839_n;
        }
      }
      {}
    }
  }
  {}
  return _835_afeid;
}
// End mosek.fusion.Model.afe_allocate

// Begin mosek.fusion.Model.con_release
// Method mosek.fusion.Model.con_release @ bld/docker-win/final/default/src/fusion/Model.mbi:4729:6-4739:7
void mosek::fusion::p_Model::con_release(int32_t _840_id)
{
  int32_t _841_num = con_blocks->blocksize(_840_id);
  if ((_841_num >= (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _842_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_841_num)));
      _checked_ptr_1<int32_t> _ptr__842_nativeidxs(_842_nativeidxs ? _842_nativeidxs->raw() : nullptr,_842_nativeidxs ? _842_nativeidxs->size(0) : 0);
      con_blocks->release(_840_id,_842_nativeidxs);
      ((*cons)(_840_id)) = nullptr;
      task_con_putboundlist_fr(_842_nativeidxs);
    }
  }
  {}
}
// End mosek.fusion.Model.con_release

// Begin mosek.fusion.Model.con_allocate
// Method mosek.fusion.Model.con_allocate @ bld/docker-win/final/default/src/fusion/Model.mbi:4709:6-4727:7
int32_t mosek::fusion::p_Model::con_allocate(std::shared_ptr< monty::ndarray< int32_t,1 > > _843_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__843_nativeidxs(_843_nativeidxs ? _843_nativeidxs->raw() : nullptr, _843_nativeidxs ? _843_nativeidxs->size(0) : 0);
  int32_t _844_conid = con_blocks->allocate(_843_nativeidxs);
  if (((int)((_843_nativeidxs)->size(0)) > (int)0))
  {
    {
      int32_t _845_maxidx = _ptr__843_nativeidxs[(int)0];
      int32_t _9470_ = (int)1;
      int32_t _9471_ = (int)((_843_nativeidxs)->size(0));
      for (int32_t _846_i = _9470_; _846_i < _9471_; ++_846_i)
      {
        {
          if ((_ptr__843_nativeidxs[_846_i] > _845_maxidx))
          {
            {
              _845_maxidx = _ptr__843_nativeidxs[_846_i];
            }
          }
          {}
        }
      }
      if ((safe_add( _845_maxidx,(int)1 ) > num_task_con))
      {
        {
          int32_t _847_n = (safe_add( _845_maxidx,(int)1 ) - num_task_con);
          task_append_con(_847_n);
          num_task_con += _847_n;
        }
      }
      {}
    }
  }
  {}
  if ((_844_conid >= (int)((cons)->size(0))))
  {
    {
      std::vector<monty::rc_ptr< ::mosek::fusion::ModelConstraint >> _9472_;
      for (int32_t _849_i = (int)0, _9473_ = safe_mul( (int)((cons)->size(0)),(int)2 ); _849_i < _9473_ ; ++_849_i)
      {
        _9472_.push_back(nullptr);
      }
      auto _9474_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 >(monty::shape(_9472_.size()),_9472_.begin(),_9472_.end()));
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelConstraint >,1 > > _848_newcons = _9474_;
      int32_t _9475_ = (int)0;
      int32_t _9476_ = (int)((cons)->size(0));
      for (int32_t _850_i = _9475_; _850_i < _9476_; ++_850_i)
      {
        {
          ((*_848_newcons)(_850_i)) = ((*cons)(_850_i));
        }
      }
      cons = _848_newcons;
    }
  }
  {}
  return _844_conid;
}
// End mosek.fusion.Model.con_allocate

// Begin mosek.fusion.Model.barvar_alloc
// Method mosek.fusion.Model.barvar_alloc @ bld/docker-win/final/default/src/fusion/Model.mbi:4602:6-4703:7
int32_t mosek::fusion::p_Model::barvar_alloc(int32_t _851_conedim,int32_t _852_numcone,std::shared_ptr< monty::ndarray< int32_t,1 > > _853_barvaridxs,std::shared_ptr< monty::ndarray< int64_t,1 > > _854_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__853_barvaridxs(_853_barvaridxs ? _853_barvaridxs->raw() : nullptr, _853_barvaridxs ? _853_barvaridxs->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__854_nativeidxs(_854_nativeidxs ? _854_nativeidxs->raw() : nullptr, _854_nativeidxs ? _854_nativeidxs->size(0) : 0);
  int32_t _855_barvarid = barvar_num;
  ++ barvar_num;
  int32_t _856_conesize = (safe_mul( _851_conedim,safe_add( _851_conedim,(int)1 ) ) / (int)2);
  int32_t _857_domsize = safe_mul( _856_conesize,_852_numcone );
  int32_t _858_block_num = ((*barvar_block_ptr)(_855_barvarid));
  int32_t _859_block_cap = (int)((barvar_block_dim)->size(0));
  int32_t _860_block_elm_num = ((*barvar_block_elm_ptr)(_855_barvarid));
  int32_t _861_block_elm_cap = (int)((barvar_block_elm_barj)->size(0));
  if ((_859_block_cap < safe_add( _858_block_num,(int)1 )))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _862_new_barvar_block_dim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_mul( (int)((barvar_block_dim)->size(0)),(int)2 ))));
      _checked_ptr_1<int32_t> _ptr__862_new_barvar_block_dim(_862_new_barvar_block_dim ? _862_new_barvar_block_dim->raw() : nullptr,_862_new_barvar_block_dim ? _862_new_barvar_block_dim->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _863_new_barvar_block_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( safe_mul( (int)((barvar_block_dim)->size(0)),(int)2 ),(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__863_new_barvar_block_ptr(_863_new_barvar_block_ptr ? _863_new_barvar_block_ptr->raw() : nullptr,_863_new_barvar_block_ptr ? _863_new_barvar_block_ptr->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _864_new_barvar_block_elm_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( safe_mul( (int)((barvar_block_dim)->size(0)),(int)2 ),(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__864_new_barvar_block_elm_ptr(_864_new_barvar_block_elm_ptr ? _864_new_barvar_block_elm_ptr->raw() : nullptr,_864_new_barvar_block_elm_ptr ? _864_new_barvar_block_elm_ptr->size(0) : 0);
      std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9477_;
      for (int32_t _866_i = (int)0, _9478_ = safe_add( safe_mul( (int)((barvar_block_dim)->size(0)),(int)2 ),(int)1 ); _866_i < _9478_ ; ++_866_i)
      {
        _9477_.push_back(nullptr);
      }
      auto _9479_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9477_.size()),_9477_.begin(),_9477_.end()));
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > > _865_new_barvars = _9479_;
      int32_t _9480_ = (int)0;
      int32_t _9481_ = (int)((barvars)->size(0));
      for (int32_t _867_i = _9480_; _867_i < _9481_; ++_867_i)
      {
        {
          ((*_865_new_barvars)(_867_i)) = ((*barvars)(_867_i));
        }
      }
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_dim,(int)0,_862_new_barvar_block_dim,(int)0,(int)((barvar_block_dim)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_ptr,(int)0,_863_new_barvar_block_ptr,(int)0,(int)((barvar_block_ptr)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_elm_ptr,(int)0,_864_new_barvar_block_elm_ptr,(int)0,(int)((barvar_block_elm_ptr)->size(0)));
      barvar_block_dim = _862_new_barvar_block_dim;
      barvar_block_ptr = _863_new_barvar_block_ptr;
      barvar_block_elm_ptr = _864_new_barvar_block_elm_ptr;
      barvars = _865_new_barvars;
    }
  }
  {}
  if ((_861_block_elm_cap < safe_add( _860_block_elm_num,_857_domsize )))
  {
    {
      int32_t _868_addnum = (safe_add( _861_block_elm_cap,_857_domsize ) - _860_block_elm_num);
      if ((_868_addnum < _861_block_elm_cap))
      {
        {
          _868_addnum = _861_block_elm_cap;
        }
      }
      {}
      int32_t _869_newlen = safe_add( _861_block_elm_cap,_868_addnum );
      std::shared_ptr< monty::ndarray< int32_t,1 > > _870_new_barvar_block_elm_barj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_869_newlen)));
      _checked_ptr_1<int32_t> _ptr__870_new_barvar_block_elm_barj(_870_new_barvar_block_elm_barj ? _870_new_barvar_block_elm_barj->raw() : nullptr,_870_new_barvar_block_elm_barj ? _870_new_barvar_block_elm_barj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _871_new_barvar_block_elm_i = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_869_newlen)));
      _checked_ptr_1<int32_t> _ptr__871_new_barvar_block_elm_i(_871_new_barvar_block_elm_i ? _871_new_barvar_block_elm_i->raw() : nullptr,_871_new_barvar_block_elm_i ? _871_new_barvar_block_elm_i->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _872_new_barvar_block_elm_j = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_869_newlen)));
      _checked_ptr_1<int32_t> _ptr__872_new_barvar_block_elm_j(_872_new_barvar_block_elm_j ? _872_new_barvar_block_elm_j->raw() : nullptr,_872_new_barvar_block_elm_j ? _872_new_barvar_block_elm_j->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_elm_barj,(int)0,_870_new_barvar_block_elm_barj,(int)0,(int)((barvar_block_elm_barj)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_elm_i,(int)0,_871_new_barvar_block_elm_i,(int)0,(int)((barvar_block_elm_i)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_block_elm_j,(int)0,_872_new_barvar_block_elm_j,(int)0,(int)((barvar_block_elm_j)->size(0)));
      barvar_block_elm_barj = _870_new_barvar_block_elm_barj;
      barvar_block_elm_i = _871_new_barvar_block_elm_i;
      barvar_block_elm_j = _872_new_barvar_block_elm_j;
    }
  }
  {}
  int32_t _873_firstcone = task_numbarvar();
  int32_t _9482_ = (int)0;
  int32_t _9483_ = _852_numcone;
  for (int32_t _874_i = _9482_; _874_i < _9483_; ++_874_i)
  {
    {
      _ptr__853_barvaridxs[_874_i] = safe_add( _873_firstcone,_874_i );
    }
  }
  if ((safe_add( _873_firstcone,_852_numcone ) >= (int)((barvar_dim)->size(0))))
  {
    {
      int32_t _875_addnum = (safe_add( _873_firstcone,_852_numcone ) - (int)((barvar_dim)->size(0)));
      if ((_875_addnum < (int)((barvar_dim)->size(0))))
      {
        {
          _875_addnum = (int)((barvar_dim)->size(0));
        }
      }
      {}
      int32_t _876_newnum = safe_add( _875_addnum,(int)((barvar_dim)->size(0)) );
      std::shared_ptr< monty::ndarray< int32_t,1 > > _877_new_barvar_dim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_876_newnum)));
      _checked_ptr_1<int32_t> _ptr__877_new_barvar_dim(_877_new_barvar_dim ? _877_new_barvar_dim->raw() : nullptr,_877_new_barvar_dim ? _877_new_barvar_dim->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(barvar_dim,(int)0,_877_new_barvar_dim,(int)0,(int)((barvar_dim)->size(0)));
      barvar_dim = _877_new_barvar_dim;
    }
  }
  {}
  ((*barvar_block_dim)(_855_barvarid)) = _851_conedim;
  ((*barvar_block_ptr)(safe_add( _855_barvarid,(int)1 ))) = safe_add( ((*barvar_block_ptr)(_855_barvarid)),_852_numcone );
  ((*barvar_block_elm_ptr)(safe_add( _855_barvarid,(int)1 ))) = safe_add( ((*barvar_block_elm_ptr)(_855_barvarid)),_857_domsize );
  {
    int32_t _878_k = (int)0;
    int32_t _879_b = ((*barvar_block_elm_ptr)(_855_barvarid));
    int32_t _9484_ = (int)0;
    int32_t _9485_ = _852_numcone;
    for (int32_t _880_i = _9484_; _880_i < _9485_; ++_880_i)
    {
      {
        int32_t _9486_ = (int)0;
        int32_t _9487_ = _851_conedim;
        for (int32_t _881_j1 = _9486_; _881_j1 < _9487_; ++_881_j1)
        {
          {
            int32_t _9488_ = _881_j1;
            int32_t _9489_ = _851_conedim;
            for (int32_t _882_j0 = _9488_; _882_j0 < _9489_; ++_882_j0)
            {
              {
                ((*barvar_block_elm_barj)(safe_add( _879_b,_878_k ))) = safe_add( _873_firstcone,_880_i );
                ((*barvar_block_elm_i)(safe_add( _879_b,_878_k ))) = _882_j0;
                ((*barvar_block_elm_j)(safe_add( _879_b,_878_k ))) = _881_j1;
                _ptr__854_nativeidxs[_878_k] = safe_add( _879_b,_878_k );
                ++ _878_k;
              }
            }
          }
        }
      }
    }
    int32_t _9490_ = (int)0;
    int32_t _9491_ = _852_numcone;
    for (int32_t _883_i = _9490_; _883_i < _9491_; ++_883_i)
    {
      {
        ((*barvar_dim)(safe_add( _873_firstcone,_883_i ))) = _851_conedim;
      }
    }
  }
  int32_t _884_barvaridx = task_append_barvar(_851_conedim,_852_numcone);
  return _855_barvarid;
}
// End mosek.fusion.Model.barvar_alloc

// Begin mosek.fusion.Model.conicvar_alloc
// Method mosek.fusion.Model.conicvar_alloc @ bld/docker-win/final/default/src/fusion/Model.mbi:4569:6-4600:7
int32_t mosek::fusion::p_Model::conicvar_alloc(int64_t _885_domidx,int32_t _886_conesize,int32_t _887_numcone,std::shared_ptr< monty::ndarray< int32_t,1 > > _888_accidxs,std::shared_ptr< monty::ndarray< int32_t,1 > > _889_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__888_accidxs(_888_accidxs ? _888_accidxs->raw() : nullptr, _888_accidxs ? _888_accidxs->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__889_nativeidxs(_889_nativeidxs ? _889_nativeidxs->raw() : nullptr, _889_nativeidxs ? _889_nativeidxs->size(0) : 0);
  int32_t _890_n = safe_mul( _886_conesize,_887_numcone );
  int32_t _891_varid = linearvar_alloc(_890_n,_889_nativeidxs);
  std::shared_ptr< monty::ndarray< double,1 > > _892_g = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_890_n)));
  _checked_ptr_1<double> _ptr__892_g(_892_g ? _892_g->raw() : nullptr,_892_g ? _892_g->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _893_conelmidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_890_n)));
  _checked_ptr_1<int32_t> _ptr__893_conelmidx(_893_conelmidx ? _893_conelmidx->raw() : nullptr,_893_conelmidx ? _893_conelmidx->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _894_afeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_890_n)));
  _checked_ptr_1<int32_t> _ptr__894_afeidxs(_894_afeidxs ? _894_afeidxs->raw() : nullptr,_894_afeidxs ? _894_afeidxs->size(0) : 0);
  int32_t _895_conid = acon_allocate(_885_domidx,_886_conesize,_887_numcone,_892_g,_894_afeidxs,_888_accidxs);
  ((*var_block_acc_id)(_891_varid)) = _895_conid;
  int32_t _9492_ = (int)0;
  int32_t _9493_ = _890_n;
  for (int32_t _896_i = _9492_; _896_i < _9493_; ++_896_i)
  {
    {
      ((*var_elm_acc_idx)(_ptr__889_nativeidxs[_896_i])) = _ptr__888_accidxs[(_896_i / _886_conesize)];
      ((*var_elm_acc_ofs)(_ptr__889_nativeidxs[_896_i])) = (_896_i % _886_conesize);
    }
  }
  std::vector<int64_t> _9494_;
  for (int32_t _897_i = (int)0, _9495_ = (int)((_894_afeidxs)->size(0)); _897_i < _9495_ ; ++_897_i)
  {
    _9494_.push_back(_ptr__894_afeidxs[_897_i]);
  }
  auto _9496_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9494_.size()),_9494_.begin(),_9494_.end()));
  std::vector<int32_t> _9497_;
  for (int32_t _898_i = (int)0, _9498_ = safe_add( _890_n,(int)1 ); _898_i < _9498_ ; ++_898_i)
  {
    _9497_.push_back(_898_i);
  }
  auto _9499_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9497_.size()),_9497_.begin(),_9497_.end()));
  std::vector<double> _9500_;
  for (int32_t _899_i = (int)0, _9501_ = _890_n; _899_i < _9501_ ; ++_899_i)
  {
    _9500_.push_back(1.0);
  }
  auto _9502_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9500_.size()),_9500_.begin(),_9500_.end()));
  std::vector<double> _9503_;
  for (int32_t _900_i = (int)0, _9504_ = _890_n; _900_i < _9504_ ; ++_900_i)
  {
    _9503_.push_back(0.0);
  }
  auto _9505_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9503_.size()),_9503_.begin(),_9503_.end()));
  task_putafeflist(_9496_,_9499_,_889_nativeidxs,_9502_,_9505_);
  return _891_varid;
}
// End mosek.fusion.Model.conicvar_alloc

// Begin mosek.fusion.Model.linearvar_alloc
// Method mosek.fusion.Model.linearvar_alloc @ bld/docker-win/final/default/src/fusion/Model.mbi:4531:6-4567:7
int32_t mosek::fusion::p_Model::linearvar_alloc(int32_t _901_n,std::shared_ptr< monty::ndarray< int32_t,1 > > _902_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__902_nativeidxs(_902_nativeidxs ? _902_nativeidxs->raw() : nullptr, _902_nativeidxs ? _902_nativeidxs->size(0) : 0);
  int32_t _903_varid = var_block_map->alloc(_901_n);
  int32_t _904_maxvaridx = safe_add( var_block_map->maxidx(_903_varid),(int)1 );
  int32_t _905_cap = var_block_map->capacity();
  int32_t _906_numblocks = var_block_map->block_capacity();
  var_block_map->get(_903_varid,_902_nativeidxs,(int)0);
  if ((task_numvar() < _904_maxvaridx))
  {
    {
      task_append_var((_904_maxvaridx - task_numvar()));
    }
  }
  {}
  if ((_903_varid >= (int)((vars)->size(0))))
  {
    {
      std::vector<monty::rc_ptr< ::mosek::fusion::ModelVariable >> _9506_;
      for (int32_t _908_i = (int)0, _9507_ = safe_mul( (int)((vars)->size(0)),(int)2 ); _908_i < _9507_ ; ++_908_i)
      {
        _9506_.push_back(nullptr);
      }
      auto _9508_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 >(monty::shape(_9506_.size()),_9506_.begin(),_9506_.end()));
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::ModelVariable >,1 > > _907_newvars = _9508_;
      int32_t _9509_ = (int)0;
      int32_t _9510_ = (int)((vars)->size(0));
      for (int32_t _909_i = _9509_; _909_i < _9510_; ++_909_i)
      {
        {
          ((*_907_newvars)(_909_i)) = ((*vars)(_909_i));
        }
      }
      vars = _907_newvars;
    }
  }
  {}
  if ((_906_numblocks > (int)((var_block_acc_id)->size(0))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _910_new_var_block_acc_id = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_906_numblocks)));
      _checked_ptr_1<int32_t> _ptr__910_new_var_block_acc_id(_910_new_var_block_acc_id ? _910_new_var_block_acc_id->raw() : nullptr,_910_new_var_block_acc_id ? _910_new_var_block_acc_id->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(var_block_acc_id,(int)0,_910_new_var_block_acc_id,(int)0,(int)((var_block_acc_id)->size(0)));
      var_block_acc_id = _910_new_var_block_acc_id;
    }
  }
  {}
  if ((_905_cap > (int)((var_elm_acc_idx)->size(0))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _911_new_var_elm_acc_idx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_905_cap)));
      _checked_ptr_1<int32_t> _ptr__911_new_var_elm_acc_idx(_911_new_var_elm_acc_idx ? _911_new_var_elm_acc_idx->raw() : nullptr,_911_new_var_elm_acc_idx ? _911_new_var_elm_acc_idx->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(var_elm_acc_idx,(int)0,_911_new_var_elm_acc_idx,(int)0,(int)((var_elm_acc_idx)->size(0)));
      var_elm_acc_idx = _911_new_var_elm_acc_idx;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _912_new_var_elm_acc_ofs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_905_cap)));
      _checked_ptr_1<int32_t> _ptr__912_new_var_elm_acc_ofs(_912_new_var_elm_acc_ofs ? _912_new_var_elm_acc_ofs->raw() : nullptr,_912_new_var_elm_acc_ofs ? _912_new_var_elm_acc_ofs->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(var_elm_acc_ofs,(int)0,_912_new_var_elm_acc_ofs,(int)0,(int)((var_elm_acc_ofs)->size(0)));
      var_elm_acc_ofs = _912_new_var_elm_acc_ofs;
    }
  }
  {}
  ((*var_block_acc_id)(_903_varid)) = (-(int)1);
  int32_t _9511_ = (int)0;
  int32_t _9512_ = _901_n;
  for (int32_t _913_i = _9511_; _913_i < _9512_; ++_913_i)
  {
    {
      ((*var_elm_acc_idx)(_ptr__902_nativeidxs[_913_i])) = (-(int)1);
    }
  }
  return _903_varid;
}
// End mosek.fusion.Model.linearvar_alloc

// Begin mosek.fusion.Model.make_continuous
// Method mosek.fusion.Model.make_continuous @ bld/docker-win/final/default/src/fusion/Model.mbi:4517:6-4528:7
void mosek::fusion::p_Model::make_continuous(std::shared_ptr< monty::ndarray< int64_t,1 > > _914_idxs)
{
  _checked_ptr_1<int64_t> _ptr__914_idxs(_914_idxs ? _914_idxs->raw() : nullptr, _914_idxs ? _914_idxs->size(0) : 0);
  int32_t _915_count = (int)0;
  int32_t _9513_ = (int)0;
  int32_t _9514_ = (int)((_914_idxs)->size(0));
  for (int32_t _916_i = _9513_; _916_i < _9514_; ++_916_i)
  {
    {
      if ((_ptr__914_idxs[_916_i] > (int)0))
      {
        {
          ++ _915_count;
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _917_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_915_count)));
  _checked_ptr_1<int32_t> _ptr__917_nativeidxs(_917_nativeidxs ? _917_nativeidxs->raw() : nullptr,_917_nativeidxs ? _917_nativeidxs->size(0) : 0);
  int32_t _918_k = (int)0;
  int32_t _9515_ = (int)0;
  int32_t _9516_ = (int)((_914_idxs)->size(0));
  for (int32_t _919_i = _9515_; _919_i < _9516_; ++_919_i)
  {
    {
      if ((_ptr__914_idxs[_919_i] > (int)0))
      {
        {
          _ptr__917_nativeidxs[_918_k] = (int32_t)_ptr__914_idxs[_919_i];
          ++ _918_k;
        }
      }
      {}
    }
  }
  task_var_putcontlist(_917_nativeidxs);
}
// End mosek.fusion.Model.make_continuous

// Begin mosek.fusion.Model.make_integer
// Method mosek.fusion.Model.make_integer @ bld/docker-win/final/default/src/fusion/Model.mbi:4505:6-4515:7
void mosek::fusion::p_Model::make_integer(std::shared_ptr< monty::ndarray< int64_t,1 > > _920_idxs)
{
  _checked_ptr_1<int64_t> _ptr__920_idxs(_920_idxs ? _920_idxs->raw() : nullptr, _920_idxs ? _920_idxs->size(0) : 0);
  int32_t _921_count = (int)0;
  int32_t _9517_ = (int)0;
  int32_t _9518_ = (int)((_920_idxs)->size(0));
  for (int32_t _922_i = _9517_; _922_i < _9518_; ++_922_i)
  {
    {
      if ((_ptr__920_idxs[_922_i] > (int)0))
      {
        {
          ++ _921_count;
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _923_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_921_count)));
  _checked_ptr_1<int32_t> _ptr__923_nativeidxs(_923_nativeidxs ? _923_nativeidxs->raw() : nullptr,_923_nativeidxs ? _923_nativeidxs->size(0) : 0);
  int32_t _924_k = (int)0;
  int32_t _9519_ = (int)0;
  int32_t _9520_ = (int)((_920_idxs)->size(0));
  for (int32_t _925_i = _9519_; _925_i < _9520_; ++_925_i)
  {
    {
      if ((_ptr__920_idxs[_925_i] > (int)0))
      {
        {
          _ptr__923_nativeidxs[_924_k] = (int32_t)_ptr__920_idxs[_925_i];
          ++ _924_k;
        }
      }
      {}
    }
  }
  task_var_putintlist(_923_nativeidxs);
}
// End mosek.fusion.Model.make_integer

// Begin mosek.fusion.Model.putlicensewait
// Method mosek.fusion.Model.putlicensewait @ bld/docker-win/final/default/src/fusion/Model.mbi:4503:6-87
void mosek::fusion::Model::putlicensewait
  ( bool _926_wait) { mosek::fusion::p_Model::putlicensewait(_926_wait); }
void mosek::fusion::p_Model::putlicensewait(bool _926_wait)
{
  ::mosek::fusion::p_BaseModel::env_putlicensewait(_926_wait);
}
// End mosek.fusion.Model.putlicensewait

// Begin mosek.fusion.Model.putlicensepath
// Method mosek.fusion.Model.putlicensepath @ bld/docker-win/final/default/src/fusion/Model.mbi:4500:6-90
void mosek::fusion::Model::putlicensepath
  ( const std::string & _927_licfile) { mosek::fusion::p_Model::putlicensepath(_927_licfile); }
void mosek::fusion::p_Model::putlicensepath(const std::string & _927_licfile)
{
  ::mosek::fusion::p_BaseModel::env_putlicensepath(_927_licfile);
}
// End mosek.fusion.Model.putlicensepath

// Begin mosek.fusion.Model.putlicensecode
// Method mosek.fusion.Model.putlicensecode @ bld/docker-win/final/default/src/fusion/Model.mbi:4496:6-87
void mosek::fusion::Model::putlicensecode
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _928_code) { mosek::fusion::p_Model::putlicensecode(_928_code); }
void mosek::fusion::p_Model::putlicensecode(std::shared_ptr< monty::ndarray< int32_t,1 > > _928_code)
{
  _checked_ptr_1<int32_t> _ptr__928_code(_928_code ? _928_code->raw() : nullptr, _928_code ? _928_code->size(0) : 0);
  ::mosek::fusion::p_BaseModel::env_putlicensecode(_928_code);
}
// End mosek.fusion.Model.putlicensecode

// Begin mosek.fusion.Model.dispose
// Method mosek.fusion.Model.dispose @ bld/docker-win/final/default/src/fusion/Model.mbi:4481:6-4490:7
void mosek::fusion::Model :: dispose() { mosek::fusion::p_Model::_get_impl(this)->dispose(); }
void mosek::fusion::p_Model::dispose()
{
  int32_t _9521_ = (int)0;
  int32_t _9522_ = (int)((vars)->size(0));
  for (int32_t _929_i = _9521_; _929_i < _9522_; ++_929_i)
  {
    {
      ((*vars)(_929_i)) = nullptr;
    }
  }
  int32_t _9523_ = (int)0;
  int32_t _9524_ = (int)((cons)->size(0));
  for (int32_t _930_i = _9523_; _930_i < _9524_; ++_930_i)
  {
    {
      ((*cons)(_930_i)) = nullptr;
    }
  }
  int32_t _9525_ = (int)0;
  int32_t _9526_ = (int)((acons)->size(0));
  for (int32_t _931_i = _9525_; _931_i < _9526_; ++_931_i)
  {
    {
      ((*acons)(_931_i)) = nullptr;
    }
  }
  int32_t _9527_ = (int)0;
  int32_t _9528_ = (int)((barvars)->size(0));
  for (int32_t _932_i = _9527_; _932_i < _9528_; ++_932_i)
  {
    {
      ((*barvars)(_932_i)) = nullptr;
    }
  }
  if ((NULL != parameters.get()))
  {
    {
      int32_t _9529_ = (int)0;
      int32_t _9530_ = (int)((parameters)->size(0));
      for (int32_t _933_i = _9529_; _933_i < _9530_; ++_933_i)
      {
        {
          ((*parameters)(_933_i)) = nullptr;
        }
      }
    }
  }
  {}
  ::mosek::fusion::p_BaseModel::dispose();
}
// End mosek.fusion.Model.dispose

// Begin mosek.fusion.Model.getTask
// Method mosek.fusion.Model.getTask @ bld/docker-win/final/default/src/fusion/Model.mbi:4461:6-64
MSKtask_t mosek::fusion::Model :: __mosek_2fusion_2Model__getTask() { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getTask(); }
MSKtask_t mosek::fusion::Model::getTask() { return __mosek_2fusion_2Model__getTask(); }
MSKtask_t mosek::fusion::p_Model::__mosek_2fusion_2Model__getTask()
{
  return __mosek_2fusion_2BaseModel__task_get();
}
// End mosek.fusion.Model.getTask

// Begin mosek.fusion.Model.getConstraintDuals
// Method mosek.fusion.Model.getConstraintDuals @ bld/docker-win/final/default/src/fusion/Model.mbi:4435:6-4450:7
void mosek::fusion::Model :: getConstraintDuals(bool _934_lower,std::shared_ptr< monty::ndarray< int32_t,1 > > _935_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _936_res,int32_t _937_offset) { mosek::fusion::p_Model::_get_impl(this)->getConstraintDuals(_934_lower,_935_nativeidxs,_936_res,_937_offset); }
void mosek::fusion::p_Model::getConstraintDuals(bool _934_lower,std::shared_ptr< monty::ndarray< int32_t,1 > > _935_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _936_res,int32_t _937_offset)
{
  _checked_ptr_1<int32_t> _ptr__935_nativeidxs(_935_nativeidxs ? _935_nativeidxs->raw() : nullptr, _935_nativeidxs ? _935_nativeidxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__936_res(_936_res ? _936_res->raw() : nullptr, _936_res ? _936_res->size(0) : 0);
  int32_t _938_n = (int)((_935_nativeidxs)->size(0));
  std::shared_ptr< monty::ndarray< double,1 > > _939_slc = getSolution_slc(::mosek::fusion::SolutionType::Default);
  _checked_ptr_1<double> _ptr__939_slc(_939_slc ? _939_slc->raw() : nullptr,_939_slc ? _939_slc->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _940_suc = getSolution_suc(::mosek::fusion::SolutionType::Default);
  _checked_ptr_1<double> _ptr__940_suc(_940_suc ? _940_suc->raw() : nullptr,_940_suc ? _940_suc->size(0) : 0);
  int32_t _9531_ = (int)0;
  int32_t _9532_ = _938_n;
  for (int32_t _941_p = _9531_; _941_p < _9532_; ++_941_p)
  {
    {
      if ((_ptr__935_nativeidxs[_941_p] >= (int)0))
      {
        {
          if (_934_lower)
          {
            {
              _ptr__936_res[safe_add( _937_offset,_941_p )] = _ptr__939_slc[_ptr__935_nativeidxs[_941_p]];
            }
          }
          else
          {
            {
              _ptr__936_res[safe_add( _937_offset,_941_p )] = (-_ptr__940_suc[_ptr__935_nativeidxs[_941_p]]);
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::SolutionError(std::string ("Requested invalid solution item"));
        }
      }
    }
  }
}
// End mosek.fusion.Model.getConstraintDuals

// Begin mosek.fusion.Model.getConstraintValues
// Method mosek.fusion.Model.getConstraintValues @ bld/docker-win/final/default/src/fusion/Model.mbi:4401:6-4432:7
void mosek::fusion::Model :: getConstraintValues(bool _942_primal,std::shared_ptr< monty::ndarray< int32_t,1 > > _943_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _944_res,int32_t _945_offset) { mosek::fusion::p_Model::_get_impl(this)->getConstraintValues(_942_primal,_943_nativeidxs,_944_res,_945_offset); }
void mosek::fusion::p_Model::getConstraintValues(bool _942_primal,std::shared_ptr< monty::ndarray< int32_t,1 > > _943_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _944_res,int32_t _945_offset)
{
  _checked_ptr_1<int32_t> _ptr__943_nativeidxs(_943_nativeidxs ? _943_nativeidxs->raw() : nullptr, _943_nativeidxs ? _943_nativeidxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__944_res(_944_res ? _944_res->raw() : nullptr, _944_res ? _944_res->size(0) : 0);
  int32_t _946_n = (int)((_943_nativeidxs)->size(0));
  if (_942_primal)
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _947_xc = getSolution_xc(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__947_xc(_947_xc ? _947_xc->raw() : nullptr,_947_xc ? _947_xc->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _948_accx = getSolution_accx(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__948_accx(_948_accx ? _948_accx->raw() : nullptr,_948_accx ? _948_accx->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _949_accptr = getSolution_accptr(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<int32_t> _ptr__949_accptr(_949_accptr ? _949_accptr->raw() : nullptr,_949_accptr ? _949_accptr->size(0) : 0);
      int32_t _9533_ = (int)0;
      int32_t _9534_ = _946_n;
      for (int32_t _950_p = _9533_; _950_p < _9534_; ++_950_p)
      {
        {
          if ((_ptr__943_nativeidxs[_950_p] >= (int)0))
          {
            {
              _ptr__944_res[safe_add( _945_offset,_950_p )] = _ptr__947_xc[_ptr__943_nativeidxs[_950_p]];
            }
          }
          else
          {
            {
              int32_t _951_i = (-safe_add( (int)1,_ptr__943_nativeidxs[_950_p] ));
              _ptr__944_res[safe_add( _945_offset,_950_p )] = (_ptr__948_accx[safe_add( _ptr__949_accptr[((*acon_elm_accid)(_951_i))],((*acon_elm_ofs)(_951_i)) )] * ((*acon_elm_scale)(_951_i)));
            }
          }
        }
      }
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _952_y = getSolution_y(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__952_y(_952_y ? _952_y->raw() : nullptr,_952_y ? _952_y->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _953_accy = getSolution_accy(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__953_accy(_953_accy ? _953_accy->raw() : nullptr,_953_accy ? _953_accy->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _954_accptr = getSolution_accptr(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<int32_t> _ptr__954_accptr(_954_accptr ? _954_accptr->raw() : nullptr,_954_accptr ? _954_accptr->size(0) : 0);
      int32_t _9535_ = (int)0;
      int32_t _9536_ = _946_n;
      for (int32_t _955_p = _9535_; _955_p < _9536_; ++_955_p)
      {
        {
          if ((_ptr__943_nativeidxs[_955_p] >= (int)0))
          {
            {
              _ptr__944_res[safe_add( _945_offset,_955_p )] = _ptr__952_y[_ptr__943_nativeidxs[_955_p]];
            }
          }
          else
          {
            {
              int32_t _956_i = (-safe_add( (int)1,_ptr__943_nativeidxs[_955_p] ));
              _ptr__944_res[safe_add( _945_offset,_955_p )] = (_ptr__953_accy[safe_add( _ptr__954_accptr[((*acon_elm_accid)(_956_i))],((*acon_elm_ofs)(_956_i)) )] * ((*acon_elm_scale)(_956_i)));
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.Model.getConstraintValues

// Begin mosek.fusion.Model.getVariableDuals
// Method mosek.fusion.Model.getVariableDuals @ bld/docker-win/final/default/src/fusion/Model.mbi:4371:6-4398:7
void mosek::fusion::Model :: getVariableDuals(bool _957_lower,std::shared_ptr< monty::ndarray< int64_t,1 > > _958_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _959_res,int32_t _960_offset) { mosek::fusion::p_Model::_get_impl(this)->getVariableDuals(_957_lower,_958_nativeidxs,_959_res,_960_offset); }
void mosek::fusion::p_Model::getVariableDuals(bool _957_lower,std::shared_ptr< monty::ndarray< int64_t,1 > > _958_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _959_res,int32_t _960_offset)
{
  _checked_ptr_1<int64_t> _ptr__958_nativeidxs(_958_nativeidxs ? _958_nativeidxs->raw() : nullptr, _958_nativeidxs ? _958_nativeidxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__959_res(_959_res ? _959_res->raw() : nullptr, _959_res ? _959_res->size(0) : 0);
  int32_t _961_n = (int)((_958_nativeidxs)->size(0));
  if (_957_lower)
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _962_xx = getSolution_slx(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__962_xx(_962_xx ? _962_xx->raw() : nullptr,_962_xx ? _962_xx->size(0) : 0);
      int32_t _9537_ = (int)0;
      int32_t _9538_ = _961_n;
      for (int32_t _963_p = _9537_; _963_p < _9538_; ++_963_p)
      {
        {
          if ((_ptr__958_nativeidxs[_963_p] > (int)0))
          {
            {
              _ptr__959_res[safe_add( _960_offset,_963_p )] = _ptr__962_xx[_ptr__958_nativeidxs[_963_p]];
            }
          }
          else
          {
            {
              _ptr__959_res[safe_add( _960_offset,_963_p )] = (int)0;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _964_xx = getSolution_sux(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__964_xx(_964_xx ? _964_xx->raw() : nullptr,_964_xx ? _964_xx->size(0) : 0);
      int32_t _9539_ = (int)0;
      int32_t _9540_ = _961_n;
      for (int32_t _965_p = _9539_; _965_p < _9540_; ++_965_p)
      {
        {
          if ((_ptr__958_nativeidxs[_965_p] > (int)0))
          {
            {
              _ptr__959_res[safe_add( _960_offset,_965_p )] = (-_ptr__964_xx[_ptr__958_nativeidxs[_965_p]]);
            }
          }
          else
          {
            {
              _ptr__959_res[safe_add( _960_offset,_965_p )] = (int)0;
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.Model.getVariableDuals

// Begin mosek.fusion.Model.getVariableValues
// Method mosek.fusion.Model.getVariableValues @ bld/docker-win/final/default/src/fusion/Model.mbi:4330:6-4367:7
void mosek::fusion::Model :: getVariableValues(bool _966_primal,std::shared_ptr< monty::ndarray< int64_t,1 > > _967_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _968_res,int32_t _969_offset) { mosek::fusion::p_Model::_get_impl(this)->getVariableValues(_966_primal,_967_nativeidxs,_968_res,_969_offset); }
void mosek::fusion::p_Model::getVariableValues(bool _966_primal,std::shared_ptr< monty::ndarray< int64_t,1 > > _967_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _968_res,int32_t _969_offset)
{
  _checked_ptr_1<int64_t> _ptr__967_nativeidxs(_967_nativeidxs ? _967_nativeidxs->raw() : nullptr, _967_nativeidxs ? _967_nativeidxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__968_res(_968_res ? _968_res->raw() : nullptr, _968_res ? _968_res->size(0) : 0);
  int32_t _970_n = (int)((_967_nativeidxs)->size(0));
  barvar_num = task_numbarvar();
  if (_966_primal)
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _971_xx = getSolution_xx(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__971_xx(_971_xx ? _971_xx->raw() : nullptr,_971_xx ? _971_xx->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _9541_;
      bool _9542_ = (barvar_num > (int)0);
      if (_9542_)
      {
        _9541_ = getSolution_barx(::mosek::fusion::SolutionType::Default);
      }
      else
      {
        _9541_ = nullptr;
      }
      std::shared_ptr< monty::ndarray< double,1 > > _972_barx = _9541_;
      _checked_ptr_1<double> _ptr__972_barx(_972_barx ? _972_barx->raw() : nullptr,_972_barx ? _972_barx->size(0) : 0);
      int32_t _9543_ = (int)0;
      int32_t _9544_ = _970_n;
      for (int32_t _973_p = _9543_; _973_p < _9544_; ++_973_p)
      {
        {
          if ((_ptr__967_nativeidxs[_973_p] > (int)0))
          {
            {
              _ptr__968_res[safe_add( _969_offset,_973_p )] = _ptr__971_xx[_ptr__967_nativeidxs[_973_p]];
            }
          }
          else if((_ptr__967_nativeidxs[_973_p] < (int)0))
          {
            {
              int64_t _974_idx = (-safe_add( _ptr__967_nativeidxs[_973_p],(int)1 ));
              _ptr__968_res[safe_add( _969_offset,_973_p )] = _ptr__972_barx[_974_idx];
            }
          }
          else
          {
            {
              _ptr__968_res[safe_add( _969_offset,_973_p )] = (int)0;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _975_yx = getSolution_yx(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__975_yx(_975_yx ? _975_yx->raw() : nullptr,_975_yx ? _975_yx->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _9545_;
      bool _9546_ = (barvar_num > (int)0);
      if (_9546_)
      {
        _9545_ = getSolution_bars(::mosek::fusion::SolutionType::Default);
      }
      else
      {
        _9545_ = nullptr;
      }
      std::shared_ptr< monty::ndarray< double,1 > > _976_bars = _9545_;
      _checked_ptr_1<double> _ptr__976_bars(_976_bars ? _976_bars->raw() : nullptr,_976_bars ? _976_bars->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _977_accy = getSolution_accy(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<double> _ptr__977_accy(_977_accy ? _977_accy->raw() : nullptr,_977_accy ? _977_accy->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _978_accptr = getSolution_accptr(::mosek::fusion::SolutionType::Default);
      _checked_ptr_1<int32_t> _ptr__978_accptr(_978_accptr ? _978_accptr->raw() : nullptr,_978_accptr ? _978_accptr->size(0) : 0);
      int32_t _9547_ = (int)0;
      int32_t _9548_ = _970_n;
      for (int32_t _979_p = _9547_; _979_p < _9548_; ++_979_p)
      {
        {
          if ((_ptr__967_nativeidxs[_979_p] < (int)0))
          {
            {
              int64_t _980_idx = (-safe_add( _ptr__967_nativeidxs[_979_p],(int)1 ));
              _ptr__968_res[safe_add( _969_offset,_979_p )] = _ptr__976_bars[_980_idx];
            }
          }
          else if((_ptr__967_nativeidxs[_979_p] == (int)0))
          {
            {
              _ptr__968_res[safe_add( _969_offset,_979_p )] = (int)0;
            }
          }
          else if((((*var_elm_acc_idx)(_ptr__967_nativeidxs[_979_p])) >= (int)0))
          {
            {
              _ptr__968_res[safe_add( _969_offset,_979_p )] = _ptr__977_accy[safe_add( _ptr__978_accptr[((*var_elm_acc_idx)(_ptr__967_nativeidxs[_979_p]))],((*var_elm_acc_ofs)(_ptr__967_nativeidxs[_979_p])) )];
            }
          }
          else
          {
            {
              _ptr__968_res[safe_add( _969_offset,_979_p )] = _ptr__975_yx[_ptr__967_nativeidxs[_979_p]];
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.Model.getVariableValues

// Begin mosek.fusion.Model.setVariableValues
// Method mosek.fusion.Model.setVariableValues @ bld/docker-win/final/default/src/fusion/Model.mbi:4307:6-4327:7
void mosek::fusion::Model :: setVariableValues(bool _981_primal,std::shared_ptr< monty::ndarray< int64_t,1 > > _982_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _983_values) { mosek::fusion::p_Model::_get_impl(this)->setVariableValues(_981_primal,_982_nativeidxs,_983_values); }
void mosek::fusion::p_Model::setVariableValues(bool _981_primal,std::shared_ptr< monty::ndarray< int64_t,1 > > _982_nativeidxs,std::shared_ptr< monty::ndarray< double,1 > > _983_values)
{
  _checked_ptr_1<int64_t> _ptr__982_nativeidxs(_982_nativeidxs ? _982_nativeidxs->raw() : nullptr, _982_nativeidxs ? _982_nativeidxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__983_values(_983_values ? _983_values->raw() : nullptr, _983_values ? _983_values->size(0) : 0);
  if (_981_primal)
  {
    {
      int32_t _984_numnz = (int)0;
      int32_t _9549_ = (int)0;
      int32_t _9550_ = (int)((_982_nativeidxs)->size(0));
      for (int32_t _985_i = _9549_; _985_i < _9550_; ++_985_i)
      {
        {
          if ((_ptr__982_nativeidxs[_985_i] >= (int)0))
          {
            {
              ++ _984_numnz;
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _986_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_984_numnz)));
      _checked_ptr_1<int32_t> _ptr__986_subj(_986_subj ? _986_subj->raw() : nullptr,_986_subj ? _986_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _987_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_984_numnz)));
      _checked_ptr_1<double> _ptr__987_val(_987_val ? _987_val->raw() : nullptr,_987_val ? _987_val->size(0) : 0);
      int32_t _988_k = (int)0;
      int32_t _9551_ = (int)0;
      int32_t _9552_ = (int)((_982_nativeidxs)->size(0));
      for (int32_t _989_i = _9551_; _989_i < _9552_; ++_989_i)
      {
        {
          if ((_ptr__982_nativeidxs[_989_i] >= (int)0))
          {
            {
              _ptr__986_subj[_988_k] = (int32_t)_ptr__982_nativeidxs[_989_i];
              _ptr__987_val[_988_k] = _ptr__983_values[_989_i];
              ++ _988_k;
            }
          }
          {}
        }
      }
      setSolution_xx(_986_subj,_987_val);
    }
  }
  else
  {
    {
    }
  }
}
// End mosek.fusion.Model.setVariableValues

// Begin mosek.fusion.Model.flushNames
// Method mosek.fusion.Model.flushNames @ bld/docker-win/final/default/src/fusion/Model.mbi:4285:6-4299:7
void mosek::fusion::Model :: flushNames() { mosek::fusion::p_Model::_get_impl(this)->flushNames(); }
void mosek::fusion::p_Model::flushNames()
{
  int32_t _9553_ = (int)0;
  int32_t _9554_ = (int)((vars)->size(0));
  for (int32_t _990_i = _9553_; _990_i < _9554_; ++_990_i)
  {
    {
      if ((NULL != ((*vars)(_990_i)).get()))
      {
        {
          mosek::fusion::p_ModelVariable::_get_impl(((*vars)(_990_i)).get())->flushNames();
        }
      }
      {}
    }
  }
  int32_t _9555_ = (int)0;
  int32_t _9556_ = (int)((barvars)->size(0));
  for (int32_t _991_i = _9555_; _991_i < _9556_; ++_991_i)
  {
    {
      if ((NULL != ((*barvars)(_991_i)).get()))
      {
        {
          mosek::fusion::p_ModelVariable::_get_impl(((*barvars)(_991_i)).get())->flushNames();
        }
      }
      {}
    }
  }
  int32_t _9557_ = (int)0;
  int32_t _9558_ = (int)((cons)->size(0));
  for (int32_t _992_i = _9557_; _992_i < _9558_; ++_992_i)
  {
    {
      if ((NULL != ((*cons)(_992_i)).get()))
      {
        {
          mosek::fusion::p_ModelConstraint::_get_impl(((*cons)(_992_i)).get())->flushNames();
        }
      }
      {}
    }
  }
  int32_t _9559_ = (int)0;
  int32_t _9560_ = (int)((acons)->size(0));
  for (int32_t _993_i = _9559_; _993_i < _9560_; ++_993_i)
  {
    {
      if ((NULL != ((*acons)(_993_i)).get()))
      {
        {
          mosek::fusion::p_ModelConstraint::_get_impl(((*acons)(_993_i)).get())->flushNames();
        }
      }
      {}
    }
  }
}
// End mosek.fusion.Model.flushNames

// Begin mosek.fusion.Model.writeTaskNoFlush
// Method mosek.fusion.Model.writeTaskNoFlush @ bld/docker-win/final/default/src/fusion/Model.mbi:4276:6-4280:7
void mosek::fusion::Model :: writeTaskNoFlush(const std::string & _994_filename) { mosek::fusion::p_Model::_get_impl(this)->writeTaskNoFlush(_994_filename); }
void mosek::fusion::p_Model::writeTaskNoFlush(const std::string & _994_filename)
{
  _pubthis->flushNames();
  task_write(_994_filename);
}
// End mosek.fusion.Model.writeTaskNoFlush

// Begin mosek.fusion.Model.writeTaskStream
// Method mosek.fusion.Model.writeTaskStream @ bld/docker-win/final/default/src/fusion/Model.mbi:4268:6-4273:7
void mosek::fusion::Model :: writeTaskStream(const std::string & _995_ext,std::ostream& _996_stream) { mosek::fusion::p_Model::_get_impl(this)->writeTaskStream(_995_ext,_996_stream); }
void mosek::fusion::p_Model::writeTaskStream(const std::string & _995_ext,std::ostream& _996_stream)
{
  _pubthis->flushNames();
  flush_parameters();
  task_write_stream(_995_ext,_996_stream);
}
// End mosek.fusion.Model.writeTaskStream

// Begin mosek.fusion.Model.dataReport
// Method mosek.fusion.Model.dataReport @ bld/docker-win/final/default/src/fusion/Model.mbi:4239:6-58
void mosek::fusion::Model :: dataReport() { mosek::fusion::p_Model::_get_impl(this)->dataReport(); }
void mosek::fusion::p_Model::dataReport()
{
  _pubthis->dataReport((int)10);
}
// End mosek.fusion.Model.dataReport

// Begin mosek.fusion.Model.dataReport
// Method mosek.fusion.Model.dataReport @ bld/docker-win/final/default/src/fusion/Model.mbi:4234:6-4238:7
void mosek::fusion::Model :: dataReport(int32_t _997_detail) { mosek::fusion::p_Model::_get_impl(this)->dataReport(_997_detail); }
void mosek::fusion::p_Model::dataReport(int32_t _997_detail)
{
  flush_parameters();
  task_analyze_problem(_997_detail);
}
// End mosek.fusion.Model.dataReport

// Begin mosek.fusion.Model.writeTask
// Method mosek.fusion.Model.writeTask @ bld/docker-win/final/default/src/fusion/Model.mbi:4227:6-4232:7
void mosek::fusion::Model :: writeTask(const std::string & _998_filename) { mosek::fusion::p_Model::_get_impl(this)->writeTask(_998_filename); }
void mosek::fusion::p_Model::writeTask(const std::string & _998_filename)
{
  _pubthis->flushNames();
  flush_parameters();
  task_write(_998_filename);
}
// End mosek.fusion.Model.writeTask

// Begin mosek.fusion.Model.getSolverLIntInfo
// Method mosek.fusion.Model.getSolverLIntInfo @ bld/docker-win/final/default/src/fusion/Model.mbi:4219:6-93
int64_t mosek::fusion::Model :: getSolverLIntInfo(const std::string & _999_name) { return mosek::fusion::p_Model::_get_impl(this)->getSolverLIntInfo(_999_name); }
int64_t mosek::fusion::p_Model::getSolverLIntInfo(const std::string & _999_name)
{
  return task_get_liinf(_999_name);
}
// End mosek.fusion.Model.getSolverLIntInfo

// Begin mosek.fusion.Model.getSolverIntInfo
// Method mosek.fusion.Model.getSolverIntInfo @ bld/docker-win/final/default/src/fusion/Model.mbi:4209:6-92
int32_t mosek::fusion::Model :: getSolverIntInfo(const std::string & _1000_name) { return mosek::fusion::p_Model::_get_impl(this)->getSolverIntInfo(_1000_name); }
int32_t mosek::fusion::p_Model::getSolverIntInfo(const std::string & _1000_name)
{
  return task_get_iinf(_1000_name);
}
// End mosek.fusion.Model.getSolverIntInfo

// Begin mosek.fusion.Model.getSolverDoubleInfo
// Method mosek.fusion.Model.getSolverDoubleInfo @ bld/docker-win/final/default/src/fusion/Model.mbi:4199:6-92
double mosek::fusion::Model :: getSolverDoubleInfo(const std::string & _1001_name) { return mosek::fusion::p_Model::_get_impl(this)->getSolverDoubleInfo(_1001_name); }
double mosek::fusion::p_Model::getSolverDoubleInfo(const std::string & _1001_name)
{
  return task_get_dinf(_1001_name);
}
// End mosek.fusion.Model.getSolverDoubleInfo

// Begin mosek.fusion.Model.setCallbackHandler
// Method mosek.fusion.Model.setCallbackHandler @ bld/docker-win/final/default/src/fusion/Model.mbi:4189:6-110
void mosek::fusion::Model :: setCallbackHandler(mosek::cbhandler_t _1002_h) { mosek::fusion::p_Model::_get_impl(this)->setCallbackHandler(_1002_h); }
void mosek::fusion::p_Model::setCallbackHandler(mosek::cbhandler_t _1002_h)
{
  task_setCallbackHandler(_1002_h);
}
// End mosek.fusion.Model.setCallbackHandler

// Begin mosek.fusion.Model.setDataCallbackHandler
// Method mosek.fusion.Model.setDataCallbackHandler @ bld/docker-win/final/default/src/fusion/Model.mbi:4168:6-114
void mosek::fusion::Model :: setDataCallbackHandler(mosek::datacbhandler_t _1003_h) { mosek::fusion::p_Model::_get_impl(this)->setDataCallbackHandler(_1003_h); }
void mosek::fusion::p_Model::setDataCallbackHandler(mosek::datacbhandler_t _1003_h)
{
  task_setDataCallbackHandler(_1003_h);
}
// End mosek.fusion.Model.setDataCallbackHandler

// Begin mosek.fusion.Model.setLogHandler
// Method mosek.fusion.Model.setLogHandler @ bld/docker-win/final/default/src/fusion/Model.mbi:4146:6-89
void mosek::fusion::Model :: setLogHandler(mosek::msghandler_t _1004_h) { mosek::fusion::p_Model::_get_impl(this)->setLogHandler(_1004_h); }
void mosek::fusion::p_Model::setLogHandler(mosek::msghandler_t _1004_h)
{
  task_setLogHandler(_1004_h);
}
// End mosek.fusion.Model.setLogHandler

// Begin mosek.fusion.Model.setSolverParam
// Method mosek.fusion.Model.setSolverParam @ bld/docker-win/final/default/src/fusion/Model.mbi:4106:6-132
void mosek::fusion::Model :: setSolverParam(const std::string & _1005_name,double _1006_floatval) { mosek::fusion::p_Model::_get_impl(this)->setSolverParam(_1005_name,_1006_floatval); }
void mosek::fusion::p_Model::setSolverParam(const std::string & _1005_name,double _1006_floatval)
{
  ::mosek::fusion::p_Parameters::setParameter(::mosek::fusion::Model::t(_pubthis),_1005_name,_1006_floatval);
}
// End mosek.fusion.Model.setSolverParam

// Begin mosek.fusion.Model.setSolverParam
// Method mosek.fusion.Model.setSolverParam @ bld/docker-win/final/default/src/fusion/Model.mbi:4094:6-128
void mosek::fusion::Model :: setSolverParam(const std::string & _1007_name,int32_t _1008_intval) { mosek::fusion::p_Model::_get_impl(this)->setSolverParam(_1007_name,_1008_intval); }
void mosek::fusion::p_Model::setSolverParam(const std::string & _1007_name,int32_t _1008_intval)
{
  ::mosek::fusion::p_Parameters::setParameter(::mosek::fusion::Model::t(_pubthis),_1007_name,_1008_intval);
}
// End mosek.fusion.Model.setSolverParam

// Begin mosek.fusion.Model.setSolverParam
// Method mosek.fusion.Model.setSolverParam @ bld/docker-win/final/default/src/fusion/Model.mbi:4082:6-128
void mosek::fusion::Model :: setSolverParam(const std::string & _1009_name,const std::string & _1010_strval) { mosek::fusion::p_Model::_get_impl(this)->setSolverParam(_1009_name,_1010_strval); }
void mosek::fusion::p_Model::setSolverParam(const std::string & _1009_name,const std::string & _1010_strval)
{
  ::mosek::fusion::p_Parameters::setParameter(::mosek::fusion::Model::t(_pubthis),_1009_name,_1010_strval);
}
// End mosek.fusion.Model.setSolverParam

// Begin mosek.fusion.Model.breakSolver
// Method mosek.fusion.Model.breakSolver @ bld/docker-win/final/default/src/fusion/Model.mbi:4066:6-4069:7
void mosek::fusion::Model :: breakSolver() { mosek::fusion::p_Model::_get_impl(this)->breakSolver(); }
void mosek::fusion::p_Model::breakSolver()
{
  task_break_solve();
}
// End mosek.fusion.Model.breakSolver

// Begin mosek.fusion.Model.optserverHost
// Method mosek.fusion.Model.optserverHost @ bld/docker-win/final/default/src/fusion/Model.mbi:4052:6-4055:7
void mosek::fusion::Model :: optserverHost(const std::string & _1011_addr) { mosek::fusion::p_Model::_get_impl(this)->optserverHost(_1011_addr); }
void mosek::fusion::p_Model::optserverHost(const std::string & _1011_addr)
{
  task_putoptserver_host(_1011_addr);
}
// End mosek.fusion.Model.optserverHost

// Begin mosek.fusion.Model.report_solution
// Method mosek.fusion.Model.report_solution @ bld/docker-win/final/default/src/fusion/Model.mbi:3971:6-4047:7
void mosek::fusion::p_Model::report_solution(mosek::fusion::SolutionType _1012_soltype,mosek::fusion::ProblemStatus _1013_prosta,mosek::fusion::SolutionStatus _1014_psolsta,mosek::fusion::SolutionStatus _1015_dsolsta,double _1016_pobj,double _1017_dobj,int32_t _1018_numvar,int32_t _1019_numcon,int32_t _1020_numbarelm,int32_t _1021_numacc,int32_t _1022_numaccelm,bool _1023_hasprimal,bool _1024_hasdual)
{
  monty::rc_ptr< ::mosek::fusion::SolutionStruct > _1025_sol;
  if ((_1012_soltype == ::mosek::fusion::SolutionType::Interior))
  {
    {
      _1025_sol = sol_itr;
    }
  }
  else if((_1012_soltype == ::mosek::fusion::SolutionType::Basic))
  {
    {
      _1025_sol = sol_bas;
    }
  }
  else if((_1012_soltype == ::mosek::fusion::SolutionType::Integer))
  {
    {
      _1025_sol = sol_itg;
    }
  }
  else
  {
    {
      _1025_sol = nullptr;
    }
  }
  if ((NULL == _1025_sol.get()))
  {
    {
      _1025_sol = ::mosek::fusion::p_SolutionStruct::_new_SolutionStruct(_1018_numvar,_1019_numcon,_1020_numbarelm,_1021_numacc,_1022_numaccelm);
    }
  }
  else
  {
    {
      _1025_sol->resize(_1018_numvar,_1019_numcon,_1020_numbarelm,_1021_numacc,_1022_numaccelm);
    }
  }
  mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->pobj = _1016_pobj;
  mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->dobj = _1017_dobj;
  mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->pstatus = _1014_psolsta;
  mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->dstatus = _1015_dsolsta;
  mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->probstatus = _1013_prosta;
  if ((_1018_numvar > (int)0))
  {
    {
      if (_1023_hasprimal)
      {
        {
          report_solution_get_xx(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->xx);
        }
      }
      {}
      if (_1024_hasdual)
      {
        {
          report_solution_get_slx(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->slx);
          report_solution_get_sux(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->sux);
          std::shared_ptr< monty::ndarray< double,1 > > _1026_yx = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->yx;
          _checked_ptr_1<double> _ptr__1026_yx(_1026_yx ? _1026_yx->raw() : nullptr,_1026_yx ? _1026_yx->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _1027_slx = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->slx;
          _checked_ptr_1<double> _ptr__1027_slx(_1027_slx ? _1027_slx->raw() : nullptr,_1027_slx ? _1027_slx->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _1028_sux = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->sux;
          _checked_ptr_1<double> _ptr__1028_sux(_1028_sux ? _1028_sux->raw() : nullptr,_1028_sux ? _1028_sux->size(0) : 0);
          int32_t _9561_ = (int)0;
          int32_t _9562_ = _1018_numvar;
          for (int32_t _1029_i = _9561_; _1029_i < _9562_; ++_1029_i)
          {
            {
              _ptr__1026_yx[_1029_i] = (_ptr__1027_slx[_1029_i] - _ptr__1028_sux[_1029_i]);
            }
          }
        }
      }
      {}
    }
  }
  {}
  if ((_1019_numcon > (int)0))
  {
    {
      if (_1023_hasprimal)
      {
        {
          report_solution_get_xc(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->xc);
        }
      }
      {}
      if (_1024_hasdual)
      {
        {
          report_solution_get_slc(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->slc);
          report_solution_get_suc(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->suc);
          std::shared_ptr< monty::ndarray< double,1 > > _1030_y = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->y;
          _checked_ptr_1<double> _ptr__1030_y(_1030_y ? _1030_y->raw() : nullptr,_1030_y ? _1030_y->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _1031_slc = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->slc;
          _checked_ptr_1<double> _ptr__1031_slc(_1031_slc ? _1031_slc->raw() : nullptr,_1031_slc ? _1031_slc->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _1032_suc = mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->suc;
          _checked_ptr_1<double> _ptr__1032_suc(_1032_suc ? _1032_suc->raw() : nullptr,_1032_suc ? _1032_suc->size(0) : 0);
          int32_t _9563_ = (int)0;
          int32_t _9564_ = _1019_numcon;
          for (int32_t _1033_i = _9563_; _1033_i < _9564_; ++_1033_i)
          {
            {
              _ptr__1030_y[_1033_i] = (_ptr__1031_slc[_1033_i] - _ptr__1032_suc[_1033_i]);
            }
          }
        }
      }
      {}
    }
  }
  {}
  if ((_1020_numbarelm > (int)0))
  {
    {
      if (_1023_hasprimal)
      {
        {
          report_solution_get_barx(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->barx);
        }
      }
      {}
      if (_1024_hasdual)
      {
        {
          report_solution_get_bars(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->bars);
        }
      }
      {}
    }
  }
  {}
  if ((task_numacc() > (int)0))
  {
    {
      report_solution_get_accptr(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->accptr);
      if (_1023_hasprimal)
      {
        {
          report_solution_get_accx(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->accx);
        }
      }
      {}
      if (_1024_hasdual)
      {
        {
          report_solution_get_accy(mosek::fusion::p_SolutionStruct::_get_impl(_1025_sol)->accy);
        }
      }
      {}
    }
  }
  {}
  if ((_1012_soltype == ::mosek::fusion::SolutionType::Interior))
  {
    {
      sol_itr = _1025_sol;
    }
  }
  else if((_1012_soltype == ::mosek::fusion::SolutionType::Basic))
  {
    {
      sol_bas = _1025_sol;
    }
  }
  else if((_1012_soltype == ::mosek::fusion::SolutionType::Integer))
  {
    {
      sol_itg = _1025_sol;
    }
  }
  {}
}
// End mosek.fusion.Model.report_solution

// Begin mosek.fusion.Model.clear_solutions
// Method mosek.fusion.Model.clear_solutions @ bld/docker-win/final/default/src/fusion/Model.mbi:3965:6-3969:7
void mosek::fusion::p_Model::clear_solutions()
{
  sol_itr = nullptr;
  sol_itg = nullptr;
  sol_bas = nullptr;
}
// End mosek.fusion.Model.clear_solutions

// Begin mosek.fusion.Model.solveBatch
// Method mosek.fusion.Model.solveBatch @ bld/docker-win/final/default/src/fusion/Model.mbi:3940:6-3963:7
std::shared_ptr< monty::ndarray< mosek::fusion::SolverStatus,1 > > mosek::fusion::Model::solveBatch
  ( bool _1034_israce,
    double _1035_maxtime,
    int32_t _1036_numthreads,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Model >,1 > > _1037_models) { return mosek::fusion::p_Model::solveBatch(_1034_israce,_1035_maxtime,_1036_numthreads,_1037_models); }
std::shared_ptr< monty::ndarray< mosek::fusion::SolverStatus,1 > > mosek::fusion::p_Model::solveBatch(bool _1034_israce,double _1035_maxtime,int32_t _1036_numthreads,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Model >,1 > > _1037_models)
{
  int32_t _1038_n = (int)((_1037_models)->size(0));
  int32_t _9565_ = (int)0;
  int32_t _9566_ = _1038_n;
  for (int32_t _1039_i = _9565_; _1039_i < _9566_; ++_1039_i)
  {
    {
      if ((NULL == ((*_1037_models)(_1039_i)).get()))
      {
        {
          throw ::mosek::fusion::OptimizeError(std::string ("One of the models is a null object"));
        }
      }
      {}
    }
  }
  int32_t _9567_ = (int)0;
  int32_t _9568_ = _1038_n;
  for (int32_t _1040_i = _9567_; _1040_i < _9568_; ++_1040_i)
  {
    {
      ((*_1037_models)(_1040_i))->flushSolutions();
      mosek::fusion::p_Model::_get_impl(((*_1037_models)(_1040_i)).get())->flush_parameters();
    }
  }
  std::shared_ptr< monty::ndarray< mosek::fusion::SolverStatus,1 > > _1041_wasOK = ::mosek::fusion::p_BaseModel::env_solve_batch(_1034_israce,_1035_maxtime,_1036_numthreads,_1037_models);
  int32_t _9569_ = (int)0;
  int32_t _9570_ = _1038_n;
  for (int32_t _1042_i = _9569_; _1042_i < _9570_; ++_1042_i)
  {
    {
      mosek::fusion::p_Model::_get_impl(((*_1037_models)(_1042_i)).get())->task_post_solve();
    }
  }
  return _1041_wasOK;
}
// End mosek.fusion.Model.solveBatch

// Begin mosek.fusion.Model.solve
// Method mosek.fusion.Model.solve @ bld/docker-win/final/default/src/fusion/Model.mbi:3931:6-3938:7
void mosek::fusion::Model :: solve(const std::string & _1043_addr,const std::string & _1044_accesstoken) { mosek::fusion::p_Model::_get_impl(this)->solve(_1043_addr,_1044_accesstoken); }
void mosek::fusion::p_Model::solve(const std::string & _1043_addr,const std::string & _1044_accesstoken)
{
  _pubthis->flushSolutions();
  flush_parameters();
  task_solve(true,_1043_addr,_1044_accesstoken);
  task_post_solve();
}
// End mosek.fusion.Model.solve

// Begin mosek.fusion.Model.solve
// Method mosek.fusion.Model.solve @ bld/docker-win/final/default/src/fusion/Model.mbi:3922:6-3929:7
void mosek::fusion::Model :: solve() { mosek::fusion::p_Model::_get_impl(this)->solve(); }
void mosek::fusion::p_Model::solve()
{
  _pubthis->flushSolutions();
  flush_parameters();
  task_solve(false,std::string (""),std::string (""));
  task_post_solve();
}
// End mosek.fusion.Model.solve

// Begin mosek.fusion.Model.flush_parameters
// Method mosek.fusion.Model.flush_parameters @ bld/docker-win/final/default/src/fusion/Model.mbi:3843:6-3890:7
void mosek::fusion::p_Model::flush_parameters()
{
  int32_t _1045_num_con_param_nz = con_blocks->num_parameterized();
  int32_t _1046_num_afe_param_nz = afe_blocks->num_parameterized();
  int32_t _1047_num_obj_param_nz = obj_blocks->num_parameterized();
  if ((_1045_num_con_param_nz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1048_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1045_num_con_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1048_subi(_1048_subi ? _1048_subi->raw() : nullptr,_1048_subi ? _1048_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1049_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1045_num_con_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1049_subj(_1049_subj ? _1049_subj->raw() : nullptr,_1049_subj ? _1049_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1050_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1045_num_con_param_nz)));
      _checked_ptr_1<double> _ptr__1050_val(_1050_val ? _1050_val->raw() : nullptr,_1050_val ? _1050_val->size(0) : 0);
      con_blocks->evaluate(xs,param_value,_1048_subi,_1049_subj,_1050_val);
      task_putaijlist(_1048_subi,_1049_subj,_1050_val,(int64_t)(_1045_num_con_param_nz));
    }
  }
  {}
  if ((_1046_num_afe_param_nz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1051_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1046_num_afe_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1051_subi(_1051_subi ? _1051_subi->raw() : nullptr,_1051_subi ? _1051_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1052_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1046_num_afe_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1052_subj(_1052_subj ? _1052_subj->raw() : nullptr,_1052_subj ? _1052_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1053_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1046_num_afe_param_nz)));
      _checked_ptr_1<double> _ptr__1053_val(_1053_val ? _1053_val->raw() : nullptr,_1053_val ? _1053_val->size(0) : 0);
      afe_blocks->evaluate(xs,param_value,_1051_subi,_1052_subj,_1053_val);
      task_putafefijlist(_1051_subi,_1052_subj,_1053_val);
    }
  }
  {}
  if ((_1047_num_obj_param_nz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1054_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1047_num_obj_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1054_subi(_1054_subi ? _1054_subi->raw() : nullptr,_1054_subi ? _1054_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1055_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1047_num_obj_param_nz)));
      _checked_ptr_1<int32_t> _ptr__1055_subj(_1055_subj ? _1055_subj->raw() : nullptr,_1055_subj ? _1055_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1056_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1047_num_obj_param_nz)));
      _checked_ptr_1<double> _ptr__1056_val(_1056_val ? _1056_val->raw() : nullptr,_1056_val ? _1056_val->size(0) : 0);
      obj_blocks->evaluate(xs,param_value,_1054_subi,_1055_subj,_1056_val);
      task_putclist(_1055_subj,_1056_val);
    }
  }
  {}
}
// End mosek.fusion.Model.flush_parameters

// Begin mosek.fusion.Model.flushParameters
// Method mosek.fusion.Model.flushParameters @ bld/docker-win/final/default/src/fusion/Model.mbi:3841:6-61
void mosek::fusion::Model :: flushParameters() { mosek::fusion::p_Model::_get_impl(this)->flushParameters(); }
void mosek::fusion::p_Model::flushParameters()
{
  flush_parameters();
}
// End mosek.fusion.Model.flushParameters

// Begin mosek.fusion.Model.evaluate_parameterized
// Method mosek.fusion.Model.evaluate_parameterized @ bld/docker-win/final/default/src/fusion/Model.mbi:3772:6-3835:7
void mosek::fusion::p_Model::evaluate_parameterized(monty::rc_ptr< ::mosek::fusion::WorkStack > _1057_xs,int32_t _1058_numrow,std::shared_ptr< monty::ndarray< int32_t,1 > > _1059_rowptrb,std::shared_ptr< monty::ndarray< int32_t,1 > > _1060_rowptre,std::shared_ptr< monty::ndarray< int64_t,1 > > _1061_codenidx,std::shared_ptr< monty::ndarray< int32_t,1 > > _1062_codeptr,std::shared_ptr< monty::ndarray< int32_t,1 > > _1063_codesizes,std::shared_ptr< monty::ndarray< int32_t,1 > > _1064_code,std::shared_ptr< monty::ndarray< double,1 > > _1065_cconst,std::shared_ptr< monty::ndarray< int32_t,1 > > _1066_subj,std::shared_ptr< monty::ndarray< double,1 > > _1067_val)
{
  _checked_ptr_1<int32_t> _ptr__1059_rowptrb(_1059_rowptrb ? _1059_rowptrb->raw() : nullptr, _1059_rowptrb ? _1059_rowptrb->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1060_rowptre(_1060_rowptre ? _1060_rowptre->raw() : nullptr, _1060_rowptre ? _1060_rowptre->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__1061_codenidx(_1061_codenidx ? _1061_codenidx->raw() : nullptr, _1061_codenidx ? _1061_codenidx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1062_codeptr(_1062_codeptr ? _1062_codeptr->raw() : nullptr, _1062_codeptr ? _1062_codeptr->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1063_codesizes(_1063_codesizes ? _1063_codesizes->raw() : nullptr, _1063_codesizes ? _1063_codesizes->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1064_code(_1064_code ? _1064_code->raw() : nullptr, _1064_code ? _1064_code->size(0) : 0);
  _checked_ptr_1<double> _ptr__1065_cconst(_1065_cconst ? _1065_cconst->raw() : nullptr, _1065_cconst ? _1065_cconst->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1066_subj(_1066_subj ? _1066_subj->raw() : nullptr, _1066_subj ? _1066_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__1067_val(_1067_val ? _1067_val->raw() : nullptr, _1067_val ? _1067_val->size(0) : 0);
  int32_t _1068_stack = _1057_xs->allocf64((int)((_1064_code)->size(0)));
  int32_t _1069_stackp = (int)0;
  std::shared_ptr< monty::ndarray< double,1 > > _1070_xf64 = mosek::fusion::p_WorkStack::_get_impl(_1057_xs)->f64;
  _checked_ptr_1<double> _ptr__1070_xf64(_1070_xf64 ? _1070_xf64->raw() : nullptr,_1070_xf64 ? _1070_xf64->size(0) : 0);
  int32_t _1071_idx = (int)0;
  int32_t _9571_ = (int)0;
  int32_t _9572_ = _1058_numrow;
  for (int32_t _1072_i = _9571_; _1072_i < _9572_; ++_1072_i)
  {
    {
      int32_t _1073_k = _ptr__1062_codeptr[_1072_i];
      int32_t _9573_ = _ptr__1059_rowptrb[_1072_i];
      int32_t _9574_ = _ptr__1060_rowptre[_1072_i];
      for (int32_t _1074_j = _9573_; _1074_j < _9574_; ++_1074_j)
      {
        {
          int32_t _9575_ = (int)0;
          int32_t _9576_ = _ptr__1063_codesizes[_1074_j];
          for (int32_t _1075_l = _9575_; _1075_l < _9576_; ++_1075_l)
          {
            {
              if ((_ptr__1064_code[_1073_k] == 0))
              {
                {
                }
              }
              else
              {
                {
                  if ((_ptr__1064_code[_1073_k] == 1))
                  {
                    {
                      _ptr__1070_xf64[safe_add( _1068_stack,_1069_stackp )] = ((*param_value)((int32_t)_ptr__1065_cconst[_1073_k]));
                      ++ _1069_stackp;
                    }
                  }
                  else
                  {
                    {
                      if ((_ptr__1064_code[_1073_k] == 2))
                      {
                        {
                          _ptr__1070_xf64[safe_add( _1068_stack,_1069_stackp )] = _ptr__1065_cconst[_1073_k];
                          ++ _1069_stackp;
                        }
                      }
                      else
                      {
                        {
                          if ((_ptr__1064_code[_1073_k] == 3))
                          {
                            {
                              _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)2)] += _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)];
                              -- _1069_stackp;
                            }
                          }
                          else
                          {
                            {
                              if ((_ptr__1064_code[_1073_k] == 4))
                              {
                                {
                                  _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)] = (-_ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)]);
                                }
                              }
                              else
                              {
                                {
                                  if ((_ptr__1064_code[_1073_k] == 5))
                                  {
                                    {
                                      _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)2)] *= _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)];
                                      -- _1069_stackp;
                                    }
                                  }
                                  else
                                  {
                                    {
                                      if ((_ptr__1064_code[_1073_k] == 6))
                                      {
                                        {
                                          _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)] = (1.0 / _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)]);
                                        }
                                      }
                                      else
                                      {
                                        {
                                          if ((_ptr__1064_code[_1073_k] == 8))
                                          {
                                            {
                                              double _1076_v = 0.0;
                                              int32_t _9577_ = (int)0;
                                              int32_t _9578_ = (int32_t)_ptr__1065_cconst[_1073_k];
                                              for (int32_t _1077_i = _9577_; _1077_i < _9578_; ++_1077_i)
                                              {
                                                {
                                                  _1076_v += _ptr__1070_xf64[(safe_add( _1068_stack,_1069_stackp ) - (int)1)];
                                                  -- _1069_stackp;
                                                }
                                              }
                                              _ptr__1070_xf64[safe_add( _1068_stack,_1069_stackp )] = _1076_v;
                                              ++ _1069_stackp;
                                            }
                                          }
                                          else
                                          {
                                            {
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              ++ _1073_k;
            }
          }
          _ptr__1066_subj[_1071_idx] = (int32_t)_ptr__1061_codenidx[_1074_j];
          _ptr__1067_val[_1071_idx] = _ptr__1070_xf64[_1068_stack];
          _1069_stackp = (int)0;
          ++ _1071_idx;
        }
      }
    }
  }
  _1057_xs->popf64((int)((_1064_code)->size(0)));
}
// End mosek.fusion.Model.evaluate_parameterized

// Begin mosek.fusion.Model.flushSolutions
// Method mosek.fusion.Model.flushSolutions @ bld/docker-win/final/default/src/fusion/Model.mbi:3765:6-3770:7
void mosek::fusion::Model :: flushSolutions() { mosek::fusion::p_Model::_get_impl(this)->flushSolutions(); }
void mosek::fusion::p_Model::flushSolutions()
{
  flush_initsol(::mosek::fusion::SolutionType::Interior);
  flush_initsol(::mosek::fusion::SolutionType::Integer);
  flush_initsol(::mosek::fusion::SolutionType::Basic);
}
// End mosek.fusion.Model.flushSolutions

// Begin mosek.fusion.Model.flush_initsol
// Method mosek.fusion.Model.flush_initsol @ bld/docker-win/final/default/src/fusion/Model.mbi:3739:6-3761:7
void mosek::fusion::p_Model::flush_initsol(mosek::fusion::SolutionType _1078_which)
{
  if ((NULL != initsol_xx.get()))
  {
    {
      int32_t _1079_numvar = task_numvar();
      std::shared_ptr< monty::ndarray< double,1 > > _1080_xx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1079_numvar)));
      _checked_ptr_1<double> _ptr__1080_xx(_1080_xx ? _1080_xx->raw() : nullptr,_1080_xx ? _1080_xx->size(0) : 0);
      /* Try @ bld/docker-win/final/default/src/fusion/Model.mbi:3744:10-3750:11 */
      try
      {
        {
          monty::rc_ptr< ::mosek::fusion::SolutionStruct > _1082_sol = __mosek_2fusion_2Model__get_sol_cache(_1078_which,true);
          if ((NULL != mosek::fusion::p_SolutionStruct::_get_impl(_1082_sol)->xx.get()))
          {
            {
              int32_t _9579_;
              bool _9580_ = ((int)((mosek::fusion::p_SolutionStruct::_get_impl(_1082_sol)->xx)->size(0)) <= _1079_numvar);
              if (_9580_)
              {
                _9579_ = (int)((mosek::fusion::p_SolutionStruct::_get_impl(_1082_sol)->xx)->size(0));
              }
              else
              {
                _9579_ = _1079_numvar;
              }
              ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SolutionStruct::_get_impl(_1082_sol)->xx,(int)0,_1080_xx,(int)0,_9579_);
            }
          }
          {}
        }
      }
      catch (mosek::fusion::SolutionError _1081_e)
      {
        {
        }
      }
      int32_t _9581_;
      bool _9582_ = ((int)((initsol_xx)->size(0)) <= _1079_numvar);
      if (_9582_)
      {
        _9581_ = (int)((initsol_xx)->size(0));
      }
      else
      {
        _9581_ = _1079_numvar;
      }
      int32_t _1083_n = _9581_;
      int32_t _9583_ = (int)0;
      int32_t _9584_ = _1083_n;
      for (int32_t _1084_i = _9583_; _1084_i < _9584_; ++_1084_i)
      {
        {
          if (((*initsol_xx_flag)(_1084_i)))
          {
            {
              _ptr__1080_xx[_1084_i] = ((*initsol_xx)(_1084_i));
            }
          }
          {}
        }
      }
      _ptr__1080_xx[bfixidx] = 1.0;
      task_putxx_slice(_1078_which,(int)0,_1079_numvar,_1080_xx);
    }
  }
  {}
}
// End mosek.fusion.Model.flush_initsol

// Begin mosek.fusion.Model.getDualSolutionStatus
// Method mosek.fusion.Model.getDualSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3734:6-3737:7
mosek::fusion::SolutionStatus mosek::fusion::Model :: getDualSolutionStatus() { return mosek::fusion::p_Model::_get_impl(this)->getDualSolutionStatus(); }
mosek::fusion::SolutionStatus mosek::fusion::p_Model::getDualSolutionStatus()
{
  return _pubthis->getDualSolutionStatus(solutionptr);
}
// End mosek.fusion.Model.getDualSolutionStatus

// Begin mosek.fusion.Model.getProblemStatus
// Method mosek.fusion.Model.getProblemStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3728:6-3731:7
mosek::fusion::ProblemStatus mosek::fusion::Model :: getProblemStatus() { return mosek::fusion::p_Model::_get_impl(this)->getProblemStatus(); }
mosek::fusion::ProblemStatus mosek::fusion::p_Model::getProblemStatus()
{
  return _pubthis->getProblemStatus(solutionptr);
}
// End mosek.fusion.Model.getProblemStatus

// Begin mosek.fusion.Model.getPrimalSolutionStatus
// Method mosek.fusion.Model.getPrimalSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3721:6-3724:7
mosek::fusion::SolutionStatus mosek::fusion::Model :: getPrimalSolutionStatus() { return mosek::fusion::p_Model::_get_impl(this)->getPrimalSolutionStatus(); }
mosek::fusion::SolutionStatus mosek::fusion::p_Model::getPrimalSolutionStatus()
{
  return getPrimalSolutionStatus(solutionptr);
}
// End mosek.fusion.Model.getPrimalSolutionStatus

// Begin mosek.fusion.Model.dualObjValue
// Method mosek.fusion.Model.dualObjValue @ bld/docker-win/final/default/src/fusion/Model.mbi:3714:6-3717:7
double mosek::fusion::Model :: dualObjValue() { return mosek::fusion::p_Model::_get_impl(this)->dualObjValue(); }
double mosek::fusion::p_Model::dualObjValue()
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(::mosek::fusion::SolutionType::Default,false))->dobj;
}
// End mosek.fusion.Model.dualObjValue

// Begin mosek.fusion.Model.primalObjValue
// Method mosek.fusion.Model.primalObjValue @ bld/docker-win/final/default/src/fusion/Model.mbi:3708:6-3711:7
double mosek::fusion::Model :: primalObjValue() { return mosek::fusion::p_Model::_get_impl(this)->primalObjValue(); }
double mosek::fusion::p_Model::primalObjValue()
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(::mosek::fusion::SolutionType::Default,true))->pobj;
}
// End mosek.fusion.Model.primalObjValue

// Begin mosek.fusion.Model.get_sol_cache
// Method mosek.fusion.Model.get_sol_cache @ bld/docker-win/final/default/src/fusion/Model.mbi:3634:6-3705:7
monty::rc_ptr< ::mosek::fusion::SolutionStruct > mosek::fusion::p_Model::__mosek_2fusion_2Model__get_sol_cache(mosek::fusion::SolutionType _1085_which_,bool _1086_primal,bool _1087_nothrow)
{
  monty::rc_ptr< ::mosek::fusion::SolutionStruct > _1088_res = nullptr;
  mosek::fusion::SolutionType _1089_which = _1085_which_;
  if ((_1089_which == ::mosek::fusion::SolutionType::Default))
  {
    {
      _1089_which = solutionptr;
    }
  }
  {}
  if ((_1089_which == ::mosek::fusion::SolutionType::Default))
  {
    {
      if ((NULL != sol_itg.get()))
      {
        {
          _1088_res = sol_itg;
        }
      }
      else if((NULL != sol_bas.get()))
      {
        {
          _1088_res = sol_bas;
        }
      }
      else
      {
        {
          _1088_res = sol_itr;
        }
      }
    }
  }
  else if((_1089_which == ::mosek::fusion::SolutionType::Interior))
  {
    {
      _1088_res = sol_itr;
    }
  }
  else if((_1089_which == ::mosek::fusion::SolutionType::Basic))
  {
    {
      _1088_res = sol_bas;
    }
  }
  else if((_1089_which == ::mosek::fusion::SolutionType::Integer))
  {
    {
      _1088_res = sol_itg;
    }
  }
  {}
  if ((NULL == _1088_res.get()))
  {
    {
      throw ::mosek::fusion::SolutionError(std::string ("Solution not available"));
    }
  }
  else
  {
    {
      if ((_1087_nothrow || ((_1086_primal && _1088_res->isPrimalAcceptable(acceptable_sol)) || ((!_1086_primal) && _1088_res->isDualAcceptable(acceptable_sol)))))
      {
        {
          return _1088_res;
        }
      }
      else if(((_1088_res == sol_itg) && (!_1086_primal)))
      {
        {
          throw ::mosek::fusion::SolutionError(std::string ("Dual solution does not exists for mixed-integer problems."));
        }
      }
      else
      {
        {
          monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1090_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
          mosek::fusion::SolutionStatus _1091_solsta = mosek::fusion::p_SolutionStruct::_get_impl(_1088_res)->pstatus;
          mosek::fusion::ProblemStatus _1092_probsta = mosek::fusion::p_SolutionStruct::_get_impl(_1088_res)->probstatus;
          if ((!_1086_primal))
          {
            {
              _1091_solsta = mosek::fusion::p_SolutionStruct::_get_impl(_1088_res)->dstatus;
            }
          }
          {}
          _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Solution status is "));
          if ((_1091_solsta == ::mosek::fusion::SolutionStatus::Undefined))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Undefined"));
            }
          }
          else if((_1091_solsta == ::mosek::fusion::SolutionStatus::Unknown))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Unknown"));
            }
          }
          else if((_1091_solsta == ::mosek::fusion::SolutionStatus::Optimal))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Optimal"));
            }
          }
          else if((_1091_solsta == ::mosek::fusion::SolutionStatus::Feasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Feasible"));
            }
          }
          else if((_1091_solsta == ::mosek::fusion::SolutionStatus::Certificate))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Certificate"));
            }
          }
          else if((_1091_solsta == ::mosek::fusion::SolutionStatus::IllposedCert))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("IllposedCert"));
            }
          }
          {}
          _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" but "));
          if ((acceptable_sol == ::mosek::fusion::AccSolutionStatus::Anything))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Anything"));
            }
          }
          else if((acceptable_sol == ::mosek::fusion::AccSolutionStatus::Optimal))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Optimal"));
            }
          }
          else if((acceptable_sol == ::mosek::fusion::AccSolutionStatus::Feasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("at least Feasible"));
            }
          }
          else if((acceptable_sol == ::mosek::fusion::AccSolutionStatus::Certificate))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Certificate"));
            }
          }
          {}
          _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" is expected. Reason: Accessing "));
          if ((_1088_res == sol_itr))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("interior-point solution"));
            }
          }
          else if((_1088_res == sol_bas))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("basic solution"));
            }
          }
          else if((_1088_res == sol_itg))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("integer solution"));
            }
          }
          {}
          _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" whose problem status is "));
          if ((_1092_probsta == ::mosek::fusion::ProblemStatus::Unknown))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Unknown"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::PrimalAndDualFeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PrimalAndDualFeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::PrimalFeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PrimalFeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::DualFeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("DualFeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::PrimalInfeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PrimalInfeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::DualInfeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("DualInfeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::PrimalAndDualInfeasible))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PrimalAndDualInfeasible"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::IllPosed))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("IllPosed"));
            }
          }
          else if((_1092_probsta == ::mosek::fusion::ProblemStatus::PrimalInfeasibleOrUnbounded))
          {
            {
              _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PrimalInfeasibleOrUnbounded"));
            }
          }
          {}
          _1090_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("."));
          throw ::mosek::fusion::SolutionError(_1090_sb->toString());
        }
      }
    }
  }
}
// End mosek.fusion.Model.get_sol_cache

// Begin mosek.fusion.Model.get_sol_cache
// Method mosek.fusion.Model.get_sol_cache @ bld/docker-win/final/default/src/fusion/Model.mbi:3627:6-3632:7
monty::rc_ptr< ::mosek::fusion::SolutionStruct > mosek::fusion::p_Model::__mosek_2fusion_2Model__get_sol_cache(mosek::fusion::SolutionType _1093_which_,bool _1094_primal)
{
  return __mosek_2fusion_2Model__get_sol_cache(_1093_which_,_1094_primal,false);
}
// End mosek.fusion.Model.get_sol_cache

// Begin mosek.fusion.Model.setSolution_xx
// Method mosek.fusion.Model.setSolution_xx @ bld/docker-win/final/default/src/fusion/Model.mbi:3612:6-3620:7
void mosek::fusion::p_Model::setSolution_xx(std::shared_ptr< monty::ndarray< int32_t,1 > > _1095_subj,std::shared_ptr< monty::ndarray< double,1 > > _1096_val)
{
  _checked_ptr_1<int32_t> _ptr__1095_subj(_1095_subj ? _1095_subj->raw() : nullptr, _1095_subj ? _1095_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__1096_val(_1096_val ? _1096_val->raw() : nullptr, _1096_val ? _1096_val->size(0) : 0);
  ensure_initsol_xx();
  int32_t _9585_ = (int)0;
  int32_t _9586_ = (int)((_1095_subj)->size(0));
  for (int32_t _1097_i = _9585_; _1097_i < _9586_; ++_1097_i)
  {
    {
      ((*initsol_xx)(_ptr__1095_subj[_1097_i])) = _ptr__1096_val[_1097_i];
      ((*initsol_xx_flag)(_ptr__1095_subj[_1097_i])) = true;
    }
  }
}
// End mosek.fusion.Model.setSolution_xx

// Begin mosek.fusion.Model.ensure_initsol_xx
// Method mosek.fusion.Model.ensure_initsol_xx @ bld/docker-win/final/default/src/fusion/Model.mbi:3595:6-3610:7
void mosek::fusion::p_Model::ensure_initsol_xx()
{
  int32_t _1098_natvarmap_num = task_numvar();
  if ((NULL == initsol_xx.get()))
  {
    {
      initsol_xx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1098_natvarmap_num)));
      std::vector<bool> _9587_;
      for (int32_t _1099_i = (int)0, _9588_ = _1098_natvarmap_num; _1099_i < _9588_ ; ++_1099_i)
      {
        _9587_.push_back(false);
      }
      auto _9589_ = std::shared_ptr< monty::ndarray< bool,1 > >(new monty::ndarray< bool,1 >(monty::shape(_9587_.size()),_9587_.begin(),_9587_.end()));
      initsol_xx_flag = _9589_;
    }
  }
  else if(((int)((initsol_xx)->size(0)) < _1098_natvarmap_num))
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _1100_tmp = initsol_xx;
      _checked_ptr_1<double> _ptr__1100_tmp(_1100_tmp ? _1100_tmp->raw() : nullptr,_1100_tmp ? _1100_tmp->size(0) : 0);
      std::shared_ptr< monty::ndarray< bool,1 > > _1101_tmp_flag = initsol_xx_flag;
      initsol_xx = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1098_natvarmap_num)));
      initsol_xx_flag = std::shared_ptr< monty::ndarray< bool,1 > >(new monty::ndarray< bool,1 >(monty::shape(_1098_natvarmap_num)));
      ::mosek::fusion::Utils::Tools::arraycopy(_1100_tmp,(int)0,initsol_xx,(int)0,(int)((_1100_tmp)->size(0)));
      int32_t _9590_ = (int)0;
      int32_t _9591_ = (int)((_1100_tmp)->size(0));
      for (int32_t _1102_i = _9590_; _1102_i < _9591_; ++_1102_i)
      {
        {
          ((*initsol_xx_flag)(_1102_i)) = ((*_1101_tmp_flag)(_1102_i));
        }
      }
    }
  }
  {}
}
// End mosek.fusion.Model.ensure_initsol_xx

// Begin mosek.fusion.Model.getSolution_accptr
// Method mosek.fusion.Model.getSolution_accptr @ bld/docker-win/final/default/src/fusion/Model.mbi:3588:6-3592:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Model::getSolution_accptr(mosek::fusion::SolutionType _1103_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1103_which,true,true))->accptr;
}
// End mosek.fusion.Model.getSolution_accptr

// Begin mosek.fusion.Model.getSolution_accy
// Method mosek.fusion.Model.getSolution_accy @ bld/docker-win/final/default/src/fusion/Model.mbi:3582:6-3586:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_accy(mosek::fusion::SolutionType _1104_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1104_which,false))->accy;
}
// End mosek.fusion.Model.getSolution_accy

// Begin mosek.fusion.Model.getSolution_accx
// Method mosek.fusion.Model.getSolution_accx @ bld/docker-win/final/default/src/fusion/Model.mbi:3576:6-3580:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_accx(mosek::fusion::SolutionType _1105_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1105_which,true))->accx;
}
// End mosek.fusion.Model.getSolution_accx

// Begin mosek.fusion.Model.getSolution_bars
// Method mosek.fusion.Model.getSolution_bars @ bld/docker-win/final/default/src/fusion/Model.mbi:3569:6-3573:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_bars(mosek::fusion::SolutionType _1106_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1106_which,false))->bars;
}
// End mosek.fusion.Model.getSolution_bars

// Begin mosek.fusion.Model.getSolution_barx
// Method mosek.fusion.Model.getSolution_barx @ bld/docker-win/final/default/src/fusion/Model.mbi:3563:6-3567:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_barx(mosek::fusion::SolutionType _1107_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1107_which,true))->barx;
}
// End mosek.fusion.Model.getSolution_barx

// Begin mosek.fusion.Model.getSolution_y
// Method mosek.fusion.Model.getSolution_y @ bld/docker-win/final/default/src/fusion/Model.mbi:3557:6-3561:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_y(mosek::fusion::SolutionType _1108_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1108_which,false))->y;
}
// End mosek.fusion.Model.getSolution_y

// Begin mosek.fusion.Model.getSolution_xc
// Method mosek.fusion.Model.getSolution_xc @ bld/docker-win/final/default/src/fusion/Model.mbi:3551:6-3555:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_xc(mosek::fusion::SolutionType _1109_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1109_which,true))->xc;
}
// End mosek.fusion.Model.getSolution_xc

// Begin mosek.fusion.Model.getSolution_suc
// Method mosek.fusion.Model.getSolution_suc @ bld/docker-win/final/default/src/fusion/Model.mbi:3545:6-3549:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_suc(mosek::fusion::SolutionType _1110_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1110_which,false))->suc;
}
// End mosek.fusion.Model.getSolution_suc

// Begin mosek.fusion.Model.getSolution_slc
// Method mosek.fusion.Model.getSolution_slc @ bld/docker-win/final/default/src/fusion/Model.mbi:3539:6-3543:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_slc(mosek::fusion::SolutionType _1111_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1111_which,false))->slc;
}
// End mosek.fusion.Model.getSolution_slc

// Begin mosek.fusion.Model.getSolution_sux
// Method mosek.fusion.Model.getSolution_sux @ bld/docker-win/final/default/src/fusion/Model.mbi:3533:6-3537:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_sux(mosek::fusion::SolutionType _1112_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1112_which,false))->sux;
}
// End mosek.fusion.Model.getSolution_sux

// Begin mosek.fusion.Model.getSolution_slx
// Method mosek.fusion.Model.getSolution_slx @ bld/docker-win/final/default/src/fusion/Model.mbi:3527:6-3531:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_slx(mosek::fusion::SolutionType _1113_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1113_which,false))->slx;
}
// End mosek.fusion.Model.getSolution_slx

// Begin mosek.fusion.Model.getSolution_yx
// Method mosek.fusion.Model.getSolution_yx @ bld/docker-win/final/default/src/fusion/Model.mbi:3521:6-3525:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_yx(mosek::fusion::SolutionType _1114_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1114_which,false))->yx;
}
// End mosek.fusion.Model.getSolution_yx

// Begin mosek.fusion.Model.getSolution_xx
// Method mosek.fusion.Model.getSolution_xx @ bld/docker-win/final/default/src/fusion/Model.mbi:3516:6-3520:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getSolution_xx(mosek::fusion::SolutionType _1115_which)
{
  return mosek::fusion::p_SolutionStruct::_get_impl(__mosek_2fusion_2Model__get_sol_cache(_1115_which,true))->xx;
}
// End mosek.fusion.Model.getSolution_xx

// Begin mosek.fusion.Model.selectedSolution
// Method mosek.fusion.Model.selectedSolution @ bld/docker-win/final/default/src/fusion/Model.mbi:3511:6-3514:7
void mosek::fusion::Model :: selectedSolution(mosek::fusion::SolutionType _1116_soltype) { mosek::fusion::p_Model::_get_impl(this)->selectedSolution(_1116_soltype); }
void mosek::fusion::p_Model::selectedSolution(mosek::fusion::SolutionType _1116_soltype)
{
  solutionptr = _1116_soltype;
}
// End mosek.fusion.Model.selectedSolution

// Begin mosek.fusion.Model.getAcceptedSolutionStatus
// Method mosek.fusion.Model.getAcceptedSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3502:6-3505:7
mosek::fusion::AccSolutionStatus mosek::fusion::Model :: getAcceptedSolutionStatus() { return mosek::fusion::p_Model::_get_impl(this)->getAcceptedSolutionStatus(); }
mosek::fusion::AccSolutionStatus mosek::fusion::p_Model::getAcceptedSolutionStatus()
{
  return acceptable_sol;
}
// End mosek.fusion.Model.getAcceptedSolutionStatus

// Begin mosek.fusion.Model.acceptedSolutionStatus
// Method mosek.fusion.Model.acceptedSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3496:6-3499:7
void mosek::fusion::Model :: acceptedSolutionStatus(mosek::fusion::AccSolutionStatus _1117_what) { mosek::fusion::p_Model::_get_impl(this)->acceptedSolutionStatus(_1117_what); }
void mosek::fusion::p_Model::acceptedSolutionStatus(mosek::fusion::AccSolutionStatus _1117_what)
{
  acceptable_sol = _1117_what;
}
// End mosek.fusion.Model.acceptedSolutionStatus

// Begin mosek.fusion.Model.getProblemStatus
// Method mosek.fusion.Model.getProblemStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3465:6-3483:7
mosek::fusion::ProblemStatus mosek::fusion::Model :: getProblemStatus(mosek::fusion::SolutionType _1118_which) { return mosek::fusion::p_Model::_get_impl(this)->getProblemStatus(_1118_which); }
mosek::fusion::ProblemStatus mosek::fusion::p_Model::getProblemStatus(mosek::fusion::SolutionType _1118_which)
{
  monty::rc_ptr< ::mosek::fusion::SolutionStruct > _1119_res = nullptr;
  if ((_1118_which == ::mosek::fusion::SolutionType::Default))
  {
    {
      if ((NULL != sol_itg.get()))
      {
        {
          _1119_res = sol_itg;
        }
      }
      else if((NULL != sol_bas.get()))
      {
        {
          _1119_res = sol_bas;
        }
      }
      else
      {
        {
          _1119_res = sol_itr;
        }
      }
    }
  }
  else if((_1118_which == ::mosek::fusion::SolutionType::Interior))
  {
    {
      _1119_res = sol_itr;
    }
  }
  else if((_1118_which == ::mosek::fusion::SolutionType::Basic))
  {
    {
      _1119_res = sol_bas;
    }
  }
  else if((_1118_which == ::mosek::fusion::SolutionType::Integer))
  {
    {
      _1119_res = sol_itg;
    }
  }
  {}
  if ((NULL == _1119_res.get()))
  {
    {
      return ::mosek::fusion::ProblemStatus::Unknown;
    }
  }
  else
  {
    {
      return mosek::fusion::p_SolutionStruct::_get_impl(_1119_res)->probstatus;
    }
  }
}
// End mosek.fusion.Model.getProblemStatus

// Begin mosek.fusion.Model.getDualSolutionStatus
// Method mosek.fusion.Model.getDualSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3459:6-122
mosek::fusion::SolutionStatus mosek::fusion::Model :: getDualSolutionStatus(mosek::fusion::SolutionType _1120_which) { return mosek::fusion::p_Model::_get_impl(this)->getDualSolutionStatus(_1120_which); }
mosek::fusion::SolutionStatus mosek::fusion::p_Model::getDualSolutionStatus(mosek::fusion::SolutionType _1120_which)
{
  return getSolutionStatus(_1120_which,false);
}
// End mosek.fusion.Model.getDualSolutionStatus

// Begin mosek.fusion.Model.getPrimalSolutionStatus
// Method mosek.fusion.Model.getPrimalSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3453:6-128
mosek::fusion::SolutionStatus mosek::fusion::Model :: getPrimalSolutionStatus(mosek::fusion::SolutionType _1121_which) { return mosek::fusion::p_Model::_get_impl(this)->getPrimalSolutionStatus(_1121_which); }
mosek::fusion::SolutionStatus mosek::fusion::p_Model::getPrimalSolutionStatus(mosek::fusion::SolutionType _1121_which)
{
  return getSolutionStatus(_1121_which,true);
}
// End mosek.fusion.Model.getPrimalSolutionStatus

// Begin mosek.fusion.Model.getSolutionStatus
// Method mosek.fusion.Model.getSolutionStatus @ bld/docker-win/final/default/src/fusion/Model.mbi:3436:6-3447:7
mosek::fusion::SolutionStatus mosek::fusion::p_Model::getSolutionStatus(mosek::fusion::SolutionType _1122_which,bool _1123_primal)
{
  /* Try @ bld/docker-win/final/default/src/fusion/Model.mbi:3437:8-3446:9 */
  try
  {
    {
      monty::rc_ptr< ::mosek::fusion::SolutionStruct > _1125_sol = __mosek_2fusion_2Model__get_sol_cache(_1122_which,_1123_primal,true);
      if (_1123_primal)
      {
        {
          return mosek::fusion::p_SolutionStruct::_get_impl(_1125_sol)->pstatus;
        }
      }
      else
      {
        {
          return mosek::fusion::p_SolutionStruct::_get_impl(_1125_sol)->dstatus;
        }
      }
    }
  }
  catch (mosek::fusion::SolutionError _1124_e)
  {
    {
      return ::mosek::fusion::SolutionStatus::Undefined;
    }
  }
}
// End mosek.fusion.Model.getSolutionStatus

// Begin mosek.fusion.Model.update
// Method mosek.fusion.Model.update @ bld/docker-win/final/default/src/fusion/Model.mbi:3298:6-3432:7
void mosek::fusion::p_Model::update(std::shared_ptr< monty::ndarray< int32_t,1 > > _1126_conidxs,monty::rc_ptr< ::mosek::fusion::Expression > _1127_expr)
{
  _checked_ptr_1<int32_t> _ptr__1126_conidxs(_1126_conidxs ? _1126_conidxs->raw() : nullptr, _1126_conidxs ? _1126_conidxs->size(0) : 0);
  ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1127_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())->eval(ws,rs,xs);
  ws->pop_expr();
  int32_t _1128_nd = mosek::fusion::p_WorkStack::_get_impl(ws)->nd;
  int32_t _1129_shape_base = mosek::fusion::p_WorkStack::_get_impl(ws)->shape_base;
  int32_t _1130_nelem = mosek::fusion::p_WorkStack::_get_impl(ws)->nelem;
  int32_t _1131_nnz = mosek::fusion::p_WorkStack::_get_impl(ws)->nnz;
  bool _1132_hassp = mosek::fusion::p_WorkStack::_get_impl(ws)->hassp;
  int32_t _1133_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(ws)->ncodeatom;
  int32_t _1134_ptr_base = mosek::fusion::p_WorkStack::_get_impl(ws)->ptr_base;
  int32_t _1135_sp_base = mosek::fusion::p_WorkStack::_get_impl(ws)->sp_base;
  int32_t _1136_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(ws)->nidxs_base;
  int32_t _1137_cof_base = mosek::fusion::p_WorkStack::_get_impl(ws)->cof_base;
  int32_t _1138_code = mosek::fusion::p_WorkStack::_get_impl(ws)->code_base;
  int32_t _1139_codeptr = mosek::fusion::p_WorkStack::_get_impl(ws)->codeptr_base;
  int32_t _1140_cconst = mosek::fusion::p_WorkStack::_get_impl(ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1141_wi32 = mosek::fusion::p_WorkStack::_get_impl(ws)->i32;
  _checked_ptr_1<int32_t> _ptr__1141_wi32(_1141_wi32 ? _1141_wi32->raw() : nullptr,_1141_wi32 ? _1141_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1142_wi64 = mosek::fusion::p_WorkStack::_get_impl(ws)->i64;
  _checked_ptr_1<int64_t> _ptr__1142_wi64(_1142_wi64 ? _1142_wi64->raw() : nullptr,_1142_wi64 ? _1142_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1143_wf64 = mosek::fusion::p_WorkStack::_get_impl(ws)->f64;
  _checked_ptr_1<double> _ptr__1143_wf64(_1143_wf64 ? _1143_wf64->raw() : nullptr,_1143_wf64 ? _1143_wf64->size(0) : 0);
  int32_t _1144_num_lincon = (int)0;
  int32_t _9592_ = (int)0;
  int32_t _9593_ = _1130_nelem;
  for (int32_t _1145_i = _9592_; _1145_i < _9593_; ++_1145_i)
  {
    {
      if ((_ptr__1126_conidxs[_1145_i] >= (int)0))
      {
        {
          ++ _1144_num_lincon;
        }
      }
      {}
    }
  }
  int32_t _1146_num_concon = (_1130_nelem - _1144_num_lincon);
  if ((_1144_num_lincon == _1130_nelem))
  {
    {
      putarows(_1126_conidxs,ws,_1130_nelem,_1131_nnz,_1134_ptr_base,_1136_nidxs_base,_1137_cof_base);
      if ((_1133_ncodeatom > (int)0))
      {
        {
          con_blocks->replace_row_code(rs,_1126_conidxs,_1134_ptr_base,_1136_nidxs_base,_1139_codeptr,_1138_code,_1140_cconst);
        }
      }
      else
      {
        {
          con_blocks->clear_row_code(_1126_conidxs);
        }
      }
    }
  }
  else if((_1146_num_concon == _1130_nelem))
  {
    {
      std::vector<int32_t> _9594_;
      for (int32_t _1147_i = (int)0, _9595_ = _1130_nelem; _1147_i < _9595_ ; ++_1147_i)
      {
        _9594_.push_back((-safe_add( (int)1,_ptr__1126_conidxs[_1147_i] )));
      }
      auto _9596_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9594_.size()),_9594_.begin(),_9594_.end()));
      putfrows(_9596_,(int)0,ws,_1130_nelem,_1131_nnz,_1134_ptr_base,_1136_nidxs_base,_1137_cof_base);
      if ((_1133_ncodeatom > (int)0))
      {
        {
          std::vector<int32_t> _9597_;
          for (int32_t _1148_i = (int)0, _9598_ = _1130_nelem; _1148_i < _9598_ ; ++_1148_i)
          {
            _9597_.push_back((-safe_add( (int)1,_ptr__1126_conidxs[_1148_i] )));
          }
          auto _9599_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9597_.size()),_9597_.begin(),_9597_.end()));
          afe_blocks->replace_row_code(rs,_9599_,_1134_ptr_base,_1136_nidxs_base,_1139_codeptr,_1138_code,_1140_cconst);
        }
      }
      else
      {
        {
          std::vector<int32_t> _9600_;
          for (int32_t _1149_i = (int)0, _9601_ = _1130_nelem; _1149_i < _9601_ ; ++_1149_i)
          {
            _9600_.push_back((-safe_add( (int)1,_ptr__1126_conidxs[_1149_i] )));
          }
          auto _9602_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9600_.size()),_9600_.begin(),_9600_.end()));
          afe_blocks->clear_row_code(_9602_);
        }
      }
    }
  }
  else
  {
    {
      int32_t _1150_cncodeelm = (int)0;
      int32_t _1151_lncodeelm = (int)0;
      int32_t _1152_cnnz = (int)0;
      int32_t _1153_lnnz = (int)0;
      int32_t _9603_ = (int)0;
      int32_t _9604_ = _1130_nelem;
      for (int32_t _1154_i = _9603_; _1154_i < _9604_; ++_1154_i)
      {
        {
          if ((_ptr__1126_conidxs[_1154_i] >= (int)0))
          {
            {
              _1153_lnnz += (_ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1154_i ),(int)1 )] - _ptr__1141_wi32[safe_add( _1134_ptr_base,_1154_i )]);
            }
          }
          else
          {
            {
              _1152_cnnz += (_ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1154_i ),(int)1 )] - _ptr__1141_wi32[safe_add( _1134_ptr_base,_1154_i )]);
            }
          }
        }
      }
      int32_t _1155_lrowidx = xs->alloci32(_1144_num_lincon);
      int32_t _1156_crowidx = xs->alloci32(_1146_num_concon);
      int32_t _1157_lptr = xs->alloci32(safe_add( _1144_num_lincon,(int)1 ));
      int32_t _1158_cptr = xs->alloci32(safe_add( _1146_num_concon,(int)1 ));
      int32_t _1159_lnidxs = xs->alloci64(_1153_lnnz);
      int32_t _1160_cnidxs = xs->alloci64(_1152_cnnz);
      int32_t _1161_lcof = xs->allocf64(_1153_lnnz);
      int32_t _1162_ccof = xs->allocf64(_1152_cnnz);
      std::shared_ptr< monty::ndarray< double,1 > > _1163_xf64 = mosek::fusion::p_WorkStack::_get_impl(xs)->f64;
      _checked_ptr_1<double> _ptr__1163_xf64(_1163_xf64 ? _1163_xf64->raw() : nullptr,_1163_xf64 ? _1163_xf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1164_xi64 = mosek::fusion::p_WorkStack::_get_impl(xs)->i64;
      _checked_ptr_1<int64_t> _ptr__1164_xi64(_1164_xi64 ? _1164_xi64->raw() : nullptr,_1164_xi64 ? _1164_xi64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1165_xi32 = mosek::fusion::p_WorkStack::_get_impl(xs)->i32;
      _checked_ptr_1<int32_t> _ptr__1165_xi32(_1165_xi32 ? _1165_xi32->raw() : nullptr,_1165_xi32 ? _1165_xi32->size(0) : 0);
      _ptr__1165_xi32[_1157_lptr] = (int)0;
      _ptr__1165_xi32[_1158_cptr] = (int)0;
      int32_t _1166_ci = (int)0;
      int32_t _1167_li = (int)0;
      int32_t _1168_cnzi = (int)0;
      int32_t _1169_lnzi = (int)0;
      int32_t _9605_ = (int)0;
      int32_t _9606_ = _1130_nelem;
      for (int32_t _1170_i = _9605_; _1170_i < _9606_; ++_1170_i)
      {
        {
          int32_t _1171_pb = _ptr__1141_wi32[safe_add( _1134_ptr_base,_1170_i )];
          int32_t _1172_pe = _ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1170_i ),(int)1 )];
          if ((_ptr__1126_conidxs[_1170_i] >= (int)0))
          {
            {
              ::mosek::fusion::Utils::Tools::arraycopy(_1142_wi64,safe_add( _1136_nidxs_base,_1171_pb ),_1164_xi64,safe_add( _1159_lnidxs,_1169_lnzi ),(_1172_pe - _1171_pb));
              ::mosek::fusion::Utils::Tools::arraycopy(_1143_wf64,safe_add( _1137_cof_base,_1171_pb ),_1163_xf64,safe_add( _1161_lcof,_1169_lnzi ),(_1172_pe - _1171_pb));
              _1169_lnzi += (_1172_pe - _1171_pb);
              _ptr__1165_xi32[safe_add( _1155_lrowidx,_1167_li )] = _ptr__1126_conidxs[_1170_i];
              _ptr__1165_xi32[safe_add( safe_add( _1157_lptr,_1167_li ),(int)1 )] = _1169_lnzi;
              ++ _1167_li;
            }
          }
          else
          {
            {
              ::mosek::fusion::Utils::Tools::arraycopy(_1142_wi64,safe_add( _1136_nidxs_base,_1171_pb ),_1164_xi64,safe_add( _1160_cnidxs,_1168_cnzi ),(_1172_pe - _1171_pb));
              ::mosek::fusion::Utils::Tools::arraycopy(_1143_wf64,safe_add( _1137_cof_base,_1171_pb ),_1163_xf64,safe_add( _1162_ccof,_1168_cnzi ),(_1172_pe - _1171_pb));
              _1168_cnzi += (_1172_pe - _1171_pb);
              _ptr__1165_xi32[safe_add( _1156_crowidx,_1166_ci )] = (-safe_add( (int)1,_ptr__1126_conidxs[_1170_i] ));
              _ptr__1165_xi32[safe_add( safe_add( _1158_cptr,_1166_ci ),(int)1 )] = _1168_cnzi;
              ++ _1166_ci;
            }
          }
        }
      }
      std::vector<int32_t> _9607_;
      for (int32_t _1173_i = (int)0, _9608_ = _1144_num_lincon; _1173_i < _9608_ ; ++_1173_i)
      {
        _9607_.push_back(_ptr__1165_xi32[safe_add( _1155_lrowidx,_1173_i )]);
      }
      auto _9609_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9607_.size()),_9607_.begin(),_9607_.end()));
      putarows(_9609_,xs,_1144_num_lincon,_1153_lnnz,_1157_lptr,_1159_lnidxs,_1161_lcof);
      putfrows(_1165_xi32,_1156_crowidx,xs,_1146_num_concon,_1152_cnnz,_1158_cptr,_1160_cnidxs,_1162_ccof);
      if ((_1133_ncodeatom > (int)0))
      {
        {
          int32_t _9610_ = (int)0;
          int32_t _9611_ = _1130_nelem;
          for (int32_t _1174_i = _9610_; _1174_i < _9611_; ++_1174_i)
          {
            {
              if ((_ptr__1126_conidxs[_1174_i] >= (int)0))
              {
                {
                  _1151_lncodeelm += (_ptr__1141_wi32[safe_add( _1139_codeptr,_ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1174_i ),(int)1 )] )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_ptr__1141_wi32[safe_add( _1134_ptr_base,_1174_i )] )]);
                }
              }
              else
              {
                {
                  _1150_cncodeelm += (_ptr__1141_wi32[safe_add( _1139_codeptr,_ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1174_i ),(int)1 )] )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_ptr__1141_wi32[safe_add( _1134_ptr_base,_1174_i )] )]);
                }
              }
            }
          }
          int32_t _1175_lcodeptr = xs->alloci32(safe_add( _1153_lnnz,(int)1 ));
          int32_t _1176_ccodeptr = xs->alloci32(safe_add( _1152_cnnz,(int)1 ));
          int32_t _1177_lcode = xs->alloci32(_1151_lncodeelm);
          int32_t _1178_ccode = xs->alloci32(_1150_cncodeelm);
          int32_t _1179_lcconst = xs->allocf64(_1151_lncodeelm);
          int32_t _1180_ccconst = xs->allocf64(_1150_cncodeelm);
          _ptr__1165_xi32[_1175_lcodeptr] = (int)0;
          _ptr__1165_xi32[_1176_ccodeptr] = (int)0;
          int32_t _1181_ccodei = (int)0;
          int32_t _1182_lcodei = (int)0;
          int32_t _1183_rnzi = (int)0;
          int32_t _1184_lnzi = (int)0;
          int32_t _9612_ = (int)0;
          int32_t _9613_ = _1130_nelem;
          for (int32_t _1185_i = _9612_; _1185_i < _9613_; ++_1185_i)
          {
            {
              int32_t _1186_pb = _ptr__1141_wi32[safe_add( _1134_ptr_base,_1185_i )];
              int32_t _1187_pe = _ptr__1141_wi32[safe_add( safe_add( _1134_ptr_base,_1185_i ),(int)1 )];
              if ((_ptr__1126_conidxs[_1185_i] >= (int)0))
              {
                {
                  ::mosek::fusion::Utils::Tools::arraycopy(_1141_wi32,safe_add( _1138_code,_ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )] ),_1165_xi32,safe_add( _1177_lcode,_1182_lcodei ),(_ptr__1141_wi32[safe_add( _1139_codeptr,_1187_pe )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )]));
                  ::mosek::fusion::Utils::Tools::arraycopy(_1143_wf64,safe_add( _1140_cconst,_ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )] ),_1163_xf64,safe_add( _1179_lcconst,_1182_lcodei ),(_ptr__1141_wi32[safe_add( _1139_codeptr,_1187_pe )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )]));
                  int32_t _9614_ = _1186_pb;
                  int32_t _9615_ = _1187_pe;
                  for (int32_t _1188_j = _9614_; _1188_j < _9615_; ++_1188_j)
                  {
                    {
                      _1182_lcodei += (_ptr__1141_wi32[safe_add( safe_add( _1139_codeptr,_1188_j ),(int)1 )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1188_j )]);
                      _ptr__1165_xi32[safe_add( safe_add( _1175_lcodeptr,_1184_lnzi ),(int)1 )] = _1182_lcodei;
                      ++ _1184_lnzi;
                    }
                  }
                }
              }
              else
              {
                {
                  ::mosek::fusion::Utils::Tools::arraycopy(_1141_wi32,safe_add( _1138_code,_ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )] ),_1165_xi32,safe_add( _1178_ccode,_1181_ccodei ),(_ptr__1141_wi32[safe_add( _1139_codeptr,_1187_pe )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )]));
                  ::mosek::fusion::Utils::Tools::arraycopy(_1143_wf64,safe_add( _1140_cconst,_ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )] ),_1163_xf64,safe_add( _1180_ccconst,_1181_ccodei ),(_ptr__1141_wi32[safe_add( _1139_codeptr,_1187_pe )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1186_pb )]));
                  int32_t _9616_ = _1186_pb;
                  int32_t _9617_ = _1187_pe;
                  for (int32_t _1189_j = _9616_; _1189_j < _9617_; ++_1189_j)
                  {
                    {
                      _1181_ccodei += (_ptr__1141_wi32[safe_add( safe_add( _1139_codeptr,_1189_j ),(int)1 )] - _ptr__1141_wi32[safe_add( _1139_codeptr,_1189_j )]);
                      _ptr__1165_xi32[safe_add( safe_add( _1176_ccodeptr,_1168_cnzi ),(int)1 )] = _1181_ccodei;
                      ++ _1168_cnzi;
                    }
                  }
                }
              }
            }
          }
          std::vector<int32_t> _9618_;
          for (int32_t _1190_i = (int)0, _9619_ = _1144_num_lincon; _1190_i < _9619_ ; ++_1190_i)
          {
            _9618_.push_back(_ptr__1165_xi32[safe_add( _1155_lrowidx,_1190_i )]);
          }
          auto _9620_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9618_.size()),_9618_.begin(),_9618_.end()));
          con_blocks->replace_row_code(xs,_9620_,_1157_lptr,_1159_lnidxs,_1175_lcodeptr,_1177_lcode,_1179_lcconst);
          std::vector<int32_t> _9621_;
          for (int32_t _1191_i = (int)0, _9622_ = _1146_num_concon; _1191_i < _9622_ ; ++_1191_i)
          {
            _9621_.push_back((int32_t)_ptr__1164_xi64[safe_add( _1156_crowidx,_1191_i )]);
          }
          auto _9623_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9621_.size()),_9621_.begin(),_9621_.end()));
          afe_blocks->replace_row_code(xs,_9623_,_1158_cptr,_1160_cnidxs,_1176_ccodeptr,_1178_ccode,_1180_ccconst);
        }
      }
      else
      {
        {
          std::vector<int32_t> _9624_;
          for (int32_t _1192_i = (int)0, _9625_ = _1144_num_lincon; _1192_i < _9625_ ; ++_1192_i)
          {
            _9624_.push_back(_ptr__1165_xi32[safe_add( _1155_lrowidx,_1192_i )]);
          }
          auto _9626_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9624_.size()),_9624_.begin(),_9624_.end()));
          con_blocks->clear_row_code(_9626_);
          std::vector<int32_t> _9627_;
          for (int32_t _1193_i = (int)0, _9628_ = _1146_num_concon; _1193_i < _9628_ ; ++_1193_i)
          {
            _9627_.push_back((int32_t)_ptr__1164_xi64[safe_add( _1156_crowidx,_1193_i )]);
          }
          auto _9629_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9627_.size()),_9627_.begin(),_9627_.end()));
          afe_blocks->clear_row_code(_9629_);
        }
      }
    }
  }
  xs->clear();
}
// End mosek.fusion.Model.update

// Begin mosek.fusion.Model.update
// Method mosek.fusion.Model.update @ bld/docker-win/final/default/src/fusion/Model.mbi:3083:6-3294:7
void mosek::fusion::p_Model::update(std::shared_ptr< monty::ndarray< int32_t,1 > > _1194_conidxs,monty::rc_ptr< ::mosek::fusion::Expression > _1195_expr,std::shared_ptr< monty::ndarray< int32_t,1 > > _1196_varidxs)
{
  _checked_ptr_1<int32_t> _ptr__1194_conidxs(_1194_conidxs ? _1194_conidxs->raw() : nullptr, _1194_conidxs ? _1194_conidxs->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__1196_varidxs(_1196_varidxs ? _1196_varidxs->raw() : nullptr, _1196_varidxs ? _1196_varidxs->size(0) : 0);
  int32_t _9630_ = (int)0;
  int32_t _9631_ = (int)((_1194_conidxs)->size(0));
  for (int32_t _1197_i = _9630_; _1197_i < _9631_; ++_1197_i)
  {
    {
      if (((_ptr__1194_conidxs[_1197_i] >= (int)0) && con_blocks->row_is_parameterized(_1197_i)))
      {
        {
          throw ::mosek::fusion::UpdateError(std::string ("Cannot update parameterized constraint"));
        }
      }
      else if(((_ptr__1194_conidxs[_1197_i] < (int)0) && con_blocks->row_is_parameterized((-safe_add( _1197_i,(int)1 )))))
      {
        {
          throw ::mosek::fusion::UpdateError(std::string ("Cannot update parameterized constraint"));
        }
      }
      {}
    }
  }
  ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1195_expr)).as<::mosek::fusion::Expression>())->eval(ws,rs,xs);
  ws->pop_expr();
  int32_t _1198_nd = mosek::fusion::p_WorkStack::_get_impl(ws)->nd;
  int32_t _1199_nelem = mosek::fusion::p_WorkStack::_get_impl(ws)->nelem;
  int32_t _1200_nnz = mosek::fusion::p_WorkStack::_get_impl(ws)->nnz;
  bool _1201_hassp = mosek::fusion::p_WorkStack::_get_impl(ws)->hassp;
  int32_t _1202_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(ws)->ncodeatom;
  int32_t _1203_shape_base = mosek::fusion::p_WorkStack::_get_impl(ws)->shape_base;
  int32_t _1204_ptr_base = mosek::fusion::p_WorkStack::_get_impl(ws)->ptr_base;
  int32_t _1205_sp_base = mosek::fusion::p_WorkStack::_get_impl(ws)->sp_base;
  int32_t _1206_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(ws)->nidxs_base;
  int32_t _1207_cof_base = mosek::fusion::p_WorkStack::_get_impl(ws)->cof_base;
  int32_t _1208_code = mosek::fusion::p_WorkStack::_get_impl(ws)->code_base;
  int32_t _1209_codeptr = mosek::fusion::p_WorkStack::_get_impl(ws)->codeptr_base;
  int32_t _1210_cconst = mosek::fusion::p_WorkStack::_get_impl(ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1211_wi32 = mosek::fusion::p_WorkStack::_get_impl(ws)->i32;
  _checked_ptr_1<int32_t> _ptr__1211_wi32(_1211_wi32 ? _1211_wi32->raw() : nullptr,_1211_wi32 ? _1211_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1212_wi64 = mosek::fusion::p_WorkStack::_get_impl(ws)->i64;
  _checked_ptr_1<int64_t> _ptr__1212_wi64(_1212_wi64 ? _1212_wi64->raw() : nullptr,_1212_wi64 ? _1212_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1213_wf64 = mosek::fusion::p_WorkStack::_get_impl(ws)->f64;
  _checked_ptr_1<double> _ptr__1213_wf64(_1213_wf64 ? _1213_wf64->raw() : nullptr,_1213_wf64 ? _1213_wf64->size(0) : 0);
  int32_t _1214_num_lincon = (int)0;
  int32_t _9632_ = (int)0;
  int32_t _9633_ = _1199_nelem;
  for (int32_t _1215_i = _9632_; _1215_i < _9633_; ++_1215_i)
  {
    {
      if ((_ptr__1194_conidxs[_1215_i] >= (int)0))
      {
        {
          ++ _1214_num_lincon;
        }
      }
      {}
    }
  }
  int32_t _1216_num_concon = (_1199_nelem - _1214_num_lincon);
  if (((_1214_num_lincon == _1199_nelem) || (_1216_num_concon == _1199_nelem)))
  {
    {
      int32_t _1217_N = safe_mul( (int)((_1194_conidxs)->size(0)),(int)((_1196_varidxs)->size(0)) );
      std::shared_ptr< monty::ndarray< double,1 > > _1218_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1217_N)));
      _checked_ptr_1<double> _ptr__1218_cof(_1218_cof ? _1218_cof->raw() : nullptr,_1218_cof ? _1218_cof->size(0) : 0);
      int32_t _1219_nzi = (int)0;
      int32_t _9634_ = (int)0;
      int32_t _9635_ = _1199_nelem;
      for (int32_t _1220_i = _9634_; _1220_i < _9635_; ++_1220_i)
      {
        {
          int32_t _1221_p0 = _ptr__1211_wi32[safe_add( _1204_ptr_base,_1220_i )];
          int32_t _1222_p1 = _ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1220_i ),(int)1 )];
          int32_t _1223_p = _1221_p0;
          int32_t _1224_l = (int)0;
          while ( ((_1224_l < (int)((_1196_varidxs)->size(0))) && (_1223_p < _1222_p1)) )
          {
            {
              if ((_ptr__1196_varidxs[_1224_l] < _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1223_p )]))
              {
                {
                  ++ _1224_l;
                }
              }
              else if((_ptr__1196_varidxs[_1224_l] > _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1223_p )]))
              {
                {
                  ++ _1223_p;
                }
              }
              else
              {
                {
                  _ptr__1218_cof[safe_add( _1219_nzi,_1224_l )] = _ptr__1213_wf64[safe_add( _1207_cof_base,_1223_p )];
                  ++ _1224_l;
                  ++ _1223_p;
                }
              }
            }
          }
          _1219_nzi += (int)((_1196_varidxs)->size(0));
        }
      }
      std::vector<int32_t> _9636_;
      for (int32_t _1226_i = (int)0, _9637_ = _1199_nelem; _1226_i < _9637_ ; ++_1226_i)
      {
        for (int32_t _1227_j = (int)0, _9638_ = (int)((_1196_varidxs)->size(0)); _1227_j < _9638_ ; ++_1227_j)
        {
          _9636_.push_back(_ptr__1196_varidxs[_1227_j]);
        }
      }
      auto _9639_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9636_.size()),_9636_.begin(),_9636_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1225_subj = _9639_;
      _checked_ptr_1<int32_t> _ptr__1225_subj(_1225_subj ? _1225_subj->raw() : nullptr,_1225_subj ? _1225_subj->size(0) : 0);
      if ((_1214_num_lincon == _1199_nelem))
      {
        {
          std::vector<int32_t> _9640_;
          for (int32_t _1229_i = (int)0, _9641_ = _1199_nelem; _1229_i < _9641_ ; ++_1229_i)
          {
            for (int32_t _1230_j = (int)0, _9642_ = (int)((_1196_varidxs)->size(0)); _1230_j < _9642_ ; ++_1230_j)
            {
              _9640_.push_back(_ptr__1194_conidxs[_1229_i]);
            }
          }
          auto _9643_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9640_.size()),_9640_.begin(),_9640_.end()));
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1228_subi = _9643_;
          _checked_ptr_1<int32_t> _ptr__1228_subi(_1228_subi ? _1228_subi->raw() : nullptr,_1228_subi ? _1228_subi->size(0) : 0);
          task_putaijlist(_1228_subi,_1225_subj,_1218_cof,(int64_t)(_1219_nzi));
          if ((_1202_ncodeatom > (int)0))
          {
            {
              con_blocks->replace_row_code(rs,_1194_conidxs,_1204_ptr_base,_1206_nidxs_base,_1209_codeptr,_1208_code,_1210_cconst);
            }
          }
          {}
        }
      }
      else
      {
        {
          std::vector<int32_t> _9644_;
          for (int32_t _1232_i = (int)0, _9645_ = _1199_nelem; _1232_i < _9645_ ; ++_1232_i)
          {
            for (int32_t _1233_j = (int)0, _9646_ = (int)((_1196_varidxs)->size(0)); _1233_j < _9646_ ; ++_1233_j)
            {
              _9644_.push_back((-safe_add( _ptr__1194_conidxs[_1232_i],(int)1 )));
            }
          }
          auto _9647_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9644_.size()),_9644_.begin(),_9644_.end()));
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1231_subi = _9647_;
          _checked_ptr_1<int32_t> _ptr__1231_subi(_1231_subi ? _1231_subi->raw() : nullptr,_1231_subi ? _1231_subi->size(0) : 0);
          task_putafefijlist(_1231_subi,_1225_subj,_1218_cof);
          if ((_1202_ncodeatom > (int)0))
          {
            {
              std::vector<int32_t> _9648_;
              for (int32_t _1234_i = (int)0, _9649_ = _1199_nelem; _1234_i < _9649_ ; ++_1234_i)
              {
                _9648_.push_back((-safe_add( (int)1,_ptr__1194_conidxs[_1234_i] )));
              }
              auto _9650_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9648_.size()),_9648_.begin(),_9648_.end()));
              afe_blocks->replace_row_code(rs,_9650_,_1204_ptr_base,_1206_nidxs_base,_1209_codeptr,_1208_code,_1210_cconst);
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      int32_t _1235_cN = safe_mul( _1216_num_concon,(int)((_1196_varidxs)->size(0)) );
      int32_t _1236_lN = safe_mul( _1214_num_lincon,(int)((_1196_varidxs)->size(0)) );
      std::shared_ptr< monty::ndarray< double,1 > > _1237_lcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1236_lN)));
      _checked_ptr_1<double> _ptr__1237_lcof(_1237_lcof ? _1237_lcof->raw() : nullptr,_1237_lcof ? _1237_lcof->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1238_ccof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1235_cN)));
      _checked_ptr_1<double> _ptr__1238_ccof(_1238_ccof ? _1238_ccof->raw() : nullptr,_1238_ccof ? _1238_ccof->size(0) : 0);
      std::vector<int32_t> _9651_;
      for (int32_t _1240_i = (int)0, _9652_ = _1214_num_lincon; _1240_i < _9652_ ; ++_1240_i)
      {
        for (int32_t _1241_j = (int)0, _9653_ = (int)((_1196_varidxs)->size(0)); _1241_j < _9653_ ; ++_1241_j)
        {
          _9651_.push_back(_ptr__1196_varidxs[_1241_j]);
        }
      }
      auto _9654_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9651_.size()),_9651_.begin(),_9651_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1239_lsubj = _9654_;
      _checked_ptr_1<int32_t> _ptr__1239_lsubj(_1239_lsubj ? _1239_lsubj->raw() : nullptr,_1239_lsubj ? _1239_lsubj->size(0) : 0);
      std::vector<int32_t> _9655_;
      for (int32_t _1243_i = (int)0, _9656_ = _1216_num_concon; _1243_i < _9656_ ; ++_1243_i)
      {
        for (int32_t _1244_j = (int)0, _9657_ = (int)((_1196_varidxs)->size(0)); _1244_j < _9657_ ; ++_1244_j)
        {
          _9655_.push_back(_ptr__1196_varidxs[_1244_j]);
        }
      }
      auto _9658_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9655_.size()),_9655_.begin(),_9655_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1242_csubj = _9658_;
      _checked_ptr_1<int32_t> _ptr__1242_csubj(_1242_csubj ? _1242_csubj->raw() : nullptr,_1242_csubj ? _1242_csubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1245_lsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1214_num_lincon)));
      _checked_ptr_1<int32_t> _ptr__1245_lsubi(_1245_lsubi ? _1245_lsubi->raw() : nullptr,_1245_lsubi ? _1245_lsubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1246_csubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1216_num_concon)));
      _checked_ptr_1<int32_t> _ptr__1246_csubi(_1246_csubi ? _1246_csubi->raw() : nullptr,_1246_csubi ? _1246_csubi->size(0) : 0);
      int32_t _1247_crowi = (int)0;
      int32_t _1248_lrowi = (int)0;
      int32_t _1249_cncodeelm = (int)0;
      int32_t _1250_lncodeelm = (int)0;
      int32_t _1251_cnnz = (int)0;
      int32_t _1252_lnnz = (int)0;
      int32_t _9659_ = (int)0;
      int32_t _9660_ = _1199_nelem;
      for (int32_t _1253_i = _9659_; _1253_i < _9660_; ++_1253_i)
      {
        {
          int32_t _1254_p0 = _ptr__1211_wi32[safe_add( _1204_ptr_base,_1253_i )];
          int32_t _1255_p1 = _ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1253_i ),(int)1 )];
          int32_t _1256_p = _1254_p0;
          int32_t _1257_l = (int)0;
          if ((_ptr__1194_conidxs[_1253_i] >= (int)0))
          {
            {
              while ( ((_1257_l < (int)((_1196_varidxs)->size(0))) && (_1256_p < _1255_p1)) )
              {
                {
                  if ((_ptr__1196_varidxs[_1257_l] < _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1256_p )]))
                  {
                    {
                      ++ _1257_l;
                    }
                  }
                  else if((_ptr__1196_varidxs[_1257_l] > _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1256_p )]))
                  {
                    {
                      ++ _1256_p;
                    }
                  }
                  else
                  {
                    {
                      _ptr__1237_lcof[safe_add( _1252_lnnz,_1257_l )] = _ptr__1213_wf64[safe_add( _1207_cof_base,_1256_p )];
                      ++ _1257_l;
                      ++ _1256_p;
                    }
                  }
                }
              }
              int32_t _9661_ = (int)0;
              int32_t _9662_ = (int)((_1196_varidxs)->size(0));
              for (int32_t _1258_j = _9661_; _1258_j < _9662_; ++_1258_j)
              {
                {
                  _ptr__1245_lsubi[safe_add( _1252_lnnz,_1258_j )] = _ptr__1194_conidxs[_1253_i];
                }
              }
              _1252_lnnz += (int)((_1196_varidxs)->size(0));
            }
          }
          else
          {
            {
              while ( ((_1257_l < (int)((_1196_varidxs)->size(0))) && (_1256_p < _1255_p1)) )
              {
                {
                  if ((_ptr__1196_varidxs[_1257_l] < _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1256_p )]))
                  {
                    {
                      ++ _1257_l;
                    }
                  }
                  else if((_ptr__1196_varidxs[_1257_l] > _ptr__1212_wi64[safe_add( _1206_nidxs_base,_1256_p )]))
                  {
                    {
                      ++ _1256_p;
                    }
                  }
                  else
                  {
                    {
                      _ptr__1238_ccof[safe_add( _1251_cnnz,_1257_l )] = _ptr__1213_wf64[safe_add( _1207_cof_base,_1256_p )];
                      ++ _1257_l;
                      ++ _1256_p;
                    }
                  }
                }
              }
              int32_t _9663_ = (int)0;
              int32_t _9664_ = (int)((_1196_varidxs)->size(0));
              for (int32_t _1259_j = _9663_; _1259_j < _9664_; ++_1259_j)
              {
                {
                  _ptr__1246_csubi[safe_add( _1251_cnnz,_1259_j )] = (-safe_add( (int)1,_ptr__1194_conidxs[_1253_i] ));
                }
              }
              _1251_cnnz += (int)((_1196_varidxs)->size(0));
            }
          }
        }
      }
      task_putaijlist(_1245_lsubi,_1239_lsubj,_1237_lcof,(int64_t)(_1252_lnnz));
      task_putafefijlist(_1246_csubi,_1242_csubj,_1238_ccof);
      if ((_1202_ncodeatom > (int)0))
      {
        {
          int32_t _9665_ = (int)0;
          int32_t _9666_ = _1199_nelem;
          for (int32_t _1260_i = _9665_; _1260_i < _9666_; ++_1260_i)
          {
            {
              if ((_ptr__1194_conidxs[_1260_i] >= (int)0))
              {
                {
                  _1252_lnnz += (_ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1260_i ),(int)1 )] - _ptr__1211_wi32[safe_add( _1204_ptr_base,_1260_i )]);
                }
              }
              else
              {
                {
                  _1251_cnnz += (_ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1260_i ),(int)1 )] - _ptr__1211_wi32[safe_add( _1204_ptr_base,_1260_i )]);
                }
              }
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1261_lrowidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1214_num_lincon)));
          _checked_ptr_1<int32_t> _ptr__1261_lrowidx(_1261_lrowidx ? _1261_lrowidx->raw() : nullptr,_1261_lrowidx ? _1261_lrowidx->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1262_crowidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1216_num_concon)));
          _checked_ptr_1<int32_t> _ptr__1262_crowidx(_1262_crowidx ? _1262_crowidx->raw() : nullptr,_1262_crowidx ? _1262_crowidx->size(0) : 0);
          int32_t _1263_lptr = xs->alloci32(safe_add( _1214_num_lincon,(int)1 ));
          int32_t _1264_cptr = xs->alloci32(safe_add( _1216_num_concon,(int)1 ));
          int32_t _1265_lnidxs = xs->alloci64(_1252_lnnz);
          int32_t _1266_cnidxs = xs->alloci64(_1251_cnnz);
          std::shared_ptr< monty::ndarray< double,1 > > _1267_xf64 = mosek::fusion::p_WorkStack::_get_impl(xs)->f64;
          _checked_ptr_1<double> _ptr__1267_xf64(_1267_xf64 ? _1267_xf64->raw() : nullptr,_1267_xf64 ? _1267_xf64->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _1268_xi64 = mosek::fusion::p_WorkStack::_get_impl(xs)->i64;
          _checked_ptr_1<int64_t> _ptr__1268_xi64(_1268_xi64 ? _1268_xi64->raw() : nullptr,_1268_xi64 ? _1268_xi64->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1269_xi32 = mosek::fusion::p_WorkStack::_get_impl(xs)->i32;
          _checked_ptr_1<int32_t> _ptr__1269_xi32(_1269_xi32 ? _1269_xi32->raw() : nullptr,_1269_xi32 ? _1269_xi32->size(0) : 0);
          _ptr__1269_xi32[_1263_lptr] = (int)0;
          _ptr__1269_xi32[_1264_cptr] = (int)0;
          int32_t _1270_ci = (int)0;
          int32_t _1271_li = (int)0;
          int32_t _1272_cnzi = (int)0;
          int32_t _1273_lnzi = (int)0;
          int32_t _9667_ = (int)0;
          int32_t _9668_ = _1199_nelem;
          for (int32_t _1274_i = _9667_; _1274_i < _9668_; ++_1274_i)
          {
            {
              int32_t _1275_pb = _ptr__1211_wi32[safe_add( _1204_ptr_base,_1274_i )];
              int32_t _1276_pe = _ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1274_i ),(int)1 )];
              if ((_ptr__1194_conidxs[_1274_i] >= (int)0))
              {
                {
                  _1273_lnzi += (_1276_pe - _1275_pb);
                  _ptr__1261_lrowidx[_1271_li] = _ptr__1194_conidxs[_1274_i];
                  _ptr__1269_xi32[safe_add( safe_add( _1263_lptr,_1271_li ),(int)1 )] = _1273_lnzi;
                  ++ _1271_li;
                }
              }
              else
              {
                {
                  _1272_cnzi += (_1276_pe - _1275_pb);
                  _ptr__1262_crowidx[_1270_ci] = (-safe_add( (int)1,_ptr__1194_conidxs[_1274_i] ));
                  _ptr__1269_xi32[safe_add( safe_add( _1264_cptr,_1270_ci ),(int)1 )] = _1272_cnzi;
                  ++ _1270_ci;
                }
              }
            }
          }
          int32_t _9669_ = (int)0;
          int32_t _9670_ = _1199_nelem;
          for (int32_t _1277_i = _9669_; _1277_i < _9670_; ++_1277_i)
          {
            {
              if ((_ptr__1194_conidxs[_1277_i] >= (int)0))
              {
                {
                  _1250_lncodeelm += (_ptr__1211_wi32[safe_add( _1209_codeptr,_ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1277_i ),(int)1 )] )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_ptr__1211_wi32[safe_add( _1204_ptr_base,_1277_i )] )]);
                }
              }
              else
              {
                {
                  _1249_cncodeelm += (_ptr__1211_wi32[safe_add( _1209_codeptr,_ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1277_i ),(int)1 )] )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_ptr__1211_wi32[safe_add( _1204_ptr_base,_1277_i )] )]);
                }
              }
            }
          }
          int32_t _1278_lcodeptr = xs->alloci32(safe_add( _1252_lnnz,(int)1 ));
          int32_t _1279_ccodeptr = xs->alloci32(safe_add( _1251_cnnz,(int)1 ));
          int32_t _1280_lcode = xs->alloci32(_1250_lncodeelm);
          int32_t _1281_ccode = xs->alloci32(_1249_cncodeelm);
          int32_t _1282_lcconst = xs->allocf64(_1250_lncodeelm);
          int32_t _1283_ccconst = xs->allocf64(_1249_cncodeelm);
          _ptr__1269_xi32[_1278_lcodeptr] = (int)0;
          _ptr__1269_xi32[_1279_ccodeptr] = (int)0;
          int32_t _1284_ccodei = (int)0;
          int32_t _1285_lcodei = (int)0;
          int32_t _1286_rnzi = (int)0;
          int32_t _1287_lnzi = (int)0;
          int32_t _9671_ = (int)0;
          int32_t _9672_ = _1199_nelem;
          for (int32_t _1288_i = _9671_; _1288_i < _9672_; ++_1288_i)
          {
            {
              int32_t _1289_pb = _ptr__1211_wi32[safe_add( _1204_ptr_base,_1288_i )];
              int32_t _1290_pe = _ptr__1211_wi32[safe_add( safe_add( _1204_ptr_base,_1288_i ),(int)1 )];
              if ((_ptr__1194_conidxs[_1288_i] >= (int)0))
              {
                {
                  ::mosek::fusion::Utils::Tools::arraycopy(_1211_wi32,safe_add( _1208_code,_ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )] ),_1269_xi32,safe_add( _1280_lcode,_1285_lcodei ),(_ptr__1211_wi32[safe_add( _1209_codeptr,_1290_pe )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )]));
                  ::mosek::fusion::Utils::Tools::arraycopy(_1213_wf64,safe_add( _1210_cconst,_ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )] ),_1267_xf64,safe_add( _1282_lcconst,_1285_lcodei ),(_ptr__1211_wi32[safe_add( _1209_codeptr,_1290_pe )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )]));
                  int32_t _9673_ = _1289_pb;
                  int32_t _9674_ = _1290_pe;
                  for (int32_t _1291_j = _9673_; _1291_j < _9674_; ++_1291_j)
                  {
                    {
                      _1285_lcodei += (_ptr__1211_wi32[safe_add( safe_add( _1209_codeptr,_1291_j ),(int)1 )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1291_j )]);
                      _ptr__1269_xi32[safe_add( safe_add( _1278_lcodeptr,_1287_lnzi ),(int)1 )] = _1285_lcodei;
                      ++ _1287_lnzi;
                    }
                  }
                }
              }
              else
              {
                {
                  ::mosek::fusion::Utils::Tools::arraycopy(_1211_wi32,safe_add( _1208_code,_ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )] ),_1269_xi32,safe_add( _1281_ccode,_1284_ccodei ),(_ptr__1211_wi32[safe_add( _1209_codeptr,_1290_pe )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )]));
                  ::mosek::fusion::Utils::Tools::arraycopy(_1213_wf64,safe_add( _1210_cconst,_ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )] ),_1267_xf64,safe_add( _1283_ccconst,_1284_ccodei ),(_ptr__1211_wi32[safe_add( _1209_codeptr,_1290_pe )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1289_pb )]));
                  int32_t _9675_ = _1289_pb;
                  int32_t _9676_ = _1290_pe;
                  for (int32_t _1292_j = _9675_; _1292_j < _9676_; ++_1292_j)
                  {
                    {
                      _1284_ccodei += (_ptr__1211_wi32[safe_add( safe_add( _1209_codeptr,_1292_j ),(int)1 )] - _ptr__1211_wi32[safe_add( _1209_codeptr,_1292_j )]);
                      _ptr__1269_xi32[safe_add( safe_add( _1279_ccodeptr,_1272_cnzi ),(int)1 )] = _1284_ccodei;
                      ++ _1272_cnzi;
                    }
                  }
                }
              }
            }
          }
          con_blocks->replace_row_code(xs,_1261_lrowidx,_1263_lptr,_1265_lnidxs,_1278_lcodeptr,_1280_lcode,_1282_lcconst);
          afe_blocks->replace_row_code(xs,_1262_crowidx,_1264_cptr,_1266_cnidxs,_1279_ccodeptr,_1281_ccode,_1283_ccconst);
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1293_lrowidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1214_num_lincon)));
          _checked_ptr_1<int32_t> _ptr__1293_lrowidx(_1293_lrowidx ? _1293_lrowidx->raw() : nullptr,_1293_lrowidx ? _1293_lrowidx->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1294_crowidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1216_num_concon)));
          _checked_ptr_1<int32_t> _ptr__1294_crowidx(_1294_crowidx ? _1294_crowidx->raw() : nullptr,_1294_crowidx ? _1294_crowidx->size(0) : 0);
          int32_t _1295_ci = (int)0;
          int32_t _1296_li = (int)0;
          int32_t _9677_ = (int)0;
          int32_t _9678_ = _1199_nelem;
          for (int32_t _1297_i = _9677_; _1297_i < _9678_; ++_1297_i)
          {
            {
              if ((_ptr__1194_conidxs[_1297_i] >= (int)0))
              {
                {
                  _ptr__1293_lrowidx[_1296_li] = _ptr__1194_conidxs[_1297_i];
                  ++ _1296_li;
                }
              }
              else
              {
                {
                  _ptr__1294_crowidx[_1295_ci] = (-safe_add( (int)1,_ptr__1194_conidxs[_1297_i] ));
                  ++ _1295_ci;
                }
              }
            }
          }
          con_blocks->clear_row_code(_1293_lrowidx);
          afe_blocks->clear_row_code(_1294_crowidx);
        }
      }
    }
  }
  xs->clear();
}
// End mosek.fusion.Model.update

// Begin mosek.fusion.Model.updateObjective
// Method mosek.fusion.Model.updateObjective @ bld/docker-win/final/default/src/fusion/Model.mbi:2995:6-3078:7
void mosek::fusion::Model :: updateObjective(monty::rc_ptr< ::mosek::fusion::Expression > _1298_expr,monty::rc_ptr< ::mosek::fusion::Variable > _1299_x) { mosek::fusion::p_Model::_get_impl(this)->updateObjective(_1298_expr,_1299_x); }
void mosek::fusion::p_Model::updateObjective(monty::rc_ptr< ::mosek::fusion::Expression > _1298_expr,monty::rc_ptr< ::mosek::fusion::Variable > _1299_x)
{
  if ((_1298_expr->getSize() != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid expression size for objective"));
    }
  }
  {}
  if ((mosek::fusion::p_RowBlockManager::_get_impl(obj_blocks)->code_used > (int)0))
  {
    {
      throw ::mosek::fusion::UpdateError(std::string ("Cannot update parameterized constraint"));
    }
  }
  {}
  int32_t _1300_ni = _1299_x->numInst();
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1301_varidxs_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1300_ni)));
  _checked_ptr_1<int64_t> _ptr__1301_varidxs_(_1301_varidxs_ ? _1301_varidxs_->raw() : nullptr,_1301_varidxs_ ? _1301_varidxs_->size(0) : 0);
  if ((_1300_ni < _1299_x->getSize()))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1302_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1300_ni)));
      _checked_ptr_1<int64_t> _ptr__1302_sp(_1302_sp ? _1302_sp->raw() : nullptr,_1302_sp ? _1302_sp->size(0) : 0);
      _1299_x->inst((int)0,_1302_sp,(int)0,_1301_varidxs_);
    }
  }
  else
  {
    {
      _1299_x->inst((int)0,_1301_varidxs_);
    }
  }
  int32_t _9679_ = (int)0;
  int32_t _9680_ = _1300_ni;
  for (int32_t _1303_i = _9679_; _1303_i < _9680_; ++_1303_i)
  {
    {
      if ((_ptr__1301_varidxs_[_1303_i] < (int)0))
      {
        {
          throw ::mosek::fusion::UpdateError(std::string ("Updating semidefinite terms is currently not possible"));
        }
      }
      {}
    }
  }
  bool _1304_varidxs_issorted = true;
  int32_t _9681_ = (int)0;
  int32_t _9682_ = (_1300_ni - (int)1);
  for (int32_t _1305_i = _9681_; _1305_i < _9682_; ++_1305_i)
  {
    {
      _1304_varidxs_issorted = (_1304_varidxs_issorted && (_ptr__1301_varidxs_[_1305_i] < _ptr__1301_varidxs_[(_1305_i - (int)1)]));
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1306_varidxs = nullptr;
  _checked_ptr_1<int32_t> _ptr__1306_varidxs(_1306_varidxs ? _1306_varidxs->raw() : nullptr,_1306_varidxs ? _1306_varidxs->size(0) : 0);
  if (_1304_varidxs_issorted)
  {
    {
      std::vector<int32_t> _9683_;
      for (int32_t _1307_i = (int)0, _9684_ = _1300_ni; _1307_i < _9684_ ; ++_1307_i)
      {
        _9683_.push_back((int32_t)_ptr__1301_varidxs_[_1307_i]);
      }
      auto _9685_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9683_.size()),_9683_.begin(),_9683_.end()));
      _1306_varidxs = _9685_;
      _ptr__1306_varidxs.update(_1306_varidxs ? _1306_varidxs->raw() : nullptr, _1306_varidxs ? _1306_varidxs->size(0) : 0);
    }
  }
  else
  {
    {
      std::vector<int64_t> _9686_;
      for (int32_t _1309_i = (-(int)1), _9687_ = _1300_ni; _1309_i < _9687_ ; ++_1309_i)
      {
        _9686_.push_back(_1309_i);
      }
      auto _9688_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9686_.size()),_9686_.begin(),_9686_.end()));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1308_perm = _9688_;
      _checked_ptr_1<int64_t> _ptr__1308_perm(_1308_perm ? _1308_perm->raw() : nullptr,_1308_perm ? _1308_perm->size(0) : 0);
      ::mosek::fusion::p_CommonTools::argQsort(_1308_perm,_1301_varidxs_,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_1300_ni));
      std::vector<int32_t> _9689_;
      for (int32_t _1310_i = (int)0, _9690_ = _1300_ni; _1310_i < _9690_ ; ++_1310_i)
      {
        _9689_.push_back((int32_t)_ptr__1301_varidxs_[_ptr__1308_perm[_1310_i]]);
      }
      auto _9691_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9689_.size()),_9689_.begin(),_9689_.end()));
      _1306_varidxs = _9691_;
      _ptr__1306_varidxs.update(_1306_varidxs ? _1306_varidxs->raw() : nullptr, _1306_varidxs ? _1306_varidxs->size(0) : 0);
    }
  }
  int32_t _1311_N = (int)((_1306_varidxs)->size(0));
  std::shared_ptr< monty::ndarray< double,1 > > _1312_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1311_N)));
  _checked_ptr_1<double> _ptr__1312_cof(_1312_cof ? _1312_cof->raw() : nullptr,_1312_cof ? _1312_cof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1313_subj = _1306_varidxs;
  _checked_ptr_1<int32_t> _ptr__1313_subj(_1313_subj ? _1313_subj->raw() : nullptr,_1313_subj ? _1313_subj->size(0) : 0);
  ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1298_expr)).as<::mosek::fusion::Expression>())->eval(ws,rs,xs);
  ws->pop_expr();
  {
  }
  int32_t _1314_nd = mosek::fusion::p_WorkStack::_get_impl(ws)->nd;
  int32_t _1315_nelem = mosek::fusion::p_WorkStack::_get_impl(ws)->nelem;
  int32_t _1316_nnz = mosek::fusion::p_WorkStack::_get_impl(ws)->nnz;
  bool _1317_hassp = mosek::fusion::p_WorkStack::_get_impl(ws)->hassp;
  int32_t _1318_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(ws)->ncodeatom;
  int32_t _1319_shape_base = mosek::fusion::p_WorkStack::_get_impl(ws)->shape_base;
  int32_t _1320_ptr_base = mosek::fusion::p_WorkStack::_get_impl(ws)->ptr_base;
  int32_t _1321_sp_base = mosek::fusion::p_WorkStack::_get_impl(ws)->sp_base;
  int32_t _1322_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(ws)->nidxs_base;
  int32_t _1323_cof_base = mosek::fusion::p_WorkStack::_get_impl(ws)->cof_base;
  int32_t _1324_code_base = mosek::fusion::p_WorkStack::_get_impl(ws)->code_base;
  int32_t _1325_codeptr_base = mosek::fusion::p_WorkStack::_get_impl(ws)->codeptr_base;
  int32_t _1326_cconst_base = mosek::fusion::p_WorkStack::_get_impl(ws)->cconst_base;
  {
  }
  if ((_1318_ncodeatom > (int)0))
  {
    {
      throw ::mosek::fusion::UpdateError(std::string ("Cannot update parameterized objective"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1327_wi32 = mosek::fusion::p_WorkStack::_get_impl(ws)->i32;
  _checked_ptr_1<int32_t> _ptr__1327_wi32(_1327_wi32 ? _1327_wi32->raw() : nullptr,_1327_wi32 ? _1327_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1328_wi64 = mosek::fusion::p_WorkStack::_get_impl(ws)->i64;
  _checked_ptr_1<int64_t> _ptr__1328_wi64(_1328_wi64 ? _1328_wi64->raw() : nullptr,_1328_wi64 ? _1328_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1329_wf64 = mosek::fusion::p_WorkStack::_get_impl(ws)->f64;
  _checked_ptr_1<double> _ptr__1329_wf64(_1329_wf64 ? _1329_wf64->raw() : nullptr,_1329_wf64 ? _1329_wf64->size(0) : 0);
  int32_t _1330_k = (int)0;
  int32_t _9692_ = (int)0;
  int32_t _9693_ = _1315_nelem;
  for (int32_t _1331_i = _9692_; _1331_i < _9693_; ++_1331_i)
  {
    {
      int32_t _1332_p0 = _ptr__1327_wi32[safe_add( _1320_ptr_base,_1331_i )];
      int32_t _1333_p1 = _ptr__1327_wi32[safe_add( safe_add( _1320_ptr_base,_1331_i ),(int)1 )];
      int32_t _1334_p = _1332_p0;
      int32_t _1335_l = (int)0;
      while ( ((_1335_l < (int)((_1306_varidxs)->size(0))) && (_1334_p < _1333_p1)) )
      {
        {
          if ((_ptr__1306_varidxs[_1335_l] < _ptr__1328_wi64[safe_add( _1322_nidxs_base,_1334_p )]))
          {
            {
              ++ _1335_l;
            }
          }
          else if((_ptr__1306_varidxs[_1335_l] > _ptr__1328_wi64[safe_add( _1322_nidxs_base,_1334_p )]))
          {
            {
              ++ _1334_p;
            }
          }
          else
          {
            {
              _ptr__1312_cof[safe_add( _1330_k,_1335_l )] = _ptr__1329_wf64[safe_add( _1323_cof_base,_1334_p )];
              ++ _1335_l;
              ++ _1334_p;
            }
          }
        }
      }
      _1330_k += (int)((_1306_varidxs)->size(0));
    }
  }
  task_putclist(_1313_subj,_1312_cof);
  if ((_1318_ncodeatom > (int)0))
  {
    {
      obj_blocks->replace_row_code(rs,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0)}),_1320_ptr_base,_1322_nidxs_base,_1325_codeptr_base,_1324_code_base,_1326_cconst_base);
    }
  }
  {}
}
// End mosek.fusion.Model.updateObjective

// Begin mosek.fusion.Model.parameter_unchecked
// Method mosek.fusion.Model.parameter_unchecked @ bld/docker-win/final/default/src/fusion/Model.mbi:2947:6-2980:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter_unchecked(const std::string & _1336_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1337_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1338_sp)
{
  _checked_ptr_1<int32_t> _ptr__1337_shape(_1337_shape ? _1337_shape->raw() : nullptr, _1337_shape ? _1337_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__1338_sp(_1338_sp ? _1338_sp->raw() : nullptr, _1338_sp ? _1338_sp->size(0) : 0);
  if ((((int)((_1336_name).size()) > (int)0) && par_map->hasItem(_1336_name)))
  {
    {
      throw ::mosek::fusion::NameError(std::string ("Duplicate parameter name"));
    }
  }
  {}
  int64_t _1339_sz = ::mosek::fusion::p_Set::size(_1337_shape);
  int32_t _9694_;
  bool _9695_ = (NULL != _1338_sp.get());
  if (_9695_)
  {
    _9694_ = (int)((_1338_sp)->size(0));
  }
  else
  {
    _9694_ = (int32_t)_1339_sz;
  }
  int32_t _1340_nelem = _9694_;
  if ((NULL == param_value.get()))
  {
    {
      param_value = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1340_nelem)));
    }
  }
  else
  {
    {
      if ((safe_add( param_num,_1340_nelem ) > (int)((param_value)->size(0))))
      {
        {
          std::shared_ptr< monty::ndarray< double,1 > > _1341_old_param_value = param_value;
          _checked_ptr_1<double> _ptr__1341_old_param_value(_1341_old_param_value ? _1341_old_param_value->raw() : nullptr,_1341_old_param_value ? _1341_old_param_value->size(0) : 0);
          int32_t _9696_;
          bool _9697_ = (safe_mul( (int)2,(int)((_1341_old_param_value)->size(0)) ) > safe_add( (int)((_1341_old_param_value)->size(0)),_1340_nelem ));
          if (_9697_)
          {
            _9696_ = safe_mul( (int)2,(int)((_1341_old_param_value)->size(0)) );
          }
          else
          {
            _9696_ = safe_add( (int)((_1341_old_param_value)->size(0)),_1340_nelem );
          }
          int32_t _1342_new_len = _9696_;
          param_value = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1342_new_len)));
          if ((param_num > (int)0))
          {
            {
              ::mosek::fusion::Utils::Tools::arraycopy(_1341_old_param_value,(int)0,param_value,(int)0,param_num);
            }
          }
          {}
        }
      }
      {}
    }
  }
  std::vector<int32_t> _9698_;
  for (int32_t _1344_i = (int)0, _9699_ = (int32_t)_1340_nelem; _1344_i < _9699_ ; ++_1344_i)
  {
    _9698_.push_back(safe_add( param_num,_1344_i ));
  }
  auto _9700_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9698_.size()),_9698_.begin(),_9698_.end()));
  monty::rc_ptr< ::mosek::fusion::ParameterImpl > _1343_r = ::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(::mosek::fusion::Model::t(_pubthis),_1337_shape,_1338_sp,_9700_);
  param_num += _1340_nelem;
  if (((int)((_1336_name).size()) > (int)0))
  {
    {
      if (((NULL == parameters.get()) || (numparameter == (int)((parameters)->size(0)))))
      {
        {
          std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _1345_tmppar = parameters;
          std::vector<monty::rc_ptr< ::mosek::fusion::Parameter >> _9701_;
          for (int32_t _1346_i = (int)0, _9702_ = safe_add( safe_mul( numparameter,(int)2 ),(int)64 ); _1346_i < _9702_ ; ++_1346_i)
          {
            _9701_.push_back(nullptr);
          }
          auto _9703_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >(monty::shape(_9701_.size()),_9701_.begin(),_9701_.end()));
          parameters = _9703_;
          int32_t _9704_ = (int)0;
          int32_t _9705_ = numparameter;
          for (int32_t _1347_i = _9704_; _1347_i < _9705_; ++_1347_i)
          {
            {
              ((*parameters)(_1347_i)) = ((*_1345_tmppar)(_1347_i));
            }
          }
        }
      }
      {}
      ((*parameters)(numparameter)) = (_1343_r).as<::mosek::fusion::Parameter>();
      par_map->setItem(_1336_name,numparameter);
      numparameter += (int)1;
    }
  }
  {}
  return (_1343_r).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.Model.parameter_unchecked

// Begin mosek.fusion.Model.parameter_
// Method mosek.fusion.Model.parameter_ @ bld/docker-win/final/default/src/fusion/Model.mbi:2931:6-2945:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter_(const std::string & _1348_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1349_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1350_sp)
{
  _checked_ptr_1<int32_t> _ptr__1349_shape(_1349_shape ? _1349_shape->raw() : nullptr, _1349_shape ? _1349_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__1350_sp(_1350_sp ? _1350_sp->raw() : nullptr, _1350_sp ? _1350_sp->size(0) : 0);
  bool _1351_sorted = true;
  int32_t _1352_nd = (int)((_1349_shape)->size(0));
  if (((NULL != _1350_sp.get()) && ((int)((_1350_sp)->size(0)) > (int)0)))
  {
    {
      bool _1353_ok = (_ptr__1350_sp[((int)((_1350_sp)->size(0)) - (int)1)] < ::mosek::fusion::p_Set::size(_1349_shape));
      int32_t _9706_ = (int)1;
      int32_t _9707_ = (int)((_1350_sp)->size(0));
      for (int32_t _1354_i = _9706_; _1354_i < _9707_; ++_1354_i)
      {
        {
          _1353_ok = (_1353_ok && (_ptr__1350_sp[(_1354_i - (int)1)] < _ptr__1350_sp[_1354_i]));
        }
      }
      if ((!_1353_ok))
      {
        {
          throw ::mosek::fusion::IndexError(std::string ("Unordered sparsity pattern"));
        }
      }
      {}
    }
  }
  {}
  return __mosek_2fusion_2Model__parameter_unchecked(_1348_name,_1349_shape,_1350_sp);
}
// End mosek.fusion.Model.parameter_

// Begin mosek.fusion.Model.parameter_
// Method mosek.fusion.Model.parameter_ @ bld/docker-win/final/default/src/fusion/Model.mbi:2908:6-2929:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter_(const std::string & _1355_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1356_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1357_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__1356_shape(_1356_shape ? _1356_shape->raw() : nullptr, _1356_shape ? _1356_shape->size(0) : 0);
  int32_t _1358_n = (int)((_1357_sparsity)->size(0));
  int32_t _1359_m = (int)((_1357_sparsity)->size(1));
  if (((int)((_1356_shape)->size(0)) != _1359_m))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid sparsity"));
    }
  }
  {}
  if ((NULL == _1357_sparsity.get()))
  {
    {
      return __mosek_2fusion_2Model__parameter_unchecked(_1355_name,_1356_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr));
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1360_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1358_n)));
      _checked_ptr_1<int64_t> _ptr__1360_sp(_1360_sp ? _1360_sp->raw() : nullptr,_1360_sp ? _1360_sp->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1361_strides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1359_m)));
      _checked_ptr_1<int64_t> _ptr__1361_strides(_1361_strides ? _1361_strides->raw() : nullptr,_1361_strides ? _1361_strides->size(0) : 0);
      _ptr__1361_strides[(_1359_m - (int)1)] = (int)1;
      int32_t _9708_ = (int)1;
      int32_t _9709_ = _1359_m;
      for (int32_t _1362_i = _9708_; _1362_i < _9709_; ++_1362_i)
      {
        {
          _ptr__1361_strides[((_1359_m - (int)1) - _1362_i)] = safe_mul( _ptr__1361_strides[(_1359_m - _1362_i)],_ptr__1356_shape[(_1359_m - _1362_i)] );
        }
      }
      int32_t _9710_ = (int)0;
      int32_t _9711_ = _1358_n;
      for (int32_t _1363_i = _9710_; _1363_i < _9711_; ++_1363_i)
      {
        {
          _ptr__1360_sp[_1363_i] = (int)0;
          int32_t _9712_ = (int)0;
          int32_t _9713_ = _1359_m;
          for (int32_t _1364_j = _9712_; _1364_j < _9713_; ++_1364_j)
          {
            {
              _ptr__1360_sp[_1363_i] += safe_mul( ((*_1357_sparsity)(_1363_i,_1364_j)),_ptr__1361_strides[_1364_j] );
            }
          }
        }
      }
      return __mosek_2fusion_2Model__parameter_(_1355_name,_1356_shape,_1360_sp);
    }
  }
}
// End mosek.fusion.Model.parameter_

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2906:6-139
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1365_name) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1365_name); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1365_name) { return __mosek_2fusion_2Model__parameter(_1365_name); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1365_name)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1366_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1366_sp(_1366_sp ? _1366_sp->raw() : nullptr,_1366_sp ? _1366_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1365_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),_1366_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2905:6-159
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1367_name,int32_t _1368_d1,int32_t _1369_d2,int32_t _1370_d3) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1367_name,_1368_d1,_1369_d2,_1370_d3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1367_name,int32_t _1368_d1,int32_t _1369_d2,int32_t _1370_d3) { return __mosek_2fusion_2Model__parameter(_1367_name,_1368_d1,_1369_d2,_1370_d3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1367_name,int32_t _1368_d1,int32_t _1369_d2,int32_t _1370_d3)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1371_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1371_sp(_1371_sp ? _1371_sp->raw() : nullptr,_1371_sp ? _1371_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1367_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1368_d1),(int32_t)(_1369_d2),(int32_t)(_1370_d3)}),_1371_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2904:6-146
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1372_name,int32_t _1373_d1,int32_t _1374_d2) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1372_name,_1373_d1,_1374_d2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1372_name,int32_t _1373_d1,int32_t _1374_d2) { return __mosek_2fusion_2Model__parameter(_1372_name,_1373_d1,_1374_d2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1372_name,int32_t _1373_d1,int32_t _1374_d2)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1375_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1375_sp(_1375_sp ? _1375_sp->raw() : nullptr,_1375_sp ? _1375_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1372_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1373_d1),(int32_t)(_1374_d2)}),_1375_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2903:6-143
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1376_name,int32_t _1377_d1) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1376_name,_1377_d1); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1376_name,int32_t _1377_d1) { return __mosek_2fusion_2Model__parameter(_1376_name,_1377_d1); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1376_name,int32_t _1377_d1)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1378_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1378_sp(_1378_sp ? _1378_sp->raw() : nullptr,_1378_sp ? _1378_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1376_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1377_d1)}),_1378_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2902:6-134
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1379_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1380_shape) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1379_name,_1380_shape); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1379_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1380_shape) { return __mosek_2fusion_2Model__parameter(_1379_name,_1380_shape); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1379_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1380_shape)
{
  _checked_ptr_1<int32_t> _ptr__1380_shape(_1380_shape ? _1380_shape->raw() : nullptr, _1380_shape ? _1380_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1381_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1381_sp(_1381_sp ? _1381_sp->raw() : nullptr,_1381_sp ? _1381_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1379_name,_1380_shape,_1381_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2901:6-123
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1382_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1383_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1384_sp) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1382_name,_1383_shape,_1384_sp); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1382_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1383_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1384_sp) { return __mosek_2fusion_2Model__parameter(_1382_name,_1383_shape,_1384_sp); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1382_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1383_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1384_sp)
{
  _checked_ptr_1<int32_t> _ptr__1383_shape(_1383_shape ? _1383_shape->raw() : nullptr, _1383_shape ? _1383_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__1384_sp(_1384_sp ? _1384_sp->raw() : nullptr, _1384_sp ? _1384_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1382_name,_1383_shape,_1384_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2900:6-136
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(const std::string & _1385_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1386_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1387_sparsity) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1385_name,_1386_shape,_1387_sparsity); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(const std::string &  _1385_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1386_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1387_sparsity) { return __mosek_2fusion_2Model__parameter(_1385_name,_1386_shape,_1387_sparsity); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(const std::string & _1385_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1386_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1387_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__1386_shape(_1386_shape ? _1386_shape->raw() : nullptr, _1386_shape ? _1386_shape->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(_1385_name,_1386_shape,_1387_sparsity);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2898:6-126
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter() { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter() { return __mosek_2fusion_2Model__parameter(); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter()
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1388_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1388_sp(_1388_sp ? _1388_sp->raw() : nullptr,_1388_sp ? _1388_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),_1388_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2897:6-145
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(int32_t _1389_d1,int32_t _1390_d2,int32_t _1391_d3) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1389_d1,_1390_d2,_1391_d3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(int32_t _1389_d1,int32_t _1390_d2,int32_t _1391_d3) { return __mosek_2fusion_2Model__parameter(_1389_d1,_1390_d2,_1391_d3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(int32_t _1389_d1,int32_t _1390_d2,int32_t _1391_d3)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1392_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1392_sp(_1392_sp ? _1392_sp->raw() : nullptr,_1392_sp ? _1392_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1389_d1),(int32_t)(_1390_d2),(int32_t)(_1391_d3)}),_1392_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2896:6-132
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(int32_t _1393_d1,int32_t _1394_d2) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1393_d1,_1394_d2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(int32_t _1393_d1,int32_t _1394_d2) { return __mosek_2fusion_2Model__parameter(_1393_d1,_1394_d2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(int32_t _1393_d1,int32_t _1394_d2)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1395_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1395_sp(_1395_sp ? _1395_sp->raw() : nullptr,_1395_sp ? _1395_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1393_d1),(int32_t)(_1394_d2)}),_1395_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2895:6-129
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(int32_t _1396_d1) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1396_d1); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(int32_t _1396_d1) { return __mosek_2fusion_2Model__parameter(_1396_d1); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(int32_t _1396_d1)
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1397_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1397_sp(_1397_sp ? _1397_sp->raw() : nullptr,_1397_sp ? _1397_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1396_d1)}),_1397_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2894:6-120
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1398_shape) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1398_shape); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1398_shape) { return __mosek_2fusion_2Model__parameter(_1398_shape); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1398_shape)
{
  _checked_ptr_1<int32_t> _ptr__1398_shape(_1398_shape ? _1398_shape->raw() : nullptr, _1398_shape ? _1398_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1399_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__1399_sp(_1399_sp ? _1399_sp->raw() : nullptr,_1399_sp ? _1399_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),_1398_shape,_1399_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2893:6-109
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1400_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1401_sp) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1400_shape,_1401_sp); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1400_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1401_sp) { return __mosek_2fusion_2Model__parameter(_1400_shape,_1401_sp); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1400_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _1401_sp)
{
  _checked_ptr_1<int32_t> _ptr__1400_shape(_1400_shape ? _1400_shape->raw() : nullptr, _1400_shape ? _1400_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__1401_sp(_1401_sp ? _1401_sp->raw() : nullptr, _1401_sp ? _1401_sp->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),_1400_shape,_1401_sp);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.parameter
// Method mosek.fusion.Model.parameter @ bld/docker-win/final/default/src/fusion/Model.mbi:2892:6-122
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1402_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1403_sparsity) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__parameter(_1402_shape,_1403_sparsity); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1402_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1403_sparsity) { return __mosek_2fusion_2Model__parameter(_1402_shape,_1403_sparsity); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__parameter(std::shared_ptr< monty::ndarray< int32_t,1 > > _1402_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _1403_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__1402_shape(_1402_shape ? _1402_shape->raw() : nullptr, _1402_shape ? _1402_shape->size(0) : 0);
  return __mosek_2fusion_2Model__parameter_(std::string (""),_1402_shape,_1403_sparsity);
}
// End mosek.fusion.Model.parameter

// Begin mosek.fusion.Model.objective_
// Method mosek.fusion.Model.objective_ @ bld/docker-win/final/default/src/fusion/Model.mbi:2795:6-2884:7
void mosek::fusion::p_Model::objective_(const std::string & _1404_name,mosek::fusion::ObjectiveSense _1405_sense,monty::rc_ptr< ::mosek::fusion::Expression > _1406_expr)
{
  task_putobjectivename(_1404_name);
  monty::rc_ptr< ::mosek::fusion::WorkStack > _1407_rs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
  monty::rc_ptr< ::mosek::fusion::WorkStack > _1408_ws = ::mosek::fusion::p_WorkStack::_new_WorkStack();
  monty::rc_ptr< ::mosek::fusion::ExprDense > _1409_obje = ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1406_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
  _1409_obje->eval(_1407_rs,_1408_ws,xs);
  _1407_rs->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1410_ri32 = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1410_ri32(_1410_ri32 ? _1410_ri32->raw() : nullptr,_1410_ri32 ? _1410_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1411_ri64 = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1411_ri64(_1411_ri64 ? _1411_ri64->raw() : nullptr,_1411_ri64 ? _1411_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1412_rf64 = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->f64;
  _checked_ptr_1<double> _ptr__1412_rf64(_1412_rf64 ? _1412_rf64->raw() : nullptr,_1412_rf64 ? _1412_rf64->size(0) : 0);
  int32_t _1413_nd = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->nd;
  int32_t _1414_nelem = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->nelem;
  int32_t _1415_nnz = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->nnz;
  bool _1416_hassp = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->hassp;
  int32_t _1417_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->ncodeatom;
  int32_t _1418_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->ptr_base;
  int32_t _1419_shape_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->shape_base;
  int32_t _1420_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->nidxs_base;
  int32_t _1421_cof_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->cof_base;
  int32_t _1422_code_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->code_base;
  int32_t _1423_codeptr_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->codeptr_base;
  int32_t _1424_cconst_base = mosek::fusion::p_WorkStack::_get_impl(_1407_rs)->cconst_base;
  int64_t _1425_totalsize = (int64_t)1;
  int32_t _9714_ = (int)0;
  int32_t _9715_ = _1413_nd;
  for (int32_t _1426_i = _9714_; _1426_i < _9715_; ++_1426_i)
  {
    {
      _1413_nd *= _ptr__1410_ri32[safe_add( _1419_shape_base,_1426_i )];
    }
  }
  if ((_1425_totalsize != (int)1))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid expression size for objective"));
    }
  }
  {}
  if ((_1414_nelem != (int)1))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid expression for objective"));
    }
  }
  {}
  int32_t _1427_linnz = (int)0;
  int32_t _1428_psdnz = (int)0;
  int32_t _9716_ = (int)0;
  int32_t _9717_ = _1415_nnz;
  for (int32_t _1429_i = _9716_; _1429_i < _9717_; ++_1429_i)
  {
    {
      if ((_ptr__1411_ri64[safe_add( _1420_nidxs_base,_1429_i )] < (int)0))
      {
        {
          ++ _1428_psdnz;
        }
      }
      else if((_ptr__1411_ri64[safe_add( _1420_nidxs_base,_1429_i )] >= (int)0))
      {
        {
          ++ _1427_linnz;
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1430_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1427_linnz)));
  _checked_ptr_1<int32_t> _ptr__1430_subj(_1430_subj ? _1430_subj->raw() : nullptr,_1430_subj ? _1430_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1431_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1427_linnz)));
  _checked_ptr_1<double> _ptr__1431_cof(_1431_cof ? _1431_cof->raw() : nullptr,_1431_cof ? _1431_cof->size(0) : 0);
  {
    int32_t _1432_k = (int)0;
    int32_t _9718_ = (int)0;
    int32_t _9719_ = _1415_nnz;
    for (int32_t _1433_j = _9718_; _1433_j < _9719_; ++_1433_j)
    {
      {
        if ((_ptr__1411_ri64[safe_add( _1420_nidxs_base,_1433_j )] >= (int)0))
        {
          {
            _ptr__1430_subj[_1432_k] = (int32_t)_ptr__1411_ri64[safe_add( _1420_nidxs_base,_1433_j )];
            _ptr__1431_cof[_1432_k] = _ptr__1412_rf64[safe_add( _1421_cof_base,_1433_j )];
            ++ _1432_k;
          }
        }
        {}
      }
    }
  }
  task_putobjective((_1405_sense == ::mosek::fusion::ObjectiveSense::Maximize),_1430_subj,_1431_cof,0.0);
  if ((_1428_psdnz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1434_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1428_psdnz)));
      _checked_ptr_1<int32_t> _ptr__1434_subj(_1434_subj ? _1434_subj->raw() : nullptr,_1434_subj ? _1434_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1435_subk = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1428_psdnz)));
      _checked_ptr_1<int32_t> _ptr__1435_subk(_1435_subk ? _1435_subk->raw() : nullptr,_1435_subk ? _1435_subk->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1436_subl = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1428_psdnz)));
      _checked_ptr_1<int32_t> _ptr__1436_subl(_1436_subl ? _1436_subl->raw() : nullptr,_1436_subl ? _1436_subl->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1437_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1428_psdnz)));
      _checked_ptr_1<double> _ptr__1437_val(_1437_val ? _1437_val->raw() : nullptr,_1437_val ? _1437_val->size(0) : 0);
      int32_t _9720_ = (int)0;
      int32_t _9721_ = _1428_psdnz;
      for (int32_t _1438_i = _9720_; _1438_i < _9721_; ++_1438_i)
      {
        {
          int64_t _1439_varidx = (-safe_add( _ptr__1411_ri64[safe_add( _1420_nidxs_base,_1438_i )],(int)1 ));
          _ptr__1434_subj[_1438_i] = ((*barvar_block_elm_barj)(_1439_varidx));
          _ptr__1435_subk[_1438_i] = ((*barvar_block_elm_i)(_1439_varidx));
          _ptr__1436_subl[_1438_i] = ((*barvar_block_elm_j)(_1439_varidx));
          double _9722_;
          bool _9723_ = (_ptr__1435_subk[_1438_i] == _ptr__1436_subl[_1438_i]);
          if (_9723_)
          {
            _9722_ = _ptr__1412_rf64[safe_add( _1421_cof_base,_1438_i )];
          }
          else
          {
            _9722_ = (0.5 * _ptr__1412_rf64[safe_add( _1421_cof_base,_1438_i )]);
          }
          _ptr__1437_val[_1438_i] = _9722_;
        }
      }
      task_putbarc(_1434_subj,_1435_subk,_1436_subl,_1437_val);
    }
  }
  {}
  if ((_1417_ncodeatom > (int)0))
  {
    {
      obj_blocks->replace_row_code(_1407_rs,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0)}),_1418_ptr_base,_1420_nidxs_base,_1423_codeptr_base,_1422_code_base,_1424_cconst_base);
    }
  }
  {}
}
// End mosek.fusion.Model.objective_

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2792:6-163
void mosek::fusion::Model :: objective(double _1440_c) { mosek::fusion::p_Model::_get_impl(this)->objective(_1440_c); }
void mosek::fusion::p_Model::objective(double _1440_c)
{
  objective_(std::string (""),::mosek::fusion::ObjectiveSense::Minimize,::mosek::fusion::p_Expr::constTerm(_1440_c));
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2791:6-145
void mosek::fusion::Model :: objective(mosek::fusion::ObjectiveSense _1441_sense,double _1442_c) { mosek::fusion::p_Model::_get_impl(this)->objective(_1441_sense,_1442_c); }
void mosek::fusion::p_Model::objective(mosek::fusion::ObjectiveSense _1441_sense,double _1442_c)
{
  objective_(std::string (""),_1441_sense,::mosek::fusion::p_Expr::constTerm(_1442_c));
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2790:6-132
void mosek::fusion::Model :: objective(mosek::fusion::ObjectiveSense _1443_sense,monty::rc_ptr< ::mosek::fusion::Expression > _1444_expr) { mosek::fusion::p_Model::_get_impl(this)->objective(_1443_sense,_1444_expr); }
void mosek::fusion::p_Model::objective(mosek::fusion::ObjectiveSense _1443_sense,monty::rc_ptr< ::mosek::fusion::Expression > _1444_expr)
{
  objective_(std::string (""),_1443_sense,_1444_expr);
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2789:6-165
void mosek::fusion::Model :: objective(const std::string & _1445_name,double _1446_c) { mosek::fusion::p_Model::_get_impl(this)->objective(_1445_name,_1446_c); }
void mosek::fusion::p_Model::objective(const std::string & _1445_name,double _1446_c)
{
  objective_(_1445_name,::mosek::fusion::ObjectiveSense::Minimize,::mosek::fusion::p_Expr::constTerm(_1446_c));
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2788:6-147
void mosek::fusion::Model :: objective(const std::string & _1447_name,mosek::fusion::ObjectiveSense _1448_sense,double _1449_c) { mosek::fusion::p_Model::_get_impl(this)->objective(_1447_name,_1448_sense,_1449_c); }
void mosek::fusion::p_Model::objective(const std::string & _1447_name,mosek::fusion::ObjectiveSense _1448_sense,double _1449_c)
{
  objective_(_1447_name,_1448_sense,::mosek::fusion::p_Expr::constTerm(_1449_c));
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.objective
// Method mosek.fusion.Model.objective @ bld/docker-win/final/default/src/fusion/Model.mbi:2787:6-134
void mosek::fusion::Model :: objective(const std::string & _1450_name,mosek::fusion::ObjectiveSense _1451_sense,monty::rc_ptr< ::mosek::fusion::Expression > _1452_expr) { mosek::fusion::p_Model::_get_impl(this)->objective(_1450_name,_1451_sense,_1452_expr); }
void mosek::fusion::p_Model::objective(const std::string & _1450_name,mosek::fusion::ObjectiveSense _1451_sense,monty::rc_ptr< ::mosek::fusion::Expression > _1452_expr)
{
  objective_(_1450_name,_1451_sense,_1452_expr);
}
// End mosek.fusion.Model.objective

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2785:6-159
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1453_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1453_exprdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1453_exprdom) { return __mosek_2fusion_2Model__constraint(_1453_exprdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1453_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),mosek::fusion::p_ExprRangeDomain::_get_impl(_1453_exprdom)->expr,mosek::fusion::p_ExprRangeDomain::_get_impl(_1453_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2783:6-159
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1454_name,monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1455_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1454_name,_1455_exprdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model::constraint(const std::string &  _1454_name,monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1455_exprdom) { return __mosek_2fusion_2Model__constraint(_1454_name,_1455_exprdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1454_name,monty::rc_ptr< ::mosek::fusion::ExprRangeDomain > _1455_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(_1454_name,mosek::fusion::p_ExprRangeDomain::_get_impl(_1455_exprdom)->expr,mosek::fusion::p_ExprRangeDomain::_get_impl(_1455_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2781:6-144
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1456_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1457_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1456_expr,_1457_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1456_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1457_rdom) { return __mosek_2fusion_2Model__constraint(_1456_expr,_1457_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1456_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1457_rdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),_1456_expr,_1457_rdom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2780:6-144
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1458_name,monty::rc_ptr< ::mosek::fusion::Expression > _1459_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1460_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1458_name,_1459_expr,_1460_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::Model::constraint(const std::string &  _1458_name,monty::rc_ptr< ::mosek::fusion::Expression > _1459_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1460_rdom) { return __mosek_2fusion_2Model__constraint(_1458_name,_1459_expr,_1460_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1458_name,monty::rc_ptr< ::mosek::fusion::Expression > _1459_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1460_rdom)
{
  return __mosek_2fusion_2Model__constraint_(_1458_name,_1459_expr,_1460_rdom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2778:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1461_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1461_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1461_exprdom) { return __mosek_2fusion_2Model__constraint(_1461_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1461_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),mosek::fusion::p_ExprConicDomain::_get_impl(_1461_exprdom)->expr,mosek::fusion::p_ExprConicDomain::_get_impl(_1461_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2776:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1462_name,monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1463_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1462_name,_1463_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1462_name,monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1463_exprdom) { return __mosek_2fusion_2Model__constraint(_1462_name,_1463_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1462_name,monty::rc_ptr< ::mosek::fusion::ExprConicDomain > _1463_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(_1462_name,mosek::fusion::p_ExprConicDomain::_get_impl(_1463_exprdom)->expr,mosek::fusion::p_ExprConicDomain::_get_impl(_1463_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2774:6-139
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1464_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1465_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1464_expr,_1465_qdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1464_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1465_qdom) { return __mosek_2fusion_2Model__constraint(_1464_expr,_1465_qdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1464_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1465_qdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),_1464_expr,_1465_qdom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2773:6-139
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1466_name,monty::rc_ptr< ::mosek::fusion::Expression > _1467_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1468_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1466_name,_1467_expr,_1468_qdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1466_name,monty::rc_ptr< ::mosek::fusion::Expression > _1467_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1468_qdom) { return __mosek_2fusion_2Model__constraint(_1466_name,_1467_expr,_1468_qdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1466_name,monty::rc_ptr< ::mosek::fusion::Expression > _1467_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1468_qdom)
{
  return __mosek_2fusion_2Model__constraint_(_1466_name,_1467_expr,_1468_qdom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2771:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1469_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1469_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1469_exprdom) { return __mosek_2fusion_2Model__constraint(_1469_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1469_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),mosek::fusion::p_ExprLinearDomain::_get_impl(_1469_exprdom)->expr,mosek::fusion::p_ExprLinearDomain::_get_impl(_1469_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2769:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1470_name,monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1471_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1470_name,_1471_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1470_name,monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1471_exprdom) { return __mosek_2fusion_2Model__constraint(_1470_name,_1471_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1470_name,monty::rc_ptr< ::mosek::fusion::ExprLinearDomain > _1471_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(_1470_name,mosek::fusion::p_ExprLinearDomain::_get_impl(_1471_exprdom)->expr,mosek::fusion::p_ExprLinearDomain::_get_impl(_1471_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2767:6-139
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1472_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1473_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1472_expr,_1473_ldom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1472_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1473_ldom) { return __mosek_2fusion_2Model__constraint(_1472_expr,_1473_ldom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1472_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1473_ldom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),_1472_expr,_1473_ldom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2766:6-139
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1474_name,monty::rc_ptr< ::mosek::fusion::Expression > _1475_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1476_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1474_name,_1475_expr,_1476_ldom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1474_name,monty::rc_ptr< ::mosek::fusion::Expression > _1475_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1476_ldom) { return __mosek_2fusion_2Model__constraint(_1474_name,_1475_expr,_1476_ldom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1474_name,monty::rc_ptr< ::mosek::fusion::Expression > _1475_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1476_ldom)
{
  return __mosek_2fusion_2Model__constraint_(_1474_name,_1475_expr,_1476_ldom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2764:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1477_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1477_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1477_exprdom) { return __mosek_2fusion_2Model__constraint(_1477_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1477_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),mosek::fusion::p_ExprPSDDomain::_get_impl(_1477_exprdom)->expr,mosek::fusion::p_ExprPSDDomain::_get_impl(_1477_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2762:6-154
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1478_name,monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1479_exprdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1478_name,_1479_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1478_name,monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1479_exprdom) { return __mosek_2fusion_2Model__constraint(_1478_name,_1479_exprdom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1478_name,monty::rc_ptr< ::mosek::fusion::ExprPSDDomain > _1479_exprdom)
{
  return __mosek_2fusion_2Model__constraint_(_1478_name,mosek::fusion::p_ExprPSDDomain::_get_impl(_1479_exprdom)->expr,mosek::fusion::p_ExprPSDDomain::_get_impl(_1479_exprdom)->dom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2760:6-141
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1480_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1481_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1480_expr,_1481_psddom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1480_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1481_psddom) { return __mosek_2fusion_2Model__constraint(_1480_expr,_1481_psddom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(monty::rc_ptr< ::mosek::fusion::Expression > _1480_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1481_psddom)
{
  return __mosek_2fusion_2Model__constraint_(std::string (""),_1480_expr,_1481_psddom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.constraint
// Method mosek.fusion.Model.constraint @ bld/docker-win/final/default/src/fusion/Model.mbi:2759:6-141
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__constraint(const std::string & _1482_name,monty::rc_ptr< ::mosek::fusion::Expression > _1483_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1484_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__constraint(_1482_name,_1483_expr,_1484_psddom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::constraint(const std::string &  _1482_name,monty::rc_ptr< ::mosek::fusion::Expression > _1483_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1484_psddom) { return __mosek_2fusion_2Model__constraint(_1482_name,_1483_expr,_1484_psddom); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint(const std::string & _1482_name,monty::rc_ptr< ::mosek::fusion::Expression > _1483_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1484_psddom)
{
  return __mosek_2fusion_2Model__constraint_(_1482_name,_1483_expr,_1484_psddom);
}
// End mosek.fusion.Model.constraint

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2748:6-170
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::PSDDomain > _1485_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1485_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(monty::rc_ptr< ::mosek::fusion::PSDDomain > _1485_psddom) { return __mosek_2fusion_2Model__variable(_1485_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::PSDDomain > _1485_psddom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),mosek::fusion::p_PSDDomain::_get_impl(_1485_psddom)->shape,_1485_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2747:6-172
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1486_n,int32_t _1487_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1488_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1486_n,_1487_m,_1488_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(int32_t _1486_n,int32_t _1487_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1488_psddom) { return __mosek_2fusion_2Model__variable(_1486_n,_1487_m,_1488_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1486_n,int32_t _1487_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1488_psddom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1487_m),(int32_t)(_1486_n),(int32_t)(_1486_n)}),_1488_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2746:6-172
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1489_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1490_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1489_n,_1490_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(int32_t _1489_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1490_psddom) { return __mosek_2fusion_2Model__variable(_1489_n,_1490_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1489_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1490_psddom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1489_n),(int32_t)(_1489_n)}),_1490_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2745:6-170
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1491_name,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1492_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1491_name,_1492_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1491_name,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1492_psddom) { return __mosek_2fusion_2Model__variable(_1491_name,_1492_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1491_name,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1492_psddom)
{
  return __mosek_2fusion_2Model__variable_(_1491_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1492_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2744:6-172
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1493_name,int32_t _1494_n,int32_t _1495_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1496_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1493_name,_1494_n,_1495_m,_1496_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1493_name,int32_t _1494_n,int32_t _1495_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1496_psddom) { return __mosek_2fusion_2Model__variable(_1493_name,_1494_n,_1495_m,_1496_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1493_name,int32_t _1494_n,int32_t _1495_m,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1496_psddom)
{
  return __mosek_2fusion_2Model__variable_(_1493_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1495_m),(int32_t)(_1494_n),(int32_t)(_1494_n)}),_1496_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2743:6-172
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1497_name,int32_t _1498_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1499_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1497_name,_1498_n,_1499_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1497_name,int32_t _1498_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1499_psddom) { return __mosek_2fusion_2Model__variable(_1497_name,_1498_n,_1499_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1497_name,int32_t _1498_n,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1499_psddom)
{
  return __mosek_2fusion_2Model__variable_(_1497_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1498_n),(int32_t)(_1498_n)}),_1499_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2742:6-157
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1500_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1501_shp,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1502_psddom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1500_name,_1501_shp,_1502_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1500_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1501_shp,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1502_psddom) { return __mosek_2fusion_2Model__variable(_1500_name,_1501_shp,_1502_psddom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1500_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1501_shp,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1502_psddom)
{
  _checked_ptr_1<int32_t> _ptr__1501_shp(_1501_shp ? _1501_shp->raw() : nullptr, _1501_shp ? _1501_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(_1500_name,_1501_shp,_1502_psddom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2736:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::ConeDomain > _1503_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1503_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(monty::rc_ptr< ::mosek::fusion::ConeDomain > _1503_qdom) { return __mosek_2fusion_2Model__variable(_1503_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::ConeDomain > _1503_qdom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1503_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2735:6-159
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::RangeDomain > _1504_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1504_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(monty::rc_ptr< ::mosek::fusion::RangeDomain > _1504_rdom) { return __mosek_2fusion_2Model__variable(_1504_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::RangeDomain > _1504_rdom)
{
  return __mosek_2fusion_2Model__ranged_variable(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1504_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2734:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::LinearDomain > _1505_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1505_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(monty::rc_ptr< ::mosek::fusion::LinearDomain > _1505_ldom) { return __mosek_2fusion_2Model__variable(_1505_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(monty::rc_ptr< ::mosek::fusion::LinearDomain > _1505_ldom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1505_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2733:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1506_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1507_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1506_shp,_1507_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1506_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1507_qdom) { return __mosek_2fusion_2Model__variable(_1506_shp,_1507_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1506_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1507_qdom)
{
  _checked_ptr_1<int32_t> _ptr__1506_shp(_1506_shp ? _1506_shp->raw() : nullptr, _1506_shp ? _1506_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(std::string (""),_1506_shp,_1507_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2732:6-159
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1508_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1509_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1508_shp,_1509_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1508_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1509_rdom) { return __mosek_2fusion_2Model__variable(_1508_shp,_1509_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1508_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1509_rdom)
{
  _checked_ptr_1<int32_t> _ptr__1508_shp(_1508_shp ? _1508_shp->raw() : nullptr, _1508_shp ? _1508_shp->size(0) : 0);
  return __mosek_2fusion_2Model__ranged_variable(std::string (""),_1508_shp,_1509_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2731:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1510_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1511_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1510_shp,_1511_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1510_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1511_ldom) { return __mosek_2fusion_2Model__variable(_1510_shp,_1511_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1510_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1511_ldom)
{
  _checked_ptr_1<int32_t> _ptr__1510_shp(_1510_shp ? _1510_shp->raw() : nullptr, _1510_shp ? _1510_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(std::string (""),_1510_shp,_1511_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2730:6-162
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1512_shp) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1512_shp); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1512_shp) { return __mosek_2fusion_2Model__variable(_1512_shp); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(std::shared_ptr< monty::ndarray< int32_t,1 > > _1512_shp)
{
  _checked_ptr_1<int32_t> _ptr__1512_shp(_1512_shp ? _1512_shp->raw() : nullptr, _1512_shp ? _1512_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(std::string (""),_1512_shp,::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2729:6-161
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1513_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1514_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1513_size,_1514_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(int32_t _1513_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1514_qdom) { return __mosek_2fusion_2Model__variable(_1513_size,_1514_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1513_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1514_qdom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1513_size)}),_1514_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2728:6-161
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1515_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1516_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1515_size,_1516_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(int32_t _1515_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1516_rdom) { return __mosek_2fusion_2Model__variable(_1515_size,_1516_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1515_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1516_rdom)
{
  return __mosek_2fusion_2Model__ranged_variable(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1515_size)}),_1516_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2727:6-161
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1517_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1518_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1517_size,_1518_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(int32_t _1517_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1518_ldom) { return __mosek_2fusion_2Model__variable(_1517_size,_1518_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1517_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1518_ldom)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1517_size)}),_1518_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2726:6-175
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(int32_t _1519_size) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1519_size); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(int32_t _1519_size) { return __mosek_2fusion_2Model__variable(_1519_size); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(int32_t _1519_size)
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1519_size)}),::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2725:6-175
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable() { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable() { return __mosek_2fusion_2Model__variable(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable()
{
  return __mosek_2fusion_2Model__variable_(std::string (""),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2723:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1520_name,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1521_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1520_name,_1521_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1520_name,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1521_qdom) { return __mosek_2fusion_2Model__variable(_1520_name,_1521_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1520_name,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1521_qdom)
{
  return __mosek_2fusion_2Model__variable_(_1520_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1521_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2722:6-159
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1522_name,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1523_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1522_name,_1523_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(const std::string &  _1522_name,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1523_rdom) { return __mosek_2fusion_2Model__variable(_1522_name,_1523_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1522_name,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1523_rdom)
{
  return __mosek_2fusion_2Model__ranged_variable(_1522_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1523_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2721:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1524_name,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1525_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1524_name,_1525_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1524_name,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1525_ldom) { return __mosek_2fusion_2Model__variable(_1524_name,_1525_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1524_name,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1525_ldom)
{
  return __mosek_2fusion_2Model__variable_(_1524_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(nullptr),_1525_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2720:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1526_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1527_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1528_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1526_name,_1527_shp,_1528_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1526_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1527_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1528_qdom) { return __mosek_2fusion_2Model__variable(_1526_name,_1527_shp,_1528_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1526_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1527_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1528_qdom)
{
  _checked_ptr_1<int32_t> _ptr__1527_shp(_1527_shp ? _1527_shp->raw() : nullptr, _1527_shp ? _1527_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(_1526_name,_1527_shp,_1528_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2719:6-159
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1529_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1530_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1531_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1529_name,_1530_shp,_1531_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(const std::string &  _1529_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1530_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1531_rdom) { return __mosek_2fusion_2Model__variable(_1529_name,_1530_shp,_1531_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1529_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1530_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1531_rdom)
{
  _checked_ptr_1<int32_t> _ptr__1530_shp(_1530_shp ? _1530_shp->raw() : nullptr, _1530_shp ? _1530_shp->size(0) : 0);
  return __mosek_2fusion_2Model__ranged_variable(_1529_name,_1530_shp,_1531_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2718:6-159
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1532_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1533_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1534_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1532_name,_1533_shp,_1534_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1532_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1533_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1534_ldom) { return __mosek_2fusion_2Model__variable(_1532_name,_1533_shp,_1534_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1532_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1533_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1534_ldom)
{
  _checked_ptr_1<int32_t> _ptr__1533_shp(_1533_shp ? _1533_shp->raw() : nullptr, _1533_shp ? _1533_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(_1532_name,_1533_shp,_1534_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2717:6-162
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1535_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1536_shp) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1535_name,_1536_shp); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1535_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1536_shp) { return __mosek_2fusion_2Model__variable(_1535_name,_1536_shp); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1535_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1536_shp)
{
  _checked_ptr_1<int32_t> _ptr__1536_shp(_1536_shp ? _1536_shp->raw() : nullptr, _1536_shp ? _1536_shp->size(0) : 0);
  return __mosek_2fusion_2Model__variable_(_1535_name,_1536_shp,::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2716:6-161
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1537_name,int32_t _1538_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1539_qdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1537_name,_1538_size,_1539_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1537_name,int32_t _1538_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1539_qdom) { return __mosek_2fusion_2Model__variable(_1537_name,_1538_size,_1539_qdom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1537_name,int32_t _1538_size,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1539_qdom)
{
  return __mosek_2fusion_2Model__variable_(_1537_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1538_size)}),_1539_qdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2715:6-161
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1540_name,int32_t _1541_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1542_rdom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1540_name,_1541_size,_1542_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::Model::variable(const std::string &  _1540_name,int32_t _1541_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1542_rdom) { return __mosek_2fusion_2Model__variable(_1540_name,_1541_size,_1542_rdom); }
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1540_name,int32_t _1541_size,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1542_rdom)
{
  return __mosek_2fusion_2Model__ranged_variable(_1540_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1541_size)}),_1542_rdom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2714:6-161
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1543_name,int32_t _1544_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1545_ldom) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1543_name,_1544_size,_1545_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1543_name,int32_t _1544_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1545_ldom) { return __mosek_2fusion_2Model__variable(_1543_name,_1544_size,_1545_ldom); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1543_name,int32_t _1544_size,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1545_ldom)
{
  return __mosek_2fusion_2Model__variable_(_1543_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1544_size)}),_1545_ldom);
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2713:6-175
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1546_name,int32_t _1547_size) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1546_name,_1547_size); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1546_name,int32_t _1547_size) { return __mosek_2fusion_2Model__variable(_1546_name,_1547_size); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1546_name,int32_t _1547_size)
{
  return __mosek_2fusion_2Model__variable_(_1546_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_1547_size)}),::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.variable
// Method mosek.fusion.Model.variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2712:6-175
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__variable(const std::string & _1548_name) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__variable(_1548_name); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::variable(const std::string &  _1548_name) { return __mosek_2fusion_2Model__variable(_1548_name); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable(const std::string & _1548_name)
{
  return __mosek_2fusion_2Model__variable_(_1548_name,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),::mosek::fusion::p_Domain::unbounded());
}
// End mosek.fusion.Model.variable

// Begin mosek.fusion.Model.removeConstraintBlock
// Method mosek.fusion.Model.removeConstraintBlock @ bld/docker-win/final/default/src/fusion/Model.mbi:2703:6-2710:7
void mosek::fusion::p_Model::removeConstraintBlock(int32_t _1549_conid)
{
  if ((_1549_conid >= (int)0))
  {
    {
      con_release(_1549_conid);
    }
  }
  else
  {
    {
      acon_release((-safe_add( (int)1,_1549_conid )));
    }
  }
}
// End mosek.fusion.Model.removeConstraintBlock

// Begin mosek.fusion.Model.removeVariableBlock
// Method mosek.fusion.Model.removeVariableBlock @ bld/docker-win/final/default/src/fusion/Model.mbi:2675:6-2700:7
void mosek::fusion::p_Model::removeVariableBlock(int64_t _1550_varid64)
{
  if ((con_blocks->is_parameterized() || afe_blocks->is_parameterized()))
  {
    {
      throw ::mosek::fusion::DeletionError(std::string ("Cannot remove variables in parameterized model"));
    }
  }
  {}
  if ((_1550_varid64 < (int)0))
  {
    {
      throw ::mosek::fusion::DeletionError(std::string ("PSD variables cannot be removed"));
    }
  }
  else
  {
    {
      int32_t _1551_varid = (int32_t)_1550_varid64;
      int32_t _1552_sz = var_block_map->blocksize(_1551_varid);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1553_nidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1552_sz)));
      _checked_ptr_1<int32_t> _ptr__1553_nidxs(_1553_nidxs ? _1553_nidxs->raw() : nullptr,_1553_nidxs ? _1553_nidxs->size(0) : 0);
      var_block_map->get(_1551_varid,_1553_nidxs,(int)0);
      var_block_map->free(_1551_varid);
      int32_t _1554_conid = ((*var_block_acc_id)(_1551_varid));
      if ((_1554_conid >= (int)0))
      {
        {
          removeConstraintBlock(_1554_conid);
        }
      }
      {}
      task_var_putboundlist_fr(_1553_nidxs);
      task_clearacollist(_1553_nidxs);
    }
  }
}
// End mosek.fusion.Model.removeVariableBlock

// Begin mosek.fusion.Model.ranged_variable
// Method mosek.fusion.Model.ranged_variable @ bld/docker-win/final/default/src/fusion/Model.mbi:2446:6-2672:7
monty::rc_ptr< ::mosek::fusion::RangedVariable > mosek::fusion::p_Model::__mosek_2fusion_2Model__ranged_variable(const std::string & _1555_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1556_shp,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1557_dom_)
{
  _checked_ptr_1<int32_t> _ptr__1556_shp(_1556_shp ? _1556_shp->raw() : nullptr, _1556_shp ? _1556_shp->size(0) : 0);
  if ((((int)((_1555_name).size()) > (int)0) && hasVariable(_1555_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate variable name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1555_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::RangeDomain > _1558_dom = mosek::fusion::p_RangeDomain::_get_impl(_1557_dom_.get())->__mosek_2fusion_2RangeDomain__finalize_and_validate(_1556_shp);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1559_shape = mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__1559_shape(_1559_shape ? _1559_shape->raw() : nullptr,_1559_shape ? _1559_shape->size(0) : 0);
  int32_t _1560_nd = (int)((_1559_shape)->size(0));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1561_strides = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1560_nd)));
  _checked_ptr_1<int32_t> _ptr__1561_strides(_1561_strides ? _1561_strides->raw() : nullptr,_1561_strides ? _1561_strides->size(0) : 0);
  if ((_1560_nd > (int)0))
  {
    {
      _ptr__1561_strides[(_1560_nd - (int)1)] = (int)1;
      int32_t _9724_ = (int)1;
      int32_t _9725_ = _1560_nd;
      for (int32_t _1562_i = _9724_; _1562_i < _9725_; ++_1562_i)
      {
        {
          _ptr__1561_strides[((_1560_nd - _1562_i) - (int)1)] = safe_mul( _ptr__1561_strides[(_1560_nd - _1562_i)],_ptr__1559_shape[(_1560_nd - _1562_i)] );
        }
      }
    }
  }
  {}
  int32_t _1563_domsize = (int)1;
  int32_t _9726_ = (int)0;
  int32_t _9727_ = (int)((_1559_shape)->size(0));
  for (int32_t _1564_i = _9726_; _1564_i < _9727_; ++_1564_i)
  {
    {
      _1563_domsize *= _ptr__1559_shape[_1564_i];
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1565_axisptr = nullptr;
  _checked_ptr_1<int32_t> _ptr__1565_axisptr(_1565_axisptr ? _1565_axisptr->raw() : nullptr,_1565_axisptr ? _1565_axisptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1566_nameptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1566_nameptr(_1566_nameptr ? _1566_nameptr->raw() : nullptr,_1566_nameptr ? _1566_nameptr->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1567_axisnames = nullptr;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1568_accaxisptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1568_accaxisptr(_1568_accaxisptr ? _1568_accaxisptr->raw() : nullptr,_1568_accaxisptr ? _1568_accaxisptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1569_accnameptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1569_accnameptr(_1569_accnameptr ? _1569_accnameptr->raw() : nullptr,_1569_accnameptr ? _1569_accnameptr->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1570_accaxisnames = nullptr;
  if ((((int)((_1555_name).size()) > (int)0) && (NULL != mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames.get())))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1571_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1572_accsb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      int32_t _1573_axisp = (int)0;
      int64_t _1574_namep = (int)0;
      int64_t _1575_numnames = (int)0;
      if (((int)((mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)->size(0)) != _1560_nd))
      {
        {
          throw ::mosek::fusion::DomainError(std::string ("Invalid index name definition"));
        }
      }
      {}
      int32_t _9728_ = (int)0;
      int32_t _9729_ = (int)((mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)->size(0));
      for (int32_t _1576_i = _9728_; _1576_i < _9729_; ++_1576_i)
      {
        {
          if ((NULL != ((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)(_1576_i)).get()))
          {
            {
              if ((_ptr__1559_shape[_1576_i] != (int)((((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)(_1576_i)))->size(0))))
              {
                {
                  throw ::mosek::fusion::DomainError(std::string ("Invalid index name definition"));
                }
              }
              {}
              _1575_numnames += _ptr__1559_shape[_1576_i];
            }
          }
          {}
        }
      }
      _1566_nameptr = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _1575_numnames,(int)1 ))));
      _ptr__1566_nameptr.update(_1566_nameptr ? _1566_nameptr->raw() : nullptr, _1566_nameptr ? _1566_nameptr->size(0) : 0);
      std::vector<int32_t> _9730_;
      for (int32_t _1577_i = (int)0, _9731_ = _1560_nd; _1577_i < _9731_ ; ++_1577_i)
      {
        _9730_.push_back((-(int)1));
      }
      auto _9732_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9730_.size()),_9730_.begin(),_9730_.end()));
      _1565_axisptr = _9732_;
      _ptr__1565_axisptr.update(_1565_axisptr ? _1565_axisptr->raw() : nullptr, _1565_axisptr ? _1565_axisptr->size(0) : 0);
      int32_t _9733_ = (int)0;
      int32_t _9734_ = (int)((mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)->size(0));
      for (int32_t _1578_i = _9733_; _1578_i < _9734_; ++_1578_i)
      {
        {
          if ((NULL != ((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)(_1578_i)).get()))
          {
            {
              _ptr__1565_axisptr[_1578_i] = _1573_axisp;
              int32_t _9735_ = (int)0;
              int32_t _9736_ = _ptr__1559_shape[_1578_i];
              for (int32_t _1579_j = _9735_; _1579_j < _9736_; ++_1579_j)
              {
                {
                  _1571_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)(_1578_i)))(_1579_j)));
                  ++ _1573_axisp;
                  _1574_namep += (int)((((*((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames)(_1578_i)))(_1579_j))).size());
                  _ptr__1566_nameptr[_1573_axisp] = _1574_namep;
                }
              }
            }
          }
          {}
        }
      }
      _1567_axisnames = _1571_sb;
      _1570_accaxisnames = _1572_accsb;
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1580_sparsity = nullptr;
  _checked_ptr_1<int64_t> _ptr__1580_sparsity(_1580_sparsity ? _1580_sparsity->raw() : nullptr,_1580_sparsity ? _1580_sparsity->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1581_perm = nullptr;
  _checked_ptr_1<int32_t> _ptr__1581_perm(_1581_perm ? _1581_perm->raw() : nullptr,_1581_perm ? _1581_perm->size(0) : 0);
  if (mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->empty)
  {
    {
      _1580_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0)));
      _ptr__1580_sparsity.update(_1580_sparsity ? _1580_sparsity->raw() : nullptr, _1580_sparsity ? _1580_sparsity->size(0) : 0);
    }
  }
  else if((NULL != mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->sparsity.get()))
  {
    {
      if (((int)((mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->sparsity)->size(1)) != _1560_nd))
      {
        {
          throw ::mosek::fusion::SparseFormatError(std::string ("Sparsity pattern is not correct"));
        }
      }
      {}
      int32_t _1582_n = (int)((mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->sparsity)->size(0));
      _1580_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1582_n)));
      _ptr__1580_sparsity.update(_1580_sparsity ? _1580_sparsity->raw() : nullptr, _1580_sparsity ? _1580_sparsity->size(0) : 0);
      {
        bool _1583_err = false;
        std::shared_ptr< monty::ndarray< int32_t,2 > > _1584_sp = mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->sparsity;
        int32_t _9737_ = (int)0;
        int32_t _9738_ = _1582_n;
        for (int32_t _1585_i = _9737_; _1585_i < _9738_; ++_1585_i)
        {
          {
            int32_t _9739_ = (int)0;
            int32_t _9740_ = (int)((_1584_sp)->size(1));
            for (int32_t _1586_j = _9739_; _1586_j < _9740_; ++_1586_j)
            {
              {
                _1583_err = (_1583_err || ((((*_1584_sp)(_1585_i,_1586_j)) < (int)0) || (((*_1584_sp)(_1585_i,_1586_j)) >= _ptr__1559_shape[_1586_j])));
              }
            }
            if ((!_1583_err))
            {
              {
                int64_t _1587_linidx = (int)0;
                int32_t _9741_ = (int)0;
                int32_t _9742_ = (int)((_1584_sp)->size(1));
                for (int32_t _1588_j = _9741_; _1588_j < _9742_; ++_1588_j)
                {
                  {
                    _1587_linidx += safe_mul( _ptr__1561_strides[_1588_j],((*_1584_sp)(_1585_i,_1588_j)) );
                  }
                }
                _ptr__1580_sparsity[_1585_i] = _1587_linidx;
              }
            }
            {}
          }
        }
        if (_1583_err)
        {
          {
            throw ::mosek::fusion::SparseFormatError(std::string ("Sparsity pattern is out of bounds"));
          }
        }
        {}
      }
      std::shared_ptr< monty::ndarray< int32_t,2 > > _1589_midxs = mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->sparsity;
      int32_t _1590_maxdim = (int)0;
      int32_t _9743_ = (int)0;
      int32_t _9744_ = _1560_nd;
      for (int32_t _1591_i = _9743_; _1591_i < _9744_; ++_1591_i)
      {
        {
          if ((_1590_maxdim < _ptr__1559_shape[_1591_i]))
          {
            {
              _1590_maxdim = _ptr__1559_shape[_1591_i];
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1592_curperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1582_n)));
      _checked_ptr_1<int32_t> _ptr__1592_curperm(_1592_curperm ? _1592_curperm->raw() : nullptr,_1592_curperm ? _1592_curperm->size(0) : 0);
      int32_t _9745_ = (int)0;
      int32_t _9746_ = _1582_n;
      for (int32_t _1593_i = _9745_; _1593_i < _9746_; ++_1593_i)
      {
        {
          _ptr__1592_curperm[_1593_i] = _1593_i;
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1594_tgtperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1582_n)));
      _checked_ptr_1<int32_t> _ptr__1594_tgtperm(_1594_tgtperm ? _1594_tgtperm->raw() : nullptr,_1594_tgtperm ? _1594_tgtperm->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1595_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _1590_maxdim,(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__1595_ptr(_1595_ptr ? _1595_ptr->raw() : nullptr,_1595_ptr ? _1595_ptr->size(0) : 0);
      int32_t _9747_ = (int)0;
      int32_t _9748_ = _1560_nd;
      for (int32_t _1596_dd = _9747_; _1596_dd < _9748_; ++_1596_dd)
      {
        {
          {
            int32_t _1597_d = ((_1560_nd - _1596_dd) - (int)1);
            int32_t _9749_ = (int)0;
            int32_t _9750_ = safe_add( _ptr__1559_shape[_1597_d],(int)1 );
            for (int32_t _1598_i = _9749_; _1598_i < _9750_; ++_1598_i)
            {
              {
                _ptr__1595_ptr[_1598_i] = (int)0;
              }
            }
            int32_t _9751_ = (int)0;
            int32_t _9752_ = _1582_n;
            for (int32_t _1599_i = _9751_; _1599_i < _9752_; ++_1599_i)
            {
              {
                ++ _ptr__1595_ptr[safe_add( ((*_1589_midxs)(_1599_i,_1597_d)),(int)1 )];
              }
            }
            int32_t _9753_ = (int)0;
            int32_t _9754_ = _ptr__1559_shape[_1597_d];
            for (int32_t _1600_i = _9753_; _1600_i < _9754_; ++_1600_i)
            {
              {
                _ptr__1595_ptr[safe_add( _1600_i,(int)1 )] += _ptr__1595_ptr[_1600_i];
              }
            }
            int32_t _9755_ = (int)0;
            int32_t _9756_ = _1582_n;
            for (int32_t _1601_ii = _9755_; _1601_ii < _9756_; ++_1601_ii)
            {
              {
                int32_t _1602_i = _ptr__1592_curperm[_1601_ii];
                _ptr__1594_tgtperm[_ptr__1595_ptr[((*_1589_midxs)(_1602_i,_1597_d))]] = _1602_i;
                ++ _ptr__1595_ptr[((*_1589_midxs)(_1602_i,_1597_d))];
              }
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1603_tmp = _1592_curperm;
          _checked_ptr_1<int32_t> _ptr__1603_tmp(_1603_tmp ? _1603_tmp->raw() : nullptr,_1603_tmp ? _1603_tmp->size(0) : 0);
          _1592_curperm = _1594_tgtperm;
          _ptr__1592_curperm.update(_1592_curperm ? _1592_curperm->raw() : nullptr, _1592_curperm ? _1592_curperm->size(0) : 0);
          _1594_tgtperm = _1603_tmp;
          _ptr__1594_tgtperm.update(_1594_tgtperm ? _1594_tgtperm->raw() : nullptr, _1594_tgtperm ? _1594_tgtperm->size(0) : 0);
        }
      }
      int32_t _9757_ = (int)0;
      int32_t _9758_ = _1582_n;
      for (int32_t _1604_ii = _9757_; _1604_ii < _9758_; ++_1604_ii)
      {
        {
          int32_t _1605_i = _ptr__1592_curperm[_1604_ii];
          int64_t _1606_k = (int)0;
          int32_t _9759_ = (int)0;
          int32_t _9760_ = _1560_nd;
          for (int32_t _1607_j = _9759_; _1607_j < _9760_; ++_1607_j)
          {
            {
              _1606_k += safe_mul( _ptr__1561_strides[_1607_j],((*_1589_midxs)(_1605_i,_1607_j)) );
            }
          }
          _ptr__1580_sparsity[_1604_ii] = _1606_k;
        }
      }
    }
  }
  {}
  int32_t _9761_;
  bool _9762_ = (NULL != _1580_sparsity.get());
  if (_9762_)
  {
    _9761_ = (int)((_1580_sparsity)->size(0));
  }
  else
  {
    _9761_ = _1563_domsize;
  }
  int32_t _1608_nvaritems = _9761_;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1609_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1608_nvaritems)));
  _checked_ptr_1<int32_t> _ptr__1609_nativeidxs(_1609_nativeidxs ? _1609_nativeidxs->raw() : nullptr,_1609_nativeidxs ? _1609_nativeidxs->size(0) : 0);
  int32_t _1610_varblockid = linearvar_alloc(_1608_nvaritems,_1609_nativeidxs);
  if (((int)((_1555_name).size()) > (int)0))
  {
    {
      var_map->setItem(_1555_name,_1610_varblockid);
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1611_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _1611_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1555_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if ((_1560_nd > (int)0))
      {
        {
          _1611_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
          int32_t _9763_ = (int)1;
          int32_t _9764_ = _1560_nd;
          for (int32_t _1612_i = _9763_; _1612_i < _9764_; ++_1612_i)
          {
            {
              _1611_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1612_i);
            }
          }
        }
      }
      {}
      _1611_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames.get()))
      {
        {
          task_format_var_names(_1609_nativeidxs,_1611_sb->toString(),_1559_shape,_1580_sparsity,mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->indexnames);
        }
      }
      else
      {
        {
          task_format_var_names(_1609_nativeidxs,_1611_sb->toString(),_1559_shape,_1580_sparsity,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  std::shared_ptr< monty::ndarray< double,1 > > _1613_bl;
  _checked_ptr_1<double> _ptr__1613_bl(_1613_bl ? _1613_bl->raw() : nullptr,_1613_bl ? _1613_bl->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1614_bu;
  _checked_ptr_1<double> _ptr__1614_bu(_1614_bu ? _1614_bu->raw() : nullptr,_1614_bu ? _1614_bu->size(0) : 0);
  if (mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->scalable)
  {
    {
      std::vector<double> _9765_;
      for (int32_t _1615_i = (int)0, _9766_ = _1608_nvaritems; _1615_i < _9766_ ; ++_1615_i)
      {
        _9765_.push_back(((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->lb)((int)0)));
      }
      auto _9767_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9765_.size()),_9765_.begin(),_9765_.end()));
      _1613_bl = _9767_;
      _ptr__1613_bl.update(_1613_bl ? _1613_bl->raw() : nullptr, _1613_bl ? _1613_bl->size(0) : 0);
      std::vector<double> _9768_;
      for (int32_t _1616_i = (int)0, _9769_ = _1608_nvaritems; _1616_i < _9769_ ; ++_1616_i)
      {
        _9768_.push_back(((*mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->ub)((int)0)));
      }
      auto _9770_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_9768_.size()),_9768_.begin(),_9768_.end()));
      _1614_bu = _9770_;
      _ptr__1614_bu.update(_1614_bu ? _1614_bu->raw() : nullptr, _1614_bu ? _1614_bu->size(0) : 0);
    }
  }
  else
  {
    {
      _1613_bl = mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->lb;
      _ptr__1613_bl.update(_1613_bl ? _1613_bl->raw() : nullptr, _1613_bl ? _1613_bl->size(0) : 0);
      _1614_bu = mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->ub;
      _ptr__1614_bu.update(_1614_bu ? _1614_bu->raw() : nullptr, _1614_bu ? _1614_bu->size(0) : 0);
    }
  }
  task_var_putboundlist_ra(_1609_nativeidxs,_1613_bl,_1614_bu);
  monty::rc_ptr< ::mosek::fusion::RangedVariable > _1617_res = ::mosek::fusion::p_RangedVariable::_new_RangedVariable(::mosek::fusion::Model::t(_pubthis),_1555_name,(int64_t)(_1610_varblockid),_1559_shape,_1580_sparsity,_1609_nativeidxs);
  if (mosek::fusion::p_RangeDomain::_get_impl(_1558_dom)->cardinal_flag)
  {
    {
      task_var_putintlist(_1609_nativeidxs);
    }
  }
  {}
  ((*vars)(_1610_varblockid)) = (_1617_res).as<::mosek::fusion::ModelVariable>();
  return _1617_res;
}
// End mosek.fusion.Model.ranged_variable

// Begin mosek.fusion.Model.variable_
// Method mosek.fusion.Model.variable_ @ bld/docker-win/final/default/src/fusion/Model.mbi:2190:6-2440:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable_(const std::string & _1618_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1619_shp,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1620_dom_)
{
  _checked_ptr_1<int32_t> _ptr__1619_shp(_1619_shp ? _1619_shp->raw() : nullptr, _1619_shp ? _1619_shp->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::ConeDomain > _1621_dom = mosek::fusion::p_ConeDomain::_get_impl(_1620_dom_.get())->__mosek_2fusion_2ConeDomain__finalize_and_validate(_1619_shp);
  if ((((int)((_1618_name).size()) > (int)0) && hasVariable(_1618_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate variable name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1618_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1622_shape = mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__1622_shape(_1622_shape ? _1622_shape->raw() : nullptr,_1622_shape ? _1622_shape->size(0) : 0);
  int32_t _1623_nd = (int)((_1622_shape)->size(0));
  int32_t _1624_coneaxis = _1621_dom->getAxis();
  int32_t _1625_conesize = _ptr__1622_shape[_1624_coneaxis];
  int32_t _1626_d1 = (int)1;
  int32_t _1627_d0 = (int)1;
  int32_t _1628_domsize = (int)1;
  int32_t _9771_ = (int)0;
  int32_t _9772_ = _1623_nd;
  for (int32_t _1629_i = _9771_; _1629_i < _9772_; ++_1629_i)
  {
    {
      _1628_domsize *= _ptr__1622_shape[_1629_i];
    }
  }
  int32_t _9773_ = (int)0;
  int32_t _9774_ = _1624_coneaxis;
  for (int32_t _1630_i = _9773_; _1630_i < _9774_; ++_1630_i)
  {
    {
      _1627_d0 *= _ptr__1622_shape[_1630_i];
    }
  }
  int32_t _9775_ = safe_add( _1624_coneaxis,(int)1 );
  int32_t _9776_ = _1623_nd;
  for (int32_t _1631_i = _9775_; _1631_i < _9776_; ++_1631_i)
  {
    {
      _1626_d1 *= _ptr__1622_shape[_1631_i];
    }
  }
  int32_t _1632_numcone = safe_mul( _1627_d0,_1626_d1 );
  int64_t _1633_domainidx;
  if ((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InQCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for quadratic cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_quad(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InRotatedQCone))
  {
    {
      if ((_1625_conesize < (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for rotated quadratic cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_rquad(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InPExpCone))
  {
    {
      if ((_1625_conesize != (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for exponential cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_pexp();
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InPPowCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for power cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_ppow(_1625_conesize,mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->alpha);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InDExpCone))
  {
    {
      if ((_1625_conesize != (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual exponential cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_dexp();
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InDPowCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual power cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_dpow(_1625_conesize,mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->alpha);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InPGeoMeanCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for primal geometric mean cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_pgeomean(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InDGeoMeanCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual geometric mean cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_dgeomean(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::Positive))
  {
    {
      _1633_domainidx = task_append_domain_rpos(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InSVecPSDCone))
  {
    {
      int32_t _1634_d = (int32_t)((::mosek::fusion::Utils::Tools::sqrt((double)(safe_add( (int)1,safe_mul( (int)8,_1625_conesize ) ))) - (int)1) / (int)2);
      if (((safe_mul( _1634_d,safe_add( _1634_d,(int)1 ) ) / (int)2) != _1625_conesize))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for vector positive semidefinite cone"))->toString());
        }
      }
      {}
      _1633_domainidx = task_append_domain_svec_psd(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::Negative))
  {
    {
      _1633_domainidx = task_append_domain_rneg(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::Unbounded))
  {
    {
      _1633_domainidx = task_append_domain_r(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::Zero))
  {
    {
      _1633_domainidx = task_append_domain_rzero(_1625_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->key == ::mosek::fusion::QConeKey::InPSDCone))
  {
    {
      if ((_1625_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for positive semidefinite cone"))->toString());
        }
      }
      else
      {
        {
          int32_t _1635_d = (int32_t)((::mosek::fusion::Utils::Tools::sqrt((double)(safe_add( (int)1,safe_mul( (int)8,_1625_conesize ) ))) - (int)1) / (int)2);
          if (((safe_mul( _1635_d,safe_add( _1635_d,(int)1 ) ) / (int)2) != _1625_conesize))
          {
            {
              throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_1625_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for positive semidefinite cone"))->toString());
            }
          }
          {}
        }
      }
      _1633_domainidx = task_append_domain_svec_psd(_1625_conesize);
    }
  }
  else
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal error: Invalid cone type"));
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1636_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_mul( _1632_numcone,_1625_conesize ))));
  _checked_ptr_1<int32_t> _ptr__1636_nativeidxs(_1636_nativeidxs ? _1636_nativeidxs->raw() : nullptr,_1636_nativeidxs ? _1636_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1637_accidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1632_numcone)));
  _checked_ptr_1<int32_t> _ptr__1637_accidxs(_1637_accidxs ? _1637_accidxs->raw() : nullptr,_1637_accidxs ? _1637_accidxs->size(0) : 0);
  int32_t _1638_varid = conicvar_alloc(_1633_domainidx,_1625_conesize,_1632_numcone,_1637_accidxs,_1636_nativeidxs);
  task_var_putboundlist_fr(_1636_nativeidxs);
  if (mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->int_flag)
  {
    {
      task_var_putintlist(_1636_nativeidxs);
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1639_permidxs = _1636_nativeidxs;
  _checked_ptr_1<int32_t> _ptr__1639_permidxs(_1639_permidxs ? _1639_permidxs->raw() : nullptr,_1639_permidxs ? _1639_permidxs->size(0) : 0);
  if ((_1624_coneaxis < ((int)((_1622_shape)->size(0)) - (int)1)))
  {
    {
      _1639_permidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)((_1636_nativeidxs)->size(0)))));
      _ptr__1639_permidxs.update(_1639_permidxs ? _1639_permidxs->raw() : nullptr, _1639_permidxs ? _1639_permidxs->size(0) : 0);
      int32_t _1640_p = (int)0;
      int32_t _9777_ = (int)0;
      int32_t _9778_ = _1627_d0;
      for (int32_t _1641_i0 = _9777_; _1641_i0 < _9778_; ++_1641_i0)
      {
        {
          int32_t _9779_ = (int)0;
          int32_t _9780_ = _1626_d1;
          for (int32_t _1642_i1 = _9779_; _1642_i1 < _9780_; ++_1642_i1)
          {
            {
              int32_t _9781_ = (int)0;
              int32_t _9782_ = _1625_conesize;
              for (int32_t _1643_k = _9781_; _1643_k < _9782_; ++_1643_k)
              {
                {
                  _ptr__1639_permidxs[_1640_p] = _ptr__1636_nativeidxs[safe_add( safe_mul( safe_add( safe_mul( _1641_i0,_1625_conesize ),_1643_k ),_1626_d1 ),_1642_i1 )];
                  ++ _1640_p;
                }
              }
            }
          }
        }
      }
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ConicVariable > _1644_res = ::mosek::fusion::p_ConicVariable::_new_ConicVariable(::mosek::fusion::Model::t(_pubthis),_1618_name,_1638_varid,_1622_shape,_1636_nativeidxs);
  ((*vars)(_1638_varid)) = (_1644_res).as<::mosek::fusion::ModelVariable>();
  if (((int)((_1618_name).size()) > (int)0))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1645_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      {
        _1645_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1618_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
        if ((_1623_nd > (int)0))
        {
          {
            _1645_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
            int32_t _9783_ = (int)1;
            int32_t _9784_ = _1623_nd;
            for (int32_t _1646_i = _9783_; _1646_i < _9784_; ++_1646_i)
            {
              {
                _1645_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1646_i);
              }
            }
          }
        }
        {}
        _1645_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
        if ((NULL != mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->indexnames.get()))
        {
          {
            task_format_var_names(_1639_permidxs,_1645_sb->toString(),_1622_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->indexnames);
          }
        }
        else
        {
          {
            task_format_var_names(_1639_permidxs,_1645_sb->toString(),_1622_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
          }
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1647_accidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1632_numcone)));
      _checked_ptr_1<int32_t> _ptr__1647_accidxs(_1647_accidxs ? _1647_accidxs->raw() : nullptr,_1647_accidxs ? _1647_accidxs->size(0) : 0);
      acc_block_map->get(((*var_block_acc_id)(_1638_varid)),_1647_accidxs,(int)0);
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _1648_accshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(((int)((_1622_shape)->size(0)) - (int)1))));
        _checked_ptr_1<int32_t> _ptr__1648_accshape(_1648_accshape ? _1648_accshape->raw() : nullptr,_1648_accshape ? _1648_accshape->size(0) : 0);
        int32_t _9785_ = (int)0;
        int32_t _9786_ = _1624_coneaxis;
        for (int32_t _1649_i = _9785_; _1649_i < _9786_; ++_1649_i)
        {
          {
            _ptr__1648_accshape[_1649_i] = _ptr__1622_shape[_1649_i];
          }
        }
        int32_t _9787_ = safe_add( _1624_coneaxis,(int)1 );
        int32_t _9788_ = _1623_nd;
        for (int32_t _1650_i = _9787_; _1650_i < _9788_; ++_1650_i)
        {
          {
            _ptr__1648_accshape[(_1650_i - (int)1)] = _ptr__1622_shape[_1650_i];
          }
        }
        monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1651_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
        _1651_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1618_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
        if (((_1623_nd - (int)1) > (int)0))
        {
          {
            _1651_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
            int32_t _9789_ = (int)1;
            int32_t _9790_ = _1623_nd;
            for (int32_t _1652_i = _9789_; _1652_i < _9790_; ++_1652_i)
            {
              {
                _1651_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1652_i);
              }
            }
          }
        }
        {}
        _1651_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
        if ((NULL != mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->indexnames.get()))
        {
          {
            std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _1653_indexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape((_1623_nd - (int)1))));
            int32_t _9791_ = (int)0;
            int32_t _9792_ = _1624_coneaxis;
            for (int32_t _1654_i = _9791_; _1654_i < _9792_; ++_1654_i)
            {
              {
                ((*_1653_indexnames)(_1654_i)) = ((*mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->indexnames)(_1654_i));
              }
            }
            int32_t _9793_ = safe_add( _1624_coneaxis,(int)1 );
            int32_t _9794_ = _1623_nd;
            for (int32_t _1655_i = _9793_; _1655_i < _9794_; ++_1655_i)
            {
              {
                ((*_1653_indexnames)((_1655_i - (int)1))) = ((*mosek::fusion::p_ConeDomain::_get_impl(_1621_dom)->indexnames)(_1655_i));
              }
            }
            std::vector<int64_t> _9795_;
            for (int32_t _1656_i = (int)0, _9796_ = _1632_numcone; _1656_i < _9796_ ; ++_1656_i)
            {
              _9795_.push_back((int64_t)_ptr__1647_accidxs[_1656_i]);
            }
            auto _9797_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9795_.size()),_9795_.begin(),_9795_.end()));
            task_format_acc_names(_9797_,_1651_sb->toString(),_1648_accshape,_1653_indexnames);
          }
        }
        else
        {
          {
            std::vector<int64_t> _9798_;
            for (int32_t _1657_i = (int)0, _9799_ = _1632_numcone; _1657_i < _9799_ ; ++_1657_i)
            {
              _9798_.push_back((int64_t)_ptr__1647_accidxs[_1657_i]);
            }
            auto _9800_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9798_.size()),_9798_.begin(),_9798_.end()));
            task_format_acc_names(_9800_,_1651_sb->toString(),_1648_accshape,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
          }
        }
      }
      var_map->setItem(_1618_name,_1638_varid);
    }
  }
  {}
  return (_1644_res).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Model.variable_

// Begin mosek.fusion.Model.variable_
// Method mosek.fusion.Model.variable_ @ bld/docker-win/final/default/src/fusion/Model.mbi:1999:6-2185:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable_(const std::string & _1658_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1659_shp,monty::rc_ptr< ::mosek::fusion::LinearDomain > _1660_dom_)
{
  _checked_ptr_1<int32_t> _ptr__1659_shp(_1659_shp ? _1659_shp->raw() : nullptr, _1659_shp ? _1659_shp->size(0) : 0);
  if ((((int)((_1658_name).size()) > (int)0) && hasVariable(_1658_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate variable name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1658_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::LinearDomain > _1661_dom = mosek::fusion::p_LinearDomain::_get_impl(_1660_dom_.get())->__mosek_2fusion_2LinearDomain__finalize_and_validate(_1659_shp);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1662_shape = mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__1662_shape(_1662_shape ? _1662_shape->raw() : nullptr,_1662_shape ? _1662_shape->size(0) : 0);
  int32_t _1663_nd = (int)((_1662_shape)->size(0));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1664_strides = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1663_nd)));
  _checked_ptr_1<int32_t> _ptr__1664_strides(_1664_strides ? _1664_strides->raw() : nullptr,_1664_strides ? _1664_strides->size(0) : 0);
  if ((_1663_nd > (int)0))
  {
    {
      _ptr__1664_strides[(_1663_nd - (int)1)] = (int)1;
      int32_t _9801_ = (int)1;
      int32_t _9802_ = _1663_nd;
      for (int32_t _1665_i = _9801_; _1665_i < _9802_; ++_1665_i)
      {
        {
          _ptr__1664_strides[((_1663_nd - _1665_i) - (int)1)] = safe_mul( _ptr__1664_strides[(_1663_nd - _1665_i)],_ptr__1662_shape[(_1663_nd - _1665_i)] );
        }
      }
    }
  }
  {}
  int32_t _1666_domsize = (int)1;
  int32_t _9803_ = (int)0;
  int32_t _9804_ = (int)((_1662_shape)->size(0));
  for (int32_t _1667_i = _9803_; _1667_i < _9804_; ++_1667_i)
  {
    {
      _1666_domsize *= _ptr__1662_shape[_1667_i];
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1668_axisptr = nullptr;
  _checked_ptr_1<int32_t> _ptr__1668_axisptr(_1668_axisptr ? _1668_axisptr->raw() : nullptr,_1668_axisptr ? _1668_axisptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1669_nameptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1669_nameptr(_1669_nameptr ? _1669_nameptr->raw() : nullptr,_1669_nameptr ? _1669_nameptr->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1670_axisnames = nullptr;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1671_accaxisptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1671_accaxisptr(_1671_accaxisptr ? _1671_accaxisptr->raw() : nullptr,_1671_accaxisptr ? _1671_accaxisptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1672_accnameptr = nullptr;
  _checked_ptr_1<int64_t> _ptr__1672_accnameptr(_1672_accnameptr ? _1672_accnameptr->raw() : nullptr,_1672_accnameptr ? _1672_accnameptr->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1673_accaxisnames = nullptr;
  if ((((int)((_1658_name).size()) > (int)0) && (NULL != mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames.get())))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1674_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1675_accsb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      int32_t _1676_axisp = (int)0;
      int64_t _1677_namep = (int)0;
      int64_t _1678_numnames = (int)0;
      if (((int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)->size(0)) != _1663_nd))
      {
        {
          throw ::mosek::fusion::DomainError(std::string ("Invalid index name definition"));
        }
      }
      {}
      int32_t _9805_ = (int)0;
      int32_t _9806_ = (int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)->size(0));
      for (int32_t _1679_i = _9805_; _1679_i < _9806_; ++_1679_i)
      {
        {
          if ((NULL != ((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)(_1679_i)).get()))
          {
            {
              if ((_ptr__1662_shape[_1679_i] != (int)((((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)(_1679_i)))->size(0))))
              {
                {
                  throw ::mosek::fusion::DomainError(std::string ("Invalid index name definition"));
                }
              }
              {}
              _1678_numnames += _ptr__1662_shape[_1679_i];
            }
          }
          {}
        }
      }
      _1669_nameptr = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _1678_numnames,(int)1 ))));
      _ptr__1669_nameptr.update(_1669_nameptr ? _1669_nameptr->raw() : nullptr, _1669_nameptr ? _1669_nameptr->size(0) : 0);
      std::vector<int32_t> _9807_;
      for (int32_t _1680_i = (int)0, _9808_ = _1663_nd; _1680_i < _9808_ ; ++_1680_i)
      {
        _9807_.push_back((-(int)1));
      }
      auto _9809_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9807_.size()),_9807_.begin(),_9807_.end()));
      _1668_axisptr = _9809_;
      _ptr__1668_axisptr.update(_1668_axisptr ? _1668_axisptr->raw() : nullptr, _1668_axisptr ? _1668_axisptr->size(0) : 0);
      int32_t _9810_ = (int)0;
      int32_t _9811_ = (int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)->size(0));
      for (int32_t _1681_i = _9810_; _1681_i < _9811_; ++_1681_i)
      {
        {
          if ((NULL != ((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)(_1681_i)).get()))
          {
            {
              _ptr__1668_axisptr[_1681_i] = _1676_axisp;
              int32_t _9812_ = (int)0;
              int32_t _9813_ = _ptr__1662_shape[_1681_i];
              for (int32_t _1682_j = _9812_; _1682_j < _9813_; ++_1682_j)
              {
                {
                  _1674_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)(_1681_i)))(_1682_j)));
                  ++ _1676_axisp;
                  _1677_namep += (int)((((*((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames)(_1681_i)))(_1682_j))).size());
                  _ptr__1669_nameptr[_1676_axisp] = _1677_namep;
                }
              }
            }
          }
          {}
        }
      }
      _1670_axisnames = _1674_sb;
      _1673_accaxisnames = _1675_accsb;
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1683_sparsity = nullptr;
  _checked_ptr_1<int64_t> _ptr__1683_sparsity(_1683_sparsity ? _1683_sparsity->raw() : nullptr,_1683_sparsity ? _1683_sparsity->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1684_perm = nullptr;
  _checked_ptr_1<int32_t> _ptr__1684_perm(_1684_perm ? _1684_perm->raw() : nullptr,_1684_perm ? _1684_perm->size(0) : 0);
  if (mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->empty)
  {
    {
      _1683_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0)));
      _ptr__1683_sparsity.update(_1683_sparsity ? _1683_sparsity->raw() : nullptr, _1683_sparsity ? _1683_sparsity->size(0) : 0);
    }
  }
  else if((NULL != mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->sparsity.get()))
  {
    {
      if (((int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->sparsity)->size(1)) != _1663_nd))
      {
        {
          throw ::mosek::fusion::SparseFormatError(std::string ("Sparsity pattern is not correct"));
        }
      }
      {}
      int32_t _1685_n = (int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->sparsity)->size(0));
      _1683_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1685_n)));
      _ptr__1683_sparsity.update(_1683_sparsity ? _1683_sparsity->raw() : nullptr, _1683_sparsity ? _1683_sparsity->size(0) : 0);
      {
        bool _1686_err = false;
        std::shared_ptr< monty::ndarray< int32_t,2 > > _1687_sp = mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->sparsity;
        int32_t _9814_ = (int)0;
        int32_t _9815_ = _1685_n;
        for (int32_t _1688_i = _9814_; _1688_i < _9815_; ++_1688_i)
        {
          {
            int32_t _9816_ = (int)0;
            int32_t _9817_ = (int)((_1687_sp)->size(1));
            for (int32_t _1689_j = _9816_; _1689_j < _9817_; ++_1689_j)
            {
              {
                _1686_err = (_1686_err || ((((*_1687_sp)(_1688_i,_1689_j)) < (int)0) || (((*_1687_sp)(_1688_i,_1689_j)) >= _ptr__1662_shape[_1689_j])));
              }
            }
            if ((!_1686_err))
            {
              {
                int64_t _1690_linidx = (int)0;
                int32_t _9818_ = (int)0;
                int32_t _9819_ = (int)((_1687_sp)->size(1));
                for (int32_t _1691_j = _9818_; _1691_j < _9819_; ++_1691_j)
                {
                  {
                    _1690_linidx += safe_mul( _ptr__1664_strides[_1691_j],((*_1687_sp)(_1688_i,_1691_j)) );
                  }
                }
                _ptr__1683_sparsity[_1688_i] = _1690_linidx;
              }
            }
            {}
          }
        }
        if (_1686_err)
        {
          {
            throw ::mosek::fusion::SparseFormatError(std::string ("Sparsity pattern is out of bounds"));
          }
        }
        {}
      }
      std::shared_ptr< monty::ndarray< int32_t,2 > > _1692_midxs = mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->sparsity;
      int32_t _1693_maxdim = (int)0;
      int32_t _9820_ = (int)0;
      int32_t _9821_ = _1663_nd;
      for (int32_t _1694_i = _9820_; _1694_i < _9821_; ++_1694_i)
      {
        {
          if ((_1693_maxdim < _ptr__1662_shape[_1694_i]))
          {
            {
              _1693_maxdim = _ptr__1662_shape[_1694_i];
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1695_curperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1685_n)));
      _checked_ptr_1<int32_t> _ptr__1695_curperm(_1695_curperm ? _1695_curperm->raw() : nullptr,_1695_curperm ? _1695_curperm->size(0) : 0);
      int32_t _9822_ = (int)0;
      int32_t _9823_ = _1685_n;
      for (int32_t _1696_i = _9822_; _1696_i < _9823_; ++_1696_i)
      {
        {
          _ptr__1695_curperm[_1696_i] = _1696_i;
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1697_tgtperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1685_n)));
      _checked_ptr_1<int32_t> _ptr__1697_tgtperm(_1697_tgtperm ? _1697_tgtperm->raw() : nullptr,_1697_tgtperm ? _1697_tgtperm->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1698_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _1693_maxdim,(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__1698_ptr(_1698_ptr ? _1698_ptr->raw() : nullptr,_1698_ptr ? _1698_ptr->size(0) : 0);
      int32_t _9824_ = (int)0;
      int32_t _9825_ = _1663_nd;
      for (int32_t _1699_dd = _9824_; _1699_dd < _9825_; ++_1699_dd)
      {
        {
          {
            int32_t _1700_d = ((_1663_nd - _1699_dd) - (int)1);
            int32_t _9826_ = (int)0;
            int32_t _9827_ = safe_add( _ptr__1662_shape[_1700_d],(int)1 );
            for (int32_t _1701_i = _9826_; _1701_i < _9827_; ++_1701_i)
            {
              {
                _ptr__1698_ptr[_1701_i] = (int)0;
              }
            }
            int32_t _9828_ = (int)0;
            int32_t _9829_ = _1685_n;
            for (int32_t _1702_i = _9828_; _1702_i < _9829_; ++_1702_i)
            {
              {
                ++ _ptr__1698_ptr[safe_add( ((*_1692_midxs)(_1702_i,_1700_d)),(int)1 )];
              }
            }
            int32_t _9830_ = (int)0;
            int32_t _9831_ = _ptr__1662_shape[_1700_d];
            for (int32_t _1703_i = _9830_; _1703_i < _9831_; ++_1703_i)
            {
              {
                _ptr__1698_ptr[safe_add( _1703_i,(int)1 )] += _ptr__1698_ptr[_1703_i];
              }
            }
            int32_t _9832_ = (int)0;
            int32_t _9833_ = _1685_n;
            for (int32_t _1704_ii = _9832_; _1704_ii < _9833_; ++_1704_ii)
            {
              {
                int32_t _1705_i = _ptr__1695_curperm[_1704_ii];
                _ptr__1697_tgtperm[_ptr__1698_ptr[((*_1692_midxs)(_1705_i,_1700_d))]] = _1705_i;
                ++ _ptr__1698_ptr[((*_1692_midxs)(_1705_i,_1700_d))];
              }
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _1706_tmp = _1695_curperm;
          _checked_ptr_1<int32_t> _ptr__1706_tmp(_1706_tmp ? _1706_tmp->raw() : nullptr,_1706_tmp ? _1706_tmp->size(0) : 0);
          _1695_curperm = _1697_tgtperm;
          _ptr__1695_curperm.update(_1695_curperm ? _1695_curperm->raw() : nullptr, _1695_curperm ? _1695_curperm->size(0) : 0);
          _1697_tgtperm = _1706_tmp;
          _ptr__1697_tgtperm.update(_1697_tgtperm ? _1697_tgtperm->raw() : nullptr, _1697_tgtperm ? _1697_tgtperm->size(0) : 0);
        }
      }
      int32_t _9834_ = (int)0;
      int32_t _9835_ = _1685_n;
      for (int32_t _1707_ii = _9834_; _1707_ii < _9835_; ++_1707_ii)
      {
        {
          int32_t _1708_i = _ptr__1695_curperm[_1707_ii];
          int64_t _1709_k = (int)0;
          int32_t _9836_ = (int)0;
          int32_t _9837_ = _1663_nd;
          for (int32_t _1710_j = _9836_; _1710_j < _9837_; ++_1710_j)
          {
            {
              _1709_k += safe_mul( _ptr__1664_strides[_1710_j],((*_1692_midxs)(_1708_i,_1710_j)) );
            }
          }
          _ptr__1683_sparsity[_1707_ii] = _1709_k;
        }
      }
    }
  }
  {}
  int32_t _9838_;
  bool _9839_ = (NULL != _1683_sparsity.get());
  if (_9839_)
  {
    _9838_ = (int)((_1683_sparsity)->size(0));
  }
  else
  {
    _9838_ = _1666_domsize;
  }
  int32_t _1711_nvaritems = _9838_;
  std::shared_ptr< monty::ndarray< double,1 > > _1712_bnds = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1711_nvaritems)));
  _checked_ptr_1<double> _ptr__1712_bnds(_1712_bnds ? _1712_bnds->raw() : nullptr,_1712_bnds ? _1712_bnds->size(0) : 0);
  if ((NULL != mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->bnd.get()))
  {
    {
      if (((int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->bnd)->size(0)) == (int)1))
      {
        {
          int32_t _9840_ = (int)0;
          int32_t _9841_ = _1711_nvaritems;
          for (int32_t _1713_i = _9840_; _1713_i < _9841_; ++_1713_i)
          {
            {
              _ptr__1712_bnds[_1713_i] = ((*mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->bnd)((int)0));
            }
          }
        }
      }
      else if(((int)((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->bnd)->size(0)) == _1711_nvaritems))
      {
        {
          ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->bnd,(int)0,_1712_bnds,(int)0,_1711_nvaritems);
        }
      }
      else
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Invalid right hand side shape in domain"));
        }
      }
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1714_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1711_nvaritems)));
  _checked_ptr_1<int32_t> _ptr__1714_nativeidxs(_1714_nativeidxs ? _1714_nativeidxs->raw() : nullptr,_1714_nativeidxs ? _1714_nativeidxs->size(0) : 0);
  int32_t _1715_varblockid = linearvar_alloc(_1711_nvaritems,_1714_nativeidxs);
  if ((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->key == ::mosek::fusion::RelationKey::IsFree))
  {
    {
      task_var_putboundlist_fr(_1714_nativeidxs);
    }
  }
  {}
  if ((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->key == ::mosek::fusion::RelationKey::LessThan))
  {
    {
      task_var_putboundlist_up(_1714_nativeidxs,_1712_bnds);
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->key == ::mosek::fusion::RelationKey::GreaterThan))
  {
    {
      task_var_putboundlist_lo(_1714_nativeidxs,_1712_bnds);
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->key == ::mosek::fusion::RelationKey::EqualsTo))
  {
    {
      task_var_putboundlist_fx(_1714_nativeidxs,_1712_bnds);
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::LinearVariable > _1716_res = ::mosek::fusion::p_LinearVariable::_new_LinearVariable(::mosek::fusion::Model::t(_pubthis),_1658_name,(int64_t)(_1715_varblockid),_1662_shape,_1683_sparsity,_1714_nativeidxs);
  ((*vars)(_1715_varblockid)) = (_1716_res).as<::mosek::fusion::ModelVariable>();
  if (((int)((_1658_name).size()) > (int)0))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1717_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _1717_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1658_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if ((_1663_nd > (int)0))
      {
        {
          _1717_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
          int32_t _9842_ = (int)1;
          int32_t _9843_ = _1663_nd;
          for (int32_t _1718_i = _9842_; _1718_i < _9843_; ++_1718_i)
          {
            {
              _1717_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1718_i);
            }
          }
        }
      }
      {}
      _1717_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames.get()))
      {
        {
          task_format_var_names(_1714_nativeidxs,_1717_sb->toString(),_1662_shape,_1683_sparsity,mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->indexnames);
        }
      }
      else
      {
        {
          task_format_var_names(_1714_nativeidxs,_1717_sb->toString(),_1662_shape,_1683_sparsity,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
      var_map->setItem(_1658_name,_1715_varblockid);
    }
  }
  {}
  if (mosek::fusion::p_LinearDomain::_get_impl(_1661_dom)->cardinal_flag)
  {
    {
      task_var_putintlist(_1714_nativeidxs);
    }
  }
  {}
  return (_1716_res).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Model.variable_

// Begin mosek.fusion.Model.variable_
// Method mosek.fusion.Model.variable_ @ bld/docker-win/final/default/src/fusion/Model.mbi:1815:6-1937:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__variable_(const std::string & _1719_name,std::shared_ptr< monty::ndarray< int32_t,1 > > _1720_shp,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1721_dom_)
{
  _checked_ptr_1<int32_t> _ptr__1720_shp(_1720_shp ? _1720_shp->raw() : nullptr, _1720_shp ? _1720_shp->size(0) : 0);
  if ((((int)((_1719_name).size()) > (int)0) && hasVariable(_1719_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate variable name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1719_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::PSDDomain > _1722_dom = mosek::fusion::p_PSDDomain::_get_impl(_1721_dom_.get())->__mosek_2fusion_2PSDDomain__finalize_and_validate(_1720_shp);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1723_shape = mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->shape;
  _checked_ptr_1<int32_t> _ptr__1723_shape(_1723_shape ? _1723_shape->raw() : nullptr,_1723_shape ? _1723_shape->size(0) : 0);
  int32_t _1724_conedim1 = mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->conedim1;
  int32_t _1725_conedim2 = mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->conedim2;
  int32_t _1726_nd = (int)((_1723_shape)->size(0));
  int32_t _1727_d = _ptr__1723_shape[_1724_conedim1];
  if ((_1724_conedim1 > _1725_conedim2))
  {
    {
      int32_t _1728_tmp = _1724_conedim1;
      _1724_conedim1 = _1725_conedim2;
      _1725_conedim2 = _1728_tmp;
    }
  }
  {}
  if (((_1724_conedim1 == _1725_conedim2) || ((_1724_conedim1 < (int)0) || (_1725_conedim2 >= _1726_nd))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid cone order dimensions for semidefinite variables"));
    }
  }
  {}
  if ((_ptr__1723_shape[_1724_conedim1] != _ptr__1723_shape[_1725_conedim2]))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape in cone order dimensions"));
    }
  }
  {}
  int32_t _1729_numcone = (int)1;
  int32_t _9844_ = (int)0;
  int32_t _9845_ = _1724_conedim1;
  for (int32_t _1730_i = _9844_; _1730_i < _9845_; ++_1730_i)
  {
    {
      _1729_numcone *= _ptr__1723_shape[_1730_i];
    }
  }
  int32_t _9846_ = safe_add( _1724_conedim1,(int)1 );
  int32_t _9847_ = _1725_conedim2;
  for (int32_t _1731_i = _9846_; _1731_i < _9847_; ++_1731_i)
  {
    {
      _1729_numcone *= _ptr__1723_shape[_1731_i];
    }
  }
  int32_t _9848_ = safe_add( _1725_conedim2,(int)1 );
  int32_t _9849_ = _1726_nd;
  for (int32_t _1732_i = _9848_; _1732_i < _9849_; ++_1732_i)
  {
    {
      _1729_numcone *= _ptr__1723_shape[_1732_i];
    }
  }
  int32_t _1733_numelm = (safe_mul( safe_mul( _1729_numcone,_1727_d ),safe_add( _1727_d,(int)1 ) ) / (int)2);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1734_nativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1733_numelm)));
  _checked_ptr_1<int64_t> _ptr__1734_nativeidxs(_1734_nativeidxs ? _1734_nativeidxs->raw() : nullptr,_1734_nativeidxs ? _1734_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1735_barvaridxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1729_numcone)));
  _checked_ptr_1<int32_t> _ptr__1735_barvaridxs(_1735_barvaridxs ? _1735_barvaridxs->raw() : nullptr,_1735_barvaridxs ? _1735_barvaridxs->size(0) : 0);
  int32_t _1736_varid = barvar_alloc(_1727_d,_1729_numcone,_1735_barvaridxs,_1734_nativeidxs);
  monty::rc_ptr< ::mosek::fusion::PSDVariable > _1737_res = ::mosek::fusion::p_PSDVariable::_new_PSDVariable(::mosek::fusion::Model::t(_pubthis),_1719_name,_1736_varid,_1723_shape,mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->conedim1,mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->conedim2,_1735_barvaridxs,_1734_nativeidxs);
  if (((int)((_1719_name).size()) > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1738_coneshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((_1726_nd - (int)2))));
      _checked_ptr_1<int32_t> _ptr__1738_coneshape(_1738_coneshape ? _1738_coneshape->raw() : nullptr,_1738_coneshape ? _1738_coneshape->size(0) : 0);
      int32_t _9850_;
      bool _9851_ = (_1724_conedim1 < _1725_conedim2);
      if (_9851_)
      {
        _9850_ = _1724_conedim1;
      }
      else
      {
        _9850_ = _1725_conedim2;
      }
      int32_t _1739_cdim1 = _9850_;
      int32_t _9852_;
      bool _9853_ = (_1724_conedim1 < _1725_conedim2);
      if (_9853_)
      {
        _9852_ = _1725_conedim2;
      }
      else
      {
        _9852_ = _1724_conedim1;
      }
      int32_t _1740_cdim2 = _9852_;
      int32_t _9854_ = (int)0;
      int32_t _9855_ = _1739_cdim1;
      for (int32_t _1741_i = _9854_; _1741_i < _9855_; ++_1741_i)
      {
        {
          _ptr__1738_coneshape[_1741_i] = _ptr__1723_shape[_1741_i];
        }
      }
      int32_t _9856_ = safe_add( _1739_cdim1,(int)1 );
      int32_t _9857_ = _1740_cdim2;
      for (int32_t _1742_i = _9856_; _1742_i < _9857_; ++_1742_i)
      {
        {
          _ptr__1738_coneshape[(_1742_i - (int)1)] = _ptr__1723_shape[_1742_i];
        }
      }
      int32_t _9858_ = safe_add( _1740_cdim2,(int)1 );
      int32_t _9859_ = _1726_nd;
      for (int32_t _1743_i = _9858_; _1743_i < _9859_; ++_1743_i)
      {
        {
          _ptr__1738_coneshape[(_1743_i - (int)2)] = _ptr__1723_shape[_1743_i];
        }
      }
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1744_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _1744_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1719_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if (((_1726_nd - (int)2) > (int)0))
      {
        {
          _1744_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
          int32_t _9860_ = (int)1;
          int32_t _9861_ = (_1726_nd - (int)2);
          for (int32_t _1745_i = _9860_; _1745_i < _9861_; ++_1745_i)
          {
            {
              _1744_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1745_i);
            }
          }
        }
      }
      {}
      _1744_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->indexnames.get()))
      {
        {
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _1746_indexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape((_1726_nd - (int)2))));
          int32_t _9862_ = (int)0;
          int32_t _9863_ = _1739_cdim1;
          for (int32_t _1747_i = _9862_; _1747_i < _9863_; ++_1747_i)
          {
            {
              ((*_1746_indexnames)(_1747_i)) = ((*mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->indexnames)(_1747_i));
            }
          }
          int32_t _9864_ = safe_add( _1739_cdim1,(int)1 );
          int32_t _9865_ = _1740_cdim2;
          for (int32_t _1748_i = _9864_; _1748_i < _9865_; ++_1748_i)
          {
            {
              ((*_1746_indexnames)((_1748_i - (int)1))) = ((*mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->indexnames)(_1748_i));
            }
          }
          int32_t _9866_ = safe_add( _1740_cdim2,(int)1 );
          int32_t _9867_ = _1726_nd;
          for (int32_t _1749_i = _9866_; _1749_i < _9867_; ++_1749_i)
          {
            {
              ((*_1746_indexnames)((_1749_i - (int)2))) = ((*mosek::fusion::p_PSDDomain::_get_impl(_1722_dom)->indexnames)(_1749_i));
            }
          }
          task_format_barvar_names(_1735_barvaridxs,_1744_sb->toString(),_1738_coneshape,_1746_indexnames);
        }
      }
      else
      {
        {
          task_format_barvar_names(_1735_barvaridxs,_1744_sb->toString(),_1738_coneshape,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  ((*barvars)(_1736_varid)) = (_1737_res).as<::mosek::fusion::ModelVariable>();
  if (((int)((_1719_name).size()) > (int)0))
  {
    {
      var_map->setItem(_1719_name,(-safe_add( _1736_varid,(int)1 )));
    }
  }
  {}
  return (_1737_res).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Model.variable_

// Begin mosek.fusion.Model.putfrows
// Method mosek.fusion.Model.putfrows @ bld/docker-win/final/default/src/fusion/Model.mbi:1684:6-1808:7
void mosek::fusion::p_Model::putfrows(std::shared_ptr< monty::ndarray< int32_t,1 > > _1750_nativeidxs,int32_t _1751_nativebaseptr,monty::rc_ptr< ::mosek::fusion::WorkStack > _1752_rs,int32_t _1753_nelem,int32_t _1754_nnz,int32_t _1755_ptr_base,int32_t _1756_nidxs_base,int32_t _1757_cof_base)
{
  _checked_ptr_1<int32_t> _ptr__1750_nativeidxs(_1750_nativeidxs ? _1750_nativeidxs->raw() : nullptr, _1750_nativeidxs ? _1750_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1758_ri32 = mosek::fusion::p_WorkStack::_get_impl(_1752_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1758_ri32(_1758_ri32 ? _1758_ri32->raw() : nullptr,_1758_ri32 ? _1758_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1759_ri64 = mosek::fusion::p_WorkStack::_get_impl(_1752_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1759_ri64(_1759_ri64 ? _1759_ri64->raw() : nullptr,_1759_ri64 ? _1759_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1760_rf64 = mosek::fusion::p_WorkStack::_get_impl(_1752_rs)->f64;
  _checked_ptr_1<double> _ptr__1760_rf64(_1760_rf64 ? _1760_rf64->raw() : nullptr,_1760_rf64 ? _1760_rf64->size(0) : 0);
  int32_t _1761_linnz = (int)0;
  int32_t _1762_barnnz = (int)0;
  int32_t _1763_totalpsdelm = (int)0;
  int32_t _9868_ = (int)0;
  int32_t _9869_ = _1753_nelem;
  for (int32_t _1764_i = _9868_; _1764_i < _9869_; ++_1764_i)
  {
    {
      int32_t _1765_ps = _ptr__1758_ri32[safe_add( _1755_ptr_base,_1764_i )];
      int32_t _1766_pe = _ptr__1758_ri32[safe_add( safe_add( _1755_ptr_base,_1764_i ),(int)1 )];
      int32_t _1767_p = _1765_ps;
      while ( ((_1767_p < _1766_pe) && (_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1767_p )] < (int)0)) )
      {
        {
          int32_t _1768_barj = ((*barvar_block_elm_barj)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1767_p )],(int)1 ))));
          int32_t _1769_p0 = _1767_p;
          ++ _1767_p;
          while ( ((_1767_p < _1766_pe) && ((_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1767_p )] < (int)0) && (_1768_barj == ((*barvar_block_elm_barj)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1767_p )],(int)1 ))))))) )
          {
            {
              ++ _1767_p;
            }
          }
          ++ _1762_barnnz;
        }
      }
      _1763_totalpsdelm += (_1767_p - _1765_ps);
      while ( ((_1767_p < _1766_pe) && (_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1767_p )] == (int)0)) )
      {
        {
          ++ _1767_p;
        }
      }
      _1761_linnz += (_1766_pe - _1767_p);
    }
  }
  if ((_1753_nelem > ((int)((_1750_nativeidxs)->size(0)) - _1751_nativebaseptr)))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Mismatching sizes"));
    }
  }
  {}
  int32_t _1770_numcon = _1753_nelem;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1771_ptrb = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _1770_numcon,(int)1 ))));
  _checked_ptr_1<int32_t> _ptr__1771_ptrb(_1771_ptrb ? _1771_ptrb->raw() : nullptr,_1771_ptrb ? _1771_ptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1772_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1761_linnz)));
  _checked_ptr_1<int32_t> _ptr__1772_subj(_1772_subj ? _1772_subj->raw() : nullptr,_1772_subj ? _1772_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1773_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1761_linnz)));
  _checked_ptr_1<double> _ptr__1773_cof(_1773_cof ? _1773_cof->raw() : nullptr,_1773_cof ? _1773_cof->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1774_bfix = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1753_nelem)));
  _checked_ptr_1<double> _ptr__1774_bfix(_1774_bfix ? _1774_bfix->raw() : nullptr,_1774_bfix ? _1774_bfix->size(0) : 0);
  {
    int32_t _1775_k = (int)0;
    int32_t _9870_ = (int)0;
    int32_t _9871_ = _1753_nelem;
    for (int32_t _1776_i = _9870_; _1776_i < _9871_; ++_1776_i)
    {
      {
        int32_t _1777_knz = (int)0;
        int32_t _9872_ = _ptr__1758_ri32[safe_add( _1755_ptr_base,_1776_i )];
        int32_t _9873_ = _ptr__1758_ri32[safe_add( safe_add( _1755_ptr_base,_1776_i ),(int)1 )];
        for (int32_t _1778_j = _9872_; _1778_j < _9873_; ++_1778_j)
        {
          {
            if ((_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1778_j )] == (int)0))
            {
              {
                _ptr__1774_bfix[_1776_i] += _ptr__1760_rf64[safe_add( _1757_cof_base,_1778_j )];
              }
            }
            else if((_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1778_j )] > (int)0))
            {
              {
                _ptr__1772_subj[safe_add( _1775_k,_1777_knz )] = (int32_t)_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1778_j )];
                _ptr__1773_cof[safe_add( _1775_k,_1777_knz )] = _ptr__1760_rf64[safe_add( _1757_cof_base,_1778_j )];
                ++ _1777_knz;
              }
            }
            {}
          }
        }
        _ptr__1771_ptrb[safe_add( _1776_i,(int)1 )] = safe_add( _ptr__1771_ptrb[_1776_i],_1777_knz );
        _1775_k += _1777_knz;
      }
    }
  }
  std::vector<int64_t> _9874_;
  for (int32_t _1779_i = (int)0, _9875_ = _1753_nelem; _1779_i < _9875_ ; ++_1779_i)
  {
    _9874_.push_back(_ptr__1750_nativeidxs[safe_add( _1779_i,_1751_nativebaseptr )]);
  }
  auto _9876_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9874_.size()),_9874_.begin(),_9874_.end()));
  task_putafeflist(_9876_,_1771_ptrb,_1772_subj,_1773_cof,_1774_bfix);
  if ((_1762_barnnz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1780_subi = _1750_nativeidxs;
      _checked_ptr_1<int32_t> _ptr__1780_subi(_1780_subi ? _1780_subi->raw() : nullptr,_1780_subi ? _1780_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1781_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _1770_numcon,(int)1 ))));
      _checked_ptr_1<int32_t> _ptr__1781_ptr(_1781_ptr ? _1781_ptr->raw() : nullptr,_1781_ptr ? _1781_ptr->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1782_barsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1762_barnnz)));
      _checked_ptr_1<int32_t> _ptr__1782_barsubj(_1782_barsubj ? _1782_barsubj->raw() : nullptr,_1782_barsubj ? _1782_barsubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1783_matdim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1762_barnnz)));
      _checked_ptr_1<int32_t> _ptr__1783_matdim(_1783_matdim ? _1783_matdim->raw() : nullptr,_1783_matdim ? _1783_matdim->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1784_matnnz = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1762_barnnz)));
      _checked_ptr_1<int64_t> _ptr__1784_matnnz(_1784_matnnz ? _1784_matnnz->raw() : nullptr,_1784_matnnz ? _1784_matnnz->size(0) : 0);
      std::vector<int32_t> _9877_;
      for (int32_t _1786_i = (int)0, _9878_ = _1763_totalpsdelm; _1786_i < _9878_ ; ++_1786_i)
      {
        _9877_.push_back((-(int)1));
      }
      auto _9879_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9877_.size()),_9877_.begin(),_9877_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1785_matsubi = _9879_;
      _checked_ptr_1<int32_t> _ptr__1785_matsubi(_1785_matsubi ? _1785_matsubi->raw() : nullptr,_1785_matsubi ? _1785_matsubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1787_matsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1763_totalpsdelm)));
      _checked_ptr_1<int32_t> _ptr__1787_matsubj(_1787_matsubj ? _1787_matsubj->raw() : nullptr,_1787_matsubj ? _1787_matsubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1788_matcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1763_totalpsdelm)));
      _checked_ptr_1<double> _ptr__1788_matcof(_1788_matcof ? _1788_matcof->raw() : nullptr,_1788_matcof ? _1788_matcof->size(0) : 0);
      int32_t _1789_barnzi = (int)0;
      int32_t _1790_barmatnzi = (int)0;
      int32_t _9880_ = (int)0;
      int32_t _9881_ = _1770_numcon;
      for (int32_t _1791_i = _9880_; _1791_i < _9881_; ++_1791_i)
      {
        {
          int32_t _1792_p = _ptr__1758_ri32[safe_add( _1755_ptr_base,_1791_i )];
          int32_t _1793_pe = _ptr__1758_ri32[safe_add( safe_add( _1755_ptr_base,_1791_i ),(int)1 )];
          while ( ((_1792_p < _1793_pe) && (_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )] < (int)0)) )
          {
            {
              int32_t _1794_p0 = _1792_p;
              int32_t _1795_barj = ((*barvar_block_elm_barj)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )],(int)1 ))));
              while ( ((_1792_p < _1793_pe) && ((_ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )] < (int)0) && (((*barvar_block_elm_barj)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )],(int)1 )))) == _1795_barj))) )
              {
                {
                  _ptr__1785_matsubi[_1790_barmatnzi] = ((*barvar_block_elm_i)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )],(int)1 ))));
                  _ptr__1787_matsubj[_1790_barmatnzi] = ((*barvar_block_elm_j)((-safe_add( _ptr__1759_ri64[safe_add( _1756_nidxs_base,_1792_p )],(int)1 ))));
                  if ((_ptr__1785_matsubi[_1790_barmatnzi] == _ptr__1787_matsubj[_1790_barmatnzi]))
                  {
                    {
                      _ptr__1788_matcof[_1790_barmatnzi] = _ptr__1760_rf64[safe_add( _1757_cof_base,_1792_p )];
                    }
                  }
                  else
                  {
                    {
                      _ptr__1788_matcof[_1790_barmatnzi] = (0.5 * _ptr__1760_rf64[safe_add( _1757_cof_base,_1792_p )]);
                    }
                  }
                  ++ _1790_barmatnzi;
                  ++ _1792_p;
                }
              }
              _ptr__1782_barsubj[_1789_barnzi] = _1795_barj;
              _ptr__1783_matdim[_1789_barnzi] = ((*barvar_dim)(_1795_barj));
              _ptr__1784_matnnz[_1789_barnzi] = (_1792_p - _1794_p0);
              ++ _1789_barnzi;
            }
          }
          _1792_p = _1793_pe;
          _ptr__1781_ptr[safe_add( _1791_i,(int)1 )] = _1789_barnzi;
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1796_symmatidx = task_appendsymmatlist(_1783_matdim,_1784_matnnz,_1785_matsubi,_1787_matsubj,_1788_matcof);
      _checked_ptr_1<int64_t> _ptr__1796_symmatidx(_1796_symmatidx ? _1796_symmatidx->raw() : nullptr,_1796_symmatidx ? _1796_symmatidx->size(0) : 0);
      task_putafebarfrowlist(_1780_subi,_1781_ptr,_1782_barsubj,_1796_symmatidx);
    }
  }
  {}
}
// End mosek.fusion.Model.putfrows

// Begin mosek.fusion.Model.putarows
// Method mosek.fusion.Model.putarows @ bld/docker-win/final/default/src/fusion/Model.mbi:1581:6-1681:7
void mosek::fusion::p_Model::putarows(std::shared_ptr< monty::ndarray< int32_t,1 > > _1797_nativeidxs,monty::rc_ptr< ::mosek::fusion::WorkStack > _1798_rs,int32_t _1799_nelem,int32_t _1800_nnz,int32_t _1801_ptr_base,int32_t _1802_nidxs_base,int32_t _1803_cof_base)
{
  _checked_ptr_1<int32_t> _ptr__1797_nativeidxs(_1797_nativeidxs ? _1797_nativeidxs->raw() : nullptr, _1797_nativeidxs ? _1797_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1804_ri32 = mosek::fusion::p_WorkStack::_get_impl(_1798_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1804_ri32(_1804_ri32 ? _1804_ri32->raw() : nullptr,_1804_ri32 ? _1804_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1805_ri64 = mosek::fusion::p_WorkStack::_get_impl(_1798_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1805_ri64(_1805_ri64 ? _1805_ri64->raw() : nullptr,_1805_ri64 ? _1805_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1806_rf64 = mosek::fusion::p_WorkStack::_get_impl(_1798_rs)->f64;
  _checked_ptr_1<double> _ptr__1806_rf64(_1806_rf64 ? _1806_rf64->raw() : nullptr,_1806_rf64 ? _1806_rf64->size(0) : 0);
  int32_t _1807_linnz = (int)0;
  int32_t _1808_barnnz = (int)0;
  int32_t _1809_totalpsdelm = (int)0;
  int32_t _9882_ = (int)0;
  int32_t _9883_ = _1799_nelem;
  for (int32_t _1810_i = _9882_; _1810_i < _9883_; ++_1810_i)
  {
    {
      int32_t _1811_ps = _ptr__1804_ri32[safe_add( _1801_ptr_base,_1810_i )];
      int32_t _1812_pe = _ptr__1804_ri32[safe_add( safe_add( _1801_ptr_base,_1810_i ),(int)1 )];
      int32_t _1813_p = _1811_ps;
      while ( ((_1813_p < _1812_pe) && (_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1813_p )] < (int)0)) )
      {
        {
          int32_t _1814_barj = ((*barvar_block_elm_barj)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1813_p )],(int)1 ))));
          int32_t _1815_p0 = _1813_p;
          ++ _1813_p;
          while ( ((_1813_p < _1812_pe) && ((_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1813_p )] < (int)0) && (_1814_barj == ((*barvar_block_elm_barj)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1813_p )],(int)1 ))))))) )
          {
            {
              ++ _1813_p;
            }
          }
          ++ _1808_barnnz;
        }
      }
      _1809_totalpsdelm += (_1813_p - _1811_ps);
      _1807_linnz += (_1812_pe - _1813_p);
    }
  }
  _1807_linnz += _1799_nelem;
  int32_t _1816_numcon = (int)((_1797_nativeidxs)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1817_ptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _1816_numcon,(int)1 ))));
  _checked_ptr_1<int64_t> _ptr__1817_ptrb(_1817_ptrb ? _1817_ptrb->raw() : nullptr,_1817_ptrb ? _1817_ptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1818_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1807_linnz)));
  _checked_ptr_1<int32_t> _ptr__1818_subj(_1818_subj ? _1818_subj->raw() : nullptr,_1818_subj ? _1818_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1819_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1807_linnz)));
  _checked_ptr_1<double> _ptr__1819_cof(_1819_cof ? _1819_cof->raw() : nullptr,_1819_cof ? _1819_cof->size(0) : 0);
  {
    int32_t _1820_k = (int)0;
    int32_t _9884_ = (int)0;
    int32_t _9885_ = _1799_nelem;
    for (int32_t _1821_i = _9884_; _1821_i < _9885_; ++_1821_i)
    {
      {
        int32_t _1822_knz = (int)0;
        int32_t _9886_ = _ptr__1804_ri32[safe_add( _1801_ptr_base,_1821_i )];
        int32_t _9887_ = _ptr__1804_ri32[safe_add( safe_add( _1801_ptr_base,_1821_i ),(int)1 )];
        for (int32_t _1823_j = _9886_; _1823_j < _9887_; ++_1823_j)
        {
          {
            if ((_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1823_j )] >= (int)0))
            {
              {
                _ptr__1818_subj[safe_add( _1820_k,_1822_knz )] = (int32_t)_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1823_j )];
                _ptr__1819_cof[safe_add( _1820_k,_1822_knz )] = _ptr__1806_rf64[safe_add( _1803_cof_base,_1823_j )];
                ++ _1822_knz;
              }
            }
            {}
          }
        }
        _ptr__1817_ptrb[safe_add( _1821_i,(int)1 )] = safe_add( _ptr__1817_ptrb[_1821_i],_1822_knz );
        _1820_k += _1822_knz;
      }
    }
  }
  task_putarowlist(_1797_nativeidxs,_1817_ptrb,_1818_subj,_1819_cof);
  if ((_1808_barnnz > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1824_subi = _1797_nativeidxs;
      _checked_ptr_1<int32_t> _ptr__1824_subi(_1824_subi ? _1824_subi->raw() : nullptr,_1824_subi ? _1824_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1825_ptr = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _1816_numcon,(int)1 ))));
      _checked_ptr_1<int64_t> _ptr__1825_ptr(_1825_ptr ? _1825_ptr->raw() : nullptr,_1825_ptr ? _1825_ptr->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1826_barsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1808_barnnz)));
      _checked_ptr_1<int32_t> _ptr__1826_barsubj(_1826_barsubj ? _1826_barsubj->raw() : nullptr,_1826_barsubj ? _1826_barsubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1827_matdim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1808_barnnz)));
      _checked_ptr_1<int32_t> _ptr__1827_matdim(_1827_matdim ? _1827_matdim->raw() : nullptr,_1827_matdim ? _1827_matdim->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1828_matnnz = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_1808_barnnz)));
      _checked_ptr_1<int64_t> _ptr__1828_matnnz(_1828_matnnz ? _1828_matnnz->raw() : nullptr,_1828_matnnz ? _1828_matnnz->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1829_matsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1809_totalpsdelm)));
      _checked_ptr_1<int32_t> _ptr__1829_matsubi(_1829_matsubi ? _1829_matsubi->raw() : nullptr,_1829_matsubi ? _1829_matsubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1830_matsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1809_totalpsdelm)));
      _checked_ptr_1<int32_t> _ptr__1830_matsubj(_1830_matsubj ? _1830_matsubj->raw() : nullptr,_1830_matsubj ? _1830_matsubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _1831_matcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1809_totalpsdelm)));
      _checked_ptr_1<double> _ptr__1831_matcof(_1831_matcof ? _1831_matcof->raw() : nullptr,_1831_matcof ? _1831_matcof->size(0) : 0);
      int32_t _1832_barnzi = (int)0;
      int32_t _1833_barmatnzi = (int)0;
      int32_t _9888_ = (int)0;
      int32_t _9889_ = _1816_numcon;
      for (int32_t _1834_i = _9888_; _1834_i < _9889_; ++_1834_i)
      {
        {
          int32_t _1835_p = _ptr__1804_ri32[safe_add( _1801_ptr_base,_1834_i )];
          int32_t _1836_pe = _ptr__1804_ri32[safe_add( safe_add( _1801_ptr_base,_1834_i ),(int)1 )];
          while ( ((_1835_p < _1836_pe) && (_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )] < (int)0)) )
          {
            {
              int32_t _1837_p0 = _1835_p;
              int32_t _1838_barj = ((*barvar_block_elm_barj)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )],(int)1 ))));
              while ( ((_1835_p < _1836_pe) && ((_ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )] < (int)0) && (((*barvar_block_elm_barj)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )],(int)1 )))) == _1838_barj))) )
              {
                {
                  _ptr__1829_matsubi[_1833_barmatnzi] = ((*barvar_block_elm_i)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )],(int)1 ))));
                  _ptr__1830_matsubj[_1833_barmatnzi] = ((*barvar_block_elm_j)((-safe_add( _ptr__1805_ri64[safe_add( _1802_nidxs_base,_1835_p )],(int)1 ))));
                  if ((_ptr__1829_matsubi[_1833_barmatnzi] == _ptr__1830_matsubj[_1833_barmatnzi]))
                  {
                    {
                      _ptr__1831_matcof[_1833_barmatnzi] = _ptr__1806_rf64[safe_add( _1803_cof_base,_1835_p )];
                    }
                  }
                  else
                  {
                    {
                      _ptr__1831_matcof[_1833_barmatnzi] = (0.5 * _ptr__1806_rf64[safe_add( _1803_cof_base,_1835_p )]);
                    }
                  }
                  ++ _1833_barmatnzi;
                  ++ _1835_p;
                }
              }
              _ptr__1826_barsubj[_1832_barnzi] = _1838_barj;
              _ptr__1827_matdim[_1832_barnzi] = ((*barvar_dim)(_1838_barj));
              _ptr__1828_matnnz[_1832_barnzi] = (_1835_p - _1837_p0);
              ++ _1832_barnzi;
            }
          }
          _1835_p = _1836_pe;
          _ptr__1825_ptr[safe_add( _1834_i,(int)1 )] = _1832_barnzi;
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _1839_symmatidx = task_appendsymmatlist(_1827_matdim,_1828_matnnz,_1829_matsubi,_1830_matsubj,_1831_matcof);
      _checked_ptr_1<int64_t> _ptr__1839_symmatidx(_1839_symmatidx ? _1839_symmatidx->raw() : nullptr,_1839_symmatidx ? _1839_symmatidx->size(0) : 0);
      task_putbararowlist(_1824_subi,_1825_ptr,_1826_barsubj,_1839_symmatidx);
    }
  }
  {}
}
// End mosek.fusion.Model.putarows

// Begin mosek.fusion.Model.constraint_
// Method mosek.fusion.Model.constraint_ @ bld/docker-win/final/default/src/fusion/Model.mbi:1453:6-1565:7
monty::rc_ptr< ::mosek::fusion::RangedConstraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint_(const std::string & _1840_name,monty::rc_ptr< ::mosek::fusion::Expression > _1841_expr,monty::rc_ptr< ::mosek::fusion::RangeDomain > _1842_dom_)
{
  if ((((int)((_1840_name).size()) > (int)0) && hasConstraint(_1840_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate constraint name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1840_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  if (mosek::fusion::p_RangeDomain::_get_impl(_1842_dom_)->cardinal_flag)
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Integer domain not allowed in a constraint"));
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ExprDense > _1843_e = ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1841_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
  _1843_e->eval(rs,ws,xs);
  rs->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1844_ri32 = mosek::fusion::p_WorkStack::_get_impl(rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1844_ri32(_1844_ri32 ? _1844_ri32->raw() : nullptr,_1844_ri32 ? _1844_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1845_ri64 = mosek::fusion::p_WorkStack::_get_impl(rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1845_ri64(_1845_ri64 ? _1845_ri64->raw() : nullptr,_1845_ri64 ? _1845_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1846_rf64 = mosek::fusion::p_WorkStack::_get_impl(rs)->f64;
  _checked_ptr_1<double> _ptr__1846_rf64(_1846_rf64 ? _1846_rf64->raw() : nullptr,_1846_rf64 ? _1846_rf64->size(0) : 0);
  int32_t _1847_nd = mosek::fusion::p_WorkStack::_get_impl(rs)->nd;
  int32_t _1848_shape_base = mosek::fusion::p_WorkStack::_get_impl(rs)->shape_base;
  int32_t _1849_nelem = mosek::fusion::p_WorkStack::_get_impl(rs)->nelem;
  int32_t _1850_nnz = mosek::fusion::p_WorkStack::_get_impl(rs)->nnz;
  int32_t _1851_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(rs)->ncodeatom;
  bool _1852_hassp = mosek::fusion::p_WorkStack::_get_impl(rs)->hassp;
  int32_t _1853_ptr_base = mosek::fusion::p_WorkStack::_get_impl(rs)->ptr_base;
  int32_t _1854_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(rs)->nidxs_base;
  int32_t _1855_cof_base = mosek::fusion::p_WorkStack::_get_impl(rs)->cof_base;
  int32_t _1856_codeptr = mosek::fusion::p_WorkStack::_get_impl(rs)->codeptr_base;
  int32_t _1857_code = mosek::fusion::p_WorkStack::_get_impl(rs)->code_base;
  int32_t _1858_cconst = mosek::fusion::p_WorkStack::_get_impl(rs)->cconst_base;
  std::vector<int32_t> _9890_;
  for (int32_t _1860_i = (int)0, _9891_ = _1847_nd; _1860_i < _9891_ ; ++_1860_i)
  {
    _9890_.push_back(_ptr__1844_ri32[safe_add( _1848_shape_base,_1860_i )]);
  }
  auto _9892_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9890_.size()),_9890_.begin(),_9890_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1859_shape = _9892_;
  _checked_ptr_1<int32_t> _ptr__1859_shape(_1859_shape ? _1859_shape->raw() : nullptr,_1859_shape ? _1859_shape->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::RangeDomain > _1861_dom = mosek::fusion::p_RangeDomain::_get_impl(_1842_dom_.get())->__mosek_2fusion_2RangeDomain__finalize_and_validate(_1859_shape);
  if ((NULL != mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->shape.get()))
  {
    {
      if (((int)((mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->shape)->size(0)) != _1847_nd))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression and domain"));
        }
      }
      else
      {
        {
          int32_t _9893_ = (int)0;
          int32_t _9894_ = _1847_nd;
          for (int32_t _1862_i = _9893_; _1862_i < _9894_; ++_1862_i)
          {
            {
              if ((((*mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->shape)(_1862_i)) != _ptr__1844_ri32[safe_add( _1848_shape_base,_1862_i )]))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression and domain"));
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  {}
  int32_t _1863_numcon = (int)1;
  int32_t _9895_ = (int)0;
  int32_t _9896_ = _1847_nd;
  for (int32_t _1864_i = _9895_; _1864_i < _9896_; ++_1864_i)
  {
    {
      _1863_numcon *= _ptr__1844_ri32[safe_add( _1848_shape_base,_1864_i )];
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1865_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1863_numcon)));
  _checked_ptr_1<int32_t> _ptr__1865_nativeidxs(_1865_nativeidxs ? _1865_nativeidxs->raw() : nullptr,_1865_nativeidxs ? _1865_nativeidxs->size(0) : 0);
  int32_t _1866_conid = con_allocate(_1865_nativeidxs);
  putarows(_1865_nativeidxs,rs,_1849_nelem,_1850_nnz,_1853_ptr_base,_1854_nidxs_base,_1855_cof_base);
  xs->clear();
  std::shared_ptr< monty::ndarray< double,1 > > _1867_bl = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1863_numcon)));
  _checked_ptr_1<double> _ptr__1867_bl(_1867_bl ? _1867_bl->raw() : nullptr,_1867_bl ? _1867_bl->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1868_bu = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1863_numcon)));
  _checked_ptr_1<double> _ptr__1868_bu(_1868_bu ? _1868_bu->raw() : nullptr,_1868_bu ? _1868_bu->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1869_domlb = mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->lb;
  _checked_ptr_1<double> _ptr__1869_domlb(_1869_domlb ? _1869_domlb->raw() : nullptr,_1869_domlb ? _1869_domlb->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1870_domub = mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->ub;
  _checked_ptr_1<double> _ptr__1870_domub(_1870_domub ? _1870_domub->raw() : nullptr,_1870_domub ? _1870_domub->size(0) : 0);
  bool _1871_domempty = mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->empty;
  bool _1872_domsc = mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->scalable;
  std::shared_ptr< monty::ndarray< int32_t,2 > > _1873_domsp = mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->sparsity;
  {
    if (_1872_domsc)
    {
      {
        int32_t _9897_ = (int)0;
        int32_t _9898_ = _1863_numcon;
        for (int32_t _1874_i = _9897_; _1874_i < _9898_; ++_1874_i)
        {
          {
            _ptr__1867_bl[_1874_i] = _ptr__1869_domlb[(int)0];
            _ptr__1868_bu[_1874_i] = _ptr__1870_domub[(int)0];
          }
        }
      }
    }
    else if(_1871_domempty)
    {
      {
      }
    }
    else if((NULL != _1873_domsp.get()))
    {
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _1875_stride = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1847_nd)));
        _checked_ptr_1<int32_t> _ptr__1875_stride(_1875_stride ? _1875_stride->raw() : nullptr,_1875_stride ? _1875_stride->size(0) : 0);
        _ptr__1875_stride[(_1847_nd - (int)1)] = (int)1;
        int32_t _9899_ = (int)1;
        int32_t _9900_ = _1847_nd;
        for (int32_t _1876_i = _9899_; _1876_i < _9900_; ++_1876_i)
        {
          {
            _ptr__1875_stride[((_1847_nd - _1876_i) - (int)1)] = safe_mul( _ptr__1875_stride[(_1847_nd - _1876_i)],_ptr__1844_ri32[(safe_add( _1848_shape_base,_1847_nd ) - _1876_i)] );
          }
        }
        int32_t _9901_ = (int)0;
        int32_t _9902_ = (int)((_1869_domlb)->size(0));
        for (int32_t _1877_i = _9901_; _1877_i < _9902_; ++_1877_i)
        {
          {
            int32_t _1878_idx = (int)0;
            int32_t _9903_ = (int)0;
            int32_t _9904_ = _1847_nd;
            for (int32_t _1879_j = _9903_; _1879_j < _9904_; ++_1879_j)
            {
              {
                _1878_idx += safe_mul( _ptr__1875_stride[_1879_j],((*_1873_domsp)(_1877_i,_1879_j)) );
              }
            }
            _ptr__1867_bl[_1878_idx] = _ptr__1869_domlb[_1877_i];
            _ptr__1868_bu[_1878_idx] = _ptr__1870_domub[_1877_i];
          }
        }
      }
    }
    else
    {
      {
        int32_t _9905_ = (int)0;
        int32_t _9906_ = _1863_numcon;
        for (int32_t _1880_i = _9905_; _1880_i < _9906_; ++_1880_i)
        {
          {
            _ptr__1867_bl[_1880_i] = _ptr__1869_domlb[_1880_i];
            _ptr__1868_bu[_1880_i] = _ptr__1870_domub[_1880_i];
          }
        }
      }
    }
  }
  task_con_putboundlist_ra(_1865_nativeidxs,_1867_bl,_1868_bu);
  if ((_1851_ncodeatom > (int)0))
  {
    {
      con_blocks->replace_row_code(rs,_1865_nativeidxs,_1853_ptr_base,_1854_nidxs_base,_1856_codeptr,_1857_code,_1858_cconst);
    }
  }
  {}
  if (((int)((_1840_name).size()) > (int)0))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1881_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _1881_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1840_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if (((int)((_1859_shape)->size(0)) > (int)0))
      {
        {
          _1881_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
        }
      }
      {}
      int32_t _9907_ = (int)1;
      int32_t _9908_ = (int)((_1859_shape)->size(0));
      for (int32_t _1882_i = _9907_; _1882_i < _9908_; ++_1882_i)
      {
        {
          _1881_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1882_i);
        }
      }
      _1881_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->indexnames.get()))
      {
        {
          task_format_con_names(_1865_nativeidxs,_1881_sb->toString(),_1859_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),mosek::fusion::p_RangeDomain::_get_impl(_1861_dom)->indexnames);
        }
      }
      else
      {
        {
          task_format_con_names(_1865_nativeidxs,_1881_sb->toString(),_1859_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  std::vector<int32_t> _9909_;
  for (int32_t _1884_i = (int)0, _9910_ = _1847_nd; _1884_i < _9910_ ; ++_1884_i)
  {
    _9909_.push_back(_ptr__1844_ri32[safe_add( _1848_shape_base,_1884_i )]);
  }
  auto _9911_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9909_.size()),_9909_.begin(),_9909_.end()));
  monty::rc_ptr< ::mosek::fusion::RangedConstraint > _1883_res = ::mosek::fusion::p_RangedConstraint::_new_RangedConstraint(::mosek::fusion::Model::t(_pubthis),_1840_name,_9911_,_1865_nativeidxs,_1866_conid);
  ((*cons)(_1866_conid)) = (_1883_res).as<::mosek::fusion::ModelConstraint>();
  if (((int)((_1840_name).size()) > (int)0))
  {
    {
      con_map->setItem(_1840_name,_1866_conid);
    }
  }
  {}
  return _1883_res;
}
// End mosek.fusion.Model.constraint_

// Begin mosek.fusion.Model.constraint_
// Method mosek.fusion.Model.constraint_ @ bld/docker-win/final/default/src/fusion/Model.mbi:1256:6-1433:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint_(const std::string & _1885_name,monty::rc_ptr< ::mosek::fusion::Expression > _1886_expr,monty::rc_ptr< ::mosek::fusion::PSDDomain > _1887_dom_)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1888_shape = _1886_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__1888_shape(_1888_shape ? _1888_shape->raw() : nullptr,_1888_shape ? _1888_shape->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::PSDDomain > _1889_dom = mosek::fusion::p_PSDDomain::_get_impl(_1887_dom_.get())->__mosek_2fusion_2PSDDomain__finalize_and_validate(_1888_shape);
  bool _1890_tril = (mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim1 < mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim2);
  int32_t _9912_;
  bool _9913_ = (mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim1 < mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim2);
  if (_9913_)
  {
    _9912_ = mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim2;
  }
  else
  {
    _9912_ = mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim1;
  }
  int32_t _1891_conedim1 = _9912_;
  int32_t _9914_;
  bool _9915_ = (mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim1 < mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim2);
  if (_9915_)
  {
    _9914_ = mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim1;
  }
  else
  {
    _9914_ = mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->conedim2;
  }
  int32_t _1892_conedim0 = _9914_;
  monty::rc_ptr< ::mosek::fusion::Expression > _9916_;
  bool _9917_ = (mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->key == ::mosek::fusion::PSDKey::IsSymPSD);
  if (_9917_)
  {
    _9916_ = ::mosek::fusion::p_ExprSymmetrize::_new_ExprSymmetrize(_1892_conedim0,_1891_conedim1,_1886_expr).as<::mosek::fusion::Expression>();
  }
  else
  {
    _9916_ = _1886_expr;
  }
  monty::rc_ptr< ::mosek::fusion::ExprDenseTril > _1893_e = ::mosek::fusion::p_ExprDenseTril::_new_ExprDenseTril(_1892_conedim0,_1891_conedim1,(::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress((::mosek::fusion::p_ExprScaleVecPSD::_new_ExprScaleVecPSD(_1892_conedim0,_1891_conedim1,(::mosek::fusion::p_ExprDenseTril::_new_ExprDenseTril(_1892_conedim0,_1891_conedim1,_9916_)).as<::mosek::fusion::BaseExpression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
  _1893_e->eval(rs,ws,xs);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1894_ri32 = mosek::fusion::p_WorkStack::_get_impl(rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1894_ri32(_1894_ri32 ? _1894_ri32->raw() : nullptr,_1894_ri32 ? _1894_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1895_ri64 = mosek::fusion::p_WorkStack::_get_impl(rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1895_ri64(_1895_ri64 ? _1895_ri64->raw() : nullptr,_1895_ri64 ? _1895_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1896_rf64 = mosek::fusion::p_WorkStack::_get_impl(rs)->f64;
  _checked_ptr_1<double> _ptr__1896_rf64(_1896_rf64 ? _1896_rf64->raw() : nullptr,_1896_rf64 ? _1896_rf64->size(0) : 0);
  int32_t _1897_nd = mosek::fusion::p_WorkStack::_get_impl(rs)->nd;
  int32_t _1898_nelem = mosek::fusion::p_WorkStack::_get_impl(rs)->nelem;
  int32_t _1899_nnz = mosek::fusion::p_WorkStack::_get_impl(rs)->nnz;
  bool _1900_hassp = mosek::fusion::p_WorkStack::_get_impl(rs)->hassp;
  int32_t _1901_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(rs)->ncodeatom;
  int32_t _1902_shape_base = mosek::fusion::p_WorkStack::_get_impl(rs)->shape_base;
  int32_t _1903_ptr_base = mosek::fusion::p_WorkStack::_get_impl(rs)->ptr_base;
  int32_t _1904_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(rs)->nidxs_base;
  int32_t _1905_sp_base = mosek::fusion::p_WorkStack::_get_impl(rs)->sp_base;
  int32_t _1906_cof_base = mosek::fusion::p_WorkStack::_get_impl(rs)->cof_base;
  int32_t _1907_codeptr = mosek::fusion::p_WorkStack::_get_impl(rs)->codeptr_base;
  int32_t _1908_code = mosek::fusion::p_WorkStack::_get_impl(rs)->code_base;
  int32_t _1909_cconst = mosek::fusion::p_WorkStack::_get_impl(rs)->cconst_base;
  int32_t _1910_conedim = _ptr__1888_shape[_1891_conedim1];
  int32_t _1911_conesize = (safe_mul( _1910_conedim,safe_add( _1910_conedim,(int)1 ) ) / (int)2);
  int32_t _1912_numcone = (int)1;
  int32_t _9918_ = (int)0;
  int32_t _9919_ = _1897_nd;
  for (int32_t _1913_i = _9918_; _1913_i < _9919_; ++_1913_i)
  {
    {
      if (((_1913_i != _1892_conedim0) && (_1913_i != _1891_conedim1)))
      {
        {
          _1912_numcone *= _ptr__1888_shape[_1913_i];
        }
      }
      {}
    }
  }
  int64_t _1914_domainidx = task_append_domain_svec_psd(_1911_conesize);
  int32_t _1915_domsize = safe_mul( _1911_conesize,_1912_numcone );
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1916_afeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1915_domsize)));
  _checked_ptr_1<int32_t> _ptr__1916_afeidxs(_1916_afeidxs ? _1916_afeidxs->raw() : nullptr,_1916_afeidxs ? _1916_afeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1917_accidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1912_numcone)));
  _checked_ptr_1<int32_t> _ptr__1917_accidxs(_1917_accidxs ? _1917_accidxs->raw() : nullptr,_1917_accidxs ? _1917_accidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1918_conelmidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1915_domsize)));
  _checked_ptr_1<int32_t> _ptr__1918_conelmidx(_1918_conelmidx ? _1918_conelmidx->raw() : nullptr,_1918_conelmidx ? _1918_conelmidx->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1919_g = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_1915_domsize)));
  _checked_ptr_1<double> _ptr__1919_g(_1919_g ? _1919_g->raw() : nullptr,_1919_g ? _1919_g->size(0) : 0);
  int32_t _1920_conid = acon_allocate(_1914_domainidx,_1911_conesize,_1912_numcone,_1919_g,_1916_afeidxs,_1917_accidxs);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1921_aconidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1915_domsize)));
  _checked_ptr_1<int32_t> _ptr__1921_aconidxs(_1921_aconidxs ? _1921_aconidxs->raw() : nullptr,_1921_aconidxs ? _1921_aconidxs->size(0) : 0);
  acon_block_map->get(_1920_conid,_1921_aconidxs,(int)0);
  int64_t _1922_d5 = (int)1;
  int64_t _1923_d4 = _ptr__1888_shape[_1891_conedim1];
  int64_t _1924_d3 = (int)1;
  int64_t _1925_d2 = _ptr__1888_shape[_1892_conedim0];
  int64_t _1926_d1 = (int)1;
  int32_t _9920_ = (int)0;
  int32_t _9921_ = _1892_conedim0;
  for (int32_t _1927_i = _9920_; _1927_i < _9921_; ++_1927_i)
  {
    {
      _1926_d1 *= _ptr__1888_shape[_1927_i];
    }
  }
  int32_t _9922_ = safe_add( _1892_conedim0,(int)1 );
  int32_t _9923_ = _1891_conedim1;
  for (int32_t _1928_i = _9922_; _1928_i < _9923_; ++_1928_i)
  {
    {
      _1924_d3 *= _ptr__1888_shape[_1928_i];
    }
  }
  int32_t _9924_ = safe_add( _1891_conedim1,(int)1 );
  int32_t _9925_ = _1897_nd;
  for (int32_t _1929_i = _9924_; _1929_i < _9925_; ++_1929_i)
  {
    {
      _1922_d5 *= _ptr__1888_shape[_1929_i];
    }
  }
  {
    int32_t _1930_k = (int)0;
    double _1931_s = (1.0 / ::mosek::fusion::Utils::Tools::sqrt((double)((int)2)));
    int32_t _9926_ = (int)0;
    int64_t _9927_ = safe_mul( safe_mul( _1926_d1,_1924_d3 ),_1922_d5 );
    for (int64_t _1932_i1 = _9926_; _1932_i1 < _9927_; ++_1932_i1)
    {
      {
        int32_t _9928_ = (int)0;
        int64_t _9929_ = _1925_d2;
        for (int64_t _1933_i2 = _9928_; _1933_i2 < _9929_; ++_1933_i2)
        {
          {
            ++ _1930_k;
            int64_t _9930_ = safe_add( _1933_i2,(int)1 );
            int64_t _9931_ = _1923_d4;
            for (int64_t _1934_i4 = _9930_; _1934_i4 < _9931_; ++_1934_i4)
            {
              {
                ((*acon_elm_scale)(_ptr__1921_aconidxs[_1930_k])) = _1931_s;
                ++ _1930_k;
              }
            }
          }
        }
      }
    }
  }
  {
    std::shared_ptr< monty::ndarray< int32_t,1 > > _1935_afetrilperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_1898_nelem)));
    _checked_ptr_1<int32_t> _ptr__1935_afetrilperm(_1935_afetrilperm ? _1935_afetrilperm->raw() : nullptr,_1935_afetrilperm ? _1935_afetrilperm->size(0) : 0);
    int32_t _1936_k = (int)0;
    if (_1890_tril)
    {
      {
        int32_t _9932_ = (int)0;
        int64_t _9933_ = _1926_d1;
        for (int64_t _1937_i1 = _9932_; _1937_i1 < _9933_; ++_1937_i1)
        {
          {
            int32_t _9934_ = (int)0;
            int64_t _9935_ = _1923_d4;
            for (int64_t _1938_i4 = _9934_; _1938_i4 < _9935_; ++_1938_i4)
            {
              {
                int32_t _9936_ = (int)0;
                int64_t _9937_ = _1924_d3;
                for (int64_t _1939_i3 = _9936_; _1939_i3 < _9937_; ++_1939_i3)
                {
                  {
                    int64_t _9938_ = _1938_i4;
                    int64_t _9939_ = _1925_d2;
                    for (int64_t _1940_i2 = _9938_; _1940_i2 < _9939_; ++_1940_i2)
                    {
                      {
                        int32_t _9940_ = (int)0;
                        int64_t _9941_ = _1922_d5;
                        for (int64_t _1941_i5 = _9940_; _1941_i5 < _9941_; ++_1941_i5)
                        {
                          {
                            int64_t _1942_coneidx = safe_add( safe_add( safe_mul( safe_mul( _1937_i1,_1924_d3 ),_1922_d5 ),safe_mul( _1939_i3,_1922_d5 ) ),_1941_i5 );
                            int64_t _1943_coneofs = safe_add( (safe_mul( _1940_i2,safe_add( _1940_i2,(int)1 ) ) / (int)2),_1938_i4 );
                            _ptr__1935_afetrilperm[safe_add( safe_mul( _1942_coneidx,_1911_conesize ),_1943_coneofs )] = _ptr__1916_afeidxs[_1936_k];
                            ++ _1936_k;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    else
    {
      {
        int32_t _9942_ = (int)0;
        int64_t _9943_ = _1926_d1;
        for (int64_t _1944_i1 = _9942_; _1944_i1 < _9943_; ++_1944_i1)
        {
          {
            int32_t _9944_ = (int)0;
            int64_t _9945_ = _1923_d4;
            for (int64_t _1945_i4 = _9944_; _1945_i4 < _9945_; ++_1945_i4)
            {
              {
                int32_t _9946_ = (int)0;
                int64_t _9947_ = _1924_d3;
                for (int64_t _1946_i3 = _9946_; _1946_i3 < _9947_; ++_1946_i3)
                {
                  {
                    int32_t _9948_ = (int)0;
                    int64_t _9949_ = safe_add( _1945_i4,(int)1 );
                    for (int64_t _1947_i2 = _9948_; _1947_i2 < _9949_; ++_1947_i2)
                    {
                      {
                        int32_t _9950_ = (int)0;
                        int64_t _9951_ = _1922_d5;
                        for (int64_t _1948_i5 = _9950_; _1948_i5 < _9951_; ++_1948_i5)
                        {
                          {
                            int64_t _1949_coneidx = safe_add( safe_add( safe_mul( safe_mul( _1944_i1,_1924_d3 ),_1922_d5 ),safe_mul( _1946_i3,_1922_d5 ) ),_1948_i5 );
                            int64_t _1950_coneofs = safe_add( (safe_mul( _1947_i2,((safe_mul( (int)2,_1925_d2 ) - _1947_i2) - (int)1) ) / (int)2),_1945_i4 );
                            _ptr__1935_afetrilperm[safe_add( safe_mul( _1949_coneidx,_1911_conesize ),_1950_coneofs )] = _ptr__1916_afeidxs[_1936_k];
                            ++ _1936_k;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    putfrows(_1935_afetrilperm,(int)0,rs,_1898_nelem,_1899_nnz,_1903_ptr_base,_1904_nidxs_base,_1906_cof_base);
    if ((_1901_ncodeatom > (int)0))
    {
      {
        afe_blocks->replace_row_code(rs,_1935_afetrilperm,_1903_ptr_base,_1904_nidxs_base,_1907_codeptr,_1908_code,_1909_cconst);
      }
    }
    {}
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1951_pafeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_mul( safe_mul( _1912_numcone,_1925_d2 ),_1925_d2 ))));
  _checked_ptr_1<int32_t> _ptr__1951_pafeidxs(_1951_pafeidxs ? _1951_pafeidxs->raw() : nullptr,_1951_pafeidxs ? _1951_pafeidxs->size(0) : 0);
  {
    int32_t _1952_k = (int)0;
    if (_1890_tril)
    {
      {
        int32_t _9952_ = (int)0;
        int64_t _9953_ = _1926_d1;
        for (int64_t _1953_i1 = _9952_; _1953_i1 < _9953_; ++_1953_i1)
        {
          {
            int32_t _9954_ = (int)0;
            int64_t _9955_ = _1925_d2;
            for (int64_t _1954_i2 = _9954_; _1954_i2 < _9955_; ++_1954_i2)
            {
              {
                int32_t _9956_ = (int)0;
                int64_t _9957_ = _1924_d3;
                for (int64_t _1955_i3 = _9956_; _1955_i3 < _9957_; ++_1955_i3)
                {
                  {
                    int32_t _9958_ = (int)0;
                    int64_t _9959_ = _1923_d4;
                    for (int64_t _1956_i4 = _9958_; _1956_i4 < _9959_; ++_1956_i4)
                    {
                      {
                        int32_t _9960_ = (int)0;
                        int64_t _9961_ = _1922_d5;
                        for (int64_t _1957_i5 = _9960_; _1957_i5 < _9961_; ++_1957_i5)
                        {
                          {
                            int64_t _1958_coneidx = safe_add( safe_add( safe_mul( safe_mul( _1953_i1,_1924_d3 ),_1922_d5 ),safe_mul( _1955_i3,_1922_d5 ) ),_1957_i5 );
                            int64_t _9962_;
                            bool _9963_ = (_1954_i2 >= _1956_i4);
                            if (_9963_)
                            {
                              _9962_ = safe_add( (safe_mul( _1956_i4,((safe_mul( (int)2,_1925_d2 ) - _1956_i4) - (int)1) ) / (int)2),_1954_i2 );
                            }
                            else
                            {
                              _9962_ = safe_add( (safe_mul( _1954_i2,((safe_mul( (int)2,_1925_d2 ) - _1954_i2) - (int)1) ) / (int)2),_1956_i4 );
                            }
                            int64_t _1959_coneofs = _9962_;
                            _ptr__1951_pafeidxs[_1952_k] = _ptr__1916_afeidxs[safe_add( safe_mul( _1958_coneidx,_1911_conesize ),_1959_coneofs )];
                            ++ _1952_k;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    else
    {
      {
        int32_t _9964_ = (int)0;
        int64_t _9965_ = _1926_d1;
        for (int64_t _1960_i1 = _9964_; _1960_i1 < _9965_; ++_1960_i1)
        {
          {
            int32_t _9966_ = (int)0;
            int64_t _9967_ = _1925_d2;
            for (int64_t _1961_i2 = _9966_; _1961_i2 < _9967_; ++_1961_i2)
            {
              {
                int32_t _9968_ = (int)0;
                int64_t _9969_ = _1924_d3;
                for (int64_t _1962_i3 = _9968_; _1962_i3 < _9969_; ++_1962_i3)
                {
                  {
                    int32_t _9970_ = (int)0;
                    int64_t _9971_ = _1923_d4;
                    for (int64_t _1963_i4 = _9970_; _1963_i4 < _9971_; ++_1963_i4)
                    {
                      {
                        int32_t _9972_ = (int)0;
                        int64_t _9973_ = _1922_d5;
                        for (int64_t _1964_i5 = _9972_; _1964_i5 < _9973_; ++_1964_i5)
                        {
                          {
                            int64_t _1965_coneidx = safe_add( safe_add( safe_mul( safe_mul( _1960_i1,_1924_d3 ),_1922_d5 ),safe_mul( _1962_i3,_1922_d5 ) ),_1964_i5 );
                            int64_t _9974_;
                            bool _9975_ = (_1961_i2 >= _1963_i4);
                            if (_9975_)
                            {
                              _9974_ = safe_add( (safe_mul( _1963_i4,((safe_mul( (int)2,_1925_d2 ) - _1963_i4) - (int)1) ) / (int)2),_1961_i2 );
                            }
                            else
                            {
                              _9974_ = safe_add( (safe_mul( _1961_i2,((safe_mul( (int)2,_1925_d2 ) - _1961_i2) - (int)1) ) / (int)2),_1963_i4 );
                            }
                            int64_t _1966_coneofs = _9974_;
                            _ptr__1951_pafeidxs[_1952_k] = _ptr__1916_afeidxs[safe_add( safe_mul( _1965_coneidx,_1911_conesize ),_1966_coneofs )];
                            ++ _1952_k;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (((int)((_1885_name).size()) > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _1967_coneshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(((int)((_1888_shape)->size(0)) - (int)2))));
      _checked_ptr_1<int32_t> _ptr__1967_coneshape(_1967_coneshape ? _1967_coneshape->raw() : nullptr,_1967_coneshape ? _1967_coneshape->size(0) : 0);
      int32_t _9976_ = (int)0;
      int32_t _9977_ = _1892_conedim0;
      for (int32_t _1968_i = _9976_; _1968_i < _9977_; ++_1968_i)
      {
        {
          _ptr__1967_coneshape[_1968_i] = _ptr__1888_shape[_1968_i];
        }
      }
      int32_t _9978_ = safe_add( _1892_conedim0,(int)1 );
      int32_t _9979_ = _1891_conedim1;
      for (int32_t _1969_i = _9978_; _1969_i < _9979_; ++_1969_i)
      {
        {
          _ptr__1967_coneshape[(_1969_i - (int)1)] = _ptr__1888_shape[_1969_i];
        }
      }
      int32_t _9980_ = safe_add( _1891_conedim1,(int)1 );
      int32_t _9981_ = _1897_nd;
      for (int32_t _1970_i = _9980_; _1970_i < _9981_; ++_1970_i)
      {
        {
          _ptr__1967_coneshape[(_1970_i - (int)2)] = _ptr__1888_shape[_1970_i];
        }
      }
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _1971_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _1971_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1885_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if ((_1897_nd > (int)2))
      {
        {
          _1971_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
          int32_t _9982_ = (int)1;
          int32_t _9983_ = (_1897_nd - (int)2);
          for (int32_t _1972_i = _9982_; _1972_i < _9983_; ++_1972_i)
          {
            {
              _1971_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1972_i);
            }
          }
        }
      }
      {}
      _1971_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->indexnames.get()))
      {
        {
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _1973_dindexnames = mosek::fusion::p_PSDDomain::_get_impl(_1889_dom)->indexnames;
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _1974_indexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape((_1897_nd - (int)2))));
          int32_t _9984_ = (int)0;
          int32_t _9985_ = _1892_conedim0;
          for (int32_t _1975_i = _9984_; _1975_i < _9985_; ++_1975_i)
          {
            {
              ((*_1974_indexnames)(_1975_i)) = ((*_1973_dindexnames)(_1975_i));
            }
          }
          int32_t _9986_ = safe_add( _1892_conedim0,(int)1 );
          int32_t _9987_ = _1891_conedim1;
          for (int32_t _1976_i = _9986_; _1976_i < _9987_; ++_1976_i)
          {
            {
              ((*_1974_indexnames)((_1976_i - (int)1))) = ((*_1973_dindexnames)(_1976_i));
            }
          }
          int32_t _9988_ = safe_add( _1891_conedim1,(int)1 );
          int32_t _9989_ = _1897_nd;
          for (int32_t _1977_i = _9988_; _1977_i < _9989_; ++_1977_i)
          {
            {
              ((*_1974_indexnames)((_1977_i - (int)2))) = ((*_1973_dindexnames)(_1977_i));
            }
          }
          std::vector<int64_t> _9990_;
          for (int32_t _1978_i = (int)0, _9991_ = (int)((_1917_accidxs)->size(0)); _1978_i < _9991_ ; ++_1978_i)
          {
            _9990_.push_back(_ptr__1917_accidxs[_1978_i]);
          }
          auto _9992_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9990_.size()),_9990_.begin(),_9990_.end()));
          task_format_acc_names(_9992_,_1971_sb->toString(),_1967_coneshape,_1974_indexnames);
        }
      }
      else
      {
        {
          std::vector<int64_t> _9993_;
          for (int32_t _1979_i = (int)0, _9994_ = (int)((_1917_accidxs)->size(0)); _1979_i < _9994_ ; ++_1979_i)
          {
            _9993_.push_back(_ptr__1917_accidxs[_1979_i]);
          }
          auto _9995_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_9993_.size()),_9993_.begin(),_9993_.end()));
          task_format_acc_names(_9995_,_1971_sb->toString(),_1967_coneshape,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ConicConstraint > _1980_res = ::mosek::fusion::p_ConicConstraint::_new_ConicConstraint(::mosek::fusion::Model::t(_pubthis),_1885_name,nullptr,_1888_shape,_1920_conid,_1951_pafeidxs,nullptr);
  ((*acons)(_1920_conid)) = (_1980_res).as<::mosek::fusion::ModelConstraint>();
  if (((int)((_1885_name).size()) > (int)0))
  {
    {
      con_map->setItem(_1885_name,(-safe_add( (int)1,_1920_conid )));
    }
  }
  {}
  return (_1980_res).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.Model.constraint_

// Begin mosek.fusion.Model.constraint_
// Method mosek.fusion.Model.constraint_ @ bld/docker-win/final/default/src/fusion/Model.mbi:831:6-1031:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint_(const std::string & _1981_name,monty::rc_ptr< ::mosek::fusion::Expression > _1982_expr,monty::rc_ptr< ::mosek::fusion::ConeDomain > _1983_dom_)
{
  if ((((int)((_1981_name).size()) > (int)0) && hasConstraint(_1981_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate constraint name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1981_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  if ((((int)((_1981_name).size()) > (int)0) && hasConstraint(_1981_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate constraint name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_1981_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  if (mosek::fusion::p_ConeDomain::_get_impl(_1983_dom_)->int_flag)
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Integer domain not allowed in a constraint"));
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ExprDense > _1984_e = ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_1982_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
  _1984_e->eval(rs,ws,xs);
  rs->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _1985_ri32 = mosek::fusion::p_WorkStack::_get_impl(rs)->i32;
  _checked_ptr_1<int32_t> _ptr__1985_ri32(_1985_ri32 ? _1985_ri32->raw() : nullptr,_1985_ri32 ? _1985_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _1986_ri64 = mosek::fusion::p_WorkStack::_get_impl(rs)->i64;
  _checked_ptr_1<int64_t> _ptr__1986_ri64(_1986_ri64 ? _1986_ri64->raw() : nullptr,_1986_ri64 ? _1986_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _1987_rf64 = mosek::fusion::p_WorkStack::_get_impl(rs)->f64;
  _checked_ptr_1<double> _ptr__1987_rf64(_1987_rf64 ? _1987_rf64->raw() : nullptr,_1987_rf64 ? _1987_rf64->size(0) : 0);
  int32_t _1988_nd = mosek::fusion::p_WorkStack::_get_impl(rs)->nd;
  int32_t _1989_shape_base = mosek::fusion::p_WorkStack::_get_impl(rs)->shape_base;
  int32_t _1990_nelem = mosek::fusion::p_WorkStack::_get_impl(rs)->nelem;
  int32_t _1991_nnz = mosek::fusion::p_WorkStack::_get_impl(rs)->nnz;
  int32_t _1992_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(rs)->ncodeatom;
  bool _1993_hassp = mosek::fusion::p_WorkStack::_get_impl(rs)->hassp;
  int32_t _1994_ptr_base = mosek::fusion::p_WorkStack::_get_impl(rs)->ptr_base;
  int32_t _1995_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(rs)->nidxs_base;
  int32_t _1996_cof_base = mosek::fusion::p_WorkStack::_get_impl(rs)->cof_base;
  int32_t _1997_code = mosek::fusion::p_WorkStack::_get_impl(rs)->code_base;
  int32_t _1998_codeptr = mosek::fusion::p_WorkStack::_get_impl(rs)->codeptr_base;
  int32_t _1999_cconst = mosek::fusion::p_WorkStack::_get_impl(rs)->cconst_base;
  std::vector<int32_t> _9996_;
  for (int32_t _2001_i = (int)0, _9997_ = _1988_nd; _2001_i < _9997_ ; ++_2001_i)
  {
    _9996_.push_back(_ptr__1985_ri32[safe_add( _1989_shape_base,_2001_i )]);
  }
  auto _9998_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_9996_.size()),_9996_.begin(),_9996_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2000_shape = _9998_;
  _checked_ptr_1<int32_t> _ptr__2000_shape(_2000_shape ? _2000_shape->raw() : nullptr,_2000_shape ? _2000_shape->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::ConeDomain > _2002_dom = mosek::fusion::p_ConeDomain::_get_impl(_1983_dom_.get())->__mosek_2fusion_2ConeDomain__finalize_and_validate(_2000_shape);
  int32_t _9999_;
  bool _10000_ = _2002_dom->axisIsSet();
  if (_10000_)
  {
    _9999_ = _2002_dom->getAxis();
  }
  else
  {
    _9999_ = (_1988_nd - (int)1);
  }
  int32_t _2003_coneaxis = _9999_;
  int32_t _2004_conesize = _ptr__2000_shape[_2003_coneaxis];
  int32_t _2005_d1 = (int)1;
  int32_t _2006_d0 = (int)1;
  int32_t _2007_domsize = (int)1;
  int32_t _10001_ = (int)0;
  int32_t _10002_ = _1988_nd;
  for (int32_t _2008_i = _10001_; _2008_i < _10002_; ++_2008_i)
  {
    {
      _2007_domsize *= _ptr__2000_shape[_2008_i];
    }
  }
  int32_t _10003_ = (int)0;
  int32_t _10004_ = _2003_coneaxis;
  for (int32_t _2009_i = _10003_; _2009_i < _10004_; ++_2009_i)
  {
    {
      _2006_d0 *= _ptr__2000_shape[_2009_i];
    }
  }
  int32_t _10005_ = safe_add( _2003_coneaxis,(int)1 );
  int32_t _10006_ = _1988_nd;
  for (int32_t _2010_i = _10005_; _2010_i < _10006_; ++_2010_i)
  {
    {
      _2005_d1 *= _ptr__2000_shape[_2010_i];
    }
  }
  int32_t _2011_numcone = safe_mul( _2006_d0,_2005_d1 );
  int64_t _2012_domainidx;
  if ((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InQCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for quadratic cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_quad(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InRotatedQCone))
  {
    {
      if ((_2004_conesize < (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for rotated quadratic cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_rquad(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InPExpCone))
  {
    {
      if ((_2004_conesize != (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for exponential cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_pexp();
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InPPowCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for power cone"))->toString());
        }
      }
      {}
      if (((int)((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->alpha)->size(0)) < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Power cone requires at least two parameters"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_ppow(_2004_conesize,mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->alpha);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InDExpCone))
  {
    {
      if ((_2004_conesize != (int)3))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual exponential cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_dexp();
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InDPowCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual power cone"))->toString());
        }
      }
      {}
      if (((int)((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->alpha)->size(0)) < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Power cone requires at least two parameters"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_dpow(_2004_conesize,mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->alpha);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InPGeoMeanCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for primal geometric mean cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_pgeomean(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InDGeoMeanCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for dual geometric mean cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_dgeomean(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InSVecPSDCone))
  {
    {
      int32_t _2013_d = (int32_t)((::mosek::fusion::Utils::Tools::sqrt((double)(safe_add( (int)1,safe_mul( (int)8,_2004_conesize ) ))) - (int)1) / (int)2);
      if (((safe_mul( _2013_d,safe_add( _2013_d,(int)1 ) ) / (int)2) != _2004_conesize))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for vector positive semidefinite cone"))->toString());
        }
      }
      {}
      _2012_domainidx = task_append_domain_svec_psd(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::Positive))
  {
    {
      _2012_domainidx = task_append_domain_rpos(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::Negative))
  {
    {
      _2012_domainidx = task_append_domain_rneg(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::Unbounded))
  {
    {
      _2012_domainidx = task_append_domain_r(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::Zero))
  {
    {
      _2012_domainidx = task_append_domain_rzero(_2004_conesize);
    }
  }
  else if((mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->key == ::mosek::fusion::QConeKey::InPSDCone))
  {
    {
      if ((_2004_conesize < (int)2))
      {
        {
          throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for positive semidefinite cone"))->toString());
        }
      }
      else
      {
        {
          int32_t _2014_d = (int32_t)((::mosek::fusion::Utils::Tools::sqrt((double)(safe_add( (int)1,safe_mul( (int)8,_2004_conesize ) ))) - (int)1) / (int)2);
          if (((safe_mul( _2014_d,safe_add( _2014_d,(int)1 ) ) / (int)2) != _2004_conesize))
          {
            {
              throw ::mosek::fusion::DimensionError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Invalid size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_2004_conesize)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") for positive semidefinite cone"))->toString());
            }
          }
          {}
        }
      }
      _2012_domainidx = task_append_domain_svec_psd(_2004_conesize);
    }
  }
  else
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal error: Invalid cone type"));
    }
  }
  std::shared_ptr< monty::ndarray< double,1 > > _2015_g = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_2007_domsize)));
  _checked_ptr_1<double> _ptr__2015_g(_2015_g ? _2015_g->raw() : nullptr,_2015_g ? _2015_g->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2016_afeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2007_domsize)));
  _checked_ptr_1<int32_t> _ptr__2016_afeidxs(_2016_afeidxs ? _2016_afeidxs->raw() : nullptr,_2016_afeidxs ? _2016_afeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2017_accidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2011_numcone)));
  _checked_ptr_1<int32_t> _ptr__2017_accidxs(_2017_accidxs ? _2017_accidxs->raw() : nullptr,_2017_accidxs ? _2017_accidxs->size(0) : 0);
  int32_t _2018_conid = acon_allocate(_2012_domainidx,_2004_conesize,_2011_numcone,_2015_g,_2016_afeidxs,_2017_accidxs);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2019_perm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2007_domsize)));
  _checked_ptr_1<int32_t> _ptr__2019_perm(_2019_perm ? _2019_perm->raw() : nullptr,_2019_perm ? _2019_perm->size(0) : 0);
  {
    int32_t _2020_idx = (int)0;
    std::shared_ptr< monty::ndarray< double,1 > > _2021_ofs = mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->domofs;
    _checked_ptr_1<double> _ptr__2021_ofs(_2021_ofs ? _2021_ofs->raw() : nullptr,_2021_ofs ? _2021_ofs->size(0) : 0);
    {
      int32_t _10007_ = (int)0;
      int32_t _10008_ = _2006_d0;
      for (int32_t _2022_i0 = _10007_; _2022_i0 < _10008_; ++_2022_i0)
      {
        {
          int32_t _10009_ = (int)0;
          int32_t _10010_ = _2005_d1;
          for (int32_t _2023_i1 = _10009_; _2023_i1 < _10010_; ++_2023_i1)
          {
            {
              int32_t _10011_ = (int)0;
              int32_t _10012_ = _2004_conesize;
              for (int32_t _2024_ic = _10011_; _2024_ic < _10012_; ++_2024_ic)
              {
                {
                  _ptr__2019_perm[safe_add( safe_add( safe_mul( safe_mul( _2022_i0,_2005_d1 ),_2004_conesize ),safe_mul( _2024_ic,_2005_d1 ) ),_2023_i1 )] = _2020_idx;
                  ++ _2020_idx;
                }
              }
            }
          }
        }
      }
      if ((NULL != _2021_ofs.get()))
      {
        {
          int32_t _10013_ = (int)0;
          int32_t _10014_ = _2007_domsize;
          for (int32_t _2025_i = _10013_; _2025_i < _10014_; ++_2025_i)
          {
            {
              _ptr__2015_g[_ptr__2019_perm[_2025_i]] = _ptr__2021_ofs[_2025_i];
            }
          }
        }
      }
      {}
    }
  }
  std::vector<int32_t> _10015_;
  for (int32_t _2027_i = (int)0, _10016_ = _2007_domsize; _2027_i < _10016_ ; ++_2027_i)
  {
    _10015_.push_back(_ptr__2016_afeidxs[_ptr__2019_perm[_2027_i]]);
  }
  auto _10017_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10015_.size()),_10015_.begin(),_10015_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2026_pafeidxs = _10017_;
  _checked_ptr_1<int32_t> _ptr__2026_pafeidxs(_2026_pafeidxs ? _2026_pafeidxs->raw() : nullptr,_2026_pafeidxs ? _2026_pafeidxs->size(0) : 0);
  putfrows(_2026_pafeidxs,(int)0,rs,_1990_nelem,_1991_nnz,_1994_ptr_base,_1995_nidxs_base,_1996_cof_base);
  if ((_1992_ncodeatom > (int)0))
  {
    {
      afe_blocks->replace_row_code(rs,_2026_pafeidxs,_1994_ptr_base,_1995_nidxs_base,_1998_codeptr,_1997_code,_1999_cconst);
    }
  }
  {}
  if (((int)((_1981_name).size()) > (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2028_accshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(((int)((_2000_shape)->size(0)) - (int)1))));
      _checked_ptr_1<int32_t> _ptr__2028_accshape(_2028_accshape ? _2028_accshape->raw() : nullptr,_2028_accshape ? _2028_accshape->size(0) : 0);
      int32_t _10018_ = (int)0;
      int32_t _10019_ = _2003_coneaxis;
      for (int32_t _2029_i = _10018_; _2029_i < _10019_; ++_2029_i)
      {
        {
          _ptr__2028_accshape[_2029_i] = _ptr__2000_shape[_2029_i];
        }
      }
      int32_t _10020_ = safe_add( _2003_coneaxis,(int)1 );
      int32_t _10021_ = _1988_nd;
      for (int32_t _2030_i = _10020_; _2030_i < _10021_; ++_2030_i)
      {
        {
          _ptr__2028_accshape[(_2030_i - (int)1)] = _ptr__2000_shape[_2030_i];
        }
      }
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2031_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _2031_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_1981_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if ((_1988_nd > (int)1))
      {
        {
          _2031_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
          int32_t _10022_ = (int)1;
          int32_t _10023_ = (_1988_nd - (int)1);
          for (int32_t _2032_i = _10022_; _2032_i < _10023_; ++_2032_i)
          {
            {
              _2031_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_2032_i);
            }
          }
        }
      }
      {}
      _2031_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->indexnames.get()))
      {
        {
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2033_dindexnames = mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->indexnames;
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2034_indexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape((_1988_nd - (int)1))));
          int32_t _10024_ = (int)0;
          int32_t _10025_ = _2003_coneaxis;
          for (int32_t _2035_i = _10024_; _2035_i < _10025_; ++_2035_i)
          {
            {
              ((*_2034_indexnames)(_2035_i)) = ((*_2033_dindexnames)(_2035_i));
            }
          }
          int32_t _10026_ = safe_add( _2003_coneaxis,(int)1 );
          int32_t _10027_ = _1988_nd;
          for (int32_t _2036_i = _10026_; _2036_i < _10027_; ++_2036_i)
          {
            {
              ((*_2034_indexnames)((_2036_i - (int)1))) = ((*_2033_dindexnames)(_2036_i));
            }
          }
          std::vector<int64_t> _10028_;
          for (int32_t _2037_i = (int)0, _10029_ = (int)((_2017_accidxs)->size(0)); _2037_i < _10029_ ; ++_2037_i)
          {
            _10028_.push_back(_ptr__2017_accidxs[_2037_i]);
          }
          auto _10030_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10028_.size()),_10028_.begin(),_10028_.end()));
          task_format_acc_names(_10030_,_2031_sb->toString(),_2028_accshape,_2034_indexnames);
        }
      }
      else
      {
        {
          std::vector<int64_t> _10031_;
          for (int32_t _2038_i = (int)0, _10032_ = (int)((_2017_accidxs)->size(0)); _2038_i < _10032_ ; ++_2038_i)
          {
            _10031_.push_back(_ptr__2017_accidxs[_2038_i]);
          }
          auto _10033_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10031_.size()),_10031_.begin(),_10031_.end()));
          task_format_acc_names(_10033_,_2031_sb->toString(),_2028_accshape,std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ConicConstraint > _2039_res = ::mosek::fusion::p_ConicConstraint::_new_ConicConstraint(::mosek::fusion::Model::t(_pubthis),_1981_name,_2002_dom,_2000_shape,_2018_conid,_2016_afeidxs,mosek::fusion::p_ConeDomain::_get_impl(_2002_dom)->indexnames);
  ((*acons)(_2018_conid)) = (_2039_res).as<::mosek::fusion::ModelConstraint>();
  if (((int)((_1981_name).size()) > (int)0))
  {
    {
      con_map->setItem(_1981_name,(-safe_add( _2018_conid,(int)1 )));
    }
  }
  {}
  return (_2039_res).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.Model.constraint_

// Begin mosek.fusion.Model.constraint_
// Method mosek.fusion.Model.constraint_ @ bld/docker-win/final/default/src/fusion/Model.mbi:704:6-826:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__constraint_(const std::string & _2040_name,monty::rc_ptr< ::mosek::fusion::Expression > _2041_expr,monty::rc_ptr< ::mosek::fusion::LinearDomain > _2042_dom_)
{
  if ((((int)((_2040_name).size()) > (int)0) && hasConstraint(_2040_name)))
  {
    {
      throw ::mosek::fusion::NameError(::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Duplicate constraint name '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_2040_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->toString());
    }
  }
  {}
  if (mosek::fusion::p_LinearDomain::_get_impl(_2042_dom_)->cardinal_flag)
  {
    {
      throw ::mosek::fusion::DomainError(std::string ("Integer domain not allowed in a constraint"));
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::ExprDense > _2043_e = ::mosek::fusion::p_ExprDense::_new_ExprDense((::mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode((::mosek::fusion::p_ExprCompress::_new_ExprCompress(_2041_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>());
  _2043_e->eval(rs,ws,xs);
  rs->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2044_ri32 = mosek::fusion::p_WorkStack::_get_impl(rs)->i32;
  _checked_ptr_1<int32_t> _ptr__2044_ri32(_2044_ri32 ? _2044_ri32->raw() : nullptr,_2044_ri32 ? _2044_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2045_ri64 = mosek::fusion::p_WorkStack::_get_impl(rs)->i64;
  _checked_ptr_1<int64_t> _ptr__2045_ri64(_2045_ri64 ? _2045_ri64->raw() : nullptr,_2045_ri64 ? _2045_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _2046_rf64 = mosek::fusion::p_WorkStack::_get_impl(rs)->f64;
  _checked_ptr_1<double> _ptr__2046_rf64(_2046_rf64 ? _2046_rf64->raw() : nullptr,_2046_rf64 ? _2046_rf64->size(0) : 0);
  int32_t _2047_nd = mosek::fusion::p_WorkStack::_get_impl(rs)->nd;
  int32_t _2048_nelem = mosek::fusion::p_WorkStack::_get_impl(rs)->nelem;
  int32_t _2049_nnz = mosek::fusion::p_WorkStack::_get_impl(rs)->nnz;
  bool _2050_hassp = mosek::fusion::p_WorkStack::_get_impl(rs)->hassp;
  int32_t _2051_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(rs)->ncodeatom;
  int32_t _2052_shape_base = mosek::fusion::p_WorkStack::_get_impl(rs)->shape_base;
  int32_t _2053_ptr_base = mosek::fusion::p_WorkStack::_get_impl(rs)->ptr_base;
  int32_t _2054_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(rs)->nidxs_base;
  int32_t _2055_cof_base = mosek::fusion::p_WorkStack::_get_impl(rs)->cof_base;
  int32_t _2056_codeptr = mosek::fusion::p_WorkStack::_get_impl(rs)->codeptr_base;
  int32_t _2057_code = mosek::fusion::p_WorkStack::_get_impl(rs)->code_base;
  int32_t _2058_cconst = mosek::fusion::p_WorkStack::_get_impl(rs)->cconst_base;
  std::vector<int32_t> _10034_;
  for (int32_t _2060_i = (int)0, _10035_ = _2047_nd; _2060_i < _10035_ ; ++_2060_i)
  {
    _10034_.push_back(_ptr__2044_ri32[safe_add( _2052_shape_base,_2060_i )]);
  }
  auto _10036_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10034_.size()),_10034_.begin(),_10034_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2059_shape = _10036_;
  _checked_ptr_1<int32_t> _ptr__2059_shape(_2059_shape ? _2059_shape->raw() : nullptr,_2059_shape ? _2059_shape->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::LinearDomain > _2061_dom = mosek::fusion::p_LinearDomain::_get_impl(_2042_dom_.get())->__mosek_2fusion_2LinearDomain__finalize_and_validate(_2059_shape);
  int64_t _2062_domsize = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->domsize;
  std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2063_indexnames = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->indexnames;
  std::shared_ptr< monty::ndarray< double,1 > > _2064_b;
  _checked_ptr_1<double> _ptr__2064_b(_2064_b ? _2064_b->raw() : nullptr,_2064_b ? _2064_b->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2065_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2062_domsize)));
  _checked_ptr_1<int32_t> _ptr__2065_nativeidxs(_2065_nativeidxs ? _2065_nativeidxs->raw() : nullptr,_2065_nativeidxs ? _2065_nativeidxs->size(0) : 0);
  int32_t _2066_conid = con_allocate(_2065_nativeidxs);
  putarows(_2065_nativeidxs,rs,_2048_nelem,_2049_nnz,_2053_ptr_base,_2054_nidxs_base,_2055_cof_base);
  {
    std::shared_ptr< monty::ndarray< int32_t,2 > > _2067_domsp = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->sparsity;
    bool _2068_domempty = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->empty;
    std::shared_ptr< monty::ndarray< double,1 > > _2069_dombnd = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->bnd;
    _checked_ptr_1<double> _ptr__2069_dombnd(_2069_dombnd ? _2069_dombnd->raw() : nullptr,_2069_dombnd ? _2069_dombnd->size(0) : 0);
    bool _2070_domscalable = mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->scalable;
    {
      if ((NULL == _2069_dombnd.get()))
      {
        {
          _2064_b = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((_2065_nativeidxs)->size(0)))));
          _ptr__2064_b.update(_2064_b ? _2064_b->raw() : nullptr, _2064_b ? _2064_b->size(0) : 0);
        }
      }
      else if(_2070_domscalable)
      {
        {
          std::vector<double> _10037_;
          for (int32_t _2071_i = (int)0, _10038_ = (int)((_2065_nativeidxs)->size(0)); _2071_i < _10038_ ; ++_2071_i)
          {
            _10037_.push_back(_ptr__2069_dombnd[(int)0]);
          }
          auto _10039_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10037_.size()),_10037_.begin(),_10037_.end()));
          _2064_b = _10039_;
          _ptr__2064_b.update(_2064_b ? _2064_b->raw() : nullptr, _2064_b ? _2064_b->size(0) : 0);
        }
      }
      else if((NULL != _2067_domsp.get()))
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2072_stride = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2047_nd)));
          _checked_ptr_1<int32_t> _ptr__2072_stride(_2072_stride ? _2072_stride->raw() : nullptr,_2072_stride ? _2072_stride->size(0) : 0);
          _ptr__2072_stride[(_2047_nd - (int)1)] = (int)1;
          int32_t _10040_ = (int)1;
          int32_t _10041_ = _2047_nd;
          for (int32_t _2073_i = _10040_; _2073_i < _10041_; ++_2073_i)
          {
            {
              _ptr__2072_stride[((_2047_nd - _2073_i) - (int)1)] = safe_mul( _ptr__2072_stride[(_2047_nd - _2073_i)],_ptr__2059_shape[(_2047_nd - _2073_i)] );
            }
          }
          _2064_b = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((_2065_nativeidxs)->size(0)))));
          _ptr__2064_b.update(_2064_b ? _2064_b->raw() : nullptr, _2064_b ? _2064_b->size(0) : 0);
          int32_t _10042_ = (int)0;
          int32_t _10043_ = (int)((_2067_domsp)->size(0));
          for (int32_t _2074_i = _10042_; _2074_i < _10043_; ++_2074_i)
          {
            {
              int32_t _2075_idx = (int)0;
              int32_t _10044_ = (int)0;
              int32_t _10045_ = _2047_nd;
              for (int32_t _2076_j = _10044_; _2076_j < _10045_; ++_2076_j)
              {
                {
                  _2075_idx += safe_mul( _ptr__2072_stride[_2076_j],((*_2067_domsp)(_2074_i,_2076_j)) );
                }
              }
              _ptr__2064_b[_2075_idx] = _ptr__2069_dombnd[_2074_i];
            }
          }
        }
      }
      else if(_2068_domempty)
      {
        {
          _2064_b = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((_2065_nativeidxs)->size(0)))));
          _ptr__2064_b.update(_2064_b ? _2064_b->raw() : nullptr, _2064_b ? _2064_b->size(0) : 0);
        }
      }
      else
      {
        {
          std::vector<double> _10046_;
          for (int32_t _2077_i = (int)0, _10047_ = (int)((_2065_nativeidxs)->size(0)); _2077_i < _10047_ ; ++_2077_i)
          {
            _10046_.push_back(_ptr__2069_dombnd[_2077_i]);
          }
          auto _10048_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10046_.size()),_10046_.begin(),_10046_.end()));
          _2064_b = _10048_;
          _ptr__2064_b.update(_2064_b ? _2064_b->raw() : nullptr, _2064_b ? _2064_b->size(0) : 0);
        }
      }
    }
  }
  if ((mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->key == ::mosek::fusion::RelationKey::IsFree))
  {
    {
      task_con_putboundlist_fr(_2065_nativeidxs);
    }
  }
  {}
  if ((mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->key == ::mosek::fusion::RelationKey::LessThan))
  {
    {
      task_con_putboundlist_up(_2065_nativeidxs,_2064_b);
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->key == ::mosek::fusion::RelationKey::GreaterThan))
  {
    {
      task_con_putboundlist_lo(_2065_nativeidxs,_2064_b);
    }
  }
  else if((mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->key == ::mosek::fusion::RelationKey::EqualsTo))
  {
    {
      task_con_putboundlist_fx(_2065_nativeidxs,_2064_b);
    }
  }
  {}
  if ((_2051_ncodeatom > (int)0))
  {
    {
      con_blocks->replace_row_code(rs,_2065_nativeidxs,_2053_ptr_base,_2054_nidxs_base,_2056_codeptr,_2057_code,_2058_cconst);
    }
  }
  {}
  if (((int)((_2040_name).size()) > (int)0))
  {
    {
      monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2078_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
      _2078_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_2040_name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["));
      if (((int)((_2059_shape)->size(0)) > (int)0))
      {
        {
          _2078_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("%0"));
        }
      }
      {}
      int32_t _10049_ = (int)1;
      int32_t _10050_ = (int)((_2059_shape)->size(0));
      for (int32_t _2079_i = _10049_; _2079_i < _10050_; ++_2079_i)
      {
        {
          _2078_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",%"))->__mosek_2fusion_2Utils_2StringBuffer__a(_2079_i);
        }
      }
      _2078_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
      if ((NULL != mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->indexnames.get()))
      {
        {
          task_format_con_names(_2065_nativeidxs,_2078_sb->toString(),_2059_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),mosek::fusion::p_LinearDomain::_get_impl(_2061_dom)->indexnames);
        }
      }
      else
      {
        {
          task_format_con_names(_2065_nativeidxs,_2078_sb->toString(),_2059_shape,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(nullptr));
        }
      }
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::LinearConstraint > _2080_res = ::mosek::fusion::p_LinearConstraint::_new_LinearConstraint(::mosek::fusion::Model::t(_pubthis),_2040_name,_2066_conid,_2059_shape,_2065_nativeidxs,_2063_indexnames);
  ((*cons)(_2066_conid)) = (_2080_res).as<::mosek::fusion::ModelConstraint>();
  if (((int)((_2040_name).size()) > (int)0))
  {
    {
      con_map->setItem(_2040_name,_2066_conid);
    }
  }
  {}
  return (_2080_res).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.Model.constraint_

// Begin mosek.fusion.Model.getVersion
// Method mosek.fusion.Model.getVersion @ bld/docker-win/final/default/src/fusion/Model.mbi:698:6-700:7
std::string mosek::fusion::Model::getVersion
  ( ) { return mosek::fusion::p_Model::getVersion(); }
std::string mosek::fusion::p_Model::getVersion()
{
  return ::mosek::fusion::p_BaseModel::env_getversion();
}
// End mosek.fusion.Model.getVersion

// Begin mosek.fusion.Model.hasParameter
// Method mosek.fusion.Model.hasParameter @ bld/docker-win/final/default/src/fusion/Model.mbi:693:6-93
bool mosek::fusion::Model :: hasParameter(const std::string & _2081_name) { return mosek::fusion::p_Model::_get_impl(this)->hasParameter(_2081_name); }
bool mosek::fusion::p_Model::hasParameter(const std::string & _2081_name)
{
  return par_map->hasItem(_2081_name);
}
// End mosek.fusion.Model.hasParameter

// Begin mosek.fusion.Model.hasConstraint
// Method mosek.fusion.Model.hasConstraint @ bld/docker-win/final/default/src/fusion/Model.mbi:692:6-93
bool mosek::fusion::Model :: hasConstraint(const std::string & _2082_name) { return mosek::fusion::p_Model::_get_impl(this)->hasConstraint(_2082_name); }
bool mosek::fusion::p_Model::hasConstraint(const std::string & _2082_name)
{
  return con_map->hasItem(_2082_name);
}
// End mosek.fusion.Model.hasConstraint

// Begin mosek.fusion.Model.hasVariable
// Method mosek.fusion.Model.hasVariable @ bld/docker-win/final/default/src/fusion/Model.mbi:691:6-93
bool mosek::fusion::Model :: hasVariable(const std::string & _2083_name) { return mosek::fusion::p_Model::_get_impl(this)->hasVariable(_2083_name); }
bool mosek::fusion::p_Model::hasVariable(const std::string & _2083_name)
{
  return var_map->hasItem(_2083_name);
}
// End mosek.fusion.Model.hasVariable

// Begin mosek.fusion.Model.getParameter
// Method mosek.fusion.Model.getParameter @ bld/docker-win/final/default/src/fusion/Model.mbi:689:6-149
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model :: __mosek_2fusion_2Model__getParameter(const std::string & _2084_name) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getParameter(_2084_name); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Model::getParameter(const std::string &  _2084_name) { return __mosek_2fusion_2Model__getParameter(_2084_name); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Model::__mosek_2fusion_2Model__getParameter(const std::string & _2084_name)
{
  monty::rc_ptr< ::mosek::fusion::Parameter > _10051_;
  bool _10052_ = par_map->hasItem(_2084_name);
  if (_10052_)
  {
    _10051_ = ((*parameters)(par_map->getItem(_2084_name)));
  }
  else
  {
    _10051_ = nullptr;
  }
  return _10051_;
}
// End mosek.fusion.Model.getParameter

// Begin mosek.fusion.Model.getConstraint
// Method mosek.fusion.Model.getConstraint @ bld/docker-win/final/default/src/fusion/Model.mbi:688:6-167
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__getConstraint(int32_t _2085_index) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getConstraint(_2085_index); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::getConstraint(int32_t _2085_index) { return __mosek_2fusion_2Model__getConstraint(_2085_index); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__getConstraint(int32_t _2085_index)
{
  monty::rc_ptr< ::mosek::fusion::Constraint > _2086_res;
  if ((_2085_index >= (int)0))
  {
    {
      _2086_res = (((*cons)(_2085_index))).as<::mosek::fusion::Constraint>();
    }
  }
  else
  {
    {
      _2086_res = (((*acons)((-safe_add( (int)1,_2085_index ))))).as<::mosek::fusion::Constraint>();
    }
  }
  return _2086_res;
}
// End mosek.fusion.Model.getConstraint

// Begin mosek.fusion.Model.getConstraint
// Method mosek.fusion.Model.getConstraint @ bld/docker-win/final/default/src/fusion/Model.mbi:678:6-687:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model :: __mosek_2fusion_2Model__getConstraint(const std::string & _2087_name) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getConstraint(_2087_name); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Model::getConstraint(const std::string &  _2087_name) { return __mosek_2fusion_2Model__getConstraint(_2087_name); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Model::__mosek_2fusion_2Model__getConstraint(const std::string & _2087_name)
{
  monty::rc_ptr< ::mosek::fusion::Constraint > _2088_retval = nullptr;
  if (con_map->hasItem(_2087_name))
  {
    {
      int32_t _2089_idx = con_map->getItem(_2087_name);
      if ((_2089_idx >= (int)0))
      {
        {
          _2088_retval = (((*cons)(_2089_idx))).as<::mosek::fusion::Constraint>();
        }
      }
      else
      {
        {
          _2088_retval = (((*acons)((-safe_add( (int)1,_2089_idx ))))).as<::mosek::fusion::Constraint>();
        }
      }
    }
  }
  {}
  return _2088_retval;
}
// End mosek.fusion.Model.getConstraint

// Begin mosek.fusion.Model.getVariable
// Method mosek.fusion.Model.getVariable @ bld/docker-win/final/default/src/fusion/Model.mbi:676:6-86
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__getVariable(int32_t _2090_index) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getVariable(_2090_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::getVariable(int32_t _2090_index) { return __mosek_2fusion_2Model__getVariable(_2090_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__getVariable(int32_t _2090_index)
{
  return (((*vars)(_2090_index))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Model.getVariable

// Begin mosek.fusion.Model.getVariable
// Method mosek.fusion.Model.getVariable @ bld/docker-win/final/default/src/fusion/Model.mbi:665:6-675:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model :: __mosek_2fusion_2Model__getVariable(const std::string & _2091_name) { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__getVariable(_2091_name); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Model::getVariable(const std::string &  _2091_name) { return __mosek_2fusion_2Model__getVariable(_2091_name); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Model::__mosek_2fusion_2Model__getVariable(const std::string & _2091_name)
{
  if (var_map->hasItem(_2091_name))
  {
    {
      int32_t _2092_varid = var_map->getItem(_2091_name);
      if ((_2092_varid < (int)0))
      {
        {
          return (((*barvars)((-safe_add( _2092_varid,(int)1 ))))).as<::mosek::fusion::Variable>();
        }
      }
      else
      {
        {
          return (((*vars)(_2092_varid))).as<::mosek::fusion::Variable>();
        }
      }
    }
  }
  else
  {
    {
      return nullptr;
    }
  }
}
// End mosek.fusion.Model.getVariable

// Begin mosek.fusion.Model.getName
// Method mosek.fusion.Model.getName @ bld/docker-win/final/default/src/fusion/Model.mbi:663:6-67
std::string mosek::fusion::Model :: getName() { return mosek::fusion::p_Model::_get_impl(this)->getName(); }
std::string mosek::fusion::p_Model::getName()
{
  return model_name;
}
// End mosek.fusion.Model.getName

// Begin mosek.fusion.Model.getParameterValue
// Method mosek.fusion.Model.getParameterValue @ bld/docker-win/final/default/src/fusion/Model.mbi:655:6-660:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Model::getParameterValue(std::shared_ptr< monty::ndarray< int32_t,1 > > _2093_idxs)
{
  _checked_ptr_1<int32_t> _ptr__2093_idxs(_2093_idxs ? _2093_idxs->raw() : nullptr, _2093_idxs ? _2093_idxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _2094_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((_2093_idxs)->size(0)))));
  _checked_ptr_1<double> _ptr__2094_res(_2094_res ? _2094_res->raw() : nullptr,_2094_res ? _2094_res->size(0) : 0);
  int32_t _10053_ = (int)0;
  int32_t _10054_ = (int)((_2093_idxs)->size(0));
  for (int32_t _2095_i = _10053_; _2095_i < _10054_; ++_2095_i)
  {
    {
      _ptr__2094_res[_2095_i] = ((*param_value)(_ptr__2093_idxs[_2095_i]));
    }
  }
  return _2094_res;
}
// End mosek.fusion.Model.getParameterValue

// Begin mosek.fusion.Model.setParameterValue
// Method mosek.fusion.Model.setParameterValue @ bld/docker-win/final/default/src/fusion/Model.mbi:650:6-653:7
void mosek::fusion::p_Model::setParameterValue(std::shared_ptr< monty::ndarray< int32_t,1 > > _2096_idxs,std::shared_ptr< monty::ndarray< double,1 > > _2097_vals)
{
  _checked_ptr_1<int32_t> _ptr__2096_idxs(_2096_idxs ? _2096_idxs->raw() : nullptr, _2096_idxs ? _2096_idxs->size(0) : 0);
  _checked_ptr_1<double> _ptr__2097_vals(_2097_vals ? _2097_vals->raw() : nullptr, _2097_vals ? _2097_vals->size(0) : 0);
  int32_t _10055_ = (int)0;
  int32_t _10056_ = (int)((_2096_idxs)->size(0));
  for (int32_t _2098_i = _10055_; _2098_i < _10056_; ++_2098_i)
  {
    {
      ((*param_value)(_ptr__2096_idxs[_2098_i])) = _ptr__2097_vals[_2098_i];
    }
  }
}
// End mosek.fusion.Model.setParameterValue

// Begin mosek.fusion.Model.clone
// Method mosek.fusion.Model.clone @ bld/docker-win/final/default/src/fusion/Model.mbi:645:6-648:7
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Model :: __mosek_2fusion_2Model__clone() { return mosek::fusion::p_Model::_get_impl(this)->__mosek_2fusion_2Model__clone(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Model::clone() { return __mosek_2fusion_2Model__clone(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_Model::__mosek_2fusion_2Model__clone()
{
  return ::mosek::fusion::p_Model::_new_Model(::mosek::fusion::Model::t(_pubthis));
}
// End mosek.fusion.Model.clone

void mosek::fusion::p_Model::destroy()
{
  xs.reset();
  ws.reset();
  rs.reset();
  sol_itg.reset();
  sol_bas.reset();
  sol_itr.reset();
  con_map.reset();
  acons.reset();
  cons.reset();
  param_value.reset();
  par_map.reset();
  parameters.reset();
  initsol_xx_flag.reset();
  initsol_xx.reset();
  var_map.reset();
  barvars.reset();
  vars.reset();
  barvar_block_elm_j.reset();
  barvar_block_elm_i.reset();
  barvar_block_elm_barj.reset();
  barvar_block_elm_ptr.reset();
  barvar_block_dim.reset();
  barvar_block_ptr.reset();
  barvar_dim.reset();
  var_elm_acc_ofs.reset();
  var_elm_acc_idx.reset();
  var_block_acc_id.reset();
  var_block_map.reset();
  acon_elm_afe.reset();
  acon_elm_ofs.reset();
  acon_elm_scale.reset();
  acon_elm_accid.reset();
  acon_afe.reset();
  acon_acc.reset();
  acon_block_map.reset();
  acc_block_map.reset();
  obj_blocks.reset();
  afe_blocks.reset();
  con_blocks.reset();
}
void mosek::fusion::Model::destroy() { mosek::fusion::p_Model::_get_impl(this)->destroy(); }
// } class Model
// class BoundInterfaceVariable { // @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:29:4-85:5
mosek::fusion::BoundInterfaceVariable::BoundInterfaceVariable(mosek::fusion::p_BoundInterfaceVariable *_impl) : mosek::fusion::SliceVariable(_impl) { /*std::cout << "BoundInterfaceVariable()" << this << std::endl; */ }
mosek::fusion::BoundInterfaceVariable::~BoundInterfaceVariable() {  /* std::cout << "~BoundInterfaceVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_BoundInterfaceVariable::p_BoundInterfaceVariable
  (::mosek::fusion::BoundInterfaceVariable * _pubthis) :     mosek::fusion::p_SliceVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.BoundInterfaceVariable.ctor @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:41:6-50:7
mosek::fusion::BoundInterfaceVariable::t mosek::fusion::p_BoundInterfaceVariable::_new_BoundInterfaceVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2099_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2100_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2101_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2102_nativeidxs,
    bool _2103_islower)
{ return new mosek::fusion::BoundInterfaceVariable(_2099_m,_2100_shape,_2101_sparsity,_2102_nativeidxs,_2103_islower); }
mosek::fusion::BoundInterfaceVariable::BoundInterfaceVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2099_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2100_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2101_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2102_nativeidxs,
    bool _2103_islower) : 
   BoundInterfaceVariable(new mosek::fusion::p_BoundInterfaceVariable(this))
{ mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->_initialize(_2099_m,_2100_shape,_2101_sparsity,_2102_nativeidxs,_2103_islower); }
void mosek::fusion::p_BoundInterfaceVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2099_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2100_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2101_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2102_nativeidxs,
    bool _2103_islower)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2100_shape(_2100_shape ? _2100_shape->raw() : nullptr, _2100_shape ? _2100_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2101_sparsity(_2101_sparsity ? _2101_sparsity->raw() : nullptr, _2101_sparsity ? _2101_sparsity->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2102_nativeidxs(_2102_nativeidxs ? _2102_nativeidxs->raw() : nullptr, _2102_nativeidxs ? _2102_nativeidxs->size(0) : 0);
    mosek::fusion::p_SliceVariable::_initialize(_2099_m,_2100_shape,_2101_sparsity,_2102_nativeidxs);
    mosek::fusion::p_BoundInterfaceVariable::_get_impl(::mosek::fusion::BoundInterfaceVariable::t(_pubthis))->islower = _2103_islower;
  }
}
// mosek.fusion.BoundInterfaceVariable.ctor

// mosek.fusion.BoundInterfaceVariable.ctor @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:33:6-39:7
mosek::fusion::BoundInterfaceVariable::t mosek::fusion::p_BoundInterfaceVariable::_new_BoundInterfaceVariable
  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2104_v,
    bool _2105_islower)
{ return new mosek::fusion::BoundInterfaceVariable(_2104_v,_2105_islower); }
mosek::fusion::BoundInterfaceVariable::BoundInterfaceVariable
  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2104_v,
    bool _2105_islower) : 
   BoundInterfaceVariable(new mosek::fusion::p_BoundInterfaceVariable(this))
{ mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->_initialize(_2104_v,_2105_islower); }
void mosek::fusion::p_BoundInterfaceVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2104_v,
    bool _2105_islower)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_SliceVariable::_initialize(_2104_v);
    mosek::fusion::p_BoundInterfaceVariable::_get_impl(::mosek::fusion::BoundInterfaceVariable::t(_pubthis))->islower = _2105_islower;
  }
}
// mosek.fusion.BoundInterfaceVariable.ctor

// Begin mosek.fusion.BoundInterfaceVariable.dual
// Method mosek.fusion.BoundInterfaceVariable.dual @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:80:6-84:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::BoundInterfaceVariable :: dual() { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->dual(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_BoundInterfaceVariable::dual()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2106_target = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_pubthis->getSize())));
  _checked_ptr_1<double> _ptr__2106_target(_2106_target ? _2106_target->raw() : nullptr,_2106_target ? _2106_target->size(0) : 0);
  dual_lu((int)0,_2106_target,islower);
  return _2106_target;
}
// End mosek.fusion.BoundInterfaceVariable.dual

// Begin mosek.fusion.BoundInterfaceVariable.transpose
// Method mosek.fusion.BoundInterfaceVariable.transpose @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:78:6-78
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__transpose() { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__transpose(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::transpose() { return __mosek_2fusion_2BoundInterfaceVariable__transpose(); }
/* override: mosek.fusion.BaseVariable.transpose*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__transpose() { return __mosek_2fusion_2BoundInterfaceVariable__transpose(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__transpose()
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__transpose())).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.transpose

// Begin mosek.fusion.BoundInterfaceVariable.pick
// Method mosek.fusion.BoundInterfaceVariable.pick @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:77:6-112
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2107_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2108_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2109_i2) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__pick(_2107_i0,_2108_i1,_2109_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2107_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2108_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2109_i2) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2107_i0,_2108_i1,_2109_i2); }
/* override: mosek.fusion.BaseVariable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2107_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2108_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2109_i2) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2107_i0,_2108_i1,_2109_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2107_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2108_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2109_i2)
{
  _checked_ptr_1<int32_t> _ptr__2107_i0(_2107_i0 ? _2107_i0->raw() : nullptr, _2107_i0 ? _2107_i0->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2108_i1(_2108_i1 ? _2108_i1->raw() : nullptr, _2108_i1 ? _2108_i1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2109_i2(_2109_i2 ? _2109_i2->raw() : nullptr, _2109_i2 ? _2109_i2->size(0) : 0);
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(_2107_i0,_2108_i1,_2109_i2))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.pick

// Begin mosek.fusion.BoundInterfaceVariable.pick
// Method mosek.fusion.BoundInterfaceVariable.pick @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:76:6-98
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2110_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2111_i1) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__pick(_2110_i0,_2111_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2110_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2111_i1) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2110_i0,_2111_i1); }
/* override: mosek.fusion.BaseVariable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2110_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2111_i1) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2110_i0,_2111_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2110_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2111_i1)
{
  _checked_ptr_1<int32_t> _ptr__2110_i0(_2110_i0 ? _2110_i0->raw() : nullptr, _2110_i0 ? _2110_i0->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2111_i1(_2111_i1 ? _2111_i1->raw() : nullptr, _2111_i1 ? _2111_i1->size(0) : 0);
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(_2110_i0,_2111_i1))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.pick

// Begin mosek.fusion.BoundInterfaceVariable.pick
// Method mosek.fusion.BoundInterfaceVariable.pick @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:75:6-91
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2112_midxs) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__pick(_2112_midxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2112_midxs) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2112_midxs); }
/* override: mosek.fusion.BaseVariable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2112_midxs) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2112_midxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2112_midxs)
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(_2112_midxs))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.pick

// Begin mosek.fusion.BoundInterfaceVariable.pick
// Method mosek.fusion.BoundInterfaceVariable.pick @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:74:6-88
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2113_idxs) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__pick(_2113_idxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2113_idxs) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2113_idxs); }
/* override: mosek.fusion.BaseVariable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2113_idxs) { return __mosek_2fusion_2BoundInterfaceVariable__pick(_2113_idxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2113_idxs)
{
  _checked_ptr_1<int32_t> _ptr__2113_idxs(_2113_idxs ? _2113_idxs->raw() : nullptr, _2113_idxs ? _2113_idxs->size(0) : 0);
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(_2113_idxs))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.pick

// Begin mosek.fusion.BoundInterfaceVariable.antidiag
// Method mosek.fusion.BoundInterfaceVariable.antidiag @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:73:6-93
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__antidiag(int32_t _2114_index) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__antidiag(_2114_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::antidiag(int32_t _2114_index) { return __mosek_2fusion_2BoundInterfaceVariable__antidiag(_2114_index); }
/* override: mosek.fusion.BaseVariable.antidiag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__antidiag(int32_t _2114_index) { return __mosek_2fusion_2BoundInterfaceVariable__antidiag(_2114_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__antidiag(int32_t _2114_index)
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__antidiag(_2114_index))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.antidiag

// Begin mosek.fusion.BoundInterfaceVariable.antidiag
// Method mosek.fusion.BoundInterfaceVariable.antidiag @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:72:6-76
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__antidiag() { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__antidiag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::antidiag() { return __mosek_2fusion_2BoundInterfaceVariable__antidiag(); }
/* override: mosek.fusion.BaseVariable.antidiag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__antidiag() { return __mosek_2fusion_2BoundInterfaceVariable__antidiag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__antidiag()
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__antidiag())).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.antidiag

// Begin mosek.fusion.BoundInterfaceVariable.diag
// Method mosek.fusion.BoundInterfaceVariable.diag @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:71:6-88
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__diag(int32_t _2115_index) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__diag(_2115_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::diag(int32_t _2115_index) { return __mosek_2fusion_2BoundInterfaceVariable__diag(_2115_index); }
/* override: mosek.fusion.BaseVariable.diag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__diag(int32_t _2115_index) { return __mosek_2fusion_2BoundInterfaceVariable__diag(_2115_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__diag(int32_t _2115_index)
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__diag(_2115_index))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.diag

// Begin mosek.fusion.BoundInterfaceVariable.diag
// Method mosek.fusion.BoundInterfaceVariable.diag @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:70:6-72
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__diag() { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__diag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::diag() { return __mosek_2fusion_2BoundInterfaceVariable__diag(); }
/* override: mosek.fusion.BaseVariable.diag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__diag() { return __mosek_2fusion_2BoundInterfaceVariable__diag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__diag()
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__diag())).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.diag

// Begin mosek.fusion.BoundInterfaceVariable.slice
// Method mosek.fusion.BoundInterfaceVariable.slice @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:69:6-113
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2116_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2117_lasta) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__slice(_2116_firsta,_2117_lasta); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2116_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2117_lasta) { return __mosek_2fusion_2BoundInterfaceVariable__slice(_2116_firsta,_2117_lasta); }
/* override: mosek.fusion.BaseVariable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2116_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2117_lasta) { return __mosek_2fusion_2BoundInterfaceVariable__slice(_2116_firsta,_2117_lasta); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2116_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2117_lasta)
{
  _checked_ptr_1<int32_t> _ptr__2116_firsta(_2116_firsta ? _2116_firsta->raw() : nullptr, _2116_firsta ? _2116_firsta->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2117_lasta(_2117_lasta ? _2117_lasta->raw() : nullptr, _2117_lasta ? _2117_lasta->size(0) : 0);
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__slice(_2116_firsta,_2117_lasta))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.slice

// Begin mosek.fusion.BoundInterfaceVariable.slice
// Method mosek.fusion.BoundInterfaceVariable.slice @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:68:6-105
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable :: __mosek_2fusion_2BoundInterfaceVariable__slice(int32_t _2118_first,int32_t _2119_last) { return mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->__mosek_2fusion_2BoundInterfaceVariable__slice(_2118_first,_2119_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::slice(int32_t _2118_first,int32_t _2119_last) { return __mosek_2fusion_2BoundInterfaceVariable__slice(_2118_first,_2119_last); }
/* override: mosek.fusion.BaseVariable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BoundInterfaceVariable::__mosek_2fusion_2BaseVariable__slice(int32_t _2118_first,int32_t _2119_last) { return __mosek_2fusion_2BoundInterfaceVariable__slice(_2118_first,_2119_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__slice(int32_t _2118_first,int32_t _2119_last)
{
  return (__mosek_2fusion_2BoundInterfaceVariable__from_(::mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__slice(_2118_first,_2119_last))).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BoundInterfaceVariable.slice

// Begin mosek.fusion.BoundInterfaceVariable.from_
// Method mosek.fusion.BoundInterfaceVariable.from_ @ bld/docker-win/final/default/src/fusion/BoundInterfaceVariable.mbi:52:6-66:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::p_BoundInterfaceVariable::__mosek_2fusion_2BoundInterfaceVariable__from_(monty::rc_ptr< ::mosek::fusion::Variable > _2120_v)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2121_shape = _pubthis->getShape();
  _checked_ptr_1<int32_t> _ptr__2121_shape(_2121_shape ? _2121_shape->raw() : nullptr,_2121_shape ? _2121_shape->size(0) : 0);
  int32_t _2122_nnz = _2120_v->numInst();
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2123_nativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2122_nnz)));
  _checked_ptr_1<int64_t> _ptr__2123_nativeidxs(_2123_nativeidxs ? _2123_nativeidxs->raw() : nullptr,_2123_nativeidxs ? _2123_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2124_sparsity = nullptr;
  _checked_ptr_1<int64_t> _ptr__2124_sparsity(_2124_sparsity ? _2124_sparsity->raw() : nullptr,_2124_sparsity ? _2124_sparsity->size(0) : 0);
  if ((_2120_v->getSize() == _2122_nnz))
  {
    {
      _2120_v->inst((int)0,_2123_nativeidxs);
    }
  }
  else
  {
    {
      _2124_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2122_nnz)));
      _ptr__2124_sparsity.update(_2124_sparsity ? _2124_sparsity->raw() : nullptr, _2124_sparsity ? _2124_sparsity->size(0) : 0);
      _2120_v->inst((int)0,_2124_sparsity,(int)0,_2123_nativeidxs);
    }
  }
  return ::mosek::fusion::p_BoundInterfaceVariable::_new_BoundInterfaceVariable(_2120_v->__mosek_2fusion_2Variable__getModel(),_2121_shape,_2124_sparsity,_2123_nativeidxs,islower);
}
// End mosek.fusion.BoundInterfaceVariable.from_

void mosek::fusion::p_BoundInterfaceVariable::destroy()
{
}
void mosek::fusion::BoundInterfaceVariable::destroy() { mosek::fusion::p_BoundInterfaceVariable::_get_impl(this)->destroy(); }
// } class BoundInterfaceVariable
// class SliceVariable { // @ bld/docker-win/final/default/src/fusion/SliceVariable.mbi:18:4-66:5
mosek::fusion::SliceVariable::SliceVariable(mosek::fusion::p_SliceVariable *_impl) : mosek::fusion::BaseVariable(_impl) { /*std::cout << "SliceVariable()" << this << std::endl; */ }
mosek::fusion::SliceVariable::~SliceVariable() {  /* std::cout << "~SliceVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_SliceVariable::p_SliceVariable
  (::mosek::fusion::SliceVariable * _pubthis) :     mosek::fusion::p_BaseVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.SliceVariable.ctor @ bld/docker-win/final/default/src/fusion/SliceVariable.mbi:54:6-65:7
mosek::fusion::SliceVariable::t mosek::fusion::p_SliceVariable::_new_SliceVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2125_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2126_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2127_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2128_nativeidxs)
{ return new mosek::fusion::SliceVariable(_2125_m,_2126_shape,_2127_sparsity,_2128_nativeidxs); }
mosek::fusion::SliceVariable::SliceVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2125_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2126_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2127_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2128_nativeidxs) : 
   SliceVariable(new mosek::fusion::p_SliceVariable(this))
{ mosek::fusion::p_SliceVariable::_get_impl(this)->_initialize(_2125_m,_2126_shape,_2127_sparsity,_2128_nativeidxs); }
void mosek::fusion::p_SliceVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2125_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2126_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2127_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2128_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2126_shape(_2126_shape ? _2126_shape->raw() : nullptr, _2126_shape ? _2126_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2127_sparsity(_2127_sparsity ? _2127_sparsity->raw() : nullptr, _2127_sparsity ? _2127_sparsity->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2128_nativeidxs(_2128_nativeidxs ? _2128_nativeidxs->raw() : nullptr, _2128_nativeidxs ? _2128_nativeidxs->size(0) : 0);
    mosek::fusion::p_BaseVariable::_initialize(_2125_m,_2126_shape,_2127_sparsity,_2128_nativeidxs);
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->nativeidxs = _2128_nativeidxs;
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->sparsity = _2127_sparsity;
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->shape = _2126_shape;
  }
}
// mosek.fusion.SliceVariable.ctor

// mosek.fusion.SliceVariable.ctor @ bld/docker-win/final/default/src/fusion/SliceVariable.mbi:47:6-52:7
mosek::fusion::SliceVariable::t mosek::fusion::p_SliceVariable::_new_SliceVariable
  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2129_v)
{ return new mosek::fusion::SliceVariable(_2129_v); }
mosek::fusion::SliceVariable::SliceVariable
  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2129_v) : 
   SliceVariable(new mosek::fusion::p_SliceVariable(this))
{ mosek::fusion::p_SliceVariable::_get_impl(this)->_initialize(_2129_v); }
void mosek::fusion::p_SliceVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::SliceVariable > _2129_v)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseVariable::_initialize(_2129_v,_2129_v->__mosek_2fusion_2BaseVariable__getModel());
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->nativeidxs = mosek::fusion::p_SliceVariable::_get_impl(_2129_v)->nativeidxs;
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->sparsity = mosek::fusion::p_SliceVariable::_get_impl(_2129_v)->sparsity;
    mosek::fusion::p_SliceVariable::_get_impl(::mosek::fusion::SliceVariable::t(_pubthis))->shape = mosek::fusion::p_SliceVariable::_get_impl(_2129_v)->shape;
  }
}
// mosek.fusion.SliceVariable.ctor

void mosek::fusion::p_SliceVariable::destroy()
{
  shape.reset();
  sparsity.reset();
  nativeidxs.reset();
}
void mosek::fusion::SliceVariable::destroy() { mosek::fusion::p_SliceVariable::_get_impl(this)->destroy(); }
// } class SliceVariable
// class RangedVariable { // @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:15:4-125:5
mosek::fusion::RangedVariable::RangedVariable(mosek::fusion::p_RangedVariable *_impl) : mosek::fusion::ModelVariable(_impl) { /*std::cout << "RangedVariable()" << this << std::endl; */ }
mosek::fusion::RangedVariable::~RangedVariable() {  /* std::cout << "~RangedVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_RangedVariable::p_RangedVariable
  (::mosek::fusion::RangedVariable * _pubthis) :     mosek::fusion::p_ModelVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.RangedVariable.ctor @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:55:6-64:7
mosek::fusion::RangedVariable::t mosek::fusion::p_RangedVariable::_new_RangedVariable
  (monty::rc_ptr< ::mosek::fusion::RangedVariable > _2130_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2131_m)
{ return new mosek::fusion::RangedVariable(_2130_v,_2131_m); }
mosek::fusion::RangedVariable::RangedVariable
  (monty::rc_ptr< ::mosek::fusion::RangedVariable > _2130_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2131_m) : 
   RangedVariable(new mosek::fusion::p_RangedVariable(this))
{ mosek::fusion::p_RangedVariable::_get_impl(this)->_initialize(_2130_v,_2131_m); }
void mosek::fusion::p_RangedVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::RangedVariable > _2130_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2131_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelVariable::_initialize(_2130_v,_2131_m);
    name = mosek::fusion::p_RangedVariable::_get_impl(_2130_v)->name;
    nativeidxs = mosek::fusion::p_RangedVariable::_get_impl(_2130_v)->nativeidxs;
    sparsity = mosek::fusion::p_RangedVariable::_get_impl(_2130_v)->sparsity;
    names_flushed = mosek::fusion::p_RangedVariable::_get_impl(_2130_v)->names_flushed;
    shape = mosek::fusion::p_RangedVariable::_get_impl(_2130_v)->shape;
  }
}
// mosek.fusion.RangedVariable.ctor

// mosek.fusion.RangedVariable.ctor @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:39:6-53:7
mosek::fusion::RangedVariable::t mosek::fusion::p_RangedVariable::_new_RangedVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2132_model,
    const std::string &  _2133_name,
    int64_t _2134_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2135_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2136_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2137_nativeidxs)
{ return new mosek::fusion::RangedVariable(_2132_model,_2133_name,_2134_varid,_2135_shape,_2136_sparsity,_2137_nativeidxs); }
mosek::fusion::RangedVariable::RangedVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2132_model,
    const std::string &  _2133_name,
    int64_t _2134_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2135_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2136_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2137_nativeidxs) : 
   RangedVariable(new mosek::fusion::p_RangedVariable(this))
{ mosek::fusion::p_RangedVariable::_get_impl(this)->_initialize(_2132_model,_2133_name,_2134_varid,_2135_shape,_2136_sparsity,_2137_nativeidxs); }
void mosek::fusion::p_RangedVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2132_model,
    const std::string &  _2133_name,
    int64_t _2134_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2135_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2136_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2137_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2135_shape(_2135_shape ? _2135_shape->raw() : nullptr, _2135_shape ? _2135_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2136_sparsity(_2136_sparsity ? _2136_sparsity->raw() : nullptr, _2136_sparsity ? _2136_sparsity->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2137_nativeidxs(_2137_nativeidxs ? _2137_nativeidxs->raw() : nullptr, _2137_nativeidxs ? _2137_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelVariable::_initialize(_2132_model,_2133_name,_2135_shape,_2134_varid,_2136_sparsity,::mosek::fusion::p_RangedVariable::globalNativeIndexes(_2137_nativeidxs));
    mosek::fusion::p_RangedVariable::_get_impl(::mosek::fusion::RangedVariable::t(_pubthis))->nativeidxs = _2137_nativeidxs;
    mosek::fusion::p_RangedVariable::_get_impl(::mosek::fusion::RangedVariable::t(_pubthis))->sparsity = _2136_sparsity;
    mosek::fusion::p_RangedVariable::_get_impl(::mosek::fusion::RangedVariable::t(_pubthis))->name = _2133_name;
    mosek::fusion::p_RangedVariable::_get_impl(::mosek::fusion::RangedVariable::t(_pubthis))->shape = _2135_shape;
    names_flushed = false;
  }
}
// mosek.fusion.RangedVariable.ctor

// Begin mosek.fusion.RangedVariable.elementDesc
// Method mosek.fusion.RangedVariable.elementDesc @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:119:6-124:7
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::RangedVariable :: __mosek_2fusion_2RangedVariable__elementDesc(int64_t _2138_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2139_sb) { return mosek::fusion::p_RangedVariable::_get_impl(this)->__mosek_2fusion_2RangedVariable__elementDesc(_2138_index,_2139_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::RangedVariable::elementDesc(int64_t _2138_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2139_sb) { return __mosek_2fusion_2RangedVariable__elementDesc(_2138_index,_2139_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::p_RangedVariable::__mosek_2fusion_2RangedVariable__elementDesc(int64_t _2138_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2139_sb)
{
  _pubthis->elementName(_2138_index,_2139_sb);
  _2139_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" : in range"));
  return _2139_sb;
}
// End mosek.fusion.RangedVariable.elementDesc

// Begin mosek.fusion.RangedVariable.flushNames
// Method mosek.fusion.RangedVariable.flushNames @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:98:6-116:7
void mosek::fusion::p_RangedVariable::flushNames()
{
}
// End mosek.fusion.RangedVariable.flushNames

// Begin mosek.fusion.RangedVariable.dual_u
// Method mosek.fusion.RangedVariable.dual_u @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:91:6-96:7
void mosek::fusion::p_RangedVariable::dual_u(int32_t _2140_offset,std::shared_ptr< monty::ndarray< double,1 > > _2141_target)
{
  _checked_ptr_1<double> _ptr__2141_target(_2141_target ? _2141_target->raw() : nullptr, _2141_target ? _2141_target->size(0) : 0);
  dual_lu(_2140_offset,_2141_target,false);
}
// End mosek.fusion.RangedVariable.dual_u

// Begin mosek.fusion.RangedVariable.dual_l
// Method mosek.fusion.RangedVariable.dual_l @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:83:6-88:7
void mosek::fusion::p_RangedVariable::dual_l(int32_t _2142_offset,std::shared_ptr< monty::ndarray< double,1 > > _2143_target)
{
  _checked_ptr_1<double> _ptr__2143_target(_2143_target ? _2143_target->raw() : nullptr, _2143_target ? _2143_target->size(0) : 0);
  dual_lu(_2142_offset,_2143_target,true);
}
// End mosek.fusion.RangedVariable.dual_l

// Begin mosek.fusion.RangedVariable.upperBoundVar
// Method mosek.fusion.RangedVariable.upperBoundVar @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:79:6-81:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::RangedVariable :: __mosek_2fusion_2RangedVariable__upperBoundVar() { return mosek::fusion::p_RangedVariable::_get_impl(this)->__mosek_2fusion_2RangedVariable__upperBoundVar(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::RangedVariable::upperBoundVar() { return __mosek_2fusion_2RangedVariable__upperBoundVar(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::p_RangedVariable::__mosek_2fusion_2RangedVariable__upperBoundVar()
{
  std::vector<int64_t> _10057_;
  for (int32_t _2144_i = (int)0, _10058_ = (int)((nativeidxs)->size(0)); _2144_i < _10058_ ; ++_2144_i)
  {
    _10057_.push_back(((*nativeidxs)(_2144_i)));
  }
  auto _10059_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10057_.size()),_10057_.begin(),_10057_.end()));
  return ::mosek::fusion::p_BoundInterfaceVariable::_new_BoundInterfaceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),shape,sparsity,_10059_,false);
}
// End mosek.fusion.RangedVariable.upperBoundVar

// Begin mosek.fusion.RangedVariable.lowerBoundVar
// Method mosek.fusion.RangedVariable.lowerBoundVar @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:73:6-75:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::RangedVariable :: __mosek_2fusion_2RangedVariable__lowerBoundVar() { return mosek::fusion::p_RangedVariable::_get_impl(this)->__mosek_2fusion_2RangedVariable__lowerBoundVar(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::RangedVariable::lowerBoundVar() { return __mosek_2fusion_2RangedVariable__lowerBoundVar(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceVariable > mosek::fusion::p_RangedVariable::__mosek_2fusion_2RangedVariable__lowerBoundVar()
{
  std::vector<int64_t> _10060_;
  for (int32_t _2145_i = (int)0, _10061_ = (int)((nativeidxs)->size(0)); _2145_i < _10061_ ; ++_2145_i)
  {
    _10060_.push_back(((*nativeidxs)(_2145_i)));
  }
  auto _10062_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10060_.size()),_10060_.begin(),_10060_.end()));
  return ::mosek::fusion::p_BoundInterfaceVariable::_new_BoundInterfaceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),shape,sparsity,_10062_,true);
}
// End mosek.fusion.RangedVariable.lowerBoundVar

// Begin mosek.fusion.RangedVariable.clone
// Method mosek.fusion.RangedVariable.clone @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:66:6-68:7
monty::rc_ptr< ::mosek::fusion::ModelVariable > mosek::fusion::p_RangedVariable::__mosek_2fusion_2RangedVariable__clone(monty::rc_ptr< ::mosek::fusion::Model > _2146_m)
{
  return (::mosek::fusion::p_RangedVariable::_new_RangedVariable(::mosek::fusion::RangedVariable::t(_pubthis),_2146_m)).as<::mosek::fusion::ModelVariable>();
}
// End mosek.fusion.RangedVariable.clone

// Begin mosek.fusion.RangedVariable.globalNativeIndexes
// Method mosek.fusion.RangedVariable.globalNativeIndexes @ bld/docker-win/final/default/src/fusion/RangedVariable.mbi:25:6-28:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_RangedVariable::globalNativeIndexes(std::shared_ptr< monty::ndarray< int32_t,1 > > _2147_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__2147_nativeidxs(_2147_nativeidxs ? _2147_nativeidxs->raw() : nullptr, _2147_nativeidxs ? _2147_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2148_r = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_2147_nativeidxs)->size(0)))));
  _checked_ptr_1<int64_t> _ptr__2148_r(_2148_r ? _2148_r->raw() : nullptr,_2148_r ? _2148_r->size(0) : 0);
  int32_t _10063_ = (int)0;
  int32_t _10064_ = (int)((_2147_nativeidxs)->size(0));
  for (int32_t _2149_i = _10063_; _2149_i < _10064_; ++_2149_i)
  {
    {
      _ptr__2148_r[_2149_i] = _ptr__2147_nativeidxs[_2149_i];
    }
  }
  return _2148_r;
}
// End mosek.fusion.RangedVariable.globalNativeIndexes

void mosek::fusion::p_RangedVariable::destroy()
{
  shape.reset();
  nativeidxs.reset();
  sparsity.reset();
}
void mosek::fusion::RangedVariable::destroy() { mosek::fusion::p_RangedVariable::_get_impl(this)->destroy(); }
// } class RangedVariable
// class LinearPSDVariable { // @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:8:4-73:5
mosek::fusion::LinearPSDVariable::LinearPSDVariable(mosek::fusion::p_LinearPSDVariable *_impl) : mosek::fusion::ModelVariable(_impl) { /*std::cout << "LinearPSDVariable()" << this << std::endl; */ }
mosek::fusion::LinearPSDVariable::~LinearPSDVariable() {  /* std::cout << "~LinearPSDVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_LinearPSDVariable::p_LinearPSDVariable
  (::mosek::fusion::LinearPSDVariable * _pubthis) :     mosek::fusion::p_ModelVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.LinearPSDVariable.ctor @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:35:6-43:7
mosek::fusion::LinearPSDVariable::t mosek::fusion::p_LinearPSDVariable::_new_LinearPSDVariable
  (monty::rc_ptr< ::mosek::fusion::LinearPSDVariable > _2150_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2151_m)
{ return new mosek::fusion::LinearPSDVariable(_2150_v,_2151_m); }
mosek::fusion::LinearPSDVariable::LinearPSDVariable
  (monty::rc_ptr< ::mosek::fusion::LinearPSDVariable > _2150_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2151_m) : 
   LinearPSDVariable(new mosek::fusion::p_LinearPSDVariable(this))
{ mosek::fusion::p_LinearPSDVariable::_get_impl(this)->_initialize(_2150_v,_2151_m); }
void mosek::fusion::p_LinearPSDVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearPSDVariable > _2150_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2151_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelVariable::_initialize(_2150_v,_2151_m);
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->conedim = mosek::fusion::p_LinearPSDVariable::_get_impl(_2150_v)->conedim;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->varid = mosek::fusion::p_LinearPSDVariable::_get_impl(_2150_v)->varid;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->name = mosek::fusion::p_LinearPSDVariable::_get_impl(_2150_v)->name;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->shape = mosek::fusion::p_LinearPSDVariable::_get_impl(_2150_v)->shape;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->nativeidxs = mosek::fusion::p_LinearPSDVariable::_get_impl(_2150_v)->nativeidxs;
  }
}
// mosek.fusion.LinearPSDVariable.ctor

// mosek.fusion.LinearPSDVariable.ctor @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:19:6-33:7
mosek::fusion::LinearPSDVariable::t mosek::fusion::p_LinearPSDVariable::_new_LinearPSDVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2152_model,
    const std::string &  _2153_name,
    int32_t _2154_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2155_shape,
    int32_t _2156_conedim,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2157_nativeidxs)
{ return new mosek::fusion::LinearPSDVariable(_2152_model,_2153_name,_2154_varid,_2155_shape,_2156_conedim,_2157_nativeidxs); }
mosek::fusion::LinearPSDVariable::LinearPSDVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2152_model,
    const std::string &  _2153_name,
    int32_t _2154_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2155_shape,
    int32_t _2156_conedim,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2157_nativeidxs) : 
   LinearPSDVariable(new mosek::fusion::p_LinearPSDVariable(this))
{ mosek::fusion::p_LinearPSDVariable::_get_impl(this)->_initialize(_2152_model,_2153_name,_2154_varid,_2155_shape,_2156_conedim,_2157_nativeidxs); }
void mosek::fusion::p_LinearPSDVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2152_model,
    const std::string &  _2153_name,
    int32_t _2154_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2155_shape,
    int32_t _2156_conedim,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2157_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2155_shape(_2155_shape ? _2155_shape->raw() : nullptr, _2155_shape ? _2155_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2157_nativeidxs(_2157_nativeidxs ? _2157_nativeidxs->raw() : nullptr, _2157_nativeidxs ? _2157_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelVariable::_initialize(_2152_model,_2153_name,_2155_shape,_2154_varid,nullptr,::mosek::fusion::p_LinearPSDVariable::globalNativeIndexes(_2157_nativeidxs));
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->name = _2153_name;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->conedim = _2156_conedim;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->varid = _2154_varid;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->shape = _2155_shape;
    mosek::fusion::p_LinearPSDVariable::_get_impl(::mosek::fusion::LinearPSDVariable::t(_pubthis))->nativeidxs = _2157_nativeidxs;
  }
}
// mosek.fusion.LinearPSDVariable.ctor

// Begin mosek.fusion.LinearPSDVariable.flushNames
// Method mosek.fusion.LinearPSDVariable.flushNames @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:71:6-38
void mosek::fusion::p_LinearPSDVariable::flushNames()
{
}
// End mosek.fusion.LinearPSDVariable.flushNames

// Begin mosek.fusion.LinearPSDVariable.toString
// Method mosek.fusion.LinearPSDVariable.toString @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:60:6-69:7
std::string mosek::fusion::LinearPSDVariable :: toString() { return mosek::fusion::p_LinearPSDVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_LinearPSDVariable::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2158_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2158_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PSDVariable("));
  if (((int)((name).size()) > (int)0))
  {
    {
      _2158_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("',"));
    }
  }
  {}
  _2158_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
  int32_t _10065_ = (int)1;
  int32_t _10066_ = (int)((shape)->size(0));
  for (int32_t _2159_i = _10065_; _2159_i < _10066_; ++_2159_i)
  {
    {
      _2158_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2159_i)));
    }
  }
  _2158_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _2158_sb->toString();
}
// End mosek.fusion.LinearPSDVariable.toString

// Begin mosek.fusion.LinearPSDVariable.make_continuous
// Method mosek.fusion.LinearPSDVariable.make_continuous @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:56:6-58:7
void mosek::fusion::LinearPSDVariable :: make_continuous(std::shared_ptr< monty::ndarray< int64_t,1 > > _2160_idxs) { mosek::fusion::p_LinearPSDVariable::_get_impl(this)->make_continuous(_2160_idxs); }
void mosek::fusion::p_LinearPSDVariable::make_continuous(std::shared_ptr< monty::ndarray< int64_t,1 > > _2160_idxs)
{
  _checked_ptr_1<int64_t> _ptr__2160_idxs(_2160_idxs ? _2160_idxs->raw() : nullptr, _2160_idxs ? _2160_idxs->size(0) : 0);
}
// End mosek.fusion.LinearPSDVariable.make_continuous

// Begin mosek.fusion.LinearPSDVariable.make_integer
// Method mosek.fusion.LinearPSDVariable.make_integer @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:51:6-54:7
void mosek::fusion::LinearPSDVariable :: make_integer(std::shared_ptr< monty::ndarray< int64_t,1 > > _2161_idxs) { mosek::fusion::p_LinearPSDVariable::_get_impl(this)->make_integer(_2161_idxs); }
void mosek::fusion::p_LinearPSDVariable::make_integer(std::shared_ptr< monty::ndarray< int64_t,1 > > _2161_idxs)
{
  _checked_ptr_1<int64_t> _ptr__2161_idxs(_2161_idxs ? _2161_idxs->raw() : nullptr, _2161_idxs ? _2161_idxs->size(0) : 0);
  throw ::mosek::fusion::UnimplementedError(std::string ("Cannot make PSDVariable elements integer"));
}
// End mosek.fusion.LinearPSDVariable.make_integer

// Begin mosek.fusion.LinearPSDVariable.clone
// Method mosek.fusion.LinearPSDVariable.clone @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:45:6-48:7
monty::rc_ptr< ::mosek::fusion::ModelVariable > mosek::fusion::p_LinearPSDVariable::__mosek_2fusion_2LinearPSDVariable__clone(monty::rc_ptr< ::mosek::fusion::Model > _2162_m)
{
  return (::mosek::fusion::p_LinearPSDVariable::_new_LinearPSDVariable(::mosek::fusion::LinearPSDVariable::t(_pubthis),_2162_m)).as<::mosek::fusion::ModelVariable>();
}
// End mosek.fusion.LinearPSDVariable.clone

// Begin mosek.fusion.LinearPSDVariable.globalNativeIndexes
// Method mosek.fusion.LinearPSDVariable.globalNativeIndexes @ bld/docker-win/final/default/src/fusion/LinearPSDVariable.monty:17:6-147
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_LinearPSDVariable::globalNativeIndexes(std::shared_ptr< monty::ndarray< int64_t,1 > > _2163_nativeidxs)
{
  _checked_ptr_1<int64_t> _ptr__2163_nativeidxs(_2163_nativeidxs ? _2163_nativeidxs->raw() : nullptr, _2163_nativeidxs ? _2163_nativeidxs->size(0) : 0);
  std::vector<int64_t> _10067_;
  for (int32_t _2164_i = (int)0, _10068_ = (int)((_2163_nativeidxs)->size(0)); _2164_i < _10068_ ; ++_2164_i)
  {
    _10067_.push_back((-safe_add( _ptr__2163_nativeidxs[_2164_i],(int)1 )));
  }
  auto _10069_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10067_.size()),_10067_.begin(),_10067_.end()));
  return _10069_;
}
// End mosek.fusion.LinearPSDVariable.globalNativeIndexes

void mosek::fusion::p_LinearPSDVariable::destroy()
{
  shape.reset();
  nativeidxs.reset();
}
void mosek::fusion::LinearPSDVariable::destroy() { mosek::fusion::p_LinearPSDVariable::_get_impl(this)->destroy(); }
// } class LinearPSDVariable
// class PSDVariable { // @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:8:4-139:5
mosek::fusion::PSDVariable::PSDVariable(mosek::fusion::p_PSDVariable *_impl) : mosek::fusion::ModelVariable(_impl) { /*std::cout << "PSDVariable()" << this << std::endl; */ }
mosek::fusion::PSDVariable::~PSDVariable() {  /* std::cout << "~PSDVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_PSDVariable::p_PSDVariable
  (::mosek::fusion::PSDVariable * _pubthis) :     mosek::fusion::p_ModelVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.PSDVariable.ctor @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:89:6-102:7
mosek::fusion::PSDVariable::t mosek::fusion::p_PSDVariable::_new_PSDVariable
  (monty::rc_ptr< ::mosek::fusion::PSDVariable > _2165_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2166_m)
{ return new mosek::fusion::PSDVariable(_2165_v,_2166_m); }
mosek::fusion::PSDVariable::PSDVariable
  (monty::rc_ptr< ::mosek::fusion::PSDVariable > _2165_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2166_m) : 
   PSDVariable(new mosek::fusion::p_PSDVariable(this))
{ mosek::fusion::p_PSDVariable::_get_impl(this)->_initialize(_2165_v,_2166_m); }
void mosek::fusion::p_PSDVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::PSDVariable > _2165_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2166_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelVariable::_initialize(_2165_v,_2166_m);
    varid = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->varid;
    nativeidxs = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->nativeidxs;
    name = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->name;
    shape = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->shape;
    conedim1 = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->conedim1;
    conedim2 = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->conedim2;
    names_flushed = false;
    model = _2166_m;
    barvaridxs = mosek::fusion::p_PSDVariable::_get_impl(_2165_v)->barvaridxs;
  }
}
// mosek.fusion.PSDVariable.ctor

// mosek.fusion.PSDVariable.ctor @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:66:6-87:7
mosek::fusion::PSDVariable::t mosek::fusion::p_PSDVariable::_new_PSDVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2167_model,
    const std::string &  _2168_name,
    int32_t _2169_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2170_shape,
    int32_t _2171_conedim1,
    int32_t _2172_conedim2,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2173_barvaridxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2174_nativeidxs)
{ return new mosek::fusion::PSDVariable(_2167_model,_2168_name,_2169_varid,_2170_shape,_2171_conedim1,_2172_conedim2,_2173_barvaridxs,_2174_nativeidxs); }
mosek::fusion::PSDVariable::PSDVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2167_model,
    const std::string &  _2168_name,
    int32_t _2169_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2170_shape,
    int32_t _2171_conedim1,
    int32_t _2172_conedim2,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2173_barvaridxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2174_nativeidxs) : 
   PSDVariable(new mosek::fusion::p_PSDVariable(this))
{ mosek::fusion::p_PSDVariable::_get_impl(this)->_initialize(_2167_model,_2168_name,_2169_varid,_2170_shape,_2171_conedim1,_2172_conedim2,_2173_barvaridxs,_2174_nativeidxs); }
void mosek::fusion::p_PSDVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2167_model,
    const std::string &  _2168_name,
    int32_t _2169_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2170_shape,
    int32_t _2171_conedim1,
    int32_t _2172_conedim2,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2173_barvaridxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2174_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2170_shape(_2170_shape ? _2170_shape->raw() : nullptr, _2170_shape ? _2170_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2173_barvaridxs(_2173_barvaridxs ? _2173_barvaridxs->raw() : nullptr, _2173_barvaridxs ? _2173_barvaridxs->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2174_nativeidxs(_2174_nativeidxs ? _2174_nativeidxs->raw() : nullptr, _2174_nativeidxs ? _2174_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelVariable::_initialize(_2167_model,_2168_name,_2170_shape,_2169_varid,nullptr,::mosek::fusion::p_PSDVariable::fullnativeidxs(_2170_shape,_2171_conedim1,_2172_conedim2,_2174_nativeidxs));
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->varid = _2169_varid;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->nativeidxs = _2174_nativeidxs;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->name = _2168_name;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->shape = _2170_shape;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->conedim1 = _2171_conedim1;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->conedim2 = _2172_conedim2;
    names_flushed = false;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->model = _2167_model;
    mosek::fusion::p_PSDVariable::_get_impl(::mosek::fusion::PSDVariable::t(_pubthis))->barvaridxs = _2173_barvaridxs;
  }
}
// mosek.fusion.PSDVariable.ctor

// Begin mosek.fusion.PSDVariable.flushNames
// Method mosek.fusion.PSDVariable.flushNames @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:130:6-137:7
void mosek::fusion::p_PSDVariable::flushNames()
{
}
// End mosek.fusion.PSDVariable.flushNames

// Begin mosek.fusion.PSDVariable.toString
// Method mosek.fusion.PSDVariable.toString @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:119:6-128:7
std::string mosek::fusion::PSDVariable :: toString() { return mosek::fusion::p_PSDVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_PSDVariable::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2175_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2175_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("PSDVariable("));
  if (((int)((name).size()) > (int)0))
  {
    {
      _2175_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("',"));
    }
  }
  {}
  _2175_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
  int32_t _10070_ = (int)1;
  int32_t _10071_ = (int)((shape)->size(0));
  for (int32_t _2176_i = _10070_; _2176_i < _10071_; ++_2176_i)
  {
    {
      _2175_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2176_i)));
    }
  }
  _2175_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _2175_sb->toString();
}
// End mosek.fusion.PSDVariable.toString

// Begin mosek.fusion.PSDVariable.elementDesc
// Method mosek.fusion.PSDVariable.elementDesc @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:111:6-116:7
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::PSDVariable :: __mosek_2fusion_2PSDVariable__elementDesc(int64_t _2177_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2178_sb) { return mosek::fusion::p_PSDVariable::_get_impl(this)->__mosek_2fusion_2PSDVariable__elementDesc(_2177_index,_2178_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::PSDVariable::elementDesc(int64_t _2177_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2178_sb) { return __mosek_2fusion_2PSDVariable__elementDesc(_2177_index,_2178_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::p_PSDVariable::__mosek_2fusion_2PSDVariable__elementDesc(int64_t _2177_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2178_sb)
{
  _pubthis->elementName(_2177_index,_2178_sb);
  _2178_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" : element in positive semidefinite cone"));
  return _2178_sb;
}
// End mosek.fusion.PSDVariable.elementDesc

// Begin mosek.fusion.PSDVariable.clone
// Method mosek.fusion.PSDVariable.clone @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:104:6-107:7
monty::rc_ptr< ::mosek::fusion::ModelVariable > mosek::fusion::p_PSDVariable::__mosek_2fusion_2PSDVariable__clone(monty::rc_ptr< ::mosek::fusion::Model > _2179_m)
{
  return (::mosek::fusion::p_PSDVariable::_new_PSDVariable(::mosek::fusion::PSDVariable::t(_pubthis),_2179_m)).as<::mosek::fusion::ModelVariable>();
}
// End mosek.fusion.PSDVariable.clone

// Begin mosek.fusion.PSDVariable.fullnativeidxs
// Method mosek.fusion.PSDVariable.fullnativeidxs @ bld/docker-win/final/default/src/fusion/SemidefiniteVariable.mbi:23:6-59:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_PSDVariable::fullnativeidxs(std::shared_ptr< monty::ndarray< int32_t,1 > > _2180_shape,int32_t _2181_conedim1,int32_t _2182_conedim2,std::shared_ptr< monty::ndarray< int64_t,1 > > _2183_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__2180_shape(_2180_shape ? _2180_shape->raw() : nullptr, _2180_shape ? _2180_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__2183_nativeidxs(_2183_nativeidxs ? _2183_nativeidxs->raw() : nullptr, _2183_nativeidxs ? _2183_nativeidxs->size(0) : 0);
  int32_t _2184_nd = (int)((_2180_shape)->size(0));
  bool _2185_tril = (_2181_conedim1 < _2182_conedim2);
  int32_t _10072_;
  bool _10073_ = _2185_tril;
  if (_10073_)
  {
    _10072_ = _2181_conedim1;
  }
  else
  {
    _10072_ = _2182_conedim2;
  }
  int32_t _2186_cd1 = _10072_;
  int32_t _10074_;
  bool _10075_ = (!_2185_tril);
  if (_10075_)
  {
    _10074_ = _2181_conedim1;
  }
  else
  {
    _10074_ = _2182_conedim2;
  }
  int32_t _2187_cd2 = _10074_;
  int32_t _2188_d0 = (int)1;
  int32_t _10076_ = (int)0;
  int32_t _10077_ = _2186_cd1;
  for (int32_t _2189_i = _10076_; _2189_i < _10077_; ++_2189_i)
  {
    {
      _2188_d0 *= _ptr__2180_shape[_2189_i];
    }
  }
  int32_t _2190_d1 = _ptr__2180_shape[_2186_cd1];
  int32_t _2191_d2 = (int)1;
  int32_t _10078_ = safe_add( _2186_cd1,(int)1 );
  int32_t _10079_ = _2187_cd2;
  for (int32_t _2192_i = _10078_; _2192_i < _10079_; ++_2192_i)
  {
    {
      _2191_d2 *= _ptr__2180_shape[_2192_i];
    }
  }
  int32_t _2193_d3 = _ptr__2180_shape[_2187_cd2];
  int32_t _2194_d4 = (int)1;
  int32_t _10080_ = safe_add( _2187_cd2,(int)1 );
  int32_t _10081_ = _2184_nd;
  for (int32_t _2195_i = _10080_; _2195_i < _10081_; ++_2195_i)
  {
    {
      _2194_d4 *= _ptr__2180_shape[_2195_i];
    }
  }
  int32_t _2196_size = safe_mul( safe_mul( safe_mul( safe_mul( _2188_d0,_2190_d1 ),_2191_d2 ),_2193_d3 ),_2194_d4 );
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2197_residxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2196_size)));
  _checked_ptr_1<int64_t> _ptr__2197_residxs(_2197_residxs ? _2197_residxs->raw() : nullptr,_2197_residxs ? _2197_residxs->size(0) : 0);
  int32_t _2198_s3 = _2194_d4;
  int32_t _2199_s2 = safe_mul( _2198_s3,_2193_d3 );
  int32_t _2200_s1 = safe_mul( _2199_s2,_2191_d2 );
  int32_t _2201_s0 = safe_mul( _2200_s1,_2200_s1 );
  {
    int32_t _2202_k = (int)0;
    int32_t _10082_ = (int)0;
    int32_t _10083_ = _2188_d0;
    for (int32_t _2203_i0 = _10082_; _2203_i0 < _10083_; ++_2203_i0)
    {
      {
        int32_t _10084_ = (int)0;
        int32_t _10085_ = _2193_d3;
        for (int32_t _2204_i3 = _10084_; _2204_i3 < _10085_; ++_2204_i3)
        {
          {
            int32_t _10086_ = (int)0;
            int32_t _10087_ = _2191_d2;
            for (int32_t _2205_i2 = _10086_; _2205_i2 < _10087_; ++_2205_i2)
            {
              {
                int32_t _10088_ = _2204_i3;
                int32_t _10089_ = _2190_d1;
                for (int32_t _2206_i1 = _10088_; _2206_i1 < _10089_; ++_2206_i1)
                {
                  {
                    int32_t _10090_ = (int)0;
                    int32_t _10091_ = _2194_d4;
                    for (int32_t _2207_i4 = _10090_; _2207_i4 < _10091_; ++_2207_i4)
                    {
                      {
                        _ptr__2197_residxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2203_i0,_2201_s0 ),safe_mul( _2206_i1,_2200_s1 ) ),safe_mul( _2205_i2,_2199_s2 ) ),safe_mul( _2204_i3,_2198_s3 ) ),_2207_i4 )] = (-safe_add( _ptr__2183_nativeidxs[_2202_k],(int)1 ));
                        _ptr__2197_residxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2203_i0,_2201_s0 ),safe_mul( _2204_i3,_2200_s1 ) ),safe_mul( _2205_i2,_2199_s2 ) ),safe_mul( _2206_i1,_2198_s3 ) ),_2207_i4 )] = (-safe_add( _ptr__2183_nativeidxs[_2202_k],(int)1 ));
                        ++ _2202_k;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return _2197_residxs;
}
// End mosek.fusion.PSDVariable.fullnativeidxs

void mosek::fusion::p_PSDVariable::destroy()
{
  model.reset();
  barvaridxs.reset();
  shape.reset();
  nativeidxs.reset();
}
void mosek::fusion::PSDVariable::destroy() { mosek::fusion::p_PSDVariable::_get_impl(this)->destroy(); }
// } class PSDVariable
// class LinearVariable { // @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:21:4-111:5
mosek::fusion::LinearVariable::LinearVariable(mosek::fusion::p_LinearVariable *_impl) : mosek::fusion::ModelVariable(_impl) { /*std::cout << "LinearVariable()" << this << std::endl; */ }
mosek::fusion::LinearVariable::~LinearVariable() {  /* std::cout << "~LinearVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_LinearVariable::p_LinearVariable
  (::mosek::fusion::LinearVariable * _pubthis) :     mosek::fusion::p_ModelVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.LinearVariable.ctor @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:53:6-62:7
mosek::fusion::LinearVariable::t mosek::fusion::p_LinearVariable::_new_LinearVariable
  (monty::rc_ptr< ::mosek::fusion::LinearVariable > _2208_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2209_m)
{ return new mosek::fusion::LinearVariable(_2208_v,_2209_m); }
mosek::fusion::LinearVariable::LinearVariable
  (monty::rc_ptr< ::mosek::fusion::LinearVariable > _2208_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2209_m) : 
   LinearVariable(new mosek::fusion::p_LinearVariable(this))
{ mosek::fusion::p_LinearVariable::_get_impl(this)->_initialize(_2208_v,_2209_m); }
void mosek::fusion::p_LinearVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearVariable > _2208_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2209_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelVariable::_initialize(_2208_v,_2209_m);
    names_flushed = mosek::fusion::p_LinearVariable::_get_impl(_2208_v)->names_flushed;
    nativeidxs = mosek::fusion::p_LinearVariable::_get_impl(_2208_v)->nativeidxs;
    sparsity = mosek::fusion::p_LinearVariable::_get_impl(_2208_v)->sparsity;
    shape = mosek::fusion::p_LinearVariable::_get_impl(_2208_v)->shape;
    name = mosek::fusion::p_LinearVariable::_get_impl(_2208_v)->name;
  }
}
// mosek.fusion.LinearVariable.ctor

// mosek.fusion.LinearVariable.ctor @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:36:6-51:7
mosek::fusion::LinearVariable::t mosek::fusion::p_LinearVariable::_new_LinearVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2210_model,
    const std::string &  _2211_name,
    int64_t _2212_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2213_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2214_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2215_nativeidxs)
{ return new mosek::fusion::LinearVariable(_2210_model,_2211_name,_2212_varid,_2213_shape,_2214_sparsity,_2215_nativeidxs); }
mosek::fusion::LinearVariable::LinearVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2210_model,
    const std::string &  _2211_name,
    int64_t _2212_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2213_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2214_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2215_nativeidxs) : 
   LinearVariable(new mosek::fusion::p_LinearVariable(this))
{ mosek::fusion::p_LinearVariable::_get_impl(this)->_initialize(_2210_model,_2211_name,_2212_varid,_2213_shape,_2214_sparsity,_2215_nativeidxs); }
void mosek::fusion::p_LinearVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2210_model,
    const std::string &  _2211_name,
    int64_t _2212_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2213_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2214_sparsity,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2215_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2213_shape(_2213_shape ? _2213_shape->raw() : nullptr, _2213_shape ? _2213_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2214_sparsity(_2214_sparsity ? _2214_sparsity->raw() : nullptr, _2214_sparsity ? _2214_sparsity->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2215_nativeidxs(_2215_nativeidxs ? _2215_nativeidxs->raw() : nullptr, _2215_nativeidxs ? _2215_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelVariable::_initialize(_2210_model,_2211_name,_2213_shape,_2212_varid,_2214_sparsity,::mosek::fusion::p_LinearVariable::globalNativeIndexes(_2215_nativeidxs));
    names_flushed = false;
    mosek::fusion::p_LinearVariable::_get_impl(::mosek::fusion::LinearVariable::t(_pubthis))->name = _2211_name;
    mosek::fusion::p_LinearVariable::_get_impl(::mosek::fusion::LinearVariable::t(_pubthis))->nativeidxs = _2215_nativeidxs;
    mosek::fusion::p_LinearVariable::_get_impl(::mosek::fusion::LinearVariable::t(_pubthis))->sparsity = _2214_sparsity;
    mosek::fusion::p_LinearVariable::_get_impl(::mosek::fusion::LinearVariable::t(_pubthis))->shape = _2213_shape;
  }
}
// mosek.fusion.LinearVariable.ctor

// Begin mosek.fusion.LinearVariable.toString
// Method mosek.fusion.LinearVariable.toString @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:95:6-109:7
std::string mosek::fusion::LinearVariable :: toString() { return mosek::fusion::p_LinearVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_LinearVariable::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2216_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("LinearVariable(("));
  if (((int)((shape)->size(0)) > (int)0))
  {
    {
      _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
      int32_t _10092_ = (int)1;
      int32_t _10093_ = (int)((shape)->size(0));
      for (int32_t _2217_i = _10092_; _2217_i < _10093_; ++_2217_i)
      {
        {
          _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2217_i)));
        }
      }
    }
  }
  {}
  _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  if ((NULL != sparsity.get()))
  {
    {
      _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",sparse"));
    }
  }
  {}
  _2216_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _2216_sb->toString();
}
// End mosek.fusion.LinearVariable.toString

// Begin mosek.fusion.LinearVariable.flushNames
// Method mosek.fusion.LinearVariable.flushNames @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:68:6-93:7
void mosek::fusion::p_LinearVariable::flushNames()
{
}
// End mosek.fusion.LinearVariable.flushNames

// Begin mosek.fusion.LinearVariable.clone
// Method mosek.fusion.LinearVariable.clone @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:64:6-66:7
monty::rc_ptr< ::mosek::fusion::ModelVariable > mosek::fusion::p_LinearVariable::__mosek_2fusion_2LinearVariable__clone(monty::rc_ptr< ::mosek::fusion::Model > _2218_m)
{
  return (::mosek::fusion::p_LinearVariable::_new_LinearVariable(::mosek::fusion::LinearVariable::t(_pubthis),_2218_m)).as<::mosek::fusion::ModelVariable>();
}
// End mosek.fusion.LinearVariable.clone

// Begin mosek.fusion.LinearVariable.globalNativeIndexes
// Method mosek.fusion.LinearVariable.globalNativeIndexes @ bld/docker-win/final/default/src/fusion/LinearVariable.mbi:31:6-34:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_LinearVariable::globalNativeIndexes(std::shared_ptr< monty::ndarray< int32_t,1 > > _2219_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__2219_nativeidxs(_2219_nativeidxs ? _2219_nativeidxs->raw() : nullptr, _2219_nativeidxs ? _2219_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2220_r = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_2219_nativeidxs)->size(0)))));
  _checked_ptr_1<int64_t> _ptr__2220_r(_2220_r ? _2220_r->raw() : nullptr,_2220_r ? _2220_r->size(0) : 0);
  int32_t _10094_ = (int)0;
  int32_t _10095_ = (int)((_2219_nativeidxs)->size(0));
  for (int32_t _2221_i = _10094_; _2221_i < _10095_; ++_2221_i)
  {
    {
      _ptr__2220_r[_2221_i] = _ptr__2219_nativeidxs[_2221_i];
    }
  }
  return _2220_r;
}
// End mosek.fusion.LinearVariable.globalNativeIndexes

void mosek::fusion::p_LinearVariable::destroy()
{
  shape.reset();
  sparsity.reset();
  nativeidxs.reset();
}
void mosek::fusion::LinearVariable::destroy() { mosek::fusion::p_LinearVariable::_get_impl(this)->destroy(); }
// } class LinearVariable
// class ConicVariable { // @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:23:4-107:5
mosek::fusion::ConicVariable::ConicVariable(mosek::fusion::p_ConicVariable *_impl) : mosek::fusion::ModelVariable(_impl) { /*std::cout << "ConicVariable()" << this << std::endl; */ }
mosek::fusion::ConicVariable::~ConicVariable() {  /* std::cout << "~ConicVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ConicVariable::p_ConicVariable
  (::mosek::fusion::ConicVariable * _pubthis) :     mosek::fusion::p_ModelVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ConicVariable.ctor @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:55:6-64:7
mosek::fusion::ConicVariable::t mosek::fusion::p_ConicVariable::_new_ConicVariable
  (monty::rc_ptr< ::mosek::fusion::ConicVariable > _2222_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2223_m)
{ return new mosek::fusion::ConicVariable(_2222_v,_2223_m); }
mosek::fusion::ConicVariable::ConicVariable
  (monty::rc_ptr< ::mosek::fusion::ConicVariable > _2222_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2223_m) : 
   ConicVariable(new mosek::fusion::p_ConicVariable(this))
{ mosek::fusion::p_ConicVariable::_get_impl(this)->_initialize(_2222_v,_2223_m); }
void mosek::fusion::p_ConicVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::ConicVariable > _2222_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2223_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelVariable::_initialize(_2222_v,_2223_m);
    names_flushed = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->names_flushed;
    shape = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->shape;
    nativeidxs = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->nativeidxs;
    shape = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->shape;
    varid = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->varid;
    name = mosek::fusion::p_ConicVariable::_get_impl(_2222_v)->name;
  }
}
// mosek.fusion.ConicVariable.ctor

// mosek.fusion.ConicVariable.ctor @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:40:6-53:7
mosek::fusion::ConicVariable::t mosek::fusion::p_ConicVariable::_new_ConicVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2224_model,
    const std::string &  _2225_name,
    int32_t _2226_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2227_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2228_nativeidxs)
{ return new mosek::fusion::ConicVariable(_2224_model,_2225_name,_2226_varid,_2227_shape,_2228_nativeidxs); }
mosek::fusion::ConicVariable::ConicVariable
  (monty::rc_ptr< ::mosek::fusion::Model > _2224_model,
    const std::string &  _2225_name,
    int32_t _2226_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2227_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2228_nativeidxs) : 
   ConicVariable(new mosek::fusion::p_ConicVariable(this))
{ mosek::fusion::p_ConicVariable::_get_impl(this)->_initialize(_2224_model,_2225_name,_2226_varid,_2227_shape,_2228_nativeidxs); }
void mosek::fusion::p_ConicVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2224_model,
    const std::string &  _2225_name,
    int32_t _2226_varid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2227_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2228_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2227_shape(_2227_shape ? _2227_shape->raw() : nullptr, _2227_shape ? _2227_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2228_nativeidxs(_2228_nativeidxs ? _2228_nativeidxs->raw() : nullptr, _2228_nativeidxs ? _2228_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelVariable::_initialize(_2224_model,_2225_name,_2227_shape,_2226_varid,nullptr,::mosek::fusion::p_ConicVariable::globalNativeIndexes(_2228_nativeidxs));
    mosek::fusion::p_ConicVariable::_get_impl(::mosek::fusion::ConicVariable::t(_pubthis))->name = _2225_name;
    mosek::fusion::p_ConicVariable::_get_impl(::mosek::fusion::ConicVariable::t(_pubthis))->names_flushed = false;
    mosek::fusion::p_ConicVariable::_get_impl(::mosek::fusion::ConicVariable::t(_pubthis))->varid = _2226_varid;
    mosek::fusion::p_ConicVariable::_get_impl(::mosek::fusion::ConicVariable::t(_pubthis))->shape = _2227_shape;
    mosek::fusion::p_ConicVariable::_get_impl(::mosek::fusion::ConicVariable::t(_pubthis))->nativeidxs = _2228_nativeidxs;
  }
}
// mosek.fusion.ConicVariable.ctor

// Begin mosek.fusion.ConicVariable.toString
// Method mosek.fusion.ConicVariable.toString @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:96:6-106:7
std::string mosek::fusion::ConicVariable :: toString() { return mosek::fusion::p_ConicVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ConicVariable::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2229_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ConicVariable( "));
  if (((int)((name).size()) > (int)0))
  {
    {
      _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("',"));
    }
  }
  {}
  _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("("));
  _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
  int32_t _10096_ = (int)1;
  int32_t _10097_ = (int)((shape)->size(0));
  for (int32_t _2230_i = _10096_; _2230_i < _10097_; ++_2230_i)
  {
    {
      _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2230_i)));
    }
  }
  _2229_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") )"));
  return _2229_sb->toString();
}
// End mosek.fusion.ConicVariable.toString

// Begin mosek.fusion.ConicVariable.flushNames
// Method mosek.fusion.ConicVariable.flushNames @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:71:6-95:7
void mosek::fusion::p_ConicVariable::flushNames()
{
}
// End mosek.fusion.ConicVariable.flushNames

// Begin mosek.fusion.ConicVariable.clone
// Method mosek.fusion.ConicVariable.clone @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:66:6-69:7
monty::rc_ptr< ::mosek::fusion::ModelVariable > mosek::fusion::p_ConicVariable::__mosek_2fusion_2ConicVariable__clone(monty::rc_ptr< ::mosek::fusion::Model > _2231_m)
{
  return (::mosek::fusion::p_ConicVariable::_new_ConicVariable(::mosek::fusion::ConicVariable::t(_pubthis),_2231_m)).as<::mosek::fusion::ModelVariable>();
}
// End mosek.fusion.ConicVariable.clone

// Begin mosek.fusion.ConicVariable.globalNativeIndexes
// Method mosek.fusion.ConicVariable.globalNativeIndexes @ bld/docker-win/final/default/src/fusion/ConicVariable.mbi:35:6-38:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_ConicVariable::globalNativeIndexes(std::shared_ptr< monty::ndarray< int32_t,1 > > _2232_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__2232_nativeidxs(_2232_nativeidxs ? _2232_nativeidxs->raw() : nullptr, _2232_nativeidxs ? _2232_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2233_r = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_2232_nativeidxs)->size(0)))));
  _checked_ptr_1<int64_t> _ptr__2233_r(_2233_r ? _2233_r->raw() : nullptr,_2233_r ? _2233_r->size(0) : 0);
  int32_t _10098_ = (int)0;
  int32_t _10099_ = (int)((_2232_nativeidxs)->size(0));
  for (int32_t _2234_i = _10098_; _2234_i < _10099_; ++_2234_i)
  {
    {
      _ptr__2233_r[_2234_i] = _ptr__2232_nativeidxs[_2234_i];
    }
  }
  return _2233_r;
}
// End mosek.fusion.ConicVariable.globalNativeIndexes

void mosek::fusion::p_ConicVariable::destroy()
{
  nativeidxs.reset();
  shape.reset();
}
void mosek::fusion::ConicVariable::destroy() { mosek::fusion::p_ConicVariable::_get_impl(this)->destroy(); }
// } class ConicVariable
// class ModelVariable { // @ bld/docker-win/final/default/src/fusion/ModelVariable.mbi:14:4-92:5
mosek::fusion::ModelVariable::ModelVariable(mosek::fusion::p_ModelVariable *_impl) : mosek::fusion::BaseVariable(_impl) { /*std::cout << "ModelVariable()" << this << std::endl; */ }
mosek::fusion::ModelVariable::~ModelVariable() {  /* std::cout << "~ModelVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ModelVariable::p_ModelVariable
  (::mosek::fusion::ModelVariable * _pubthis) :     mosek::fusion::p_BaseVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ModelVariable.ctor @ bld/docker-win/final/default/src/fusion/ModelVariable.mbi:62:6-72:7
void mosek::fusion::p_ModelVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::ModelVariable > _2235_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2236_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseVariable::_initialize(_2235_v,_2236_m);
    name = mosek::fusion::p_ModelVariable::_get_impl(_2235_v)->name;
    varid = mosek::fusion::p_ModelVariable::_get_impl(_2235_v)->varid;
    modelvar_nativeidxs = mosek::fusion::p_ModelVariable::_get_impl(_2235_v)->modelvar_nativeidxs;
    shape = mosek::fusion::p_ModelVariable::_get_impl(_2235_v)->shape;
    sparsity = mosek::fusion::p_ModelVariable::_get_impl(_2235_v)->sparsity;
  }
}
// mosek.fusion.ModelVariable.ctor

// mosek.fusion.ModelVariable.ctor @ bld/docker-win/final/default/src/fusion/ModelVariable.mbi:44:6-58:7
void mosek::fusion::p_ModelVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2237_model,
    const std::string &  _2238_name,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2239_shape,
    int64_t _2240_varid,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2241_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2242_modelvar_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2239_shape(_2239_shape ? _2239_shape->raw() : nullptr, _2239_shape ? _2239_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2241_sparsity(_2241_sparsity ? _2241_sparsity->raw() : nullptr, _2241_sparsity ? _2241_sparsity->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2242_modelvar_nativeidxs(_2242_modelvar_nativeidxs ? _2242_modelvar_nativeidxs->raw() : nullptr, _2242_modelvar_nativeidxs ? _2242_modelvar_nativeidxs->size(0) : 0);
    mosek::fusion::p_BaseVariable::_initialize(_2237_model,_2239_shape,_2241_sparsity,_2242_modelvar_nativeidxs);
    mosek::fusion::p_ModelVariable::_get_impl(::mosek::fusion::ModelVariable::t(_pubthis))->name = _2238_name;
    mosek::fusion::p_ModelVariable::_get_impl(::mosek::fusion::ModelVariable::t(_pubthis))->varid = _2240_varid;
    mosek::fusion::p_ModelVariable::_get_impl(::mosek::fusion::ModelVariable::t(_pubthis))->shape = _2239_shape;
    mosek::fusion::p_ModelVariable::_get_impl(::mosek::fusion::ModelVariable::t(_pubthis))->sparsity = _2241_sparsity;
    mosek::fusion::p_ModelVariable::_get_impl(::mosek::fusion::ModelVariable::t(_pubthis))->modelvar_nativeidxs = _2242_modelvar_nativeidxs;
  }
}
// mosek.fusion.ModelVariable.ctor

// Begin mosek.fusion.ModelVariable.flushNames
// End mosek.fusion.ModelVariable.flushNames

// Begin mosek.fusion.ModelVariable.elementName
// Method mosek.fusion.ModelVariable.elementName @ bld/docker-win/final/default/src/fusion/ModelVariable.mbi:84:6-88:7
void mosek::fusion::ModelVariable :: elementName(int64_t _2243_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2244_sb) { mosek::fusion::p_ModelVariable::_get_impl(this)->elementName(_2243_index,_2244_sb); }
void mosek::fusion::p_ModelVariable::elementName(int64_t _2243_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2244_sb)
{
  std::string _10100_;
  bool _10101_ = ((int)((name).size()) == (int)0);
  if (_10101_)
  {
    _10100_ = std::string ("_");
  }
  else
  {
    _10100_ = name;
  }
  _2244_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_10100_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("["))->__mosek_2fusion_2Utils_2StringBuffer__a(::mosek::fusion::p_Set::indexToString(shape,_2243_index))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"));
}
// End mosek.fusion.ModelVariable.elementName

// Begin mosek.fusion.ModelVariable.remove
// Method mosek.fusion.ModelVariable.remove @ bld/docker-win/final/default/src/fusion/ModelVariable.mbi:78:6-80:7
void mosek::fusion::ModelVariable :: remove() { mosek::fusion::p_ModelVariable::_get_impl(this)->remove(); }
void mosek::fusion::p_ModelVariable::remove()
{
  mosek::fusion::p_Model::_get_impl(_pubthis->__mosek_2fusion_2BaseVariable__getModel().get())->removeVariableBlock(varid);
}
// End mosek.fusion.ModelVariable.remove

// Begin mosek.fusion.ModelVariable.clone
// End mosek.fusion.ModelVariable.clone

void mosek::fusion::p_ModelVariable::destroy()
{
  sparsity.reset();
  shape.reset();
  modelvar_nativeidxs.reset();
}
void mosek::fusion::ModelVariable::destroy() { mosek::fusion::p_ModelVariable::_get_impl(this)->destroy(); }
// } class ModelVariable
// class NilVariable { // @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1000:4-1088:5
mosek::fusion::NilVariable::NilVariable(mosek::fusion::p_NilVariable *_impl) : mosek::fusion::BaseVariable(_impl) { /*std::cout << "NilVariable()" << this << std::endl; */ }
mosek::fusion::NilVariable::~NilVariable() {  /* std::cout << "~NilVariable()" << this << std::endl << std::flush; */ }
mosek::fusion::p_NilVariable::p_NilVariable
  (::mosek::fusion::NilVariable * _pubthis) :     mosek::fusion::p_BaseVariable(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.NilVariable.ctor @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1008:6-1012:7
mosek::fusion::NilVariable::t mosek::fusion::p_NilVariable::_new_NilVariable
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _2246_shape)
{ return new mosek::fusion::NilVariable(_2246_shape); }
mosek::fusion::NilVariable::NilVariable
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _2246_shape) : 
   NilVariable(new mosek::fusion::p_NilVariable(this))
{ mosek::fusion::p_NilVariable::_get_impl(this)->_initialize(_2246_shape); }
void mosek::fusion::p_NilVariable::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _2246_shape)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2246_shape(_2246_shape ? _2246_shape->raw() : nullptr, _2246_shape ? _2246_shape->size(0) : 0);
    mosek::fusion::p_BaseVariable::_initialize(nullptr,::mosek::fusion::Utils::Tools::arraycopy(_2246_shape),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))));
    std::vector<int32_t> _10102_;
    for (int32_t _2247_i = (int)0, _10103_ = (int)((_2246_shape)->size(0)); _2247_i < _10103_ ; ++_2247_i)
    {
      _10102_.push_back(_ptr__2246_shape[_2247_i]);
    }
    auto _10104_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10102_.size()),_10102_.begin(),_10102_.end()));
    mosek::fusion::p_NilVariable::_get_impl(::mosek::fusion::NilVariable::t(_pubthis))->shape = _10104_;
  }
}
// mosek.fusion.NilVariable.ctor

// mosek.fusion.NilVariable.ctor @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1006:6-45
mosek::fusion::NilVariable::t mosek::fusion::p_NilVariable::_new_NilVariable
  ()
{ return new mosek::fusion::NilVariable(); }
mosek::fusion::NilVariable::NilVariable
  () : 
   NilVariable(new mosek::fusion::p_NilVariable(this))
{ mosek::fusion::p_NilVariable::_get_impl(this)->_initialize(); }
void mosek::fusion::p_NilVariable::_initialize  ()
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_NilVariable::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))));
  }
}
// mosek.fusion.NilVariable.ctor

// Begin mosek.fusion.NilVariable.flushNames
// Method mosek.fusion.NilVariable.flushNames @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1085:6-44
void mosek::fusion::p_NilVariable::flushNames()
{
}
// End mosek.fusion.NilVariable.flushNames

// Begin mosek.fusion.NilVariable.elementDesc
// Method mosek.fusion.NilVariable.elementDesc @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1084:6-102
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::NilVariable :: __mosek_2fusion_2NilVariable__elementDesc(int64_t _2248_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2249_sb) { return mosek::fusion::p_NilVariable::_get_impl(this)->__mosek_2fusion_2NilVariable__elementDesc(_2248_index,_2249_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::NilVariable::elementDesc(int64_t _2248_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2249_sb) { return __mosek_2fusion_2NilVariable__elementDesc(_2248_index,_2249_sb); }
monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > mosek::fusion::p_NilVariable::__mosek_2fusion_2NilVariable__elementDesc(int64_t _2248_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2249_sb)
{
  return _2249_sb;
}
// End mosek.fusion.NilVariable.elementDesc

// Begin mosek.fusion.NilVariable.elementName
// Method mosek.fusion.NilVariable.elementName @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1083:6-76
void mosek::fusion::NilVariable :: elementName(int64_t _2250_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2251_sb) { mosek::fusion::p_NilVariable::_get_impl(this)->elementName(_2250_index,_2251_sb); }
void mosek::fusion::p_NilVariable::elementName(int64_t _2250_index,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2251_sb)
{
}
// End mosek.fusion.NilVariable.elementName

// Begin mosek.fusion.NilVariable.numInst
// Method mosek.fusion.NilVariable.numInst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1079:6-1081:7
int32_t mosek::fusion::NilVariable :: numInst() { return mosek::fusion::p_NilVariable::_get_impl(this)->numInst(); }
int32_t mosek::fusion::p_NilVariable::numInst()
{
  return (int)0;
}
// End mosek.fusion.NilVariable.numInst

// Begin mosek.fusion.NilVariable.inst
// Method mosek.fusion.NilVariable.inst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1071:6-1077:7
int32_t mosek::fusion::NilVariable :: inst(int32_t _2252_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2253_sparsity,std::shared_ptr< monty::ndarray< int64_t,1 > > _2254_basevar_nativeidxs) { return mosek::fusion::p_NilVariable::_get_impl(this)->inst(_2252_offset,_2253_sparsity,_2254_basevar_nativeidxs); }
int32_t mosek::fusion::p_NilVariable::inst(int32_t _2252_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2253_sparsity,std::shared_ptr< monty::ndarray< int64_t,1 > > _2254_basevar_nativeidxs)
{
  _checked_ptr_1<int64_t> _ptr__2253_sparsity(_2253_sparsity ? _2253_sparsity->raw() : nullptr, _2253_sparsity ? _2253_sparsity->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__2254_basevar_nativeidxs(_2254_basevar_nativeidxs ? _2254_basevar_nativeidxs->raw() : nullptr, _2254_basevar_nativeidxs ? _2254_basevar_nativeidxs->size(0) : 0);
  return (int)0;
}
// End mosek.fusion.NilVariable.inst

// Begin mosek.fusion.NilVariable.inst
// Method mosek.fusion.NilVariable.inst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1066:6-1069:8
void mosek::fusion::NilVariable :: inst(int32_t _2255_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2256_nindex) { mosek::fusion::p_NilVariable::_get_impl(this)->inst(_2255_offset,_2256_nindex); }
void mosek::fusion::p_NilVariable::inst(int32_t _2255_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2256_nindex)
{
  _checked_ptr_1<int64_t> _ptr__2256_nindex(_2256_nindex ? _2256_nindex->raw() : nullptr, _2256_nindex ? _2256_nindex->size(0) : 0);
}
// End mosek.fusion.NilVariable.inst

// Begin mosek.fusion.NilVariable.set_values
// Method mosek.fusion.NilVariable.set_values @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1061:6-1064:8
void mosek::fusion::NilVariable :: set_values(std::shared_ptr< monty::ndarray< double,1 > > _2257_target,bool _2258_primal) { mosek::fusion::p_NilVariable::_get_impl(this)->set_values(_2257_target,_2258_primal); }
void mosek::fusion::p_NilVariable::set_values(std::shared_ptr< monty::ndarray< double,1 > > _2257_target,bool _2258_primal)
{
  _checked_ptr_1<double> _ptr__2257_target(_2257_target ? _2257_target->raw() : nullptr, _2257_target ? _2257_target->size(0) : 0);
}
// End mosek.fusion.NilVariable.set_values

// Begin mosek.fusion.NilVariable.values
// Method mosek.fusion.NilVariable.values @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1055:6-1059:8
void mosek::fusion::NilVariable :: values(int32_t _2259_offset,std::shared_ptr< monty::ndarray< double,1 > > _2260_target,bool _2261_primal) { mosek::fusion::p_NilVariable::_get_impl(this)->values(_2259_offset,_2260_target,_2261_primal); }
void mosek::fusion::p_NilVariable::values(int32_t _2259_offset,std::shared_ptr< monty::ndarray< double,1 > > _2260_target,bool _2261_primal)
{
  _checked_ptr_1<double> _ptr__2260_target(_2260_target ? _2260_target->raw() : nullptr, _2260_target ? _2260_target->size(0) : 0);
}
// End mosek.fusion.NilVariable.values

// Begin mosek.fusion.NilVariable.make_continuous
// Method mosek.fusion.NilVariable.make_continuous @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1053:6-40
void mosek::fusion::NilVariable :: make_continuous() { mosek::fusion::p_NilVariable::_get_impl(this)->make_continuous(); }
void mosek::fusion::p_NilVariable::make_continuous()
{
}
// End mosek.fusion.NilVariable.make_continuous

// Begin mosek.fusion.NilVariable.make_integer
// Method mosek.fusion.NilVariable.make_integer @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1052:6-37
void mosek::fusion::NilVariable :: make_integer() { mosek::fusion::p_NilVariable::_get_impl(this)->make_integer(); }
void mosek::fusion::p_NilVariable::make_integer()
{
}
// End mosek.fusion.NilVariable.make_integer

// Begin mosek.fusion.NilVariable.toString
// Method mosek.fusion.NilVariable.toString @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1050:6-63
std::string mosek::fusion::NilVariable :: toString() { return mosek::fusion::p_NilVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_NilVariable::toString()
{
  return std::string ("NilVariable");
}
// End mosek.fusion.NilVariable.toString

// Begin mosek.fusion.NilVariable.index
// Method mosek.fusion.NilVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1044:6-1048:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable :: __mosek_2fusion_2NilVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2262_first) { return mosek::fusion::p_NilVariable::_get_impl(this)->__mosek_2fusion_2NilVariable__index(_2262_first); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2262_first) { return __mosek_2fusion_2NilVariable__index(_2262_first); }
/* override: mosek.fusion.BaseVariable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::__mosek_2fusion_2BaseVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2262_first) { return __mosek_2fusion_2NilVariable__index(_2262_first); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_NilVariable::__mosek_2fusion_2NilVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2262_first)
{
  _checked_ptr_1<int32_t> _ptr__2262_first(_2262_first ? _2262_first->raw() : nullptr, _2262_first ? _2262_first->size(0) : 0);
  std::vector<int32_t> _10105_;
  for (int32_t _2263_i = (int)0, _10106_ = (int)((shape)->size(0)); _2263_i < _10106_ ; ++_2263_i)
  {
    _10105_.push_back((int)1);
  }
  auto _10107_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10105_.size()),_10105_.begin(),_10105_.end()));
  return (::mosek::fusion::p_NilVariable::_new_NilVariable(_10107_)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.NilVariable.index

// Begin mosek.fusion.NilVariable.index
// Method mosek.fusion.NilVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1038:6-1042:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable :: __mosek_2fusion_2NilVariable__index(int32_t _2264_first) { return mosek::fusion::p_NilVariable::_get_impl(this)->__mosek_2fusion_2NilVariable__index(_2264_first); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::index(int32_t _2264_first) { return __mosek_2fusion_2NilVariable__index(_2264_first); }
/* override: mosek.fusion.BaseVariable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::__mosek_2fusion_2BaseVariable__index(int32_t _2264_first) { return __mosek_2fusion_2NilVariable__index(_2264_first); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_NilVariable::__mosek_2fusion_2NilVariable__index(int32_t _2264_first)
{
  std::vector<int32_t> _10108_;
  for (int32_t _2265_i = (int)0, _10109_ = (int)((shape)->size(0)); _2265_i < _10109_ ; ++_2265_i)
  {
    _10108_.push_back((int)1);
  }
  auto _10110_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10108_.size()),_10108_.begin(),_10108_.end()));
  return (::mosek::fusion::p_NilVariable::_new_NilVariable(_10110_)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.NilVariable.index

// Begin mosek.fusion.NilVariable.slice
// Method mosek.fusion.NilVariable.slice @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1026:6-1036:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable :: __mosek_2fusion_2NilVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2266_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2267_last) { return mosek::fusion::p_NilVariable::_get_impl(this)->__mosek_2fusion_2NilVariable__slice(_2266_first,_2267_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2266_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2267_last) { return __mosek_2fusion_2NilVariable__slice(_2266_first,_2267_last); }
/* override: mosek.fusion.BaseVariable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::__mosek_2fusion_2BaseVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2266_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2267_last) { return __mosek_2fusion_2NilVariable__slice(_2266_first,_2267_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_NilVariable::__mosek_2fusion_2NilVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2266_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2267_last)
{
  _checked_ptr_1<int32_t> _ptr__2266_first(_2266_first ? _2266_first->raw() : nullptr, _2266_first ? _2266_first->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2267_last(_2267_last ? _2267_last->raw() : nullptr, _2267_last ? _2267_last->size(0) : 0);
  if ((((int)((shape)->size(0)) != (int)((_2266_first)->size(0))) || ((int)((shape)->size(0)) != (int)((_2267_last)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching slice shape"));
    }
  }
  {}
  int32_t _10111_ = (int)0;
  int32_t _10112_ = (int)((_2266_first)->size(0));
  for (int32_t _2268_i = _10111_; _2268_i < _10112_; ++_2268_i)
  {
    {
      if (((_ptr__2267_last[_2268_i] > _ptr__2266_first[_2268_i]) || ((_ptr__2266_first[_2268_i] < (int)0) || (_ptr__2267_last[_2268_i] >= ((*shape)(_2268_i))))))
      {
        {
          throw ::mosek::fusion::SliceError(std::string ("Slice is out of bounds"));
        }
      }
      {}
    }
  }
  std::vector<int32_t> _10113_;
  for (int32_t _2269_i = (int)0, _10114_ = (int)((shape)->size(0)); _2269_i < _10114_ ; ++_2269_i)
  {
    _10113_.push_back((_ptr__2267_last[_2269_i] - _ptr__2266_first[_2269_i]));
  }
  auto _10115_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10113_.size()),_10113_.begin(),_10113_.end()));
  return (::mosek::fusion::p_NilVariable::_new_NilVariable(_10115_)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.NilVariable.slice

// Begin mosek.fusion.NilVariable.slice
// Method mosek.fusion.NilVariable.slice @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:1014:6-1024:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable :: __mosek_2fusion_2NilVariable__slice(int32_t _2270_first,int32_t _2271_last) { return mosek::fusion::p_NilVariable::_get_impl(this)->__mosek_2fusion_2NilVariable__slice(_2270_first,_2271_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::slice(int32_t _2270_first,int32_t _2271_last) { return __mosek_2fusion_2NilVariable__slice(_2270_first,_2271_last); }
/* override: mosek.fusion.BaseVariable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::NilVariable::__mosek_2fusion_2BaseVariable__slice(int32_t _2270_first,int32_t _2271_last) { return __mosek_2fusion_2NilVariable__slice(_2270_first,_2271_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_NilVariable::__mosek_2fusion_2NilVariable__slice(int32_t _2270_first,int32_t _2271_last)
{
  if (((_2271_last > _2270_first) || ((_2270_first < (int)0) || (_2271_last > ((*shape)((int)0))))))
  {
    {
      throw ::mosek::fusion::SliceError(std::string ("Slice is out of bounds"));
    }
  }
  else if(((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching slice shape"));
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_NilVariable::_new_NilVariable(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((_2271_last - _2270_first))}))).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.NilVariable.slice

void mosek::fusion::p_NilVariable::destroy()
{
  shape.reset();
}
void mosek::fusion::NilVariable::destroy() { mosek::fusion::p_NilVariable::_get_impl(this)->destroy(); }
// } class NilVariable
// class BaseVariable { // @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:53:4-969:5
mosek::fusion::BaseVariable::BaseVariable(mosek::fusion::p_BaseVariable *_impl) : _impl(_impl) { /*std::cout << "BaseVariable() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::BaseVariable::~BaseVariable() { delete _impl; _impl = nullptr; }
mosek::fusion::p_BaseVariable::p_BaseVariable
  (::mosek::fusion::BaseVariable * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.BaseVariable.ctor @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:99:6-108:7
void mosek::fusion::p_BaseVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::BaseVariable > _2272_v,
    monty::rc_ptr< ::mosek::fusion::Model > _2273_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    model = _2273_m;
    shape = mosek::fusion::p_BaseVariable::_get_impl(_2272_v)->shape;
    sparsity = mosek::fusion::p_BaseVariable::_get_impl(_2272_v)->sparsity;
    basevar_nativeidxs = mosek::fusion::p_BaseVariable::_get_impl(_2272_v)->basevar_nativeidxs;
  }
}
// mosek.fusion.BaseVariable.ctor

// mosek.fusion.BaseVariable.ctor @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:83:6-94:7
void mosek::fusion::p_BaseVariable::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2274_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2275_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2276_sparsity,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2277_basevar_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2275_shape(_2275_shape ? _2275_shape->raw() : nullptr, _2275_shape ? _2275_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2276_sparsity(_2276_sparsity ? _2276_sparsity->raw() : nullptr, _2276_sparsity ? _2276_sparsity->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2277_basevar_nativeidxs(_2277_basevar_nativeidxs ? _2277_basevar_nativeidxs->raw() : nullptr, _2277_basevar_nativeidxs ? _2277_basevar_nativeidxs->size(0) : 0);
    model = _2274_m;
    mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->shape = _2275_shape;
    mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->sparsity = _2276_sparsity;
    mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->basevar_nativeidxs = _2277_basevar_nativeidxs;
  }
}
// mosek.fusion.BaseVariable.ctor

// Begin mosek.fusion.BaseVariable.toString
// Method mosek.fusion.BaseVariable.toString @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:957:6-968:7
std::string mosek::fusion::BaseVariable :: toString() { return mosek::fusion::p_BaseVariable::_get_impl(this)->toString(); }
std::string mosek::fusion::p_BaseVariable::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2278_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2278_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Variable(("));
  if (((int)((shape)->size(0)) > (int)0))
  {
    {
      _2278_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
      int32_t _10116_ = (int)1;
      int32_t _10117_ = (int)((shape)->size(0));
      for (int32_t _2279_i = _10116_; _2279_i < _10117_; ++_2279_i)
      {
        {
          _2278_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2279_i)));
        }
      }
    }
  }
  {}
  _2278_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("))"));
  return _2278_sb->toString();
}
// End mosek.fusion.BaseVariable.toString

// Begin mosek.fusion.BaseVariable.eval
// Method mosek.fusion.BaseVariable.eval @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:926:6-954:7
void mosek::fusion::BaseVariable :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _2280_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _2281_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _2282_xs) { mosek::fusion::p_BaseVariable::_get_impl(this)->eval(_2280_rs,_2281_ws,_2282_xs); }
void mosek::fusion::p_BaseVariable::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _2280_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _2281_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _2282_xs)
{
  int32_t _2283_nnz = (int)((basevar_nativeidxs)->size(0));
  int32_t _2284_nelem = _2283_nnz;
  int32_t _2285_nd = (int)((shape)->size(0));
  bool _2286_hassp = (NULL != sparsity.get());
  _2280_rs->alloc_expr(_2285_nd,_2284_nelem,_2283_nnz,_2286_hassp);
  int32_t _2287_ptr = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->ptr_base;
  int32_t _2288_nidxs = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->nidxs_base;
  int32_t _2289_sp = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->sp_base;
  int32_t _2290_cof = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->cof_base;
  int32_t _2291_shape_base = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->shape_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2292_ri32 = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__2292_ri32(_2292_ri32 ? _2292_ri32->raw() : nullptr,_2292_ri32 ? _2292_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2293_ri64 = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__2293_ri64(_2293_ri64 ? _2293_ri64->raw() : nullptr,_2293_ri64 ? _2293_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _2294_rf64 = mosek::fusion::p_WorkStack::_get_impl(_2280_rs)->f64;
  _checked_ptr_1<double> _ptr__2294_rf64(_2294_rf64 ? _2294_rf64->raw() : nullptr,_2294_rf64 ? _2294_rf64->size(0) : 0);
  int32_t _10118_ = (int)0;
  int32_t _10119_ = _2285_nd;
  for (int32_t _2295_i = _10118_; _2295_i < _10119_; ++_2295_i)
  {
    {
      _ptr__2292_ri32[safe_add( _2291_shape_base,_2295_i )] = ((*shape)(_2295_i));
    }
  }
  {
    int32_t _10120_ = (int)0;
    int32_t _10121_ = safe_add( _2283_nnz,(int)1 );
    for (int32_t _2296_i = _10120_; _2296_i < _10121_; ++_2296_i)
    {
      {
        _ptr__2292_ri32[safe_add( _2287_ptr,_2296_i )] = _2296_i;
      }
    }
    int32_t _10122_ = (int)0;
    int32_t _10123_ = _2283_nnz;
    for (int32_t _2297_i = _10122_; _2297_i < _10123_; ++_2297_i)
    {
      {
        _ptr__2293_ri64[safe_add( _2288_nidxs,_2297_i )] = ((*basevar_nativeidxs)(_2297_i));
      }
    }
    if (_2286_hassp)
    {
      {
        int32_t _10124_ = (int)0;
        int32_t _10125_ = _2283_nnz;
        for (int32_t _2298_i = _10124_; _2298_i < _10125_; ++_2298_i)
        {
          {
            _ptr__2293_ri64[safe_add( _2289_sp,_2298_i )] = ((*sparsity)(_2298_i));
          }
        }
      }
    }
    {}
    int32_t _10126_ = (int)0;
    int32_t _10127_ = _2283_nnz;
    for (int32_t _2299_i = _10126_; _2299_i < _10127_; ++_2299_i)
    {
      {
        _ptr__2294_rf64[safe_add( _2290_cof,_2299_i )] = 1.0;
      }
    }
  }
}
// End mosek.fusion.BaseVariable.eval

// Begin mosek.fusion.BaseVariable.remove
// Method mosek.fusion.BaseVariable.remove @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:920:6-922:7
void mosek::fusion::BaseVariable :: remove() { mosek::fusion::p_BaseVariable::_get_impl(this)->remove(); }
void mosek::fusion::p_BaseVariable::remove()
{
  throw ::mosek::fusion::DeletionError(std::string ("Only original variables can be removed"));
}
// End mosek.fusion.BaseVariable.remove

// Begin mosek.fusion.BaseVariable.fromTril
// Method mosek.fusion.BaseVariable.fromTril @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:844:6-918:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__fromTril(int32_t _2300_dim0,int32_t _2301_d) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__fromTril(_2300_dim0,_2301_d); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::fromTril(int32_t _2300_dim0,int32_t _2301_d) { return __mosek_2fusion_2BaseVariable__fromTril(_2300_dim0,_2301_d); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__fromTril(int32_t _2300_dim0,int32_t _2301_d)
{
  if (((_2300_dim0 < (int)0) || (_2300_dim0 >= (int)((shape)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid dimension"));
    }
  }
  else if((((*shape)(_2300_dim0)) != (safe_mul( _2301_d,safe_add( _2301_d,(int)1 ) ) / (int)2)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid shape for operation"));
    }
  }
  {}
  int32_t _2302_d0 = (int)1;
  int32_t _10128_ = (int)0;
  int32_t _10129_ = _2300_dim0;
  for (int32_t _2303_i = _10128_; _2303_i < _10129_; ++_2303_i)
  {
    {
      _2302_d0 *= ((*shape)(_2303_i));
    }
  }
  int32_t _2304_d1 = ((*shape)(_2300_dim0));
  int32_t _2305_d2 = (int)1;
  int32_t _10130_ = safe_add( _2300_dim0,(int)1 );
  int32_t _10131_ = (int)((shape)->size(0));
  for (int32_t _2306_i = _10130_; _2306_i < _10131_; ++_2306_i)
  {
    {
      _2305_d2 *= ((*shape)(_2306_i));
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2307_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( (int)((shape)->size(0)),(int)1 ))));
  _checked_ptr_1<int32_t> _ptr__2307_rshape(_2307_rshape ? _2307_rshape->raw() : nullptr,_2307_rshape ? _2307_rshape->size(0) : 0);
  int32_t _10132_ = (int)0;
  int32_t _10133_ = _2300_dim0;
  for (int32_t _2308_i = _10132_; _2308_i < _10133_; ++_2308_i)
  {
    {
      _ptr__2307_rshape[_2308_i] = ((*shape)(_2308_i));
    }
  }
  _ptr__2307_rshape[_2300_dim0] = _2301_d;
  _ptr__2307_rshape[safe_add( _2300_dim0,(int)1 )] = _2301_d;
  int32_t _10134_ = safe_add( _2300_dim0,(int)1 );
  int32_t _10135_ = (int)((shape)->size(0));
  for (int32_t _2309_i = _10134_; _2309_i < _10135_; ++_2309_i)
  {
    {
      _ptr__2307_rshape[safe_add( _2309_i,(int)1 )] = ((*shape)(_2309_i));
    }
  }
  if ((NULL == sparsity.get()))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2310_nidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_mul( safe_mul( safe_mul( _2302_d0,_2301_d ),_2301_d ),_2305_d2 ))));
      _checked_ptr_1<int64_t> _ptr__2310_nidxs(_2310_nidxs ? _2310_nidxs->raw() : nullptr,_2310_nidxs ? _2310_nidxs->size(0) : 0);
      int32_t _2311_ofs = (int)0;
      int32_t _10136_ = (int)0;
      int32_t _10137_ = _2302_d0;
      for (int32_t _2312_i0 = _10136_; _2312_i0 < _10137_; ++_2312_i0)
      {
        {
          int32_t _10138_ = (int)0;
          int32_t _10139_ = _2301_d;
          for (int32_t _2313_i10 = _10138_; _2313_i10 < _10139_; ++_2313_i10)
          {
            {
              int32_t _10140_ = (int)0;
              int32_t _10141_ = _2301_d;
              for (int32_t _2314_i11 = _10140_; _2314_i11 < _10141_; ++_2314_i11)
              {
                {
                  int32_t _10142_ = (int)0;
                  int32_t _10143_ = _2305_d2;
                  for (int32_t _2315_i2 = _10142_; _2315_i2 < _10143_; ++_2315_i2)
                  {
                    {
                      if ((_2313_i10 >= _2314_i11))
                      {
                        {
                          _ptr__2310_nidxs[_2311_ofs] = ((*basevar_nativeidxs)(safe_add( safe_add( safe_mul( safe_mul( _2312_i0,_2304_d1 ),_2305_d2 ),safe_mul( safe_add( (safe_mul( _2313_i10,safe_add( _2313_i10,(int)1 ) ) / (int)2),_2314_i11 ),_2305_d2 ) ),_2315_i2 )));
                        }
                      }
                      else
                      {
                        {
                          _ptr__2310_nidxs[_2311_ofs] = ((*basevar_nativeidxs)(safe_add( safe_add( safe_mul( safe_mul( _2312_i0,_2304_d1 ),_2305_d2 ),safe_mul( safe_add( (safe_mul( _2314_i11,safe_add( _2314_i11,(int)1 ) ) / (int)2),_2313_i10 ),_2305_d2 ) ),_2315_i2 )));
                        }
                      }
                      ++ _2311_ofs;
                    }
                  }
                }
              }
            }
          }
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2307_rshape,nullptr,_2310_nidxs)).as<::mosek::fusion::Variable>();
    }
  }
  else
  {
    {
      int32_t _2316_nelm = (int)0;
      int32_t _10144_ = (int)0;
      int32_t _10145_ = (int)((sparsity)->size(0));
      for (int32_t _2317_i = _10144_; _2317_i < _10145_; ++_2317_i)
      {
        {
          int64_t _2318_i1 = ((((*sparsity)(_2317_i)) / _2305_d2) % _2304_d1);
          int32_t _2319_ii = (int32_t)(((-(int)1) + ::mosek::fusion::Utils::Tools::sqrt((double)(safe_mul( safe_add( (int)1,safe_mul( (int)2,_2318_i1 ) ),safe_add( (int)1,safe_mul( (int)2,_2318_i1 ) ) )))) / (int)4);
          int64_t _2320_jj = (((*sparsity)(_2317_i)) - (safe_mul( _2319_ii,safe_add( _2319_ii,(int)1 ) ) / (int)2));
          if ((_2319_ii == _2320_jj))
          {
            {
              _2316_nelm += (int)1;
            }
          }
          else
          {
            {
              _2316_nelm += (int)2;
            }
          }
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2321_nidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2316_nelm)));
      _checked_ptr_1<int64_t> _ptr__2321_nidxs(_2321_nidxs ? _2321_nidxs->raw() : nullptr,_2321_nidxs ? _2321_nidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2322_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2316_nelm)));
      _checked_ptr_1<int64_t> _ptr__2322_sp(_2322_sp ? _2322_sp->raw() : nullptr,_2322_sp ? _2322_sp->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2323_perm = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2316_nelm)));
      _checked_ptr_1<int64_t> _ptr__2323_perm(_2323_perm ? _2323_perm->raw() : nullptr,_2323_perm ? _2323_perm->size(0) : 0);
      int32_t _10146_ = (int)0;
      int32_t _10147_ = _2316_nelm;
      for (int32_t _2324_i = _10146_; _2324_i < _10147_; ++_2324_i)
      {
        {
          _ptr__2323_perm[_2324_i] = _2324_i;
        }
      }
      int32_t _2325_elmi = (int)0;
      int32_t _10148_ = (int)0;
      int32_t _10149_ = (int)((sparsity)->size(0));
      for (int32_t _2326_i = _10148_; _2326_i < _10149_; ++_2326_i)
      {
        {
          int64_t _2327_i0 = (((*sparsity)(_2326_i)) / safe_mul( _2304_d1,_2305_d2 ));
          int64_t _2328_i1 = ((((*sparsity)(_2326_i)) / _2305_d2) % _2304_d1);
          int64_t _2329_i2 = (((*sparsity)(_2326_i)) % _2305_d2);
          int32_t _2330_ii1 = (int32_t)(((-(int)1) + ::mosek::fusion::Utils::Tools::sqrt((double)(safe_mul( safe_add( (int)1,safe_mul( (int)2,_2328_i1 ) ),safe_add( (int)1,safe_mul( (int)2,_2328_i1 ) ) )))) / (int)4);
          int64_t _2331_jj1 = (((*sparsity)(_2326_i)) - (safe_mul( _2330_ii1,safe_add( _2330_ii1,(int)1 ) ) / (int)2));
          if ((_2330_ii1 == _2331_jj1))
          {
            {
              _ptr__2321_nidxs[_2325_elmi] = ((*basevar_nativeidxs)(_2326_i));
              _ptr__2322_sp[_2325_elmi] = safe_add( safe_add( safe_mul( safe_mul( safe_mul( _2327_i0,_2301_d ),_2301_d ),_2305_d2 ),safe_mul( safe_add( safe_mul( _2330_ii1,_2301_d ),_2331_jj1 ),_2305_d2 ) ),_2329_i2 );
              _2325_elmi += (int)1;
            }
          }
          else
          {
            {
              _ptr__2321_nidxs[_2325_elmi] = ((*basevar_nativeidxs)(_2326_i));
              _ptr__2321_nidxs[safe_add( _2325_elmi,(int)1 )] = ((*basevar_nativeidxs)(_2326_i));
              _ptr__2322_sp[_2325_elmi] = safe_add( safe_add( safe_mul( safe_mul( safe_mul( _2327_i0,_2301_d ),_2301_d ),_2305_d2 ),safe_mul( safe_add( safe_mul( _2330_ii1,_2301_d ),_2331_jj1 ),_2305_d2 ) ),_2329_i2 );
              _ptr__2322_sp[safe_add( _2325_elmi,(int)1 )] = safe_add( safe_add( safe_mul( safe_mul( safe_mul( _2327_i0,_2301_d ),_2301_d ),_2305_d2 ),safe_mul( safe_add( safe_mul( _2331_jj1,_2301_d ),_2330_ii1 ),_2305_d2 ) ),_2329_i2 );
              _2325_elmi += (int)2;
            }
          }
        }
      }
      ::mosek::fusion::p_CommonTools::argQsort(_2323_perm,_2321_nidxs,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_2316_nelm));
      std::vector<int64_t> _10150_;
      for (int32_t _2332_i = (int)0, _10151_ = _2316_nelm; _2332_i < _10151_ ; ++_2332_i)
      {
        _10150_.push_back(_ptr__2322_sp[_ptr__2323_perm[_2332_i]]);
      }
      auto _10152_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10150_.size()),_10150_.begin(),_10150_.end()));
      std::vector<int64_t> _10153_;
      for (int32_t _2333_i = (int)0, _10154_ = _2316_nelm; _2333_i < _10154_ ; ++_2333_i)
      {
        _10153_.push_back(_ptr__2321_nidxs[_ptr__2323_perm[_2333_i]]);
      }
      auto _10155_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10153_.size()),_10153_.begin(),_10153_.end()));
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2307_rshape,_10152_,_10155_)).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.BaseVariable.fromTril

// Begin mosek.fusion.BaseVariable.fromTril
// Method mosek.fusion.BaseVariable.fromTril @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:827:6-842:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__fromTril(int32_t _2334_d) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__fromTril(_2334_d); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::fromTril(int32_t _2334_d) { return __mosek_2fusion_2BaseVariable__fromTril(_2334_d); }
/* override: mosek.fusion.Variable.fromTril*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__fromTril(int32_t _2334_d) { return __mosek_2fusion_2BaseVariable__fromTril(_2334_d); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__fromTril(int32_t _2334_d)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__fromTril((int)0,_2334_d);
}
// End mosek.fusion.BaseVariable.fromTril

// Begin mosek.fusion.BaseVariable.tril
// Method mosek.fusion.BaseVariable.tril @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:738:6-825:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__tril(int32_t _2335_dim1,int32_t _2336_dim2) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__tril(_2335_dim1,_2336_dim2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::tril(int32_t _2335_dim1,int32_t _2336_dim2) { return __mosek_2fusion_2BaseVariable__tril(_2335_dim1,_2336_dim2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__tril(int32_t _2335_dim1,int32_t _2336_dim2)
{
  if (((_2335_dim1 < (int)0) || ((_2335_dim1 >= _2336_dim2) || (_2336_dim2 >= (int)((shape)->size(0))))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid dimension specification"));
    }
  }
  else
  {
    {
      if ((((*shape)(_2335_dim1)) != ((*shape)(_2336_dim2))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Operation only valid for square variables"));
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2337_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(((int)((shape)->size(0)) - (int)1))));
  _checked_ptr_1<int32_t> _ptr__2337_rshape(_2337_rshape ? _2337_rshape->raw() : nullptr,_2337_rshape ? _2337_rshape->size(0) : 0);
  int32_t _10156_ = (int)0;
  int32_t _10157_ = _2335_dim1;
  for (int32_t _2338_i = _10156_; _2338_i < _10157_; ++_2338_i)
  {
    {
      _ptr__2337_rshape[_2338_i] = ((*shape)(_2338_i));
    }
  }
  _ptr__2337_rshape[_2335_dim1] = (safe_mul( ((*shape)(_2335_dim1)),safe_add( ((*shape)(_2335_dim1)),(int)1 ) ) / (int)2);
  int32_t _10158_ = safe_add( _2335_dim1,(int)1 );
  int32_t _10159_ = _2336_dim2;
  for (int32_t _2339_i = _10158_; _2339_i < _10159_; ++_2339_i)
  {
    {
      _ptr__2337_rshape[_2339_i] = ((*shape)(_2339_i));
    }
  }
  int32_t _10160_ = safe_add( _2336_dim2,(int)1 );
  int32_t _10161_ = (int)((shape)->size(0));
  for (int32_t _2340_i = _10160_; _2340_i < _10161_; ++_2340_i)
  {
    {
      _ptr__2337_rshape[(_2340_i - (int)1)] = ((*shape)(_2340_i));
    }
  }
  if ((NULL == sparsity.get()))
  {
    {
      int32_t _2341_d0 = (int)1;
      int32_t _10162_ = (int)0;
      int32_t _10163_ = _2335_dim1;
      for (int32_t _2342_i = _10162_; _2342_i < _10163_; ++_2342_i)
      {
        {
          _2341_d0 *= ((*shape)(_2342_i));
        }
      }
      int32_t _2343_d1 = ((*shape)(_2335_dim1));
      int32_t _2344_d2 = (int)1;
      int32_t _10164_ = safe_add( _2335_dim1,(int)1 );
      int32_t _10165_ = _2336_dim2;
      for (int32_t _2345_i = _10164_; _2345_i < _10165_; ++_2345_i)
      {
        {
          _2344_d2 *= ((*shape)(_2345_i));
        }
      }
      int32_t _2346_d3 = ((*shape)(_2336_dim2));
      int32_t _2347_d4 = (int)1;
      int32_t _10166_ = safe_add( _2336_dim2,(int)1 );
      int32_t _10167_ = (int)((shape)->size(0));
      for (int32_t _2348_i = _10166_; _2348_i < _10167_; ++_2348_i)
      {
        {
          _2347_d4 *= ((*shape)(_2348_i));
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2349_nidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((safe_mul( safe_mul( safe_mul( safe_mul( _2341_d0,_2344_d2 ),_2347_d4 ),_2343_d1 ),safe_add( _2343_d1,(int)1 ) ) / (int)2))));
      _checked_ptr_1<int64_t> _ptr__2349_nidxs(_2349_nidxs ? _2349_nidxs->raw() : nullptr,_2349_nidxs ? _2349_nidxs->size(0) : 0);
      int32_t _2350_i = (int)0;
      int32_t _10168_ = (int)0;
      int32_t _10169_ = _2341_d0;
      for (int32_t _2351_i0 = _10168_; _2351_i0 < _10169_; ++_2351_i0)
      {
        {
          int32_t _10170_ = (int)0;
          int32_t _10171_ = _2343_d1;
          for (int32_t _2352_i1 = _10170_; _2352_i1 < _10171_; ++_2352_i1)
          {
            {
              int32_t _10172_ = (int)0;
              int32_t _10173_ = safe_add( _2352_i1,(int)1 );
              for (int32_t _2353_i3 = _10172_; _2353_i3 < _10173_; ++_2353_i3)
              {
                {
                  int32_t _10174_ = (int)0;
                  int32_t _10175_ = _2344_d2;
                  for (int32_t _2354_i2 = _10174_; _2354_i2 < _10175_; ++_2354_i2)
                  {
                    {
                      int32_t _10176_ = (int)0;
                      int32_t _10177_ = _2347_d4;
                      for (int32_t _2355_i4 = _10176_; _2355_i4 < _10177_; ++_2355_i4)
                      {
                        {
                          _ptr__2349_nidxs[_2350_i] = ((*basevar_nativeidxs)(safe_add( _2355_i4,safe_mul( _2347_d4,safe_add( _2353_i3,safe_mul( _2346_d3,safe_add( _2354_i2,safe_mul( _2344_d2,safe_add( _2352_i1,safe_mul( _2343_d1,_2351_i0 ) ) ) ) ) ) ) )));
                          _2350_i += (int)1;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2337_rshape,nullptr,_2349_nidxs)).as<::mosek::fusion::Variable>();
    }
  }
  else
  {
    {
      int32_t _2356_d0 = (int)1;
      int32_t _10178_ = (int)0;
      int32_t _10179_ = _2335_dim1;
      for (int32_t _2357_i = _10178_; _2357_i < _10179_; ++_2357_i)
      {
        {
          _2356_d0 *= ((*shape)(_2357_i));
        }
      }
      int32_t _2358_d1 = ((*shape)(_2335_dim1));
      int32_t _2359_d2 = (int)1;
      int32_t _10180_ = safe_add( _2335_dim1,(int)1 );
      int32_t _10181_ = _2336_dim2;
      for (int32_t _2360_i = _10180_; _2360_i < _10181_; ++_2360_i)
      {
        {
          _2359_d2 *= ((*shape)(_2360_i));
        }
      }
      int32_t _2361_d3 = ((*shape)(_2336_dim2));
      int32_t _2362_d4 = (int)1;
      int32_t _10182_ = safe_add( _2336_dim2,(int)1 );
      int32_t _10183_ = (int)((shape)->size(0));
      for (int32_t _2363_i = _10182_; _2363_i < _10183_; ++_2363_i)
      {
        {
          _2362_d4 *= ((*shape)(_2363_i));
        }
      }
      int32_t _2364_s4 = (int)1;
      int32_t _2365_s3 = _2362_d4;
      int32_t _2366_s2 = safe_mul( _2365_s3,_2361_d3 );
      int32_t _2367_s1 = safe_mul( _2366_s2,_2359_d2 );
      int32_t _2368_s0 = safe_mul( _2367_s1,_2358_d1 );
      int32_t _2369_nelm = (int)0;
      int32_t _10184_ = (int)0;
      int32_t _10185_ = (int)((sparsity)->size(0));
      for (int32_t _2370_i = _10184_; _2370_i < _10185_; ++_2370_i)
      {
        {
          if ((((((*sparsity)(_2370_i)) / _2367_s1) % _2358_d1) >= ((((*sparsity)(_2370_i)) / _2365_s3) % _2361_d3)))
          {
            {
              ++ _2369_nelm;
            }
          }
          {}
        }
      }
      int32_t _2371_rs3 = (int)1;
      int32_t _2372_rs2 = _2362_d4;
      int32_t _2373_rs1 = safe_mul( _2372_rs2,_2359_d2 );
      int32_t _2374_rs0 = (safe_mul( safe_mul( _2373_rs1,_2358_d1 ),safe_add( _2358_d1,(int)1 ) ) / (int)2);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2375_perm = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2369_nelm)));
      _checked_ptr_1<int64_t> _ptr__2375_perm(_2375_perm ? _2375_perm->raw() : nullptr,_2375_perm ? _2375_perm->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2376_rnidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2369_nelm)));
      _checked_ptr_1<int64_t> _ptr__2376_rnidxs(_2376_rnidxs ? _2376_rnidxs->raw() : nullptr,_2376_rnidxs ? _2376_rnidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2377_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2369_nelm)));
      _checked_ptr_1<int64_t> _ptr__2377_rsp(_2377_rsp ? _2377_rsp->raw() : nullptr,_2377_rsp ? _2377_rsp->size(0) : 0);
      int32_t _2378_elmi = (int)0;
      {
        int32_t _10186_ = (int)0;
        int32_t _10187_ = (int)((sparsity)->size(0));
        for (int32_t _2379_i = _10186_; _2379_i < _10187_; ++_2379_i)
        {
          {
            if ((((((*sparsity)(_2379_i)) / _2367_s1) % _2358_d1) >= ((((*sparsity)(_2379_i)) / _2365_s3) % _2361_d3)))
            {
              {
                int64_t _2380_i0 = (((*sparsity)(_2379_i)) / _2368_s0);
                int64_t _2381_i1 = ((((*sparsity)(_2379_i)) / _2367_s1) % _2358_d1);
                int64_t _2382_i2 = ((((*sparsity)(_2379_i)) / _2366_s2) % _2359_d2);
                int64_t _2383_i3 = ((((*sparsity)(_2379_i)) / _2365_s3) % _2361_d3);
                int64_t _2384_i4 = ((((*sparsity)(_2379_i)) / _2364_s4) % _2362_d4);
                _ptr__2376_rnidxs[_2378_elmi] = ((*basevar_nativeidxs)(_2379_i));
                _ptr__2377_rsp[_2378_elmi] = safe_add( safe_add( safe_add( safe_mul( _2374_rs0,_2380_i0 ),safe_mul( _2373_rs1,safe_add( (safe_mul( _2381_i1,safe_add( _2381_i1,(int)1 ) ) / (int)2),_2383_i3 ) ) ),safe_mul( _2372_rs2,_2382_i2 ) ),safe_mul( _2371_rs3,_2384_i4 ) );
                ++ _2378_elmi;
              }
            }
            {}
          }
        }
        int32_t _10188_ = (int)0;
        int32_t _10189_ = _2369_nelm;
        for (int32_t _2385_i = _10188_; _2385_i < _10189_; ++_2385_i)
        {
          {
            _ptr__2375_perm[_2385_i] = _2385_i;
          }
        }
      }
      ::mosek::fusion::p_CommonTools::argQsort(_2375_perm,_2376_rnidxs,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_2369_nelm));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2386_nidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2369_nelm)));
      _checked_ptr_1<int64_t> _ptr__2386_nidxs(_2386_nidxs ? _2386_nidxs->raw() : nullptr,_2386_nidxs ? _2386_nidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2387_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2369_nelm)));
      _checked_ptr_1<int64_t> _ptr__2387_sp(_2387_sp ? _2387_sp->raw() : nullptr,_2387_sp ? _2387_sp->size(0) : 0);
      int32_t _10190_ = (int)0;
      int32_t _10191_ = _2369_nelm;
      for (int32_t _2388_i = _10190_; _2388_i < _10191_; ++_2388_i)
      {
        {
          _ptr__2386_nidxs[_2388_i] = _ptr__2376_rnidxs[_ptr__2375_perm[_2388_i]];
        }
      }
      int32_t _10192_ = (int)0;
      int32_t _10193_ = _2369_nelm;
      for (int32_t _2389_i = _10192_; _2389_i < _10193_; ++_2389_i)
      {
        {
          _ptr__2387_sp[_2389_i] = _ptr__2377_rsp[_ptr__2375_perm[_2389_i]];
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2337_rshape,_2387_sp,_2386_nidxs)).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.BaseVariable.tril

// Begin mosek.fusion.BaseVariable.tril
// Method mosek.fusion.BaseVariable.tril @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:736:6-57
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__tril() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__tril(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::tril() { return __mosek_2fusion_2BaseVariable__tril(); }
/* override: mosek.fusion.Variable.tril*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__tril() { return __mosek_2fusion_2BaseVariable__tril(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__tril()
{
  return _pubthis->__mosek_2fusion_2BaseVariable__tril((int)0,(int)1);
}
// End mosek.fusion.BaseVariable.tril

// Begin mosek.fusion.BaseVariable.reshape
// Method mosek.fusion.BaseVariable.reshape @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:734:6-114
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__reshape(int32_t _2390_dim0,int32_t _2391_dim1,int32_t _2392_dim2) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__reshape(_2390_dim0,_2391_dim1,_2392_dim2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::reshape(int32_t _2390_dim0,int32_t _2391_dim1,int32_t _2392_dim2) { return __mosek_2fusion_2BaseVariable__reshape(_2390_dim0,_2391_dim1,_2392_dim2); }
/* override: mosek.fusion.Variable.reshape*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__reshape(int32_t _2390_dim0,int32_t _2391_dim1,int32_t _2392_dim2) { return __mosek_2fusion_2BaseVariable__reshape(_2390_dim0,_2391_dim1,_2392_dim2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__reshape(int32_t _2390_dim0,int32_t _2391_dim1,int32_t _2392_dim2)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2390_dim0),(int32_t)(_2391_dim1),(int32_t)(_2392_dim2)}));
}
// End mosek.fusion.BaseVariable.reshape

// Begin mosek.fusion.BaseVariable.reshape
// Method mosek.fusion.BaseVariable.reshape @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:733:6-98
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__reshape(int32_t _2393_dim0,int32_t _2394_dim1) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__reshape(_2393_dim0,_2394_dim1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::reshape(int32_t _2393_dim0,int32_t _2394_dim1) { return __mosek_2fusion_2BaseVariable__reshape(_2393_dim0,_2394_dim1); }
/* override: mosek.fusion.Variable.reshape*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__reshape(int32_t _2393_dim0,int32_t _2394_dim1) { return __mosek_2fusion_2BaseVariable__reshape(_2393_dim0,_2394_dim1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__reshape(int32_t _2393_dim0,int32_t _2394_dim1)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2393_dim0),(int32_t)(_2394_dim1)}));
}
// End mosek.fusion.BaseVariable.reshape

// Begin mosek.fusion.BaseVariable.reshape
// Method mosek.fusion.BaseVariable.reshape @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:732:6-82
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__reshape(int32_t _2395_dim0) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__reshape(_2395_dim0); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::reshape(int32_t _2395_dim0) { return __mosek_2fusion_2BaseVariable__reshape(_2395_dim0); }
/* override: mosek.fusion.Variable.reshape*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__reshape(int32_t _2395_dim0) { return __mosek_2fusion_2BaseVariable__reshape(_2395_dim0); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__reshape(int32_t _2395_dim0)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2395_dim0)}));
}
// End mosek.fusion.BaseVariable.reshape

// Begin mosek.fusion.BaseVariable.reshape
// Method mosek.fusion.BaseVariable.reshape @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:719:6-730:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _2396_shape) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__reshape(_2396_shape); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _2396_shape) { return __mosek_2fusion_2BaseVariable__reshape(_2396_shape); }
/* override: mosek.fusion.Variable.reshape*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _2396_shape) { return __mosek_2fusion_2BaseVariable__reshape(_2396_shape); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _2396_shape)
{
  _checked_ptr_1<int32_t> _ptr__2396_shape(_2396_shape ? _2396_shape->raw() : nullptr, _2396_shape ? _2396_shape->size(0) : 0);
  int64_t _2397_shapesize = (int)1;
  int32_t _10194_ = (int)0;
  int32_t _10195_ = (int)((_2396_shape)->size(0));
  for (int32_t _2398_i = _10194_; _2398_i < _10195_; ++_2398_i)
  {
    {
      if ((_ptr__2396_shape[_2398_i] < (int)0))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Invalid shape"));
        }
      }
      {}
      _2397_shapesize *= _ptr__2396_shape[_2398_i];
    }
  }
  if ((_2397_shapesize != _pubthis->getSize()))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Shape size does not match variable size"));
    }
  }
  {}
  std::vector<int32_t> _10196_;
  for (int32_t _2399_i = (int)0, _10197_ = (int)((_2396_shape)->size(0)); _2399_i < _10197_ ; ++_2399_i)
  {
    _10196_.push_back(_ptr__2396_shape[_2399_i]);
  }
  auto _10198_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10196_.size()),_10196_.begin(),_10196_.end()));
  return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_10198_,sparsity,basevar_nativeidxs)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BaseVariable.reshape

// Begin mosek.fusion.BaseVariable.setLevel
// Method mosek.fusion.BaseVariable.setLevel @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:705:6-717:7
void mosek::fusion::BaseVariable :: setLevel(std::shared_ptr< monty::ndarray< double,1 > > _2400_v) { mosek::fusion::p_BaseVariable::_get_impl(this)->setLevel(_2400_v); }
void mosek::fusion::p_BaseVariable::setLevel(std::shared_ptr< monty::ndarray< double,1 > > _2400_v)
{
  _checked_ptr_1<double> _ptr__2400_v(_2400_v ? _2400_v->raw() : nullptr, _2400_v ? _2400_v->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      if (((int)((_2400_v)->size(0)) != (int)((basevar_nativeidxs)->size(0))))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Invalid length of solution values vector"));
        }
      }
      {}
      model->setVariableValues(true,basevar_nativeidxs,_2400_v);
    }
  }
  else
  {
    {
      if (((int)((_2400_v)->size(0)) != _pubthis->getSize()))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Invalid length of solution values vector"));
        }
      }
      {}
      std::vector<double> _10199_;
      for (int32_t _2402_i = (int)0, _10200_ = (int)((basevar_nativeidxs)->size(0)); _2402_i < _10200_ ; ++_2402_i)
      {
        _10199_.push_back(_ptr__2400_v[((*sparsity)(_2402_i))]);
      }
      auto _10201_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10199_.size()),_10199_.begin(),_10199_.end()));
      std::shared_ptr< monty::ndarray< double,1 > > _2401_v = _10201_;
      _checked_ptr_1<double> _ptr__2401_v(_2401_v ? _2401_v->raw() : nullptr,_2401_v ? _2401_v->size(0) : 0);
      model->setVariableValues(true,basevar_nativeidxs,_2401_v);
    }
  }
}
// End mosek.fusion.BaseVariable.setLevel

// Begin mosek.fusion.BaseVariable.getModel
// Method mosek.fusion.BaseVariable.getModel @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:703:6-55
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__getModel() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::BaseVariable::getModel() { return __mosek_2fusion_2BaseVariable__getModel(); }
/* override: mosek.fusion.Variable.getModel*/
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__getModel() { return __mosek_2fusion_2BaseVariable__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__getModel()
{
  return model;
}
// End mosek.fusion.BaseVariable.getModel

// Begin mosek.fusion.BaseVariable.getND
// Method mosek.fusion.BaseVariable.getND @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:702:6-56
int32_t mosek::fusion::BaseVariable :: getND() { return mosek::fusion::p_BaseVariable::_get_impl(this)->getND(); }
int32_t mosek::fusion::p_BaseVariable::getND()
{
  return (int)((shape)->size(0));
}
// End mosek.fusion.BaseVariable.getND

// Begin mosek.fusion.BaseVariable.getDim
// Method mosek.fusion.BaseVariable.getDim @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:701:6-62
int32_t mosek::fusion::BaseVariable :: getDim(int32_t _2403_d) { return mosek::fusion::p_BaseVariable::_get_impl(this)->getDim(_2403_d); }
int32_t mosek::fusion::p_BaseVariable::getDim(int32_t _2403_d)
{
  return ((*shape)(_2403_d));
}
// End mosek.fusion.BaseVariable.getDim

// Begin mosek.fusion.BaseVariable.getShape
// Method mosek.fusion.BaseVariable.getShape @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:700:6-79
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::BaseVariable :: getShape() { return mosek::fusion::p_BaseVariable::_get_impl(this)->getShape(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_BaseVariable::getShape()
{
  return ::mosek::fusion::Utils::Tools::arraycopy(shape);
}
// End mosek.fusion.BaseVariable.getShape

// Begin mosek.fusion.BaseVariable.getSize
// Method mosek.fusion.BaseVariable.getSize @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:699:6-107
int64_t mosek::fusion::BaseVariable :: getSize() { return mosek::fusion::p_BaseVariable::_get_impl(this)->getSize(); }
int64_t mosek::fusion::p_BaseVariable::getSize()
{
  int64_t _2404_sz = (int64_t)1;
  int32_t _10202_ = (int)0;
  int32_t _10203_ = (int)((shape)->size(0));
  for (int32_t _2405_i = _10202_; _2405_i < _10203_; ++_2405_i)
  {
    {
      _2404_sz *= ((*shape)(_2405_i));
    }
  }
  return _2404_sz;
}
// End mosek.fusion.BaseVariable.getSize

// Begin mosek.fusion.BaseVariable.dual
// Method mosek.fusion.BaseVariable.dual @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:686:6-696:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::BaseVariable :: dual() { return mosek::fusion::p_BaseVariable::_get_impl(this)->dual(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_BaseVariable::dual()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2406_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((basevar_nativeidxs)->size(0)))));
  _checked_ptr_1<double> _ptr__2406_res(_2406_res ? _2406_res->raw() : nullptr,_2406_res ? _2406_res->size(0) : 0);
  model->getVariableValues(false,basevar_nativeidxs,_2406_res,(int)0);
  if ((NULL != sparsity.get()))
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _2407_spread_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_pubthis->getSize())));
      _checked_ptr_1<double> _ptr__2407_spread_res(_2407_spread_res ? _2407_spread_res->raw() : nullptr,_2407_spread_res ? _2407_spread_res->size(0) : 0);
      int32_t _10204_ = (int)0;
      int32_t _10205_ = (int)((basevar_nativeidxs)->size(0));
      for (int32_t _2408_i = _10204_; _2408_i < _10205_; ++_2408_i)
      {
        {
          _ptr__2407_spread_res[((*sparsity)(_2408_i))] = _ptr__2406_res[_2408_i];
        }
      }
      _2406_res = _2407_spread_res;
      _ptr__2406_res.update(_2406_res ? _2406_res->raw() : nullptr, _2406_res ? _2406_res->size(0) : 0);
    }
  }
  {}
  return _2406_res;
}
// End mosek.fusion.BaseVariable.dual

// Begin mosek.fusion.BaseVariable.level
// Method mosek.fusion.BaseVariable.level @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:674:6-684:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::BaseVariable :: level() { return mosek::fusion::p_BaseVariable::_get_impl(this)->level(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_BaseVariable::level()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2409_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((basevar_nativeidxs)->size(0)))));
  _checked_ptr_1<double> _ptr__2409_res(_2409_res ? _2409_res->raw() : nullptr,_2409_res ? _2409_res->size(0) : 0);
  model->getVariableValues(true,basevar_nativeidxs,_2409_res,(int)0);
  if ((NULL != sparsity.get()))
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _2410_spread_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_pubthis->getSize())));
      _checked_ptr_1<double> _ptr__2410_spread_res(_2410_spread_res ? _2410_spread_res->raw() : nullptr,_2410_spread_res ? _2410_spread_res->size(0) : 0);
      int32_t _10206_ = (int)0;
      int32_t _10207_ = (int)((basevar_nativeidxs)->size(0));
      for (int32_t _2411_i = _10206_; _2411_i < _10207_; ++_2411_i)
      {
        {
          _ptr__2410_spread_res[((*sparsity)(_2411_i))] = _ptr__2409_res[_2411_i];
        }
      }
      _2409_res = _2410_spread_res;
      _ptr__2409_res.update(_2409_res ? _2409_res->raw() : nullptr, _2409_res ? _2409_res->size(0) : 0);
    }
  }
  {}
  return _2409_res;
}
// End mosek.fusion.BaseVariable.level

// Begin mosek.fusion.BaseVariable.makeContinuous
// Method mosek.fusion.BaseVariable.makeContinuous @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:670:6-59
void mosek::fusion::BaseVariable :: makeContinuous() { mosek::fusion::p_BaseVariable::_get_impl(this)->makeContinuous(); }
void mosek::fusion::p_BaseVariable::makeContinuous()
{
  _pubthis->make_continuous();
}
// End mosek.fusion.BaseVariable.makeContinuous

// Begin mosek.fusion.BaseVariable.makeInteger
// Method mosek.fusion.BaseVariable.makeInteger @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:669:6-53
void mosek::fusion::BaseVariable :: makeInteger() { mosek::fusion::p_BaseVariable::_get_impl(this)->makeInteger(); }
void mosek::fusion::p_BaseVariable::makeInteger()
{
  _pubthis->make_integer();
}
// End mosek.fusion.BaseVariable.makeInteger

// Begin mosek.fusion.BaseVariable.transpose
// Method mosek.fusion.BaseVariable.transpose @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:630:6-665:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__transpose() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__transpose(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::transpose() { return __mosek_2fusion_2BaseVariable__transpose(); }
/* override: mosek.fusion.Variable.transpose*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__transpose() { return __mosek_2fusion_2BaseVariable__transpose(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__transpose()
{
  if (((int)((shape)->size(0)) == (int)1))
  {
    {
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(((*shape)((int)0)))}),sparsity,basevar_nativeidxs)).as<::mosek::fusion::Variable>();
    }
  }
  else if(((int)((shape)->size(0)) > (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid shape for operation"));
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2412_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((basevar_nativeidxs)->size(0)))));
      _checked_ptr_1<int64_t> _ptr__2412_idxs(_2412_idxs ? _2412_idxs->raw() : nullptr,_2412_idxs ? _2412_idxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _10208_;
      bool _10209_ = (NULL == sparsity.get());
      if (_10209_)
      {
        _10208_ = nullptr;
      }
      else
      {
        _10208_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((basevar_nativeidxs)->size(0)))));
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2413_sp = _10208_;
      _checked_ptr_1<int64_t> _ptr__2413_sp(_2413_sp ? _2413_sp->raw() : nullptr,_2413_sp ? _2413_sp->size(0) : 0);
      if ((NULL == sparsity.get()))
      {
        {
          int32_t _2414_k = (int)0;
          int32_t _10210_ = (int)0;
          int32_t _10211_ = ((*shape)((int)1));
          for (int32_t _2415_j = _10210_; _2415_j < _10211_; ++_2415_j)
          {
            {
              int32_t _10212_ = (int)0;
              int32_t _10213_ = ((*shape)((int)0));
              for (int32_t _2416_i = _10212_; _2416_i < _10213_; ++_2416_i)
              {
                {
                  _ptr__2412_idxs[_2414_k] = ((*basevar_nativeidxs)(safe_add( safe_mul( _2416_i,((*shape)((int)1)) ),_2415_j )));
                  ++ _2414_k;
                }
              }
            }
          }
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2417_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( ((*shape)((int)1)),(int)1 ))));
          _checked_ptr_1<int32_t> _ptr__2417_ptr(_2417_ptr ? _2417_ptr->raw() : nullptr,_2417_ptr ? _2417_ptr->size(0) : 0);
          int32_t _2418_dim0 = ((*shape)((int)0));
          int32_t _2419_dim1 = ((*shape)((int)1));
          int32_t _10214_ = (int)0;
          int32_t _10215_ = (int)((sparsity)->size(0));
          for (int32_t _2420_i = _10214_; _2420_i < _10215_; ++_2420_i)
          {
            {
              ++ _ptr__2417_ptr[safe_add( (((*sparsity)(_2420_i)) % _2419_dim1),(int)1 )];
            }
          }
          int32_t _10216_ = (int)0;
          int32_t _10217_ = _2419_dim1;
          for (int32_t _2421_i = _10216_; _2421_i < _10217_; ++_2421_i)
          {
            {
              _ptr__2417_ptr[safe_add( _2421_i,(int)1 )] += _ptr__2417_ptr[_2421_i];
            }
          }
          int32_t _10218_ = (int)0;
          int32_t _10219_ = (int)((sparsity)->size(0));
          for (int32_t _2422_i = _10218_; _2422_i < _10219_; ++_2422_i)
          {
            {
              int64_t _2423_ii = (((*sparsity)(_2422_i)) % _2419_dim1);
              _ptr__2412_idxs[_ptr__2417_ptr[_2423_ii]] = ((*basevar_nativeidxs)(_2422_i));
              _ptr__2413_sp[_ptr__2417_ptr[_2423_ii]] = safe_add( (((*sparsity)(_2422_i)) / _2419_dim1),safe_mul( (((*sparsity)(_2422_i)) % _2419_dim1),_2418_dim0 ) );
              ++ _ptr__2417_ptr[_2423_ii];
            }
          }
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*shape)((int)1))),(int32_t)(((*shape)((int)0)))}),_2413_sp,_2412_idxs)).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.BaseVariable.transpose

// Begin mosek.fusion.BaseVariable.index
// Method mosek.fusion.BaseVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:619:6-622:40
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__index(int32_t _2424_i0,int32_t _2425_i1,int32_t _2426_i2) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__index(_2424_i0,_2425_i1,_2426_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::index(int32_t _2424_i0,int32_t _2425_i1,int32_t _2426_i2) { return __mosek_2fusion_2BaseVariable__index(_2424_i0,_2425_i1,_2426_i2); }
/* override: mosek.fusion.Variable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__index(int32_t _2424_i0,int32_t _2425_i1,int32_t _2426_i2) { return __mosek_2fusion_2BaseVariable__index(_2424_i0,_2425_i1,_2426_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__index(int32_t _2424_i0,int32_t _2425_i1,int32_t _2426_i2)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2424_i0),(int32_t)(_2425_i1),(int32_t)(_2426_i2)}));
}
// End mosek.fusion.BaseVariable.index

// Begin mosek.fusion.BaseVariable.index
// Method mosek.fusion.BaseVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:614:6-616:37
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__index(int32_t _2427_i0,int32_t _2428_i1) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__index(_2427_i0,_2428_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::index(int32_t _2427_i0,int32_t _2428_i1) { return __mosek_2fusion_2BaseVariable__index(_2427_i0,_2428_i1); }
/* override: mosek.fusion.Variable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__index(int32_t _2427_i0,int32_t _2428_i1) { return __mosek_2fusion_2BaseVariable__index(_2427_i0,_2428_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__index(int32_t _2427_i0,int32_t _2428_i1)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2427_i0),(int32_t)(_2428_i1)}));
}
// End mosek.fusion.BaseVariable.index

// Begin mosek.fusion.BaseVariable.index
// Method mosek.fusion.BaseVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:606:6-611:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2429_index) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__index(_2429_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2429_index) { return __mosek_2fusion_2BaseVariable__index(_2429_index); }
/* override: mosek.fusion.Variable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2429_index) { return __mosek_2fusion_2BaseVariable__index(_2429_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2429_index)
{
  _checked_ptr_1<int32_t> _ptr__2429_index(_2429_index ? _2429_index->raw() : nullptr, _2429_index ? _2429_index->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,2 > > _2430_midx = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)1,(int)((_2429_index)->size(0)))));
  int32_t _10220_ = (int)0;
  int32_t _10221_ = (int)((_2429_index)->size(0));
  for (int32_t _2431_i = _10220_; _2431_i < _10221_; ++_2431_i)
  {
    {
      ((*_2430_midx)((int)0,_2431_i)) = _ptr__2429_index[_2431_i];
    }
  }
  return _pubthis->__mosek_2fusion_2BaseVariable__pick(_2430_midx)->__mosek_2fusion_2Variable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))));
}
// End mosek.fusion.BaseVariable.index

// Begin mosek.fusion.BaseVariable.index
// Method mosek.fusion.BaseVariable.index @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:600:6-603:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__index(int32_t _2432_index) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__index(_2432_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::index(int32_t _2432_index) { return __mosek_2fusion_2BaseVariable__index(_2432_index); }
/* override: mosek.fusion.Variable.index*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__index(int32_t _2432_index) { return __mosek_2fusion_2BaseVariable__index(_2432_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__index(int32_t _2432_index)
{
  return _pubthis->__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2432_index)}))->__mosek_2fusion_2Variable__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))));
}
// End mosek.fusion.BaseVariable.index

// Begin mosek.fusion.BaseVariable.pick
// Method mosek.fusion.BaseVariable.pick @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:579:6-597:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2433_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2434_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2435_i2) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__pick(_2433_i0,_2434_i1,_2435_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2433_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2434_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2435_i2) { return __mosek_2fusion_2BaseVariable__pick(_2433_i0,_2434_i1,_2435_i2); }
/* override: mosek.fusion.Variable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2433_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2434_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2435_i2) { return __mosek_2fusion_2BaseVariable__pick(_2433_i0,_2434_i1,_2435_i2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2433_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2434_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2435_i2)
{
  _checked_ptr_1<int32_t> _ptr__2433_i0(_2433_i0 ? _2433_i0->raw() : nullptr, _2433_i0 ? _2433_i0->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2434_i1(_2434_i1 ? _2434_i1->raw() : nullptr, _2434_i1 ? _2434_i1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2435_i2(_2435_i2 ? _2435_i2->raw() : nullptr, _2435_i2 ? _2435_i2->size(0) : 0);
  if (((int)((shape)->size(0)) != (int)3))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  if ((((int)((_2433_i0)->size(0)) != (int)((_2434_i1)->size(0))) || ((int)((_2433_i0)->size(0)) != (int)((_2435_i2)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching argument lengths"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,2 > > _2436_midxs = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_2433_i0)->size(0)),(int)3)));
  int32_t _10222_ = (int)0;
  int32_t _10223_ = (int)((_2433_i0)->size(0));
  for (int32_t _2437_i = _10222_; _2437_i < _10223_; ++_2437_i)
  {
    {
      ((*_2436_midxs)(_2437_i,(int)0)) = _ptr__2433_i0[_2437_i];
      ((*_2436_midxs)(_2437_i,(int)1)) = _ptr__2434_i1[_2437_i];
      ((*_2436_midxs)(_2437_i,(int)2)) = _ptr__2435_i2[_2437_i];
    }
  }
  return _pubthis->__mosek_2fusion_2BaseVariable__pick(_2436_midxs);
}
// End mosek.fusion.BaseVariable.pick

// Begin mosek.fusion.BaseVariable.pick
// Method mosek.fusion.BaseVariable.pick @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:563:6-577:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2438_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2439_i1) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__pick(_2438_i0,_2439_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2438_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2439_i1) { return __mosek_2fusion_2BaseVariable__pick(_2438_i0,_2439_i1); }
/* override: mosek.fusion.Variable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2438_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2439_i1) { return __mosek_2fusion_2BaseVariable__pick(_2438_i0,_2439_i1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2438_i0,std::shared_ptr< monty::ndarray< int32_t,1 > > _2439_i1)
{
  _checked_ptr_1<int32_t> _ptr__2438_i0(_2438_i0 ? _2438_i0->raw() : nullptr, _2438_i0 ? _2438_i0->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2439_i1(_2439_i1 ? _2439_i1->raw() : nullptr, _2439_i1 ? _2439_i1->size(0) : 0);
  if ((((int)((shape)->size(0)) != (int)2) || ((int)((_2438_i0)->size(0)) != (int)((_2439_i1)->size(0)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,2 > > _2440_midxs = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_2438_i0)->size(0)),(int)2)));
  int32_t _10224_ = (int)0;
  int32_t _10225_ = (int)((_2438_i0)->size(0));
  for (int32_t _2441_i = _10224_; _2441_i < _10225_; ++_2441_i)
  {
    {
      ((*_2440_midxs)(_2441_i,(int)0)) = _ptr__2438_i0[_2441_i];
      ((*_2440_midxs)(_2441_i,(int)1)) = _ptr__2439_i1[_2441_i];
    }
  }
  return _pubthis->__mosek_2fusion_2BaseVariable__pick(_2440_midxs);
}
// End mosek.fusion.BaseVariable.pick

// Begin mosek.fusion.BaseVariable.pick
// Method mosek.fusion.BaseVariable.pick @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:502:6-561:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2442_midxs) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__pick(_2442_midxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2442_midxs) { return __mosek_2fusion_2BaseVariable__pick(_2442_midxs); }
/* override: mosek.fusion.Variable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2442_midxs) { return __mosek_2fusion_2BaseVariable__pick(_2442_midxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2442_midxs)
{
  if (((int)((shape)->size(0)) != (int)((_2442_midxs)->size(1))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  bool _2443_invalidindex = false;
  int32_t _10226_ = (int)0;
  int32_t _10227_ = (int)((_2442_midxs)->size(0));
  for (int32_t _2444_i = _10226_; _2444_i < _10227_; ++_2444_i)
  {
    {
      int32_t _10228_ = (int)0;
      int32_t _10229_ = (int)((_2442_midxs)->size(1));
      for (int32_t _2445_j = _10228_; _2445_j < _10229_; ++_2445_j)
      {
        {
          if (((((*_2442_midxs)(_2444_i,_2445_j)) < (int)0) || (((*_2442_midxs)(_2444_i,_2445_j)) >= ((*shape)(_2445_j)))))
          {
            {
              _2443_invalidindex = true;
            }
          }
          {}
        }
      }
    }
  }
  if (_2443_invalidindex)
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  int32_t _2446_nd = (int)((shape)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2447_strides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2446_nd)));
  _checked_ptr_1<int64_t> _ptr__2447_strides(_2447_strides ? _2447_strides->raw() : nullptr,_2447_strides ? _2447_strides->size(0) : 0);
  _ptr__2447_strides[(_2446_nd - (int)1)] = (int)1;
  int32_t _10230_ = (int)1;
  int32_t _10231_ = _2446_nd;
  for (int32_t _2448_i = _10230_; _2448_i < _10231_; ++_2448_i)
  {
    {
      _ptr__2447_strides[((_2446_nd - _2448_i) - (int)1)] = safe_mul( _ptr__2447_strides[(_2446_nd - _2448_i)],((*shape)((_2446_nd - _2448_i))) );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2449_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_2442_midxs)->size(0)))});
  _checked_ptr_1<int32_t> _ptr__2449_rshape(_2449_rshape ? _2449_rshape->raw() : nullptr,_2449_rshape ? _2449_rshape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2450_idxs;
  _checked_ptr_1<int64_t> _ptr__2450_idxs(_2450_idxs ? _2450_idxs->raw() : nullptr,_2450_idxs ? _2450_idxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2451_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__2451_sp(_2451_sp ? _2451_sp->raw() : nullptr,_2451_sp ? _2451_sp->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      _2450_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_2442_midxs)->size(0)))));
      _ptr__2450_idxs.update(_2450_idxs ? _2450_idxs->raw() : nullptr, _2450_idxs ? _2450_idxs->size(0) : 0);
      {
        int32_t _10232_ = (int)0;
        int32_t _10233_ = (int)((_2442_midxs)->size(0));
        for (int32_t _2452_i = _10232_; _2452_i < _10233_; ++_2452_i)
        {
          {
            int64_t _2453_ii = (int64_t)0;
            int32_t _10234_ = (int)0;
            int32_t _10235_ = _2446_nd;
            for (int32_t _2454_j = _10234_; _2454_j < _10235_; ++_2454_j)
            {
              {
                _2453_ii += safe_mul( _ptr__2447_strides[_2454_j],((*_2442_midxs)(_2452_i,_2454_j)) );
              }
            }
            _ptr__2450_idxs[_2452_i] = ((*basevar_nativeidxs)(_2453_ii));
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _2455_nnz = (int)0;
      int32_t _10236_ = (int)0;
      int32_t _10237_ = (int)((_2442_midxs)->size(0));
      for (int32_t _2456_i = _10236_; _2456_i < _10237_; ++_2456_i)
      {
        {
          int64_t _2457_ii = (int64_t)0;
          int32_t _10238_ = (int)0;
          int32_t _10239_ = _2446_nd;
          for (int32_t _2458_j = _10238_; _2458_j < _10239_; ++_2458_j)
          {
            {
              _2457_ii += safe_mul( _ptr__2447_strides[_2458_j],((*_2442_midxs)(_2456_i,_2458_j)) );
            }
          }
          if ((::mosek::fusion::p_CommonTools::binarySearch(sparsity,_2457_ii) >= (int)0))
          {
            {
              ++ _2455_nnz;
            }
          }
          {}
        }
      }
      _2450_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2455_nnz)));
      _ptr__2450_idxs.update(_2450_idxs ? _2450_idxs->raw() : nullptr, _2450_idxs ? _2450_idxs->size(0) : 0);
      _2451_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2455_nnz)));
      _ptr__2451_sp.update(_2451_sp ? _2451_sp->raw() : nullptr, _2451_sp ? _2451_sp->size(0) : 0);
      {
        int32_t _2459_k = (int)0;
        int32_t _10240_ = (int)0;
        int32_t _10241_ = (int)((_2442_midxs)->size(0));
        for (int32_t _2460_i = _10240_; _2460_i < _10241_; ++_2460_i)
        {
          {
            int64_t _2461_ii = (int64_t)0;
            int32_t _10242_ = (int)0;
            int32_t _10243_ = _2446_nd;
            for (int32_t _2462_j = _10242_; _2462_j < _10243_; ++_2462_j)
            {
              {
                _2461_ii += safe_mul( _ptr__2447_strides[_2462_j],((*_2442_midxs)(_2460_i,_2462_j)) );
              }
            }
            int32_t _2463_iidx = ::mosek::fusion::p_CommonTools::binarySearch(sparsity,_2461_ii);
            if ((_2463_iidx >= (int)0))
            {
              {
                _ptr__2450_idxs[_2459_k] = ((*basevar_nativeidxs)(_2463_iidx));
                _ptr__2451_sp[_2459_k] = _2460_i;
                ++ _2459_k;
              }
            }
            {}
          }
        }
      }
      if ((_2455_nnz == (int)((_2442_midxs)->size(0))))
      {
        {
          _2451_sp = nullptr;
          _ptr__2451_sp.update(_2451_sp ? _2451_sp->raw() : nullptr, _2451_sp ? _2451_sp->size(0) : 0);
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2449_rshape,_2451_sp,_2450_idxs)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BaseVariable.pick

// Begin mosek.fusion.BaseVariable.pick
// Method mosek.fusion.BaseVariable.pick @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:460:6-500:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2464_idxs) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__pick(_2464_idxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2464_idxs) { return __mosek_2fusion_2BaseVariable__pick(_2464_idxs); }
/* override: mosek.fusion.Variable.pick*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2464_idxs) { return __mosek_2fusion_2BaseVariable__pick(_2464_idxs); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2464_idxs)
{
  _checked_ptr_1<int32_t> _ptr__2464_idxs(_2464_idxs ? _2464_idxs->raw() : nullptr, _2464_idxs ? _2464_idxs->size(0) : 0);
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  bool _2465_invalidindex = false;
  int32_t _10244_ = (int)0;
  int32_t _10245_ = (int)((_2464_idxs)->size(0));
  for (int32_t _2466_i = _10244_; _2466_i < _10245_; ++_2466_i)
  {
    {
      if (((_ptr__2464_idxs[_2466_i] < (int)0) || (_ptr__2464_idxs[_2466_i] >= ((*shape)((int)0)))))
      {
        {
          _2465_invalidindex = true;
        }
      }
      {}
    }
  }
  if (_2465_invalidindex)
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2467_nidxs;
  _checked_ptr_1<int64_t> _ptr__2467_nidxs(_2467_nidxs ? _2467_nidxs->raw() : nullptr,_2467_nidxs ? _2467_nidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2468_sp = nullptr;
  _checked_ptr_1<int64_t> _ptr__2468_sp(_2468_sp ? _2468_sp->raw() : nullptr,_2468_sp ? _2468_sp->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      std::vector<int64_t> _10246_;
      for (int32_t _2469_i = (int)0, _10247_ = (int)((_2464_idxs)->size(0)); _2469_i < _10247_ ; ++_2469_i)
      {
        _10246_.push_back(((*basevar_nativeidxs)(_ptr__2464_idxs[_2469_i])));
      }
      auto _10248_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10246_.size()),_10246_.begin(),_10246_.end()));
      _2467_nidxs = _10248_;
      _ptr__2467_nidxs.update(_2467_nidxs ? _2467_nidxs->raw() : nullptr, _2467_nidxs ? _2467_nidxs->size(0) : 0);
    }
  }
  else
  {
    {
      int32_t _2470_nnz = (int)0;
      int32_t _10249_ = (int)0;
      int32_t _10250_ = (int)((_2464_idxs)->size(0));
      for (int32_t _2471_i = _10249_; _2471_i < _10250_; ++_2471_i)
      {
        {
          if ((::mosek::fusion::p_CommonTools::binarySearch(sparsity,(int64_t)(_ptr__2464_idxs[_2471_i])) >= (int)0))
          {
            {
              ++ _2470_nnz;
            }
          }
          {}
        }
      }
      _2467_nidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2470_nnz)));
      _ptr__2467_nidxs.update(_2467_nidxs ? _2467_nidxs->raw() : nullptr, _2467_nidxs ? _2467_nidxs->size(0) : 0);
      _2468_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2470_nnz)));
      _ptr__2468_sp.update(_2468_sp ? _2468_sp->raw() : nullptr, _2468_sp ? _2468_sp->size(0) : 0);
      int32_t _2472_k = (int)0;
      int32_t _10251_ = (int)0;
      int32_t _10252_ = (int)((_2464_idxs)->size(0));
      for (int32_t _2473_i = _10251_; _2473_i < _10252_; ++_2473_i)
      {
        {
          int32_t _2474_j = ::mosek::fusion::p_CommonTools::binarySearch(sparsity,(int64_t)(_ptr__2464_idxs[_2473_i]));
          if ((_2474_j >= (int)0))
          {
            {
              _ptr__2468_sp[_2472_k] = _2473_i;
              _ptr__2467_nidxs[_2472_k] = ((*basevar_nativeidxs)(_2474_j));
              ++ _2472_k;
            }
          }
          {}
        }
      }
      if ((_2470_nnz == (int)((_2464_idxs)->size(0))))
      {
        {
          _2468_sp = nullptr;
          _ptr__2468_sp.update(_2468_sp ? _2468_sp->raw() : nullptr, _2468_sp ? _2468_sp->size(0) : 0);
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_2464_idxs)->size(0)))}),_2468_sp,_2467_nidxs)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.BaseVariable.pick

// Begin mosek.fusion.BaseVariable.antidiag
// Method mosek.fusion.BaseVariable.antidiag @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:446:6-457:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__antidiag(int32_t _2475_index) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__antidiag(_2475_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::antidiag(int32_t _2475_index) { return __mosek_2fusion_2BaseVariable__antidiag(_2475_index); }
/* override: mosek.fusion.Variable.antidiag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__antidiag(int32_t _2475_index) { return __mosek_2fusion_2BaseVariable__antidiag(_2475_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__antidiag(int32_t _2475_index)
{
  if (((int)((shape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("antidiag() only works on two-dimensional objects"));
    }
  }
  else if(((_2475_index >= ((*shape)((int)1))) || ((-_2475_index) >= ((*shape)((int)2)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Diagonal index out of bounds"));
    }
  }
  {}
  if ((_2475_index >= (int)0))
  {
    {
      int32_t _10253_;
      bool _10254_ = (((*shape)((int)0)) < (((*shape)((int)1)) - _2475_index));
      if (_10254_)
      {
        _10253_ = ((*shape)((int)0));
      }
      else
      {
        _10253_ = (((*shape)((int)1)) - _2475_index);
      }
      return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0),(int32_t)(((((*shape)((int)1)) - (int)1) - _2475_index))}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((-(int)1))}),_10253_);
    }
  }
  else
  {
    {
      int32_t _10255_;
      bool _10256_ = (((*shape)((int)1)) < safe_add( ((*shape)((int)0)),_2475_index ));
      if (_10256_)
      {
        _10255_ = ((*shape)((int)1));
      }
      else
      {
        _10255_ = safe_add( ((*shape)((int)0)),_2475_index );
      }
      return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((-_2475_index)),(int32_t)((((*shape)((int)1)) - (int)1))}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((-(int)1))}),_10255_);
    }
  }
}
// End mosek.fusion.BaseVariable.antidiag

// Begin mosek.fusion.BaseVariable.antidiag
// Method mosek.fusion.BaseVariable.antidiag @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:438:6-444:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__antidiag() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__antidiag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::antidiag() { return __mosek_2fusion_2BaseVariable__antidiag(); }
/* override: mosek.fusion.Variable.antidiag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__antidiag() { return __mosek_2fusion_2BaseVariable__antidiag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__antidiag()
{
  if (((int)((shape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("antidiag() only works on two-dimensional objects"));
    }
  }
  {}
  int32_t _10257_;
  bool _10258_ = (((*shape)((int)0)) < ((*shape)((int)1)));
  if (_10258_)
  {
    _10257_ = ((*shape)((int)0));
  }
  else
  {
    _10257_ = ((*shape)((int)1));
  }
  return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0),(int32_t)((((*shape)((int)1)) - (int)1))}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((-(int)1))}),_10257_);
}
// End mosek.fusion.BaseVariable.antidiag

// Begin mosek.fusion.BaseVariable.diag
// Method mosek.fusion.BaseVariable.diag @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:425:6-436:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__diag(int32_t _2476_index) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__diag(_2476_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::diag(int32_t _2476_index) { return __mosek_2fusion_2BaseVariable__diag(_2476_index); }
/* override: mosek.fusion.Variable.diag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__diag(int32_t _2476_index) { return __mosek_2fusion_2BaseVariable__diag(_2476_index); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__diag(int32_t _2476_index)
{
  if (((int)((shape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("diag() only works on two-dimensional objects"));
    }
  }
  else if(((_2476_index >= ((*shape)((int)1))) || ((-_2476_index) >= ((*shape)((int)2)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Diagonal index out of bounds"));
    }
  }
  {}
  if ((_2476_index >= (int)0))
  {
    {
      int32_t _10259_;
      bool _10260_ = (((*shape)((int)0)) < (((*shape)((int)1)) - _2476_index));
      if (_10260_)
      {
        _10259_ = ((*shape)((int)0));
      }
      else
      {
        _10259_ = (((*shape)((int)1)) - _2476_index);
      }
      return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0),(int32_t)(_2476_index)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((int)1)}),_10259_);
    }
  }
  else
  {
    {
      int32_t _10261_;
      bool _10262_ = (((*shape)((int)1)) < safe_add( ((*shape)((int)0)),_2476_index ));
      if (_10262_)
      {
        _10261_ = ((*shape)((int)1));
      }
      else
      {
        _10261_ = safe_add( ((*shape)((int)0)),_2476_index );
      }
      return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((-_2476_index)),(int32_t)((int)0)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((int)1)}),_10261_);
    }
  }
}
// End mosek.fusion.BaseVariable.diag

// Begin mosek.fusion.BaseVariable.diag
// Method mosek.fusion.BaseVariable.diag @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:418:6-423:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__diag() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__diag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::diag() { return __mosek_2fusion_2BaseVariable__diag(); }
/* override: mosek.fusion.Variable.diag*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__diag() { return __mosek_2fusion_2BaseVariable__diag(); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__diag()
{
  if (((int)((shape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("diag() only works on two-dimensional objects"));
    }
  }
  {}
  int32_t _10263_;
  bool _10264_ = (((*shape)((int)0)) < ((*shape)((int)1)));
  if (_10264_)
  {
    _10263_ = ((*shape)((int)0));
  }
  else
  {
    _10263_ = ((*shape)((int)1));
  }
  return __mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0),(int32_t)((int)0)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((int)1)}),_10263_);
}
// End mosek.fusion.BaseVariable.diag

// Begin mosek.fusion.BaseVariable.general_diag
// Method mosek.fusion.BaseVariable.general_diag @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:368:6-415:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__general_diag(std::shared_ptr< monty::ndarray< int32_t,1 > > _2477_firstidx,std::shared_ptr< monty::ndarray< int32_t,1 > > _2478_step,int32_t _2479_num)
{
  _checked_ptr_1<int32_t> _ptr__2477_firstidx(_2477_firstidx ? _2477_firstidx->raw() : nullptr, _2477_firstidx ? _2477_firstidx->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2478_step(_2478_step ? _2478_step->raw() : nullptr, _2478_step ? _2478_step->size(0) : 0);
  int32_t _2480_nd = (int)((shape)->size(0));
  if (((_2480_nd != (int)((_2477_firstidx)->size(0))) || (_2480_nd != (int)((_2478_step)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid start or step definition"));
    }
  }
  {}
  int32_t _10265_ = (int)0;
  int32_t _10266_ = _2480_nd;
  for (int32_t _2481_i = _10265_; _2481_i < _10266_; ++_2481_i)
  {
    {
      if (((_ptr__2477_firstidx[_2481_i] < (int)0) || (_ptr__2477_firstidx[_2481_i] >= ((*shape)(_2481_i)))))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Start element is out of bounds"));
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2482_strides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2480_nd)));
  _checked_ptr_1<int64_t> _ptr__2482_strides(_2482_strides ? _2482_strides->raw() : nullptr,_2482_strides ? _2482_strides->size(0) : 0);
  _ptr__2482_strides[(_2480_nd - (int)1)] = (int)1;
  int32_t _10267_ = (int)1;
  int32_t _10268_ = _2480_nd;
  for (int32_t _2483_i = _10267_; _2483_i < _10268_; ++_2483_i)
  {
    {
      _ptr__2482_strides[((_2480_nd - _2483_i) - (int)1)] = safe_mul( _ptr__2482_strides[(_2480_nd - _2483_i)],((*shape)((_2480_nd - _2483_i))) );
    }
  }
  int64_t _2484_startidx = (int64_t)0;
  int32_t _10269_ = (int)0;
  int32_t _10270_ = (int)((_2478_step)->size(0));
  for (int32_t _2485_i = _10269_; _2485_i < _10270_; ++_2485_i)
  {
    {
      _2484_startidx += safe_mul( _ptr__2477_firstidx[_2485_i],_ptr__2482_strides[_2485_i] );
    }
  }
  int64_t _2486_stepstride = (int64_t)0;
  int32_t _10271_ = (int)0;
  int32_t _10272_ = (int)((_2478_step)->size(0));
  for (int32_t _2487_i = _10271_; _2487_i < _10272_; ++_2487_i)
  {
    {
      _2486_stepstride += safe_mul( _ptr__2478_step[_2487_i],_ptr__2482_strides[_2487_i] );
    }
  }
  if ((NULL == sparsity.get()))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2488_residxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2479_num)));
      _checked_ptr_1<int64_t> _ptr__2488_residxs(_2488_residxs ? _2488_residxs->raw() : nullptr,_2488_residxs ? _2488_residxs->size(0) : 0);
      int32_t _10273_ = (int)0;
      int32_t _10274_ = _2479_num;
      for (int32_t _2489_i = _10273_; _2489_i < _10274_; ++_2489_i)
      {
        {
          _ptr__2488_residxs[_2489_i] = ((*basevar_nativeidxs)(safe_add( _2484_startidx,safe_mul( _2486_stepstride,_2489_i ) )));
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2479_num)}),nullptr,_2488_residxs)).as<::mosek::fusion::Variable>();
    }
  }
  else
  {
    {
      int32_t _2490_numnz = (int)0;
      int32_t _10275_ = (int)0;
      int32_t _10276_ = _2479_num;
      for (int32_t _2491_i = _10275_; _2491_i < _10276_; ++_2491_i)
      {
        {
          int64_t _2492_residx = safe_add( _2484_startidx,safe_mul( _2486_stepstride,_2491_i ) );
          int32_t _2493_spidx = ::mosek::fusion::p_CommonTools::binarySearch(sparsity,_2492_residx);
          if ((_2493_spidx >= (int)0))
          {
            {
              ++ _2490_numnz;
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2494_residxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2490_numnz)));
      _checked_ptr_1<int64_t> _ptr__2494_residxs(_2494_residxs ? _2494_residxs->raw() : nullptr,_2494_residxs ? _2494_residxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2495_ressp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2490_numnz)));
      _checked_ptr_1<int64_t> _ptr__2495_ressp(_2495_ressp ? _2495_ressp->raw() : nullptr,_2495_ressp ? _2495_ressp->size(0) : 0);
      int32_t _2496_k = (int)0;
      int32_t _10277_ = (int)0;
      int32_t _10278_ = _2479_num;
      for (int32_t _2497_i = _10277_; _2497_i < _10278_; ++_2497_i)
      {
        {
          _ptr__2494_residxs[_2497_i] = ((*basevar_nativeidxs)(safe_add( _2484_startidx,safe_mul( _2486_stepstride,_2497_i ) )));
          int64_t _2498_residx = safe_add( _2484_startidx,safe_mul( _2486_stepstride,_2497_i ) );
          int32_t _2499_spidx = ::mosek::fusion::p_CommonTools::binarySearch(sparsity,_2498_residx);
          if ((_2499_spidx >= (int)0))
          {
            {
              _ptr__2495_ressp[_2496_k] = _2497_i;
              _ptr__2494_residxs[_2496_k] = ((*basevar_nativeidxs)(_2499_spidx));
              ++ _2496_k;
            }
          }
          {}
        }
      }
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2479_num)}),_2495_ressp,_2494_residxs)).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.BaseVariable.general_diag

// Begin mosek.fusion.BaseVariable.slice
// Method mosek.fusion.BaseVariable.slice @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:260:6-357:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2500_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2501_last) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__slice(_2500_first,_2501_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2500_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2501_last) { return __mosek_2fusion_2BaseVariable__slice(_2500_first,_2501_last); }
/* override: mosek.fusion.Variable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2500_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2501_last) { return __mosek_2fusion_2BaseVariable__slice(_2500_first,_2501_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2500_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _2501_last)
{
  _checked_ptr_1<int32_t> _ptr__2500_first(_2500_first ? _2500_first->raw() : nullptr, _2500_first ? _2500_first->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2501_last(_2501_last ? _2501_last->raw() : nullptr, _2501_last ? _2501_last->size(0) : 0);
  if (((int)((_2500_first)->size(0)) != (int)((_2501_last)->size(0))))
  {
    {
      throw ::mosek::fusion::SliceError(std::string ("Invalid slice"));
    }
  }
  else if(((int)((_2500_first)->size(0)) != (int)((shape)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Variable shape and slice do not match"));
    }
  }
  else
  {
    {
      int32_t _10279_ = (int)0;
      int32_t _10280_ = (int)((shape)->size(0));
      for (int32_t _2502_i = _10279_; _2502_i < _10280_; ++_2502_i)
      {
        {
          if (((_ptr__2500_first[_2502_i] < (int)0) || (_ptr__2501_last[_2502_i] > ((*shape)(_2502_i)))))
          {
            {
              throw ::mosek::fusion::IndexError(std::string ("Slice is out of bounds"));
            }
          }
          else if((_ptr__2500_first[_2502_i] > _ptr__2501_last[_2502_i]))
          {
            {
              throw ::mosek::fusion::SliceError(std::string ("Invalid slice"));
            }
          }
          {}
        }
      }
      int32_t _2503_nd = (int)((shape)->size(0));
      std::vector<int32_t> _10281_;
      for (int32_t _2505_i = (int)0, _10282_ = _2503_nd; _2505_i < _10282_ ; ++_2505_i)
      {
        _10281_.push_back((_ptr__2501_last[_2505_i] - _ptr__2500_first[_2505_i]));
      }
      auto _10283_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10281_.size()),_10281_.begin(),_10281_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2504_sliceshape = _10283_;
      _checked_ptr_1<int32_t> _ptr__2504_sliceshape(_2504_sliceshape ? _2504_sliceshape->raw() : nullptr,_2504_sliceshape ? _2504_sliceshape->size(0) : 0);
      int32_t _2506_slicesize = (int)1;
      int32_t _10284_ = (int)0;
      int32_t _10285_ = _2503_nd;
      for (int32_t _2507_i = _10284_; _2507_i < _10285_; ++_2507_i)
      {
        {
          _2506_slicesize *= (_ptr__2501_last[_2507_i] - _ptr__2500_first[_2507_i]);
        }
      }
      if ((_2506_slicesize == (int)0))
      {
        {
          return (::mosek::fusion::p_NilVariable::_new_NilVariable()).as<::mosek::fusion::Variable>();
        }
      }
      else if((NULL != sparsity.get()))
      {
        {
          int32_t _2508_nnz = (int)0;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2509_key = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2503_nd)));
          _checked_ptr_1<int32_t> _ptr__2509_key(_2509_key ? _2509_key->raw() : nullptr,_2509_key ? _2509_key->size(0) : 0);
          int32_t _10286_ = (int)0;
          int32_t _10287_ = (int)((sparsity)->size(0));
          for (int32_t _2510_i = _10286_; _2510_i < _10287_; ++_2510_i)
          {
            {
              int64_t _2511_rem = ((*sparsity)(_2510_i));
              int32_t _10288_ = (int)1;
              int32_t _10289_ = _2503_nd;
              for (int32_t _2512_k = _10288_; _2512_k < _10289_; ++_2512_k)
              {
                {
                  _ptr__2509_key[(_2503_nd - _2512_k)] = (int32_t)(_2511_rem % ((*shape)((_2503_nd - _2512_k))));
                  _2511_rem /= ((*shape)((_2503_nd - _2512_k)));
                }
              }
              _ptr__2509_key[(int)0] = (int32_t)_2511_rem;
              int32_t _2513_k = (int)0;
              while ( ((_ptr__2509_key[_2513_k] >= _ptr__2500_first[_2513_k]) && (_ptr__2509_key[_2513_k] < _ptr__2501_last[_2513_k])) )
              {
                {
                  ++ _2513_k;
                }
              }
              if ((_2513_k == _2503_nd))
              {
                {
                  ++ _2508_nnz;
                }
              }
              {}
            }
          }
          int32_t _2514_idx = (int)0;
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2515_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2508_nnz)));
          _checked_ptr_1<int64_t> _ptr__2515_idxs(_2515_idxs ? _2515_idxs->raw() : nullptr,_2515_idxs ? _2515_idxs->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2516_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2508_nnz)));
          _checked_ptr_1<int64_t> _ptr__2516_sp(_2516_sp ? _2516_sp->raw() : nullptr,_2516_sp ? _2516_sp->size(0) : 0);
          int32_t _10290_ = (int)0;
          int32_t _10291_ = (int)((sparsity)->size(0));
          for (int32_t _2517_i = _10290_; _2517_i < _10291_; ++_2517_i)
          {
            {
              int64_t _2518_rem = ((*sparsity)(_2517_i));
              int32_t _10292_ = (int)1;
              int32_t _10293_ = _2503_nd;
              for (int32_t _2519_k = _10292_; _2519_k < _10293_; ++_2519_k)
              {
                {
                  _ptr__2509_key[(_2503_nd - _2519_k)] = (int32_t)(_2518_rem % ((*shape)((_2503_nd - _2519_k))));
                  _2518_rem /= ((*shape)((_2503_nd - _2519_k)));
                }
              }
              _ptr__2509_key[(int)0] = (int32_t)_2518_rem;
              int32_t _2520_k = (int)0;
              while ( ((_ptr__2509_key[_2520_k] >= _ptr__2500_first[_2520_k]) && (_ptr__2509_key[_2520_k] < _ptr__2501_last[_2520_k])) )
              {
                {
                  ++ _2520_k;
                }
              }
              if ((_2520_k == _2503_nd))
              {
                {
                  _ptr__2515_idxs[_2514_idx] = ((*basevar_nativeidxs)(_2517_i));
                  int32_t _2521_spidx = (int)0;
                  int32_t _10294_ = (int)0;
                  int32_t _10295_ = _2503_nd;
                  for (int32_t _2522_i = _10294_; _2522_i < _10295_; ++_2522_i)
                  {
                    {
                      _2521_spidx = safe_add( safe_mul( _2521_spidx,_ptr__2504_sliceshape[_2522_i] ),(_ptr__2509_key[_2522_i] - _ptr__2500_first[_2522_i]) );
                    }
                  }
                  _ptr__2516_sp[_2514_idx] = _2521_spidx;
                  ++ _2514_idx;
                }
              }
              {}
            }
          }
          return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2504_sliceshape,_2516_sp,_2515_idxs)).as<::mosek::fusion::Variable>();
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2523_sliceidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2506_slicesize)));
          _checked_ptr_1<int64_t> _ptr__2523_sliceidxs(_2523_sliceidxs ? _2523_sliceidxs->raw() : nullptr,_2523_sliceidxs ? _2523_sliceidxs->size(0) : 0);
          {
            std::shared_ptr< monty::ndarray< int32_t,1 > > _2524_strides = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2503_nd)));
            _checked_ptr_1<int32_t> _ptr__2524_strides(_2524_strides ? _2524_strides->raw() : nullptr,_2524_strides ? _2524_strides->size(0) : 0);
            _ptr__2524_strides[(_2503_nd - (int)1)] = (int)1;
            int32_t _10296_ = (int)1;
            int32_t _10297_ = _2503_nd;
            for (int32_t _2525_i = _10296_; _2525_i < _10297_; ++_2525_i)
            {
              {
                _ptr__2524_strides[((_2503_nd - _2525_i) - (int)1)] = safe_mul( _ptr__2524_strides[(_2503_nd - _2525_i)],((*shape)((_2503_nd - _2525_i))) );
              }
            }
            int32_t _2526_start = (int)0;
            int32_t _10298_ = (int)0;
            int32_t _10299_ = _2503_nd;
            for (int32_t _2527_i = _10298_; _2527_i < _10299_; ++_2527_i)
            {
              {
                _2526_start += safe_mul( _ptr__2500_first[_2527_i],_ptr__2524_strides[_2527_i] );
              }
            }
            std::vector<int32_t> _10300_;
            for (int32_t _2529_i = (int)0, _10301_ = _2503_nd; _2529_i < _10301_ ; ++_2529_i)
            {
              _10300_.push_back(_2526_start);
            }
            auto _10302_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10300_.size()),_10300_.begin(),_10300_.end()));
            std::shared_ptr< monty::ndarray< int32_t,1 > > _2528_pp = _10302_;
            _checked_ptr_1<int32_t> _ptr__2528_pp(_2528_pp ? _2528_pp->raw() : nullptr,_2528_pp ? _2528_pp->size(0) : 0);
            std::vector<int32_t> _10303_;
            for (int32_t _2531_i = (int)0, _10304_ = _2503_nd; _2531_i < _10304_ ; ++_2531_i)
            {
              _10303_.push_back(_ptr__2500_first[_2531_i]);
            }
            auto _10305_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10303_.size()),_10303_.begin(),_10303_.end()));
            std::shared_ptr< monty::ndarray< int32_t,1 > > _2530_ii = _10305_;
            _checked_ptr_1<int32_t> _ptr__2530_ii(_2530_ii ? _2530_ii->raw() : nullptr,_2530_ii ? _2530_ii->size(0) : 0);
            int32_t _10306_ = (int)0;
            int32_t _10307_ = _2506_slicesize;
            for (int32_t _2532_i = _10306_; _2532_i < _10307_; ++_2532_i)
            {
              {
                _ptr__2523_sliceidxs[_2532_i] = ((*basevar_nativeidxs)(_ptr__2528_pp[(_2503_nd - (int)1)]));
                _ptr__2530_ii[(_2503_nd - (int)1)] += (int)1;
                _ptr__2528_pp[(_2503_nd - (int)1)] += _ptr__2524_strides[(_2503_nd - (int)1)];
                if ((_ptr__2530_ii[(_2503_nd - (int)1)] >= _ptr__2501_last[(_2503_nd - (int)1)]))
                {
                  {
                    int32_t _2533_k = (_2503_nd - (int)1);
                    while ( ((_2533_k > (int)0) && (_ptr__2530_ii[_2533_k] >= _ptr__2501_last[_2533_k])) )
                    {
                      {
                        _ptr__2530_ii[_2533_k] = _ptr__2500_first[_2533_k];
                        _ptr__2530_ii[(_2533_k - (int)1)] += (int)1;
                        _ptr__2528_pp[(_2533_k - (int)1)] += _ptr__2524_strides[(_2533_k - (int)1)];
                        -- _2533_k;
                      }
                    }
                    int32_t _10308_ = safe_add( _2533_k,(int)1 );
                    int32_t _10309_ = _2503_nd;
                    for (int32_t _2534_k2 = _10308_; _2534_k2 < _10309_; ++_2534_k2)
                    {
                      {
                        _ptr__2528_pp[_2534_k2] = _ptr__2528_pp[_2533_k];
                      }
                    }
                  }
                }
                {}
              }
            }
          }
          return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),_2504_sliceshape,nullptr,_2523_sliceidxs)).as<::mosek::fusion::Variable>();
        }
      }
    }
  }
}
// End mosek.fusion.BaseVariable.slice

// Begin mosek.fusion.BaseVariable.slice
// Method mosek.fusion.BaseVariable.slice @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:228:6-257:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__slice(int32_t _2535_first,int32_t _2536_last) { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__slice(_2535_first,_2536_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::slice(int32_t _2535_first,int32_t _2536_last) { return __mosek_2fusion_2BaseVariable__slice(_2535_first,_2536_last); }
/* override: mosek.fusion.Variable.slice*/
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__slice(int32_t _2535_first,int32_t _2536_last) { return __mosek_2fusion_2BaseVariable__slice(_2535_first,_2536_last); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__slice(int32_t _2535_first,int32_t _2536_last)
{
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Variable shape and slice do not match"));
    }
  }
  {}
  if (((_2535_first == (int)0) && (_2536_last == ((*shape)((int)0)))))
  {
    {
      return (::mosek::fusion::BaseVariable::t(_pubthis)).as<::mosek::fusion::Variable>();
    }
  }
  else if(((_2535_first < (int)0) || (_2536_last > ((*shape)((int)0)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Slice is out of bounds"));
    }
  }
  else if((_2535_first > _2536_last))
  {
    {
      throw ::mosek::fusion::SliceError(std::string ("Invalid slice"));
    }
  }
  else if((_2535_first == _2536_last))
  {
    {
      return (::mosek::fusion::p_NilVariable::_new_NilVariable()).as<::mosek::fusion::Variable>();
    }
  }
  else if((NULL != sparsity.get()))
  {
    {
      int32_t _2537_slicesize = (_2536_last - _2535_first);
      int32_t _2538_nnz = (int)0;
      int32_t _2539_i0 = ::mosek::fusion::p_CommonTools::binarySearchL(sparsity,(int64_t)(_2535_first));
      int32_t _2540_i1 = ::mosek::fusion::p_CommonTools::binarySearchL(sparsity,(int64_t)(_2536_last));
      std::vector<int64_t> _10310_;
      for (int32_t _2541_i = _2539_i0, _10311_ = _2540_i1; _2541_i < _10311_ ; ++_2541_i)
      {
        _10310_.push_back((((*sparsity)(_2541_i)) - _2535_first));
      }
      auto _10312_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10310_.size()),_10310_.begin(),_10310_.end()));
      std::vector<int64_t> _10313_;
      for (int32_t _2542_i = _2539_i0, _10314_ = _2540_i1; _2542_i < _10314_ ; ++_2542_i)
      {
        _10313_.push_back(((*basevar_nativeidxs)(_2542_i)));
      }
      auto _10315_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10313_.size()),_10313_.begin(),_10313_.end()));
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2537_slicesize)}),_10312_,_10315_)).as<::mosek::fusion::Variable>();
    }
  }
  else
  {
    {
      int32_t _2543_slicesize = (_2536_last - _2535_first);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2544_sliceidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2543_slicesize)));
      _checked_ptr_1<int64_t> _ptr__2544_sliceidxs(_2544_sliceidxs ? _2544_sliceidxs->raw() : nullptr,_2544_sliceidxs ? _2544_sliceidxs->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(basevar_nativeidxs,_2535_first,_2544_sliceidxs,(int)0,_2543_slicesize);
      return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_pubthis->__mosek_2fusion_2BaseVariable__getModel(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2543_slicesize)}),nullptr,_2544_sliceidxs)).as<::mosek::fusion::Variable>();
    }
  }
}
// End mosek.fusion.BaseVariable.slice

// Begin mosek.fusion.BaseVariable.asExpr
// Method mosek.fusion.BaseVariable.asExpr @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:226:6-74
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseVariable :: __mosek_2fusion_2BaseVariable__asExpr() { return mosek::fusion::p_BaseVariable::_get_impl(this)->__mosek_2fusion_2BaseVariable__asExpr(); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseVariable::asExpr() { return __mosek_2fusion_2BaseVariable__asExpr(); }
/* override: mosek.fusion.Variable.asExpr*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseVariable::__mosek_2fusion_2Variable__asExpr() { return __mosek_2fusion_2BaseVariable__asExpr(); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseVariable::__mosek_2fusion_2BaseVariable__asExpr()
{
  return (::mosek::fusion::p_ExprFromVar::_new_ExprFromVar((::mosek::fusion::BaseVariable::t(_pubthis)).as<::mosek::fusion::Variable>())).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseVariable.asExpr

// Begin mosek.fusion.BaseVariable.inst
// Method mosek.fusion.BaseVariable.inst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:185:6-207:7
int32_t mosek::fusion::BaseVariable :: inst(int32_t _2545_spoffset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2546_sparsity,int32_t _2547_nioffset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2548_basevar_nativeidxs) { return mosek::fusion::p_BaseVariable::_get_impl(this)->inst(_2545_spoffset,_2546_sparsity,_2547_nioffset,_2548_basevar_nativeidxs); }
int32_t mosek::fusion::p_BaseVariable::inst(int32_t _2545_spoffset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2546_sparsity,int32_t _2547_nioffset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2548_basevar_nativeidxs)
{
  _checked_ptr_1<int64_t> _ptr__2546_sparsity(_2546_sparsity ? _2546_sparsity->raw() : nullptr, _2546_sparsity ? _2546_sparsity->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__2548_basevar_nativeidxs(_2548_basevar_nativeidxs ? _2548_basevar_nativeidxs->raw() : nullptr, _2548_basevar_nativeidxs ? _2548_basevar_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2549_thisnidxs = mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->basevar_nativeidxs;
  _checked_ptr_1<int64_t> _ptr__2549_thisnidxs(_2549_thisnidxs ? _2549_thisnidxs->raw() : nullptr,_2549_thisnidxs ? _2549_thisnidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2550_thissp = mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->sparsity;
  _checked_ptr_1<int64_t> _ptr__2550_thissp(_2550_thissp ? _2550_thissp->raw() : nullptr,_2550_thissp ? _2550_thissp->size(0) : 0);
  if ((NULL == _2550_thissp.get()))
  {
    {
      int32_t _10316_ = (int)0;
      int32_t _10317_ = (int)((_2549_thisnidxs)->size(0));
      for (int32_t _2551_i = _10316_; _2551_i < _10317_; ++_2551_i)
      {
        {
          _ptr__2546_sparsity[safe_add( _2551_i,_2545_spoffset )] = _2551_i;
          _ptr__2548_basevar_nativeidxs[safe_add( _2551_i,_2547_nioffset )] = _ptr__2549_thisnidxs[_2551_i];
        }
      }
    }
  }
  else
  {
    {
      int32_t _10318_ = (int)0;
      int32_t _10319_ = (int)((mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->sparsity)->size(0));
      for (int32_t _2552_i = _10318_; _2552_i < _10319_; ++_2552_i)
      {
        {
          _ptr__2546_sparsity[safe_add( _2545_spoffset,_2552_i )] = _ptr__2550_thissp[_2552_i];
          _ptr__2548_basevar_nativeidxs[safe_add( _2552_i,_2547_nioffset )] = _ptr__2549_thisnidxs[_2552_i];
        }
      }
    }
  }
  return (int)((mosek::fusion::p_BaseVariable::_get_impl(::mosek::fusion::BaseVariable::t(_pubthis))->basevar_nativeidxs)->size(0));
}
// End mosek.fusion.BaseVariable.inst

// Begin mosek.fusion.BaseVariable.numInst
// Method mosek.fusion.BaseVariable.numInst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:181:6-183:7
int32_t mosek::fusion::BaseVariable :: numInst() { return mosek::fusion::p_BaseVariable::_get_impl(this)->numInst(); }
int32_t mosek::fusion::p_BaseVariable::numInst()
{
  return (int)((basevar_nativeidxs)->size(0));
}
// End mosek.fusion.BaseVariable.numInst

// Begin mosek.fusion.BaseVariable.inst
// Method mosek.fusion.BaseVariable.inst @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:165:6-179:7
void mosek::fusion::BaseVariable :: inst(int32_t _2553_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2554_nindex) { mosek::fusion::p_BaseVariable::_get_impl(this)->inst(_2553_offset,_2554_nindex); }
void mosek::fusion::p_BaseVariable::inst(int32_t _2553_offset,std::shared_ptr< monty::ndarray< int64_t,1 > > _2554_nindex)
{
  _checked_ptr_1<int64_t> _ptr__2554_nindex(_2554_nindex ? _2554_nindex->raw() : nullptr, _2554_nindex ? _2554_nindex->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      int32_t _10320_ = (int)0;
      int32_t _10321_ = (int)((basevar_nativeidxs)->size(0));
      for (int32_t _2555_i = _10320_; _2555_i < _10321_; ++_2555_i)
      {
        {
          _ptr__2554_nindex[safe_add( _2553_offset,_2555_i )] = ((*basevar_nativeidxs)(_2555_i));
        }
      }
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2556_shape = _pubthis->getShape();
      _checked_ptr_1<int32_t> _ptr__2556_shape(_2556_shape ? _2556_shape->raw() : nullptr,_2556_shape ? _2556_shape->size(0) : 0);
      int32_t _2557_domsize = (int)1;
      int32_t _10322_ = (int)0;
      int32_t _10323_ = (int)((_2556_shape)->size(0));
      for (int32_t _2558_i = _10322_; _2558_i < _10323_; ++_2558_i)
      {
        {
          _2557_domsize *= _ptr__2556_shape[_2558_i];
        }
      }
      int32_t _10324_ = (int)0;
      int32_t _10325_ = _2557_domsize;
      for (int32_t _2559_i = _10324_; _2559_i < _10325_; ++_2559_i)
      {
        {
          _ptr__2554_nindex[safe_add( _2553_offset,_2559_i )] = (int)0;
        }
      }
      int32_t _10326_ = (int)0;
      int32_t _10327_ = (int)((sparsity)->size(0));
      for (int32_t _2560_i = _10326_; _2560_i < _10327_; ++_2560_i)
      {
        {
          _ptr__2554_nindex[safe_add( _2553_offset,((*sparsity)(_2560_i)) )] = ((*basevar_nativeidxs)(_2560_i));
        }
      }
    }
  }
}
// End mosek.fusion.BaseVariable.inst

// Begin mosek.fusion.BaseVariable.set_values
// Method mosek.fusion.BaseVariable.set_values @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:147:6-163:7
void mosek::fusion::BaseVariable :: set_values(std::shared_ptr< monty::ndarray< double,1 > > _2561_values,bool _2562_primal) { mosek::fusion::p_BaseVariable::_get_impl(this)->set_values(_2561_values,_2562_primal); }
void mosek::fusion::p_BaseVariable::set_values(std::shared_ptr< monty::ndarray< double,1 > > _2561_values,bool _2562_primal)
{
  _checked_ptr_1<double> _ptr__2561_values(_2561_values ? _2561_values->raw() : nullptr, _2561_values ? _2561_values->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      _pubthis->__mosek_2fusion_2BaseVariable__getModel()->setVariableValues(_2562_primal,basevar_nativeidxs,_2561_values);
    }
  }
  else
  {
    {
      int32_t _2563_varsize = (int)1;
      int32_t _10328_ = (int)0;
      int32_t _10329_ = (int)((shape)->size(0));
      for (int32_t _2564_i = _10328_; _2564_i < _10329_; ++_2564_i)
      {
        {
          _2563_varsize *= ((*shape)(_2564_i));
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2565_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2563_varsize)));
      _checked_ptr_1<int64_t> _ptr__2565_idxs(_2565_idxs ? _2565_idxs->raw() : nullptr,_2565_idxs ? _2565_idxs->size(0) : 0);
      int32_t _10330_ = (int)0;
      int32_t _10331_ = (int)((basevar_nativeidxs)->size(0));
      for (int32_t _2566_i = _10330_; _2566_i < _10331_; ++_2566_i)
      {
        {
          _ptr__2565_idxs[((*sparsity)(_2566_i))] = ((*basevar_nativeidxs)(_2566_i));
        }
      }
      _pubthis->__mosek_2fusion_2BaseVariable__getModel()->setVariableValues(_2562_primal,_2565_idxs,_2561_values);
    }
  }
}
// End mosek.fusion.BaseVariable.set_values

// Begin mosek.fusion.BaseVariable.dual_lu
// Method mosek.fusion.BaseVariable.dual_lu @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:131:6-144:7
void mosek::fusion::p_BaseVariable::dual_lu(int32_t _2567_offset,std::shared_ptr< monty::ndarray< double,1 > > _2568_target,bool _2569_lower)
{
  _checked_ptr_1<double> _ptr__2568_target(_2568_target ? _2568_target->raw() : nullptr, _2568_target ? _2568_target->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      model->getVariableDuals(_2569_lower,basevar_nativeidxs,_2568_target,_2567_offset);
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2570_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_pubthis->getSize())));
      _checked_ptr_1<int64_t> _ptr__2570_idxs(_2570_idxs ? _2570_idxs->raw() : nullptr,_2570_idxs ? _2570_idxs->size(0) : 0);
      int32_t _10332_ = (int)0;
      int32_t _10333_ = (int)((sparsity)->size(0));
      for (int32_t _2571_i = _10332_; _2571_i < _10333_; ++_2571_i)
      {
        {
          _ptr__2570_idxs[((*sparsity)(_2571_i))] = ((*basevar_nativeidxs)(_2571_i));
        }
      }
      model->getVariableDuals(_2569_lower,_2570_idxs,_2568_target,_2567_offset);
    }
  }
}
// End mosek.fusion.BaseVariable.dual_lu

// Begin mosek.fusion.BaseVariable.values
// Method mosek.fusion.BaseVariable.values @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:116:6-129:7
void mosek::fusion::BaseVariable :: values(int32_t _2572_offset,std::shared_ptr< monty::ndarray< double,1 > > _2573_target,bool _2574_primal) { mosek::fusion::p_BaseVariable::_get_impl(this)->values(_2572_offset,_2573_target,_2574_primal); }
void mosek::fusion::p_BaseVariable::values(int32_t _2572_offset,std::shared_ptr< monty::ndarray< double,1 > > _2573_target,bool _2574_primal)
{
  _checked_ptr_1<double> _ptr__2573_target(_2573_target ? _2573_target->raw() : nullptr, _2573_target ? _2573_target->size(0) : 0);
  if ((NULL == sparsity.get()))
  {
    {
      model->getVariableValues(_2574_primal,basevar_nativeidxs,_2573_target,_2572_offset);
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2575_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_pubthis->getSize())));
      _checked_ptr_1<int64_t> _ptr__2575_idxs(_2575_idxs ? _2575_idxs->raw() : nullptr,_2575_idxs ? _2575_idxs->size(0) : 0);
      int32_t _10334_ = (int)0;
      int32_t _10335_ = (int)((sparsity)->size(0));
      for (int32_t _2576_i = _10334_; _2576_i < _10335_; ++_2576_i)
      {
        {
          _ptr__2575_idxs[((*sparsity)(_2576_i))] = ((*basevar_nativeidxs)(_2576_i));
        }
      }
      model->getVariableValues(_2574_primal,_2575_idxs,_2573_target,_2572_offset);
    }
  }
}
// End mosek.fusion.BaseVariable.values

// Begin mosek.fusion.BaseVariable.make_continuous
// Method mosek.fusion.BaseVariable.make_continuous @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:114:6-89
void mosek::fusion::BaseVariable :: make_continuous() { mosek::fusion::p_BaseVariable::_get_impl(this)->make_continuous(); }
void mosek::fusion::p_BaseVariable::make_continuous()
{
  mosek::fusion::p_Model::_get_impl(_pubthis->__mosek_2fusion_2BaseVariable__getModel().get())->make_continuous(basevar_nativeidxs);
}
// End mosek.fusion.BaseVariable.make_continuous

// Begin mosek.fusion.BaseVariable.make_integer
// Method mosek.fusion.BaseVariable.make_integer @ bld/docker-win/final/default/src/fusion/BaseVariable.monty:113:6-83
void mosek::fusion::BaseVariable :: make_integer() { mosek::fusion::p_BaseVariable::_get_impl(this)->make_integer(); }
void mosek::fusion::p_BaseVariable::make_integer()
{
  mosek::fusion::p_Model::_get_impl(_pubthis->__mosek_2fusion_2BaseVariable__getModel().get())->make_integer(basevar_nativeidxs);
}
// End mosek.fusion.BaseVariable.make_integer

void mosek::fusion::p_BaseVariable::destroy()
{
  sparsity.reset();
  basevar_nativeidxs.reset();
  model.reset();
  shape.reset();
}
void mosek::fusion::BaseVariable::destroy() { mosek::fusion::p_BaseVariable::_get_impl(this)->destroy(); }
// } class BaseVariable
// class Variable { // @ bld/docker-win/final/default/src/fusion/Variable.mbi:187:4-419:5
// Begin mosek.fusion.Variable.toString
// End mosek.fusion.Variable.toString

// Begin mosek.fusion.Variable.numInst
// End mosek.fusion.Variable.numInst

// Begin mosek.fusion.Variable.inst
// End mosek.fusion.Variable.inst

// Begin mosek.fusion.Variable.inst
// End mosek.fusion.Variable.inst

// Begin mosek.fusion.Variable.remove
// End mosek.fusion.Variable.remove

// Begin mosek.fusion.Variable.getND
// End mosek.fusion.Variable.getND

// Begin mosek.fusion.Variable.getShape
// End mosek.fusion.Variable.getShape

// Begin mosek.fusion.Variable.getModel
monty::rc_ptr< mosek::fusion::Model > mosek::fusion::Variable::getModel() { return __mosek_2fusion_2Variable__getModel(); }
// End mosek.fusion.Variable.getModel

// Begin mosek.fusion.Variable.getSize
// End mosek.fusion.Variable.getSize

// Begin mosek.fusion.Variable.setLevel
// End mosek.fusion.Variable.setLevel

// Begin mosek.fusion.Variable.fromTril
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::fromTril(int32_t _2584_dim) { return __mosek_2fusion_2Variable__fromTril(_2584_dim); }
// End mosek.fusion.Variable.fromTril

// Begin mosek.fusion.Variable.tril
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::tril() { return __mosek_2fusion_2Variable__tril(); }
// End mosek.fusion.Variable.tril

// Begin mosek.fusion.Variable.reshape
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::reshape(int32_t _2585_dim0,int32_t _2586_dim1,int32_t _2587_dim2) { return __mosek_2fusion_2Variable__reshape(_2585_dim0,_2586_dim1,_2587_dim2); }
// End mosek.fusion.Variable.reshape

// Begin mosek.fusion.Variable.reshape
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::reshape(int32_t _2588_dim0,int32_t _2589_dim1) { return __mosek_2fusion_2Variable__reshape(_2588_dim0,_2589_dim1); }
// End mosek.fusion.Variable.reshape

// Begin mosek.fusion.Variable.reshape
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::reshape(int32_t _2590_dim0) { return __mosek_2fusion_2Variable__reshape(_2590_dim0); }
// End mosek.fusion.Variable.reshape

// Begin mosek.fusion.Variable.reshape
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _2591_shape) { return __mosek_2fusion_2Variable__reshape(_2591_shape); }
// End mosek.fusion.Variable.reshape

// Begin mosek.fusion.Variable.set_values
// End mosek.fusion.Variable.set_values

// Begin mosek.fusion.Variable.dual
// End mosek.fusion.Variable.dual

// Begin mosek.fusion.Variable.level
// End mosek.fusion.Variable.level

// Begin mosek.fusion.Variable.values
// End mosek.fusion.Variable.values

// Begin mosek.fusion.Variable.make_continuous
// End mosek.fusion.Variable.make_continuous

// Begin mosek.fusion.Variable.make_integer
// End mosek.fusion.Variable.make_integer

// Begin mosek.fusion.Variable.makeContinuous
// End mosek.fusion.Variable.makeContinuous

// Begin mosek.fusion.Variable.makeInteger
// End mosek.fusion.Variable.makeInteger

// Begin mosek.fusion.Variable.transpose
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::transpose() { return __mosek_2fusion_2Variable__transpose(); }
// End mosek.fusion.Variable.transpose

// Begin mosek.fusion.Variable.pick
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2597_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2598_i2,std::shared_ptr< monty::ndarray< int32_t,1 > > _2599_i3) { return __mosek_2fusion_2Variable__pick(_2597_i1,_2598_i2,_2599_i3); }
// End mosek.fusion.Variable.pick

// Begin mosek.fusion.Variable.pick
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2600_i1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2601_i2) { return __mosek_2fusion_2Variable__pick(_2600_i1,_2601_i2); }
// End mosek.fusion.Variable.pick

// Begin mosek.fusion.Variable.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2602_midxs) { return __mosek_2fusion_2Variable__pick(_2602_midxs); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _2602_midxs) { return __mosek_2fusion_2Variable__pick(_2602_midxs); }
// End mosek.fusion.Variable.pick

// Begin mosek.fusion.Variable.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2603_idxs) { return __mosek_2fusion_2Variable__pick(_2603_idxs); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _2603_idxs) { return __mosek_2fusion_2Variable__pick(_2603_idxs); }
// End mosek.fusion.Variable.pick

// Begin mosek.fusion.Variable.antidiag
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::antidiag() { return __mosek_2fusion_2Variable__antidiag(); }
// End mosek.fusion.Variable.antidiag

// Begin mosek.fusion.Variable.antidiag
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::antidiag(int32_t _2604_index) { return __mosek_2fusion_2Variable__antidiag(_2604_index); }
// End mosek.fusion.Variable.antidiag

// Begin mosek.fusion.Variable.diag
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::diag() { return __mosek_2fusion_2Variable__diag(); }
// End mosek.fusion.Variable.diag

// Begin mosek.fusion.Variable.diag
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::diag(int32_t _2605_index) { return __mosek_2fusion_2Variable__diag(_2605_index); }
// End mosek.fusion.Variable.diag

// Begin mosek.fusion.Variable.index
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2606_idx) { return __mosek_2fusion_2Variable__index(_2606_idx); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2606_idx) { return __mosek_2fusion_2Variable__index(_2606_idx); }
// End mosek.fusion.Variable.index

// Begin mosek.fusion.Variable.index
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::index(int32_t _2607_i1,int32_t _2608_i2,int32_t _2609_i3) { return __mosek_2fusion_2Variable__index(_2607_i1,_2608_i2,_2609_i3); }
// End mosek.fusion.Variable.index

// Begin mosek.fusion.Variable.index
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::index(int32_t _2610_i1,int32_t _2611_i2) { return __mosek_2fusion_2Variable__index(_2610_i1,_2611_i2); }
// End mosek.fusion.Variable.index

// Begin mosek.fusion.Variable.index
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__index(int32_t _2612_i1) { return __mosek_2fusion_2Variable__index(_2612_i1); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::index(int32_t _2612_i1) { return __mosek_2fusion_2Variable__index(_2612_i1); }
// End mosek.fusion.Variable.index

// Begin mosek.fusion.Variable.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2613_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2614_lasta) { return __mosek_2fusion_2Variable__slice(_2613_firsta,_2614_lasta); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2613_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2614_lasta) { return __mosek_2fusion_2Variable__slice(_2613_firsta,_2614_lasta); }
// End mosek.fusion.Variable.slice

// Begin mosek.fusion.Variable.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::__mosek_2fusion_2Expression__slice(int32_t _2615_first,int32_t _2616_last) { return __mosek_2fusion_2Variable__slice(_2615_first,_2616_last); }
monty::rc_ptr< mosek::fusion::Variable > mosek::fusion::Variable::slice(int32_t _2615_first,int32_t _2616_last) { return __mosek_2fusion_2Variable__slice(_2615_first,_2616_last); }
// End mosek.fusion.Variable.slice

// Begin mosek.fusion.Variable.asExpr
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Variable::asExpr() { return __mosek_2fusion_2Variable__asExpr(); }
// End mosek.fusion.Variable.asExpr

// } class Variable
// class Var { // @ bld/docker-win/final/default/src/fusion/Var.monty:144:4-814:5
mosek::fusion::Var::Var(mosek::fusion::p_Var *_impl) : _impl(_impl) { /*std::cout << "Var() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Var::~Var() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Var::p_Var
  (::mosek::fusion::Var * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Var.empty
// Method mosek.fusion.Var.empty @ bld/docker-win/final/default/src/fusion/Var.monty:808:6-813:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::empty
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _2617_shape) { return mosek::fusion::p_Var::empty(_2617_shape); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::empty(std::shared_ptr< monty::ndarray< int32_t,1 > > _2617_shape)
{
  _checked_ptr_1<int32_t> _ptr__2617_shape(_2617_shape ? _2617_shape->raw() : nullptr, _2617_shape ? _2617_shape->size(0) : 0);
  int32_t _10336_ = (int)0;
  int32_t _10337_ = (int)((_2617_shape)->size(0));
  for (int32_t _2618_i = _10336_; _2618_i < _10337_; ++_2618_i)
  {
    {
      if ((_ptr__2617_shape[_2618_i] < (int)0))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Invalid shape"));
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_NilVariable::_new_NilVariable(_2617_shape)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Var.empty

// Begin mosek.fusion.Var.compress
// Method mosek.fusion.Var.compress @ bld/docker-win/final/default/src/fusion/Var.monty:782:6-800:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::compress
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2619_v) { return mosek::fusion::p_Var::compress(_2619_v); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::compress(monty::rc_ptr< ::mosek::fusion::Variable > _2619_v)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2620_shape = _2619_v->getShape();
  _checked_ptr_1<int32_t> _ptr__2620_shape(_2620_shape ? _2620_shape->raw() : nullptr,_2620_shape ? _2620_shape->size(0) : 0);
  int32_t _2621_nd = (int)((_2620_shape)->size(0));
  int32_t _2622_realnd = (int)0;
  int32_t _10338_ = (int)0;
  int32_t _10339_ = _2621_nd;
  for (int32_t _2623_i = _10338_; _2623_i < _10339_; ++_2623_i)
  {
    {
      if ((_ptr__2620_shape[_2623_i] != (int)1))
      {
        {
          ++ _2622_realnd;
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2624_realshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2622_realnd)));
  _checked_ptr_1<int32_t> _ptr__2624_realshape(_2624_realshape ? _2624_realshape->raw() : nullptr,_2624_realshape ? _2624_realshape->size(0) : 0);
  {
    int32_t _2625_k = (int)0;
    int32_t _10340_ = (int)0;
    int32_t _10341_ = _2621_nd;
    for (int32_t _2626_i = _10340_; _2626_i < _10341_; ++_2626_i)
    {
      {
        if ((_ptr__2620_shape[_2626_i] != (int)1))
        {
          {
            _ptr__2624_realshape[_2625_k] = _ptr__2620_shape[_2626_i];
            ++ _2625_k;
          }
        }
        {}
      }
    }
  }
  return ::mosek::fusion::p_Var::reshape(_2619_v,_2624_realshape);
}
// End mosek.fusion.Var.compress

// Begin mosek.fusion.Var.reshape
// Method mosek.fusion.Var.reshape @ bld/docker-win/final/default/src/fusion/Var.monty:765:6-768:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::reshape
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2627_v,
    int32_t _2628_d1) { return mosek::fusion::p_Var::reshape(_2627_v,_2628_d1); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::reshape(monty::rc_ptr< ::mosek::fusion::Variable > _2627_v,int32_t _2628_d1)
{
  return ::mosek::fusion::p_Var::reshape(_2627_v,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2628_d1)}));
}
// End mosek.fusion.Var.reshape

// Begin mosek.fusion.Var.reshape
// Method mosek.fusion.Var.reshape @ bld/docker-win/final/default/src/fusion/Var.monty:751:6-754:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::reshape
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2629_v,
    int32_t _2630_d1,
    int32_t _2631_d2) { return mosek::fusion::p_Var::reshape(_2629_v,_2630_d1,_2631_d2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::reshape(monty::rc_ptr< ::mosek::fusion::Variable > _2629_v,int32_t _2630_d1,int32_t _2631_d2)
{
  return ::mosek::fusion::p_Var::reshape(_2629_v,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_2630_d1),(int32_t)(_2631_d2)}));
}
// End mosek.fusion.Var.reshape

// Begin mosek.fusion.Var.flatten
// Method mosek.fusion.Var.flatten @ bld/docker-win/final/default/src/fusion/Var.monty:738:6-741:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::flatten
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2632_v) { return mosek::fusion::p_Var::flatten(_2632_v); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::flatten(monty::rc_ptr< ::mosek::fusion::Variable > _2632_v)
{
  return ::mosek::fusion::p_Var::reshape(_2632_v,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int32_t)::mosek::fusion::p_Set::size(_2632_v->getShape()))}));
}
// End mosek.fusion.Var.flatten

// Begin mosek.fusion.Var.reshape
// Method mosek.fusion.Var.reshape @ bld/docker-win/final/default/src/fusion/Var.monty:707:6-709:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::reshape
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2633_v,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2634_shape) { return mosek::fusion::p_Var::reshape(_2633_v,_2634_shape); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::reshape(monty::rc_ptr< ::mosek::fusion::Variable > _2633_v,std::shared_ptr< monty::ndarray< int32_t,1 > > _2634_shape)
{
  _checked_ptr_1<int32_t> _ptr__2634_shape(_2634_shape ? _2634_shape->raw() : nullptr, _2634_shape ? _2634_shape->size(0) : 0);
  return _2633_v->__mosek_2fusion_2Variable__reshape(_2634_shape);
}
// End mosek.fusion.Var.reshape

// Begin mosek.fusion.Var.index_permute_
// Method mosek.fusion.Var.index_permute_ @ bld/docker-win/final/default/src/fusion/Var.monty:619:6-672:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::index_permute_(monty::rc_ptr< ::mosek::fusion::Variable > _2635_v,std::shared_ptr< monty::ndarray< int32_t,1 > > _2636_perm)
{
  _checked_ptr_1<int32_t> _ptr__2636_perm(_2636_perm ? _2636_perm->raw() : nullptr, _2636_perm ? _2636_perm->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2637_sparsity;
  _checked_ptr_1<int64_t> _ptr__2637_sparsity(_2637_sparsity ? _2637_sparsity->raw() : nullptr,_2637_sparsity ? _2637_sparsity->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2638_nativeidxs;
  _checked_ptr_1<int64_t> _ptr__2638_nativeidxs(_2638_nativeidxs ? _2638_nativeidxs->raw() : nullptr,_2638_nativeidxs ? _2638_nativeidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2639_shape = _2635_v->getShape();
  _checked_ptr_1<int32_t> _ptr__2639_shape(_2639_shape ? _2639_shape->raw() : nullptr,_2639_shape ? _2639_shape->size(0) : 0);
  int32_t _2640_nd = (int)((_2639_shape)->size(0));
  int32_t _2641_shapesize = (int)1;
  int32_t _10342_ = (int)0;
  int32_t _10343_ = _2640_nd;
  for (int32_t _2642_i = _10342_; _2642_i < _10343_; ++_2642_i)
  {
    {
      _2641_shapesize *= _ptr__2639_shape[_2642_i];
    }
  }
  int32_t _2643_nnz = _2635_v->numInst();
  std::shared_ptr< monty::ndarray< int64_t,1 > > _2644_pstrides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2640_nd)));
  _checked_ptr_1<int64_t> _ptr__2644_pstrides(_2644_pstrides ? _2644_pstrides->raw() : nullptr,_2644_pstrides ? _2644_pstrides->size(0) : 0);
  _ptr__2644_pstrides[(_2640_nd - (int)1)] = (int)1;
  int32_t _10344_ = (int)1;
  int32_t _10345_ = _2640_nd;
  for (int32_t _2645_i = _10344_; _2645_i < _10345_; ++_2645_i)
  {
    {
      _ptr__2644_pstrides[((_2640_nd - _2645_i) - (int)1)] = safe_mul( _ptr__2644_pstrides[(_2640_nd - _2645_i)],_ptr__2639_shape[_ptr__2636_perm[(_2640_nd - _2645_i)]] );
    }
  }
  if ((_2643_nnz < _2641_shapesize))
  {
    {
      _2637_sparsity = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2643_nnz)));
      _ptr__2637_sparsity.update(_2637_sparsity ? _2637_sparsity->raw() : nullptr, _2637_sparsity ? _2637_sparsity->size(0) : 0);
      _2638_nativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2643_nnz)));
      _ptr__2638_nativeidxs.update(_2638_nativeidxs ? _2638_nativeidxs->raw() : nullptr, _2638_nativeidxs ? _2638_nativeidxs->size(0) : 0);
      _2635_v->inst((int)0,_2637_sparsity,(int)0,_2638_nativeidxs);
    }
  }
  else
  {
    {
      _2637_sparsity = nullptr;
      _ptr__2637_sparsity.update(_2637_sparsity ? _2637_sparsity->raw() : nullptr, _2637_sparsity ? _2637_sparsity->size(0) : 0);
      _2638_nativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2643_nnz)));
      _ptr__2638_nativeidxs.update(_2638_nativeidxs ? _2638_nativeidxs->raw() : nullptr, _2638_nativeidxs ? _2638_nativeidxs->size(0) : 0);
      _2635_v->inst((int)0,_2638_nativeidxs);
    }
  }
  if ((NULL == _2637_sparsity.get()))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2646_residxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2643_nnz)));
      _checked_ptr_1<int64_t> _ptr__2646_residxs(_2646_residxs ? _2646_residxs->raw() : nullptr,_2646_residxs ? _2646_residxs->size(0) : 0);
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _2647_ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2640_nd)));
        _checked_ptr_1<int32_t> _ptr__2647_ii(_2647_ii ? _2647_ii->raw() : nullptr,_2647_ii ? _2647_ii->size(0) : 0);
        int32_t _10346_ = (int)0;
        int32_t _10347_ = _2643_nnz;
        for (int32_t _2648_i = _10346_; _2648_i < _10347_; ++_2648_i)
        {
          {
            int32_t _2649_rem = _2648_i;
            int32_t _10348_ = (int)0;
            int32_t _10349_ = _2640_nd;
            for (int32_t _2650_j = _10348_; _2650_j < _10349_; ++_2650_j)
            {
              {
                _ptr__2647_ii[((_2640_nd - _2648_i) - (int)1)] = (_2649_rem % _ptr__2639_shape[((_2640_nd - _2648_i) - (int)1)]);
                _2649_rem /= _ptr__2639_shape[((_2640_nd - _2648_i) - (int)1)];
              }
            }
            int32_t _2651_newi = (int)0;
            int32_t _10350_ = (int)0;
            int32_t _10351_ = _2640_nd;
            for (int32_t _2652_j = _10350_; _2652_j < _10351_; ++_2652_j)
            {
              {
                _2651_newi += (int32_t)safe_mul( _ptr__2647_ii[_ptr__2636_perm[_2652_j]],_ptr__2644_pstrides[_2652_j] );
              }
            }
            _ptr__2646_residxs[_2651_newi] = _ptr__2638_nativeidxs[_2648_i];
          }
        }
      }
      _2638_nativeidxs = _2646_residxs;
      _ptr__2638_nativeidxs.update(_2638_nativeidxs ? _2638_nativeidxs->raw() : nullptr, _2638_nativeidxs ? _2638_nativeidxs->size(0) : 0);
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2653_ressp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2643_nnz)));
      _checked_ptr_1<int64_t> _ptr__2653_ressp(_2653_ressp ? _2653_ressp->raw() : nullptr,_2653_ressp ? _2653_ressp->size(0) : 0);
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _2654_ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2640_nd)));
        _checked_ptr_1<int32_t> _ptr__2654_ii(_2654_ii ? _2654_ii->raw() : nullptr,_2654_ii ? _2654_ii->size(0) : 0);
        int32_t _10352_ = (int)0;
        int32_t _10353_ = _2643_nnz;
        for (int32_t _2655_i = _10352_; _2655_i < _10353_; ++_2655_i)
        {
          {
            int32_t _2656_rem = _2655_i;
            int32_t _10354_ = (int)0;
            int32_t _10355_ = _2640_nd;
            for (int32_t _2657_j = _10354_; _2657_j < _10355_; ++_2657_j)
            {
              {
                _ptr__2654_ii[((_2640_nd - _2655_i) - (int)1)] = (_2656_rem % _ptr__2639_shape[((_2640_nd - _2655_i) - (int)1)]);
                _2656_rem /= _ptr__2639_shape[((_2640_nd - _2655_i) - (int)1)];
              }
            }
            int32_t _2658_newi = (int)0;
            int32_t _10356_ = (int)0;
            int32_t _10357_ = _2640_nd;
            for (int32_t _2659_j = _10356_; _2659_j < _10357_; ++_2659_j)
            {
              {
                _2658_newi += (int32_t)safe_mul( _ptr__2654_ii[_ptr__2636_perm[_2659_j]],_ptr__2644_pstrides[_2659_j] );
              }
            }
            _ptr__2653_ressp[_2655_i] = _2658_newi;
          }
        }
      }
      std::vector<int64_t> _10358_;
      for (int32_t _2661_i = (int)0, _10359_ = _2643_nnz; _2661_i < _10359_ ; ++_2661_i)
      {
        _10358_.push_back(_2661_i);
      }
      auto _10360_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10358_.size()),_10358_.begin(),_10358_.end()));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2660_spperm = _10360_;
      _checked_ptr_1<int64_t> _ptr__2660_spperm(_2660_spperm ? _2660_spperm->raw() : nullptr,_2660_spperm ? _2660_spperm->size(0) : 0);
      ::mosek::fusion::p_CommonTools::argQsort(_2660_spperm,_2653_ressp,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_2643_nnz));
      std::vector<int64_t> _10361_;
      for (int32_t _2662_i = (int)0, _10362_ = _2643_nnz; _2662_i < _10362_ ; ++_2662_i)
      {
        _10361_.push_back(_ptr__2637_sparsity[_ptr__2660_spperm[_2662_i]]);
      }
      auto _10363_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10361_.size()),_10361_.begin(),_10361_.end()));
      _2637_sparsity = _10363_;
      _ptr__2637_sparsity.update(_2637_sparsity ? _2637_sparsity->raw() : nullptr, _2637_sparsity ? _2637_sparsity->size(0) : 0);
      std::vector<int64_t> _10364_;
      for (int32_t _2663_i = (int)0, _10365_ = _2643_nnz; _2663_i < _10365_ ; ++_2663_i)
      {
        _10364_.push_back(_ptr__2638_nativeidxs[_ptr__2660_spperm[_2663_i]]);
      }
      auto _10366_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10364_.size()),_10364_.begin(),_10364_.end()));
      _2638_nativeidxs = _10366_;
      _ptr__2638_nativeidxs.update(_2638_nativeidxs ? _2638_nativeidxs->raw() : nullptr, _2638_nativeidxs ? _2638_nativeidxs->size(0) : 0);
    }
  }
  std::vector<int32_t> _10367_;
  for (int32_t _2664_i = (int)0, _10368_ = _2640_nd; _2664_i < _10368_ ; ++_2664_i)
  {
    _10367_.push_back(_ptr__2639_shape[_ptr__2636_perm[_2664_i]]);
  }
  auto _10369_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10367_.size()),_10367_.begin(),_10367_.end()));
  return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2635_v->__mosek_2fusion_2Variable__getModel(),_10369_,_2637_sparsity,_2638_nativeidxs)).as<::mosek::fusion::Variable>();
}
// End mosek.fusion.Var.index_permute_

// Begin mosek.fusion.Var.hrepeat
// Method mosek.fusion.Var.hrepeat @ bld/docker-win/final/default/src/fusion/Var.monty:611:6-108
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::hrepeat
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2665_v,
    int32_t _2666_n) { return mosek::fusion::p_Var::hrepeat(_2665_v,_2666_n); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::hrepeat(monty::rc_ptr< ::mosek::fusion::Variable > _2665_v,int32_t _2666_n)
{
  return ::mosek::fusion::p_Var::drepeat(_2665_v,(int)1,_2666_n);
}
// End mosek.fusion.Var.hrepeat

// Begin mosek.fusion.Var.vrepeat
// Method mosek.fusion.Var.vrepeat @ bld/docker-win/final/default/src/fusion/Var.monty:610:6-108
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::vrepeat
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2667_v,
    int32_t _2668_n) { return mosek::fusion::p_Var::vrepeat(_2667_v,_2668_n); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::vrepeat(monty::rc_ptr< ::mosek::fusion::Variable > _2667_v,int32_t _2668_n)
{
  return ::mosek::fusion::p_Var::drepeat(_2667_v,(int)0,_2668_n);
}
// End mosek.fusion.Var.vrepeat

// Begin mosek.fusion.Var.repeat
// Method mosek.fusion.Var.repeat @ bld/docker-win/final/default/src/fusion/Var.monty:609:6-108
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::repeat
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2669_v,
    int32_t _2670_n) { return mosek::fusion::p_Var::repeat(_2669_v,_2670_n); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::repeat(monty::rc_ptr< ::mosek::fusion::Variable > _2669_v,int32_t _2670_n)
{
  return ::mosek::fusion::p_Var::drepeat(_2669_v,(int)0,_2670_n);
}
// End mosek.fusion.Var.repeat

// Begin mosek.fusion.Var.repeat
// Method mosek.fusion.Var.repeat @ bld/docker-win/final/default/src/fusion/Var.monty:608:6-108
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::repeat
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2671_v,
    int32_t _2672_dim,
    int32_t _2673_n) { return mosek::fusion::p_Var::repeat(_2671_v,_2672_dim,_2673_n); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::repeat(monty::rc_ptr< ::mosek::fusion::Variable > _2671_v,int32_t _2672_dim,int32_t _2673_n)
{
  return ::mosek::fusion::p_Var::drepeat(_2671_v,_2672_dim,_2673_n);
}
// End mosek.fusion.Var.repeat

// Begin mosek.fusion.Var.drepeat
// Method mosek.fusion.Var.drepeat @ bld/docker-win/final/default/src/fusion/Var.monty:472:6-606:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::drepeat(monty::rc_ptr< ::mosek::fusion::Variable > _2674_v,int32_t _2675_dim,int32_t _2676_n)
{
  if ((_2676_n < (int)0))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Cannot repeat less than 0 times"));
    }
  }
  else if((_2676_n == (int)0))
  {
    {
      return (::mosek::fusion::p_NilVariable::_new_NilVariable()).as<::mosek::fusion::Variable>();
    }
  }
  else if((_2676_n == (int)1))
  {
    {
      return _2674_v;
    }
  }
  else
  {
    {
      monty::rc_ptr< ::mosek::fusion::Model > _2677_model = _2674_v->__mosek_2fusion_2Variable__getModel();
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2678_shape = _2674_v->getShape();
      _checked_ptr_1<int32_t> _ptr__2678_shape(_2678_shape ? _2678_shape->raw() : nullptr,_2678_shape ? _2678_shape->size(0) : 0);
      int32_t _2679_nd = (int)((_2678_shape)->size(0));
      if (((_2675_dim < (int)0) || (_2675_dim > _2679_nd)))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Invalid stacking dimension"));
        }
      }
      {}
      int64_t _2680_domsize = ::mosek::fusion::p_Set::size(_2678_shape);
      int32_t _2681_nnz = _2674_v->numInst();
      int32_t _2682_rnnz = safe_mul( _2681_nnz,_2676_n );
      int32_t _2683_d0 = (int)1;
      int32_t _10370_ = (int)0;
      int32_t _10371_ = _2675_dim;
      for (int32_t _2684_i = _10370_; _2684_i < _10371_; ++_2684_i)
      {
        {
          _2683_d0 *= _ptr__2678_shape[_2684_i];
        }
      }
      int32_t _10372_;
      bool _10373_ = (_2675_dim < _2679_nd);
      if (_10373_)
      {
        _10372_ = _ptr__2678_shape[_2675_dim];
      }
      else
      {
        _10372_ = (int)1;
      }
      int32_t _2685_d1 = _10372_;
      int32_t _2686_nd1 = safe_mul( _2685_d1,_2676_n );
      int32_t _2687_d2 = (int)1;
      int32_t _10374_ = safe_add( _2675_dim,(int)1 );
      int32_t _10375_ = _2679_nd;
      for (int32_t _2688_i = _10374_; _2688_i < _10375_; ++_2688_i)
      {
        {
          _2687_d2 *= _ptr__2678_shape[_2688_i];
        }
      }
      int32_t _10376_;
      bool _10377_ = (_2675_dim < _2679_nd);
      if (_10377_)
      {
        _10376_ = _2679_nd;
      }
      else
      {
        _10376_ = safe_add( _2675_dim,(int)1 );
      }
      int32_t _2689_rnd = _10376_;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2690_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2689_rnd)));
      _checked_ptr_1<int32_t> _ptr__2690_rshape(_2690_rshape ? _2690_rshape->raw() : nullptr,_2690_rshape ? _2690_rshape->size(0) : 0);
      int32_t _10378_ = (int)0;
      int32_t _10379_ = _2679_nd;
      for (int32_t _2691_i = _10378_; _2691_i < _10379_; ++_2691_i)
      {
        {
          _ptr__2690_rshape[_2691_i] = _ptr__2678_shape[_2691_i];
        }
      }
      int32_t _10380_ = _2679_nd;
      int32_t _10381_ = _2689_rnd;
      for (int32_t _2692_i = _10380_; _2692_i < _10381_; ++_2692_i)
      {
        {
          _ptr__2690_rshape[_2692_i] = (int)1;
        }
      }
      _ptr__2690_rshape[_2675_dim] = _2686_nd1;
      if ((_2681_nnz < _2680_domsize))
      {
        {
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2693_tnativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2681_nnz)));
          _checked_ptr_1<int64_t> _ptr__2693_tnativeidxs(_2693_tnativeidxs ? _2693_tnativeidxs->raw() : nullptr,_2693_tnativeidxs ? _2693_tnativeidxs->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2694_tsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2681_nnz)));
          _checked_ptr_1<int64_t> _ptr__2694_tsp(_2694_tsp ? _2694_tsp->raw() : nullptr,_2694_tsp ? _2694_tsp->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2695_rnativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2682_rnnz)));
          _checked_ptr_1<int64_t> _ptr__2695_rnativeidxs(_2695_rnativeidxs ? _2695_rnativeidxs->raw() : nullptr,_2695_rnativeidxs ? _2695_rnativeidxs->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2696_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2682_rnnz)));
          _checked_ptr_1<int64_t> _ptr__2696_rsp(_2696_rsp ? _2696_rsp->raw() : nullptr,_2696_rsp ? _2696_rsp->size(0) : 0);
          _2674_v->inst((int)0,_2694_tsp,(int)0,_2693_tnativeidxs);
          {
            int32_t _2697_ns0 = safe_mul( _2686_nd1,_2687_d2 );
            int32_t _2698_s0 = safe_mul( _2685_d1,_2687_d2 );
            int32_t _2699_s1 = _2687_d2;
            if ((_2675_dim == (int)0))
            {
              {
                int32_t _2700_k = (int)0;
                int32_t _10382_ = (int)0;
                int32_t _10383_ = _2676_n;
                for (int32_t _2701_i = _10382_; _2701_i < _10383_; ++_2701_i)
                {
                  {
                    int32_t _10384_ = (int)0;
                    int32_t _10385_ = _2681_nnz;
                    for (int32_t _2702_j = _10384_; _2702_j < _10385_; ++_2702_j)
                    {
                      {
                        _ptr__2696_rsp[_2700_k] = safe_add( _ptr__2694_tsp[_2702_j],safe_mul( _2701_i,_2680_domsize ) );
                        _ptr__2695_rnativeidxs[_2700_k] = _ptr__2693_tnativeidxs[_2702_j];
                        ++ _2700_k;
                      }
                    }
                  }
                }
                return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2677_model,_2690_rshape,_2696_rsp,_2695_rnativeidxs)).as<::mosek::fusion::Variable>();
              }
            }
            else if((_2675_dim >= _2679_nd))
            {
              {
                int32_t _2703_k = (int)0;
                int32_t _10386_ = (int)0;
                int32_t _10387_ = _2681_nnz;
                for (int32_t _2704_j = _10386_; _2704_j < _10387_; ++_2704_j)
                {
                  {
                    int32_t _10388_ = (int)0;
                    int32_t _10389_ = _2676_n;
                    for (int32_t _2705_i = _10388_; _2705_i < _10389_; ++_2705_i)
                    {
                      {
                        _ptr__2696_rsp[_2703_k] = safe_add( safe_mul( _ptr__2694_tsp[_2704_j],_2676_n ),_2705_i );
                        _ptr__2695_rnativeidxs[_2703_k] = _ptr__2693_tnativeidxs[_2704_j];
                        ++ _2703_k;
                      }
                    }
                  }
                }
                return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2677_model,_2690_rshape,_2696_rsp,_2695_rnativeidxs)).as<::mosek::fusion::Variable>();
              }
            }
            else
            {
              {
                int32_t _2706_k = (int)0;
                int32_t _10390_ = (int)0;
                int32_t _10391_ = _2681_nnz;
                for (int32_t _2707_i = _10390_; _2707_i < _10391_; ++_2707_i)
                {
                  {
                    int64_t _2708_i0 = (_ptr__2694_tsp[_2707_i] / _2698_s0);
                    int64_t _2709_i1 = ((_ptr__2694_tsp[_2707_i] / _2699_s1) % _2685_d1);
                    int64_t _2710_i2 = (_ptr__2694_tsp[_2707_i] % _2687_d2);
                    int32_t _10392_ = (int)0;
                    int32_t _10393_ = _2676_n;
                    for (int32_t _2711_j = _10392_; _2711_j < _10393_; ++_2711_j)
                    {
                      {
                        _ptr__2696_rsp[_2706_k] = safe_add( safe_add( safe_mul( _2708_i0,_2697_ns0 ),safe_mul( safe_add( _2709_i1,safe_mul( _2685_d1,_2711_j ) ),_2687_d2 ) ),_2710_i2 );
                        _ptr__2695_rnativeidxs[_2706_k] = _ptr__2693_tnativeidxs[_2707_i];
                        ++ _2706_k;
                      }
                    }
                  }
                }
                int32_t _2712_maxdim = (int)1;
                int32_t _10394_ = (int)0;
                int32_t _10395_ = _2689_rnd;
                for (int32_t _2713_i = _10394_; _2713_i < _10395_; ++_2713_i)
                {
                  {
                    if ((_2712_maxdim < _ptr__2690_rshape[_2713_i]))
                    {
                      {
                        _2712_maxdim = _ptr__2690_rshape[_2713_i];
                      }
                    }
                    {}
                  }
                }
                std::shared_ptr< monty::ndarray< int32_t,1 > > _2714_curperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2682_rnnz)));
                _checked_ptr_1<int32_t> _ptr__2714_curperm(_2714_curperm ? _2714_curperm->raw() : nullptr,_2714_curperm ? _2714_curperm->size(0) : 0);
                std::shared_ptr< monty::ndarray< int32_t,1 > > _2715_tgtperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2682_rnnz)));
                _checked_ptr_1<int32_t> _ptr__2715_tgtperm(_2715_tgtperm ? _2715_tgtperm->raw() : nullptr,_2715_tgtperm ? _2715_tgtperm->size(0) : 0);
                {
                  std::shared_ptr< monty::ndarray< int32_t,1 > > _2716_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _2712_maxdim,(int)1 ))));
                  _checked_ptr_1<int32_t> _ptr__2716_ptr(_2716_ptr ? _2716_ptr->raw() : nullptr,_2716_ptr ? _2716_ptr->size(0) : 0);
                  std::shared_ptr< monty::ndarray< int64_t,1 > > _2717_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2689_rnd)));
                  _checked_ptr_1<int64_t> _ptr__2717_s(_2717_s ? _2717_s->raw() : nullptr,_2717_s ? _2717_s->size(0) : 0);
                  _ptr__2717_s[(_2689_rnd - (int)1)] = (int)1;
                  int32_t _10396_ = (int)1;
                  int32_t _10397_ = _2689_rnd;
                  for (int32_t _2718_i = _10396_; _2718_i < _10397_; ++_2718_i)
                  {
                    {
                      _ptr__2717_s[((_2689_rnd - _2718_i) - (int)1)] = safe_mul( _ptr__2717_s[(_2689_rnd - _2718_i)],_ptr__2690_rshape[(_2689_rnd - _2718_i)] );
                    }
                  }
                  int32_t _10398_ = (int)0;
                  int32_t _10399_ = _2682_rnnz;
                  for (int32_t _2719_i = _10398_; _2719_i < _10399_; ++_2719_i)
                  {
                    {
                      _ptr__2714_curperm[_2719_i] = _2719_i;
                    }
                  }
                  int32_t _10400_ = (int)0;
                  int32_t _10401_ = _2689_rnd;
                  for (int32_t _2720_ii = _10400_; _2720_ii < _10401_; ++_2720_ii)
                  {
                    {
                      int32_t _2721_i = ((_2689_rnd - _2720_ii) - (int)1);
                      int32_t _10402_ = (int)0;
                      int32_t _10403_ = safe_add( _ptr__2690_rshape[_2721_i],(int)1 );
                      for (int32_t _2722_j = _10402_; _2722_j < _10403_; ++_2722_j)
                      {
                        {
                          _ptr__2716_ptr[_2722_j] = (int)0;
                        }
                      }
                      int32_t _10404_ = (int)0;
                      int32_t _10405_ = _2682_rnnz;
                      for (int32_t _2723_j = _10404_; _2723_j < _10405_; ++_2723_j)
                      {
                        {
                          ++ _ptr__2716_ptr[safe_add( ((_ptr__2696_rsp[_2723_j] / _ptr__2717_s[_2721_i]) % _ptr__2690_rshape[_2721_i]),(int)1 )];
                        }
                      }
                      int32_t _10406_ = (int)0;
                      int32_t _10407_ = _ptr__2690_rshape[_2721_i];
                      for (int32_t _2724_j = _10406_; _2724_j < _10407_; ++_2724_j)
                      {
                        {
                          _ptr__2716_ptr[safe_add( _2724_j,(int)1 )] += _ptr__2716_ptr[_2724_j];
                        }
                      }
                      int32_t _10408_ = (int)0;
                      int32_t _10409_ = _2682_rnnz;
                      for (int32_t _2725_jj = _10408_; _2725_jj < _10409_; ++_2725_jj)
                      {
                        {
                          int32_t _2726_j = _ptr__2714_curperm[_2725_jj];
                          int64_t _2727_idx = ((_ptr__2696_rsp[_2726_j] / _ptr__2717_s[_2721_i]) % _ptr__2690_rshape[_2721_i]);
                          _ptr__2715_tgtperm[_ptr__2716_ptr[_2727_idx]] = _2726_j;
                          ++ _ptr__2716_ptr[_2727_idx];
                        }
                      }
                      std::shared_ptr< monty::ndarray< int32_t,1 > > _2728_tmp = _2714_curperm;
                      _checked_ptr_1<int32_t> _ptr__2728_tmp(_2728_tmp ? _2728_tmp->raw() : nullptr,_2728_tmp ? _2728_tmp->size(0) : 0);
                      _2714_curperm = _2715_tgtperm;
                      _ptr__2714_curperm.update(_2714_curperm ? _2714_curperm->raw() : nullptr, _2714_curperm ? _2714_curperm->size(0) : 0);
                      _2715_tgtperm = _2728_tmp;
                      _ptr__2715_tgtperm.update(_2715_tgtperm ? _2715_tgtperm->raw() : nullptr, _2715_tgtperm ? _2715_tgtperm->size(0) : 0);
                    }
                  }
                }
                std::vector<int64_t> _10410_;
                for (int32_t _2729_i = (int)0, _10411_ = _2682_rnnz; _2729_i < _10411_ ; ++_2729_i)
                {
                  _10410_.push_back(_ptr__2696_rsp[_ptr__2714_curperm[_2729_i]]);
                }
                auto _10412_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10410_.size()),_10410_.begin(),_10410_.end()));
                std::vector<int64_t> _10413_;
                for (int32_t _2730_i = (int)0, _10414_ = _2682_rnnz; _2730_i < _10414_ ; ++_2730_i)
                {
                  _10413_.push_back(_ptr__2695_rnativeidxs[_ptr__2714_curperm[_2730_i]]);
                }
                auto _10415_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10413_.size()),_10413_.begin(),_10413_.end()));
                return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2677_model,_2690_rshape,_10412_,_10415_)).as<::mosek::fusion::Variable>();
              }
            }
          }
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2731_tnativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2681_nnz)));
          _checked_ptr_1<int64_t> _ptr__2731_tnativeidxs(_2731_tnativeidxs ? _2731_tnativeidxs->raw() : nullptr,_2731_tnativeidxs ? _2731_tnativeidxs->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2732_rnativeidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_mul( _2681_nnz,_2676_n ))));
          _checked_ptr_1<int64_t> _ptr__2732_rnativeidxs(_2732_rnativeidxs ? _2732_rnativeidxs->raw() : nullptr,_2732_rnativeidxs ? _2732_rnativeidxs->size(0) : 0);
          _2674_v->inst((int)0,_2731_tnativeidxs);
          int32_t _2733_s0 = safe_mul( _2686_nd1,_2687_d2 );
          int32_t _2734_s1 = _2687_d2;
          int32_t _2735_k = (int)0;
          int32_t _10416_ = (int)0;
          int32_t _10417_ = _2683_d0;
          for (int32_t _2736_i0 = _10416_; _2736_i0 < _10417_; ++_2736_i0)
          {
            {
              int32_t _10418_ = (int)0;
              int32_t _10419_ = _2685_d1;
              for (int32_t _2737_i1 = _10418_; _2737_i1 < _10419_; ++_2737_i1)
              {
                {
                  int32_t _10420_ = (int)0;
                  int32_t _10421_ = _2687_d2;
                  for (int32_t _2738_i2 = _10420_; _2738_i2 < _10421_; ++_2738_i2)
                  {
                    {
                      int32_t _10422_ = (int)0;
                      int32_t _10423_ = _2676_n;
                      for (int32_t _2739_j = _10422_; _2739_j < _10423_; ++_2739_j)
                      {
                        {
                          _ptr__2732_rnativeidxs[safe_add( safe_add( safe_mul( _2736_i0,_2733_s0 ),safe_mul( safe_add( _2737_i1,safe_mul( _2739_j,_2685_d1 ) ),_2734_s1 ) ),_2738_i2 )] = _ptr__2731_tnativeidxs[_2735_k];
                        }
                      }
                      ++ _2735_k;
                    }
                  }
                }
              }
            }
          }
          return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2677_model,_2690_rshape,nullptr,_2732_rnativeidxs)).as<::mosek::fusion::Variable>();
        }
      }
    }
  }
}
// End mosek.fusion.Var.drepeat

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:450:6-454:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >,1 > > _2740_vlist) { return mosek::fusion::p_Var::stack(_2740_vlist); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >,1 > > _2740_vlist)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Variable >> _10424_;
  for (int32_t _2741_i = (int)0, _10425_ = (int)((_2740_vlist)->size(0)); _2741_i < _10425_ ; ++_2741_i)
  {
    _10424_.push_back(::mosek::fusion::p_Var::dstack(((*_2740_vlist)(_2741_i)),(int)1));
  }
  auto _10426_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >(monty::shape(_10424_.size()),_10424_.begin(),_10424_.end()));
  return ::mosek::fusion::p_Var::dstack(_10426_,(int)0);
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.vstack
// Method mosek.fusion.Var.vstack @ bld/docker-win/final/default/src/fusion/Var.monty:414:6-420:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::vstack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2742_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2743_v2,
    monty::rc_ptr< ::mosek::fusion::Variable > _2744_v3) { return mosek::fusion::p_Var::vstack(_2742_v1,_2743_v2,_2744_v3); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::vstack(monty::rc_ptr< ::mosek::fusion::Variable > _2742_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2743_v2,monty::rc_ptr< ::mosek::fusion::Variable > _2744_v3)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2742_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2743_v2.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2744_v3.get())}),(int)0);
}
// End mosek.fusion.Var.vstack

// Begin mosek.fusion.Var.vstack
// Method mosek.fusion.Var.vstack @ bld/docker-win/final/default/src/fusion/Var.monty:396:6-401:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::vstack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2745_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2746_v2) { return mosek::fusion::p_Var::vstack(_2745_v1,_2746_v2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::vstack(monty::rc_ptr< ::mosek::fusion::Variable > _2745_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2746_v2)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2745_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2746_v2.get())}),(int)0);
}
// End mosek.fusion.Var.vstack

// Begin mosek.fusion.Var.vstack
// Method mosek.fusion.Var.vstack @ bld/docker-win/final/default/src/fusion/Var.monty:377:6-381:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::vstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2747_v) { return mosek::fusion::p_Var::vstack(_2747_v); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::vstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2747_v)
{
  return ::mosek::fusion::p_Var::dstack(_2747_v,(int)0);
}
// End mosek.fusion.Var.vstack

// Begin mosek.fusion.Var.hstack
// Method mosek.fusion.Var.hstack @ bld/docker-win/final/default/src/fusion/Var.monty:357:6-363:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::hstack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2748_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2749_v2,
    monty::rc_ptr< ::mosek::fusion::Variable > _2750_v3) { return mosek::fusion::p_Var::hstack(_2748_v1,_2749_v2,_2750_v3); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::hstack(monty::rc_ptr< ::mosek::fusion::Variable > _2748_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2749_v2,monty::rc_ptr< ::mosek::fusion::Variable > _2750_v3)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2748_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2749_v2.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2750_v3.get())}),(int)1);
}
// End mosek.fusion.Var.hstack

// Begin mosek.fusion.Var.hstack
// Method mosek.fusion.Var.hstack @ bld/docker-win/final/default/src/fusion/Var.monty:336:6-341:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::hstack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2751_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2752_v2) { return mosek::fusion::p_Var::hstack(_2751_v1,_2752_v2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::hstack(monty::rc_ptr< ::mosek::fusion::Variable > _2751_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2752_v2)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2751_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2752_v2.get())}),(int)1);
}
// End mosek.fusion.Var.hstack

// Begin mosek.fusion.Var.hstack
// Method mosek.fusion.Var.hstack @ bld/docker-win/final/default/src/fusion/Var.monty:315:6-319:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::hstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2753_v) { return mosek::fusion::p_Var::hstack(_2753_v); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::hstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2753_v)
{
  return ::mosek::fusion::p_Var::dstack(_2753_v,(int)1);
}
// End mosek.fusion.Var.hstack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:298:6-91
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2754_v,
    int32_t _2755_dim) { return mosek::fusion::p_Var::stack(_2754_v,_2755_dim); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2754_v,int32_t _2755_dim)
{
  return ::mosek::fusion::p_Var::stack(_2755_dim,_2754_v);
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:297:6-130
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2756_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2757_v2,
    monty::rc_ptr< ::mosek::fusion::Variable > _2758_v3,
    int32_t _2759_dim) { return mosek::fusion::p_Var::stack(_2756_v1,_2757_v2,_2758_v3,_2759_dim); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(monty::rc_ptr< ::mosek::fusion::Variable > _2756_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2757_v2,monty::rc_ptr< ::mosek::fusion::Variable > _2758_v3,int32_t _2759_dim)
{
  return ::mosek::fusion::p_Var::stack(_2759_dim,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2756_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2757_v2.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2758_v3.get())}));
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:296:6-114
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2760_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2761_v2,
    int32_t _2762_dim) { return mosek::fusion::p_Var::stack(_2760_v1,_2761_v2,_2762_dim); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(monty::rc_ptr< ::mosek::fusion::Variable > _2760_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2761_v2,int32_t _2762_dim)
{
  return ::mosek::fusion::p_Var::stack(_2762_dim,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2760_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2761_v2.get())}));
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:290:6-293:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( int32_t _2763_dim,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2764_v) { return mosek::fusion::p_Var::stack(_2763_dim,_2764_v); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(int32_t _2763_dim,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2764_v)
{
  int32_t _2765_maxnd = _2763_dim;
  int32_t _10427_ = (int)0;
  int32_t _10428_ = (int)((_2764_v)->size(0));
  for (int32_t _2766_i = _10427_; _2766_i < _10428_; ++_2766_i)
  {
    {
      if ((_2765_maxnd < ((*_2764_v)(_2766_i))->getND()))
      {
        {
          _2765_maxnd = ((*_2764_v)(_2766_i))->getND();
        }
      }
      {}
    }
  }
  return ::mosek::fusion::p_Var::dstack(_2764_v,_2763_dim);
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:289:6-131
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( int32_t _2767_dim,
    monty::rc_ptr< ::mosek::fusion::Variable > _2768_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2769_v2,
    monty::rc_ptr< ::mosek::fusion::Variable > _2770_v3) { return mosek::fusion::p_Var::stack(_2767_dim,_2768_v1,_2769_v2,_2770_v3); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(int32_t _2767_dim,monty::rc_ptr< ::mosek::fusion::Variable > _2768_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2769_v2,monty::rc_ptr< ::mosek::fusion::Variable > _2770_v3)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2768_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2769_v2.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2770_v3.get())}),_2767_dim);
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.stack
// Method mosek.fusion.Var.stack @ bld/docker-win/final/default/src/fusion/Var.monty:288:6-115
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::stack
  ( int32_t _2771_dim,
    monty::rc_ptr< ::mosek::fusion::Variable > _2772_v1,
    monty::rc_ptr< ::mosek::fusion::Variable > _2773_v2) { return mosek::fusion::p_Var::stack(_2771_dim,_2772_v1,_2773_v2); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::stack(int32_t _2771_dim,monty::rc_ptr< ::mosek::fusion::Variable > _2772_v1,monty::rc_ptr< ::mosek::fusion::Variable > _2773_v2)
{
  return ::mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >{::monty::rc_ptr<::mosek::fusion::Variable>(_2772_v1.get()),::monty::rc_ptr<::mosek::fusion::Variable>(_2773_v2.get())}),_2771_dim);
}
// End mosek.fusion.Var.stack

// Begin mosek.fusion.Var.promote
// Method mosek.fusion.Var.promote @ bld/docker-win/final/default/src/fusion/Var.monty:275:6-285:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::Var::promote
  ( monty::rc_ptr< ::mosek::fusion::Variable > _2774_v,
    int32_t _2775_nd) { return mosek::fusion::p_Var::promote(_2774_v,_2775_nd); }
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::promote(monty::rc_ptr< ::mosek::fusion::Variable > _2774_v,int32_t _2775_nd)
{
  if ((_2775_nd > _2774_v->getND()))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2776_shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2775_nd)));
      _checked_ptr_1<int32_t> _ptr__2776_shape(_2776_shape ? _2776_shape->raw() : nullptr,_2776_shape ? _2776_shape->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2777_sh = _2774_v->getShape();
      _checked_ptr_1<int32_t> _ptr__2777_sh(_2777_sh ? _2777_sh->raw() : nullptr,_2777_sh ? _2777_sh->size(0) : 0);
      int32_t _10429_ = (int)0;
      int32_t _10430_ = (int)((_2777_sh)->size(0));
      for (int32_t _2778_i = _10429_; _2778_i < _10430_; ++_2778_i)
      {
        {
          _ptr__2776_shape[_2778_i] = _ptr__2777_sh[_2778_i];
        }
      }
      int32_t _10431_ = (int)((_2777_sh)->size(0));
      int32_t _10432_ = _2775_nd;
      for (int32_t _2779_i = _10431_; _2779_i < _10432_; ++_2779_i)
      {
        {
          _ptr__2776_shape[_2779_i] = (int)1;
        }
      }
      return _2774_v->__mosek_2fusion_2Variable__reshape(_2776_shape);
    }
  }
  else
  {
    {
      return _2774_v;
    }
  }
}
// End mosek.fusion.Var.promote

// Begin mosek.fusion.Var.dstack
// Method mosek.fusion.Var.dstack @ bld/docker-win/final/default/src/fusion/Var.monty:151:6-267:7
monty::rc_ptr< ::mosek::fusion::Variable > mosek::fusion::p_Var::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _2780_v,int32_t _2781_dim)
{
  if ((_2781_dim < (int)0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid stacking dimension"));
    }
  }
  {}
  monty::rc_ptr< ::mosek::fusion::Model > _2782_m0 = nullptr;
  {
    int32_t _10433_ = (int)0;
    int32_t _10434_ = (int)((_2780_v)->size(0));
    for (int32_t _2783_i = _10433_; _2783_i < _10434_; ++_2783_i)
    {
      {
        if ((NULL == _2782_m0.get()))
        {
          {
            _2782_m0 = ((*_2780_v)(_2783_i))->__mosek_2fusion_2Variable__getModel();
          }
        }
        else if(((NULL != ((*_2780_v)(_2783_i))->__mosek_2fusion_2Variable__getModel().get()) && (((*_2780_v)(_2783_i))->__mosek_2fusion_2Variable__getModel() != _2782_m0)))
        {
          {
            monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2784_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
            std::string _10435_;
            bool _10436_ = ((int)((mosek::fusion::p_Model::_get_impl(_2782_m0.get())->getName()).size()) > (int)0);
            if (_10436_)
            {
              _10435_ = mosek::fusion::p_Model::_get_impl(_2782_m0.get())->getName();
            }
            else
            {
              _10435_ = std::string ("?");
            }
            std::string _2785_m1name = _10435_;
            std::string _10437_;
            bool _10438_ = ((int)((mosek::fusion::p_Model::_get_impl(((*_2780_v)(_2783_i))->__mosek_2fusion_2Variable__getModel().get())->getName()).size()) > (int)0);
            if (_10438_)
            {
              _10437_ = mosek::fusion::p_Model::_get_impl(((*_2780_v)(_2783_i))->__mosek_2fusion_2Variable__getModel().get())->getName();
            }
            else
            {
              _10437_ = std::string ("?");
            }
            std::string _2786_m2name = _10437_;
            _2784_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Variables belong to different models: '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_2785_m1name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("' and '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_2786_m2name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"));
            throw ::mosek::fusion::ModelError(_2784_sb->toString());
          }
        }
        {}
      }
    }
  }
  if (((int)((_2780_v)->size(0)) == (int)0))
  {
    {
      return (::mosek::fusion::p_NilVariable::_new_NilVariable()).as<::mosek::fusion::Variable>();
    }
  }
  else if(((int)((_2780_v)->size(0)) == (int)1))
  {
    {
      return ((*_2780_v)((int)0));
    }
  }
  else
  {
    {
      int32_t _2787_n = (int)((_2780_v)->size(0));
      std::vector<int32_t> _10439_;
      for (int32_t _2789_i = (int)0, _10440_ = _2787_n; _2789_i < _10440_ ; ++_2789_i)
      {
        _10439_.push_back(((*_2780_v)(_2789_i))->numInst());
      }
      auto _10441_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10439_.size()),_10439_.begin(),_10439_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2788_numnz = _10441_;
      _checked_ptr_1<int32_t> _ptr__2788_numnz(_2788_numnz ? _2788_numnz->raw() : nullptr,_2788_numnz ? _2788_numnz->size(0) : 0);
      std::vector<std::shared_ptr< monty::ndarray< int32_t,1 > >> _10442_;
      for (int32_t _2791_i = (int)0, _10443_ = _2787_n; _2791_i < _10443_ ; ++_2791_i)
      {
        _10442_.push_back(((*_2780_v)(_2791_i))->getShape());
      }
      auto _10444_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 >(monty::shape(_10442_.size()),_10442_.begin(),_10442_.end()));
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _2790_shapes = _10444_;
      std::vector<int32_t> _10445_;
      for (int32_t _2793_i = (int)0, _10446_ = _2787_n; _2793_i < _10446_ ; ++_2793_i)
      {
        _10445_.push_back((int)((((*_2790_shapes)(_2793_i)))->size(0)));
      }
      auto _10447_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10445_.size()),_10445_.begin(),_10445_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2792_nds = _10447_;
      _checked_ptr_1<int32_t> _ptr__2792_nds(_2792_nds ? _2792_nds->raw() : nullptr,_2792_nds ? _2792_nds->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2794_shape0 = ((*_2790_shapes)((int)0));
      _checked_ptr_1<int32_t> _ptr__2794_shape0(_2794_shape0 ? _2794_shape0->raw() : nullptr,_2794_shape0 ? _2794_shape0->size(0) : 0);
      int32_t _2795_nd0 = _ptr__2792_nds[(int)0];
      int32_t _2796_rnnz = (int)0;
      int32_t _10448_ = (int)0;
      int32_t _10449_ = _2787_n;
      for (int32_t _2797_i = _10448_; _2797_i < _10449_; ++_2797_i)
      {
        {
          _2796_rnnz += _ptr__2788_numnz[_2797_i];
        }
      }
      int32_t _2798_rnd = safe_add( _2781_dim,(int)1 );
      int32_t _10450_ = (int)0;
      int32_t _10451_ = _2787_n;
      for (int32_t _2799_i = _10450_; _2799_i < _10451_; ++_2799_i)
      {
        {
          if ((_2798_rnd < _ptr__2792_nds[_2799_i]))
          {
            {
              _2798_rnd = _ptr__2792_nds[_2799_i];
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2800_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2798_rnd)));
      _checked_ptr_1<int32_t> _ptr__2800_rshape(_2800_rshape ? _2800_rshape->raw() : nullptr,_2800_rshape ? _2800_rshape->size(0) : 0);
      int32_t _10452_ = (int)0;
      int32_t _10453_ = _2795_nd0;
      for (int32_t _2801_i = _10452_; _2801_i < _10453_; ++_2801_i)
      {
        {
          _ptr__2800_rshape[_2801_i] = _ptr__2794_shape0[_2801_i];
        }
      }
      int32_t _10454_ = _2795_nd0;
      int32_t _10455_ = _2798_rnd;
      for (int32_t _2802_i = _10454_; _2802_i < _10455_; ++_2802_i)
      {
        {
          _ptr__2800_rshape[_2802_i] = (int)1;
        }
      }
      _ptr__2800_rshape[_2781_dim] = (int)0;
      int32_t _10456_ = (int)0;
      int32_t _10457_ = _2787_n;
      for (int32_t _2803_i = _10456_; _2803_i < _10457_; ++_2803_i)
      {
        {
          int32_t _10458_;
          bool _10459_ = ((int)((((*_2790_shapes)(_2803_i)))->size(0)) > _2781_dim);
          if (_10459_)
          {
            _10458_ = ((*((*_2790_shapes)(_2803_i)))(_2781_dim));
          }
          else
          {
            _10458_ = (int)1;
          }
          _ptr__2800_rshape[_2781_dim] += _10458_;
        }
      }
      int32_t _10460_ = (int)0;
      int32_t _10461_ = _2787_n;
      for (int32_t _2804_i = _10460_; _2804_i < _10461_; ++_2804_i)
      {
        {
          int32_t _10462_ = (int)0;
          int32_t _10463_ = (int)((((*_2790_shapes)(_2804_i)))->size(0));
          for (int32_t _2805_j = _10462_; _2805_j < _10463_; ++_2805_j)
          {
            {
              if (((_2805_j != _2781_dim) && (((*((*_2790_shapes)(_2804_i)))(_2805_j)) != _ptr__2800_rshape[_2805_j])))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Variable dimensions do not match"));
                }
              }
              {}
            }
          }
          int32_t _10464_ = (int)((((*_2790_shapes)(_2804_i)))->size(0));
          int32_t _10465_ = _2798_rnd;
          for (int32_t _2806_j = _10464_; _2806_j < _10465_; ++_2806_j)
          {
            {
              if (((_2806_j != _2781_dim) && ((int)1 != _ptr__2800_rshape[_2806_j])))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Variable dimensions do not match"));
                }
              }
              {}
            }
          }
        }
      }
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2807_rnidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2796_rnnz)));
      _checked_ptr_1<int64_t> _ptr__2807_rnidxs(_2807_rnidxs ? _2807_rnidxs->raw() : nullptr,_2807_rnidxs ? _2807_rnidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _2808_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2796_rnnz)));
      _checked_ptr_1<int64_t> _ptr__2808_rsp(_2808_rsp ? _2808_rsp->raw() : nullptr,_2808_rsp ? _2808_rsp->size(0) : 0);
      std::vector<int32_t> _10466_;
      for (int32_t _2810_i = (int)0, _10467_ = (int)((_2780_v)->size(0)); _2810_i < _10467_ ; ++_2810_i)
      {
        int32_t _10468_;
        bool _10469_ = (_2781_dim < (int)((((*_2790_shapes)(_2810_i)))->size(0)));
        if (_10469_)
        {
          _10468_ = ((*((*_2790_shapes)(_2810_i)))(_2781_dim));
        }
        else
        {
          _10468_ = (int)1;
        }
        _10466_.push_back(_10468_);
      }
      auto _10470_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10466_.size()),_10466_.begin(),_10466_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _2809_sdims = _10470_;
      _checked_ptr_1<int32_t> _ptr__2809_sdims(_2809_sdims ? _2809_sdims->raw() : nullptr,_2809_sdims ? _2809_sdims->size(0) : 0);
      int32_t _2811_d0 = (int)1;
      int32_t _10471_ = (int)0;
      int32_t _10472_ = _2781_dim;
      for (int32_t _2812_i = _10471_; _2812_i < _10472_; ++_2812_i)
      {
        {
          int32_t _10473_;
          bool _10474_ = (_2812_i < (int)((_2794_shape0)->size(0)));
          if (_10474_)
          {
            _10473_ = _ptr__2794_shape0[_2812_i];
          }
          else
          {
            _10473_ = (int)1;
          }
          _2811_d0 *= _10473_;
        }
      }
      int32_t _2813_d1 = (int)0;
      int32_t _10475_ = (int)0;
      int32_t _10476_ = _2787_n;
      for (int32_t _2814_i = _10475_; _2814_i < _10476_; ++_2814_i)
      {
        {
          _2813_d1 += _ptr__2809_sdims[_2814_i];
        }
      }
      int32_t _2815_d2 = (int)1;
      int32_t _10477_ = safe_add( _2781_dim,(int)1 );
      int32_t _10478_ = (int)((_2794_shape0)->size(0));
      for (int32_t _2816_i = _10477_; _2816_i < _10478_; ++_2816_i)
      {
        {
          _2815_d2 *= _ptr__2794_shape0[_2816_i];
        }
      }
      if ((_2811_d0 == (int)1))
      {
        {
          int32_t _2817_k = (int)0;
          int64_t _2818_kspofs = (int)0;
          int32_t _10479_ = (int)0;
          int32_t _10480_ = _2787_n;
          for (int32_t _2819_i = _10479_; _2819_i < _10480_; ++_2819_i)
          {
            {
              ((*_2780_v)(_2819_i))->inst(_2817_k,_2808_rsp,_2817_k,_2807_rnidxs);
              int32_t _10481_ = (int)0;
              int32_t _10482_ = _ptr__2788_numnz[_2819_i];
              for (int32_t _2820_j = _10481_; _2820_j < _10482_; ++_2820_j)
              {
                {
                  _ptr__2808_rsp[_2817_k] += _2818_kspofs;
                  ++ _2817_k;
                }
              }
              _2818_kspofs += ::mosek::fusion::p_Set::size(((*_2790_shapes)(_2819_i)));
            }
          }
          std::shared_ptr< monty::ndarray< int64_t,1 > > _10483_;
          bool _10484_ = (_2796_rnnz < safe_mul( safe_mul( _2811_d0,_2813_d1 ),_2815_d2 ));
          if (_10484_)
          {
            _10483_ = _2808_rsp;
          }
          else
          {
            _10483_ = nullptr;
          }
          return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2782_m0,_2800_rshape,_10483_,_2807_rnidxs)).as<::mosek::fusion::Variable>();
        }
      }
      else
      {
        {
          int32_t _2821_b = (int)0;
          int32_t _10485_ = (int)0;
          int32_t _10486_ = _2787_n;
          for (int32_t _2822_i = _10485_; _2822_i < _10486_; ++_2822_i)
          {
            {
              _2821_b += ((*_2780_v)(_2822_i))->inst(_2821_b,_2808_rsp,_2821_b,_2807_rnidxs);
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2823_curperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2796_rnnz)));
          _checked_ptr_1<int32_t> _ptr__2823_curperm(_2823_curperm ? _2823_curperm->raw() : nullptr,_2823_curperm ? _2823_curperm->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2824_tgtperm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2796_rnnz)));
          _checked_ptr_1<int32_t> _ptr__2824_tgtperm(_2824_tgtperm ? _2824_tgtperm->raw() : nullptr,_2824_tgtperm ? _2824_tgtperm->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2825_offset = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2787_n)));
          _checked_ptr_1<int32_t> _ptr__2825_offset(_2825_offset ? _2825_offset->raw() : nullptr,_2825_offset ? _2825_offset->size(0) : 0);
          int32_t _10487_ = (int)0;
          int32_t _10488_ = (_2787_n - (int)1);
          for (int32_t _2826_i = _10487_; _2826_i < _10488_; ++_2826_i)
          {
            {
              _ptr__2825_offset[safe_add( _2826_i,(int)1 )] = safe_add( _ptr__2825_offset[_2826_i],_ptr__2809_sdims[_2826_i] );
            }
          }
          int32_t _10489_ = (int)0;
          int32_t _10490_ = _2796_rnnz;
          for (int32_t _2827_i = _10489_; _2827_i < _10490_; ++_2827_i)
          {
            {
              _ptr__2823_curperm[_2827_i] = _2827_i;
            }
          }
          int32_t _2828_k = (int)0;
          int32_t _10491_ = (int)0;
          int32_t _10492_ = _2787_n;
          for (int32_t _2829_i = _10491_; _2829_i < _10492_; ++_2829_i)
          {
            {
              int32_t _10493_ = (int)0;
              int32_t _10494_ = _ptr__2788_numnz[_2829_i];
              for (int32_t _2830_j = _10493_; _2830_j < _10494_; ++_2830_j)
              {
                {
                  int64_t _2831_i0 = (_ptr__2808_rsp[_2828_k] / safe_mul( _ptr__2809_sdims[_2829_i],_2815_d2 ));
                  int64_t _2832_i1 = ((_ptr__2808_rsp[_2828_k] / _2815_d2) % _ptr__2809_sdims[_2829_i]);
                  int64_t _2833_i2 = (_ptr__2808_rsp[_2828_k] % _2815_d2);
                  _ptr__2808_rsp[_2828_k] = safe_add( safe_mul( safe_add( safe_add( safe_mul( _2831_i0,_2813_d1 ),_2832_i1 ),_ptr__2825_offset[_2829_i] ),_2815_d2 ),_2833_i2 );
                  ++ _2828_k;
                }
              }
            }
          }
          int32_t _2834_maxdim = (int)1;
          int32_t _10495_ = (int)0;
          int32_t _10496_ = _2798_rnd;
          for (int32_t _2835_i = _10495_; _2835_i < _10496_; ++_2835_i)
          {
            {
              int32_t _10497_;
              bool _10498_ = (_2834_maxdim < _ptr__2800_rshape[_2835_i]);
              if (_10498_)
              {
                _10497_ = _ptr__2800_rshape[_2835_i];
              }
              else
              {
                _10497_ = _2834_maxdim;
              }
              _2834_maxdim = _10497_;
            }
          }
          std::shared_ptr< monty::ndarray< int64_t,1 > > _2836_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_2798_rnd)));
          _checked_ptr_1<int64_t> _ptr__2836_s(_2836_s ? _2836_s->raw() : nullptr,_2836_s ? _2836_s->size(0) : 0);
          _ptr__2836_s[(_2798_rnd - (int)1)] = (int)1;
          int32_t _10499_ = (int)1;
          int32_t _10500_ = _2798_rnd;
          for (int32_t _2837_i = _10499_; _2837_i < _10500_; ++_2837_i)
          {
            {
              _ptr__2836_s[((_2798_rnd - _2837_i) - (int)1)] = safe_mul( _ptr__2836_s[(_2798_rnd - _2837_i)],_ptr__2800_rshape[(_2798_rnd - _2837_i)] );
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _2838_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _2834_maxdim,(int)1 ))));
          _checked_ptr_1<int32_t> _ptr__2838_ptr(_2838_ptr ? _2838_ptr->raw() : nullptr,_2838_ptr ? _2838_ptr->size(0) : 0);
          int32_t _10501_ = (int)0;
          int32_t _10502_ = _2798_rnd;
          for (int32_t _2839_ii = _10501_; _2839_ii < _10502_; ++_2839_ii)
          {
            {
              int32_t _2840_i = ((_2798_rnd - _2839_ii) - (int)1);
              int32_t _10503_ = (int)0;
              int32_t _10504_ = safe_add( _ptr__2800_rshape[_2840_i],(int)1 );
              for (int32_t _2841_j = _10503_; _2841_j < _10504_; ++_2841_j)
              {
                {
                  _ptr__2838_ptr[_2841_j] = (int)0;
                }
              }
              int32_t _10505_ = (int)0;
              int32_t _10506_ = _2796_rnnz;
              for (int32_t _2842_j = _10505_; _2842_j < _10506_; ++_2842_j)
              {
                {
                  ++ _ptr__2838_ptr[safe_add( ((_ptr__2808_rsp[_2842_j] / _ptr__2836_s[_2840_i]) % _ptr__2800_rshape[_2840_i]),(int)1 )];
                }
              }
              int32_t _10507_ = (int)0;
              int32_t _10508_ = _ptr__2800_rshape[_2840_i];
              for (int32_t _2843_j = _10507_; _2843_j < _10508_; ++_2843_j)
              {
                {
                  _ptr__2838_ptr[safe_add( _2843_j,(int)1 )] += _ptr__2838_ptr[_2843_j];
                }
              }
              int32_t _10509_ = (int)0;
              int32_t _10510_ = _2796_rnnz;
              for (int32_t _2844_jj = _10509_; _2844_jj < _10510_; ++_2844_jj)
              {
                {
                  int32_t _2845_j = _ptr__2823_curperm[_2844_jj];
                  int64_t _2846_idx = ((_ptr__2808_rsp[_2845_j] / _ptr__2836_s[_2840_i]) % _ptr__2800_rshape[_2840_i]);
                  _ptr__2824_tgtperm[_ptr__2838_ptr[_2846_idx]] = _2845_j;
                  ++ _ptr__2838_ptr[_2846_idx];
                }
              }
              std::shared_ptr< monty::ndarray< int32_t,1 > > _2847_tmp = _2823_curperm;
              _checked_ptr_1<int32_t> _ptr__2847_tmp(_2847_tmp ? _2847_tmp->raw() : nullptr,_2847_tmp ? _2847_tmp->size(0) : 0);
              _2823_curperm = _2824_tgtperm;
              _ptr__2823_curperm.update(_2823_curperm ? _2823_curperm->raw() : nullptr, _2823_curperm ? _2823_curperm->size(0) : 0);
              _2824_tgtperm = _2847_tmp;
              _ptr__2824_tgtperm.update(_2824_tgtperm ? _2824_tgtperm->raw() : nullptr, _2824_tgtperm ? _2824_tgtperm->size(0) : 0);
            }
          }
          std::shared_ptr< monty::ndarray< int64_t,1 > > _10511_;
          bool _10512_ = (_2796_rnnz < safe_mul( safe_mul( _2811_d0,_2813_d1 ),_2815_d2 ));
          if (_10512_)
          {
            std::vector<int64_t> _10513_;
            for (int32_t _2848_i = (int)0, _10514_ = _2796_rnnz; _2848_i < _10514_ ; ++_2848_i)
            {
              _10513_.push_back(_ptr__2808_rsp[_ptr__2823_curperm[_2848_i]]);
            }
            auto _10515_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10513_.size()),_10513_.begin(),_10513_.end()));
            _10511_ = _10515_;
          }
          else
          {
            _10511_ = nullptr;
          }
          std::vector<int64_t> _10516_;
          for (int32_t _2849_i = (int)0, _10517_ = _2796_rnnz; _2849_i < _10517_ ; ++_2849_i)
          {
            _10516_.push_back(_ptr__2807_rnidxs[_ptr__2823_curperm[_2849_i]]);
          }
          auto _10518_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10516_.size()),_10516_.begin(),_10516_.end()));
          return (::mosek::fusion::p_SliceVariable::_new_SliceVariable(_2782_m0,_2800_rshape,_10511_,_10518_)).as<::mosek::fusion::Variable>();
        }
      }
    }
  }
}
// End mosek.fusion.Var.dstack

void mosek::fusion::p_Var::destroy()
{
}
void mosek::fusion::Var::destroy() { mosek::fusion::p_Var::_get_impl(this)->destroy(); }
// } class Var
// class BoundInterfaceConstraint { // @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:26:4-69:5
mosek::fusion::BoundInterfaceConstraint::BoundInterfaceConstraint(mosek::fusion::p_BoundInterfaceConstraint *_impl) : mosek::fusion::SliceConstraint(_impl) { /*std::cout << "BoundInterfaceConstraint()" << this << std::endl; */ }
mosek::fusion::BoundInterfaceConstraint::~BoundInterfaceConstraint() {  /* std::cout << "~BoundInterfaceConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_BoundInterfaceConstraint::p_BoundInterfaceConstraint
  (::mosek::fusion::BoundInterfaceConstraint * _pubthis) :     mosek::fusion::p_SliceConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.BoundInterfaceConstraint.ctor @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:39:6-47:7
mosek::fusion::BoundInterfaceConstraint::t mosek::fusion::p_BoundInterfaceConstraint::_new_BoundInterfaceConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2850_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2851_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2852_nativeidxs,
    bool _2853_islower)
{ return new mosek::fusion::BoundInterfaceConstraint(_2850_m,_2851_shape,_2852_nativeidxs,_2853_islower); }
mosek::fusion::BoundInterfaceConstraint::BoundInterfaceConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2850_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2851_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2852_nativeidxs,
    bool _2853_islower) : 
   BoundInterfaceConstraint(new mosek::fusion::p_BoundInterfaceConstraint(this))
{ mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->_initialize(_2850_m,_2851_shape,_2852_nativeidxs,_2853_islower); }
void mosek::fusion::p_BoundInterfaceConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2850_m,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2851_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2852_nativeidxs,
    bool _2853_islower)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2851_shape(_2851_shape ? _2851_shape->raw() : nullptr, _2851_shape ? _2851_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2852_nativeidxs(_2852_nativeidxs ? _2852_nativeidxs->raw() : nullptr, _2852_nativeidxs ? _2852_nativeidxs->size(0) : 0);
    mosek::fusion::p_SliceConstraint::_initialize(_2850_m,_2851_shape,_2852_nativeidxs);
    mosek::fusion::p_BoundInterfaceConstraint::_get_impl(::mosek::fusion::BoundInterfaceConstraint::t(_pubthis))->islower = _2853_islower;
  }
}
// mosek.fusion.BoundInterfaceConstraint.ctor

// mosek.fusion.BoundInterfaceConstraint.ctor @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:31:6-37:7
mosek::fusion::BoundInterfaceConstraint::t mosek::fusion::p_BoundInterfaceConstraint::_new_BoundInterfaceConstraint
  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2854_c,
    bool _2855_islower)
{ return new mosek::fusion::BoundInterfaceConstraint(_2854_c,_2855_islower); }
mosek::fusion::BoundInterfaceConstraint::BoundInterfaceConstraint
  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2854_c,
    bool _2855_islower) : 
   BoundInterfaceConstraint(new mosek::fusion::p_BoundInterfaceConstraint(this))
{ mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->_initialize(_2854_c,_2855_islower); }
void mosek::fusion::p_BoundInterfaceConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2854_c,
    bool _2855_islower)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_SliceConstraint::_initialize(_2854_c);
    mosek::fusion::p_BoundInterfaceConstraint::_get_impl(::mosek::fusion::BoundInterfaceConstraint::t(_pubthis))->islower = _2855_islower;
  }
}
// mosek.fusion.BoundInterfaceConstraint.ctor

// Begin mosek.fusion.BoundInterfaceConstraint.dual
// Method mosek.fusion.BoundInterfaceConstraint.dual @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:64:6-68:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::BoundInterfaceConstraint :: dual() { return mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->dual(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_BoundInterfaceConstraint::dual()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2856_target = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_pubthis->getSize())));
  _checked_ptr_1<double> _ptr__2856_target(_2856_target ? _2856_target->raw() : nullptr,_2856_target ? _2856_target->size(0) : 0);
  dual_lu((int)0,_2856_target,islower);
  return _2856_target;
}
// End mosek.fusion.BoundInterfaceConstraint.dual

// Begin mosek.fusion.BoundInterfaceConstraint.slice
// Method mosek.fusion.BoundInterfaceConstraint.slice @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:62:6-124
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint :: __mosek_2fusion_2BoundInterfaceConstraint__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2857_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2858_lasta) { return mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->__mosek_2fusion_2BoundInterfaceConstraint__slice(_2857_firsta,_2858_lasta); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2857_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2858_lasta) { return __mosek_2fusion_2BoundInterfaceConstraint__slice(_2857_firsta,_2858_lasta); }
/* override: mosek.fusion.Constraint.slice*/
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::__mosek_2fusion_2Constraint__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2857_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2858_lasta) { return __mosek_2fusion_2BoundInterfaceConstraint__slice(_2857_firsta,_2858_lasta); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_BoundInterfaceConstraint::__mosek_2fusion_2BoundInterfaceConstraint__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _2857_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _2858_lasta)
{
  _checked_ptr_1<int32_t> _ptr__2857_firsta(_2857_firsta ? _2857_firsta->raw() : nullptr, _2857_firsta ? _2857_firsta->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2858_lasta(_2858_lasta ? _2858_lasta->raw() : nullptr, _2858_lasta ? _2858_lasta->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Constraint > _2859_c = ::mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__slice(_2857_firsta,_2858_lasta);
  return (__mosek_2fusion_2BoundInterfaceConstraint__from_(_2859_c)).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.BoundInterfaceConstraint.slice

// Begin mosek.fusion.BoundInterfaceConstraint.slice
// Method mosek.fusion.BoundInterfaceConstraint.slice @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:61:6-122
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint :: __mosek_2fusion_2BoundInterfaceConstraint__slice(int32_t _2860_first,int32_t _2861_last) { return mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->__mosek_2fusion_2BoundInterfaceConstraint__slice(_2860_first,_2861_last); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::slice(int32_t _2860_first,int32_t _2861_last) { return __mosek_2fusion_2BoundInterfaceConstraint__slice(_2860_first,_2861_last); }
/* override: mosek.fusion.Constraint.slice*/
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::__mosek_2fusion_2Constraint__slice(int32_t _2860_first,int32_t _2861_last) { return __mosek_2fusion_2BoundInterfaceConstraint__slice(_2860_first,_2861_last); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_BoundInterfaceConstraint::__mosek_2fusion_2BoundInterfaceConstraint__slice(int32_t _2860_first,int32_t _2861_last)
{
  monty::rc_ptr< ::mosek::fusion::Constraint > _2862_c = ::mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__slice(_2860_first,_2861_last);
  return (__mosek_2fusion_2BoundInterfaceConstraint__from_(_2862_c)).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.BoundInterfaceConstraint.slice

// Begin mosek.fusion.BoundInterfaceConstraint.index
// Method mosek.fusion.BoundInterfaceConstraint.index @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:60:6-115
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint :: __mosek_2fusion_2BoundInterfaceConstraint__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2863_idxa) { return mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->__mosek_2fusion_2BoundInterfaceConstraint__index(_2863_idxa); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2863_idxa) { return __mosek_2fusion_2BoundInterfaceConstraint__index(_2863_idxa); }
/* override: mosek.fusion.Constraint.index*/
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::__mosek_2fusion_2Constraint__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2863_idxa) { return __mosek_2fusion_2BoundInterfaceConstraint__index(_2863_idxa); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_BoundInterfaceConstraint::__mosek_2fusion_2BoundInterfaceConstraint__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _2863_idxa)
{
  _checked_ptr_1<int32_t> _ptr__2863_idxa(_2863_idxa ? _2863_idxa->raw() : nullptr, _2863_idxa ? _2863_idxa->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Constraint > _2864_c = ::mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__index(_2863_idxa);
  return (__mosek_2fusion_2BoundInterfaceConstraint__from_(_2864_c)).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.BoundInterfaceConstraint.index

// Begin mosek.fusion.BoundInterfaceConstraint.index
// Method mosek.fusion.BoundInterfaceConstraint.index @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:59:6-114
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint :: __mosek_2fusion_2BoundInterfaceConstraint__index(int32_t _2865_idx) { return mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->__mosek_2fusion_2BoundInterfaceConstraint__index(_2865_idx); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::index(int32_t _2865_idx) { return __mosek_2fusion_2BoundInterfaceConstraint__index(_2865_idx); }
/* override: mosek.fusion.Constraint.index*/
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::BoundInterfaceConstraint::__mosek_2fusion_2Constraint__index(int32_t _2865_idx) { return __mosek_2fusion_2BoundInterfaceConstraint__index(_2865_idx); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_BoundInterfaceConstraint::__mosek_2fusion_2BoundInterfaceConstraint__index(int32_t _2865_idx)
{
  monty::rc_ptr< ::mosek::fusion::Constraint > _2866_c = ::mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__index(_2865_idx);
  return (__mosek_2fusion_2BoundInterfaceConstraint__from_(_2866_c)).as<::mosek::fusion::Constraint>();
}
// End mosek.fusion.BoundInterfaceConstraint.index

// Begin mosek.fusion.BoundInterfaceConstraint.from_
// Method mosek.fusion.BoundInterfaceConstraint.from_ @ bld/docker-win/final/default/src/fusion/BoundInterfaceConstraint.mbi:49:6-57:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::p_BoundInterfaceConstraint::__mosek_2fusion_2BoundInterfaceConstraint__from_(monty::rc_ptr< ::mosek::fusion::Constraint > _2867_c)
{
  monty::rc_ptr< ::mosek::fusion::Constraint > _10519_ = _2867_c;
  if (false) {}
  else if (nullptr != dynamic_cast<::mosek::fusion::SliceConstraint*>(_10519_.get()))
  {
    ::mosek::fusion::SliceConstraint::t _2868_cc (dynamic_cast<::mosek::fusion::SliceConstraint*>(_10519_.get()));
    {
      return ::mosek::fusion::p_BoundInterfaceConstraint::_new_BoundInterfaceConstraint(_2868_cc,islower);
    }
  }
  else
  {
    mosek::fusion::Constraint::t _2869_cc = _10519_;
    {
      return nullptr;
    }
  }
}
// End mosek.fusion.BoundInterfaceConstraint.from_

void mosek::fusion::p_BoundInterfaceConstraint::destroy()
{
}
void mosek::fusion::BoundInterfaceConstraint::destroy() { mosek::fusion::p_BoundInterfaceConstraint::_get_impl(this)->destroy(); }
// } class BoundInterfaceConstraint
// class LinearPSDConstraint { // @ bld/docker-win/final/default/src/fusion/LinearPSDConstraint.monty:17:4-183:5
mosek::fusion::LinearPSDConstraint::LinearPSDConstraint(mosek::fusion::p_LinearPSDConstraint *_impl) : mosek::fusion::ModelConstraint(_impl) { /*std::cout << "LinearPSDConstraint()" << this << std::endl; */ }
mosek::fusion::LinearPSDConstraint::~LinearPSDConstraint() {  /* std::cout << "~LinearPSDConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_LinearPSDConstraint::p_LinearPSDConstraint
  (::mosek::fusion::LinearPSDConstraint * _pubthis) :     mosek::fusion::p_ModelConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.LinearPSDConstraint.ctor @ bld/docker-win/final/default/src/fusion/LinearPSDConstraint.monty:48:6-58:7
mosek::fusion::LinearPSDConstraint::t mosek::fusion::p_LinearPSDConstraint::_new_LinearPSDConstraint
  (monty::rc_ptr< ::mosek::fusion::LinearPSDConstraint > _2870_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2871_m)
{ return new mosek::fusion::LinearPSDConstraint(_2870_c,_2871_m); }
mosek::fusion::LinearPSDConstraint::LinearPSDConstraint
  (monty::rc_ptr< ::mosek::fusion::LinearPSDConstraint > _2870_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2871_m) : 
   LinearPSDConstraint(new mosek::fusion::p_LinearPSDConstraint(this))
{ mosek::fusion::p_LinearPSDConstraint::_get_impl(this)->_initialize(_2870_c,_2871_m); }
void mosek::fusion::p_LinearPSDConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearPSDConstraint > _2870_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2871_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelConstraint::_initialize(_2870_c,_2871_m);
    conid = mosek::fusion::p_LinearPSDConstraint::_get_impl(_2870_c)->conid;
    slackidxs = mosek::fusion::p_LinearPSDConstraint::_get_impl(_2870_c)->slackidxs;
    nativeidxs = mosek::fusion::p_LinearPSDConstraint::_get_impl(_2870_c)->nativeidxs;
    conedim = mosek::fusion::p_LinearPSDConstraint::_get_impl(_2870_c)->conedim;
    shape = mosek::fusion::p_LinearPSDConstraint::_get_impl(_2870_c)->shape;
  }
}
// mosek.fusion.LinearPSDConstraint.ctor

// mosek.fusion.LinearPSDConstraint.ctor @ bld/docker-win/final/default/src/fusion/LinearPSDConstraint.monty:27:6-46:7
mosek::fusion::LinearPSDConstraint::t mosek::fusion::p_LinearPSDConstraint::_new_LinearPSDConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2872_model,
    const std::string &  _2873_name,
    int32_t _2874_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2875_shape,
    int32_t _2876_conedim,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2877_nativeidxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2878_slackidxs)
{ return new mosek::fusion::LinearPSDConstraint(_2872_model,_2873_name,_2874_conid,_2875_shape,_2876_conedim,_2877_nativeidxs,_2878_slackidxs); }
mosek::fusion::LinearPSDConstraint::LinearPSDConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2872_model,
    const std::string &  _2873_name,
    int32_t _2874_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2875_shape,
    int32_t _2876_conedim,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2877_nativeidxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2878_slackidxs) : 
   LinearPSDConstraint(new mosek::fusion::p_LinearPSDConstraint(this))
{ mosek::fusion::p_LinearPSDConstraint::_get_impl(this)->_initialize(_2872_model,_2873_name,_2874_conid,_2875_shape,_2876_conedim,_2877_nativeidxs,_2878_slackidxs); }
void mosek::fusion::p_LinearPSDConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2872_model,
    const std::string &  _2873_name,
    int32_t _2874_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2875_shape,
    int32_t _2876_conedim,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2877_nativeidxs,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2878_slackidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2875_shape(_2875_shape ? _2875_shape->raw() : nullptr, _2875_shape ? _2875_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2877_nativeidxs(_2877_nativeidxs ? _2877_nativeidxs->raw() : nullptr, _2877_nativeidxs ? _2877_nativeidxs->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2878_slackidxs(_2878_slackidxs ? _2878_slackidxs->raw() : nullptr, _2878_slackidxs ? _2878_slackidxs->size(0) : 0);
    mosek::fusion::p_ModelConstraint::_initialize(_2872_model,_2873_name,_2875_shape,_2877_nativeidxs,_2874_conid);
    mosek::fusion::p_LinearPSDConstraint::_get_impl(::mosek::fusion::LinearPSDConstraint::t(_pubthis))->conid = _2874_conid;
    mosek::fusion::p_LinearPSDConstraint::_get_impl(::mosek::fusion::LinearPSDConstraint::t(_pubthis))->slackidxs = _2878_slackidxs;
    mosek::fusion::p_LinearPSDConstraint::_get_impl(::mosek::fusion::LinearPSDConstraint::t(_pubthis))->nativeidxs = _2877_nativeidxs;
    mosek::fusion::p_LinearPSDConstraint::_get_impl(::mosek::fusion::LinearPSDConstraint::t(_pubthis))->conedim = _2876_conedim;
    mosek::fusion::p_LinearPSDConstraint::_get_impl(::mosek::fusion::LinearPSDConstraint::t(_pubthis))->shape = _2875_shape;
  }
}
// mosek.fusion.LinearPSDConstraint.ctor

// Begin mosek.fusion.LinearPSDConstraint.domainToString
// Method mosek.fusion.LinearPSDConstraint.domainToString @ bld/docker-win/final/default/src/fusion/LinearPSDConstraint.monty:174:6-182:7
void mosek::fusion::p_LinearPSDConstraint::domainToString(int64_t _2879_i,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2880_sb)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2881_k = ::mosek::fusion::p_Set::idxtokey(shape,_2879_i);
  _checked_ptr_1<int32_t> _ptr__2881_k(_2881_k ? _2881_k->raw() : nullptr,_2881_k ? _2881_k->size(0) : 0);
  _2880_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" : element ("))->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__2881_k[(int)0]);
  int32_t _10520_ = (int)1;
  int32_t _10521_ = (int)((_2881_k)->size(0));
  for (int32_t _2882_j = _10520_; _2882_j < _10521_; ++_2882_j)
  {
    {
      _2880_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__2881_k[_2882_j]);
    }
  }
  _2880_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (") in a positive semi-definite cone of size ("))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
  int32_t _10522_ = (int)1;
  int32_t _10523_ = (int)((_2881_k)->size(0));
  for (int32_t _2883_j = _10522_; _2883_j < _10523_; ++_2883_j)
  {
    {
      _2880_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_2883_j)));
    }
  }
  _2880_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
}
// End mosek.fusion.LinearPSDConstraint.domainToString

// Begin mosek.fusion.LinearPSDConstraint.clone
// Method mosek.fusion.LinearPSDConstraint.clone @ bld/docker-win/final/default/src/fusion/LinearPSDConstraint.monty:60:6-63:7
monty::rc_ptr< ::mosek::fusion::ModelConstraint > mosek::fusion::p_LinearPSDConstraint::__mosek_2fusion_2LinearPSDConstraint__clone(monty::rc_ptr< ::mosek::fusion::Model > _2884_m)
{
  return (::mosek::fusion::p_LinearPSDConstraint::_new_LinearPSDConstraint(::mosek::fusion::LinearPSDConstraint::t(_pubthis),_2884_m)).as<::mosek::fusion::ModelConstraint>();
}
// End mosek.fusion.LinearPSDConstraint.clone

void mosek::fusion::p_LinearPSDConstraint::destroy()
{
  shape.reset();
  slackidxs.reset();
  nativeidxs.reset();
}
void mosek::fusion::LinearPSDConstraint::destroy() { mosek::fusion::p_LinearPSDConstraint::_get_impl(this)->destroy(); }
// } class LinearPSDConstraint
// class PSDConstraint { // @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:17:4-146:5
mosek::fusion::PSDConstraint::PSDConstraint(mosek::fusion::p_PSDConstraint *_impl) : mosek::fusion::ModelConstraint(_impl) { /*std::cout << "PSDConstraint()" << this << std::endl; */ }
mosek::fusion::PSDConstraint::~PSDConstraint() {  /* std::cout << "~PSDConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_PSDConstraint::p_PSDConstraint
  (::mosek::fusion::PSDConstraint * _pubthis) :     mosek::fusion::p_ModelConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.PSDConstraint.ctor @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:104:6-117:7
mosek::fusion::PSDConstraint::t mosek::fusion::p_PSDConstraint::_new_PSDConstraint
  (monty::rc_ptr< ::mosek::fusion::PSDConstraint > _2885_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2886_m)
{ return new mosek::fusion::PSDConstraint(_2885_c,_2886_m); }
mosek::fusion::PSDConstraint::PSDConstraint
  (monty::rc_ptr< ::mosek::fusion::PSDConstraint > _2885_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2886_m) : 
   PSDConstraint(new mosek::fusion::p_PSDConstraint(this))
{ mosek::fusion::p_PSDConstraint::_get_impl(this)->_initialize(_2885_c,_2886_m); }
void mosek::fusion::p_PSDConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::PSDConstraint > _2885_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2886_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelConstraint::_initialize(_2885_c,_2886_m);
    conid = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->conid;
    name = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->name;
    shape = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->shape;
    slackidxs = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->slackidxs;
    nativeidxs = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->nativeidxs;
    names_flushed = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->names_flushed;
    conedim0 = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->conedim0;
    conedim1 = mosek::fusion::p_PSDConstraint::_get_impl(_2885_c)->conedim1;
  }
}
// mosek.fusion.PSDConstraint.ctor

// mosek.fusion.PSDConstraint.ctor @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:78:6-102:7
mosek::fusion::PSDConstraint::t mosek::fusion::p_PSDConstraint::_new_PSDConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2887_model,
    const std::string &  _2888_name,
    int32_t _2889_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2890_shape,
    int32_t _2891_conedim0,
    int32_t _2892_conedim1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2893_slackidxs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2894_nativeidxs)
{ return new mosek::fusion::PSDConstraint(_2887_model,_2888_name,_2889_conid,_2890_shape,_2891_conedim0,_2892_conedim1,_2893_slackidxs,_2894_nativeidxs); }
mosek::fusion::PSDConstraint::PSDConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2887_model,
    const std::string &  _2888_name,
    int32_t _2889_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2890_shape,
    int32_t _2891_conedim0,
    int32_t _2892_conedim1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2893_slackidxs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2894_nativeidxs) : 
   PSDConstraint(new mosek::fusion::p_PSDConstraint(this))
{ mosek::fusion::p_PSDConstraint::_get_impl(this)->_initialize(_2887_model,_2888_name,_2889_conid,_2890_shape,_2891_conedim0,_2892_conedim1,_2893_slackidxs,_2894_nativeidxs); }
void mosek::fusion::p_PSDConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2887_model,
    const std::string &  _2888_name,
    int32_t _2889_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2890_shape,
    int32_t _2891_conedim0,
    int32_t _2892_conedim1,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _2893_slackidxs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2894_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2890_shape(_2890_shape ? _2890_shape->raw() : nullptr, _2890_shape ? _2890_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__2893_slackidxs(_2893_slackidxs ? _2893_slackidxs->raw() : nullptr, _2893_slackidxs ? _2893_slackidxs->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2894_nativeidxs(_2894_nativeidxs ? _2894_nativeidxs->raw() : nullptr, _2894_nativeidxs ? _2894_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelConstraint::_initialize(_2887_model,_2888_name,_2890_shape,::mosek::fusion::p_PSDConstraint::computenidxs(_2890_shape,_2891_conedim0,_2892_conedim1,_2894_nativeidxs),_2889_conid);
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->conid = _2889_conid;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->nativeidxs = _2894_nativeidxs;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->slackidxs = _2893_slackidxs;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->name = _2888_name;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->shape = _2890_shape;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->conedim0 = _2891_conedim0;
    mosek::fusion::p_PSDConstraint::_get_impl(::mosek::fusion::PSDConstraint::t(_pubthis))->conedim1 = _2892_conedim1;
    names_flushed = false;
  }
}
// mosek.fusion.PSDConstraint.ctor

// Begin mosek.fusion.PSDConstraint.toString
// Method mosek.fusion.PSDConstraint.toString @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:133:6-145:7
std::string mosek::fusion::PSDConstraint :: toString() { return mosek::fusion::p_PSDConstraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_PSDConstraint::toString()
{
  throw ::mosek::fusion::UnimplementedError(std::string ("PSDConstraint.toString not implemented"));
}
// End mosek.fusion.PSDConstraint.toString

// Begin mosek.fusion.PSDConstraint.clone
// Method mosek.fusion.PSDConstraint.clone @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:119:6-122:7
monty::rc_ptr< ::mosek::fusion::ModelConstraint > mosek::fusion::p_PSDConstraint::__mosek_2fusion_2PSDConstraint__clone(monty::rc_ptr< ::mosek::fusion::Model > _2895_m)
{
  return (::mosek::fusion::p_PSDConstraint::_new_PSDConstraint(::mosek::fusion::PSDConstraint::t(_pubthis),_2895_m)).as<::mosek::fusion::ModelConstraint>();
}
// End mosek.fusion.PSDConstraint.clone

// Begin mosek.fusion.PSDConstraint.computenidxs
// Method mosek.fusion.PSDConstraint.computenidxs @ bld/docker-win/final/default/src/fusion/SemidefiniteConstraint.mbi:31:6-72:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_PSDConstraint::computenidxs(std::shared_ptr< monty::ndarray< int32_t,1 > > _2896_shape,int32_t _2897_d0,int32_t _2898_d1,std::shared_ptr< monty::ndarray< int32_t,1 > > _2899_nativeidxs)
{
  _checked_ptr_1<int32_t> _ptr__2896_shape(_2896_shape ? _2896_shape->raw() : nullptr, _2896_shape ? _2896_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__2899_nativeidxs(_2899_nativeidxs ? _2899_nativeidxs->raw() : nullptr, _2899_nativeidxs ? _2899_nativeidxs->size(0) : 0);
  int32_t _2900_nd = (int)((_2896_shape)->size(0));
  bool _2901_tril = (_2897_d0 < _2898_d1);
  int32_t _10524_;
  bool _10525_ = _2901_tril;
  if (_10525_)
  {
    _10524_ = _2897_d0;
  }
  else
  {
    _10524_ = _2898_d1;
  }
  int32_t _2902_conedim0 = _10524_;
  int32_t _10526_;
  bool _10527_ = _2901_tril;
  if (_10527_)
  {
    _10526_ = _2898_d1;
  }
  else
  {
    _10526_ = _2897_d0;
  }
  int32_t _2903_conedim1 = _10526_;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2904_dim = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((int)1),(int32_t)((int)1),(int32_t)((int)1),(int32_t)((int)1)});
  _checked_ptr_1<int32_t> _ptr__2904_dim(_2904_dim ? _2904_dim->raw() : nullptr,_2904_dim ? _2904_dim->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2905_stride = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)5)));
  _checked_ptr_1<int32_t> _ptr__2905_stride(_2905_stride ? _2905_stride->raw() : nullptr,_2905_stride ? _2905_stride->size(0) : 0);
  int32_t _2906_size = (int)1;
  int32_t _10528_ = (int)0;
  int32_t _10529_ = (int)((_2896_shape)->size(0));
  for (int32_t _2907_i = _10528_; _2907_i < _10529_; ++_2907_i)
  {
    {
      _2906_size *= _ptr__2896_shape[_2907_i];
    }
  }
  int32_t _10530_ = (int)0;
  int32_t _10531_ = _2902_conedim0;
  for (int32_t _2908_i = _10530_; _2908_i < _10531_; ++_2908_i)
  {
    {
      _ptr__2904_dim[(int)0] *= _ptr__2896_shape[_2908_i];
    }
  }
  _ptr__2904_dim[(int)1] = _ptr__2896_shape[_2902_conedim0];
  int32_t _10532_ = safe_add( _2902_conedim0,(int)1 );
  int32_t _10533_ = _2903_conedim1;
  for (int32_t _2909_i = _10532_; _2909_i < _10533_; ++_2909_i)
  {
    {
      _ptr__2904_dim[(int)2] *= _ptr__2896_shape[_2909_i];
    }
  }
  _ptr__2904_dim[(int)3] = _ptr__2896_shape[_2903_conedim1];
  int32_t _10534_ = safe_add( _2903_conedim1,(int)1 );
  int32_t _10535_ = _2900_nd;
  for (int32_t _2910_i = _10534_; _2910_i < _10535_; ++_2910_i)
  {
    {
      _ptr__2904_dim[(int)4] *= _ptr__2896_shape[_2910_i];
    }
  }
  _ptr__2905_stride[(int)4] = (int)1;
  int32_t _10536_ = (int)1;
  int32_t _10537_ = (int)5;
  for (int32_t _2911_i = _10536_; _2911_i < _10537_; ++_2911_i)
  {
    {
      _ptr__2905_stride[(((int)5 - _2911_i) - (int)1)] = safe_mul( _ptr__2905_stride[((int)5 - _2911_i)],_ptr__2904_dim[((int)5 - _2911_i)] );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2912_nidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_2906_size)));
  _checked_ptr_1<int32_t> _ptr__2912_nidxs(_2912_nidxs ? _2912_nidxs->raw() : nullptr,_2912_nidxs ? _2912_nidxs->size(0) : 0);
  int32_t _2913_k = (int)0;
  if (_2901_tril)
  {
    {
      int32_t _10538_ = (int)0;
      int32_t _10539_ = _ptr__2904_dim[(int)0];
      for (int32_t _2914_i0 = _10538_; _2914_i0 < _10539_; ++_2914_i0)
      {
        {
          int32_t _10540_ = (int)0;
          int32_t _10541_ = _ptr__2904_dim[(int)1];
          for (int32_t _2915_i1 = _10540_; _2915_i1 < _10541_; ++_2915_i1)
          {
            {
              int32_t _10542_ = (int)0;
              int32_t _10543_ = _ptr__2904_dim[(int)2];
              for (int32_t _2916_i2 = _10542_; _2916_i2 < _10543_; ++_2916_i2)
              {
                {
                  int32_t _10544_ = _2915_i1;
                  int32_t _10545_ = _ptr__2904_dim[(int)1];
                  for (int32_t _2917_i3 = _10544_; _2917_i3 < _10545_; ++_2917_i3)
                  {
                    {
                      int32_t _10546_ = (int)0;
                      int32_t _10547_ = _ptr__2904_dim[(int)4];
                      for (int32_t _2918_i4 = _10546_; _2918_i4 < _10547_; ++_2918_i4)
                      {
                        {
                          _ptr__2912_nidxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2914_i0,_ptr__2905_stride[(int)0] ),safe_mul( _2915_i1,_ptr__2905_stride[(int)1] ) ),safe_mul( _2916_i2,_ptr__2905_stride[(int)2] ) ),safe_mul( _2917_i3,_ptr__2905_stride[(int)3] ) ),safe_mul( _2918_i4,_ptr__2905_stride[(int)4] ) )] = _ptr__2899_nativeidxs[_2913_k];
                          _ptr__2912_nidxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2914_i0,_ptr__2905_stride[(int)0] ),safe_mul( _2917_i3,_ptr__2905_stride[(int)1] ) ),safe_mul( _2916_i2,_ptr__2905_stride[(int)2] ) ),safe_mul( _2915_i1,_ptr__2905_stride[(int)3] ) ),safe_mul( _2918_i4,_ptr__2905_stride[(int)4] ) )] = _ptr__2899_nativeidxs[_2913_k];
                          ++ _2913_k;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _10548_ = (int)0;
      int32_t _10549_ = _ptr__2904_dim[(int)0];
      for (int32_t _2919_i0 = _10548_; _2919_i0 < _10549_; ++_2919_i0)
      {
        {
          int32_t _10550_ = (int)0;
          int32_t _10551_ = _ptr__2904_dim[(int)1];
          for (int32_t _2920_i1 = _10550_; _2920_i1 < _10551_; ++_2920_i1)
          {
            {
              int32_t _10552_ = (int)0;
              int32_t _10553_ = _ptr__2904_dim[(int)2];
              for (int32_t _2921_i2 = _10552_; _2921_i2 < _10553_; ++_2921_i2)
              {
                {
                  int32_t _10554_ = (int)0;
                  int32_t _10555_ = safe_add( _2920_i1,(int)1 );
                  for (int32_t _2922_i3 = _10554_; _2922_i3 < _10555_; ++_2922_i3)
                  {
                    {
                      int32_t _10556_ = (int)0;
                      int32_t _10557_ = _ptr__2904_dim[(int)4];
                      for (int32_t _2923_i4 = _10556_; _2923_i4 < _10557_; ++_2923_i4)
                      {
                        {
                          _ptr__2912_nidxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2919_i0,_ptr__2905_stride[(int)0] ),safe_mul( _2920_i1,_ptr__2905_stride[(int)1] ) ),safe_mul( _2921_i2,_ptr__2905_stride[(int)2] ) ),safe_mul( _2922_i3,_ptr__2905_stride[(int)3] ) ),safe_mul( _2923_i4,_ptr__2905_stride[(int)4] ) )] = _ptr__2899_nativeidxs[_2913_k];
                          _ptr__2912_nidxs[safe_add( safe_add( safe_add( safe_add( safe_mul( _2919_i0,_ptr__2905_stride[(int)0] ),safe_mul( _2922_i3,_ptr__2905_stride[(int)1] ) ),safe_mul( _2921_i2,_ptr__2905_stride[(int)2] ) ),safe_mul( _2920_i1,_ptr__2905_stride[(int)3] ) ),safe_mul( _2923_i4,_ptr__2905_stride[(int)4] ) )] = _ptr__2899_nativeidxs[_2913_k];
                          ++ _2913_k;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return _2912_nidxs;
}
// End mosek.fusion.PSDConstraint.computenidxs

void mosek::fusion::p_PSDConstraint::destroy()
{
  shape.reset();
  slackidxs.reset();
  nativeidxs.reset();
}
void mosek::fusion::PSDConstraint::destroy() { mosek::fusion::p_PSDConstraint::_get_impl(this)->destroy(); }
// } class PSDConstraint
// class SliceConstraint { // @ bld/docker-win/final/default/src/fusion/SliceConstraint.mbi:23:4-43:5
mosek::fusion::SliceConstraint::SliceConstraint(mosek::fusion::p_SliceConstraint *_impl) : mosek::fusion::Constraint(_impl) { /*std::cout << "SliceConstraint()" << this << std::endl; */ }
mosek::fusion::SliceConstraint::~SliceConstraint() {  /* std::cout << "~SliceConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_SliceConstraint::p_SliceConstraint
  (::mosek::fusion::SliceConstraint * _pubthis) :     mosek::fusion::p_Constraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.SliceConstraint.ctor @ bld/docker-win/final/default/src/fusion/SliceConstraint.mbi:33:6-36:7
mosek::fusion::SliceConstraint::t mosek::fusion::p_SliceConstraint::_new_SliceConstraint
  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2924_c)
{ return new mosek::fusion::SliceConstraint(_2924_c); }
mosek::fusion::SliceConstraint::SliceConstraint
  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2924_c) : 
   SliceConstraint(new mosek::fusion::p_SliceConstraint(this))
{ mosek::fusion::p_SliceConstraint::_get_impl(this)->_initialize(_2924_c); }
void mosek::fusion::p_SliceConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::SliceConstraint > _2924_c)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Constraint::_initialize(_2924_c,_2924_c->__mosek_2fusion_2Constraint__getModel());
  }
}
// mosek.fusion.SliceConstraint.ctor

// mosek.fusion.SliceConstraint.ctor @ bld/docker-win/final/default/src/fusion/SliceConstraint.mbi:26:6-31:7
mosek::fusion::SliceConstraint::t mosek::fusion::p_SliceConstraint::_new_SliceConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2925_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2926_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2927_nativeidxs)
{ return new mosek::fusion::SliceConstraint(_2925_model,_2926_shape,_2927_nativeidxs); }
mosek::fusion::SliceConstraint::SliceConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2925_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2926_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2927_nativeidxs) : 
   SliceConstraint(new mosek::fusion::p_SliceConstraint(this))
{ mosek::fusion::p_SliceConstraint::_get_impl(this)->_initialize(_2925_model,_2926_shape,_2927_nativeidxs); }
void mosek::fusion::p_SliceConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2925_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2926_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2927_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2926_shape(_2926_shape ? _2926_shape->raw() : nullptr, _2926_shape ? _2926_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2927_nativeidxs(_2927_nativeidxs ? _2927_nativeidxs->raw() : nullptr, _2927_nativeidxs ? _2927_nativeidxs->size(0) : 0);
    mosek::fusion::p_Constraint::_initialize(_2925_model,_2926_shape,_2927_nativeidxs);
  }
}
// mosek.fusion.SliceConstraint.ctor

// Begin mosek.fusion.SliceConstraint.toString
// Method mosek.fusion.SliceConstraint.toString @ bld/docker-win/final/default/src/fusion/SliceConstraint.mbi:38:6-42:7
std::string mosek::fusion::SliceConstraint :: toString() { return mosek::fusion::p_SliceConstraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_SliceConstraint::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2928_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2928_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("SliceConstraint()"));
  return _2928_sb->toString();
}
// End mosek.fusion.SliceConstraint.toString

void mosek::fusion::p_SliceConstraint::destroy()
{
}
void mosek::fusion::SliceConstraint::destroy() { mosek::fusion::p_SliceConstraint::_get_impl(this)->destroy(); }
// } class SliceConstraint
// class RangedConstraint { // @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:13:4-204:5
mosek::fusion::RangedConstraint::RangedConstraint(mosek::fusion::p_RangedConstraint *_impl) : mosek::fusion::ModelConstraint(_impl) { /*std::cout << "RangedConstraint()" << this << std::endl; */ }
mosek::fusion::RangedConstraint::~RangedConstraint() {  /* std::cout << "~RangedConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_RangedConstraint::p_RangedConstraint
  (::mosek::fusion::RangedConstraint * _pubthis) :     mosek::fusion::p_ModelConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.RangedConstraint.ctor @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:32:6-39:7
mosek::fusion::RangedConstraint::t mosek::fusion::p_RangedConstraint::_new_RangedConstraint
  (monty::rc_ptr< ::mosek::fusion::RangedConstraint > _2929_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2930_m)
{ return new mosek::fusion::RangedConstraint(_2929_c,_2930_m); }
mosek::fusion::RangedConstraint::RangedConstraint
  (monty::rc_ptr< ::mosek::fusion::RangedConstraint > _2929_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2930_m) : 
   RangedConstraint(new mosek::fusion::p_RangedConstraint(this))
{ mosek::fusion::p_RangedConstraint::_get_impl(this)->_initialize(_2929_c,_2930_m); }
void mosek::fusion::p_RangedConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::RangedConstraint > _2929_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2930_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelConstraint::_initialize(_2929_c,_2930_m);
    shape = mosek::fusion::p_RangedConstraint::_get_impl(_2929_c)->shape;
    nativeidxs = mosek::fusion::p_RangedConstraint::_get_impl(_2929_c)->nativeidxs;
  }
}
// mosek.fusion.RangedConstraint.ctor

// mosek.fusion.RangedConstraint.ctor @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:19:6-29:7
mosek::fusion::RangedConstraint::t mosek::fusion::p_RangedConstraint::_new_RangedConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2931_model,
    const std::string &  _2932_name,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2933_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2934_nativeidxs,
    int32_t _2935_conid)
{ return new mosek::fusion::RangedConstraint(_2931_model,_2932_name,_2933_shape,_2934_nativeidxs,_2935_conid); }
mosek::fusion::RangedConstraint::RangedConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2931_model,
    const std::string &  _2932_name,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2933_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2934_nativeidxs,
    int32_t _2935_conid) : 
   RangedConstraint(new mosek::fusion::p_RangedConstraint(this))
{ mosek::fusion::p_RangedConstraint::_get_impl(this)->_initialize(_2931_model,_2932_name,_2933_shape,_2934_nativeidxs,_2935_conid); }
void mosek::fusion::p_RangedConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2931_model,
    const std::string &  _2932_name,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2933_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2934_nativeidxs,
    int32_t _2935_conid)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2933_shape(_2933_shape ? _2933_shape->raw() : nullptr, _2933_shape ? _2933_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2934_nativeidxs(_2934_nativeidxs ? _2934_nativeidxs->raw() : nullptr, _2934_nativeidxs ? _2934_nativeidxs->size(0) : 0);
    mosek::fusion::p_ModelConstraint::_initialize(_2931_model,_2932_name,_2933_shape,_2934_nativeidxs,_2935_conid);
    mosek::fusion::p_RangedConstraint::_get_impl(::mosek::fusion::RangedConstraint::t(_pubthis))->shape = _2933_shape;
    mosek::fusion::p_RangedConstraint::_get_impl(::mosek::fusion::RangedConstraint::t(_pubthis))->nativeidxs = _2934_nativeidxs;
  }
}
// mosek.fusion.RangedConstraint.ctor

// Begin mosek.fusion.RangedConstraint.upperBoundCon
// Method mosek.fusion.RangedConstraint.upperBoundCon @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:55:6-57:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::RangedConstraint :: __mosek_2fusion_2RangedConstraint__upperBoundCon() { return mosek::fusion::p_RangedConstraint::_get_impl(this)->__mosek_2fusion_2RangedConstraint__upperBoundCon(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::RangedConstraint::upperBoundCon() { return __mosek_2fusion_2RangedConstraint__upperBoundCon(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::p_RangedConstraint::__mosek_2fusion_2RangedConstraint__upperBoundCon()
{
  return ::mosek::fusion::p_BoundInterfaceConstraint::_new_BoundInterfaceConstraint(_pubthis->__mosek_2fusion_2Constraint__getModel(),shape,nativeidxs,false);
}
// End mosek.fusion.RangedConstraint.upperBoundCon

// Begin mosek.fusion.RangedConstraint.lowerBoundCon
// Method mosek.fusion.RangedConstraint.lowerBoundCon @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:49:6-51:7
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::RangedConstraint :: __mosek_2fusion_2RangedConstraint__lowerBoundCon() { return mosek::fusion::p_RangedConstraint::_get_impl(this)->__mosek_2fusion_2RangedConstraint__lowerBoundCon(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::RangedConstraint::lowerBoundCon() { return __mosek_2fusion_2RangedConstraint__lowerBoundCon(); }
monty::rc_ptr< ::mosek::fusion::BoundInterfaceConstraint > mosek::fusion::p_RangedConstraint::__mosek_2fusion_2RangedConstraint__lowerBoundCon()
{
  return ::mosek::fusion::p_BoundInterfaceConstraint::_new_BoundInterfaceConstraint(_pubthis->__mosek_2fusion_2Constraint__getModel(),shape,nativeidxs,true);
}
// End mosek.fusion.RangedConstraint.lowerBoundCon

// Begin mosek.fusion.RangedConstraint.clone
// Method mosek.fusion.RangedConstraint.clone @ bld/docker-win/final/default/src/fusion/RangedConstraint.mbi:41:6-44:7
monty::rc_ptr< ::mosek::fusion::ModelConstraint > mosek::fusion::p_RangedConstraint::__mosek_2fusion_2RangedConstraint__clone(monty::rc_ptr< ::mosek::fusion::Model > _2936_m)
{
  return (::mosek::fusion::p_RangedConstraint::_new_RangedConstraint(::mosek::fusion::RangedConstraint::t(_pubthis),_2936_m)).as<::mosek::fusion::ModelConstraint>();
}
// End mosek.fusion.RangedConstraint.clone

void mosek::fusion::p_RangedConstraint::destroy()
{
  nativeidxs.reset();
  shape.reset();
}
void mosek::fusion::RangedConstraint::destroy() { mosek::fusion::p_RangedConstraint::_get_impl(this)->destroy(); }
// } class RangedConstraint
// class ConicConstraint { // @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:22:4-94:5
mosek::fusion::ConicConstraint::ConicConstraint(mosek::fusion::p_ConicConstraint *_impl) : mosek::fusion::ModelConstraint(_impl) { /*std::cout << "ConicConstraint()" << this << std::endl; */ }
mosek::fusion::ConicConstraint::~ConicConstraint() {  /* std::cout << "~ConicConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ConicConstraint::p_ConicConstraint
  (::mosek::fusion::ConicConstraint * _pubthis) :     mosek::fusion::p_ModelConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ConicConstraint.ctor @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:65:6-75:7
mosek::fusion::ConicConstraint::t mosek::fusion::p_ConicConstraint::_new_ConicConstraint
  (monty::rc_ptr< ::mosek::fusion::ConicConstraint > _2937_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2938_m)
{ return new mosek::fusion::ConicConstraint(_2937_c,_2938_m); }
mosek::fusion::ConicConstraint::ConicConstraint
  (monty::rc_ptr< ::mosek::fusion::ConicConstraint > _2937_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2938_m) : 
   ConicConstraint(new mosek::fusion::p_ConicConstraint(this))
{ mosek::fusion::p_ConicConstraint::_get_impl(this)->_initialize(_2937_c,_2938_m); }
void mosek::fusion::p_ConicConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::ConicConstraint > _2937_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2938_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelConstraint::_initialize(_2937_c,_2938_m);
    dom = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->dom;
    conid = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->conid;
    shape = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->shape;
    name = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->name;
    nativeidxs = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->nativeidxs;
    names_flushed = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->names_flushed;
    indexnames = mosek::fusion::p_ConicConstraint::_get_impl(_2937_c)->indexnames;
  }
}
// mosek.fusion.ConicConstraint.ctor

// mosek.fusion.ConicConstraint.ctor @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:38:6-62:7
mosek::fusion::ConicConstraint::t mosek::fusion::p_ConicConstraint::_new_ConicConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2939_model,
    const std::string &  _2940_name,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _2941_dom,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2942_shape,
    int32_t _2943_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2944_nativeidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2945_indexnames)
{ return new mosek::fusion::ConicConstraint(_2939_model,_2940_name,_2941_dom,_2942_shape,_2943_conid,_2944_nativeidxs,_2945_indexnames); }
mosek::fusion::ConicConstraint::ConicConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2939_model,
    const std::string &  _2940_name,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _2941_dom,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2942_shape,
    int32_t _2943_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2944_nativeidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2945_indexnames) : 
   ConicConstraint(new mosek::fusion::p_ConicConstraint(this))
{ mosek::fusion::p_ConicConstraint::_get_impl(this)->_initialize(_2939_model,_2940_name,_2941_dom,_2942_shape,_2943_conid,_2944_nativeidxs,_2945_indexnames); }
void mosek::fusion::p_ConicConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2939_model,
    const std::string &  _2940_name,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _2941_dom,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2942_shape,
    int32_t _2943_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2944_nativeidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2945_indexnames)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2942_shape(_2942_shape ? _2942_shape->raw() : nullptr, _2942_shape ? _2942_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2944_nativeidxs(_2944_nativeidxs ? _2944_nativeidxs->raw() : nullptr, _2944_nativeidxs ? _2944_nativeidxs->size(0) : 0);
    std::vector<int32_t> _10558_;
    for (int32_t _2946_i = (int)0, _10559_ = (int)((_2944_nativeidxs)->size(0)); _2946_i < _10559_ ; ++_2946_i)
    {
      _10558_.push_back((-safe_add( (int)1,_ptr__2944_nativeidxs[_2946_i] )));
    }
    auto _10560_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10558_.size()),_10558_.begin(),_10558_.end()));
    mosek::fusion::p_ModelConstraint::_initialize(_2939_model,_2940_name,_2942_shape,_10560_,(-safe_add( (int)1,_2943_conid )));
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->dom = _2941_dom;
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->shape = _2942_shape;
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->name = _2940_name;
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->nativeidxs = _2944_nativeidxs;
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->indexnames = _2945_indexnames;
    mosek::fusion::p_ConicConstraint::_get_impl(::mosek::fusion::ConicConstraint::t(_pubthis))->conid = _2943_conid;
    names_flushed = false;
  }
}
// mosek.fusion.ConicConstraint.ctor

// Begin mosek.fusion.ConicConstraint.toString
// Method mosek.fusion.ConicConstraint.toString @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:88:6-92:7
std::string mosek::fusion::ConicConstraint :: toString() { return mosek::fusion::p_ConicConstraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ConicConstraint::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2947_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2947_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ConicConstraint('"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("')"));
  return _2947_sb->toString();
}
// End mosek.fusion.ConicConstraint.toString

// Begin mosek.fusion.ConicConstraint.domainToString
// Method mosek.fusion.ConicConstraint.domainToString @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:83:6-85:7
void mosek::fusion::p_ConicConstraint::domainToString(int64_t _2948_i,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2949_sb)
{
  throw ::mosek::fusion::UnimplementedError(std::string ("ConicConstraint.domainToString"));
}
// End mosek.fusion.ConicConstraint.domainToString

// Begin mosek.fusion.ConicConstraint.clone
// Method mosek.fusion.ConicConstraint.clone @ bld/docker-win/final/default/src/fusion/ConicConstraint.mbi:77:6-80:7
monty::rc_ptr< ::mosek::fusion::ModelConstraint > mosek::fusion::p_ConicConstraint::__mosek_2fusion_2ConicConstraint__clone(monty::rc_ptr< ::mosek::fusion::Model > _2950_m)
{
  return (::mosek::fusion::p_ConicConstraint::_new_ConicConstraint(::mosek::fusion::ConicConstraint::t(_pubthis),_2950_m)).as<::mosek::fusion::ModelConstraint>();
}
// End mosek.fusion.ConicConstraint.clone

void mosek::fusion::p_ConicConstraint::destroy()
{
  indexnames.reset();
  nativeidxs.reset();
  shape.reset();
  dom.reset();
}
void mosek::fusion::ConicConstraint::destroy() { mosek::fusion::p_ConicConstraint::_get_impl(this)->destroy(); }
// } class ConicConstraint
// class LinearConstraint { // @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:24:4-119:5
mosek::fusion::LinearConstraint::LinearConstraint(mosek::fusion::p_LinearConstraint *_impl) : mosek::fusion::ModelConstraint(_impl) { /*std::cout << "LinearConstraint()" << this << std::endl; */ }
mosek::fusion::LinearConstraint::~LinearConstraint() {  /* std::cout << "~LinearConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_LinearConstraint::p_LinearConstraint
  (::mosek::fusion::LinearConstraint * _pubthis) :     mosek::fusion::p_ModelConstraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.LinearConstraint.ctor @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:53:6-63:7
mosek::fusion::LinearConstraint::t mosek::fusion::p_LinearConstraint::_new_LinearConstraint
  (monty::rc_ptr< ::mosek::fusion::LinearConstraint > _2951_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2952_m)
{ return new mosek::fusion::LinearConstraint(_2951_c,_2952_m); }
mosek::fusion::LinearConstraint::LinearConstraint
  (monty::rc_ptr< ::mosek::fusion::LinearConstraint > _2951_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2952_m) : 
   LinearConstraint(new mosek::fusion::p_LinearConstraint(this))
{ mosek::fusion::p_LinearConstraint::_get_impl(this)->_initialize(_2951_c,_2952_m); }
void mosek::fusion::p_LinearConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearConstraint > _2951_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2952_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ModelConstraint::_initialize(_2951_c,_2952_m);
    conid = mosek::fusion::p_LinearConstraint::_get_impl(_2951_c)->conid;
    name = mosek::fusion::p_LinearConstraint::_get_impl(_2951_c)->name;
    nidxs = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinearConstraint::_get_impl(_2951_c)->nidxs);
    names_flushed = mosek::fusion::p_LinearConstraint::_get_impl(_2951_c)->names_flushed;
    indexnames = mosek::fusion::p_LinearConstraint::_get_impl(_2951_c)->indexnames;
  }
}
// mosek.fusion.LinearConstraint.ctor

// mosek.fusion.LinearConstraint.ctor @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:37:6-51:7
mosek::fusion::LinearConstraint::t mosek::fusion::p_LinearConstraint::_new_LinearConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2953_model,
    const std::string &  _2954_name,
    int32_t _2955_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2956_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2957_nidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2958_indexnames)
{ return new mosek::fusion::LinearConstraint(_2953_model,_2954_name,_2955_conid,_2956_shape,_2957_nidxs,_2958_indexnames); }
mosek::fusion::LinearConstraint::LinearConstraint
  (monty::rc_ptr< ::mosek::fusion::Model > _2953_model,
    const std::string &  _2954_name,
    int32_t _2955_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2956_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2957_nidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2958_indexnames) : 
   LinearConstraint(new mosek::fusion::p_LinearConstraint(this))
{ mosek::fusion::p_LinearConstraint::_get_impl(this)->_initialize(_2953_model,_2954_name,_2955_conid,_2956_shape,_2957_nidxs,_2958_indexnames); }
void mosek::fusion::p_LinearConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2953_model,
    const std::string &  _2954_name,
    int32_t _2955_conid,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2956_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2957_nidxs,
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _2958_indexnames)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2956_shape(_2956_shape ? _2956_shape->raw() : nullptr, _2956_shape ? _2956_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2957_nidxs(_2957_nidxs ? _2957_nidxs->raw() : nullptr, _2957_nidxs ? _2957_nidxs->size(0) : 0);
    mosek::fusion::p_ModelConstraint::_initialize(_2953_model,_2954_name,_2956_shape,_2957_nidxs,_2955_conid);
    mosek::fusion::p_LinearConstraint::_get_impl(::mosek::fusion::LinearConstraint::t(_pubthis))->nidxs = _2957_nidxs;
    mosek::fusion::p_LinearConstraint::_get_impl(::mosek::fusion::LinearConstraint::t(_pubthis))->conid = _2955_conid;
    mosek::fusion::p_LinearConstraint::_get_impl(::mosek::fusion::LinearConstraint::t(_pubthis))->name = _2954_name;
    mosek::fusion::p_LinearConstraint::_get_impl(::mosek::fusion::LinearConstraint::t(_pubthis))->names_flushed = false;
    mosek::fusion::p_LinearConstraint::_get_impl(::mosek::fusion::LinearConstraint::t(_pubthis))->indexnames = _2958_indexnames;
  }
}
// mosek.fusion.LinearConstraint.ctor

// Begin mosek.fusion.LinearConstraint.toString
// Method mosek.fusion.LinearConstraint.toString @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:104:6-117:7
std::string mosek::fusion::LinearConstraint :: toString() { return mosek::fusion::p_LinearConstraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_LinearConstraint::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2959_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2959_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("LinearConstraint('"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("')"));
  return _2959_sb->toString();
}
// End mosek.fusion.LinearConstraint.toString

// Begin mosek.fusion.LinearConstraint.flushNames
// Method mosek.fusion.LinearConstraint.flushNames @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:75:6-102:7
void mosek::fusion::p_LinearConstraint::flushNames()
{
}
// End mosek.fusion.LinearConstraint.flushNames

// Begin mosek.fusion.LinearConstraint.domainToString
// Method mosek.fusion.LinearConstraint.domainToString @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:70:6-73:7
void mosek::fusion::p_LinearConstraint::domainToString(int64_t _2960_i,monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2961_sb)
{
}
// End mosek.fusion.LinearConstraint.domainToString

// Begin mosek.fusion.LinearConstraint.clone
// Method mosek.fusion.LinearConstraint.clone @ bld/docker-win/final/default/src/fusion/LinearConstraint.mbi:65:6-68:7
monty::rc_ptr< ::mosek::fusion::ModelConstraint > mosek::fusion::p_LinearConstraint::__mosek_2fusion_2LinearConstraint__clone(monty::rc_ptr< ::mosek::fusion::Model > _2962_m)
{
  return (::mosek::fusion::p_LinearConstraint::_new_LinearConstraint(::mosek::fusion::LinearConstraint::t(_pubthis),_2962_m)).as<::mosek::fusion::ModelConstraint>();
}
// End mosek.fusion.LinearConstraint.clone

void mosek::fusion::p_LinearConstraint::destroy()
{
  indexnames.reset();
  nidxs.reset();
}
void mosek::fusion::LinearConstraint::destroy() { mosek::fusion::p_LinearConstraint::_get_impl(this)->destroy(); }
// } class LinearConstraint
// class ModelConstraint { // @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:19:4-84:5
mosek::fusion::ModelConstraint::ModelConstraint(mosek::fusion::p_ModelConstraint *_impl) : mosek::fusion::Constraint(_impl) { /*std::cout << "ModelConstraint()" << this << std::endl; */ }
mosek::fusion::ModelConstraint::~ModelConstraint() {  /* std::cout << "~ModelConstraint()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ModelConstraint::p_ModelConstraint
  (::mosek::fusion::ModelConstraint * _pubthis) :     mosek::fusion::p_Constraint(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ModelConstraint.ctor @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:57:6-66:7
void mosek::fusion::p_ModelConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::ModelConstraint > _2963_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2964_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Constraint::_initialize(_2963_c,_2964_m);
    mosek::fusion::p_ModelConstraint::_get_impl(::mosek::fusion::ModelConstraint::t(_pubthis))->conid = mosek::fusion::p_ModelConstraint::_get_impl(_2963_c)->conid;
    name = mosek::fusion::p_ModelConstraint::_get_impl(_2963_c)->name;
    modelcon_nativeidxs = mosek::fusion::p_ModelConstraint::_get_impl(_2963_c)->modelcon_nativeidxs;
    shape = mosek::fusion::p_ModelConstraint::_get_impl(_2963_c)->shape;
  }
}
// mosek.fusion.ModelConstraint.ctor

// mosek.fusion.ModelConstraint.ctor @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:42:6-55:7
void mosek::fusion::p_ModelConstraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2965_model,
    const std::string &  _2966_name,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2967_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2968_nidxs,
    int32_t _2969_conid)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2967_shape(_2967_shape ? _2967_shape->raw() : nullptr, _2967_shape ? _2967_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2968_nidxs(_2968_nidxs ? _2968_nidxs->raw() : nullptr, _2968_nidxs ? _2968_nidxs->size(0) : 0);
    mosek::fusion::p_Constraint::_initialize(_2965_model,_2967_shape,_2968_nidxs);
    mosek::fusion::p_ModelConstraint::_get_impl(::mosek::fusion::ModelConstraint::t(_pubthis))->name = _2966_name;
    mosek::fusion::p_ModelConstraint::_get_impl(::mosek::fusion::ModelConstraint::t(_pubthis))->modelcon_nativeidxs = _2968_nidxs;
    mosek::fusion::p_ModelConstraint::_get_impl(::mosek::fusion::ModelConstraint::t(_pubthis))->shape = _2967_shape;
    mosek::fusion::p_ModelConstraint::_get_impl(::mosek::fusion::ModelConstraint::t(_pubthis))->conid = _2969_conid;
  }
}
// mosek.fusion.ModelConstraint.ctor

// Begin mosek.fusion.ModelConstraint.toString
// Method mosek.fusion.ModelConstraint.toString @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:79:6-83:7
std::string mosek::fusion::ModelConstraint :: toString() { return mosek::fusion::p_ModelConstraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ModelConstraint::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _2970_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _2970_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Constraint('"))->__mosek_2fusion_2Utils_2StringBuffer__a(name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("')"));
  return _2970_sb->toString();
}
// End mosek.fusion.ModelConstraint.toString

// Begin mosek.fusion.ModelConstraint.flushNames
// Method mosek.fusion.ModelConstraint.flushNames @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:75:6-77:7
void mosek::fusion::p_ModelConstraint::flushNames()
{
}
// End mosek.fusion.ModelConstraint.flushNames

// Begin mosek.fusion.ModelConstraint.clone
// End mosek.fusion.ModelConstraint.clone

// Begin mosek.fusion.ModelConstraint.remove
// Method mosek.fusion.ModelConstraint.remove @ bld/docker-win/final/default/src/fusion/ModelConstraint.mbi:68:6-70:7
void mosek::fusion::ModelConstraint :: remove() { mosek::fusion::p_ModelConstraint::_get_impl(this)->remove(); }
void mosek::fusion::p_ModelConstraint::remove()
{
  mosek::fusion::p_Model::_get_impl(_pubthis->__mosek_2fusion_2Constraint__getModel().get())->removeConstraintBlock(conid);
}
// End mosek.fusion.ModelConstraint.remove

void mosek::fusion::p_ModelConstraint::destroy()
{
  shape.reset();
  modelcon_nativeidxs.reset();
}
void mosek::fusion::ModelConstraint::destroy() { mosek::fusion::p_ModelConstraint::_get_impl(this)->destroy(); }
// } class ModelConstraint
// class Constraint { // @ bld/docker-win/final/default/src/fusion/Constraint.mbi:110:4-680:5
mosek::fusion::Constraint::Constraint(mosek::fusion::p_Constraint *_impl) : _impl(_impl) { /*std::cout << "Constraint() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Constraint::~Constraint() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Constraint::p_Constraint
  (::mosek::fusion::Constraint * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.Constraint.ctor @ bld/docker-win/final/default/src/fusion/Constraint.mbi:135:6-140:7
void mosek::fusion::p_Constraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Constraint > _2972_c,
    monty::rc_ptr< ::mosek::fusion::Model > _2973_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    model = _2973_m;
    shape = mosek::fusion::p_Constraint::_get_impl(_2972_c)->shape;
    con_nativeidxs = mosek::fusion::p_Constraint::_get_impl(_2972_c)->con_nativeidxs;
  }
}
// mosek.fusion.Constraint.ctor

// mosek.fusion.Constraint.ctor @ bld/docker-win/final/default/src/fusion/Constraint.mbi:124:6-132:7
void mosek::fusion::p_Constraint::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _2974_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2975_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _2976_con_nativeidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__2975_shape(_2975_shape ? _2975_shape->raw() : nullptr, _2975_shape ? _2975_shape->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__2976_con_nativeidxs(_2976_con_nativeidxs ? _2976_con_nativeidxs->raw() : nullptr, _2976_con_nativeidxs ? _2976_con_nativeidxs->size(0) : 0);
    mosek::fusion::p_Constraint::_get_impl(::mosek::fusion::Constraint::t(_pubthis))->model = _2974_model;
    mosek::fusion::p_Constraint::_get_impl(::mosek::fusion::Constraint::t(_pubthis))->shape = _2975_shape;
    mosek::fusion::p_Constraint::_get_impl(::mosek::fusion::Constraint::t(_pubthis))->con_nativeidxs = _2976_con_nativeidxs;
  }
}
// mosek.fusion.Constraint.ctor

// Begin mosek.fusion.Constraint.toString
// Method mosek.fusion.Constraint.toString @ bld/docker-win/final/default/src/fusion/Constraint.mbi:662:6-679:7
std::string mosek::fusion::Constraint :: toString() { return mosek::fusion::p_Constraint::_get_impl(this)->toString(); }
std::string mosek::fusion::p_Constraint::toString()
{
  throw ::mosek::fusion::UnimplementedError(std::string ("Constraint.toString"));
}
// End mosek.fusion.Constraint.toString

// Begin mosek.fusion.Constraint.toStringArray
// Method mosek.fusion.Constraint.toStringArray @ bld/docker-win/final/default/src/fusion/Constraint.mbi:651:6-657:7
void mosek::fusion::p_Constraint::toStringArray(std::shared_ptr< monty::ndarray< int64_t,1 > > _2977_subi,int64_t _2978_dstidx,std::shared_ptr< monty::ndarray< std::string,1 > > _2979_result)
{
  _checked_ptr_1<int64_t> _ptr__2977_subi(_2977_subi ? _2977_subi->raw() : nullptr, _2977_subi ? _2977_subi->size(0) : 0);
}
// End mosek.fusion.Constraint.toStringArray

// Begin mosek.fusion.Constraint.dual_lu
// Method mosek.fusion.Constraint.dual_lu @ bld/docker-win/final/default/src/fusion/Constraint.mbi:642:6-644:7
void mosek::fusion::p_Constraint::dual_lu(int32_t _2980_offset,std::shared_ptr< monty::ndarray< double,1 > > _2981_target,bool _2982_islower)
{
  _checked_ptr_1<double> _ptr__2981_target(_2981_target ? _2981_target->raw() : nullptr, _2981_target ? _2981_target->size(0) : 0);
  model->getConstraintDuals(_2982_islower,con_nativeidxs,_2981_target,_2980_offset);
}
// End mosek.fusion.Constraint.dual_lu

// Begin mosek.fusion.Constraint.dual
// Method mosek.fusion.Constraint.dual @ bld/docker-win/final/default/src/fusion/Constraint.mbi:636:6-640:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::Constraint :: dual() { return mosek::fusion::p_Constraint::_get_impl(this)->dual(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Constraint::dual()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2983_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((con_nativeidxs)->size(0)))));
  _checked_ptr_1<double> _ptr__2983_res(_2983_res ? _2983_res->raw() : nullptr,_2983_res ? _2983_res->size(0) : 0);
  values(false,(int)0,_2983_res);
  return _2983_res;
}
// End mosek.fusion.Constraint.dual

// Begin mosek.fusion.Constraint.level
// Method mosek.fusion.Constraint.level @ bld/docker-win/final/default/src/fusion/Constraint.mbi:623:6-627:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::Constraint :: level() { return mosek::fusion::p_Constraint::_get_impl(this)->level(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_Constraint::level()
{
  std::shared_ptr< monty::ndarray< double,1 > > _2984_res = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((con_nativeidxs)->size(0)))));
  _checked_ptr_1<double> _ptr__2984_res(_2984_res ? _2984_res->raw() : nullptr,_2984_res ? _2984_res->size(0) : 0);
  values(true,(int)0,_2984_res);
  return _2984_res;
}
// End mosek.fusion.Constraint.level

// Begin mosek.fusion.Constraint.values
// Method mosek.fusion.Constraint.values @ bld/docker-win/final/default/src/fusion/Constraint.mbi:607:6-613:7
void mosek::fusion::p_Constraint::values(bool _2985_primal,int32_t _2986_offset,std::shared_ptr< monty::ndarray< double,1 > > _2987_target)
{
  _checked_ptr_1<double> _ptr__2987_target(_2987_target ? _2987_target->raw() : nullptr, _2987_target ? _2987_target->size(0) : 0);
  model->getConstraintValues(_2985_primal,con_nativeidxs,_2987_target,_2986_offset);
}
// End mosek.fusion.Constraint.values

// Begin mosek.fusion.Constraint.remove
// Method mosek.fusion.Constraint.remove @ bld/docker-win/final/default/src/fusion/Constraint.mbi:601:6-603:7
void mosek::fusion::Constraint :: remove() { mosek::fusion::p_Constraint::_get_impl(this)->remove(); }
void mosek::fusion::p_Constraint::remove()
{
  throw ::mosek::fusion::DeletionError(std::string ("Only original constraints can be removed"));
}
// End mosek.fusion.Constraint.remove

// Begin mosek.fusion.Constraint.update
// Method mosek.fusion.Constraint.update @ bld/docker-win/final/default/src/fusion/Constraint.mbi:592:6-594:7
void mosek::fusion::Constraint :: update(std::shared_ptr< monty::ndarray< double,1 > > _2988_bfix) { mosek::fusion::p_Constraint::_get_impl(this)->update(_2988_bfix); }
void mosek::fusion::p_Constraint::update(std::shared_ptr< monty::ndarray< double,1 > > _2988_bfix)
{
  _checked_ptr_1<double> _ptr__2988_bfix(_2988_bfix ? _2988_bfix->raw() : nullptr, _2988_bfix ? _2988_bfix->size(0) : 0);
  _pubthis->update(::mosek::fusion::p_Expr::reshape(::mosek::fusion::p_Expr::constTerm(_2988_bfix),_pubthis->getShape()),(::mosek::fusion::p_NilVariable::_new_NilVariable()).as<::mosek::fusion::Variable>(),true);
}
// End mosek.fusion.Constraint.update

// Begin mosek.fusion.Constraint.update
// Method mosek.fusion.Constraint.update @ bld/docker-win/final/default/src/fusion/Constraint.mbi:577:6-590:7
void mosek::fusion::Constraint :: update(monty::rc_ptr< ::mosek::fusion::Expression > _2989_expr) { mosek::fusion::p_Constraint::_get_impl(this)->update(_2989_expr); }
void mosek::fusion::p_Constraint::update(monty::rc_ptr< ::mosek::fusion::Expression > _2989_expr)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2990_eshape = _2989_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__2990_eshape(_2990_eshape ? _2990_eshape->raw() : nullptr,_2990_eshape ? _2990_eshape->size(0) : 0);
  if (((int)((shape)->size(0)) < (int)((_2990_eshape)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
    }
  }
  {}
  int32_t _10561_ = (int)0;
  int32_t _10562_ = (int)((_2990_eshape)->size(0));
  for (int32_t _2991_i = _10561_; _2991_i < _10562_; ++_2991_i)
  {
    {
      if ((_ptr__2990_eshape[_2991_i] != ((*shape)(_2991_i))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
        }
      }
      {}
    }
  }
  int32_t _10563_ = (int)((_2990_eshape)->size(0));
  int32_t _10564_ = (int)((shape)->size(0));
  for (int32_t _2992_i = _10563_; _2992_i < _10564_; ++_2992_i)
  {
    {
      if ((((*shape)(_2992_i)) != (int)1))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
        }
      }
      {}
    }
  }
  mosek::fusion::p_Model::_get_impl(model.get())->update(con_nativeidxs,_2989_expr);
}
// End mosek.fusion.Constraint.update

// Begin mosek.fusion.Constraint.update
// Method mosek.fusion.Constraint.update @ bld/docker-win/final/default/src/fusion/Constraint.mbi:517:6-574:7
void mosek::fusion::Constraint :: update(monty::rc_ptr< ::mosek::fusion::Expression > _2993_expr,monty::rc_ptr< ::mosek::fusion::Variable > _2994_x,bool _2995_bfixupdate) { mosek::fusion::p_Constraint::_get_impl(this)->update(_2993_expr,_2994_x,_2995_bfixupdate); }
void mosek::fusion::p_Constraint::update(monty::rc_ptr< ::mosek::fusion::Expression > _2993_expr,monty::rc_ptr< ::mosek::fusion::Variable > _2994_x,bool _2995_bfixupdate)
{
  int32_t _2996_nd = _pubthis->getND();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _2997_eshape = _2993_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__2997_eshape(_2997_eshape ? _2997_eshape->raw() : nullptr,_2997_eshape ? _2997_eshape->size(0) : 0);
  if ((_2996_nd < (int)((_2997_eshape)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
    }
  }
  {}
  int32_t _10565_ = (int)0;
  int32_t _10566_ = (int)((_2997_eshape)->size(0));
  for (int32_t _2998_i = _10565_; _2998_i < _10566_; ++_2998_i)
  {
    {
      if ((_ptr__2997_eshape[_2998_i] != ((*shape)(_2998_i))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
        }
      }
      {}
    }
  }
  int32_t _10567_ = (int)((_2997_eshape)->size(0));
  int32_t _10568_ = (int)((shape)->size(0));
  for (int32_t _2999_i = _10567_; _2999_i < _10568_; ++_2999_i)
  {
    {
      if ((((*shape)(_2999_i)) != (int)1))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Expression shape does not match constraint"));
        }
      }
      {}
    }
  }
  int32_t _3000_ni = _2994_x->numInst();
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3001_varidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3000_ni)));
  _checked_ptr_1<int64_t> _ptr__3001_varidxs(_3001_varidxs ? _3001_varidxs->raw() : nullptr,_3001_varidxs ? _3001_varidxs->size(0) : 0);
  if ((_3000_ni < _2994_x->getSize()))
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _3002_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3000_ni)));
      _checked_ptr_1<int64_t> _ptr__3002_sp(_3002_sp ? _3002_sp->raw() : nullptr,_3002_sp ? _3002_sp->size(0) : 0);
      _2994_x->inst((int)0,_3002_sp,(int)0,_3001_varidxs);
    }
  }
  else
  {
    {
      _2994_x->inst((int)0,_3001_varidxs);
    }
  }
  int32_t _10569_ = (int)0;
  int32_t _10570_ = _3000_ni;
  for (int32_t _3003_i = _10569_; _3003_i < _10570_; ++_3003_i)
  {
    {
      if ((_ptr__3001_varidxs[_3003_i] < (int)0))
      {
        {
          throw ::mosek::fusion::UpdateError(std::string ("Semidefinite terms cannot be updated"));
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3004_varidxs32;
  _checked_ptr_1<int32_t> _ptr__3004_varidxs32(_3004_varidxs32 ? _3004_varidxs32->raw() : nullptr,_3004_varidxs32 ? _3004_varidxs32->size(0) : 0);
  {
    bool _3005_issorted = true;
    int32_t _10571_ = (int)0;
    int32_t _10572_ = (_3000_ni - (int)1);
    for (int32_t _3006_i = _10571_; _3006_i < _10572_; ++_3006_i)
    {
      {
        _3005_issorted = (_3005_issorted && (_ptr__3001_varidxs[_3006_i] < _ptr__3001_varidxs[safe_add( _3006_i,(int)1 )]));
      }
    }
    if (_3005_issorted)
    {
      {
        if ((!_2995_bfixupdate))
        {
          {
            std::vector<int32_t> _10573_;
            for (int32_t _3007_i = (int)0, _10574_ = _3000_ni; _3007_i < _10574_ ; ++_3007_i)
            {
              _10573_.push_back((int32_t)_ptr__3001_varidxs[_3007_i]);
            }
            auto _10575_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10573_.size()),_10573_.begin(),_10573_.end()));
            _3004_varidxs32 = _10575_;
            _ptr__3004_varidxs32.update(_3004_varidxs32 ? _3004_varidxs32->raw() : nullptr, _3004_varidxs32 ? _3004_varidxs32->size(0) : 0);
          }
        }
        else
        {
          {
            _3004_varidxs32 = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _3000_ni,(int)1 ))));
            _ptr__3004_varidxs32.update(_3004_varidxs32 ? _3004_varidxs32->raw() : nullptr, _3004_varidxs32 ? _3004_varidxs32->size(0) : 0);
            _ptr__3004_varidxs32[(int)0] = (int)0;
            int32_t _10576_ = (int)0;
            int32_t _10577_ = _3000_ni;
            for (int32_t _3008_i = _10576_; _3008_i < _10577_; ++_3008_i)
            {
              {
                _ptr__3004_varidxs32[safe_add( (int)1,_3008_i )] = (int32_t)_ptr__3001_varidxs[_3008_i];
              }
            }
          }
        }
      }
    }
    else
    {
      {
        std::vector<int64_t> _10578_;
        for (int32_t _3010_i = (int)0, _10579_ = _3000_ni; _3010_i < _10579_ ; ++_3010_i)
        {
          _10578_.push_back(_3010_i);
        }
        auto _10580_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10578_.size()),_10578_.begin(),_10578_.end()));
        std::shared_ptr< monty::ndarray< int64_t,1 > > _3009_perm = _10580_;
        _checked_ptr_1<int64_t> _ptr__3009_perm(_3009_perm ? _3009_perm->raw() : nullptr,_3009_perm ? _3009_perm->size(0) : 0);
        ::mosek::fusion::p_CommonTools::argQsort(_3009_perm,_3001_varidxs,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_3000_ni));
        int32_t _3011_nunique = (int)1;
        int32_t _10581_ = (int)1;
        int32_t _10582_ = _3000_ni;
        for (int32_t _3012_i = _10581_; _3012_i < _10582_; ++_3012_i)
        {
          {
            if ((_ptr__3001_varidxs[_ptr__3009_perm[(_3012_i - (int)1)]] < _ptr__3001_varidxs[_ptr__3009_perm[_3012_i]]))
            {
              {
                ++ _3011_nunique;
              }
            }
            {}
          }
        }
        if (_2995_bfixupdate)
        {
          {
            _3011_nunique += (int)1;
          }
        }
        {}
        _3004_varidxs32 = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3011_nunique)));
        _ptr__3004_varidxs32.update(_3004_varidxs32 ? _3004_varidxs32->raw() : nullptr, _3004_varidxs32 ? _3004_varidxs32->size(0) : 0);
        int32_t _3013_k = (int)0;
        if (_2995_bfixupdate)
        {
          {
            _ptr__3004_varidxs32[(int)0] = (int)0;
            ++ _3013_k;
          }
        }
        {}
        _ptr__3004_varidxs32[_3013_k] = (int32_t)_ptr__3001_varidxs[_ptr__3009_perm[(int)0]];
        int32_t _10583_ = (int)1;
        int32_t _10584_ = _3000_ni;
        for (int32_t _3014_i = _10583_; _3014_i < _10584_; ++_3014_i)
        {
          {
            if ((_ptr__3001_varidxs[(_3014_i - (int)1)] < _ptr__3001_varidxs[_3014_i]))
            {
              {
                _ptr__3004_varidxs32[_3013_k] = (int32_t)_ptr__3001_varidxs[_ptr__3009_perm[_3014_i]];
                ++ _3013_k;
              }
            }
            {}
          }
        }
      }
    }
  }
  mosek::fusion::p_Model::_get_impl(model.get())->update(con_nativeidxs,_2993_expr,_3004_varidxs32);
}
// End mosek.fusion.Constraint.update

// Begin mosek.fusion.Constraint.update
// Method mosek.fusion.Constraint.update @ bld/docker-win/final/default/src/fusion/Constraint.mbi:513:6-515:7
void mosek::fusion::Constraint :: update(monty::rc_ptr< ::mosek::fusion::Expression > _3015_expr,monty::rc_ptr< ::mosek::fusion::Variable > _3016_x) { mosek::fusion::p_Constraint::_get_impl(this)->update(_3015_expr,_3016_x); }
void mosek::fusion::p_Constraint::update(monty::rc_ptr< ::mosek::fusion::Expression > _3015_expr,monty::rc_ptr< ::mosek::fusion::Variable > _3016_x)
{
  _pubthis->update(_3015_expr,_3016_x,false);
}
// End mosek.fusion.Constraint.update

// Begin mosek.fusion.Constraint.get_model
// Method mosek.fusion.Constraint.get_model @ bld/docker-win/final/default/src/fusion/Constraint.mbi:505:6-508:7
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__get_model() { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__get_model(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Constraint::get_model() { return __mosek_2fusion_2Constraint__get_model(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__get_model()
{
  return model;
}
// End mosek.fusion.Constraint.get_model

// Begin mosek.fusion.Constraint.get_nd
// Method mosek.fusion.Constraint.get_nd @ bld/docker-win/final/default/src/fusion/Constraint.mbi:498:6-501:7
int32_t mosek::fusion::Constraint :: get_nd() { return mosek::fusion::p_Constraint::_get_impl(this)->get_nd(); }
int32_t mosek::fusion::p_Constraint::get_nd()
{
  return (int)((shape)->size(0));
}
// End mosek.fusion.Constraint.get_nd

// Begin mosek.fusion.Constraint.size
// Method mosek.fusion.Constraint.size @ bld/docker-win/final/default/src/fusion/Constraint.mbi:491:6-494:7
int64_t mosek::fusion::Constraint :: size() { return mosek::fusion::p_Constraint::_get_impl(this)->size(); }
int64_t mosek::fusion::p_Constraint::size()
{
  int64_t _3017_sz = (int)1;
  int32_t _10585_ = (int)0;
  int32_t _10586_ = (int)((shape)->size(0));
  for (int32_t _3018_i = _10585_; _3018_i < _10586_; ++_3018_i)
  {
    {
      _3017_sz *= ((*shape)(_3018_i));
    }
  }
  return _3017_sz;
}
// End mosek.fusion.Constraint.size

// Begin mosek.fusion.Constraint.stack
// Method mosek.fusion.Constraint.stack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:479:6-484:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::stack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3019_clist,
    int32_t _3020_dim) { return mosek::fusion::p_Constraint::stack(_3019_clist,_3020_dim); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::stack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3019_clist,int32_t _3020_dim)
{
  return ::mosek::fusion::p_Constraint::dstack(_3019_clist,_3020_dim);
}
// End mosek.fusion.Constraint.stack

// Begin mosek.fusion.Constraint.stack
// Method mosek.fusion.Constraint.stack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:471:6-478:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::stack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3021_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3022_v2,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3023_v3,
    int32_t _3024_dim) { return mosek::fusion::p_Constraint::stack(_3021_v1,_3022_v2,_3023_v3,_3024_dim); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::stack(monty::rc_ptr< ::mosek::fusion::Constraint > _3021_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3022_v2,monty::rc_ptr< ::mosek::fusion::Constraint > _3023_v3,int32_t _3024_dim)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3021_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3022_v2.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3023_v3.get())}),_3024_dim);
}
// End mosek.fusion.Constraint.stack

// Begin mosek.fusion.Constraint.stack
// Method mosek.fusion.Constraint.stack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:463:6-469:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::stack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3025_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3026_v2,
    int32_t _3027_dim) { return mosek::fusion::p_Constraint::stack(_3025_v1,_3026_v2,_3027_dim); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::stack(monty::rc_ptr< ::mosek::fusion::Constraint > _3025_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3026_v2,int32_t _3027_dim)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3025_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3026_v2.get())}),_3027_dim);
}
// End mosek.fusion.Constraint.stack

// Begin mosek.fusion.Constraint.hstack
// Method mosek.fusion.Constraint.hstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:456:6-460:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::hstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3028_clist) { return mosek::fusion::p_Constraint::hstack(_3028_clist); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::hstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3028_clist)
{
  return ::mosek::fusion::p_Constraint::dstack(_3028_clist,(int)1);
}
// End mosek.fusion.Constraint.hstack

// Begin mosek.fusion.Constraint.vstack
// Method mosek.fusion.Constraint.vstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:451:6-455:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::vstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3029_clist) { return mosek::fusion::p_Constraint::vstack(_3029_clist); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::vstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3029_clist)
{
  return ::mosek::fusion::p_Constraint::dstack(_3029_clist,(int)0);
}
// End mosek.fusion.Constraint.vstack

// Begin mosek.fusion.Constraint.hstack
// Method mosek.fusion.Constraint.hstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:432:6-438:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::hstack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3030_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3031_v2,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3032_v3) { return mosek::fusion::p_Constraint::hstack(_3030_v1,_3031_v2,_3032_v3); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::hstack(monty::rc_ptr< ::mosek::fusion::Constraint > _3030_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3031_v2,monty::rc_ptr< ::mosek::fusion::Constraint > _3032_v3)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3030_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3031_v2.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3032_v3.get())}),(int)1);
}
// End mosek.fusion.Constraint.hstack

// Begin mosek.fusion.Constraint.vstack
// Method mosek.fusion.Constraint.vstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:425:6-431:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::vstack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3033_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3034_v2,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3035_v3) { return mosek::fusion::p_Constraint::vstack(_3033_v1,_3034_v2,_3035_v3); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::vstack(monty::rc_ptr< ::mosek::fusion::Constraint > _3033_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3034_v2,monty::rc_ptr< ::mosek::fusion::Constraint > _3035_v3)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3033_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3034_v2.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3035_v3.get())}),(int)0);
}
// End mosek.fusion.Constraint.vstack

// Begin mosek.fusion.Constraint.hstack
// Method mosek.fusion.Constraint.hstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:406:6-411:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::hstack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3036_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3037_v2) { return mosek::fusion::p_Constraint::hstack(_3036_v1,_3037_v2); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::hstack(monty::rc_ptr< ::mosek::fusion::Constraint > _3036_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3037_v2)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3036_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3037_v2.get())}),(int)1);
}
// End mosek.fusion.Constraint.hstack

// Begin mosek.fusion.Constraint.vstack
// Method mosek.fusion.Constraint.vstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:399:6-404:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::vstack
  ( monty::rc_ptr< ::mosek::fusion::Constraint > _3038_v1,
    monty::rc_ptr< ::mosek::fusion::Constraint > _3039_v2) { return mosek::fusion::p_Constraint::vstack(_3038_v1,_3039_v2); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::vstack(monty::rc_ptr< ::mosek::fusion::Constraint > _3038_v1,monty::rc_ptr< ::mosek::fusion::Constraint > _3039_v2)
{
  return ::mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 >{::monty::rc_ptr<::mosek::fusion::Constraint>(_3038_v1.get()),::monty::rc_ptr<::mosek::fusion::Constraint>(_3039_v2.get())}),(int)0);
}
// End mosek.fusion.Constraint.vstack

// Begin mosek.fusion.Constraint.dstack
// Method mosek.fusion.Constraint.dstack @ bld/docker-win/final/default/src/fusion/Constraint.mbi:277:6-386:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Constraint >,1 > > _3040_c,int32_t _3041_dim)
{
  monty::rc_ptr< ::mosek::fusion::Model > _3042_m0 = nullptr;
  {
    int32_t _10587_ = (int)0;
    int32_t _10588_ = (int)((_3040_c)->size(0));
    for (int32_t _3043_i = _10587_; _3043_i < _10588_; ++_3043_i)
    {
      {
        if ((NULL == _3042_m0.get()))
        {
          {
            _3042_m0 = ((*_3040_c)(_3043_i))->__mosek_2fusion_2Constraint__getModel();
          }
        }
        else if(((NULL != mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3043_i)))->model.get()) && (mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3043_i)))->model != _3042_m0)))
        {
          {
            monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _3044_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
            std::string _10589_;
            bool _10590_ = ((int)((mosek::fusion::p_Model::_get_impl(_3042_m0.get())->getName()).size()) > (int)0);
            if (_10590_)
            {
              _10589_ = mosek::fusion::p_Model::_get_impl(_3042_m0.get())->getName();
            }
            else
            {
              _10589_ = std::string ("?");
            }
            std::string _3045_m1name = _10589_;
            std::string _10591_;
            bool _10592_ = ((int)((mosek::fusion::p_Model::_get_impl(((*_3040_c)(_3043_i))->__mosek_2fusion_2Constraint__getModel().get())->getName()).size()) > (int)0);
            if (_10592_)
            {
              _10591_ = mosek::fusion::p_Model::_get_impl(((*_3040_c)(_3043_i))->__mosek_2fusion_2Constraint__getModel().get())->getName();
            }
            else
            {
              _10591_ = std::string ("?");
            }
            std::string _3046_m2name = _10591_;
            _3044_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Constraints belong to different models: '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_3045_m1name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("' and '"))->__mosek_2fusion_2Utils_2StringBuffer__a(_3046_m2name)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("'"));
            throw ::mosek::fusion::ModelError(_3044_sb->toString());
          }
        }
        {}
      }
    }
  }
  if (((int)((_3040_c)->size(0)) == (int)0))
  {
    {
      return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)0)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))))).as<::mosek::fusion::Constraint>();
    }
  }
  else if(((int)((_3040_c)->size(0)) == (int)1))
  {
    {
      return ((*_3040_c)((int)1));
    }
  }
  else
  {
    {
      int32_t _3047_n = (int)((_3040_c)->size(0));
      int32_t _3048_nd = (int)1;
      int32_t _10593_ = (int)0;
      int32_t _10594_ = _3047_n;
      for (int32_t _3049_i = _10593_; _3049_i < _10594_; ++_3049_i)
      {
        {
          int32_t _10595_;
          bool _10596_ = (((*_3040_c)(_3049_i))->getND() > _3048_nd);
          if (_10596_)
          {
            _10595_ = ((*_3040_c)(_3049_i))->getND();
          }
          else
          {
            _10595_ = _3048_nd;
          }
          _3048_nd = _10595_;
        }
      }
      if ((_3041_dim == _3048_nd))
      {
        {
          ++ _3048_nd;
        }
      }
      {}
      std::shared_ptr< monty::ndarray< int32_t,2 > > _3050_shape = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape(_3047_n,_3048_nd)));
      int32_t _10597_ = (int)0;
      int32_t _10598_ = _3047_n;
      for (int32_t _3051_i = _10597_; _3051_i < _10598_; ++_3051_i)
      {
        {
          int32_t _10599_ = (int)0;
          int32_t _10600_ = _3048_nd;
          for (int32_t _3052_j = _10599_; _3052_j < _10600_; ++_3052_j)
          {
            {
              ((*_3050_shape)(_3051_i,_3052_j)) = (int)1;
            }
          }
        }
      }
      std::vector<int32_t> _10601_;
      for (int32_t _3054_i = (int)0, _10602_ = _3047_n; _3054_i < _10602_ ; ++_3054_i)
      {
        _10601_.push_back(((*_3040_c)(_3054_i))->getSize());
      }
      auto _10603_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10601_.size()),_10601_.begin(),_10601_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3053_numnz = _10603_;
      _checked_ptr_1<int32_t> _ptr__3053_numnz(_3053_numnz ? _3053_numnz->raw() : nullptr,_3053_numnz ? _3053_numnz->size(0) : 0);
      int32_t _3055_totalnnz = (int)0;
      int32_t _10604_ = (int)0;
      int32_t _10605_ = _3047_n;
      for (int32_t _3056_i = _10604_; _3056_i < _10605_; ++_3056_i)
      {
        {
          _3055_totalnnz += _ptr__3053_numnz[_3056_i];
        }
      }
      int32_t _10606_ = (int)0;
      int32_t _10607_ = _3047_n;
      for (int32_t _3057_i = _10606_; _3057_i < _10607_; ++_3057_i)
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3058_shpi = ((*_3040_c)(_3057_i))->getShape();
          _checked_ptr_1<int32_t> _ptr__3058_shpi(_3058_shpi ? _3058_shpi->raw() : nullptr,_3058_shpi ? _3058_shpi->size(0) : 0);
          int32_t _10608_ = (int)0;
          int32_t _10609_ = (int)((_3058_shpi)->size(0));
          for (int32_t _3059_j = _10608_; _3059_j < _10609_; ++_3059_j)
          {
            {
              ((*_3050_shape)(_3057_i,_3059_j)) = _ptr__3058_shpi[_3059_j];
            }
          }
        }
      }
      if (((_3041_dim < (int)0) || (_3041_dim > _3048_nd)))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Invalid stacking dimension"));
        }
      }
      {}
      int32_t _10610_ = (int)0;
      int32_t _10611_ = _3041_dim;
      for (int32_t _3060_i = _10610_; _3060_i < _10611_; ++_3060_i)
      {
        {
          int32_t _10612_ = (int)1;
          int32_t _10613_ = _3047_n;
          for (int32_t _3061_j = _10612_; _3061_j < _10613_; ++_3061_j)
          {
            {
              if ((((*_3050_shape)((int)0,_3060_i)) != ((*_3050_shape)(_3061_j,_3060_i))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Constraint dimensions do not match"));
                }
              }
              {}
            }
          }
        }
      }
      int32_t _10614_ = safe_add( _3041_dim,(int)1 );
      int32_t _10615_ = _3048_nd;
      for (int32_t _3062_i = _10614_; _3062_i < _10615_; ++_3062_i)
      {
        {
          int32_t _10616_ = (int)1;
          int32_t _10617_ = _3047_n;
          for (int32_t _3063_j = _10616_; _3063_j < _10617_; ++_3063_j)
          {
            {
              if ((((*_3050_shape)((int)0,_3062_i)) != ((*_3050_shape)(_3063_j,_3062_i))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Constraint dimensions do not match"));
                }
              }
              {}
            }
          }
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3064_con_nativeidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3055_totalnnz)));
      _checked_ptr_1<int32_t> _ptr__3064_con_nativeidxs(_3064_con_nativeidxs ? _3064_con_nativeidxs->raw() : nullptr,_3064_con_nativeidxs ? _3064_con_nativeidxs->size(0) : 0);
      std::vector<int32_t> _10618_;
      for (int32_t _3066_i = (int)0, _10619_ = _3048_nd; _3066_i < _10619_ ; ++_3066_i)
      {
        _10618_.push_back(((*_3050_shape)((int)0,_3066_i)));
      }
      auto _10620_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10618_.size()),_10618_.begin(),_10618_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3065_resshape = _10620_;
      _checked_ptr_1<int32_t> _ptr__3065_resshape(_3065_resshape ? _3065_resshape->raw() : nullptr,_3065_resshape ? _3065_resshape->size(0) : 0);
      int32_t _10621_ = (int)1;
      int32_t _10622_ = _3047_n;
      for (int32_t _3067_i = _10621_; _3067_i < _10622_; ++_3067_i)
      {
        {
          _ptr__3065_resshape[_3041_dim] += ((*_3050_shape)(_3067_i,_3041_dim));
        }
      }
      {
        int32_t _3068_rnd = (int)((_3065_resshape)->size(0));
        std::shared_ptr< monty::ndarray< int64_t,1 > > _3069_cumdims = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( (int)((_3040_c)->size(0)),(int)1 ))));
        _checked_ptr_1<int64_t> _ptr__3069_cumdims(_3069_cumdims ? _3069_cumdims->raw() : nullptr,_3069_cumdims ? _3069_cumdims->size(0) : 0);
        int32_t _10623_ = (int)0;
        int32_t _10624_ = (int)((_3040_c)->size(0));
        for (int32_t _3070_i = _10623_; _3070_i < _10624_; ++_3070_i)
        {
          {
            _ptr__3069_cumdims[safe_add( _3070_i,(int)1 )] = safe_add( _ptr__3069_cumdims[_3070_i],((*_3050_shape)(_3070_i,_3041_dim)) );
          }
        }
        if ((_3041_dim == (int)0))
        {
          {
            int32_t _3071_b = (int)0;
            int32_t _10625_ = (int)0;
            int32_t _10626_ = _3047_n;
            for (int32_t _3072_i = _10625_; _3072_i < _10626_; ++_3072_i)
            {
              {
                int32_t _3073_nnz = (int)((mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3072_i)))->con_nativeidxs)->size(0));
                ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3072_i)))->con_nativeidxs,(int)0,_3064_con_nativeidxs,_3071_b,_3073_nnz);
                _3071_b += _3073_nnz;
              }
            }
          }
        }
        else
        {
          {
            std::vector<std::shared_ptr< monty::ndarray< int32_t,1 > >> _10627_;
            for (int32_t _3075_i = (int)0, _10628_ = _3047_n; _3075_i < _10628_ ; ++_3075_i)
            {
              _10627_.push_back(mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3075_i)))->con_nativeidxs);
            }
            auto _10629_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 >(monty::shape(_10627_.size()),_10627_.begin(),_10627_.end()));
            std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _3074_nidxlist = _10629_;
            if ((_3041_dim < _3048_nd))
            {
              {
                int32_t _3076_d0 = (int)1;
                int32_t _10630_ = (int)0;
                int32_t _10631_ = _3041_dim;
                for (int32_t _3077_i = _10630_; _3077_i < _10631_; ++_3077_i)
                {
                  {
                    _3076_d0 *= _ptr__3065_resshape[_3077_i];
                  }
                }
                int32_t _3078_d2 = (int)1;
                int32_t _10632_ = safe_add( _3041_dim,(int)1 );
                int32_t _10633_ = _3048_nd;
                for (int32_t _3079_i = _10632_; _3079_i < _10633_; ++_3079_i)
                {
                  {
                    _3078_d2 *= _ptr__3065_resshape[_3079_i];
                  }
                }
                int32_t _3080_k = (int)0;
                int32_t _10634_ = (int)0;
                int32_t _10635_ = _3076_d0;
                for (int32_t _3081_i0 = _10634_; _3081_i0 < _10635_; ++_3081_i0)
                {
                  {
                    int32_t _10636_ = (int)0;
                    int32_t _10637_ = _3047_n;
                    for (int32_t _3082_j = _10636_; _3082_j < _10637_; ++_3082_j)
                    {
                      {
                        int32_t _3083_l = (int)0;
                        int32_t _3084_d1 = ((*_3050_shape)(_3082_j,_3041_dim));
                        int32_t _10638_ = (int)0;
                        int32_t _10639_ = _3084_d1;
                        for (int32_t _3085_i1 = _10638_; _3085_i1 < _10639_; ++_3085_i1)
                        {
                          {
                            int32_t _10640_ = (int)0;
                            int32_t _10641_ = _3078_d2;
                            for (int32_t _3086_i2 = _10640_; _3086_i2 < _10641_; ++_3086_i2)
                            {
                              {
                                _ptr__3064_con_nativeidxs[_3080_k] = ((*mosek::fusion::p_Constraint::_get_impl(((*_3040_c)(_3047_n)))->con_nativeidxs)(safe_add( safe_mul( safe_mul( _3081_i0,_3078_d2 ),_3084_d1 ),_3083_l )));
                                ++ _3080_k;
                                ++ _3083_l;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            else
            {
              {
                int32_t _3087_prodshape = (int)1;
                int32_t _10642_ = (int)0;
                int32_t _10643_ = _3048_nd;
                for (int32_t _3088_i = _10642_; _3088_i < _10643_; ++_3088_i)
                {
                  {
                    _3087_prodshape *= _ptr__3065_resshape[_3088_i];
                  }
                }
                int32_t _3089_k = (int)0;
                int32_t _10644_ = (int)0;
                int32_t _10645_ = _3087_prodshape;
                for (int32_t _3090_i = _10644_; _3090_i < _10645_; ++_3090_i)
                {
                  {
                    int32_t _10646_ = (int)0;
                    int32_t _10647_ = _3047_n;
                    for (int32_t _3091_j = _10646_; _3091_j < _10647_; ++_3091_j)
                    {
                      {
                        _ptr__3064_con_nativeidxs[_3089_k] = ((*((*_3074_nidxlist)(_3091_j)))(_3090_i));
                        ++ _3089_k;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(_3042_m0,_3065_resshape,_3064_con_nativeidxs)).as<::mosek::fusion::Constraint>();
    }
  }
}
// End mosek.fusion.Constraint.dstack

// Begin mosek.fusion.Constraint.index
// Method mosek.fusion.Constraint.index @ bld/docker-win/final/default/src/fusion/Constraint.mbi:251:6-266:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _3092_idxa) { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__index(_3092_idxa); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _3092_idxa) { return __mosek_2fusion_2Constraint__index(_3092_idxa); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _3092_idxa)
{
  _checked_ptr_1<int32_t> _ptr__3092_idxa(_3092_idxa ? _3092_idxa->raw() : nullptr, _3092_idxa ? _3092_idxa->size(0) : 0);
  if (((int)((_3092_idxa)->size(0)) != (int)((shape)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("variable shape and slice do not match"));
    }
  }
  else
  {
    {
      int32_t _10648_ = (int)0;
      int32_t _10649_ = (int)((shape)->size(0));
      for (int32_t _3093_i = _10648_; _3093_i < _10649_; ++_3093_i)
      {
        {
          if (((_ptr__3092_idxa[_3093_i] < (int)0) || (_ptr__3092_idxa[_3093_i] > ((*shape)(_3093_i)))))
          {
            {
              throw ::mosek::fusion::IndexError(std::string ("index is out of bounds"));
            }
          }
          {}
        }
      }
      int32_t _3094_nd = (int)((shape)->size(0));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _3095_strides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3094_nd)));
      _checked_ptr_1<int64_t> _ptr__3095_strides(_3095_strides ? _3095_strides->raw() : nullptr,_3095_strides ? _3095_strides->size(0) : 0);
      _ptr__3095_strides[(_3094_nd - (int)1)] = (int)1;
      int32_t _10650_ = (int)1;
      int32_t _10651_ = _3094_nd;
      for (int32_t _3096_i = _10650_; _3096_i < _10651_; ++_3096_i)
      {
        {
          _ptr__3095_strides[((_3094_nd - _3096_i) - (int)1)] = safe_mul( _ptr__3095_strides[(_3094_nd - _3096_i)],((*shape)((_3094_nd - _3096_i))) );
        }
      }
      int32_t _3097_ii = (int)0;
      int32_t _10652_ = (int)0;
      int32_t _10653_ = _3094_nd;
      for (int32_t _3098_i = _10652_; _3098_i < _10653_; ++_3098_i)
      {
        {
          _3097_ii += (int32_t)safe_mul( _ptr__3095_strides[_3098_i],_ptr__3092_idxa[_3098_i] );
        }
      }
      return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*con_nativeidxs)(_3097_ii)))}))).as<::mosek::fusion::Constraint>();
    }
  }
}
// End mosek.fusion.Constraint.index

// Begin mosek.fusion.Constraint.index
// Method mosek.fusion.Constraint.index @ bld/docker-win/final/default/src/fusion/Constraint.mbi:236:6-246:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__index(int32_t _3099_idx) { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__index(_3099_idx); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::index(int32_t _3099_idx) { return __mosek_2fusion_2Constraint__index(_3099_idx); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__index(int32_t _3099_idx)
{
  if ((((int)((shape)->size(0)) == (int)0) && (_3099_idx == (int)0)))
  {
    {
      return ::mosek::fusion::Constraint::t(_pubthis);
    }
  }
  else if(((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Variable shape and slice do not match"));
    }
  }
  else if(((_3099_idx < (int)0) || (_3099_idx > ((*shape)((int)0)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Index is out of bounds"));
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*con_nativeidxs)(_3099_idx)))}))).as<::mosek::fusion::Constraint>();
    }
  }
}
// End mosek.fusion.Constraint.index

// Begin mosek.fusion.Constraint.slice
// Method mosek.fusion.Constraint.slice @ bld/docker-win/final/default/src/fusion/Constraint.mbi:179:6-231:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3100_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _3101_lasta) { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__slice(_3100_firsta,_3101_lasta); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3100_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _3101_lasta) { return __mosek_2fusion_2Constraint__slice(_3100_firsta,_3101_lasta); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3100_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _3101_lasta)
{
  _checked_ptr_1<int32_t> _ptr__3100_firsta(_3100_firsta ? _3100_firsta->raw() : nullptr, _3100_firsta ? _3100_firsta->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3101_lasta(_3101_lasta ? _3101_lasta->raw() : nullptr, _3101_lasta ? _3101_lasta->size(0) : 0);
  if (((int)((_3100_firsta)->size(0)) != (int)((_3101_lasta)->size(0))))
  {
    {
      throw ::mosek::fusion::SliceError(std::string ("invalid slice"));
    }
  }
  else if(((int)((_3100_firsta)->size(0)) != (int)((shape)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("variable shape and slice do not match"));
    }
  }
  else
  {
    {
      int32_t _10654_ = (int)0;
      int32_t _10655_ = (int)((shape)->size(0));
      for (int32_t _3102_i = _10654_; _3102_i < _10655_; ++_3102_i)
      {
        {
          if (((_ptr__3100_firsta[_3102_i] < (int)0) || (_ptr__3101_lasta[_3102_i] > ((*shape)(_3102_i)))))
          {
            {
              throw ::mosek::fusion::IndexError(std::string ("slice is out of bounds"));
            }
          }
          else if((_ptr__3100_firsta[_3102_i] > _ptr__3101_lasta[_3102_i]))
          {
            {
              throw ::mosek::fusion::SliceError(std::string ("invalid slice"));
            }
          }
          {}
        }
      }
      int32_t _3103_nd = (int)((shape)->size(0));
      std::vector<int32_t> _10656_;
      for (int32_t _3105_i = (int)0, _10657_ = _3103_nd; _3105_i < _10657_ ; ++_3105_i)
      {
        _10656_.push_back((_ptr__3101_lasta[_3105_i] - _ptr__3100_firsta[_3105_i]));
      }
      auto _10658_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10656_.size()),_10656_.begin(),_10656_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3104_sliceshape = _10658_;
      _checked_ptr_1<int32_t> _ptr__3104_sliceshape(_3104_sliceshape ? _3104_sliceshape->raw() : nullptr,_3104_sliceshape ? _3104_sliceshape->size(0) : 0);
      int32_t _3106_slicesize = (int)1;
      int32_t _10659_ = (int)0;
      int32_t _10660_ = _3103_nd;
      for (int32_t _3107_i = _10659_; _3107_i < _10660_; ++_3107_i)
      {
        {
          _3106_slicesize *= (_ptr__3101_lasta[_3107_i] - _ptr__3100_firsta[_3107_i]);
        }
      }
      if ((_3106_slicesize == (int)0))
      {
        {
          return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(model,_3104_sliceshape,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))))).as<::mosek::fusion::Constraint>();
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3108_sliceidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3106_slicesize)));
          _checked_ptr_1<int32_t> _ptr__3108_sliceidxs(_3108_sliceidxs ? _3108_sliceidxs->raw() : nullptr,_3108_sliceidxs ? _3108_sliceidxs->size(0) : 0);
          {
            std::shared_ptr< monty::ndarray< int32_t,1 > > _3109_strides = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3103_nd)));
            _checked_ptr_1<int32_t> _ptr__3109_strides(_3109_strides ? _3109_strides->raw() : nullptr,_3109_strides ? _3109_strides->size(0) : 0);
            _ptr__3109_strides[(_3103_nd - (int)1)] = (int)1;
            int32_t _10661_ = (int)1;
            int32_t _10662_ = _3103_nd;
            for (int32_t _3110_i = _10661_; _3110_i < _10662_; ++_3110_i)
            {
              {
                _ptr__3109_strides[((_3103_nd - _3110_i) - (int)1)] = safe_mul( _ptr__3109_strides[(_3103_nd - _3110_i)],((*shape)((_3103_nd - _3110_i))) );
              }
            }
            int32_t _3111_start = (int)0;
            int32_t _10663_ = (int)0;
            int32_t _10664_ = _3103_nd;
            for (int32_t _3112_i = _10663_; _3112_i < _10664_; ++_3112_i)
            {
              {
                _3111_start += safe_mul( _ptr__3100_firsta[_3112_i],_ptr__3109_strides[_3112_i] );
              }
            }
            std::vector<int32_t> _10665_;
            for (int32_t _3114_i = (int)0, _10666_ = _3103_nd; _3114_i < _10666_ ; ++_3114_i)
            {
              _10665_.push_back(_3111_start);
            }
            auto _10667_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10665_.size()),_10665_.begin(),_10665_.end()));
            std::shared_ptr< monty::ndarray< int32_t,1 > > _3113_pp = _10667_;
            _checked_ptr_1<int32_t> _ptr__3113_pp(_3113_pp ? _3113_pp->raw() : nullptr,_3113_pp ? _3113_pp->size(0) : 0);
            std::vector<int32_t> _10668_;
            for (int32_t _3116_i = (int)0, _10669_ = _3103_nd; _3116_i < _10669_ ; ++_3116_i)
            {
              _10668_.push_back(_ptr__3100_firsta[_3116_i]);
            }
            auto _10670_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10668_.size()),_10668_.begin(),_10668_.end()));
            std::shared_ptr< monty::ndarray< int32_t,1 > > _3115_ii = _10670_;
            _checked_ptr_1<int32_t> _ptr__3115_ii(_3115_ii ? _3115_ii->raw() : nullptr,_3115_ii ? _3115_ii->size(0) : 0);
            int32_t _10671_ = (int)0;
            int32_t _10672_ = _3106_slicesize;
            for (int32_t _3117_i = _10671_; _3117_i < _10672_; ++_3117_i)
            {
              {
                _ptr__3108_sliceidxs[_3117_i] = ((*con_nativeidxs)(_ptr__3113_pp[(_3103_nd - (int)1)]));
                _ptr__3115_ii[(_3103_nd - (int)1)] += (int)1;
                _ptr__3113_pp[(_3103_nd - (int)1)] += _ptr__3109_strides[(_3103_nd - (int)1)];
                if ((_ptr__3115_ii[(_3103_nd - (int)1)] >= _ptr__3101_lasta[(_3103_nd - (int)1)]))
                {
                  {
                    int32_t _3118_k = (_3103_nd - (int)1);
                    while ( ((_3118_k > (int)0) && (_ptr__3115_ii[_3118_k] >= _ptr__3101_lasta[_3118_k])) )
                    {
                      {
                        _ptr__3115_ii[_3118_k] = _ptr__3100_firsta[_3118_k];
                        _ptr__3115_ii[(_3118_k - (int)1)] += (int)1;
                        _ptr__3113_pp[(_3118_k - (int)1)] += _ptr__3109_strides[(_3118_k - (int)1)];
                        -- _3118_k;
                      }
                    }
                    int32_t _10673_ = safe_add( _3118_k,(int)1 );
                    int32_t _10674_ = _3103_nd;
                    for (int32_t _3119_k2 = _10673_; _3119_k2 < _10674_; ++_3119_k2)
                    {
                      {
                        _ptr__3113_pp[_3119_k2] = _ptr__3113_pp[_3118_k];
                      }
                    }
                  }
                }
                {}
              }
            }
          }
          return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(_pubthis->__mosek_2fusion_2Constraint__getModel(),_3104_sliceshape,_3108_sliceidxs)).as<::mosek::fusion::Constraint>();
        }
      }
    }
  }
}
// End mosek.fusion.Constraint.slice

// Begin mosek.fusion.Constraint.slice
// Method mosek.fusion.Constraint.slice @ bld/docker-win/final/default/src/fusion/Constraint.mbi:166:6-177:7
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__slice(int32_t _3120_first,int32_t _3121_last) { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__slice(_3120_first,_3121_last); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::Constraint::slice(int32_t _3120_first,int32_t _3121_last) { return __mosek_2fusion_2Constraint__slice(_3120_first,_3121_last); }
monty::rc_ptr< ::mosek::fusion::Constraint > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__slice(int32_t _3120_first,int32_t _3121_last)
{
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Variable shape and slice do not match"));
    }
  }
  {}
  if (((_3120_first == (int)0) && (_3121_last == ((*shape)((int)0)))))
  {
    {
      return ::mosek::fusion::Constraint::t(_pubthis);
    }
  }
  else if(((_3120_first < (int)0) || (_3121_last > ((*shape)((int)0)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Slice is out of bounds"));
    }
  }
  else if((_3120_first > _3121_last))
  {
    {
      throw ::mosek::fusion::SliceError(std::string ("Invalid slice"));
    }
  }
  else
  {
    {
      std::vector<int32_t> _10675_;
      for (int32_t _3122_i = _3120_first, _10676_ = _3121_last; _3122_i < _10676_ ; ++_3122_i)
      {
        _10675_.push_back(((*con_nativeidxs)(_3122_i)));
      }
      auto _10677_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10675_.size()),_10675_.begin(),_10675_.end()));
      return (::mosek::fusion::p_SliceConstraint::_new_SliceConstraint(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((_3121_last - _3120_first))}),_10677_)).as<::mosek::fusion::Constraint>();
    }
  }
}
// End mosek.fusion.Constraint.slice

// Begin mosek.fusion.Constraint.getND
// Method mosek.fusion.Constraint.getND @ bld/docker-win/final/default/src/fusion/Constraint.mbi:162:6-164:7
int32_t mosek::fusion::Constraint :: getND() { return mosek::fusion::p_Constraint::_get_impl(this)->getND(); }
int32_t mosek::fusion::p_Constraint::getND()
{
  return (int)((shape)->size(0));
}
// End mosek.fusion.Constraint.getND

// Begin mosek.fusion.Constraint.getSize
// Method mosek.fusion.Constraint.getSize @ bld/docker-win/final/default/src/fusion/Constraint.mbi:156:6-159:7
int32_t mosek::fusion::Constraint :: getSize() { return mosek::fusion::p_Constraint::_get_impl(this)->getSize(); }
int32_t mosek::fusion::p_Constraint::getSize()
{
  int32_t _3123_sz = (int)1;
  int32_t _10678_ = (int)0;
  int32_t _10679_ = (int)((shape)->size(0));
  for (int32_t _3124_i = _10678_; _3124_i < _10679_; ++_3124_i)
  {
    {
      _3123_sz *= ((*shape)(_3124_i));
    }
  }
  return _3123_sz;
}
// End mosek.fusion.Constraint.getSize

// Begin mosek.fusion.Constraint.getModel
// Method mosek.fusion.Constraint.getModel @ bld/docker-win/final/default/src/fusion/Constraint.mbi:153:6-55
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Constraint :: __mosek_2fusion_2Constraint__getModel() { return mosek::fusion::p_Constraint::_get_impl(this)->__mosek_2fusion_2Constraint__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::Constraint::getModel() { return __mosek_2fusion_2Constraint__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_Constraint::__mosek_2fusion_2Constraint__getModel()
{
  return model;
}
// End mosek.fusion.Constraint.getModel

// Begin mosek.fusion.Constraint.getShape
// Method mosek.fusion.Constraint.getShape @ bld/docker-win/final/default/src/fusion/Constraint.mbi:147:6-150:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Constraint :: getShape() { return mosek::fusion::p_Constraint::_get_impl(this)->getShape(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Constraint::getShape()
{
  std::vector<int32_t> _10680_;
  for (int32_t _3125_i = (int)0, _10681_ = (int)((shape)->size(0)); _3125_i < _10681_ ; ++_3125_i)
  {
    _10680_.push_back(((*shape)(_3125_i)));
  }
  auto _10682_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10680_.size()),_10680_.begin(),_10680_.end()));
  return _10682_;
}
// End mosek.fusion.Constraint.getShape

// Begin mosek.fusion.Constraint.getNativeidxs
// Method mosek.fusion.Constraint.getNativeidxs @ bld/docker-win/final/default/src/fusion/Constraint.mbi:142:6-144:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Constraint::getNativeidxs()
{
  return con_nativeidxs;
}
// End mosek.fusion.Constraint.getNativeidxs

void mosek::fusion::p_Constraint::destroy()
{
  con_nativeidxs.reset();
  shape.reset();
  model.reset();
}
void mosek::fusion::Constraint::destroy() { mosek::fusion::p_Constraint::_get_impl(this)->destroy(); }
// } class Constraint
// class Set { // @ bld/docker-win/final/default/src/fusion/Set.mbi:34:4-207:5
mosek::fusion::Set::Set(mosek::fusion::p_Set *_impl) : _impl(_impl) { /*std::cout << "Set() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Set::~Set() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Set::p_Set
  (::mosek::fusion::Set * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Set.size
// Method mosek.fusion.Set.size @ bld/docker-win/final/default/src/fusion/Set.mbi:204:6-206:7
int64_t mosek::fusion::Set::size
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3126_shape) { return mosek::fusion::p_Set::size(_3126_shape); }
int64_t mosek::fusion::p_Set::size(std::shared_ptr< monty::ndarray< int32_t,1 > > _3126_shape)
{
  _checked_ptr_1<int32_t> _ptr__3126_shape(_3126_shape ? _3126_shape->raw() : nullptr, _3126_shape ? _3126_shape->size(0) : 0);
  int64_t _3127_sz = (int64_t)1;
  int32_t _10683_ = (int)0;
  int32_t _10684_ = (int)((_3126_shape)->size(0));
  for (int32_t _3128_i = _10683_; _3128_i < _10684_; ++_3128_i)
  {
    {
      _3127_sz *= _ptr__3126_shape[_3128_i];
    }
  }
  return _3127_sz;
}
// End mosek.fusion.Set.size

// Begin mosek.fusion.Set.match
// Method mosek.fusion.Set.match @ bld/docker-win/final/default/src/fusion/Set.mbi:195:6-201:7
bool mosek::fusion::Set::match
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3129_s1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3130_s2) { return mosek::fusion::p_Set::match(_3129_s1,_3130_s2); }
bool mosek::fusion::p_Set::match(std::shared_ptr< monty::ndarray< int32_t,1 > > _3129_s1,std::shared_ptr< monty::ndarray< int32_t,1 > > _3130_s2)
{
  _checked_ptr_1<int32_t> _ptr__3129_s1(_3129_s1 ? _3129_s1->raw() : nullptr, _3129_s1 ? _3129_s1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3130_s2(_3130_s2 ? _3130_s2->raw() : nullptr, _3130_s2 ? _3130_s2->size(0) : 0);
  if (((int)((_3129_s1)->size(0)) != (int)((_3130_s2)->size(0))))
  {
    {
      return false;
    }
  }
  {}
  int32_t _10685_ = (int)0;
  int32_t _10686_ = (int)((_3129_s1)->size(0));
  for (int32_t _3131_i = _10685_; _3131_i < _10686_; ++_3131_i)
  {
    {
      if ((_ptr__3129_s1[_3131_i] != _ptr__3130_s2[_3131_i]))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.Set.match

// Begin mosek.fusion.Set.linearidx
// Method mosek.fusion.Set.linearidx @ bld/docker-win/final/default/src/fusion/Set.mbi:186:6-192:7
int64_t mosek::fusion::Set::linearidx
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3132_shape,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3133_key) { return mosek::fusion::p_Set::linearidx(_3132_shape,_3133_key); }
int64_t mosek::fusion::p_Set::linearidx(std::shared_ptr< monty::ndarray< int32_t,1 > > _3132_shape,std::shared_ptr< monty::ndarray< int32_t,1 > > _3133_key)
{
  _checked_ptr_1<int32_t> _ptr__3132_shape(_3132_shape ? _3132_shape->raw() : nullptr, _3132_shape ? _3132_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3133_key(_3133_key ? _3133_key->raw() : nullptr, _3133_key ? _3133_key->size(0) : 0);
  int64_t _3134_res = _ptr__3133_key[(int)0];
  int32_t _10687_ = (int)1;
  int32_t _10688_ = (int)((_3133_key)->size(0));
  for (int32_t _3135_i = _10687_; _3135_i < _10688_; ++_3135_i)
  {
    {
      _3134_res = safe_add( safe_mul( _3134_res,_ptr__3132_shape[_3135_i] ),_ptr__3133_key[_3135_i] );
    }
  }
  return _3134_res;
}
// End mosek.fusion.Set.linearidx

// Begin mosek.fusion.Set.idxtokey
// Method mosek.fusion.Set.idxtokey @ bld/docker-win/final/default/src/fusion/Set.mbi:169:6-174:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::idxtokey
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3136_shape,
    int64_t _3137_idx) { return mosek::fusion::p_Set::idxtokey(_3136_shape,_3137_idx); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::idxtokey(std::shared_ptr< monty::ndarray< int32_t,1 > > _3136_shape,int64_t _3137_idx)
{
  _checked_ptr_1<int32_t> _ptr__3136_shape(_3136_shape ? _3136_shape->raw() : nullptr, _3136_shape ? _3136_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3138_res = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)((_3136_shape)->size(0)))));
  _checked_ptr_1<int32_t> _ptr__3138_res(_3138_res ? _3138_res->raw() : nullptr,_3138_res ? _3138_res->size(0) : 0);
  ::mosek::fusion::p_Set::idxtokey(_3136_shape,_3137_idx,_3138_res);
  return _3138_res;
}
// End mosek.fusion.Set.idxtokey

// Begin mosek.fusion.Set.idxtokey
// Method mosek.fusion.Set.idxtokey @ bld/docker-win/final/default/src/fusion/Set.mbi:154:6-167:7
void mosek::fusion::Set::idxtokey
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3139_shape,
    int64_t _3140_idx,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3141_dest) { mosek::fusion::p_Set::idxtokey(_3139_shape,_3140_idx,_3141_dest); }
void mosek::fusion::p_Set::idxtokey(std::shared_ptr< monty::ndarray< int32_t,1 > > _3139_shape,int64_t _3140_idx,std::shared_ptr< monty::ndarray< int32_t,1 > > _3141_dest)
{
  _checked_ptr_1<int32_t> _ptr__3139_shape(_3139_shape ? _3139_shape->raw() : nullptr, _3139_shape ? _3139_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3141_dest(_3141_dest ? _3141_dest->raw() : nullptr, _3141_dest ? _3141_dest->size(0) : 0);
  int32_t _3142_nd = (int)((_3139_shape)->size(0));
  if ((_3142_nd > (int)0))
  {
    {
      int64_t _3143_ix = _3140_idx;
      int32_t _10689_ = (int)0;
      int32_t _10690_ = (_3142_nd - (int)1);
      for (int32_t _3144_i = _10689_; _3144_i < _10690_; ++_3144_i)
      {
        {
          _ptr__3141_dest[((_3142_nd - _3144_i) - (int)1)] = (int32_t)(_3143_ix % _ptr__3139_shape[((_3142_nd - _3144_i) - (int)1)]);
          _3143_ix /= _ptr__3139_shape[((_3142_nd - _3144_i) - (int)1)];
        }
      }
      _ptr__3141_dest[(int)0] = (int32_t)_3143_ix;
    }
  }
  {}
}
// End mosek.fusion.Set.idxtokey

// Begin mosek.fusion.Set.indexToString
// Method mosek.fusion.Set.indexToString @ bld/docker-win/final/default/src/fusion/Set.mbi:124:6-148:7
std::string mosek::fusion::Set::indexToString
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3145_shape,
    int64_t _3146_key) { return mosek::fusion::p_Set::indexToString(_3145_shape,_3146_key); }
std::string mosek::fusion::p_Set::indexToString(std::shared_ptr< monty::ndarray< int32_t,1 > > _3145_shape,int64_t _3146_key)
{
  _checked_ptr_1<int32_t> _ptr__3145_shape(_3145_shape ? _3145_shape->raw() : nullptr, _3145_shape ? _3145_shape->size(0) : 0);
  int32_t _3147_nd = (int)((_3145_shape)->size(0));
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _3148_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  if ((_3147_nd == (int)0))
  {
    {
      return std::string ("0");
    }
  }
  else if((_3147_nd == (int)1))
  {
    {
      return _3148_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_3146_key)->toString();
    }
  }
  else
  {
    {
      int64_t _3149_rem = _3146_key;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3150_k = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3147_nd)));
      _checked_ptr_1<int32_t> _ptr__3150_k(_3150_k ? _3150_k->raw() : nullptr,_3150_k ? _3150_k->size(0) : 0);
      int32_t _10691_ = (int)1;
      int32_t _10692_ = _3147_nd;
      for (int32_t _3151_i = _10691_; _3151_i < _10692_; ++_3151_i)
      {
        {
          _ptr__3150_k[(_3147_nd - _3151_i)] = (int32_t)(_3149_rem % _ptr__3145_shape[(_3147_nd - _3151_i)]);
          _3149_rem /= _ptr__3145_shape[(_3147_nd - _3151_i)];
        }
      }
      _ptr__3150_k[(int)0] = (int32_t)_3149_rem;
      _3148_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__3150_k[(int)0]);
      int32_t _10693_ = (int)1;
      int32_t _10694_ = _3147_nd;
      for (int32_t _3152_i = _10693_; _3152_i < _10694_; ++_3152_i)
      {
        {
          _3148_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__3150_k[_3152_i]);
        }
      }
      return _3148_sb->toString();
    }
  }
}
// End mosek.fusion.Set.indexToString

// Begin mosek.fusion.Set.keyToString
// Method mosek.fusion.Set.keyToString @ bld/docker-win/final/default/src/fusion/Set.mbi:112:6-119:7
std::string mosek::fusion::Set::keyToString
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3153_key) { return mosek::fusion::p_Set::keyToString(_3153_key); }
std::string mosek::fusion::p_Set::keyToString(std::shared_ptr< monty::ndarray< int32_t,1 > > _3153_key)
{
  _checked_ptr_1<int32_t> _ptr__3153_key(_3153_key ? _3153_key->raw() : nullptr, _3153_key ? _3153_key->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _3154_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _3154_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__3153_key[(int)0]);
  int32_t _10695_ = (int)1;
  int32_t _10696_ = (int)((_3153_key)->size(0));
  for (int32_t _3155_i = _10695_; _3155_i < _10696_; ++_3155_i)
  {
    {
      _3154_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(_ptr__3153_key[_3155_i]);
    }
  }
  return _3154_sb->toString();
}
// End mosek.fusion.Set.keyToString

// Begin mosek.fusion.Set.indexToKey
// Method mosek.fusion.Set.indexToKey @ bld/docker-win/final/default/src/fusion/Set.mbi:92:6-107:7
void mosek::fusion::Set::indexToKey
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3156_shape,
    int64_t _3157_key,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3158_res) { mosek::fusion::p_Set::indexToKey(_3156_shape,_3157_key,_3158_res); }
void mosek::fusion::p_Set::indexToKey(std::shared_ptr< monty::ndarray< int32_t,1 > > _3156_shape,int64_t _3157_key,std::shared_ptr< monty::ndarray< int32_t,1 > > _3158_res)
{
  _checked_ptr_1<int32_t> _ptr__3156_shape(_3156_shape ? _3156_shape->raw() : nullptr, _3156_shape ? _3156_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3158_res(_3158_res ? _3158_res->raw() : nullptr, _3158_res ? _3158_res->size(0) : 0);
  int32_t _3159_nd = (int)((_3156_shape)->size(0));
  if ((_3159_nd == (int)1))
  {
    {
      _ptr__3158_res[(int)0] = (int32_t)_3157_key;
    }
  }
  else
  {
    {
      int64_t _3160_rem = _3157_key;
      int32_t _10697_ = (int)1;
      int32_t _10698_ = _3159_nd;
      for (int32_t _3161_i = _10697_; _3161_i < _10698_; ++_3161_i)
      {
        {
          _ptr__3158_res[(_3159_nd - _3161_i)] = (int32_t)(_3160_rem % _ptr__3156_shape[(_3159_nd - _3161_i)]);
          _3160_rem /= _ptr__3156_shape[(_3159_nd - _3161_i)];
        }
      }
      _ptr__3158_res[(int)0] = (int32_t)_3160_rem;
    }
  }
}
// End mosek.fusion.Set.indexToKey

// Begin mosek.fusion.Set.strides
// Method mosek.fusion.Set.strides @ bld/docker-win/final/default/src/fusion/Set.mbi:81:6-87:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::Set::strides
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3162_shape) { return mosek::fusion::p_Set::strides(_3162_shape); }
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_Set::strides(std::shared_ptr< monty::ndarray< int32_t,1 > > _3162_shape)
{
  _checked_ptr_1<int32_t> _ptr__3162_shape(_3162_shape ? _3162_shape->raw() : nullptr, _3162_shape ? _3162_shape->size(0) : 0);
  int32_t _3163_nd = (int)((_3162_shape)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3164_st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3163_nd)));
  _checked_ptr_1<int64_t> _ptr__3164_st(_3164_st ? _3164_st->raw() : nullptr,_3164_st ? _3164_st->size(0) : 0);
  _ptr__3164_st[(_3163_nd - (int)1)] = (int)1;
  int32_t _10699_ = (int)1;
  int32_t _10700_ = _3163_nd;
  for (int32_t _3165_i = _10699_; _3165_i < _10700_; ++_3165_i)
  {
    {
      _ptr__3164_st[((_3163_nd - _3165_i) - (int)1)] = safe_mul( _ptr__3164_st[(_3163_nd - _3165_i)],_ptr__3162_shape[(_3163_nd - _3165_i)] );
    }
  }
  return _3164_st;
}
// End mosek.fusion.Set.strides

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:66:6-72:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3166_set1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3167_set2) { return mosek::fusion::p_Set::make(_3166_set1,_3167_set2); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(std::shared_ptr< monty::ndarray< int32_t,1 > > _3166_set1,std::shared_ptr< monty::ndarray< int32_t,1 > > _3167_set2)
{
  _checked_ptr_1<int32_t> _ptr__3166_set1(_3166_set1 ? _3166_set1->raw() : nullptr, _3166_set1 ? _3166_set1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3167_set2(_3167_set2 ? _3167_set2->raw() : nullptr, _3167_set2 ? _3167_set2->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3168_r = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( (int)((_3166_set1)->size(0)),(int)((_3167_set2)->size(0)) ))));
  _checked_ptr_1<int32_t> _ptr__3168_r(_3168_r ? _3168_r->raw() : nullptr,_3168_r ? _3168_r->size(0) : 0);
  int32_t _10701_ = (int)0;
  int32_t _10702_ = (int)((_3166_set1)->size(0));
  for (int32_t _3169_i = _10701_; _3169_i < _10702_; ++_3169_i)
  {
    {
      _ptr__3168_r[_3169_i] = _ptr__3166_set1[_3169_i];
    }
  }
  int32_t _10703_ = (int)0;
  int32_t _10704_ = (int)((_3167_set2)->size(0));
  for (int32_t _3170_i = _10703_; _3170_i < _10704_; ++_3170_i)
  {
    {
      _ptr__3168_r[safe_add( (int)((_3166_set1)->size(0)),_3170_i )] = _ptr__3167_set2[_3170_i];
    }
  }
  return _3168_r;
}
// End mosek.fusion.Set.make

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:61:6-64:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3171_sizes) { return mosek::fusion::p_Set::make(_3171_sizes); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(std::shared_ptr< monty::ndarray< int32_t,1 > > _3171_sizes)
{
  _checked_ptr_1<int32_t> _ptr__3171_sizes(_3171_sizes ? _3171_sizes->raw() : nullptr, _3171_sizes ? _3171_sizes->size(0) : 0);
  std::vector<int32_t> _10705_;
  for (int32_t _3172_i = (int)0, _10706_ = (int)((_3171_sizes)->size(0)); _3172_i < _10706_ ; ++_3172_i)
  {
    _10705_.push_back(_ptr__3171_sizes[_3172_i]);
  }
  auto _10707_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10705_.size()),_10705_.begin(),_10705_.end()));
  return _10707_;
}
// End mosek.fusion.Set.make

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:56:6-59:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( int32_t _3173_s1,
    int32_t _3174_s2,
    int32_t _3175_s3) { return mosek::fusion::p_Set::make(_3173_s1,_3174_s2,_3175_s3); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(int32_t _3173_s1,int32_t _3174_s2,int32_t _3175_s3)
{
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3173_s1),(int32_t)(_3174_s2),(int32_t)(_3175_s3)});
}
// End mosek.fusion.Set.make

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:51:6-54:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( int32_t _3176_s1,
    int32_t _3177_s2) { return mosek::fusion::p_Set::make(_3176_s1,_3177_s2); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(int32_t _3176_s1,int32_t _3177_s2)
{
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3176_s1),(int32_t)(_3177_s2)});
}
// End mosek.fusion.Set.make

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:46:6-49:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( int32_t _3178_sz) { return mosek::fusion::p_Set::make(_3178_sz); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(int32_t _3178_sz)
{
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3178_sz)});
}
// End mosek.fusion.Set.make

// Begin mosek.fusion.Set.scalar
// Method mosek.fusion.Set.scalar @ bld/docker-win/final/default/src/fusion/Set.mbi:44:6-67
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::scalar
  ( ) { return mosek::fusion::p_Set::scalar(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::scalar()
{
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
}
// End mosek.fusion.Set.scalar

// Begin mosek.fusion.Set.make
// Method mosek.fusion.Set.make @ bld/docker-win/final/default/src/fusion/Set.mbi:36:6-39:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::Set::make
  ( std::shared_ptr< monty::ndarray< std::string,1 > > _3179_names) { return mosek::fusion::p_Set::make(_3179_names); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_Set::make(std::shared_ptr< monty::ndarray< std::string,1 > > _3179_names)
{
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3179_names)->size(0)))});
}
// End mosek.fusion.Set.make

void mosek::fusion::p_Set::destroy()
{
}
void mosek::fusion::Set::destroy() { mosek::fusion::p_Set::_get_impl(this)->destroy(); }
// } class Set
// class ConeDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:1654:4-1809:5
mosek::fusion::ConeDomain::ConeDomain(mosek::fusion::p_ConeDomain *_impl) : _impl(_impl) { /*std::cout << "ConeDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ConeDomain::~ConeDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ConeDomain::p_ConeDomain
  (::mosek::fusion::ConeDomain * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.ConeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1748:6-1759:7
mosek::fusion::ConeDomain::t mosek::fusion::p_ConeDomain::_new_ConeDomain
  (mosek::fusion::QConeKey _3180_k,
    std::shared_ptr< monty::ndarray< double,1 > > _3181_alpha,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3182_d)
{ return new mosek::fusion::ConeDomain(_3180_k,_3181_alpha,_3182_d); }
mosek::fusion::ConeDomain::ConeDomain
  (mosek::fusion::QConeKey _3180_k,
    std::shared_ptr< monty::ndarray< double,1 > > _3181_alpha,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3182_d) : 
   ConeDomain(new mosek::fusion::p_ConeDomain(this))
{ mosek::fusion::p_ConeDomain::_get_impl(this)->_initialize(_3180_k,_3181_alpha,_3182_d); }
void mosek::fusion::p_ConeDomain::_initialize  (mosek::fusion::QConeKey _3180_k,
    std::shared_ptr< monty::ndarray< double,1 > > _3181_alpha,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3182_d)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3181_alpha(_3181_alpha ? _3181_alpha->raw() : nullptr, _3181_alpha ? _3181_alpha->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3182_d(_3182_d ? _3182_d->raw() : nullptr, _3182_d ? _3182_d->size(0) : 0);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _10708_;
    bool _10709_ = (NULL != _3182_d.get());
    if (_10709_)
    {
      _10708_ = ::mosek::fusion::Utils::Tools::arraycopy(_3182_d);
    }
    else
    {
      _10708_ = nullptr;
    }
    shape = _10708_;
    domsize = (int)0;
    mosek::fusion::p_ConeDomain::_get_impl(::mosek::fusion::ConeDomain::t(_pubthis))->alpha = _3181_alpha;
    key = _3180_k;
    axisidx = (int)0;
    axisset = false;
    int_flag = false;
    domofs = nullptr;
    indexnames = nullptr;
  }
}
// mosek.fusion.ConeDomain.ctor

// mosek.fusion.ConeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1722:6-1724:7
mosek::fusion::ConeDomain::t mosek::fusion::p_ConeDomain::_new_ConeDomain
  (mosek::fusion::QConeKey _3183_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3184_d)
{ return new mosek::fusion::ConeDomain(_3183_k,_3184_d); }
mosek::fusion::ConeDomain::ConeDomain
  (mosek::fusion::QConeKey _3183_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3184_d) : 
   ConeDomain(new mosek::fusion::p_ConeDomain(this))
{ mosek::fusion::p_ConeDomain::_get_impl(this)->_initialize(_3183_k,_3184_d); }
void mosek::fusion::p_ConeDomain::_initialize  (mosek::fusion::QConeKey _3183_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3184_d)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__3184_d(_3184_d ? _3184_d->raw() : nullptr, _3184_d ? _3184_d->size(0) : 0);
    mosek::fusion::p_ConeDomain::_initialize(_3183_k,nullptr,_3184_d);
  }
}
// mosek.fusion.ConeDomain.ctor

// mosek.fusion.ConeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1668:6-1678:7
mosek::fusion::ConeDomain::t mosek::fusion::p_ConeDomain::_new_ConeDomain
  (monty::rc_ptr< ::mosek::fusion::ConeDomain > _3185_other)
{ return new mosek::fusion::ConeDomain(_3185_other); }
mosek::fusion::ConeDomain::ConeDomain
  (monty::rc_ptr< ::mosek::fusion::ConeDomain > _3185_other) : 
   ConeDomain(new mosek::fusion::p_ConeDomain(this))
{ mosek::fusion::p_ConeDomain::_get_impl(this)->_initialize(_3185_other); }
void mosek::fusion::p_ConeDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::ConeDomain > _3185_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    key = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->key;
    axisidx = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->axisidx;
    axisset = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->axisset;
    int_flag = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->int_flag;
    shape = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->shape;
    alpha = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->alpha;
    domofs = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->domofs;
    domsize = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->domsize;
    indexnames = mosek::fusion::p_ConeDomain::_get_impl(_3185_other)->indexnames;
  }
}
// mosek.fusion.ConeDomain.ctor

// Begin mosek.fusion.ConeDomain.match_shape
// Method mosek.fusion.ConeDomain.match_shape @ bld/docker-win/final/default/src/fusion/domain.mbi:1804:6-1808:7
bool mosek::fusion::p_ConeDomain::match_shape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3186_shp)
{
  _checked_ptr_1<int32_t> _ptr__3186_shp(_3186_shp ? _3186_shp->raw() : nullptr, _3186_shp ? _3186_shp->size(0) : 0);
  return ((NULL == shape.get()) || ::mosek::fusion::p_Set::match(_3186_shp,shape));
}
// End mosek.fusion.ConeDomain.match_shape

// Begin mosek.fusion.ConeDomain.integral
// Method mosek.fusion.ConeDomain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:1802:6-76
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__integral() { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::integral() { return __mosek_2fusion_2ConeDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__integral()
{
  int_flag = true;
  return ::mosek::fusion::ConeDomain::t(_pubthis);
}
// End mosek.fusion.ConeDomain.integral

// Begin mosek.fusion.ConeDomain.axisIsSet
// Method mosek.fusion.ConeDomain.axisIsSet @ bld/docker-win/final/default/src/fusion/domain.mbi:1795:6-66
bool mosek::fusion::ConeDomain :: axisIsSet() { return mosek::fusion::p_ConeDomain::_get_impl(this)->axisIsSet(); }
bool mosek::fusion::p_ConeDomain::axisIsSet()
{
  return axisset;
}
// End mosek.fusion.ConeDomain.axisIsSet

// Begin mosek.fusion.ConeDomain.getAxis
// Method mosek.fusion.ConeDomain.getAxis @ bld/docker-win/final/default/src/fusion/domain.mbi:1792:6-66
int32_t mosek::fusion::ConeDomain :: getAxis() { return mosek::fusion::p_ConeDomain::_get_impl(this)->getAxis(); }
int32_t mosek::fusion::p_ConeDomain::getAxis()
{
  return axisidx;
}
// End mosek.fusion.ConeDomain.getAxis

// Begin mosek.fusion.ConeDomain.axis
// Method mosek.fusion.ConeDomain.axis @ bld/docker-win/final/default/src/fusion/domain.mbi:1789:6-94
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__axis(int32_t _3187_a) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__axis(_3187_a); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::axis(int32_t _3187_a) { return __mosek_2fusion_2ConeDomain__axis(_3187_a); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__axis(int32_t _3187_a)
{
  axisidx = _3187_a;
  axisset = true;
  return ::mosek::fusion::ConeDomain::t(_pubthis);
}
// End mosek.fusion.ConeDomain.axis

// Begin mosek.fusion.ConeDomain.withShape
// Method mosek.fusion.ConeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1785:6-121
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__withShape(int32_t _3188_dim0,int32_t _3189_dim1,int32_t _3190_dim2) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__withShape(_3188_dim0,_3189_dim1,_3190_dim2); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::withShape(int32_t _3188_dim0,int32_t _3189_dim1,int32_t _3190_dim2) { return __mosek_2fusion_2ConeDomain__withShape(_3188_dim0,_3189_dim1,_3190_dim2); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withShape(int32_t _3188_dim0,int32_t _3189_dim1,int32_t _3190_dim2)
{
  return __mosek_2fusion_2ConeDomain__withShape_(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3188_dim0),(int32_t)(_3189_dim1),(int32_t)(_3190_dim2)}));
}
// End mosek.fusion.ConeDomain.withShape

// Begin mosek.fusion.ConeDomain.withShape
// Method mosek.fusion.ConeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1784:6-105
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__withShape(int32_t _3191_dim0,int32_t _3192_dim1) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__withShape(_3191_dim0,_3192_dim1); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::withShape(int32_t _3191_dim0,int32_t _3192_dim1) { return __mosek_2fusion_2ConeDomain__withShape(_3191_dim0,_3192_dim1); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withShape(int32_t _3191_dim0,int32_t _3192_dim1)
{
  return __mosek_2fusion_2ConeDomain__withShape_(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3191_dim0),(int32_t)(_3192_dim1)}));
}
// End mosek.fusion.ConeDomain.withShape

// Begin mosek.fusion.ConeDomain.withShape
// Method mosek.fusion.ConeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1783:6-89
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__withShape(int32_t _3193_dim0) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__withShape(_3193_dim0); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::withShape(int32_t _3193_dim0) { return __mosek_2fusion_2ConeDomain__withShape(_3193_dim0); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withShape(int32_t _3193_dim0)
{
  return __mosek_2fusion_2ConeDomain__withShape_(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3193_dim0)}));
}
// End mosek.fusion.ConeDomain.withShape

// Begin mosek.fusion.ConeDomain.withShape
// Method mosek.fusion.ConeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1782:6-104
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3194_shp) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__withShape(_3194_shp); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3194_shp) { return __mosek_2fusion_2ConeDomain__withShape(_3194_shp); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3194_shp)
{
  _checked_ptr_1<int32_t> _ptr__3194_shp(_3194_shp ? _3194_shp->raw() : nullptr, _3194_shp ? _3194_shp->size(0) : 0);
  return __mosek_2fusion_2ConeDomain__withShape_(::mosek::fusion::Utils::Tools::arraycopy(_3194_shp));
}
// End mosek.fusion.ConeDomain.withShape

// Begin mosek.fusion.ConeDomain.withShape_
// Method mosek.fusion.ConeDomain.withShape_ @ bld/docker-win/final/default/src/fusion/domain.mbi:1781:6-85
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withShape_(std::shared_ptr< monty::ndarray< int32_t,1 > > _3195_shp)
{
  _checked_ptr_1<int32_t> _ptr__3195_shp(_3195_shp ? _3195_shp->raw() : nullptr, _3195_shp ? _3195_shp->size(0) : 0);
  shape = _3195_shp;
  return ::mosek::fusion::ConeDomain::t(_pubthis);
}
// End mosek.fusion.ConeDomain.withShape_

// Begin mosek.fusion.ConeDomain.withNamesOnAxis
// Method mosek.fusion.ConeDomain.withNamesOnAxis @ bld/docker-win/final/default/src/fusion/domain.mbi:1761:6-1774:7
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain :: __mosek_2fusion_2ConeDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3196_names,int32_t _3197_axis) { return mosek::fusion::p_ConeDomain::_get_impl(this)->__mosek_2fusion_2ConeDomain__withNamesOnAxis(_3196_names,_3197_axis); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ConeDomain::withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3196_names,int32_t _3197_axis) { return __mosek_2fusion_2ConeDomain__withNamesOnAxis(_3196_names,_3197_axis); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3196_names,int32_t _3197_axis)
{
  if ((NULL == _3196_names.get()))
  {
    {
      indexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(safe_add( _3197_axis,(int)1 ))));
      std::vector<std::string> _10710_;
      for (int32_t _3198_i = (int)0, _10711_ = (int)((_3196_names)->size(0)); _3198_i < _10711_ ; ++_3198_i)
      {
        _10710_.push_back(((*_3196_names)(_3198_i)));
      }
      auto _10712_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10710_.size()),_10710_.begin(),_10710_.end()));
      ((*indexnames)(_3197_axis)) = _10712_;
    }
  }
  {}
  if (((int)((indexnames)->size(0)) < safe_add( _3197_axis,(int)1 )))
  {
    {
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _3199_ixnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_3197_axis)));
      int32_t _10713_ = (int)0;
      int32_t _10714_ = (int)((indexnames)->size(0));
      for (int32_t _3200_i = _10713_; _3200_i < _10714_; ++_3200_i)
      {
        {
          ((*_3199_ixnames)(_3200_i)) = ((*indexnames)(_3200_i));
        }
      }
      indexnames = _3199_ixnames;
    }
  }
  {}
  std::vector<std::string> _10715_;
  for (int32_t _3201_i = (int)0, _10716_ = (int)((_3196_names)->size(0)); _3201_i < _10716_ ; ++_3201_i)
  {
    _10715_.push_back(((*_3196_names)(_3201_i)));
  }
  auto _10717_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10715_.size()),_10715_.begin(),_10715_.end()));
  ((*indexnames)(_3197_axis)) = _10717_;
  return ::mosek::fusion::ConeDomain::t(_pubthis);
}
// End mosek.fusion.ConeDomain.withNamesOnAxis

// Begin mosek.fusion.ConeDomain.finalize_and_validate_inplace
// Method mosek.fusion.ConeDomain.finalize_and_validate_inplace @ bld/docker-win/final/default/src/fusion/domain.mbi:1686:6-1720:7
void mosek::fusion::p_ConeDomain::finalize_and_validate_inplace(std::shared_ptr< monty::ndarray< int32_t,1 > > _3202_shp)
{
  _checked_ptr_1<int32_t> _ptr__3202_shp(_3202_shp ? _3202_shp->raw() : nullptr, _3202_shp ? _3202_shp->size(0) : 0);
  domsize = (int)1;
  if ((NULL == shape.get()))
  {
    {
      if ((NULL != _3202_shp.get()))
      {
        {
          shape = _3202_shp;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Missing domain shape"));
        }
      }
    }
  }
  else if((NULL != _3202_shp.get()))
  {
    {
      if (((int)((_3202_shp)->size(0)) != (int)((shape)->size(0))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
        }
      }
      {}
      int32_t _10718_ = (int)0;
      int32_t _10719_ = (int)((_3202_shp)->size(0));
      for (int32_t _3203_i = _10718_; _3203_i < _10719_; ++_3203_i)
      {
        {
          if ((_ptr__3202_shp[_3203_i] != ((*shape)(_3203_i))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
            }
          }
          {}
        }
      }
    }
  }
  {}
  int32_t _10720_ = (int)0;
  int32_t _10721_ = (int)((shape)->size(0));
  for (int32_t _3204_i = _10720_; _3204_i < _10721_; ++_3204_i)
  {
    {
      domsize *= ((*shape)(_3204_i));
    }
  }
  if ((NULL != indexnames.get()))
  {
    {
      if (((int)((indexnames)->size(0)) != (int)((shape)->size(0))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
        }
      }
      {}
      int32_t _10722_ = (int)0;
      int32_t _10723_ = (int)((shape)->size(0));
      for (int32_t _3205_i = _10722_; _3205_i < _10723_; ++_3205_i)
      {
        {
          if (((NULL != ((*indexnames)(_3205_i)).get()) && ((int)((((*indexnames)(_3205_i)))->size(0)) != ((*shape)(_3205_i)))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
            }
          }
          {}
        }
      }
    }
  }
  {}
  if ((!axisset))
  {
    {
      axisset = true;
      axisidx = ((int)((shape)->size(0)) - (int)1);
    }
  }
  else if(((axisidx < (int)0) || (axisidx >= (int)((shape)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Cone axis is invalid"));
    }
  }
  {}
  if (((NULL != domofs.get()) && ((int)((domofs)->size(0)) != domsize)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Domain offset does not match shape"));
    }
  }
  {}
}
// End mosek.fusion.ConeDomain.finalize_and_validate_inplace

// Begin mosek.fusion.ConeDomain.finalize_and_validate
// Method mosek.fusion.ConeDomain.finalize_and_validate @ bld/docker-win/final/default/src/fusion/domain.mbi:1681:6-1685:7
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_ConeDomain::__mosek_2fusion_2ConeDomain__finalize_and_validate(std::shared_ptr< monty::ndarray< int32_t,1 > > _3206_shp)
{
  _checked_ptr_1<int32_t> _ptr__3206_shp(_3206_shp ? _3206_shp->raw() : nullptr, _3206_shp ? _3206_shp->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::ConeDomain > _3207_res = ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::ConeDomain::t(_pubthis));
  mosek::fusion::p_ConeDomain::_get_impl(_3207_res.get())->finalize_and_validate_inplace(_3206_shp);
  return _3207_res;
}
// End mosek.fusion.ConeDomain.finalize_and_validate

void mosek::fusion::p_ConeDomain::destroy()
{
  indexnames.reset();
  domofs.reset();
  alpha.reset();
  shape.reset();
}
void mosek::fusion::ConeDomain::destroy() { mosek::fusion::p_ConeDomain::_get_impl(this)->destroy(); }
// } class ConeDomain
// class PSDDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:1452:4-1608:5
mosek::fusion::PSDDomain::PSDDomain(mosek::fusion::p_PSDDomain *_impl) : _impl(_impl) { /*std::cout << "PSDDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::PSDDomain::~PSDDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_PSDDomain::p_PSDDomain
  (::mosek::fusion::PSDDomain * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.PSDDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1525:6-1542:7
mosek::fusion::PSDDomain::t mosek::fusion::p_PSDDomain::_new_PSDDomain
  (mosek::fusion::PSDKey _3208_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3209_shp,
    int32_t _3210_conedim1,
    int32_t _3211_conedim2)
{ return new mosek::fusion::PSDDomain(_3208_k,_3209_shp,_3210_conedim1,_3211_conedim2); }
mosek::fusion::PSDDomain::PSDDomain
  (mosek::fusion::PSDKey _3208_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3209_shp,
    int32_t _3210_conedim1,
    int32_t _3211_conedim2) : 
   PSDDomain(new mosek::fusion::p_PSDDomain(this))
{ mosek::fusion::p_PSDDomain::_get_impl(this)->_initialize(_3208_k,_3209_shp,_3210_conedim1,_3211_conedim2); }
void mosek::fusion::p_PSDDomain::_initialize  (mosek::fusion::PSDKey _3208_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3209_shp,
    int32_t _3210_conedim1,
    int32_t _3211_conedim2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__3209_shp(_3209_shp ? _3209_shp->raw() : nullptr, _3209_shp ? _3209_shp->size(0) : 0);
    axisIsSet = true;
    shape = _3209_shp;
    key = _3208_k;
    mosek::fusion::p_PSDDomain::_get_impl(::mosek::fusion::PSDDomain::t(_pubthis))->conedim1 = _3210_conedim1;
    mosek::fusion::p_PSDDomain::_get_impl(::mosek::fusion::PSDDomain::t(_pubthis))->conedim2 = _3211_conedim2;
    indexnames = nullptr;
    int32_t _3212_nd = (int)((shape)->size(0));
    if (((!(((int)((shape)->size(0)) > _3210_conedim1) && (((int)((shape)->size(0)) > _3211_conedim2) && ((_3210_conedim1 >= (int)0) && ((_3211_conedim2 >= (int)0) && (_3210_conedim1 != _3211_conedim2)))))) && (((*shape)(_3210_conedim1)) == ((*shape)(_3211_conedim2)))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape or cone dimensions"));
      }
    }
    {}
  }
}
// mosek.fusion.PSDDomain.ctor

// mosek.fusion.PSDDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1521:6-1523:7
mosek::fusion::PSDDomain::t mosek::fusion::p_PSDDomain::_new_PSDDomain
  (mosek::fusion::PSDKey _3213_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3214_shp)
{ return new mosek::fusion::PSDDomain(_3213_k,_3214_shp); }
mosek::fusion::PSDDomain::PSDDomain
  (mosek::fusion::PSDKey _3213_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3214_shp) : 
   PSDDomain(new mosek::fusion::p_PSDDomain(this))
{ mosek::fusion::p_PSDDomain::_get_impl(this)->_initialize(_3213_k,_3214_shp); }
void mosek::fusion::p_PSDDomain::_initialize  (mosek::fusion::PSDKey _3213_k,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3214_shp)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__3214_shp(_3214_shp ? _3214_shp->raw() : nullptr, _3214_shp ? _3214_shp->size(0) : 0);
    mosek::fusion::p_PSDDomain::_initialize(_3213_k,_3214_shp,((int)((_3214_shp)->size(0)) - (int)2),((int)((_3214_shp)->size(0)) - (int)1));
  }
}
// mosek.fusion.PSDDomain.ctor

// mosek.fusion.PSDDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1513:6-1520:7
mosek::fusion::PSDDomain::t mosek::fusion::p_PSDDomain::_new_PSDDomain
  (mosek::fusion::PSDKey _3215_k)
{ return new mosek::fusion::PSDDomain(_3215_k); }
mosek::fusion::PSDDomain::PSDDomain
  (mosek::fusion::PSDKey _3215_k) : 
   PSDDomain(new mosek::fusion::p_PSDDomain(this))
{ mosek::fusion::p_PSDDomain::_get_impl(this)->_initialize(_3215_k); }
void mosek::fusion::p_PSDDomain::_initialize  (mosek::fusion::PSDKey _3215_k)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    shape = nullptr;
    key = _3215_k;
    conedim1 = (int)0;
    conedim2 = (int)0;
    axisIsSet = false;
    indexnames = nullptr;
  }
}
// mosek.fusion.PSDDomain.ctor

// mosek.fusion.PSDDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1460:6-1467:7
mosek::fusion::PSDDomain::t mosek::fusion::p_PSDDomain::_new_PSDDomain
  (monty::rc_ptr< ::mosek::fusion::PSDDomain > _3216_other)
{ return new mosek::fusion::PSDDomain(_3216_other); }
mosek::fusion::PSDDomain::PSDDomain
  (monty::rc_ptr< ::mosek::fusion::PSDDomain > _3216_other) : 
   PSDDomain(new mosek::fusion::p_PSDDomain(this))
{ mosek::fusion::p_PSDDomain::_get_impl(this)->_initialize(_3216_other); }
void mosek::fusion::p_PSDDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::PSDDomain > _3216_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    shape = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->shape;
    key = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->key;
    conedim1 = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->conedim1;
    conedim2 = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->conedim2;
    axisIsSet = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->axisIsSet;
    indexnames = mosek::fusion::p_PSDDomain::_get_impl(_3216_other)->indexnames;
  }
}
// mosek.fusion.PSDDomain.ctor

// Begin mosek.fusion.PSDDomain.axis
// Method mosek.fusion.PSDDomain.axis @ bld/docker-win/final/default/src/fusion/domain.mbi:1570:6-1589:7
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::PSDDomain :: __mosek_2fusion_2PSDDomain__axis(int32_t _3217_conedim1,int32_t _3218_conedim2) { return mosek::fusion::p_PSDDomain::_get_impl(this)->__mosek_2fusion_2PSDDomain__axis(_3217_conedim1,_3218_conedim2); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::PSDDomain::axis(int32_t _3217_conedim1,int32_t _3218_conedim2) { return __mosek_2fusion_2PSDDomain__axis(_3217_conedim1,_3218_conedim2); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_PSDDomain::__mosek_2fusion_2PSDDomain__axis(int32_t _3217_conedim1,int32_t _3218_conedim2)
{
  mosek::fusion::p_PSDDomain::_get_impl(::mosek::fusion::PSDDomain::t(_pubthis))->conedim1 = _3217_conedim1;
  mosek::fusion::p_PSDDomain::_get_impl(::mosek::fusion::PSDDomain::t(_pubthis))->conedim2 = _3218_conedim2;
  axisIsSet = true;
  if (((NULL == shape.get()) && (!((_3217_conedim1 >= (int)0) && ((_3218_conedim2 >= (int)0) && (_3217_conedim1 != _3218_conedim2))))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape or cone dimensions"));
    }
  }
  else if(((NULL != shape.get()) && ((!(((int)((shape)->size(0)) > _3217_conedim1) && (((int)((shape)->size(0)) > _3218_conedim2) && ((_3217_conedim1 >= (int)0) && ((_3218_conedim2 >= (int)0) && (_3217_conedim1 != _3218_conedim2)))))) && (((*shape)(_3217_conedim1)) == ((*shape)(_3218_conedim2))))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape or cone dimensions"));
    }
  }
  {}
  return ::mosek::fusion::PSDDomain::t(_pubthis);
}
// End mosek.fusion.PSDDomain.axis

// Begin mosek.fusion.PSDDomain.withNamesOnAxis
// Method mosek.fusion.PSDDomain.withNamesOnAxis @ bld/docker-win/final/default/src/fusion/domain.mbi:1546:6-1559:7
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::PSDDomain :: __mosek_2fusion_2PSDDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3219_names,int32_t _3220_axis) { return mosek::fusion::p_PSDDomain::_get_impl(this)->__mosek_2fusion_2PSDDomain__withNamesOnAxis(_3219_names,_3220_axis); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::PSDDomain::withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3219_names,int32_t _3220_axis) { return __mosek_2fusion_2PSDDomain__withNamesOnAxis(_3219_names,_3220_axis); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_PSDDomain::__mosek_2fusion_2PSDDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3219_names,int32_t _3220_axis)
{
  if ((NULL == indexnames.get()))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10724_;
      for (int32_t _3221_i = (int)0, _10725_ = safe_add( _3220_axis,(int)1 ); _3221_i < _10725_ ; ++_3221_i)
      {
        _10724_.push_back(nullptr);
      }
      auto _10726_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10724_.size()),_10724_.begin(),_10724_.end()));
      indexnames = _10726_;
      std::vector<std::string> _10727_;
      for (int32_t _3222_i = (int)0, _10728_ = (int)((_3219_names)->size(0)); _3222_i < _10728_ ; ++_3222_i)
      {
        _10727_.push_back(((*_3219_names)(_3222_i)));
      }
      auto _10729_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10727_.size()),_10727_.begin(),_10727_.end()));
      ((*indexnames)(_3220_axis)) = _10729_;
    }
  }
  {}
  if (((int)((indexnames)->size(0)) < safe_add( _3220_axis,(int)1 )))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10730_;
      for (int32_t _3224_i = (int)0, _10731_ = safe_add( _3220_axis,(int)1 ); _3224_i < _10731_ ; ++_3224_i)
      {
        _10730_.push_back(nullptr);
      }
      auto _10732_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10730_.size()),_10730_.begin(),_10730_.end()));
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _3223_ixnames = _10732_;
      int32_t _10733_ = (int)0;
      int32_t _10734_ = (int)((indexnames)->size(0));
      for (int32_t _3225_i = _10733_; _3225_i < _10734_; ++_3225_i)
      {
        {
          ((*_3223_ixnames)(_3225_i)) = ((*indexnames)(_3225_i));
        }
      }
      indexnames = _3223_ixnames;
    }
  }
  {}
  std::vector<std::string> _10735_;
  for (int32_t _3226_i = (int)0, _10736_ = (int)((_3219_names)->size(0)); _3226_i < _10736_ ; ++_3226_i)
  {
    _10735_.push_back(((*_3219_names)(_3226_i)));
  }
  auto _10737_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10735_.size()),_10735_.begin(),_10735_.end()));
  ((*indexnames)(_3220_axis)) = _10737_;
  return ::mosek::fusion::PSDDomain::t(_pubthis);
}
// End mosek.fusion.PSDDomain.withNamesOnAxis

// Begin mosek.fusion.PSDDomain.finalize_and_validate_inplace
// Method mosek.fusion.PSDDomain.finalize_and_validate_inplace @ bld/docker-win/final/default/src/fusion/domain.mbi:1474:6-1510:7
void mosek::fusion::p_PSDDomain::finalize_and_validate_inplace(std::shared_ptr< monty::ndarray< int32_t,1 > > _3227_shp)
{
  _checked_ptr_1<int32_t> _ptr__3227_shp(_3227_shp ? _3227_shp->raw() : nullptr, _3227_shp ? _3227_shp->size(0) : 0);
  if ((NULL != _3227_shp.get()))
  {
    {
      if ((NULL == shape.get()))
      {
        {
          shape = _3227_shp;
        }
      }
      else
      {
        {
          if (((int)((_3227_shp)->size(0)) != (int)((shape)->size(0))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
            }
          }
          {}
          int32_t _10738_ = (int)0;
          int32_t _10739_ = (int)((_3227_shp)->size(0));
          for (int32_t _3228_i = _10738_; _3228_i < _10739_; ++_3228_i)
          {
            {
              if ((_ptr__3227_shp[_3228_i] != ((*shape)(_3228_i))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  {}
  if (((int)((shape)->size(0)) < (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Positive semidefinite domain must have at least two dimensions"));
    }
  }
  {}
  if ((!axisIsSet))
  {
    {
      conedim1 = ((int)((shape)->size(0)) - (int)2);
      conedim2 = ((int)((shape)->size(0)) - (int)1);
    }
  }
  {}
  if (((conedim1 < (int)0) || ((conedim1 >= (int)((shape)->size(0))) || ((conedim2 < (int)0) || ((conedim2 >= (int)((shape)->size(0))) || (conedim1 == conedim2))))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid cone dimension specification"));
    }
  }
  {}
  if ((((*shape)(conedim1)) != ((*shape)(conedim2))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Cone dimensions must have same size"));
    }
  }
  {}
  if ((NULL != indexnames.get()))
  {
    {
      if (((int)((indexnames)->size(0)) != (int)((shape)->size(0))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Index names do not match the domain shape"));
        }
      }
      else
      {
        {
          int32_t _10740_ = (int)0;
          int32_t _10741_ = (int)((shape)->size(0));
          for (int32_t _3229_i = _10740_; _3229_i < _10741_; ++_3229_i)
          {
            {
              if (((NULL != ((*indexnames)(_3229_i)).get()) && ((int)((((*indexnames)(_3229_i)))->size(0)) != ((*shape)(_3229_i)))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Index names do not match the domain shape"));
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  {}
}
// End mosek.fusion.PSDDomain.finalize_and_validate_inplace

// Begin mosek.fusion.PSDDomain.finalize_and_validate
// Method mosek.fusion.PSDDomain.finalize_and_validate @ bld/docker-win/final/default/src/fusion/domain.mbi:1469:6-1473:7
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_PSDDomain::__mosek_2fusion_2PSDDomain__finalize_and_validate(std::shared_ptr< monty::ndarray< int32_t,1 > > _3230_shp)
{
  _checked_ptr_1<int32_t> _ptr__3230_shp(_3230_shp ? _3230_shp->raw() : nullptr, _3230_shp ? _3230_shp->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::PSDDomain > _3231_res = ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDDomain::t(_pubthis));
  mosek::fusion::p_PSDDomain::_get_impl(_3231_res.get())->finalize_and_validate_inplace(_3230_shp);
  return _3231_res;
}
// End mosek.fusion.PSDDomain.finalize_and_validate

void mosek::fusion::p_PSDDomain::destroy()
{
  indexnames.reset();
  shape.reset();
}
void mosek::fusion::PSDDomain::destroy() { mosek::fusion::p_PSDDomain::_get_impl(this)->destroy(); }
// } class PSDDomain
// class SymmetricRangeDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:1407:4-1422:5
mosek::fusion::SymmetricRangeDomain::SymmetricRangeDomain(mosek::fusion::p_SymmetricRangeDomain *_impl) : mosek::fusion::RangeDomain(_impl) { /*std::cout << "SymmetricRangeDomain()" << this << std::endl; */ }
mosek::fusion::SymmetricRangeDomain::~SymmetricRangeDomain() {  /* std::cout << "~SymmetricRangeDomain()" << this << std::endl << std::flush; */ }
mosek::fusion::p_SymmetricRangeDomain::p_SymmetricRangeDomain
  (::mosek::fusion::SymmetricRangeDomain * _pubthis) :     mosek::fusion::p_RangeDomain(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.SymmetricRangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1411:6-1420:7
mosek::fusion::SymmetricRangeDomain::t mosek::fusion::p_SymmetricRangeDomain::_new_SymmetricRangeDomain
  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3232_other)
{ return new mosek::fusion::SymmetricRangeDomain(_3232_other); }
mosek::fusion::SymmetricRangeDomain::SymmetricRangeDomain
  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3232_other) : 
   SymmetricRangeDomain(new mosek::fusion::p_SymmetricRangeDomain(this))
{ mosek::fusion::p_SymmetricRangeDomain::_get_impl(this)->_initialize(_3232_other); }
void mosek::fusion::p_SymmetricRangeDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3232_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_RangeDomain::_initialize(_3232_other);
    if (((NULL != shape.get()) && (((int)((shape)->size(0)) != (int)2) || (((*shape)((int)0)) != ((*shape)((int)1))))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Only square domains can be symmetric"));
      }
    }
    {}
    int32_t _10742_;
    bool _10743_ = (NULL == shape.get());
    if (_10743_)
    {
      _10742_ = (int)0;
    }
    else
    {
      _10742_ = ((*shape)((int)0));
    }
    dim = _10742_;
  }
}
// mosek.fusion.SymmetricRangeDomain.ctor

void mosek::fusion::p_SymmetricRangeDomain::destroy()
{
}
void mosek::fusion::SymmetricRangeDomain::destroy() { mosek::fusion::p_SymmetricRangeDomain::_get_impl(this)->destroy(); }
// } class SymmetricRangeDomain
// class RangeDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:1120:4-1399:5
mosek::fusion::RangeDomain::RangeDomain(mosek::fusion::p_RangeDomain *_impl) : _impl(_impl) { /*std::cout << "RangeDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::RangeDomain::~RangeDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_RangeDomain::p_RangeDomain
  (::mosek::fusion::RangeDomain * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.RangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1291:6-1298:7
mosek::fusion::RangeDomain::t mosek::fusion::p_RangeDomain::_new_RangeDomain
  (bool _3233_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3234_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3235_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3236_dims)
{ return new mosek::fusion::RangeDomain(_3233_scalable,_3234_lb,_3235_ub,_3236_dims); }
mosek::fusion::RangeDomain::RangeDomain
  (bool _3233_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3234_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3235_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3236_dims) : 
   RangeDomain(new mosek::fusion::p_RangeDomain(this))
{ mosek::fusion::p_RangeDomain::_get_impl(this)->_initialize(_3233_scalable,_3234_lb,_3235_ub,_3236_dims); }
void mosek::fusion::p_RangeDomain::_initialize  (bool _3233_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3234_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3235_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3236_dims)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3234_lb(_3234_lb ? _3234_lb->raw() : nullptr, _3234_lb ? _3234_lb->size(0) : 0);
    _checked_ptr_1<double> _ptr__3235_ub(_3235_ub ? _3235_ub->raw() : nullptr, _3235_ub ? _3235_ub->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3236_dims(_3236_dims ? _3236_dims->raw() : nullptr, _3236_dims ? _3236_dims->size(0) : 0);
    mosek::fusion::p_RangeDomain::_initialize(_3233_scalable,_3234_lb,_3235_ub,_3236_dims,nullptr,(int)1);
  }
}
// mosek.fusion.RangeDomain.ctor

// mosek.fusion.RangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1271:6-1289:7
mosek::fusion::RangeDomain::t mosek::fusion::p_RangeDomain::_new_RangeDomain
  (bool _3237_scalable,
    double _3238_lb,
    double _3239_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3240_dims)
{ return new mosek::fusion::RangeDomain(_3237_scalable,_3238_lb,_3239_ub,_3240_dims); }
mosek::fusion::RangeDomain::RangeDomain
  (bool _3237_scalable,
    double _3238_lb,
    double _3239_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3240_dims) : 
   RangeDomain(new mosek::fusion::p_RangeDomain(this))
{ mosek::fusion::p_RangeDomain::_get_impl(this)->_initialize(_3237_scalable,_3238_lb,_3239_ub,_3240_dims); }
void mosek::fusion::p_RangeDomain::_initialize  (bool _3237_scalable,
    double _3238_lb,
    double _3239_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3240_dims)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__3240_dims(_3240_dims ? _3240_dims->raw() : nullptr, _3240_dims ? _3240_dims->size(0) : 0);
    cardinal_flag = false;
    shape = _3240_dims;
    sparsity = nullptr;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->scalable = _3237_scalable;
    int32_t _3241_totalsize = (int)1;
    int32_t _10744_ = (int)0;
    int32_t _10745_ = (int)((_3240_dims)->size(0));
    for (int32_t _3242_i = _10744_; _3242_i < _10745_; ++_3242_i)
    {
      {
        _3241_totalsize *= _ptr__3240_dims[_3242_i];
      }
    }
    std::vector<double> _10746_;
    for (int32_t _3243_i = (int)0, _10747_ = _3241_totalsize; _3243_i < _10747_ ; ++_3243_i)
    {
      _10746_.push_back(_3239_ub);
    }
    auto _10748_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10746_.size()),_10746_.begin(),_10746_.end()));
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->ub = _10748_;
    std::vector<double> _10749_;
    for (int32_t _3244_i = (int)0, _10750_ = _3241_totalsize; _3244_i < _10750_ ; ++_3244_i)
    {
      _10749_.push_back(_3238_lb);
    }
    auto _10751_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10749_.size()),_10749_.begin(),_10749_.end()));
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->lb = _10751_;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->empty = false;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->indexnames = nullptr;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->domsize = (int)0;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->nelements = (int)0;
  }
}
// mosek.fusion.RangeDomain.ctor

// mosek.fusion.RangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1261:6-1269:7
mosek::fusion::RangeDomain::t mosek::fusion::p_RangeDomain::_new_RangeDomain
  (bool _3245_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3246_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3247_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3248_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3249_sp)
{ return new mosek::fusion::RangeDomain(_3245_scalable,_3246_lb,_3247_ub,_3248_dims,_3249_sp); }
mosek::fusion::RangeDomain::RangeDomain
  (bool _3245_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3246_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3247_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3248_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3249_sp) : 
   RangeDomain(new mosek::fusion::p_RangeDomain(this))
{ mosek::fusion::p_RangeDomain::_get_impl(this)->_initialize(_3245_scalable,_3246_lb,_3247_ub,_3248_dims,_3249_sp); }
void mosek::fusion::p_RangeDomain::_initialize  (bool _3245_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3246_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3247_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3248_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3249_sp)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3246_lb(_3246_lb ? _3246_lb->raw() : nullptr, _3246_lb ? _3246_lb->size(0) : 0);
    _checked_ptr_1<double> _ptr__3247_ub(_3247_ub ? _3247_ub->raw() : nullptr, _3247_ub ? _3247_ub->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3248_dims(_3248_dims ? _3248_dims->raw() : nullptr, _3248_dims ? _3248_dims->size(0) : 0);
    mosek::fusion::p_RangeDomain::_initialize(_3245_scalable,_3246_lb,_3247_ub,_3248_dims,_3249_sp,(int)1);
  }
}
// mosek.fusion.RangeDomain.ctor

// mosek.fusion.RangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1240:6-1259:7
mosek::fusion::RangeDomain::t mosek::fusion::p_RangeDomain::_new_RangeDomain
  (bool _3250_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3251_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3252_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3253_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3254_sp,
    int32_t _3255_steal)
{ return new mosek::fusion::RangeDomain(_3250_scalable,_3251_lb,_3252_ub,_3253_dims,_3254_sp,_3255_steal); }
mosek::fusion::RangeDomain::RangeDomain
  (bool _3250_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3251_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3252_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3253_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3254_sp,
    int32_t _3255_steal) : 
   RangeDomain(new mosek::fusion::p_RangeDomain(this))
{ mosek::fusion::p_RangeDomain::_get_impl(this)->_initialize(_3250_scalable,_3251_lb,_3252_ub,_3253_dims,_3254_sp,_3255_steal); }
void mosek::fusion::p_RangeDomain::_initialize  (bool _3250_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3251_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3252_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3253_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3254_sp,
    int32_t _3255_steal)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3251_lb(_3251_lb ? _3251_lb->raw() : nullptr, _3251_lb ? _3251_lb->size(0) : 0);
    _checked_ptr_1<double> _ptr__3252_ub(_3252_ub ? _3252_ub->raw() : nullptr, _3252_ub ? _3252_ub->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3253_dims(_3253_dims ? _3253_dims->raw() : nullptr, _3253_dims ? _3253_dims->size(0) : 0);
    cardinal_flag = false;
    shape = _3253_dims;
    sparsity = nullptr;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->scalable = _3250_scalable;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->ub = _3252_ub;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->lb = _3251_lb;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity = _3254_sp;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->empty = false;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->indexnames = nullptr;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->domsize = (int)0;
    mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->nelements = (int)0;
  }
}
// mosek.fusion.RangeDomain.ctor

// mosek.fusion.RangeDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1225:6-1238:7
mosek::fusion::RangeDomain::t mosek::fusion::p_RangeDomain::_new_RangeDomain
  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3256_other)
{ return new mosek::fusion::RangeDomain(_3256_other); }
mosek::fusion::RangeDomain::RangeDomain
  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3256_other) : 
   RangeDomain(new mosek::fusion::p_RangeDomain(this))
{ mosek::fusion::p_RangeDomain::_get_impl(this)->_initialize(_3256_other); }
void mosek::fusion::p_RangeDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::RangeDomain > _3256_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    cardinal_flag = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->cardinal_flag;
    sparsity = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->sparsity;
    scalable = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->scalable;
    shape = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->shape;
    ub = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->ub;
    lb = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->lb;
    domsize = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->domsize;
    nelements = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->nelements;
    empty = mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->empty;
    std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _10752_;
    bool _10753_ = (NULL != mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->indexnames.get());
    if (_10753_)
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10754_;
      for (int32_t _3257_i = (int)0, _10755_ = (int)((mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->indexnames)->size(0)); _3257_i < _10755_ ; ++_3257_i)
      {
        _10754_.push_back(((*mosek::fusion::p_RangeDomain::_get_impl(_3256_other)->indexnames)(_3257_i)));
      }
      auto _10756_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10754_.size()),_10754_.begin(),_10754_.end()));
      _10752_ = _10756_;
    }
    else
    {
      _10752_ = nullptr;
    }
    indexnames = _10752_;
  }
}
// mosek.fusion.RangeDomain.ctor

// Begin mosek.fusion.RangeDomain.symmetric
// Method mosek.fusion.RangeDomain.symmetric @ bld/docker-win/final/default/src/fusion/domain.mbi:1398:6-96
monty::rc_ptr< ::mosek::fusion::SymmetricRangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__symmetric() { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__symmetric(); }
monty::rc_ptr< ::mosek::fusion::SymmetricRangeDomain > mosek::fusion::RangeDomain::symmetric() { return __mosek_2fusion_2RangeDomain__symmetric(); }
monty::rc_ptr< ::mosek::fusion::SymmetricRangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__symmetric()
{
  return ::mosek::fusion::p_SymmetricRangeDomain::_new_SymmetricRangeDomain(::mosek::fusion::RangeDomain::t(_pubthis));
}
// End mosek.fusion.RangeDomain.symmetric

// Begin mosek.fusion.RangeDomain.sparse
// Method mosek.fusion.RangeDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1387:6-1394:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3258_sparsity) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__sparse(_3258_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3258_sparsity) { return __mosek_2fusion_2RangeDomain__sparse(_3258_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3258_sparsity)
{
  mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3258_sparsity)->size(0)),(int)((_3258_sparsity)->size(1)))));
  {
    int32_t _3259_i = (int)0;
    for(;(_3259_i < (int)((_3258_sparsity)->size(0)));++ _3259_i)
    {
      {
        {
          int32_t _3260_j = (int)0;
          for(;(_3260_j < (int)((_3258_sparsity)->size(1)));++ _3260_j)
          {
            {
              ((*mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity)(_3259_i,_3260_j)) = ((*_3258_sparsity)(_3259_i,_3260_j));
            }
          }
        }
      }
    }
  }
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.sparse

// Begin mosek.fusion.RangeDomain.sparse
// Method mosek.fusion.RangeDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1373:6-1379:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3261_sparsity) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__sparse(_3261_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3261_sparsity) { return __mosek_2fusion_2RangeDomain__sparse(_3261_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3261_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__3261_sparsity(_3261_sparsity ? _3261_sparsity->raw() : nullptr, _3261_sparsity ? _3261_sparsity->size(0) : 0);
  mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3261_sparsity)->size(0)),(int)1)));
  int32_t _10757_ = (int)0;
  int32_t _10758_ = (int)((_3261_sparsity)->size(0));
  for (int32_t _3262_i = _10757_; _3262_i < _10758_; ++_3262_i)
  {
    {
      ((*mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity)(_3262_i,(int)0)) = _ptr__3261_sparsity[_3262_i];
    }
  }
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.sparse

// Begin mosek.fusion.RangeDomain.sparse
// Method mosek.fusion.RangeDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1361:6-1366:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__sparse() { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__sparse(); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::sparse() { return __mosek_2fusion_2RangeDomain__sparse(); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__sparse()
{
  mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->empty = true;
  mosek::fusion::p_RangeDomain::_get_impl(::mosek::fusion::RangeDomain::t(_pubthis))->sparsity = nullptr;
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.sparse

// Begin mosek.fusion.RangeDomain.integral
// Method mosek.fusion.RangeDomain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:1353:6-83
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__integral() { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::integral() { return __mosek_2fusion_2RangeDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__integral()
{
  cardinal_flag = true;
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.integral

// Begin mosek.fusion.RangeDomain.withShape
// Method mosek.fusion.RangeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1340:6-124
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__withShape(int32_t _3263_dim0,int32_t _3264_dim1,int32_t _3265_dim2) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__withShape(_3263_dim0,_3264_dim1,_3265_dim2); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::withShape(int32_t _3263_dim0,int32_t _3264_dim1,int32_t _3265_dim2) { return __mosek_2fusion_2RangeDomain__withShape(_3263_dim0,_3264_dim1,_3265_dim2); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__withShape(int32_t _3263_dim0,int32_t _3264_dim1,int32_t _3265_dim2)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3263_dim0),(int32_t)(_3264_dim1),(int32_t)(_3265_dim2)});
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.withShape

// Begin mosek.fusion.RangeDomain.withShape
// Method mosek.fusion.RangeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1339:6-108
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__withShape(int32_t _3266_dim0,int32_t _3267_dim1) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__withShape(_3266_dim0,_3267_dim1); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::withShape(int32_t _3266_dim0,int32_t _3267_dim1) { return __mosek_2fusion_2RangeDomain__withShape(_3266_dim0,_3267_dim1); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__withShape(int32_t _3266_dim0,int32_t _3267_dim1)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3266_dim0),(int32_t)(_3267_dim1)});
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.withShape

// Begin mosek.fusion.RangeDomain.withShape
// Method mosek.fusion.RangeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1338:6-92
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__withShape(int32_t _3268_dim0) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__withShape(_3268_dim0); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::withShape(int32_t _3268_dim0) { return __mosek_2fusion_2RangeDomain__withShape(_3268_dim0); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__withShape(int32_t _3268_dim0)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3268_dim0)});
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.withShape

// Begin mosek.fusion.RangeDomain.withShape
// Method mosek.fusion.RangeDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:1337:6-83
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3269_shp) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__withShape(_3269_shp); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3269_shp) { return __mosek_2fusion_2RangeDomain__withShape(_3269_shp); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3269_shp)
{
  _checked_ptr_1<int32_t> _ptr__3269_shp(_3269_shp ? _3269_shp->raw() : nullptr, _3269_shp ? _3269_shp->size(0) : 0);
  shape = _3269_shp;
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.withShape

// Begin mosek.fusion.RangeDomain.withNamesOnAxis
// Method mosek.fusion.RangeDomain.withNamesOnAxis @ bld/docker-win/final/default/src/fusion/domain.mbi:1313:6-1326:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain :: __mosek_2fusion_2RangeDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3270_names,int32_t _3271_axis) { return mosek::fusion::p_RangeDomain::_get_impl(this)->__mosek_2fusion_2RangeDomain__withNamesOnAxis(_3270_names,_3271_axis); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::RangeDomain::withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3270_names,int32_t _3271_axis) { return __mosek_2fusion_2RangeDomain__withNamesOnAxis(_3270_names,_3271_axis); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3270_names,int32_t _3271_axis)
{
  if ((NULL == indexnames.get()))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10759_;
      for (int32_t _3272_i = (int)0, _10760_ = safe_add( _3271_axis,(int)1 ); _3272_i < _10760_ ; ++_3272_i)
      {
        _10759_.push_back(nullptr);
      }
      auto _10761_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10759_.size()),_10759_.begin(),_10759_.end()));
      indexnames = _10761_;
      std::vector<std::string> _10762_;
      for (int32_t _3273_i = (int)0, _10763_ = (int)((_3270_names)->size(0)); _3273_i < _10763_ ; ++_3273_i)
      {
        _10762_.push_back(((*_3270_names)(_3273_i)));
      }
      auto _10764_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10762_.size()),_10762_.begin(),_10762_.end()));
      ((*indexnames)(_3271_axis)) = _10764_;
    }
  }
  {}
  if (((int)((indexnames)->size(0)) < safe_add( _3271_axis,(int)1 )))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10765_;
      for (int32_t _3275_i = (int)0, _10766_ = safe_add( _3271_axis,(int)1 ); _3275_i < _10766_ ; ++_3275_i)
      {
        _10765_.push_back(nullptr);
      }
      auto _10767_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10765_.size()),_10765_.begin(),_10765_.end()));
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _3274_ixnames = _10767_;
      int32_t _10768_ = (int)0;
      int32_t _10769_ = (int)((indexnames)->size(0));
      for (int32_t _3276_i = _10768_; _3276_i < _10769_; ++_3276_i)
      {
        {
          ((*_3274_ixnames)(_3276_i)) = ((*indexnames)(_3276_i));
        }
      }
      indexnames = _3274_ixnames;
    }
  }
  {}
  std::vector<std::string> _10770_;
  for (int32_t _3277_i = (int)0, _10771_ = (int)((_3270_names)->size(0)); _3277_i < _10771_ ; ++_3277_i)
  {
    _10770_.push_back(((*_3270_names)(_3277_i)));
  }
  auto _10772_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10770_.size()),_10770_.begin(),_10770_.end()));
  ((*indexnames)(_3271_axis)) = _10772_;
  return ::mosek::fusion::RangeDomain::t(_pubthis);
}
// End mosek.fusion.RangeDomain.withNamesOnAxis

// Begin mosek.fusion.RangeDomain.match_shape
// Method mosek.fusion.RangeDomain.match_shape @ bld/docker-win/final/default/src/fusion/domain.mbi:1300:6-1311:7
bool mosek::fusion::p_RangeDomain::match_shape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3278_shp)
{
  _checked_ptr_1<int32_t> _ptr__3278_shp(_3278_shp ? _3278_shp->raw() : nullptr, _3278_shp ? _3278_shp->size(0) : 0);
  if (scalable)
  {
    {
      return true;
    }
  }
  else if(((int)((shape)->size(0)) != (int)((_3278_shp)->size(0))))
  {
    {
      return false;
    }
  }
  else
  {
    {
      int32_t _10773_ = (int)0;
      int32_t _10774_ = (int)((shape)->size(0));
      for (int32_t _3279_i = _10773_; _3279_i < _10774_; ++_3279_i)
      {
        {
          if ((((*shape)(_3279_i)) != _ptr__3278_shp[_3279_i]))
          {
            {
              return false;
            }
          }
          {}
        }
      }
    }
  }
  return true;
}
// End mosek.fusion.RangeDomain.match_shape

// Begin mosek.fusion.RangeDomain.finalize_and_validate_inplace
// Method mosek.fusion.RangeDomain.finalize_and_validate_inplace @ bld/docker-win/final/default/src/fusion/domain.mbi:1157:6-1223:7
void mosek::fusion::p_RangeDomain::finalize_and_validate_inplace(std::shared_ptr< monty::ndarray< int32_t,1 > > _3280_shp)
{
  _checked_ptr_1<int32_t> _ptr__3280_shp(_3280_shp ? _3280_shp->raw() : nullptr, _3280_shp ? _3280_shp->size(0) : 0);
  domsize = (int)1;
  if (scalable)
  {
    {
      if ((NULL != _3280_shp.get()))
      {
        {
          shape = _3280_shp;
        }
      }
      else
      {
        {
          shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
        }
      }
      int32_t _10775_ = (int)0;
      int32_t _10776_ = (int)((shape)->size(0));
      for (int32_t _3281_i = _10775_; _3281_i < _10776_; ++_3281_i)
      {
        {
          domsize *= ((*shape)(_3281_i));
        }
      }
    }
  }
  else
  {
    {
      if ((NULL != _3280_shp.get()))
      {
        {
          if (((int)((_3280_shp)->size(0)) != (int)((shape)->size(0))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
            }
          }
          {}
          int32_t _10777_ = (int)0;
          int32_t _10778_ = (int)((_3280_shp)->size(0));
          for (int32_t _3282_i = _10777_; _3282_i < _10778_; ++_3282_i)
          {
            {
              if ((_ptr__3280_shp[_3282_i] != ((*shape)(_3282_i))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
                }
              }
              {}
            }
          }
        }
      }
      {}
      int32_t _10779_ = (int)0;
      int32_t _10780_ = (int)((shape)->size(0));
      for (int32_t _3283_i = _10779_; _3283_i < _10780_; ++_3283_i)
      {
        {
          domsize *= ((*shape)(_3283_i));
        }
      }
    }
  }
  if ((NULL != indexnames.get()))
  {
    {
      if (((int)((indexnames)->size(0)) != (int)((shape)->size(0))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
        }
      }
      {}
      int32_t _10781_ = (int)0;
      int32_t _10782_ = (int)((shape)->size(0));
      for (int32_t _3284_i = _10781_; _3284_i < _10782_; ++_3284_i)
      {
        {
          if (((NULL != ((*indexnames)(_3284_i)).get()) && ((int)((((*indexnames)(_3284_i)))->size(0)) != ((*shape)(_3284_i)))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
            }
          }
          {}
        }
      }
    }
  }
  {}
  if ((NULL != sparsity.get()))
  {
    {
      nelements = (int)((sparsity)->size(0));
      if (((int)((shape)->size(0)) != (int)((sparsity)->size(1))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape and sparsity pattern"));
        }
      }
      {}
      int32_t _10783_ = (int)0;
      int64_t _10784_ = nelements;
      for (int64_t _3285_i = _10783_; _3285_i < _10784_; ++_3285_i)
      {
        {
          int32_t _10785_ = (int)0;
          int32_t _10786_ = (int)((sparsity)->size(1));
          for (int32_t _3286_j = _10785_; _3286_j < _10786_; ++_3286_j)
          {
            {
              if (((((*sparsity)(_3285_i,_3286_j)) < (int)0) || (((*sparsity)(_3285_i,_3286_j)) >= ((*shape)(_3286_j)))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Sparsity pattern entry is out of bounds"));
                }
              }
              {}
            }
          }
        }
      }
      if (((!scalable) && ((NULL != lb.get()) && ((int)((lb)->size(0)) != nelements))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Sparsity pattern does not match bound"));
        }
      }
      {}
      if (((!scalable) && ((NULL != ub.get()) && ((int)((ub)->size(0)) != nelements))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Sparsity pattern does not match bound"));
        }
      }
      {}
    }
  }
  else
  {
    {
      nelements = domsize;
      if (((NULL != lb.get()) && (!scalable)))
      {
        {
          if (((int)((lb)->size(0)) != nelements))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Domain bound does not match shape"));
            }
          }
          {}
        }
      }
      {}
      if (((NULL != ub.get()) && (!scalable)))
      {
        {
          if (((int)((ub)->size(0)) != nelements))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Domain bound does not match shape"));
            }
          }
          {}
        }
      }
      {}
    }
  }
}
// End mosek.fusion.RangeDomain.finalize_and_validate_inplace

// Begin mosek.fusion.RangeDomain.finalize_and_validate
// Method mosek.fusion.RangeDomain.finalize_and_validate @ bld/docker-win/final/default/src/fusion/domain.mbi:1151:6-1155:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_RangeDomain::__mosek_2fusion_2RangeDomain__finalize_and_validate(std::shared_ptr< monty::ndarray< int32_t,1 > > _3287_shp)
{
  _checked_ptr_1<int32_t> _ptr__3287_shp(_3287_shp ? _3287_shp->raw() : nullptr, _3287_shp ? _3287_shp->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::RangeDomain > _3288_res = ::mosek::fusion::p_RangeDomain::_new_RangeDomain(::mosek::fusion::RangeDomain::t(_pubthis));
  mosek::fusion::p_RangeDomain::_get_impl(_3288_res.get())->finalize_and_validate_inplace(_3287_shp);
  return _3288_res;
}
// End mosek.fusion.RangeDomain.finalize_and_validate

void mosek::fusion::p_RangeDomain::destroy()
{
  indexnames.reset();
  ub.reset();
  lb.reset();
  sparsity.reset();
  shape.reset();
}
void mosek::fusion::RangeDomain::destroy() { mosek::fusion::p_RangeDomain::_get_impl(this)->destroy(); }
// } class RangeDomain
// class SymmetricLinearDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:1023:4-1093:5
mosek::fusion::SymmetricLinearDomain::SymmetricLinearDomain(mosek::fusion::p_SymmetricLinearDomain *_impl) : _impl(_impl) { /*std::cout << "SymmetricLinearDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::SymmetricLinearDomain::~SymmetricLinearDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_SymmetricLinearDomain::p_SymmetricLinearDomain
  (::mosek::fusion::SymmetricLinearDomain * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.SymmetricLinearDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:1034:6-1048:7
mosek::fusion::SymmetricLinearDomain::t mosek::fusion::p_SymmetricLinearDomain::_new_SymmetricLinearDomain
  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3289_other)
{ return new mosek::fusion::SymmetricLinearDomain(_3289_other); }
mosek::fusion::SymmetricLinearDomain::SymmetricLinearDomain
  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3289_other) : 
   SymmetricLinearDomain(new mosek::fusion::p_SymmetricLinearDomain(this))
{ mosek::fusion::p_SymmetricLinearDomain::_get_impl(this)->_initialize(_3289_other); }
void mosek::fusion::p_SymmetricLinearDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3289_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    dom = _3289_other;
    shape = mosek::fusion::p_LinearDomain::_get_impl(_3289_other)->shape;
    key = mosek::fusion::p_LinearDomain::_get_impl(_3289_other)->key;
    cardinal_flag = mosek::fusion::p_LinearDomain::_get_impl(_3289_other)->cardinal_flag;
    sparsity = mosek::fusion::p_LinearDomain::_get_impl(_3289_other)->sparsity;
    if (((NULL != shape.get()) && (((int)((shape)->size(0)) != (int)2) || (((*shape)((int)0)) != ((*shape)((int)1))))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Only square domains can be symmetric"));
      }
    }
    {}
    int32_t _10787_;
    bool _10788_ = (NULL == shape.get());
    if (_10788_)
    {
      _10787_ = (int)0;
    }
    else
    {
      _10787_ = ((*shape)((int)0));
    }
    dim = _10787_;
  }
}
// mosek.fusion.SymmetricLinearDomain.ctor

// Begin mosek.fusion.SymmetricLinearDomain.sparse
// Method mosek.fusion.SymmetricLinearDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1085:6-1092:7
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain :: __mosek_2fusion_2SymmetricLinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3290_sparsity) { return mosek::fusion::p_SymmetricLinearDomain::_get_impl(this)->__mosek_2fusion_2SymmetricLinearDomain__sparse(_3290_sparsity); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3290_sparsity) { return __mosek_2fusion_2SymmetricLinearDomain__sparse(_3290_sparsity); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::p_SymmetricLinearDomain::__mosek_2fusion_2SymmetricLinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3290_sparsity)
{
  mosek::fusion::p_SymmetricLinearDomain::_get_impl(::mosek::fusion::SymmetricLinearDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3290_sparsity)->size(0)),(int)((_3290_sparsity)->size(1)))));
  {
    int32_t _3291_i = (int)0;
    for(;(_3291_i < (int)((_3290_sparsity)->size(0)));++ _3291_i)
    {
      {
        {
          int32_t _3292_j = (int)0;
          for(;(_3292_j < (int)((_3290_sparsity)->size(1)));++ _3292_j)
          {
            {
              ((*mosek::fusion::p_SymmetricLinearDomain::_get_impl(::mosek::fusion::SymmetricLinearDomain::t(_pubthis))->sparsity)(_3291_i,_3292_j)) = ((*_3290_sparsity)(_3291_i,_3292_j));
            }
          }
        }
      }
    }
  }
  return ::mosek::fusion::SymmetricLinearDomain::t(_pubthis);
}
// End mosek.fusion.SymmetricLinearDomain.sparse

// Begin mosek.fusion.SymmetricLinearDomain.sparse
// Method mosek.fusion.SymmetricLinearDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1071:6-1077:7
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain :: __mosek_2fusion_2SymmetricLinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3293_sparsity) { return mosek::fusion::p_SymmetricLinearDomain::_get_impl(this)->__mosek_2fusion_2SymmetricLinearDomain__sparse(_3293_sparsity); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3293_sparsity) { return __mosek_2fusion_2SymmetricLinearDomain__sparse(_3293_sparsity); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::p_SymmetricLinearDomain::__mosek_2fusion_2SymmetricLinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3293_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__3293_sparsity(_3293_sparsity ? _3293_sparsity->raw() : nullptr, _3293_sparsity ? _3293_sparsity->size(0) : 0);
  mosek::fusion::p_SymmetricLinearDomain::_get_impl(::mosek::fusion::SymmetricLinearDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3293_sparsity)->size(0)),(int)1)));
  int32_t _10789_ = (int)0;
  int32_t _10790_ = (int)((_3293_sparsity)->size(0));
  for (int32_t _3294_i = _10789_; _3294_i < _10790_; ++_3294_i)
  {
    {
      ((*mosek::fusion::p_SymmetricLinearDomain::_get_impl(::mosek::fusion::SymmetricLinearDomain::t(_pubthis))->sparsity)(_3294_i,(int)0)) = _ptr__3293_sparsity[_3294_i];
    }
  }
  return ::mosek::fusion::SymmetricLinearDomain::t(_pubthis);
}
// End mosek.fusion.SymmetricLinearDomain.sparse

// Begin mosek.fusion.SymmetricLinearDomain.integral
// Method mosek.fusion.SymmetricLinearDomain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:1063:6-92
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain :: __mosek_2fusion_2SymmetricLinearDomain__integral() { return mosek::fusion::p_SymmetricLinearDomain::_get_impl(this)->__mosek_2fusion_2SymmetricLinearDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::SymmetricLinearDomain::integral() { return __mosek_2fusion_2SymmetricLinearDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::p_SymmetricLinearDomain::__mosek_2fusion_2SymmetricLinearDomain__integral()
{
  cardinal_flag = true;
  return ::mosek::fusion::SymmetricLinearDomain::t(_pubthis);
}
// End mosek.fusion.SymmetricLinearDomain.integral

// Begin mosek.fusion.SymmetricLinearDomain.match_shape
// Method mosek.fusion.SymmetricLinearDomain.match_shape @ bld/docker-win/final/default/src/fusion/domain.mbi:1050:6-1055:7
bool mosek::fusion::p_SymmetricLinearDomain::match_shape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3295_shp)
{
  _checked_ptr_1<int32_t> _ptr__3295_shp(_3295_shp ? _3295_shp->raw() : nullptr, _3295_shp ? _3295_shp->size(0) : 0);
  int32_t _10791_ = (int)0;
  int32_t _10792_ = (int)((_3295_shp)->size(0));
  for (int32_t _3296_i = _10791_; _3296_i < _10792_; ++_3296_i)
  {
    {
      if ((_ptr__3295_shp[_3296_i] == ((*shape)(_3296_i))))
      {
        {
          return false;
        }
      }
      {}
    }
  }
  return true;
}
// End mosek.fusion.SymmetricLinearDomain.match_shape

void mosek::fusion::p_SymmetricLinearDomain::destroy()
{
  sparsity.reset();
  shape.reset();
  dom.reset();
}
void mosek::fusion::SymmetricLinearDomain::destroy() { mosek::fusion::p_SymmetricLinearDomain::_get_impl(this)->destroy(); }
// } class SymmetricLinearDomain
// class LinearDomain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:765:4-1016:5
mosek::fusion::LinearDomain::LinearDomain(mosek::fusion::p_LinearDomain *_impl) : _impl(_impl) { /*std::cout << "LinearDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::LinearDomain::~LinearDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_LinearDomain::p_LinearDomain
  (::mosek::fusion::LinearDomain * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.LinearDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:909:6-915:6
mosek::fusion::LinearDomain::t mosek::fusion::p_LinearDomain::_new_LinearDomain
  (mosek::fusion::RelationKey _3297_k,
    bool _3298_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3299_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3300_dims)
{ return new mosek::fusion::LinearDomain(_3297_k,_3298_scalable,_3299_rhs,_3300_dims); }
mosek::fusion::LinearDomain::LinearDomain
  (mosek::fusion::RelationKey _3297_k,
    bool _3298_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3299_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3300_dims) : 
   LinearDomain(new mosek::fusion::p_LinearDomain(this))
{ mosek::fusion::p_LinearDomain::_get_impl(this)->_initialize(_3297_k,_3298_scalable,_3299_rhs,_3300_dims); }
void mosek::fusion::p_LinearDomain::_initialize  (mosek::fusion::RelationKey _3297_k,
    bool _3298_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3299_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3300_dims)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3299_rhs(_3299_rhs ? _3299_rhs->raw() : nullptr, _3299_rhs ? _3299_rhs->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3300_dims(_3300_dims ? _3300_dims->raw() : nullptr, _3300_dims ? _3300_dims->size(0) : 0);
    mosek::fusion::p_LinearDomain::_initialize(_3297_k,_3298_scalable,_3299_rhs,_3300_dims,nullptr,(int)1);
  }
}
// mosek.fusion.LinearDomain.ctor

// mosek.fusion.LinearDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:890:6-907:7
mosek::fusion::LinearDomain::t mosek::fusion::p_LinearDomain::_new_LinearDomain
  (mosek::fusion::RelationKey _3301_k,
    bool _3302_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3303_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3304_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3305_sp,
    int32_t _3306_steal)
{ return new mosek::fusion::LinearDomain(_3301_k,_3302_scalable,_3303_rhs,_3304_dims,_3305_sp,_3306_steal); }
mosek::fusion::LinearDomain::LinearDomain
  (mosek::fusion::RelationKey _3301_k,
    bool _3302_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3303_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3304_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3305_sp,
    int32_t _3306_steal) : 
   LinearDomain(new mosek::fusion::p_LinearDomain(this))
{ mosek::fusion::p_LinearDomain::_get_impl(this)->_initialize(_3301_k,_3302_scalable,_3303_rhs,_3304_dims,_3305_sp,_3306_steal); }
void mosek::fusion::p_LinearDomain::_initialize  (mosek::fusion::RelationKey _3301_k,
    bool _3302_scalable,
    std::shared_ptr< monty::ndarray< double,1 > > _3303_rhs,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3304_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3305_sp,
    int32_t _3306_steal)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__3303_rhs(_3303_rhs ? _3303_rhs->raw() : nullptr, _3303_rhs ? _3303_rhs->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__3304_dims(_3304_dims ? _3304_dims->raw() : nullptr, _3304_dims ? _3304_dims->size(0) : 0);
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->scalable = _3302_scalable;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->shape = _3304_dims;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->key = _3301_k;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->bnd = _3303_rhs;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity = _3305_sp;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->cardinal_flag = false;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->empty = false;
    indexnames = nullptr;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->domsize = (int)0;
    mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->nelements = (int)0;
  }
}
// mosek.fusion.LinearDomain.ctor

// mosek.fusion.LinearDomain.ctor @ bld/docker-win/final/default/src/fusion/domain.mbi:875:6-888:7
mosek::fusion::LinearDomain::t mosek::fusion::p_LinearDomain::_new_LinearDomain
  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3307_other)
{ return new mosek::fusion::LinearDomain(_3307_other); }
mosek::fusion::LinearDomain::LinearDomain
  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3307_other) : 
   LinearDomain(new mosek::fusion::p_LinearDomain(this))
{ mosek::fusion::p_LinearDomain::_get_impl(this)->_initialize(_3307_other); }
void mosek::fusion::p_LinearDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::LinearDomain > _3307_other)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    scalable = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->scalable;
    nelements = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->nelements;
    domsize = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->domsize;
    shape = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->shape;
    key = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->key;
    bnd = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->bnd;
    sparsity = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->sparsity;
    cardinal_flag = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->cardinal_flag;
    empty = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->empty;
    indexnames = mosek::fusion::p_LinearDomain::_get_impl(_3307_other)->indexnames;
  }
}
// mosek.fusion.LinearDomain.ctor

// Begin mosek.fusion.LinearDomain.symmetric
// Method mosek.fusion.LinearDomain.symmetric @ bld/docker-win/final/default/src/fusion/domain.mbi:1015:6-98
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__symmetric() { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__symmetric(); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::LinearDomain::symmetric() { return __mosek_2fusion_2LinearDomain__symmetric(); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__symmetric()
{
  return ::mosek::fusion::p_SymmetricLinearDomain::_new_SymmetricLinearDomain(::mosek::fusion::LinearDomain::t(_pubthis));
}
// End mosek.fusion.LinearDomain.symmetric

// Begin mosek.fusion.LinearDomain.sparse
// Method mosek.fusion.LinearDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:1003:6-1011:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3308_sparsity) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__sparse(_3308_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3308_sparsity) { return __mosek_2fusion_2LinearDomain__sparse(_3308_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,2 > > _3308_sparsity)
{
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3308_sparsity)->size(0)),(int)((_3308_sparsity)->size(1)))));
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->empty = false;
  {
    int32_t _3309_i = (int)0;
    for(;(_3309_i < (int)((_3308_sparsity)->size(0)));++ _3309_i)
    {
      {
        {
          int32_t _3310_j = (int)0;
          for(;(_3310_j < (int)((_3308_sparsity)->size(1)));++ _3310_j)
          {
            {
              ((*mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity)(_3309_i,_3310_j)) = ((*_3308_sparsity)(_3309_i,_3310_j));
            }
          }
        }
      }
    }
  }
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.sparse

// Begin mosek.fusion.LinearDomain.sparse
// Method mosek.fusion.LinearDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:988:6-995:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3311_sparsity) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__sparse(_3311_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3311_sparsity) { return __mosek_2fusion_2LinearDomain__sparse(_3311_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _3311_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__3311_sparsity(_3311_sparsity ? _3311_sparsity->raw() : nullptr, _3311_sparsity ? _3311_sparsity->size(0) : 0);
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3311_sparsity)->size(0)),(int)1)));
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->empty = false;
  int32_t _10793_ = (int)0;
  int32_t _10794_ = (int)((_3311_sparsity)->size(0));
  for (int32_t _3312_i = _10793_; _3312_i < _10794_; ++_3312_i)
  {
    {
      ((*mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity)(_3312_i,(int)0)) = _ptr__3311_sparsity[_3312_i];
    }
  }
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.sparse

// Begin mosek.fusion.LinearDomain.sparse
// Method mosek.fusion.LinearDomain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:976:6-981:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__sparse() { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__sparse(); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::sparse() { return __mosek_2fusion_2LinearDomain__sparse(); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__sparse()
{
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->empty = true;
  mosek::fusion::p_LinearDomain::_get_impl(::mosek::fusion::LinearDomain::t(_pubthis))->sparsity = nullptr;
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.sparse

// Begin mosek.fusion.LinearDomain.integral
// Method mosek.fusion.LinearDomain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:966:6-83
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__integral() { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::integral() { return __mosek_2fusion_2LinearDomain__integral(); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__integral()
{
  cardinal_flag = true;
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.integral

// Begin mosek.fusion.LinearDomain.withShape
// Method mosek.fusion.LinearDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:958:6-125
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__withShape(int32_t _3313_dim0,int32_t _3314_dim1,int32_t _3315_dim2) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__withShape(_3313_dim0,_3314_dim1,_3315_dim2); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::withShape(int32_t _3313_dim0,int32_t _3314_dim1,int32_t _3315_dim2) { return __mosek_2fusion_2LinearDomain__withShape(_3313_dim0,_3314_dim1,_3315_dim2); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__withShape(int32_t _3313_dim0,int32_t _3314_dim1,int32_t _3315_dim2)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3313_dim0),(int32_t)(_3314_dim1),(int32_t)(_3315_dim2)});
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.withShape

// Begin mosek.fusion.LinearDomain.withShape
// Method mosek.fusion.LinearDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:957:6-109
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__withShape(int32_t _3316_dim0,int32_t _3317_dim1) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__withShape(_3316_dim0,_3317_dim1); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::withShape(int32_t _3316_dim0,int32_t _3317_dim1) { return __mosek_2fusion_2LinearDomain__withShape(_3316_dim0,_3317_dim1); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__withShape(int32_t _3316_dim0,int32_t _3317_dim1)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3316_dim0),(int32_t)(_3317_dim1)});
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.withShape

// Begin mosek.fusion.LinearDomain.withShape
// Method mosek.fusion.LinearDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:956:6-93
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__withShape(int32_t _3318_dim0) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__withShape(_3318_dim0); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::withShape(int32_t _3318_dim0) { return __mosek_2fusion_2LinearDomain__withShape(_3318_dim0); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__withShape(int32_t _3318_dim0)
{
  shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3318_dim0)});
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.withShape

// Begin mosek.fusion.LinearDomain.withShape
// Method mosek.fusion.LinearDomain.withShape @ bld/docker-win/final/default/src/fusion/domain.mbi:955:6-85
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3319_shp) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__withShape(_3319_shp); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3319_shp) { return __mosek_2fusion_2LinearDomain__withShape(_3319_shp); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__withShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3319_shp)
{
  _checked_ptr_1<int32_t> _ptr__3319_shp(_3319_shp ? _3319_shp->raw() : nullptr, _3319_shp ? _3319_shp->size(0) : 0);
  shape = _3319_shp;
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.withShape

// Begin mosek.fusion.LinearDomain.withNamesOnAxis
// Method mosek.fusion.LinearDomain.withNamesOnAxis @ bld/docker-win/final/default/src/fusion/domain.mbi:929:6-942:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain :: __mosek_2fusion_2LinearDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3320_names,int32_t _3321_axis) { return mosek::fusion::p_LinearDomain::_get_impl(this)->__mosek_2fusion_2LinearDomain__withNamesOnAxis(_3320_names,_3321_axis); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::LinearDomain::withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3320_names,int32_t _3321_axis) { return __mosek_2fusion_2LinearDomain__withNamesOnAxis(_3320_names,_3321_axis); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__withNamesOnAxis(std::shared_ptr< monty::ndarray< std::string,1 > > _3320_names,int32_t _3321_axis)
{
  if ((NULL == indexnames.get()))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10795_;
      for (int32_t _3322_i = (int)0, _10796_ = safe_add( _3321_axis,(int)1 ); _3322_i < _10796_ ; ++_3322_i)
      {
        _10795_.push_back(nullptr);
      }
      auto _10797_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10795_.size()),_10795_.begin(),_10795_.end()));
      indexnames = _10797_;
      std::vector<std::string> _10798_;
      for (int32_t _3323_i = (int)0, _10799_ = (int)((_3320_names)->size(0)); _3323_i < _10799_ ; ++_3323_i)
      {
        _10798_.push_back(((*_3320_names)(_3323_i)));
      }
      auto _10800_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10798_.size()),_10798_.begin(),_10798_.end()));
      ((*indexnames)(_3321_axis)) = _10800_;
    }
  }
  {}
  if (((int)((indexnames)->size(0)) < safe_add( _3321_axis,(int)1 )))
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< std::string,1 > >> _10801_;
      for (int32_t _3325_i = (int)0, _10802_ = safe_add( _3321_axis,(int)1 ); _3325_i < _10802_ ; ++_3325_i)
      {
        _10801_.push_back(nullptr);
      }
      auto _10803_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape(_10801_.size()),_10801_.begin(),_10801_.end()));
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _3324_ixnames = _10803_;
      int32_t _10804_ = (int)0;
      int32_t _10805_ = (int)((indexnames)->size(0));
      for (int32_t _3326_i = _10804_; _3326_i < _10805_; ++_3326_i)
      {
        {
          ((*_3324_ixnames)(_3326_i)) = ((*indexnames)(_3326_i));
        }
      }
      indexnames = _3324_ixnames;
    }
  }
  {}
  std::vector<std::string> _10806_;
  for (int32_t _3327_i = (int)0, _10807_ = (int)((_3320_names)->size(0)); _3327_i < _10807_ ; ++_3327_i)
  {
    _10806_.push_back(((*_3320_names)(_3327_i)));
  }
  auto _10808_ = std::shared_ptr< monty::ndarray< std::string,1 > >(new monty::ndarray< std::string,1 >(monty::shape(_10806_.size()),_10806_.begin(),_10806_.end()));
  ((*indexnames)(_3321_axis)) = _10808_;
  return ::mosek::fusion::LinearDomain::t(_pubthis);
}
// End mosek.fusion.LinearDomain.withNamesOnAxis

// Begin mosek.fusion.LinearDomain.match_shape
// Method mosek.fusion.LinearDomain.match_shape @ bld/docker-win/final/default/src/fusion/domain.mbi:917:6-925:7
bool mosek::fusion::p_LinearDomain::match_shape(std::shared_ptr< monty::ndarray< int32_t,1 > > _3328_shp)
{
  _checked_ptr_1<int32_t> _ptr__3328_shp(_3328_shp ? _3328_shp->raw() : nullptr, _3328_shp ? _3328_shp->size(0) : 0);
  if ((!scalable))
  {
    {
      int32_t _10809_ = (int)0;
      int32_t _10810_ = (int)((_3328_shp)->size(0));
      for (int32_t _3329_i = _10809_; _3329_i < _10810_; ++_3329_i)
      {
        {
          if ((_ptr__3328_shp[_3329_i] == ((*shape)(_3329_i))))
          {
            {
              return false;
            }
          }
          {}
        }
      }
    }
  }
  {}
  return true;
}
// End mosek.fusion.LinearDomain.match_shape

// Begin mosek.fusion.LinearDomain.finalize_and_validate_inplace
// Method mosek.fusion.LinearDomain.finalize_and_validate_inplace @ bld/docker-win/final/default/src/fusion/domain.mbi:804:6-872:7
void mosek::fusion::p_LinearDomain::finalize_and_validate_inplace(std::shared_ptr< monty::ndarray< int32_t,1 > > _3330_shp)
{
  _checked_ptr_1<int32_t> _ptr__3330_shp(_3330_shp ? _3330_shp->raw() : nullptr, _3330_shp ? _3330_shp->size(0) : 0);
  if (scalable)
  {
    {
      if ((NULL == shape.get()))
      {
        {
          if (((NULL != sparsity.get()) && (NULL == _3330_shp.get())))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Sparse domain requires a fixed shape"));
            }
          }
          {}
          if ((NULL != _3330_shp.get()))
          {
            {
              shape = _3330_shp;
            }
          }
          else
          {
            {
              shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
            }
          }
        }
      }
      {}
    }
  }
  else
  {
    {
      if ((NULL != _3330_shp.get()))
      {
        {
          if (((int)((_3330_shp)->size(0)) != (int)((shape)->size(0))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
            }
          }
          {}
          int32_t _10811_ = (int)0;
          int32_t _10812_ = (int)((_3330_shp)->size(0));
          for (int32_t _3331_i = _10811_; _3331_i < _10812_; ++_3331_i)
          {
            {
              if ((_ptr__3330_shp[_3331_i] != ((*shape)(_3331_i))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Conflicting shape definitions"));
                }
              }
              {}
            }
          }
        }
      }
      {}
    }
  }
  if ((NULL != indexnames.get()))
  {
    {
      if (((int)((indexnames)->size(0)) > (int)((shape)->size(0))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
        }
      }
      {}
      int32_t _10813_ = (int)0;
      int32_t _10814_ = (int)((indexnames)->size(0));
      for (int32_t _3332_i = _10813_; _3332_i < _10814_; ++_3332_i)
      {
        {
          if (((NULL != ((*indexnames)(_3332_i)).get()) && ((int)((((*indexnames)(_3332_i)))->size(0)) != ((*shape)(_3332_i)))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Index names do not match shape"));
            }
          }
          {}
        }
      }
      if (((int)((indexnames)->size(0)) < (int)((shape)->size(0))))
      {
        {
          std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > > _3333_tmpindexnames = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< std::string,1 > >,1 >(monty::shape((int)((shape)->size(0)))));
          int32_t _10815_ = (int)0;
          int32_t _10816_ = (int)((indexnames)->size(0));
          for (int32_t _3334_i = _10815_; _3334_i < _10816_; ++_3334_i)
          {
            {
              ((*_3333_tmpindexnames)(_3334_i)) = ((*indexnames)(_3334_i));
            }
          }
          indexnames = _3333_tmpindexnames;
        }
      }
      {}
    }
  }
  {}
  domsize = (int)1;
  int32_t _10817_ = (int)0;
  int32_t _10818_ = (int)((shape)->size(0));
  for (int32_t _3335_i = _10817_; _3335_i < _10818_; ++_3335_i)
  {
    {
      domsize *= ((*shape)(_3335_i));
    }
  }
  if ((NULL != sparsity.get()))
  {
    {
      nelements = (int)((sparsity)->size(0));
      if (((int)((shape)->size(0)) != (int)((sparsity)->size(1))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape and sparsity pattern"));
        }
      }
      {}
      int32_t _10819_ = (int)0;
      int64_t _10820_ = nelements;
      for (int64_t _3336_i = _10819_; _3336_i < _10820_; ++_3336_i)
      {
        {
          int32_t _10821_ = (int)0;
          int32_t _10822_ = (int)((sparsity)->size(1));
          for (int32_t _3337_j = _10821_; _3337_j < _10822_; ++_3337_j)
          {
            {
              if (((((*sparsity)(_3336_i,_3337_j)) < (int)0) || (((*sparsity)(_3336_i,_3337_j)) >= ((*shape)(_3337_j)))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("Sparsity pattern entry is out of bounds"));
                }
              }
              {}
            }
          }
        }
      }
      if (((!scalable) && ((NULL != bnd.get()) && ((int)((bnd)->size(0)) != nelements))))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Sparsity pattern does not match bound"));
        }
      }
      {}
    }
  }
  else
  {
    {
      nelements = domsize;
      if (((NULL != bnd.get()) && (!scalable)))
      {
        {
          if (((int)((bnd)->size(0)) != nelements))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Domain bound does not match shape"));
            }
          }
          {}
        }
      }
      {}
    }
  }
}
// End mosek.fusion.LinearDomain.finalize_and_validate_inplace

// Begin mosek.fusion.LinearDomain.finalize_and_validate
// Method mosek.fusion.LinearDomain.finalize_and_validate @ bld/docker-win/final/default/src/fusion/domain.mbi:799:6-803:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_LinearDomain::__mosek_2fusion_2LinearDomain__finalize_and_validate(std::shared_ptr< monty::ndarray< int32_t,1 > > _3338_shp)
{
  _checked_ptr_1<int32_t> _ptr__3338_shp(_3338_shp ? _3338_shp->raw() : nullptr, _3338_shp ? _3338_shp->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::LinearDomain > _3339_res = ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::LinearDomain::t(_pubthis));
  mosek::fusion::p_LinearDomain::_get_impl(_3339_res.get())->finalize_and_validate_inplace(_3338_shp);
  return _3339_res;
}
// End mosek.fusion.LinearDomain.finalize_and_validate

void mosek::fusion::p_LinearDomain::destroy()
{
  indexnames.reset();
  sparsity.reset();
  bnd.reset();
  shape.reset();
}
void mosek::fusion::LinearDomain::destroy() { mosek::fusion::p_LinearDomain::_get_impl(this)->destroy(); }
// } class LinearDomain
// class Domain { // @ bld/docker-win/final/default/src/fusion/domain.mbi:402:4-744:5
mosek::fusion::Domain::Domain(mosek::fusion::p_Domain *_impl) : _impl(_impl) { /*std::cout << "Domain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Domain::~Domain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Domain::p_Domain
  (::mosek::fusion::Domain * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Domain.dimsize
// Method mosek.fusion.Domain.dimsize @ bld/docker-win/final/default/src/fusion/domain.mbi:743:6-126
int64_t mosek::fusion::p_Domain::dimsize(std::shared_ptr< monty::ndarray< int32_t,1 > > _3340_dims)
{
  _checked_ptr_1<int32_t> _ptr__3340_dims(_3340_dims ? _3340_dims->raw() : nullptr, _3340_dims ? _3340_dims->size(0) : 0);
  int64_t _3341_sz = (int64_t)1;
  int32_t _10823_ = (int)0;
  int32_t _10824_ = (int)((_3340_dims)->size(0));
  for (int32_t _3342_i = _10823_; _3342_i < _10824_; ++_3342_i)
  {
    {
      _3341_sz *= _ptr__3340_dims[_3342_i];
    }
  }
  return _3341_sz;
}
// End mosek.fusion.Domain.dimsize

// Begin mosek.fusion.Domain.mkRangedDomain
// Method mosek.fusion.Domain.mkRangedDomain @ bld/docker-win/final/default/src/fusion/domain.mbi:624:6-741:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::mkRangedDomain(monty::rc_ptr< ::mosek::fusion::Matrix > _3343_lb,monty::rc_ptr< ::mosek::fusion::Matrix > _3344_ub)
{
  if (((mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimi != mosek::fusion::p_Matrix::_get_impl(_3344_ub)->dimi) || (mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimj != mosek::fusion::p_Matrix::_get_impl(_3344_ub)->dimj)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions in domain"));
    }
  }
  {}
  if ((_3343_lb->isSparse() && _3344_ub->isSparse()))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3345_lsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3343_lb->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3345_lsubi(_3345_lsubi ? _3345_lsubi->raw() : nullptr,_3345_lsubi ? _3345_lsubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3346_lsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3343_lb->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3346_lsubj(_3346_lsubj ? _3346_lsubj->raw() : nullptr,_3346_lsubj ? _3346_lsubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3347_lval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3343_lb->numNonzeros())));
      _checked_ptr_1<double> _ptr__3347_lval(_3347_lval ? _3347_lval->raw() : nullptr,_3347_lval ? _3347_lval->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3348_usubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3344_ub->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3348_usubi(_3348_usubi ? _3348_usubi->raw() : nullptr,_3348_usubi ? _3348_usubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3349_usubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3344_ub->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3349_usubj(_3349_usubj ? _3349_usubj->raw() : nullptr,_3349_usubj ? _3349_usubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3350_uval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3344_ub->numNonzeros())));
      _checked_ptr_1<double> _ptr__3350_uval(_3350_uval ? _3350_uval->raw() : nullptr,_3350_uval ? _3350_uval->size(0) : 0);
      _3343_lb->getDataAsTriplets(_3345_lsubi,_3346_lsubj,_3347_lval);
      _3344_ub->getDataAsTriplets(_3348_usubi,_3349_usubj,_3350_uval);
      int64_t _3351_n = (int)0;
      {
        int32_t _3352_ui = (int)0;
        int32_t _3353_li = (int)0;
        while ( ((_3353_li < (int)((_3345_lsubi)->size(0))) && (_3352_ui < (int)((_3348_usubi)->size(0)))) )
        {
          {
            if (((_ptr__3345_lsubi[_3353_li] < _ptr__3348_usubi[_3352_ui]) || ((_ptr__3345_lsubi[_3353_li] == _ptr__3348_usubi[_3352_ui]) && (_ptr__3346_lsubj[_3353_li] < _ptr__3349_usubj[_3352_ui]))))
            {
              {
                ++ _3351_n;
                ++ _3353_li;
              }
            }
            else
            {
              {
                if (((_ptr__3345_lsubi[_3353_li] > _ptr__3348_usubi[_3352_ui]) || ((_ptr__3345_lsubi[_3353_li] == _ptr__3348_usubi[_3352_ui]) && (_ptr__3346_lsubj[_3353_li] > _ptr__3349_usubj[_3352_ui]))))
                {
                  {
                    ++ _3351_n;
                    ++ _3352_ui;
                  }
                }
                else
                {
                  {
                    ++ _3351_n;
                    ++ _3353_li;
                    ++ _3352_ui;
                  }
                }
              }
            }
          }
        }
        _3351_n += ((int)((_3345_lsubi)->size(0)) - _3353_li);
        _3351_n += ((int)((_3348_usubi)->size(0)) - _3352_ui);
      }
      std::shared_ptr< monty::ndarray< int32_t,2 > > _3354_inst = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape(_3351_n,(int)2)));
      std::shared_ptr< monty::ndarray< double,1 > > _3355_lbv = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3351_n)));
      _checked_ptr_1<double> _ptr__3355_lbv(_3355_lbv ? _3355_lbv->raw() : nullptr,_3355_lbv ? _3355_lbv->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3356_ubv = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3351_n)));
      _checked_ptr_1<double> _ptr__3356_ubv(_3356_ubv ? _3356_ubv->raw() : nullptr,_3356_ubv ? _3356_ubv->size(0) : 0);
      {
        int32_t _3357_k = (int)0;
        int32_t _3358_ui = (int)0;
        int32_t _3359_li = (int)0;
        while ( ((_3359_li < (int)((_3345_lsubi)->size(0))) && (_3358_ui < (int)((_3348_usubi)->size(0)))) )
        {
          {
            if (((_ptr__3345_lsubi[_3359_li] < _ptr__3348_usubi[_3358_ui]) || ((_ptr__3345_lsubi[_3359_li] == _ptr__3348_usubi[_3358_ui]) && (_ptr__3346_lsubj[_3359_li] < _ptr__3349_usubj[_3358_ui]))))
            {
              {
                ((*_3354_inst)(_3357_k,(int)0)) = _ptr__3345_lsubi[_3359_li];
                ((*_3354_inst)(_3357_k,(int)1)) = _ptr__3346_lsubj[_3359_li];
                _ptr__3355_lbv[_3357_k] = _ptr__3347_lval[_3359_li];
                _ptr__3356_ubv[_3357_k] = 0.0;
                ++ _3357_k;
                ++ _3359_li;
              }
            }
            else
            {
              {
                if (((_ptr__3345_lsubi[_3359_li] > _ptr__3348_usubi[_3358_ui]) || ((_ptr__3345_lsubi[_3359_li] == _ptr__3348_usubi[_3358_ui]) && (_ptr__3346_lsubj[_3359_li] > _ptr__3349_usubj[_3358_ui]))))
                {
                  {
                    ((*_3354_inst)(_3357_k,(int)0)) = _ptr__3348_usubi[_3358_ui];
                    ((*_3354_inst)(_3357_k,(int)1)) = _ptr__3349_usubj[_3358_ui];
                    _ptr__3355_lbv[_3357_k] = 0.0;
                    _ptr__3356_ubv[_3357_k] = _ptr__3350_uval[_3358_ui];
                    ++ _3357_k;
                    ++ _3358_ui;
                  }
                }
                else
                {
                  {
                    ((*_3354_inst)(_3357_k,(int)0)) = _ptr__3348_usubi[_3358_ui];
                    ((*_3354_inst)(_3357_k,(int)1)) = _ptr__3349_usubj[_3358_ui];
                    _ptr__3355_lbv[_3357_k] = _ptr__3347_lval[_3358_ui];
                    _ptr__3356_ubv[_3357_k] = _ptr__3350_uval[_3358_ui];
                    ++ _3357_k;
                    ++ _3359_li;
                    ++ _3358_ui;
                  }
                }
              }
            }
          }
        }
        while ( (_3359_li < (int)((_3345_lsubi)->size(0))) )
        {
          {
            ((*_3354_inst)(_3357_k,(int)0)) = _ptr__3345_lsubi[_3359_li];
            ((*_3354_inst)(_3357_k,(int)1)) = _ptr__3346_lsubj[_3359_li];
            _ptr__3355_lbv[_3357_k] = _ptr__3347_lval[_3359_li];
            _ptr__3356_ubv[_3357_k] = 0.0;
            ++ _3357_k;
            ++ _3359_li;
          }
        }
        while ( (_3358_ui < (int)((_3348_usubi)->size(0))) )
        {
          {
            ((*_3354_inst)(_3357_k,(int)0)) = _ptr__3348_usubi[_3358_ui];
            ((*_3354_inst)(_3357_k,(int)1)) = _ptr__3349_usubj[_3358_ui];
            _ptr__3355_lbv[_3357_k] = 0.0;
            _ptr__3356_ubv[_3357_k] = _ptr__3350_uval[_3358_ui];
            ++ _3357_k;
            ++ _3358_ui;
          }
        }
      }
      return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3355_lbv,_3356_ubv,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimi),(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimj)}),_3354_inst,(int)1);
    }
  }
  else
  {
    {
      int32_t _3360_dimj = mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimj;
      int32_t _3361_dimi = mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimi;
      int32_t _3362_n = safe_mul( _3361_dimi,_3360_dimj );
      std::shared_ptr< monty::ndarray< double,1 > > _3363_lval;
      _checked_ptr_1<double> _ptr__3363_lval(_3363_lval ? _3363_lval->raw() : nullptr,_3363_lval ? _3363_lval->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3364_uval;
      _checked_ptr_1<double> _ptr__3364_uval(_3364_uval ? _3364_uval->raw() : nullptr,_3364_uval ? _3364_uval->size(0) : 0);
      if (_3343_lb->isSparse())
      {
        {
          _3363_lval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3362_n)));
          _ptr__3363_lval.update(_3363_lval ? _3363_lval->raw() : nullptr, _3363_lval ? _3363_lval->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3365_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3343_lb->numNonzeros())));
          _checked_ptr_1<int32_t> _ptr__3365_subi(_3365_subi ? _3365_subi->raw() : nullptr,_3365_subi ? _3365_subi->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3366_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3343_lb->numNonzeros())));
          _checked_ptr_1<int32_t> _ptr__3366_subj(_3366_subj ? _3366_subj->raw() : nullptr,_3366_subj ? _3366_subj->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _3367_v = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3343_lb->numNonzeros())));
          _checked_ptr_1<double> _ptr__3367_v(_3367_v ? _3367_v->raw() : nullptr,_3367_v ? _3367_v->size(0) : 0);
          _3343_lb->getDataAsTriplets(_3365_subi,_3366_subj,_3367_v);
          int32_t _10825_ = (int)0;
          int32_t _10826_ = (int)((_3365_subi)->size(0));
          for (int32_t _3368_i = _10825_; _3368_i < _10826_; ++_3368_i)
          {
            {
              _ptr__3363_lval[safe_add( safe_mul( _ptr__3365_subi[_3368_i],_3360_dimj ),_ptr__3366_subj[_3368_i] )] = _ptr__3367_v[_3368_i];
            }
          }
        }
      }
      else
      {
        {
          _3363_lval = _3343_lb->getDataAsArray();
          _ptr__3363_lval.update(_3363_lval ? _3363_lval->raw() : nullptr, _3363_lval ? _3363_lval->size(0) : 0);
        }
      }
      if (_3344_ub->isSparse())
      {
        {
          _3364_uval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3362_n)));
          _ptr__3364_uval.update(_3364_uval ? _3364_uval->raw() : nullptr, _3364_uval ? _3364_uval->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3369_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3344_ub->numNonzeros())));
          _checked_ptr_1<int32_t> _ptr__3369_subi(_3369_subi ? _3369_subi->raw() : nullptr,_3369_subi ? _3369_subi->size(0) : 0);
          std::shared_ptr< monty::ndarray< int32_t,1 > > _3370_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3344_ub->numNonzeros())));
          _checked_ptr_1<int32_t> _ptr__3370_subj(_3370_subj ? _3370_subj->raw() : nullptr,_3370_subj ? _3370_subj->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _3371_v = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3344_ub->numNonzeros())));
          _checked_ptr_1<double> _ptr__3371_v(_3371_v ? _3371_v->raw() : nullptr,_3371_v ? _3371_v->size(0) : 0);
          _3344_ub->getDataAsTriplets(_3369_subi,_3370_subj,_3371_v);
          int32_t _10827_ = (int)0;
          int32_t _10828_ = (int)((_3369_subi)->size(0));
          for (int32_t _3372_i = _10827_; _3372_i < _10828_; ++_3372_i)
          {
            {
              _ptr__3364_uval[safe_add( safe_mul( _ptr__3369_subi[_3372_i],_3360_dimj ),_ptr__3370_subj[_3372_i] )] = _ptr__3371_v[_3372_i];
            }
          }
        }
      }
      else
      {
        {
          _3364_uval = _3344_ub->getDataAsArray();
          _ptr__3364_uval.update(_3364_uval ? _3364_uval->raw() : nullptr, _3364_uval ? _3364_uval->size(0) : 0);
        }
      }
      return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3363_lval,_3364_uval,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimi),(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3343_lb)->dimj)}),nullptr,(int)1);
    }
  }
}
// End mosek.fusion.Domain.mkRangedDomain

// Begin mosek.fusion.Domain.mkRangedDomain
// Method mosek.fusion.Domain.mkRangedDomain @ bld/docker-win/final/default/src/fusion/domain.mbi:603:6-622:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::mkRangedDomain(std::shared_ptr< monty::ndarray< double,2 > > _3373_lb,std::shared_ptr< monty::ndarray< double,2 > > _3374_ub)
{
  if ((((int)((_3373_lb)->size(0)) != (int)((_3374_ub)->size(0))) || ((int)((_3373_lb)->size(1)) != (int)((_3374_ub)->size(1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions in domain"));
    }
  }
  {}
  int32_t _3375_dimj = (int)((_3373_lb)->size(1));
  int32_t _3376_dimi = (int)((_3373_lb)->size(0));
  int32_t _3377_n = safe_mul( _3376_dimi,_3375_dimj );
  std::shared_ptr< monty::ndarray< double,1 > > _3378_lval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3377_n)));
  _checked_ptr_1<double> _ptr__3378_lval(_3378_lval ? _3378_lval->raw() : nullptr,_3378_lval ? _3378_lval->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3379_uval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3377_n)));
  _checked_ptr_1<double> _ptr__3379_uval(_3379_uval ? _3379_uval->raw() : nullptr,_3379_uval ? _3379_uval->size(0) : 0);
  int32_t _3380_k = (int)0;
  int32_t _10829_ = (int)0;
  int32_t _10830_ = _3376_dimi;
  for (int32_t _3381_i = _10829_; _3381_i < _10830_; ++_3381_i)
  {
    {
      int32_t _10831_ = (int)0;
      int32_t _10832_ = _3375_dimj;
      for (int32_t _3382_j = _10831_; _3382_j < _10832_; ++_3382_j)
      {
        {
          _ptr__3378_lval[_3380_k] = ((*_3373_lb)(_3381_i,_3382_j));
          _ptr__3379_uval[_3380_k] = ((*_3374_ub)(_3381_i,_3382_j));
          ++ _3380_k;
        }
      }
    }
  }
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3378_lval,_3379_uval,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3376_dimi),(int32_t)(_3375_dimj)}),nullptr,(int)1);
}
// End mosek.fusion.Domain.mkRangedDomain

// Begin mosek.fusion.Domain.mkLinearDomain
// Method mosek.fusion.Domain.mkLinearDomain @ bld/docker-win/final/default/src/fusion/domain.mbi:583:6-601:7
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::mkLinearDomain(mosek::fusion::RelationKey _3383_k,monty::rc_ptr< ::mosek::fusion::Matrix > _3384_mx)
{
  if (_3384_mx->isSparse())
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3385_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3384_mx->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3385_msubi(_3385_msubi ? _3385_msubi->raw() : nullptr,_3385_msubi ? _3385_msubi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3386_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3384_mx->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__3386_msubj(_3386_msubj ? _3386_msubj->raw() : nullptr,_3386_msubj ? _3386_msubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3387_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_3384_mx->numNonzeros())));
      _checked_ptr_1<double> _ptr__3387_mval(_3387_mval ? _3387_mval->raw() : nullptr,_3387_mval ? _3387_mval->size(0) : 0);
      _3384_mx->getDataAsTriplets(_3385_msubi,_3386_msubj,_3387_mval);
      std::shared_ptr< monty::ndarray< int32_t,2 > > _3388_inst = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_3385_msubi)->size(0)),(int)2)));
      int32_t _10833_ = (int)0;
      int32_t _10834_ = (int)((_3385_msubi)->size(0));
      for (int32_t _3389_i = _10833_; _3389_i < _10834_; ++_3389_i)
      {
        {
          ((*_3388_inst)(_3389_i,(int)0)) = _ptr__3385_msubi[_3389_i];
          ((*_3388_inst)(_3389_i,(int)1)) = _ptr__3386_msubj[_3389_i];
        }
      }
      return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(_3383_k,false,_3387_mval,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3384_mx)->dimi),(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3384_mx)->dimj)}),_3388_inst,(int)1);
    }
  }
  else
  {
    {
      return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(_3383_k,false,_3384_mx->getDataAsArray(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3384_mx)->dimi),(int32_t)(mosek::fusion::p_Matrix::_get_impl(_3384_mx)->dimj)}),nullptr,(int)1);
    }
  }
}
// End mosek.fusion.Domain.mkLinearDomain

// Begin mosek.fusion.Domain.prod
// Method mosek.fusion.Domain.prod @ bld/docker-win/final/default/src/fusion/domain.mbi:581:6-121
int64_t mosek::fusion::p_Domain::prod(std::shared_ptr< monty::ndarray< int32_t,1 > > _3390_dim)
{
  _checked_ptr_1<int32_t> _ptr__3390_dim(_3390_dim ? _3390_dim->raw() : nullptr, _3390_dim ? _3390_dim->size(0) : 0);
  int64_t _3391_r = (int)1;
  int32_t _10835_ = (int)0;
  int32_t _10836_ = (int)((_3390_dim)->size(0));
  for (int32_t _3392_i = _10835_; _3392_i < _10836_; ++_3392_i)
  {
    {
      _3391_r *= _ptr__3390_dim[_3392_i];
    }
  }
  return _3391_r;
}
// End mosek.fusion.Domain.prod

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:564:6-579:7
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(bool _3393_scalable,std::shared_ptr< monty::ndarray< double,1 > > _3394_lb,std::shared_ptr< monty::ndarray< double,1 > > _3395_ub,std::shared_ptr< monty::ndarray< int32_t,2 > > _3396_sp,std::shared_ptr< monty::ndarray< int32_t,1 > > _3397_dims)
{
  _checked_ptr_1<double> _ptr__3394_lb(_3394_lb ? _3394_lb->raw() : nullptr, _3394_lb ? _3394_lb->size(0) : 0);
  _checked_ptr_1<double> _ptr__3395_ub(_3395_ub ? _3395_ub->raw() : nullptr, _3395_ub ? _3395_ub->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3397_dims(_3397_dims ? _3397_dims->raw() : nullptr, _3397_dims ? _3397_dims->size(0) : 0);
  if (((!_3393_scalable) && ((int)((_3394_lb)->size(0)) != (int)((_3395_ub)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching lengths of upper and lower bounds."));
    }
  }
  {}
  if (((NULL != _3396_sp.get()) && ((int)((_3396_sp)->size(0)) != (int)((_3394_lb)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching lengths of upper/lower bounds and sparsity."));
    }
  }
  {}
  int32_t _10837_ = (int)0;
  int32_t _10838_ = (int)((_3395_ub)->size(0));
  for (int32_t _3398_i = _10837_; _3398_i < _10838_; ++_3398_i)
  {
    {
      if ((_ptr__3394_lb[_3398_i] > _ptr__3395_ub[_3398_i]))
      {
        {
          throw ::mosek::fusion::DomainError(std::string ("Invalid range specified"));
        }
      }
      {}
    }
  }
  if (((NULL != _3397_dims.get()) && (::mosek::fusion::p_Domain::dimsize(_3397_dims) != (int)((_3394_lb)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching dimensions."));
    }
  }
  {}
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(_3393_scalable,_3394_lb,_3395_ub,_3397_dims)->__mosek_2fusion_2RangeDomain__sparse(_3396_sp);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.symmetric
// Method mosek.fusion.Domain.symmetric @ bld/docker-win/final/default/src/fusion/domain.mbi:561:6-103
monty::rc_ptr< ::mosek::fusion::SymmetricRangeDomain > mosek::fusion::Domain::symmetric
  ( monty::rc_ptr< ::mosek::fusion::RangeDomain > _3399_rd) { return mosek::fusion::p_Domain::symmetric(_3399_rd); }
monty::rc_ptr< ::mosek::fusion::SymmetricRangeDomain > mosek::fusion::p_Domain::symmetric(monty::rc_ptr< ::mosek::fusion::RangeDomain > _3399_rd)
{
  return _3399_rd->__mosek_2fusion_2RangeDomain__symmetric();
}
// End mosek.fusion.Domain.symmetric

// Begin mosek.fusion.Domain.symmetric
// Method mosek.fusion.Domain.symmetric @ bld/docker-win/final/default/src/fusion/domain.mbi:560:6-103
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::Domain::symmetric
  ( monty::rc_ptr< ::mosek::fusion::LinearDomain > _3400_ld) { return mosek::fusion::p_Domain::symmetric(_3400_ld); }
monty::rc_ptr< ::mosek::fusion::SymmetricLinearDomain > mosek::fusion::p_Domain::symmetric(monty::rc_ptr< ::mosek::fusion::LinearDomain > _3400_ld)
{
  return _3400_ld->__mosek_2fusion_2LinearDomain__symmetric();
}
// End mosek.fusion.Domain.symmetric

// Begin mosek.fusion.Domain.sparse
// Method mosek.fusion.Domain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:557:6-118
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::sparse
  ( monty::rc_ptr< ::mosek::fusion::RangeDomain > _3401_rd,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3402_sparsity) { return mosek::fusion::p_Domain::sparse(_3401_rd,_3402_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::sparse(monty::rc_ptr< ::mosek::fusion::RangeDomain > _3401_rd,std::shared_ptr< monty::ndarray< int32_t,2 > > _3402_sparsity)
{
  return _3401_rd->__mosek_2fusion_2RangeDomain__sparse(_3402_sparsity);
}
// End mosek.fusion.Domain.sparse

// Begin mosek.fusion.Domain.sparse
// Method mosek.fusion.Domain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:556:6-118
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::sparse
  ( monty::rc_ptr< ::mosek::fusion::RangeDomain > _3403_rd,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3404_sparsity) { return mosek::fusion::p_Domain::sparse(_3403_rd,_3404_sparsity); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::sparse(monty::rc_ptr< ::mosek::fusion::RangeDomain > _3403_rd,std::shared_ptr< monty::ndarray< int32_t,1 > > _3404_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__3404_sparsity(_3404_sparsity ? _3404_sparsity->raw() : nullptr, _3404_sparsity ? _3404_sparsity->size(0) : 0);
  return _3403_rd->__mosek_2fusion_2RangeDomain__sparse(_3404_sparsity);
}
// End mosek.fusion.Domain.sparse

// Begin mosek.fusion.Domain.sparse
// Method mosek.fusion.Domain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:555:6-118
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::sparse
  ( monty::rc_ptr< ::mosek::fusion::LinearDomain > _3405_ld,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _3406_sparsity) { return mosek::fusion::p_Domain::sparse(_3405_ld,_3406_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::sparse(monty::rc_ptr< ::mosek::fusion::LinearDomain > _3405_ld,std::shared_ptr< monty::ndarray< int32_t,2 > > _3406_sparsity)
{
  return _3405_ld->__mosek_2fusion_2LinearDomain__sparse(_3406_sparsity);
}
// End mosek.fusion.Domain.sparse

// Begin mosek.fusion.Domain.sparse
// Method mosek.fusion.Domain.sparse @ bld/docker-win/final/default/src/fusion/domain.mbi:554:6-118
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::sparse
  ( monty::rc_ptr< ::mosek::fusion::LinearDomain > _3407_ld,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3408_sparsity) { return mosek::fusion::p_Domain::sparse(_3407_ld,_3408_sparsity); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::sparse(monty::rc_ptr< ::mosek::fusion::LinearDomain > _3407_ld,std::shared_ptr< monty::ndarray< int32_t,1 > > _3408_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__3408_sparsity(_3408_sparsity ? _3408_sparsity->raw() : nullptr, _3408_sparsity ? _3408_sparsity->size(0) : 0);
  return _3407_ld->__mosek_2fusion_2LinearDomain__sparse(_3408_sparsity);
}
// End mosek.fusion.Domain.sparse

// Begin mosek.fusion.Domain.integral
// Method mosek.fusion.Domain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:552:6-92
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::integral
  ( monty::rc_ptr< ::mosek::fusion::RangeDomain > _3409_rd) { return mosek::fusion::p_Domain::integral(_3409_rd); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::integral(monty::rc_ptr< ::mosek::fusion::RangeDomain > _3409_rd)
{
  return _3409_rd->__mosek_2fusion_2RangeDomain__integral();
}
// End mosek.fusion.Domain.integral

// Begin mosek.fusion.Domain.integral
// Method mosek.fusion.Domain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:551:6-92
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::integral
  ( monty::rc_ptr< ::mosek::fusion::LinearDomain > _3410_ld) { return mosek::fusion::p_Domain::integral(_3410_ld); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::integral(monty::rc_ptr< ::mosek::fusion::LinearDomain > _3410_ld)
{
  return _3410_ld->__mosek_2fusion_2LinearDomain__integral();
}
// End mosek.fusion.Domain.integral

// Begin mosek.fusion.Domain.integral
// Method mosek.fusion.Domain.integral @ bld/docker-win/final/default/src/fusion/domain.mbi:550:6-88
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::integral
  ( monty::rc_ptr< ::mosek::fusion::ConeDomain > _3411_c) { return mosek::fusion::p_Domain::integral(_3411_c); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::integral(monty::rc_ptr< ::mosek::fusion::ConeDomain > _3411_c)
{
  return _3411_c->__mosek_2fusion_2ConeDomain__integral();
}
// End mosek.fusion.Domain.integral

// Begin mosek.fusion.Domain.axis
// Method mosek.fusion.Domain.axis @ bld/docker-win/final/default/src/fusion/domain.mbi:548:6-93
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::axis
  ( monty::rc_ptr< ::mosek::fusion::ConeDomain > _3412_c,
    int32_t _3413_a) { return mosek::fusion::p_Domain::axis(_3412_c,_3413_a); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::axis(monty::rc_ptr< ::mosek::fusion::ConeDomain > _3412_c,int32_t _3413_a)
{
  return _3412_c->__mosek_2fusion_2ConeDomain__axis(_3413_a);
}
// End mosek.fusion.Domain.axis

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:545:6-178
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3414_alphas,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3415_dims) { return mosek::fusion::p_Domain::inDPowerCone(_3414_alphas,_3415_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3414_alphas,std::shared_ptr< monty::ndarray< int32_t,1 > > _3415_dims)
{
  _checked_ptr_1<double> _ptr__3414_alphas(_3414_alphas ? _3414_alphas->raw() : nullptr, _3414_alphas ? _3414_alphas->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3415_dims(_3415_dims ? _3415_dims->raw() : nullptr, _3415_dims ? _3415_dims->size(0) : 0);
  std::vector<int32_t> _10839_;
  for (int32_t _3416_i = (int)0, _10840_ = (int)((_3415_dims)->size(0)); _3416_i < _10840_ ; ++_3416_i)
  {
    _10839_.push_back(_ptr__3415_dims[_3416_i]);
  }
  auto _10841_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10839_.size()),_10839_.begin(),_10839_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,_3414_alphas,_10841_);
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:544:6-153
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3417_alphas,
    int32_t _3418_m) { return mosek::fusion::p_Domain::inDPowerCone(_3417_alphas,_3418_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3417_alphas,int32_t _3418_m)
{
  _checked_ptr_1<double> _ptr__3417_alphas(_3417_alphas ? _3417_alphas->raw() : nullptr, _3417_alphas ? _3417_alphas->size(0) : 0);
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,_3417_alphas,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3418_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:543:6-147
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3419_alphas) { return mosek::fusion::p_Domain::inDPowerCone(_3419_alphas); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3419_alphas)
{
  _checked_ptr_1<double> _ptr__3419_alphas(_3419_alphas ? _3419_alphas->raw() : nullptr, _3419_alphas ? _3419_alphas->size(0) : 0);
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,_3419_alphas,nullptr);
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:541:6-191
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( double _3420_alpha,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3421_dims) { return mosek::fusion::p_Domain::inDPowerCone(_3420_alpha,_3421_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(double _3420_alpha,std::shared_ptr< monty::ndarray< int32_t,1 > > _3421_dims)
{
  _checked_ptr_1<int32_t> _ptr__3421_dims(_3421_dims ? _3421_dims->raw() : nullptr, _3421_dims ? _3421_dims->size(0) : 0);
  std::vector<int32_t> _10842_;
  for (int32_t _3422_i = (int)0, _10843_ = (int)((_3421_dims)->size(0)); _3422_i < _10843_ ; ++_3422_i)
  {
    _10842_.push_back(_ptr__3421_dims[_3422_i]);
  }
  auto _10844_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10842_.size()),_10842_.begin(),_10842_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3420_alpha),(double)((1.0 - _3420_alpha))}),_10844_);
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:540:6-166
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( double _3423_alpha,
    int32_t _3424_m) { return mosek::fusion::p_Domain::inDPowerCone(_3423_alpha,_3424_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(double _3423_alpha,int32_t _3424_m)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3423_alpha),(double)((1.0 - _3423_alpha))}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3424_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inDPowerCone
// Method mosek.fusion.Domain.inDPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:539:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDPowerCone
  ( double _3425_alpha) { return mosek::fusion::p_Domain::inDPowerCone(_3425_alpha); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDPowerCone(double _3425_alpha)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3425_alpha),(double)((1.0 - _3425_alpha))}),nullptr);
}
// End mosek.fusion.Domain.inDPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:536:6-178
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3426_alphas,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3427_dims) { return mosek::fusion::p_Domain::inPPowerCone(_3426_alphas,_3427_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3426_alphas,std::shared_ptr< monty::ndarray< int32_t,1 > > _3427_dims)
{
  _checked_ptr_1<double> _ptr__3426_alphas(_3426_alphas ? _3426_alphas->raw() : nullptr, _3426_alphas ? _3426_alphas->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3427_dims(_3427_dims ? _3427_dims->raw() : nullptr, _3427_dims ? _3427_dims->size(0) : 0);
  std::vector<int32_t> _10845_;
  for (int32_t _3428_i = (int)0, _10846_ = (int)((_3427_dims)->size(0)); _3428_i < _10846_ ; ++_3428_i)
  {
    _10845_.push_back(_ptr__3427_dims[_3428_i]);
  }
  auto _10847_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10845_.size()),_10845_.begin(),_10845_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,_3426_alphas,_10847_);
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:535:6-153
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3429_alphas,
    int32_t _3430_m) { return mosek::fusion::p_Domain::inPPowerCone(_3429_alphas,_3430_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3429_alphas,int32_t _3430_m)
{
  _checked_ptr_1<double> _ptr__3429_alphas(_3429_alphas ? _3429_alphas->raw() : nullptr, _3429_alphas ? _3429_alphas->size(0) : 0);
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,_3429_alphas,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3430_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:534:6-147
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( std::shared_ptr< monty::ndarray< double,1 > > _3431_alphas) { return mosek::fusion::p_Domain::inPPowerCone(_3431_alphas); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(std::shared_ptr< monty::ndarray< double,1 > > _3431_alphas)
{
  _checked_ptr_1<double> _ptr__3431_alphas(_3431_alphas ? _3431_alphas->raw() : nullptr, _3431_alphas ? _3431_alphas->size(0) : 0);
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,_3431_alphas,nullptr);
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:532:6-191
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( double _3432_alpha,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3433_dims) { return mosek::fusion::p_Domain::inPPowerCone(_3432_alpha,_3433_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(double _3432_alpha,std::shared_ptr< monty::ndarray< int32_t,1 > > _3433_dims)
{
  _checked_ptr_1<int32_t> _ptr__3433_dims(_3433_dims ? _3433_dims->raw() : nullptr, _3433_dims ? _3433_dims->size(0) : 0);
  std::vector<int32_t> _10848_;
  for (int32_t _3434_i = (int)0, _10849_ = (int)((_3433_dims)->size(0)); _3434_i < _10849_ ; ++_3434_i)
  {
    _10848_.push_back(_ptr__3433_dims[_3434_i]);
  }
  auto _10850_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10848_.size()),_10848_.begin(),_10848_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3432_alpha),(double)((1.0 - _3432_alpha))}),_10850_);
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:531:6-166
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( double _3435_alpha,
    int32_t _3436_m) { return mosek::fusion::p_Domain::inPPowerCone(_3435_alpha,_3436_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(double _3435_alpha,int32_t _3436_m)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3435_alpha),(double)((1.0 - _3435_alpha))}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3436_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inPPowerCone
// Method mosek.fusion.Domain.inPPowerCone @ bld/docker-win/final/default/src/fusion/domain.mbi:530:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPPowerCone
  ( double _3437_alpha) { return mosek::fusion::p_Domain::inPPowerCone(_3437_alpha); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPPowerCone(double _3437_alpha)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPPowCone,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3437_alpha),(double)((1.0 - _3437_alpha))}),nullptr);
}
// End mosek.fusion.Domain.inPPowerCone

// Begin mosek.fusion.Domain.inDExpCone
// Method mosek.fusion.Domain.inDExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:527:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDExpCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3438_dims) { return mosek::fusion::p_Domain::inDExpCone(_3438_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDExpCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3438_dims)
{
  _checked_ptr_1<int32_t> _ptr__3438_dims(_3438_dims ? _3438_dims->raw() : nullptr, _3438_dims ? _3438_dims->size(0) : 0);
  std::vector<int32_t> _10851_;
  for (int32_t _3439_i = (int)0, _10852_ = (int)((_3438_dims)->size(0)); _3439_i < _10852_ ; ++_3439_i)
  {
    _10851_.push_back(_ptr__3438_dims[_3439_i]);
  }
  auto _10853_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10851_.size()),_10851_.begin(),_10851_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDExpCone,_10853_);
}
// End mosek.fusion.Domain.inDExpCone

// Begin mosek.fusion.Domain.inDExpCone
// Method mosek.fusion.Domain.inDExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:526:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDExpCone
  ( int32_t _3440_m) { return mosek::fusion::p_Domain::inDExpCone(_3440_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDExpCone(int32_t _3440_m)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDExpCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3440_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inDExpCone

// Begin mosek.fusion.Domain.inDExpCone
// Method mosek.fusion.Domain.inDExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:525:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDExpCone
  ( ) { return mosek::fusion::p_Domain::inDExpCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDExpCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDExpCone,nullptr);
}
// End mosek.fusion.Domain.inDExpCone

// Begin mosek.fusion.Domain.inPExpCone
// Method mosek.fusion.Domain.inPExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:522:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPExpCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3441_dims) { return mosek::fusion::p_Domain::inPExpCone(_3441_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPExpCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3441_dims)
{
  _checked_ptr_1<int32_t> _ptr__3441_dims(_3441_dims ? _3441_dims->raw() : nullptr, _3441_dims ? _3441_dims->size(0) : 0);
  std::vector<int32_t> _10854_;
  for (int32_t _3442_i = (int)0, _10855_ = (int)((_3441_dims)->size(0)); _3442_i < _10855_ ; ++_3442_i)
  {
    _10854_.push_back(_ptr__3441_dims[_3442_i]);
  }
  auto _10856_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10854_.size()),_10854_.begin(),_10854_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPExpCone,_10856_);
}
// End mosek.fusion.Domain.inPExpCone

// Begin mosek.fusion.Domain.inPExpCone
// Method mosek.fusion.Domain.inPExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:521:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPExpCone
  ( int32_t _3443_m) { return mosek::fusion::p_Domain::inPExpCone(_3443_m); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPExpCone(int32_t _3443_m)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPExpCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3443_m),(int32_t)((int)3)}));
}
// End mosek.fusion.Domain.inPExpCone

// Begin mosek.fusion.Domain.inPExpCone
// Method mosek.fusion.Domain.inPExpCone @ bld/docker-win/final/default/src/fusion/domain.mbi:520:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPExpCone
  ( ) { return mosek::fusion::p_Domain::inPExpCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPExpCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPExpCone,nullptr);
}
// End mosek.fusion.Domain.inPExpCone

// Begin mosek.fusion.Domain.inDGeoMeanCone
// Method mosek.fusion.Domain.inDGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:516:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDGeoMeanCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3444_dims) { return mosek::fusion::p_Domain::inDGeoMeanCone(_3444_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDGeoMeanCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3444_dims)
{
  _checked_ptr_1<int32_t> _ptr__3444_dims(_3444_dims ? _3444_dims->raw() : nullptr, _3444_dims ? _3444_dims->size(0) : 0);
  std::vector<int32_t> _10857_;
  for (int32_t _3445_i = (int)0, _10858_ = (int)((_3444_dims)->size(0)); _3445_i < _10858_ ; ++_3445_i)
  {
    _10857_.push_back(_ptr__3444_dims[_3445_i]);
  }
  auto _10859_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10857_.size()),_10857_.begin(),_10857_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDGeoMeanCone,_10859_);
}
// End mosek.fusion.Domain.inDGeoMeanCone

// Begin mosek.fusion.Domain.inDGeoMeanCone
// Method mosek.fusion.Domain.inDGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:515:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDGeoMeanCone
  ( int32_t _3446_m,
    int32_t _3447_n) { return mosek::fusion::p_Domain::inDGeoMeanCone(_3446_m,_3447_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDGeoMeanCone(int32_t _3446_m,int32_t _3447_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDGeoMeanCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3446_m),(int32_t)(_3447_n)}));
}
// End mosek.fusion.Domain.inDGeoMeanCone

// Begin mosek.fusion.Domain.inDGeoMeanCone
// Method mosek.fusion.Domain.inDGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:514:6-133
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDGeoMeanCone
  ( int32_t _3448_n) { return mosek::fusion::p_Domain::inDGeoMeanCone(_3448_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDGeoMeanCone(int32_t _3448_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDGeoMeanCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3448_n)}));
}
// End mosek.fusion.Domain.inDGeoMeanCone

// Begin mosek.fusion.Domain.inDGeoMeanCone
// Method mosek.fusion.Domain.inDGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:513:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inDGeoMeanCone
  ( ) { return mosek::fusion::p_Domain::inDGeoMeanCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inDGeoMeanCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InDGeoMeanCone,nullptr);
}
// End mosek.fusion.Domain.inDGeoMeanCone

// Begin mosek.fusion.Domain.inPGeoMeanCone
// Method mosek.fusion.Domain.inPGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:511:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPGeoMeanCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3449_dims) { return mosek::fusion::p_Domain::inPGeoMeanCone(_3449_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPGeoMeanCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3449_dims)
{
  _checked_ptr_1<int32_t> _ptr__3449_dims(_3449_dims ? _3449_dims->raw() : nullptr, _3449_dims ? _3449_dims->size(0) : 0);
  std::vector<int32_t> _10860_;
  for (int32_t _3450_i = (int)0, _10861_ = (int)((_3449_dims)->size(0)); _3450_i < _10861_ ; ++_3450_i)
  {
    _10860_.push_back(_ptr__3449_dims[_3450_i]);
  }
  auto _10862_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10860_.size()),_10860_.begin(),_10860_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPGeoMeanCone,_10862_);
}
// End mosek.fusion.Domain.inPGeoMeanCone

// Begin mosek.fusion.Domain.inPGeoMeanCone
// Method mosek.fusion.Domain.inPGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:510:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPGeoMeanCone
  ( int32_t _3451_m,
    int32_t _3452_n) { return mosek::fusion::p_Domain::inPGeoMeanCone(_3451_m,_3452_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPGeoMeanCone(int32_t _3451_m,int32_t _3452_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPGeoMeanCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3451_m),(int32_t)(_3452_n)}));
}
// End mosek.fusion.Domain.inPGeoMeanCone

// Begin mosek.fusion.Domain.inPGeoMeanCone
// Method mosek.fusion.Domain.inPGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:509:6-133
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPGeoMeanCone
  ( int32_t _3453_n) { return mosek::fusion::p_Domain::inPGeoMeanCone(_3453_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPGeoMeanCone(int32_t _3453_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPGeoMeanCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3453_n)}));
}
// End mosek.fusion.Domain.inPGeoMeanCone

// Begin mosek.fusion.Domain.inPGeoMeanCone
// Method mosek.fusion.Domain.inPGeoMeanCone @ bld/docker-win/final/default/src/fusion/domain.mbi:508:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inPGeoMeanCone
  ( ) { return mosek::fusion::p_Domain::inPGeoMeanCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inPGeoMeanCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InPGeoMeanCone,nullptr);
}
// End mosek.fusion.Domain.inPGeoMeanCone

// Begin mosek.fusion.Domain.inRotatedQCone
// Method mosek.fusion.Domain.inRotatedQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:493:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inRotatedQCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3454_dims) { return mosek::fusion::p_Domain::inRotatedQCone(_3454_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inRotatedQCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3454_dims)
{
  _checked_ptr_1<int32_t> _ptr__3454_dims(_3454_dims ? _3454_dims->raw() : nullptr, _3454_dims ? _3454_dims->size(0) : 0);
  std::vector<int32_t> _10863_;
  for (int32_t _3455_i = (int)0, _10864_ = (int)((_3454_dims)->size(0)); _3455_i < _10864_ ; ++_3455_i)
  {
    _10863_.push_back(_ptr__3454_dims[_3455_i]);
  }
  auto _10865_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10863_.size()),_10863_.begin(),_10863_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InRotatedQCone,_10865_);
}
// End mosek.fusion.Domain.inRotatedQCone

// Begin mosek.fusion.Domain.inRotatedQCone
// Method mosek.fusion.Domain.inRotatedQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:492:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inRotatedQCone
  ( int32_t _3456_m,
    int32_t _3457_n) { return mosek::fusion::p_Domain::inRotatedQCone(_3456_m,_3457_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inRotatedQCone(int32_t _3456_m,int32_t _3457_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InRotatedQCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3456_m),(int32_t)(_3457_n)}));
}
// End mosek.fusion.Domain.inRotatedQCone

// Begin mosek.fusion.Domain.inRotatedQCone
// Method mosek.fusion.Domain.inRotatedQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:491:6-133
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inRotatedQCone
  ( int32_t _3458_n) { return mosek::fusion::p_Domain::inRotatedQCone(_3458_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inRotatedQCone(int32_t _3458_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InRotatedQCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3458_n)}));
}
// End mosek.fusion.Domain.inRotatedQCone

// Begin mosek.fusion.Domain.inRotatedQCone
// Method mosek.fusion.Domain.inRotatedQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:490:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inRotatedQCone
  ( ) { return mosek::fusion::p_Domain::inRotatedQCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inRotatedQCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InRotatedQCone,nullptr);
}
// End mosek.fusion.Domain.inRotatedQCone

// Begin mosek.fusion.Domain.inQCone
// Method mosek.fusion.Domain.inQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:488:6-160
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inQCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3459_dims) { return mosek::fusion::p_Domain::inQCone(_3459_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inQCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3459_dims)
{
  _checked_ptr_1<int32_t> _ptr__3459_dims(_3459_dims ? _3459_dims->raw() : nullptr, _3459_dims ? _3459_dims->size(0) : 0);
  std::vector<int32_t> _10866_;
  for (int32_t _3460_i = (int)0, _10867_ = (int)((_3459_dims)->size(0)); _3460_i < _10867_ ; ++_3460_i)
  {
    _10866_.push_back(_ptr__3459_dims[_3460_i]);
  }
  auto _10868_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10866_.size()),_10866_.begin(),_10866_.end()));
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InQCone,_10868_);
}
// End mosek.fusion.Domain.inQCone

// Begin mosek.fusion.Domain.inQCone
// Method mosek.fusion.Domain.inQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:487:6-135
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inQCone
  ( int32_t _3461_m,
    int32_t _3462_n) { return mosek::fusion::p_Domain::inQCone(_3461_m,_3462_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inQCone(int32_t _3461_m,int32_t _3462_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InQCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3461_m),(int32_t)(_3462_n)}));
}
// End mosek.fusion.Domain.inQCone

// Begin mosek.fusion.Domain.inQCone
// Method mosek.fusion.Domain.inQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:486:6-133
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inQCone
  ( int32_t _3463_n) { return mosek::fusion::p_Domain::inQCone(_3463_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inQCone(int32_t _3463_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InQCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3463_n)}));
}
// End mosek.fusion.Domain.inQCone

// Begin mosek.fusion.Domain.inQCone
// Method mosek.fusion.Domain.inQCone @ bld/docker-win/final/default/src/fusion/domain.mbi:485:6-129
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inQCone
  ( ) { return mosek::fusion::p_Domain::inQCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inQCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InQCone,nullptr);
}
// End mosek.fusion.Domain.inQCone

// Begin mosek.fusion.Domain.inSVecPSDCone
// Method mosek.fusion.Domain.inSVecPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:482:6-128
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inSVecPSDCone
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3464_dims) { return mosek::fusion::p_Domain::inSVecPSDCone(_3464_dims); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inSVecPSDCone(std::shared_ptr< monty::ndarray< int32_t,1 > > _3464_dims)
{
  _checked_ptr_1<int32_t> _ptr__3464_dims(_3464_dims ? _3464_dims->raw() : nullptr, _3464_dims ? _3464_dims->size(0) : 0);
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InSVecPSDCone,_3464_dims);
}
// End mosek.fusion.Domain.inSVecPSDCone

// Begin mosek.fusion.Domain.inSVecPSDCone
// Method mosek.fusion.Domain.inSVecPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:481:6-136
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inSVecPSDCone
  ( int32_t _3465_d1,
    int32_t _3466_d2) { return mosek::fusion::p_Domain::inSVecPSDCone(_3465_d1,_3466_d2); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inSVecPSDCone(int32_t _3465_d1,int32_t _3466_d2)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InSVecPSDCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3465_d1),(int32_t)(_3466_d2)}));
}
// End mosek.fusion.Domain.inSVecPSDCone

// Begin mosek.fusion.Domain.inSVecPSDCone
// Method mosek.fusion.Domain.inSVecPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:480:6-132
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inSVecPSDCone
  ( int32_t _3467_n) { return mosek::fusion::p_Domain::inSVecPSDCone(_3467_n); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inSVecPSDCone(int32_t _3467_n)
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InSVecPSDCone,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3467_n)}));
}
// End mosek.fusion.Domain.inSVecPSDCone

// Begin mosek.fusion.Domain.inSVecPSDCone
// Method mosek.fusion.Domain.inSVecPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:479:6-128
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::Domain::inSVecPSDCone
  ( ) { return mosek::fusion::p_Domain::inSVecPSDCone(); }
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::p_Domain::inSVecPSDCone()
{
  return ::mosek::fusion::p_ConeDomain::_new_ConeDomain(::mosek::fusion::QConeKey::InSVecPSDCone,nullptr);
}
// End mosek.fusion.Domain.inSVecPSDCone

// Begin mosek.fusion.Domain.isTrilPSD
// Method mosek.fusion.Domain.isTrilPSD @ bld/docker-win/final/default/src/fusion/domain.mbi:469:6-130
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::isTrilPSD
  ( int32_t _3468_n,
    int32_t _3469_m) { return mosek::fusion::p_Domain::isTrilPSD(_3468_n,_3469_m); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::isTrilPSD(int32_t _3468_n,int32_t _3469_m)
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsTrilPSD,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3469_m),(int32_t)(_3468_n),(int32_t)(_3468_n)}),(int)1,(int)2);
}
// End mosek.fusion.Domain.isTrilPSD

// Begin mosek.fusion.Domain.isTrilPSD
// Method mosek.fusion.Domain.isTrilPSD @ bld/docker-win/final/default/src/fusion/domain.mbi:468:6-128
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::isTrilPSD
  ( int32_t _3470_n) { return mosek::fusion::p_Domain::isTrilPSD(_3470_n); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::isTrilPSD(int32_t _3470_n)
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsTrilPSD,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3470_n),(int32_t)(_3470_n)}),(int)0,(int)1);
}
// End mosek.fusion.Domain.isTrilPSD

// Begin mosek.fusion.Domain.isTrilPSD
// Method mosek.fusion.Domain.isTrilPSD @ bld/docker-win/final/default/src/fusion/domain.mbi:467:6-112
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::isTrilPSD
  ( ) { return mosek::fusion::p_Domain::isTrilPSD(); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::isTrilPSD()
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsTrilPSD);
}
// End mosek.fusion.Domain.isTrilPSD

// Begin mosek.fusion.Domain.inPSDCone
// Method mosek.fusion.Domain.inPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:465:6-126
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::inPSDCone
  ( int32_t _3471_n,
    int32_t _3472_m) { return mosek::fusion::p_Domain::inPSDCone(_3471_n,_3472_m); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::inPSDCone(int32_t _3471_n,int32_t _3472_m)
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsSymPSD,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3472_m),(int32_t)(_3471_n),(int32_t)(_3471_n)}));
}
// End mosek.fusion.Domain.inPSDCone

// Begin mosek.fusion.Domain.inPSDCone
// Method mosek.fusion.Domain.inPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:464:6-124
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::inPSDCone
  ( int32_t _3473_n) { return mosek::fusion::p_Domain::inPSDCone(_3473_n); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::inPSDCone(int32_t _3473_n)
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsSymPSD,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3473_n),(int32_t)(_3473_n)}));
}
// End mosek.fusion.Domain.inPSDCone

// Begin mosek.fusion.Domain.inPSDCone
// Method mosek.fusion.Domain.inPSDCone @ bld/docker-win/final/default/src/fusion/domain.mbi:463:6-111
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::Domain::inPSDCone
  ( ) { return mosek::fusion::p_Domain::inPSDCone(); }
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::p_Domain::inPSDCone()
{
  return ::mosek::fusion::p_PSDDomain::_new_PSDDomain(::mosek::fusion::PSDKey::IsSymPSD);
}
// End mosek.fusion.Domain.inPSDCone

// Begin mosek.fusion.Domain.binary
// Method mosek.fusion.Domain.binary @ bld/docker-win/final/default/src/fusion/domain.mbi:460:6-123
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::binary
  ( ) { return mosek::fusion::p_Domain::binary(); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::binary()
{
  return ::mosek::fusion::p_Domain::inRange(0.0,1.0)->__mosek_2fusion_2RangeDomain__integral();
}
// End mosek.fusion.Domain.binary

// Begin mosek.fusion.Domain.binary
// Method mosek.fusion.Domain.binary @ bld/docker-win/final/default/src/fusion/domain.mbi:459:6-128
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::binary
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3474_dims) { return mosek::fusion::p_Domain::binary(_3474_dims); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::binary(std::shared_ptr< monty::ndarray< int32_t,1 > > _3474_dims)
{
  _checked_ptr_1<int32_t> _ptr__3474_dims(_3474_dims ? _3474_dims->raw() : nullptr, _3474_dims ? _3474_dims->size(0) : 0);
  return ::mosek::fusion::p_Domain::inRange(0.0,1.0,_3474_dims)->__mosek_2fusion_2RangeDomain__integral();
}
// End mosek.fusion.Domain.binary

// Begin mosek.fusion.Domain.binary
// Method mosek.fusion.Domain.binary @ bld/docker-win/final/default/src/fusion/domain.mbi:458:6-134
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::binary
  ( int32_t _3475_m,
    int32_t _3476_n) { return mosek::fusion::p_Domain::binary(_3475_m,_3476_n); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::binary(int32_t _3475_m,int32_t _3476_n)
{
  return ::mosek::fusion::p_Domain::inRange(0.0,1.0,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3475_m),(int32_t)(_3476_n)}))->__mosek_2fusion_2RangeDomain__integral();
}
// End mosek.fusion.Domain.binary

// Begin mosek.fusion.Domain.binary
// Method mosek.fusion.Domain.binary @ bld/docker-win/final/default/src/fusion/domain.mbi:457:6-132
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::binary
  ( int32_t _3477_n) { return mosek::fusion::p_Domain::binary(_3477_n); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::binary(int32_t _3477_n)
{
  return ::mosek::fusion::p_Domain::inRange(0.0,1.0,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3477_n)}))->__mosek_2fusion_2RangeDomain__integral();
}
// End mosek.fusion.Domain.binary

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:451:6-120
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _3478_lbm,
    monty::rc_ptr< ::mosek::fusion::Matrix > _3479_ubm) { return mosek::fusion::p_Domain::inRange(_3478_lbm,_3479_ubm); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(monty::rc_ptr< ::mosek::fusion::Matrix > _3478_lbm,monty::rc_ptr< ::mosek::fusion::Matrix > _3479_ubm)
{
  return ::mosek::fusion::p_Domain::mkRangedDomain(_3478_lbm,_3479_ubm);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:450:6-120
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( std::shared_ptr< monty::ndarray< double,2 > > _3480_lba,
    std::shared_ptr< monty::ndarray< double,2 > > _3481_uba) { return mosek::fusion::p_Domain::inRange(_3480_lba,_3481_uba); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(std::shared_ptr< monty::ndarray< double,2 > > _3480_lba,std::shared_ptr< monty::ndarray< double,2 > > _3481_uba)
{
  return ::mosek::fusion::p_Domain::mkRangedDomain(_3480_lba,_3481_uba);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:448:6-147
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( std::shared_ptr< monty::ndarray< double,1 > > _3482_lba,
    std::shared_ptr< monty::ndarray< double,1 > > _3483_uba,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3484_dims) { return mosek::fusion::p_Domain::inRange(_3482_lba,_3483_uba,_3484_dims); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(std::shared_ptr< monty::ndarray< double,1 > > _3482_lba,std::shared_ptr< monty::ndarray< double,1 > > _3483_uba,std::shared_ptr< monty::ndarray< int32_t,1 > > _3484_dims)
{
  _checked_ptr_1<double> _ptr__3482_lba(_3482_lba ? _3482_lba->raw() : nullptr, _3482_lba ? _3482_lba->size(0) : 0);
  _checked_ptr_1<double> _ptr__3483_uba(_3483_uba ? _3483_uba->raw() : nullptr, _3483_uba ? _3483_uba->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3484_dims(_3484_dims ? _3484_dims->raw() : nullptr, _3484_dims ? _3484_dims->size(0) : 0);
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3482_lba,_3483_uba,_3484_dims);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:447:6-174
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( std::shared_ptr< monty::ndarray< double,1 > > _3485_lba,
    double _3486_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3487_dims) { return mosek::fusion::p_Domain::inRange(_3485_lba,_3486_ub,_3487_dims); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(std::shared_ptr< monty::ndarray< double,1 > > _3485_lba,double _3486_ub,std::shared_ptr< monty::ndarray< int32_t,1 > > _3487_dims)
{
  _checked_ptr_1<double> _ptr__3485_lba(_3485_lba ? _3485_lba->raw() : nullptr, _3485_lba ? _3485_lba->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3487_dims(_3487_dims ? _3487_dims->raw() : nullptr, _3487_dims ? _3487_dims->size(0) : 0);
  std::vector<double> _10869_;
  for (int32_t _3488_i = (int)0, _10870_ = (int)((_3485_lba)->size(0)); _3488_i < _10870_ ; ++_3488_i)
  {
    _10869_.push_back(_3486_ub);
  }
  auto _10871_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10869_.size()),_10869_.begin(),_10869_.end()));
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3485_lba,_10871_,_3487_dims);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:446:6-201
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( double _3489_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3490_uba,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3491_dims) { return mosek::fusion::p_Domain::inRange(_3489_lb,_3490_uba,_3491_dims); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(double _3489_lb,std::shared_ptr< monty::ndarray< double,1 > > _3490_uba,std::shared_ptr< monty::ndarray< int32_t,1 > > _3491_dims)
{
  _checked_ptr_1<double> _ptr__3490_uba(_3490_uba ? _3490_uba->raw() : nullptr, _3490_uba ? _3490_uba->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3491_dims(_3491_dims ? _3491_dims->raw() : nullptr, _3491_dims ? _3491_dims->size(0) : 0);
  std::vector<double> _10872_;
  for (int32_t _3492_i = (int)0, _10873_ = (int)((_3490_uba)->size(0)); _3492_i < _10873_ ; ++_3492_i)
  {
    _10872_.push_back(_3489_lb);
  }
  auto _10874_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10872_.size()),_10872_.begin(),_10872_.end()));
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_10874_,_3490_uba,_3491_dims);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:445:6-145
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( double _3493_lb,
    double _3494_ub,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3495_dims) { return mosek::fusion::p_Domain::inRange(_3493_lb,_3494_ub,_3495_dims); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(double _3493_lb,double _3494_ub,std::shared_ptr< monty::ndarray< int32_t,1 > > _3495_dims)
{
  _checked_ptr_1<int32_t> _ptr__3495_dims(_3495_dims ? _3495_dims->raw() : nullptr, _3495_dims ? _3495_dims->size(0) : 0);
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3493_lb,_3494_ub,_3495_dims);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:443:6-198
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( std::shared_ptr< monty::ndarray< double,1 > > _3496_lba,
    std::shared_ptr< monty::ndarray< double,1 > > _3497_uba) { return mosek::fusion::p_Domain::inRange(_3496_lba,_3497_uba); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(std::shared_ptr< monty::ndarray< double,1 > > _3496_lba,std::shared_ptr< monty::ndarray< double,1 > > _3497_uba)
{
  _checked_ptr_1<double> _ptr__3496_lba(_3496_lba ? _3496_lba->raw() : nullptr, _3496_lba ? _3496_lba->size(0) : 0);
  _checked_ptr_1<double> _ptr__3497_uba(_3497_uba ? _3497_uba->raw() : nullptr, _3497_uba ? _3497_uba->size(0) : 0);
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3496_lba,_3497_uba,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3496_lba)->size(0)))}));
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:442:6-198
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( std::shared_ptr< monty::ndarray< double,1 > > _3498_lba,
    double _3499_ub) { return mosek::fusion::p_Domain::inRange(_3498_lba,_3499_ub); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(std::shared_ptr< monty::ndarray< double,1 > > _3498_lba,double _3499_ub)
{
  _checked_ptr_1<double> _ptr__3498_lba(_3498_lba ? _3498_lba->raw() : nullptr, _3498_lba ? _3498_lba->size(0) : 0);
  std::vector<double> _10875_;
  for (int32_t _3500_i = (int)0, _10876_ = (int)((_3498_lba)->size(0)); _3500_i < _10876_ ; ++_3500_i)
  {
    _10875_.push_back(_3499_ub);
  }
  auto _10877_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10875_.size()),_10875_.begin(),_10875_.end()));
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_3498_lba,_10877_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3498_lba)->size(0)))}));
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:441:6-198
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( double _3501_lb,
    std::shared_ptr< monty::ndarray< double,1 > > _3502_uba) { return mosek::fusion::p_Domain::inRange(_3501_lb,_3502_uba); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(double _3501_lb,std::shared_ptr< monty::ndarray< double,1 > > _3502_uba)
{
  _checked_ptr_1<double> _ptr__3502_uba(_3502_uba ? _3502_uba->raw() : nullptr, _3502_uba ? _3502_uba->size(0) : 0);
  std::vector<double> _10878_;
  for (int32_t _3503_i = (int)0, _10879_ = (int)((_3502_uba)->size(0)); _3503_i < _10879_ ; ++_3503_i)
  {
    _10878_.push_back(_3501_lb);
  }
  auto _10880_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10878_.size()),_10878_.begin(),_10878_.end()));
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(false,_10880_,_3502_uba,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3502_uba)->size(0)))}));
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.inRange
// Method mosek.fusion.Domain.inRange @ bld/docker-win/final/default/src/fusion/domain.mbi:440:6-187
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::Domain::inRange
  ( double _3504_lb,
    double _3505_ub) { return mosek::fusion::p_Domain::inRange(_3504_lb,_3505_ub); }
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::p_Domain::inRange(double _3504_lb,double _3505_ub)
{
  return ::mosek::fusion::p_RangeDomain::_new_RangeDomain(true,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3504_lb)}),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3505_ub)}),nullptr);
}
// End mosek.fusion.Domain.inRange

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:437:6-138
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _3506_mx) { return mosek::fusion::p_Domain::greaterThan(_3506_mx); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(monty::rc_ptr< ::mosek::fusion::Matrix > _3506_mx)
{
  return ::mosek::fusion::p_Domain::mkLinearDomain(::mosek::fusion::RelationKey::GreaterThan,_3506_mx);
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:436:6-177
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( std::shared_ptr< monty::ndarray< double,1 > > _3507_a1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3508_dims) { return mosek::fusion::p_Domain::greaterThan(_3507_a1,_3508_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(std::shared_ptr< monty::ndarray< double,1 > > _3507_a1,std::shared_ptr< monty::ndarray< int32_t,1 > > _3508_dims)
{
  _checked_ptr_1<double> _ptr__3507_a1(_3507_a1 ? _3507_a1->raw() : nullptr, _3507_a1 ? _3507_a1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3508_dims(_3508_dims ? _3508_dims->raw() : nullptr, _3508_dims ? _3508_dims->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,::mosek::fusion::Utils::Tools::arraycopy(_3507_a1),_3508_dims);
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:435:6-230
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( std::shared_ptr< monty::ndarray< double,2 > > _3509_a2) { return mosek::fusion::p_Domain::greaterThan(_3509_a2); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(std::shared_ptr< monty::ndarray< double,2 > > _3509_a2)
{
  std::vector<double> _10881_;
  for (int32_t _3510_i = (int)0, _10882_ = (int)((_3509_a2)->size(0)); _3510_i < _10882_ ; ++_3510_i)
  {
    for (int32_t _3511_j = (int)0, _10883_ = (int)((_3509_a2)->size(1)); _3511_j < _10883_ ; ++_3511_j)
    {
      _10881_.push_back(((*_3509_a2)(_3510_i,_3511_j)));
    }
  }
  auto _10884_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10881_.size()),_10881_.begin(),_10881_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,_10884_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3509_a2)->size(0))),(int32_t)((int)((_3509_a2)->size(1)))}));
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:434:6-187
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( std::shared_ptr< monty::ndarray< double,1 > > _3512_a1) { return mosek::fusion::p_Domain::greaterThan(_3512_a1); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(std::shared_ptr< monty::ndarray< double,1 > > _3512_a1)
{
  _checked_ptr_1<double> _ptr__3512_a1(_3512_a1 ? _3512_a1->raw() : nullptr, _3512_a1 ? _3512_a1->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,::mosek::fusion::Utils::Tools::arraycopy(_3512_a1),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3512_a1)->size(0)))}));
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:433:6-184
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( double _3513_b,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3514_dims) { return mosek::fusion::p_Domain::greaterThan(_3513_b,_3514_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(double _3513_b,std::shared_ptr< monty::ndarray< int32_t,1 > > _3514_dims)
{
  _checked_ptr_1<int32_t> _ptr__3514_dims(_3514_dims ? _3514_dims->raw() : nullptr, _3514_dims ? _3514_dims->size(0) : 0);
  std::vector<double> _10885_;
  for (int64_t _3515_i = (int)0, _10886_ = ::mosek::fusion::p_Domain::prod(_3514_dims); _3515_i < _10886_ ; ++_3515_i)
  {
    _10885_.push_back(_3513_b);
  }
  auto _10887_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10885_.size()),_10885_.begin(),_10885_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,_10887_,_3514_dims);
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:432:6-183
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( double _3516_b,
    int32_t _3517_m,
    int32_t _3518_n) { return mosek::fusion::p_Domain::greaterThan(_3516_b,_3517_m,_3518_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(double _3516_b,int32_t _3517_m,int32_t _3518_n)
{
  std::vector<double> _10888_;
  for (int32_t _3519_i = (int)0, _10889_ = safe_mul( _3518_n,_3517_m ); _3519_i < _10889_ ; ++_3519_i)
  {
    _10888_.push_back(_3516_b);
  }
  auto _10890_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10888_.size()),_10888_.begin(),_10888_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,_10890_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3517_m),(int32_t)(_3518_n)}));
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:431:6-179
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( double _3520_b,
    int32_t _3521_n) { return mosek::fusion::p_Domain::greaterThan(_3520_b,_3521_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(double _3520_b,int32_t _3521_n)
{
  std::vector<double> _10891_;
  for (int32_t _3522_i = (int)0, _10892_ = _3521_n; _3522_i < _10892_ ; ++_3522_i)
  {
    _10891_.push_back(_3520_b);
  }
  auto _10893_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10891_.size()),_10891_.begin(),_10891_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,false,_10893_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3521_n)}));
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.greaterThan
// Method mosek.fusion.Domain.greaterThan @ bld/docker-win/final/default/src/fusion/domain.mbi:430:6-161
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::greaterThan
  ( double _3523_b) { return mosek::fusion::p_Domain::greaterThan(_3523_b); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::greaterThan(double _3523_b)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::GreaterThan,true,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3523_b)}),nullptr);
}
// End mosek.fusion.Domain.greaterThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:428:6-135
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _3524_mx) { return mosek::fusion::p_Domain::lessThan(_3524_mx); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(monty::rc_ptr< ::mosek::fusion::Matrix > _3524_mx)
{
  return ::mosek::fusion::p_Domain::mkLinearDomain(::mosek::fusion::RelationKey::LessThan,_3524_mx);
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:427:6-177
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( std::shared_ptr< monty::ndarray< double,1 > > _3525_a1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3526_dims) { return mosek::fusion::p_Domain::lessThan(_3525_a1,_3526_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(std::shared_ptr< monty::ndarray< double,1 > > _3525_a1,std::shared_ptr< monty::ndarray< int32_t,1 > > _3526_dims)
{
  _checked_ptr_1<double> _ptr__3525_a1(_3525_a1 ? _3525_a1->raw() : nullptr, _3525_a1 ? _3525_a1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3526_dims(_3526_dims ? _3526_dims->raw() : nullptr, _3526_dims ? _3526_dims->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,::mosek::fusion::Utils::Tools::arraycopy(_3525_a1),_3526_dims);
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:426:6-230
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( std::shared_ptr< monty::ndarray< double,2 > > _3527_a2) { return mosek::fusion::p_Domain::lessThan(_3527_a2); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(std::shared_ptr< monty::ndarray< double,2 > > _3527_a2)
{
  std::vector<double> _10894_;
  for (int32_t _3528_i = (int)0, _10895_ = (int)((_3527_a2)->size(0)); _3528_i < _10895_ ; ++_3528_i)
  {
    for (int32_t _3529_j = (int)0, _10896_ = (int)((_3527_a2)->size(1)); _3529_j < _10896_ ; ++_3529_j)
    {
      _10894_.push_back(((*_3527_a2)(_3528_i,_3529_j)));
    }
  }
  auto _10897_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10894_.size()),_10894_.begin(),_10894_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,_10897_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3527_a2)->size(0))),(int32_t)((int)((_3527_a2)->size(1)))}));
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:425:6-187
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( std::shared_ptr< monty::ndarray< double,1 > > _3530_a1) { return mosek::fusion::p_Domain::lessThan(_3530_a1); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(std::shared_ptr< monty::ndarray< double,1 > > _3530_a1)
{
  _checked_ptr_1<double> _ptr__3530_a1(_3530_a1 ? _3530_a1->raw() : nullptr, _3530_a1 ? _3530_a1->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,::mosek::fusion::Utils::Tools::arraycopy(_3530_a1),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3530_a1)->size(0)))}));
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:424:6-160
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( double _3531_b,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3532_dims) { return mosek::fusion::p_Domain::lessThan(_3531_b,_3532_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(double _3531_b,std::shared_ptr< monty::ndarray< int32_t,1 > > _3532_dims)
{
  _checked_ptr_1<int32_t> _ptr__3532_dims(_3532_dims ? _3532_dims->raw() : nullptr, _3532_dims ? _3532_dims->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3531_b)}),_3532_dims);
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:423:6-166
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( double _3533_b,
    int32_t _3534_m,
    int32_t _3535_n) { return mosek::fusion::p_Domain::lessThan(_3533_b,_3534_m,_3535_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(double _3533_b,int32_t _3534_m,int32_t _3535_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3533_b)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3534_m),(int32_t)(_3535_n)}));
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:422:6-164
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( double _3536_b,
    int32_t _3537_n) { return mosek::fusion::p_Domain::lessThan(_3536_b,_3537_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(double _3536_b,int32_t _3537_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3536_b)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3537_n)}));
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.lessThan
// Method mosek.fusion.Domain.lessThan @ bld/docker-win/final/default/src/fusion/domain.mbi:421:6-159
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::lessThan
  ( double _3538_b) { return mosek::fusion::p_Domain::lessThan(_3538_b); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::lessThan(double _3538_b)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::LessThan,true,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3538_b)}),nullptr);
}
// End mosek.fusion.Domain.lessThan

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:418:6-137
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _3539_mx) { return mosek::fusion::p_Domain::equalsTo(_3539_mx); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(monty::rc_ptr< ::mosek::fusion::Matrix > _3539_mx)
{
  return ::mosek::fusion::p_Domain::mkLinearDomain(::mosek::fusion::RelationKey::EqualsTo,_3539_mx);
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:417:6-177
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( std::shared_ptr< monty::ndarray< double,1 > > _3540_a1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3541_dims) { return mosek::fusion::p_Domain::equalsTo(_3540_a1,_3541_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(std::shared_ptr< monty::ndarray< double,1 > > _3540_a1,std::shared_ptr< monty::ndarray< int32_t,1 > > _3541_dims)
{
  _checked_ptr_1<double> _ptr__3540_a1(_3540_a1 ? _3540_a1->raw() : nullptr, _3540_a1 ? _3540_a1->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3541_dims(_3541_dims ? _3541_dims->raw() : nullptr, _3541_dims ? _3541_dims->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,::mosek::fusion::Utils::Tools::arraycopy(_3540_a1),_3541_dims);
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:416:6-230
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( std::shared_ptr< monty::ndarray< double,2 > > _3542_a2) { return mosek::fusion::p_Domain::equalsTo(_3542_a2); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(std::shared_ptr< monty::ndarray< double,2 > > _3542_a2)
{
  std::vector<double> _10898_;
  for (int32_t _3543_i = (int)0, _10899_ = (int)((_3542_a2)->size(0)); _3543_i < _10899_ ; ++_3543_i)
  {
    for (int32_t _3544_j = (int)0, _10900_ = (int)((_3542_a2)->size(1)); _3544_j < _10900_ ; ++_3544_j)
    {
      _10898_.push_back(((*_3542_a2)(_3543_i,_3544_j)));
    }
  }
  auto _10901_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_10898_.size()),_10898_.begin(),_10898_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,_10901_,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3542_a2)->size(0))),(int32_t)((int)((_3542_a2)->size(1)))}));
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:415:6-187
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( std::shared_ptr< monty::ndarray< double,1 > > _3545_a1) { return mosek::fusion::p_Domain::equalsTo(_3545_a1); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(std::shared_ptr< monty::ndarray< double,1 > > _3545_a1)
{
  _checked_ptr_1<double> _ptr__3545_a1(_3545_a1 ? _3545_a1->raw() : nullptr, _3545_a1 ? _3545_a1->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,::mosek::fusion::Utils::Tools::arraycopy(_3545_a1),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_3545_a1)->size(0)))}));
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:414:6-160
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( double _3546_b,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3547_dims) { return mosek::fusion::p_Domain::equalsTo(_3546_b,_3547_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(double _3546_b,std::shared_ptr< monty::ndarray< int32_t,1 > > _3547_dims)
{
  _checked_ptr_1<int32_t> _ptr__3547_dims(_3547_dims ? _3547_dims->raw() : nullptr, _3547_dims ? _3547_dims->size(0) : 0);
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3546_b)}),_3547_dims);
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:413:6-166
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( double _3548_b,
    int32_t _3549_m,
    int32_t _3550_n) { return mosek::fusion::p_Domain::equalsTo(_3548_b,_3549_m,_3550_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(double _3548_b,int32_t _3549_m,int32_t _3550_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3548_b)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3549_m),(int32_t)(_3550_n)}));
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:412:6-164
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( double _3551_b,
    int32_t _3552_n) { return mosek::fusion::p_Domain::equalsTo(_3551_b,_3552_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(double _3551_b,int32_t _3552_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,false,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3551_b)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3552_n)}));
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.equalsTo
// Method mosek.fusion.Domain.equalsTo @ bld/docker-win/final/default/src/fusion/domain.mbi:411:6-159
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::equalsTo
  ( double _3553_b) { return mosek::fusion::p_Domain::equalsTo(_3553_b); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::equalsTo(double _3553_b)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::EqualsTo,true,std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >{(double)(_3553_b)}),nullptr);
}
// End mosek.fusion.Domain.equalsTo

// Begin mosek.fusion.Domain.unbounded
// Method mosek.fusion.Domain.unbounded @ bld/docker-win/final/default/src/fusion/domain.mbi:408:6-188
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::unbounded
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3554_dims) { return mosek::fusion::p_Domain::unbounded(_3554_dims); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::unbounded(std::shared_ptr< monty::ndarray< int32_t,1 > > _3554_dims)
{
  _checked_ptr_1<int32_t> _ptr__3554_dims(_3554_dims ? _3554_dims->raw() : nullptr, _3554_dims ? _3554_dims->size(0) : 0);
  std::vector<int32_t> _10902_;
  for (int32_t _3555_i = (int)0, _10903_ = (int)((_3554_dims)->size(0)); _3555_i < _10903_ ; ++_3555_i)
  {
    _10902_.push_back(_ptr__3554_dims[_3555_i]);
  }
  auto _10904_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10902_.size()),_10902_.begin(),_10902_.end()));
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::IsFree,false,nullptr,_10904_);
}
// End mosek.fusion.Domain.unbounded

// Begin mosek.fusion.Domain.unbounded
// Method mosek.fusion.Domain.unbounded @ bld/docker-win/final/default/src/fusion/domain.mbi:407:6-163
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::unbounded
  ( int32_t _3556_m,
    int32_t _3557_n) { return mosek::fusion::p_Domain::unbounded(_3556_m,_3557_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::unbounded(int32_t _3556_m,int32_t _3557_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::IsFree,false,nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3556_m),(int32_t)(_3557_n)}));
}
// End mosek.fusion.Domain.unbounded

// Begin mosek.fusion.Domain.unbounded
// Method mosek.fusion.Domain.unbounded @ bld/docker-win/final/default/src/fusion/domain.mbi:406:6-161
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::unbounded
  ( int32_t _3558_n) { return mosek::fusion::p_Domain::unbounded(_3558_n); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::unbounded(int32_t _3558_n)
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::IsFree,false,nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3558_n)}));
}
// End mosek.fusion.Domain.unbounded

// Begin mosek.fusion.Domain.unbounded
// Method mosek.fusion.Domain.unbounded @ bld/docker-win/final/default/src/fusion/domain.mbi:405:6-156
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::Domain::unbounded
  ( ) { return mosek::fusion::p_Domain::unbounded(); }
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::p_Domain::unbounded()
{
  return ::mosek::fusion::p_LinearDomain::_new_LinearDomain(::mosek::fusion::RelationKey::IsFree,true,nullptr,nullptr);
}
// End mosek.fusion.Domain.unbounded

void mosek::fusion::p_Domain::destroy()
{
}
void mosek::fusion::Domain::destroy() { mosek::fusion::p_Domain::_get_impl(this)->destroy(); }
// } class Domain
// class ExprCode { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:3097:4-3217:5
mosek::fusion::ExprCode::ExprCode(mosek::fusion::p_ExprCode *_impl) : _impl(_impl) { /*std::cout << "ExprCode() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ExprCode::~ExprCode() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ExprCode::p_ExprCode
  (::mosek::fusion::ExprCode * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.ExprCode.inplace_relocate
// Method mosek.fusion.ExprCode.inplace_relocate @ bld/docker-win/final/default/src/fusion/Parameter.monty:3211:6-3216:7
void mosek::fusion::ExprCode::inplace_relocate
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3559_code,
    int32_t _3560_from_offset,
    int32_t _3561_num,
    int32_t _3562_const_base) { mosek::fusion::p_ExprCode::inplace_relocate(_3559_code,_3560_from_offset,_3561_num,_3562_const_base); }
void mosek::fusion::p_ExprCode::inplace_relocate(std::shared_ptr< monty::ndarray< int32_t,1 > > _3559_code,int32_t _3560_from_offset,int32_t _3561_num,int32_t _3562_const_base)
{
  _checked_ptr_1<int32_t> _ptr__3559_code(_3559_code ? _3559_code->raw() : nullptr, _3559_code ? _3559_code->size(0) : 0);
  int32_t _10905_ = (int)0;
  int32_t _10906_ = _3561_num;
  int32_t _10907_ = (int)2;
  for (int32_t _3563_i = _10905_; _3563_i < _10906_; _3563_i += _10907_)
  {
    {
      if ((_ptr__3559_code[_3563_i] == (int)2))
      {
        {
          _ptr__3559_code[safe_add( _3563_i,(int)1 )] += _3562_const_base;
        }
      }
      {}
    }
  }
}
// End mosek.fusion.ExprCode.inplace_relocate

// Begin mosek.fusion.ExprCode.op2str
// Method mosek.fusion.ExprCode.op2str @ bld/docker-win/final/default/src/fusion/Parameter.monty:3198:6-3208:7
std::string mosek::fusion::ExprCode::op2str
  ( int32_t _3564_op) { return mosek::fusion::p_ExprCode::op2str(_3564_op); }
std::string mosek::fusion::p_ExprCode::op2str(int32_t _3564_op)
{
  if ((_3564_op == 0))
  {
    {
      return std::string ("NOP");
    }
  }
  else if((_3564_op == 1))
  {
    {
      return std::string ("PARAMREF");
    }
  }
  else if((_3564_op == 2))
  {
    {
      return std::string ("CONST");
    }
  }
  else if((_3564_op == 3))
  {
    {
      return std::string ("ADD");
    }
  }
  else if((_3564_op == 4))
  {
    {
      return std::string ("NEG");
    }
  }
  else if((_3564_op == 5))
  {
    {
      return std::string ("MUL");
    }
  }
  else if((_3564_op == 6))
  {
    {
      return std::string ("INV");
    }
  }
  else if((_3564_op == 8))
  {
    {
      return std::string ("SUM");
    }
  }
  else
  {
    {
      return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("?("))->__mosek_2fusion_2Utils_2StringBuffer__a(_3564_op)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
    }
  }
}
// End mosek.fusion.ExprCode.op2str

// Begin mosek.fusion.ExprCode.eval_add_list
// Method mosek.fusion.ExprCode.eval_add_list @ bld/docker-win/final/default/src/fusion/Parameter.monty:3144:6-3195:7
void mosek::fusion::ExprCode::eval_add_list
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3565_code,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3566_ptr,
    std::shared_ptr< monty::ndarray< double,1 > > _3567_consts,
    int32_t _3568_offset,
    std::shared_ptr< monty::ndarray< double,1 > > _3569_target,
    std::shared_ptr< monty::ndarray< double,1 > > _3570_P,
    monty::rc_ptr< ::mosek::fusion::WorkStack > _3571_xs) { mosek::fusion::p_ExprCode::eval_add_list(_3565_code,_3566_ptr,_3567_consts,_3568_offset,_3569_target,_3570_P,_3571_xs); }
void mosek::fusion::p_ExprCode::eval_add_list(std::shared_ptr< monty::ndarray< int32_t,1 > > _3565_code,std::shared_ptr< monty::ndarray< int32_t,1 > > _3566_ptr,std::shared_ptr< monty::ndarray< double,1 > > _3567_consts,int32_t _3568_offset,std::shared_ptr< monty::ndarray< double,1 > > _3569_target,std::shared_ptr< monty::ndarray< double,1 > > _3570_P,monty::rc_ptr< ::mosek::fusion::WorkStack > _3571_xs)
{
  _checked_ptr_1<int32_t> _ptr__3565_code(_3565_code ? _3565_code->raw() : nullptr, _3565_code ? _3565_code->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3566_ptr(_3566_ptr ? _3566_ptr->raw() : nullptr, _3566_ptr ? _3566_ptr->size(0) : 0);
  _checked_ptr_1<double> _ptr__3567_consts(_3567_consts ? _3567_consts->raw() : nullptr, _3567_consts ? _3567_consts->size(0) : 0);
  _checked_ptr_1<double> _ptr__3569_target(_3569_target ? _3569_target->raw() : nullptr, _3569_target ? _3569_target->size(0) : 0);
  _checked_ptr_1<double> _ptr__3570_P(_3570_P ? _3570_P->raw() : nullptr, _3570_P ? _3570_P->size(0) : 0);
  int32_t _3572_stack = _3571_xs->allocf64((int)((_3565_code)->size(0)));
  int32_t _3573_stackp = (int)0;
  std::shared_ptr< monty::ndarray< double,1 > > _3574_xf64 = mosek::fusion::p_WorkStack::_get_impl(_3571_xs)->f64;
  _checked_ptr_1<double> _ptr__3574_xf64(_3574_xf64 ? _3574_xf64->raw() : nullptr,_3574_xf64 ? _3574_xf64->size(0) : 0);
  int32_t _10908_ = (int)0;
  int32_t _10909_ = ((int)((_3566_ptr)->size(0)) - (int)1);
  for (int32_t _3575_i = _10908_; _3575_i < _10909_; ++_3575_i)
  {
    {
      int32_t _10910_ = _ptr__3566_ptr[_3575_i];
      int32_t _10911_ = _ptr__3566_ptr[safe_add( _3575_i,(int)1 )];
      int32_t _10912_ = (int)2;
      for (int32_t _3576_j = _10910_; _3576_j < _10911_; _3576_j += _10912_)
      {
        {
          if ((_ptr__3565_code[_3576_j] == 0))
          {
            {
            }
          }
          else if((_ptr__3565_code[_3576_j] == 1))
          {
            {
              _ptr__3574_xf64[safe_add( _3572_stack,_3573_stackp )] = _ptr__3570_P[_ptr__3565_code[safe_add( _3576_j,(int)1 )]];
              ++ _3573_stackp;
            }
          }
          else if((_ptr__3565_code[_3576_j] == 2))
          {
            {
              _ptr__3574_xf64[safe_add( _3572_stack,_3573_stackp )] = _ptr__3567_consts[(_3576_j / (int)2)];
              ++ _3573_stackp;
            }
          }
          else if((_ptr__3565_code[_3576_j] == 3))
          {
            {
              _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)2)] = (_ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)] + _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)2)]);
              -- _3573_stackp;
            }
          }
          else if((_ptr__3565_code[_3576_j] == 4))
          {
            {
              _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)] = (-_ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)]);
            }
          }
          else if((_ptr__3565_code[_3576_j] == 5))
          {
            {
              _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)2)] = (_ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)] * _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)2)]);
              -- _3573_stackp;
            }
          }
          else if((_ptr__3565_code[_3576_j] == 6))
          {
            {
              _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)] = (1.0 / _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)]);
            }
          }
          else if((_ptr__3565_code[_3576_j] == 8))
          {
            {
              double _3577_r = 0.0;
              int32_t _10913_ = (int)0;
              int32_t _10914_ = _ptr__3565_code[safe_add( _3576_j,(int)1 )];
              for (int32_t _3578_k = _10913_; _3578_k < _10914_; ++_3578_k)
              {
                {
                  -- _3573_stackp;
                  _3577_r += _ptr__3574_xf64[safe_add( _3572_stack,_3573_stackp )];
                }
              }
              _ptr__3574_xf64[safe_add( _3572_stack,_3573_stackp )] = _3577_r;
              ++ _3573_stackp;
            }
          }
          {}
        }
      }
      _ptr__3569_target[safe_add( _3568_offset,_3575_i )] += _ptr__3574_xf64[(safe_add( _3572_stack,_3573_stackp ) - (int)1)];
    }
  }
  _3571_xs->clear();
}
// End mosek.fusion.ExprCode.eval_add_list

// Begin mosek.fusion.ExprCode.eval_add_list
// Method mosek.fusion.ExprCode.eval_add_list @ bld/docker-win/final/default/src/fusion/Parameter.monty:3140:6-3142:7
void mosek::fusion::ExprCode::eval_add_list
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3579_code,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _3580_ptr,
    std::shared_ptr< monty::ndarray< double,1 > > _3581_consts,
    std::shared_ptr< monty::ndarray< double,1 > > _3582_target,
    std::shared_ptr< monty::ndarray< double,1 > > _3583_P,
    monty::rc_ptr< ::mosek::fusion::WorkStack > _3584_xs) { mosek::fusion::p_ExprCode::eval_add_list(_3579_code,_3580_ptr,_3581_consts,_3582_target,_3583_P,_3584_xs); }
void mosek::fusion::p_ExprCode::eval_add_list(std::shared_ptr< monty::ndarray< int32_t,1 > > _3579_code,std::shared_ptr< monty::ndarray< int32_t,1 > > _3580_ptr,std::shared_ptr< monty::ndarray< double,1 > > _3581_consts,std::shared_ptr< monty::ndarray< double,1 > > _3582_target,std::shared_ptr< monty::ndarray< double,1 > > _3583_P,monty::rc_ptr< ::mosek::fusion::WorkStack > _3584_xs)
{
  _checked_ptr_1<int32_t> _ptr__3579_code(_3579_code ? _3579_code->raw() : nullptr, _3579_code ? _3579_code->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3580_ptr(_3580_ptr ? _3580_ptr->raw() : nullptr, _3580_ptr ? _3580_ptr->size(0) : 0);
  _checked_ptr_1<double> _ptr__3581_consts(_3581_consts ? _3581_consts->raw() : nullptr, _3581_consts ? _3581_consts->size(0) : 0);
  _checked_ptr_1<double> _ptr__3582_target(_3582_target ? _3582_target->raw() : nullptr, _3582_target ? _3582_target->size(0) : 0);
  _checked_ptr_1<double> _ptr__3583_P(_3583_P ? _3583_P->raw() : nullptr, _3583_P ? _3583_P->size(0) : 0);
  ::mosek::fusion::p_ExprCode::eval_add_list(_3579_code,_3580_ptr,_3581_consts,(int)0,_3582_target,_3583_P,_3584_xs);
}
// End mosek.fusion.ExprCode.eval_add_list

// Begin mosek.fusion.ExprCode.emit_sum
// Method mosek.fusion.ExprCode.emit_sum @ bld/docker-win/final/default/src/fusion/Parameter.monty:3133:6-3137:7
int32_t mosek::fusion::ExprCode::emit_sum
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3585_tgt,
    int32_t _3586_ofs,
    int32_t _3587_num) { return mosek::fusion::p_ExprCode::emit_sum(_3585_tgt,_3586_ofs,_3587_num); }
int32_t mosek::fusion::p_ExprCode::emit_sum(std::shared_ptr< monty::ndarray< int32_t,1 > > _3585_tgt,int32_t _3586_ofs,int32_t _3587_num)
{
  _checked_ptr_1<int32_t> _ptr__3585_tgt(_3585_tgt ? _3585_tgt->raw() : nullptr, _3585_tgt ? _3585_tgt->size(0) : 0);
  _ptr__3585_tgt[_3586_ofs] = 8;
  _ptr__3585_tgt[safe_add( _3586_ofs,(int)1 )] = _3587_num;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_sum

// Begin mosek.fusion.ExprCode.emit_inv
// Method mosek.fusion.ExprCode.emit_inv @ bld/docker-win/final/default/src/fusion/Parameter.monty:3128:6-3132:7
int32_t mosek::fusion::ExprCode::emit_inv
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3588_tgt,
    int32_t _3589_ofs) { return mosek::fusion::p_ExprCode::emit_inv(_3588_tgt,_3589_ofs); }
int32_t mosek::fusion::p_ExprCode::emit_inv(std::shared_ptr< monty::ndarray< int32_t,1 > > _3588_tgt,int32_t _3589_ofs)
{
  _checked_ptr_1<int32_t> _ptr__3588_tgt(_3588_tgt ? _3588_tgt->raw() : nullptr, _3588_tgt ? _3588_tgt->size(0) : 0);
  _ptr__3588_tgt[_3589_ofs] = 6;
  _ptr__3588_tgt[safe_add( _3589_ofs,(int)1 )] = (int)0;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_inv

// Begin mosek.fusion.ExprCode.emit_mul
// Method mosek.fusion.ExprCode.emit_mul @ bld/docker-win/final/default/src/fusion/Parameter.monty:3123:6-3127:7
int32_t mosek::fusion::ExprCode::emit_mul
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3590_tgt,
    int32_t _3591_ofs) { return mosek::fusion::p_ExprCode::emit_mul(_3590_tgt,_3591_ofs); }
int32_t mosek::fusion::p_ExprCode::emit_mul(std::shared_ptr< monty::ndarray< int32_t,1 > > _3590_tgt,int32_t _3591_ofs)
{
  _checked_ptr_1<int32_t> _ptr__3590_tgt(_3590_tgt ? _3590_tgt->raw() : nullptr, _3590_tgt ? _3590_tgt->size(0) : 0);
  _ptr__3590_tgt[_3591_ofs] = 5;
  _ptr__3590_tgt[safe_add( _3591_ofs,(int)1 )] = (int)0;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_mul

// Begin mosek.fusion.ExprCode.emit_neg
// Method mosek.fusion.ExprCode.emit_neg @ bld/docker-win/final/default/src/fusion/Parameter.monty:3118:6-3122:7
int32_t mosek::fusion::ExprCode::emit_neg
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3592_tgt,
    int32_t _3593_ofs) { return mosek::fusion::p_ExprCode::emit_neg(_3592_tgt,_3593_ofs); }
int32_t mosek::fusion::p_ExprCode::emit_neg(std::shared_ptr< monty::ndarray< int32_t,1 > > _3592_tgt,int32_t _3593_ofs)
{
  _checked_ptr_1<int32_t> _ptr__3592_tgt(_3592_tgt ? _3592_tgt->raw() : nullptr, _3592_tgt ? _3592_tgt->size(0) : 0);
  _ptr__3592_tgt[_3593_ofs] = 4;
  _ptr__3592_tgt[safe_add( _3593_ofs,(int)1 )] = (int)0;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_neg

// Begin mosek.fusion.ExprCode.emit_add
// Method mosek.fusion.ExprCode.emit_add @ bld/docker-win/final/default/src/fusion/Parameter.monty:3113:6-3117:7
int32_t mosek::fusion::ExprCode::emit_add
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3594_tgt,
    int32_t _3595_ofs) { return mosek::fusion::p_ExprCode::emit_add(_3594_tgt,_3595_ofs); }
int32_t mosek::fusion::p_ExprCode::emit_add(std::shared_ptr< monty::ndarray< int32_t,1 > > _3594_tgt,int32_t _3595_ofs)
{
  _checked_ptr_1<int32_t> _ptr__3594_tgt(_3594_tgt ? _3594_tgt->raw() : nullptr, _3594_tgt ? _3594_tgt->size(0) : 0);
  _ptr__3594_tgt[_3595_ofs] = 3;
  _ptr__3594_tgt[safe_add( _3595_ofs,(int)1 )] = (int)0;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_add

// Begin mosek.fusion.ExprCode.emit_constref
// Method mosek.fusion.ExprCode.emit_constref @ bld/docker-win/final/default/src/fusion/Parameter.monty:3108:6-3112:7
int32_t mosek::fusion::ExprCode::emit_constref
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3596_tgt,
    int32_t _3597_ofs,
    int32_t _3598_i) { return mosek::fusion::p_ExprCode::emit_constref(_3596_tgt,_3597_ofs,_3598_i); }
int32_t mosek::fusion::p_ExprCode::emit_constref(std::shared_ptr< monty::ndarray< int32_t,1 > > _3596_tgt,int32_t _3597_ofs,int32_t _3598_i)
{
  _checked_ptr_1<int32_t> _ptr__3596_tgt(_3596_tgt ? _3596_tgt->raw() : nullptr, _3596_tgt ? _3596_tgt->size(0) : 0);
  _ptr__3596_tgt[_3597_ofs] = 2;
  _ptr__3596_tgt[safe_add( _3597_ofs,(int)1 )] = _3598_i;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_constref

// Begin mosek.fusion.ExprCode.emit_paramref
// Method mosek.fusion.ExprCode.emit_paramref @ bld/docker-win/final/default/src/fusion/Parameter.monty:3103:6-3107:7
int32_t mosek::fusion::ExprCode::emit_paramref
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3599_tgt,
    int32_t _3600_ofs,
    int32_t _3601_i) { return mosek::fusion::p_ExprCode::emit_paramref(_3599_tgt,_3600_ofs,_3601_i); }
int32_t mosek::fusion::p_ExprCode::emit_paramref(std::shared_ptr< monty::ndarray< int32_t,1 > > _3599_tgt,int32_t _3600_ofs,int32_t _3601_i)
{
  _checked_ptr_1<int32_t> _ptr__3599_tgt(_3599_tgt ? _3599_tgt->raw() : nullptr, _3599_tgt ? _3599_tgt->size(0) : 0);
  _ptr__3599_tgt[_3600_ofs] = 1;
  _ptr__3599_tgt[safe_add( _3600_ofs,(int)1 )] = _3601_i;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_paramref

// Begin mosek.fusion.ExprCode.emit_nop
// Method mosek.fusion.ExprCode.emit_nop @ bld/docker-win/final/default/src/fusion/Parameter.monty:3098:6-3102:7
int32_t mosek::fusion::ExprCode::emit_nop
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _3602_tgt,
    int32_t _3603_ofs) { return mosek::fusion::p_ExprCode::emit_nop(_3602_tgt,_3603_ofs); }
int32_t mosek::fusion::p_ExprCode::emit_nop(std::shared_ptr< monty::ndarray< int32_t,1 > > _3602_tgt,int32_t _3603_ofs)
{
  _checked_ptr_1<int32_t> _ptr__3602_tgt(_3602_tgt ? _3602_tgt->raw() : nullptr, _3602_tgt ? _3602_tgt->size(0) : 0);
  _ptr__3602_tgt[_3603_ofs] = 0;
  _ptr__3602_tgt[safe_add( _3603_ofs,(int)1 )] = (int)0;
  return (int)2;
}
// End mosek.fusion.ExprCode.emit_nop

void mosek::fusion::p_ExprCode::destroy()
{
}
void mosek::fusion::ExprCode::destroy() { mosek::fusion::p_ExprCode::_get_impl(this)->destroy(); }
// } class ExprCode
// class ExprParameter { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:3077:4-3094:5
mosek::fusion::ExprParameter::ExprParameter(mosek::fusion::p_ExprParameter *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprParameter()" << this << std::endl; */ }
mosek::fusion::ExprParameter::~ExprParameter() {  /* std::cout << "~ExprParameter()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprParameter::p_ExprParameter
  (::mosek::fusion::ExprParameter * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprParameter.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:3081:6-3084:7
mosek::fusion::ExprParameter::t mosek::fusion::p_ExprParameter::_new_ExprParameter
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3604_p)
{ return new mosek::fusion::ExprParameter(_3604_p); }
mosek::fusion::ExprParameter::ExprParameter
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3604_p) : 
   ExprParameter(new mosek::fusion::p_ExprParameter(this))
{ mosek::fusion::p_ExprParameter::_get_impl(this)->_initialize(_3604_p); }
void mosek::fusion::p_ExprParameter::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _3604_p)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_3604_p->getShape());
    mosek::fusion::p_ExprParameter::_get_impl(::mosek::fusion::ExprParameter::t(_pubthis))->p = _3604_p;
  }
}
// mosek.fusion.ExprParameter.ctor

// Begin mosek.fusion.ExprParameter.eval
// Method mosek.fusion.ExprParameter.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:3091:6-3093:7
void mosek::fusion::ExprParameter :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3605_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3606_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3607_xs) { mosek::fusion::p_ExprParameter::_get_impl(this)->eval(_3605_rs,_3606_ws,_3607_xs); }
void mosek::fusion::p_ExprParameter::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3605_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3606_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3607_xs)
{
  p->eval(_3605_rs,_3606_ws,_3607_xs);
}
// End mosek.fusion.ExprParameter.eval

// Begin mosek.fusion.ExprParameter.slice
// Method mosek.fusion.ExprParameter.slice @ bld/docker-win/final/default/src/fusion/Parameter.monty:3089:6-116
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter :: __mosek_2fusion_2ExprParameter__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3608_start,std::shared_ptr< monty::ndarray< int32_t,1 > > _3609_stop) { return mosek::fusion::p_ExprParameter::_get_impl(this)->__mosek_2fusion_2ExprParameter__slice(_3608_start,_3609_stop); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3608_start,std::shared_ptr< monty::ndarray< int32_t,1 > > _3609_stop) { return __mosek_2fusion_2ExprParameter__slice(_3608_start,_3609_stop); }
/* override: mosek.fusion.BaseExpression.slice*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter::__mosek_2fusion_2BaseExpression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3608_start,std::shared_ptr< monty::ndarray< int32_t,1 > > _3609_stop) { return __mosek_2fusion_2ExprParameter__slice(_3608_start,_3609_stop); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_ExprParameter::__mosek_2fusion_2ExprParameter__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _3608_start,std::shared_ptr< monty::ndarray< int32_t,1 > > _3609_stop)
{
  _checked_ptr_1<int32_t> _ptr__3608_start(_3608_start ? _3608_start->raw() : nullptr, _3608_start ? _3608_start->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__3609_stop(_3609_stop ? _3609_stop->raw() : nullptr, _3609_stop ? _3609_stop->size(0) : 0);
  return (::mosek::fusion::p_ExprParameter::_new_ExprParameter(p->__mosek_2fusion_2Parameter__slice(_3608_start,_3609_stop))).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.ExprParameter.slice

// Begin mosek.fusion.ExprParameter.slice
// Method mosek.fusion.ExprParameter.slice @ bld/docker-win/final/default/src/fusion/Parameter.monty:3088:6-112
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter :: __mosek_2fusion_2ExprParameter__slice(int32_t _3610_start,int32_t _3611_stop) { return mosek::fusion::p_ExprParameter::_get_impl(this)->__mosek_2fusion_2ExprParameter__slice(_3610_start,_3611_stop); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter::slice(int32_t _3610_start,int32_t _3611_stop) { return __mosek_2fusion_2ExprParameter__slice(_3610_start,_3611_stop); }
/* override: mosek.fusion.BaseExpression.slice*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprParameter::__mosek_2fusion_2BaseExpression__slice(int32_t _3610_start,int32_t _3611_stop) { return __mosek_2fusion_2ExprParameter__slice(_3610_start,_3611_stop); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_ExprParameter::__mosek_2fusion_2ExprParameter__slice(int32_t _3610_start,int32_t _3611_stop)
{
  return (::mosek::fusion::p_ExprParameter::_new_ExprParameter(p->__mosek_2fusion_2Parameter__slice(_3610_start,_3611_stop))).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.ExprParameter.slice

// Begin mosek.fusion.ExprParameter.toString
// Method mosek.fusion.ExprParameter.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:3086:6-128
std::string mosek::fusion::ExprParameter :: toString() { return mosek::fusion::p_ExprParameter::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprParameter::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprParameter("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprParameter.toString

void mosek::fusion::p_ExprParameter::destroy()
{
  p.reset();
}
void mosek::fusion::ExprParameter::destroy() { mosek::fusion::p_ExprParameter::_get_impl(this)->destroy(); }
// } class ExprParameter
// class Param { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:2951:4-3074:5
mosek::fusion::Param::Param(mosek::fusion::p_Param *_impl) : _impl(_impl) { /*std::cout << "Param() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Param::~Param() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Param::p_Param
  (::mosek::fusion::Param * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Param.repeat
// Method mosek.fusion.Param.repeat @ bld/docker-win/final/default/src/fusion/Parameter.monty:3073:6-122
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::repeat
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _3612_p,
    int32_t _3613_n,
    int32_t _3614_dim) { return mosek::fusion::p_Param::repeat(_3612_p,_3613_n,_3614_dim); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::repeat(monty::rc_ptr< ::mosek::fusion::Parameter > _3612_p,int32_t _3613_n,int32_t _3614_dim)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Parameter >> _10915_;
  for (int32_t _3615_i = (int)0, _10916_ = _3613_n; _3615_i < _10916_ ; ++_3615_i)
  {
    _10915_.push_back(_3612_p);
  }
  auto _10917_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >(monty::shape(_10915_.size()),_10915_.begin(),_10915_.end()));
  return ::mosek::fusion::p_Param::stack(_3614_dim,_10917_);
}
// End mosek.fusion.Param.repeat

// Begin mosek.fusion.Param.stack
// Method mosek.fusion.Param.stack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3072:6-136
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::stack
  ( int32_t _3616_dim,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3617_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3618_p2,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3619_p3) { return mosek::fusion::p_Param::stack(_3616_dim,_3617_p1,_3618_p2,_3619_p3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::stack(int32_t _3616_dim,monty::rc_ptr< ::mosek::fusion::Parameter > _3617_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3618_p2,monty::rc_ptr< ::mosek::fusion::Parameter > _3619_p3)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3617_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3618_p2.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3619_p3.get())}),_3616_dim);
}
// End mosek.fusion.Param.stack

// Begin mosek.fusion.Param.stack
// Method mosek.fusion.Param.stack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3071:6-119
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::stack
  ( int32_t _3620_dim,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3621_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3622_p2) { return mosek::fusion::p_Param::stack(_3620_dim,_3621_p1,_3622_p2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::stack(int32_t _3620_dim,monty::rc_ptr< ::mosek::fusion::Parameter > _3621_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3622_p2)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3621_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3622_p2.get())}),_3620_dim);
}
// End mosek.fusion.Param.stack

// Begin mosek.fusion.Param.stack
// Method mosek.fusion.Param.stack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3070:6-95
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::stack
  ( int32_t _3623_dim,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3624_p) { return mosek::fusion::p_Param::stack(_3623_dim,_3624_p); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::stack(int32_t _3623_dim,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3624_p)
{
  return ::mosek::fusion::p_Param::dstack(_3624_p,_3623_dim);
}
// End mosek.fusion.Param.stack

// Begin mosek.fusion.Param.stack
// Method mosek.fusion.Param.stack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3069:6-119
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::stack
  ( std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >,1 > > _3625_p) { return mosek::fusion::p_Param::stack(_3625_p); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::stack(std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >,1 > > _3625_p)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Parameter >> _10918_;
  for (int32_t _3626_i = (int)0, _10919_ = (int)((_3625_p)->size(0)); _3626_i < _10919_ ; ++_3626_i)
  {
    _10918_.push_back(::mosek::fusion::p_Param::hstack(((*_3625_p)(_3626_i))));
  }
  auto _10920_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >(monty::shape(_10918_.size()),_10918_.begin(),_10918_.end()));
  return ::mosek::fusion::p_Param::vstack(_10920_);
}
// End mosek.fusion.Param.stack

// Begin mosek.fusion.Param.hstack
// Method mosek.fusion.Param.hstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3068:6-123
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::hstack
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _3627_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3628_p2,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3629_p3) { return mosek::fusion::p_Param::hstack(_3627_p1,_3628_p2,_3629_p3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::hstack(monty::rc_ptr< ::mosek::fusion::Parameter > _3627_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3628_p2,monty::rc_ptr< ::mosek::fusion::Parameter > _3629_p3)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3627_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3628_p2.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3629_p3.get())}),(int)1);
}
// End mosek.fusion.Param.hstack

// Begin mosek.fusion.Param.hstack
// Method mosek.fusion.Param.hstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3067:6-107
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::hstack
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _3630_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3631_p2) { return mosek::fusion::p_Param::hstack(_3630_p1,_3631_p2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::hstack(monty::rc_ptr< ::mosek::fusion::Parameter > _3630_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3631_p2)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3630_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3631_p2.get())}),(int)1);
}
// End mosek.fusion.Param.hstack

// Begin mosek.fusion.Param.hstack
// Method mosek.fusion.Param.hstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3066:6-83
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::hstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3632_p) { return mosek::fusion::p_Param::hstack(_3632_p); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::hstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3632_p)
{
  return ::mosek::fusion::p_Param::dstack(_3632_p,(int)1);
}
// End mosek.fusion.Param.hstack

// Begin mosek.fusion.Param.vstack
// Method mosek.fusion.Param.vstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3065:6-123
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::vstack
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _3633_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3634_p2,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3635_p3) { return mosek::fusion::p_Param::vstack(_3633_p1,_3634_p2,_3635_p3); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::vstack(monty::rc_ptr< ::mosek::fusion::Parameter > _3633_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3634_p2,monty::rc_ptr< ::mosek::fusion::Parameter > _3635_p3)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3633_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3634_p2.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3635_p3.get())}),(int)0);
}
// End mosek.fusion.Param.vstack

// Begin mosek.fusion.Param.vstack
// Method mosek.fusion.Param.vstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3064:6-107
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::vstack
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _3636_p1,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3637_p2) { return mosek::fusion::p_Param::vstack(_3636_p1,_3637_p2); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::vstack(monty::rc_ptr< ::mosek::fusion::Parameter > _3636_p1,monty::rc_ptr< ::mosek::fusion::Parameter > _3637_p2)
{
  return ::mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 >{::monty::rc_ptr<::mosek::fusion::Parameter>(_3636_p1.get()),::monty::rc_ptr<::mosek::fusion::Parameter>(_3637_p2.get())}),(int)0);
}
// End mosek.fusion.Param.vstack

// Begin mosek.fusion.Param.vstack
// Method mosek.fusion.Param.vstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:3063:6-83
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::Param::vstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3638_p) { return mosek::fusion::p_Param::vstack(_3638_p); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::vstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3638_p)
{
  return ::mosek::fusion::p_Param::dstack(_3638_p,(int)0);
}
// End mosek.fusion.Param.vstack

// Begin mosek.fusion.Param.dstack
// Method mosek.fusion.Param.dstack @ bld/docker-win/final/default/src/fusion/Parameter.monty:2952:6-3061:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_Param::dstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Parameter >,1 > > _3639_p,int32_t _3640_dim)
{
  if ((_3640_dim < (int)0))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid stacking dimension"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3641_dimsizes = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)((_3639_p)->size(0)))));
  _checked_ptr_1<int32_t> _ptr__3641_dimsizes(_3641_dimsizes ? _3641_dimsizes->raw() : nullptr,_3641_dimsizes ? _3641_dimsizes->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3642_itemsizes = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_3639_p)->size(0)))));
  _checked_ptr_1<int64_t> _ptr__3642_itemsizes(_3642_itemsizes ? _3642_itemsizes->raw() : nullptr,_3642_itemsizes ? _3642_itemsizes->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3643_rshape;
  _checked_ptr_1<int32_t> _ptr__3643_rshape(_3643_rshape ? _3643_rshape->raw() : nullptr,_3643_rshape ? _3643_rshape->size(0) : 0);
  int32_t _3644_rnd = ((*_3639_p)((int)0))->getND();
  int32_t _10921_ = (int)1;
  int32_t _10922_ = (int)((_3639_p)->size(0));
  for (int32_t _3645_i = _10921_; _3645_i < _10922_; ++_3645_i)
  {
    {
      if ((_3644_rnd < ((*_3639_p)(_3645_i))->getND()))
      {
        {
          _3644_rnd = ((*_3639_p)(_3645_i))->getND();
        }
      }
      {}
    }
  }
  if ((_3640_dim < _3644_rnd))
  {
    {
      int32_t _3646_i = (int)0;
      while ( ((_3646_i < (int)((_3639_p)->size(0))) && (_3644_rnd != ((*_3639_p)(_3646_i))->getND())) )
      {
        {
          ++ _3646_i;
        }
      }
      _3643_rshape = ((*_3639_p)(_3646_i))->getShape();
      _ptr__3643_rshape.update(_3643_rshape ? _3643_rshape->raw() : nullptr, _3643_rshape ? _3643_rshape->size(0) : 0);
      {
        int32_t _3647_i = (int)0;
        while ( ((_3647_i < (int)((_3639_p)->size(0))) && (_3644_rnd != ((*_3639_p)(_3647_i))->getND())) )
        {
          {
            ++ _3647_i;
          }
        }
        _3643_rshape = ((*_3639_p)(_3647_i))->getShape();
        _ptr__3643_rshape.update(_3643_rshape ? _3643_rshape->raw() : nullptr, _3643_rshape ? _3643_rshape->size(0) : 0);
      }
    }
  }
  else
  {
    {
      std::vector<int32_t> _10923_;
      for (int32_t _3648_i = (int)0, _10924_ = safe_add( _3640_dim,(int)1 ); _3648_i < _10924_ ; ++_3648_i)
      {
        _10923_.push_back((int)1);
      }
      auto _10925_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10923_.size()),_10923_.begin(),_10923_.end()));
      _3643_rshape = _10925_;
      _ptr__3643_rshape.update(_3643_rshape ? _3643_rshape->raw() : nullptr, _3643_rshape ? _3643_rshape->size(0) : 0);
      {
        int32_t _3649_i = (int)0;
        while ( ((_3649_i < (int)((_3639_p)->size(0))) && (_3644_rnd != ((*_3639_p)(_3649_i))->getND())) )
        {
          {
            ++ _3649_i;
          }
        }
        int32_t _3650_ndi = ((*_3639_p)(_3649_i))->getND();
        std::shared_ptr< monty::ndarray< int32_t,1 > > _3651_shapei = ((*_3639_p)(_3649_i))->getShape();
        _checked_ptr_1<int32_t> _ptr__3651_shapei(_3651_shapei ? _3651_shapei->raw() : nullptr,_3651_shapei ? _3651_shapei->size(0) : 0);
        int32_t _10926_ = (int)0;
        int32_t _10927_ = _3650_ndi;
        for (int32_t _3652_j = _10926_; _3652_j < _10927_; ++_3652_j)
        {
          {
            _ptr__3643_rshape[_3652_j] = _ptr__3651_shapei[_3652_j];
          }
        }
      }
    }
  }
  _3644_rnd = (int)((_3643_rshape)->size(0));
  int32_t _3653_dimsize = (int)0;
  {
    bool _3654_dimerr = false;
    int32_t _10928_ = (int)0;
    int32_t _10929_ = (int)((_3639_p)->size(0));
    for (int32_t _3655_i = _10928_; _3655_i < _10929_; ++_3655_i)
    {
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _3656_shapei = ((*_3639_p)(_3655_i))->getShape();
        _checked_ptr_1<int32_t> _ptr__3656_shapei(_3656_shapei ? _3656_shapei->raw() : nullptr,_3656_shapei ? _3656_shapei->size(0) : 0);
        _ptr__3642_itemsizes[_3655_i] = ::mosek::fusion::p_Set::size(_3656_shapei);
        int32_t _10930_ = (int)0;
        int32_t _10931_ = (int)((_3656_shapei)->size(0));
        for (int32_t _3657_j = _10930_; _3657_j < _10931_; ++_3657_j)
        {
          {
            _3654_dimerr = (_3654_dimerr && ((_3657_j == _3640_dim) || (_ptr__3656_shapei[_3657_j] == _ptr__3643_rshape[_3657_j])));
          }
        }
        if ((_3640_dim < (int)((_3656_shapei)->size(0))))
        {
          {
            _ptr__3641_dimsizes[_3655_i] = _ptr__3656_shapei[_3640_dim];
            _3653_dimsize += _ptr__3656_shapei[_3640_dim];
            int32_t _10932_ = (int)((_3656_shapei)->size(0));
            int32_t _10933_ = _3644_rnd;
            for (int32_t _3658_j = _10932_; _3658_j < _10933_; ++_3658_j)
            {
              {
                _3654_dimerr = (_3654_dimerr && ((_3658_j == _3640_dim) || (_ptr__3643_rshape[_3658_j] == (int)1)));
              }
            }
          }
        }
        else
        {
          {
            _3653_dimsize += (int)1;
            _ptr__3641_dimsizes[_3655_i] = (int)1;
          }
        }
      }
    }
    if (_3654_dimerr)
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions for stacking"));
      }
    }
    {}
  }
  _ptr__3643_rshape[_3640_dim] = _3653_dimsize;
  std::vector<int32_t> _10934_;
  for (int32_t _3660_i = (int)0, _10935_ = (int)((_3639_p)->size(0)); _3660_i < _10935_ ; ++_3660_i)
  {
    _10934_.push_back(((*_3639_p)(_3660_i))->getNumNonzero());
  }
  auto _10936_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10934_.size()),_10934_.begin(),_10934_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3659_nnzs = _10936_;
  _checked_ptr_1<int32_t> _ptr__3659_nnzs(_3659_nnzs ? _3659_nnzs->raw() : nullptr,_3659_nnzs ? _3659_nnzs->size(0) : 0);
  int32_t _3661_rnnz = (int)0;
  int32_t _10937_ = (int)0;
  int32_t _10938_ = (int)((_3659_nnzs)->size(0));
  for (int32_t _3662_i = _10937_; _3662_i < _10938_; ++_3662_i)
  {
    {
      _3661_rnnz += _ptr__3659_nnzs[_3662_i];
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3663_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3661_rnnz)));
  _checked_ptr_1<int64_t> _ptr__3663_sp(_3663_sp ? _3663_sp->raw() : nullptr,_3663_sp ? _3663_sp->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3664_idx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3661_rnnz)));
  _checked_ptr_1<int32_t> _ptr__3664_idx(_3664_idx ? _3664_idx->raw() : nullptr,_3664_idx ? _3664_idx->size(0) : 0);
  int64_t _3665_dim0 = (int)1;
  int32_t _10939_ = (int)0;
  int32_t _10940_ = _3640_dim;
  for (int32_t _3666_i = _10939_; _3666_i < _10940_; ++_3666_i)
  {
    {
      _3665_dim0 *= _ptr__3643_rshape[_3666_i];
    }
  }
  int64_t _3667_dim1 = _3653_dimsize;
  int64_t _3668_dim2 = (int)1;
  int32_t _10941_ = safe_add( _3640_dim,(int)1 );
  int32_t _10942_ = _3644_rnd;
  for (int32_t _3669_i = _10941_; _3669_i < _10942_; ++_3669_i)
  {
    {
      _3668_dim2 *= _ptr__3643_rshape[_3669_i];
    }
  }
  {
    int32_t _3670_ofs = (int)0;
    int64_t _3671_ofsdim = (int)0;
    int32_t _10943_ = (int)0;
    int32_t _10944_ = (int)((_3639_p)->size(0));
    for (int32_t _3672_i = _10943_; _3672_i < _10944_; ++_3672_i)
    {
      {
        int32_t _3673_ni = ((*_3639_p)(_3672_i))->getNumNonzero();
        ((*_3639_p)(_3672_i))->getSp(_3663_sp,_3670_ofs);
        ((*_3639_p)(_3672_i))->getAllIndexes(_3664_idx,_3670_ofs);
        if ((_3640_dim == (int)0))
        {
          {
            int32_t _10945_ = _3670_ofs;
            int32_t _10946_ = safe_add( _3670_ofs,_3673_ni );
            for (int32_t _3674_j = _10945_; _3674_j < _10946_; ++_3674_j)
            {
              {
                _ptr__3663_sp[_3674_j] += _3671_ofsdim;
              }
            }
            _3671_ofsdim += _ptr__3642_itemsizes[_3672_i];
          }
        }
        else
        {
          {
            int32_t _10947_ = _3670_ofs;
            int32_t _10948_ = safe_add( _3670_ofs,_3673_ni );
            for (int32_t _3675_j = _10947_; _3675_j < _10948_; ++_3675_j)
            {
              {
                int64_t _3676_i0 = (_ptr__3663_sp[_3675_j] / safe_mul( _ptr__3641_dimsizes[_3672_i],_3668_dim2 ));
                int64_t _3677_i1 = ((_ptr__3663_sp[_3675_j] / _3668_dim2) % _ptr__3641_dimsizes[_3672_i]);
                int64_t _3678_i2 = (_ptr__3663_sp[_3675_j] % _3668_dim2);
                _ptr__3663_sp[_3675_j] = safe_add( safe_add( safe_mul( _3676_i0,safe_mul( _3653_dimsize,_3668_dim2 ) ),safe_mul( safe_add( _3677_i1,_3671_ofsdim ),_3668_dim2 ) ),_3678_i2 );
              }
            }
            _3671_ofsdim += _ptr__3641_dimsizes[_3672_i];
          }
        }
        _3670_ofs += _3673_ni;
      }
    }
  }
  int32_t _3679_maxdim = _ptr__3643_rshape[(int)0];
  int32_t _10949_ = (int)1;
  int32_t _10950_ = _3644_rnd;
  for (int32_t _3680_i = _10949_; _3680_i < _10950_; ++_3680_i)
  {
    {
      if ((_3679_maxdim < _ptr__3643_rshape[_3680_i]))
      {
        {
          _3679_maxdim = _ptr__3643_rshape[_3680_i];
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3681_ptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _3679_maxdim,(int)1 ))));
  _checked_ptr_1<int32_t> _ptr__3681_ptr(_3681_ptr ? _3681_ptr->raw() : nullptr,_3681_ptr ? _3681_ptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3682_perm = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3661_rnnz)));
  _checked_ptr_1<int32_t> _ptr__3682_perm(_3682_perm ? _3682_perm->raw() : nullptr,_3682_perm ? _3682_perm->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3683_perm2 = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_3661_rnnz)));
  _checked_ptr_1<int32_t> _ptr__3683_perm2(_3683_perm2 ? _3683_perm2->raw() : nullptr,_3683_perm2 ? _3683_perm2->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3684_rstrides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_3644_rnd)));
  _checked_ptr_1<int64_t> _ptr__3684_rstrides(_3684_rstrides ? _3684_rstrides->raw() : nullptr,_3684_rstrides ? _3684_rstrides->size(0) : 0);
  _ptr__3684_rstrides[(_3644_rnd - (int)1)] = (int)1;
  int32_t _10951_ = (int)1;
  int32_t _10952_ = _3644_rnd;
  for (int32_t _3685_i = _10951_; _3685_i < _10952_; ++_3685_i)
  {
    {
      _ptr__3684_rstrides[((_3644_rnd - _3685_i) - (int)1)] = safe_mul( _ptr__3684_rstrides[(_3644_rnd - _3685_i)],_ptr__3643_rshape[(_3644_rnd - _3685_i)] );
    }
  }
  int32_t _10953_ = (int)0;
  int32_t _10954_ = _3661_rnnz;
  for (int32_t _3686_i = _10953_; _3686_i < _10954_; ++_3686_i)
  {
    {
      _ptr__3682_perm[_3686_i] = _3686_i;
    }
  }
  int32_t _10955_ = (int)0;
  int32_t _10956_ = _3644_rnd;
  for (int32_t _3687_d_ = _10955_; _3687_d_ < _10956_; ++_3687_d_)
  {
    {
      int32_t _3688_d = ((_3644_rnd - _3687_d_) - (int)1);
      int32_t _10957_ = (int)0;
      int32_t _10958_ = safe_add( _3679_maxdim,(int)1 );
      for (int32_t _3689_i = _10957_; _3689_i < _10958_; ++_3689_i)
      {
        {
          _ptr__3681_ptr[_3689_i] = (int)0;
        }
      }
      int32_t _10959_ = (int)0;
      int32_t _10960_ = _3661_rnnz;
      for (int32_t _3690_i = _10959_; _3690_i < _10960_; ++_3690_i)
      {
        {
          ++ _ptr__3681_ptr[safe_add( (int)1,((_ptr__3663_sp[_3690_i] / _ptr__3684_rstrides[_3688_d]) % _ptr__3643_rshape[_3688_d]) )];
        }
      }
      int32_t _10961_ = (int)0;
      int32_t _10962_ = _3679_maxdim;
      for (int32_t _3691_i = _10961_; _3691_i < _10962_; ++_3691_i)
      {
        {
          _ptr__3681_ptr[safe_add( _3691_i,(int)1 )] += _ptr__3681_ptr[_3691_i];
        }
      }
      int32_t _10963_ = (int)0;
      int32_t _10964_ = _3661_rnnz;
      for (int32_t _3692_i = _10963_; _3692_i < _10964_; ++_3692_i)
      {
        {
          int64_t _3693_idx = ((_ptr__3663_sp[_ptr__3682_perm[_3692_i]] / _ptr__3684_rstrides[_3688_d]) % _ptr__3643_rshape[_3688_d]);
          _ptr__3683_perm2[_ptr__3681_ptr[_3693_idx]] = _ptr__3682_perm[_3692_i];
          ++ _ptr__3681_ptr[_3693_idx];
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3694_tmp = _3683_perm2;
      _checked_ptr_1<int32_t> _ptr__3694_tmp(_3694_tmp ? _3694_tmp->raw() : nullptr,_3694_tmp ? _3694_tmp->size(0) : 0);
      _3683_perm2 = _3682_perm;
      _ptr__3683_perm2.update(_3683_perm2 ? _3683_perm2->raw() : nullptr, _3683_perm2 ? _3683_perm2->size(0) : 0);
      _3682_perm = _3694_tmp;
      _ptr__3682_perm.update(_3682_perm ? _3682_perm->raw() : nullptr, _3682_perm ? _3682_perm->size(0) : 0);
    }
  }
  std::vector<int64_t> _10965_;
  for (int32_t _3696_i = (int)0, _10966_ = _3661_rnnz; _3696_i < _10966_ ; ++_3696_i)
  {
    _10965_.push_back(_ptr__3663_sp[_ptr__3682_perm[_3696_i]]);
  }
  auto _10967_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_10965_.size()),_10965_.begin(),_10965_.end()));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3695_rsp = _10967_;
  _checked_ptr_1<int64_t> _ptr__3695_rsp(_3695_rsp ? _3695_rsp->raw() : nullptr,_3695_rsp ? _3695_rsp->size(0) : 0);
  std::vector<int32_t> _10968_;
  for (int32_t _3698_i = (int)0, _10969_ = _3661_rnnz; _3698_i < _10969_ ; ++_3698_i)
  {
    _10968_.push_back(_ptr__3664_idx[_ptr__3682_perm[_3698_i]]);
  }
  auto _10970_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_10968_.size()),_10968_.begin(),_10968_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3697_ridx = _10970_;
  _checked_ptr_1<int32_t> _ptr__3697_ridx(_3697_ridx ? _3697_ridx->raw() : nullptr,_3697_ridx ? _3697_ridx->size(0) : 0);
  return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(((*_3639_p)((int)0))->__mosek_2fusion_2Parameter__getModel(),_3643_rshape,_3695_rsp,_3697_ridx)).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.Param.dstack

void mosek::fusion::p_Param::destroy()
{
}
void mosek::fusion::Param::destroy() { mosek::fusion::p_Param::_get_impl(this)->destroy(); }
// } class Param
// class ExprMulParamScalarExpr { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:2719:4-2864:5
mosek::fusion::ExprMulParamScalarExpr::ExprMulParamScalarExpr(mosek::fusion::p_ExprMulParamScalarExpr *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamScalarExpr()" << this << std::endl; */ }
mosek::fusion::ExprMulParamScalarExpr::~ExprMulParamScalarExpr() {  /* std::cout << "~ExprMulParamScalarExpr()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamScalarExpr::p_ExprMulParamScalarExpr
  (::mosek::fusion::ExprMulParamScalarExpr * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamScalarExpr.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:2723:6-2729:7
mosek::fusion::ExprMulParamScalarExpr::t mosek::fusion::p_ExprMulParamScalarExpr::_new_ExprMulParamScalarExpr
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3699_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3700_e)
{ return new mosek::fusion::ExprMulParamScalarExpr(_3699_p,_3700_e); }
mosek::fusion::ExprMulParamScalarExpr::ExprMulParamScalarExpr
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3699_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3700_e) : 
   ExprMulParamScalarExpr(new mosek::fusion::p_ExprMulParamScalarExpr(this))
{ mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(this)->_initialize(_3699_p,_3700_e); }
void mosek::fusion::p_ExprMulParamScalarExpr::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _3699_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3700_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_3699_p->getShape());
    mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(::mosek::fusion::ExprMulParamScalarExpr::t(_pubthis))->p = _3699_p;
    mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(::mosek::fusion::ExprMulParamScalarExpr::t(_pubthis))->e = _3700_e;
    if ((_3700_e->getND() != (int)0))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamScalarExpr.ctor

// Begin mosek.fusion.ExprMulParamScalarExpr.eval
// Method mosek.fusion.ExprMulParamScalarExpr.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:2733:6-2863:7
void mosek::fusion::ExprMulParamScalarExpr :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3701_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3702_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3703_xs) { mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(this)->eval(_3701_rs,_3702_ws,_3703_xs); }
void mosek::fusion::p_ExprMulParamScalarExpr::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3701_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3702_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3703_xs)
{
  e->eval(_3702_ws,_3701_rs,_3703_xs);
  _3702_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3704_wi32 = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__3704_wi32(_3704_wi32 ? _3704_wi32->raw() : nullptr,_3704_wi32 ? _3704_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3705_wi64 = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__3705_wi64(_3705_wi64 ? _3705_wi64->raw() : nullptr,_3705_wi64 ? _3705_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3706_wf64 = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->f64;
  _checked_ptr_1<double> _ptr__3706_wf64(_3706_wf64 ? _3706_wf64->raw() : nullptr,_3706_wf64 ? _3706_wf64->size(0) : 0);
  int32_t _3707_nd = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->nd;
  if ((_3707_nd != (int)0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operator shape for multiplication"));
    }
  }
  {}
  int32_t _3708_nelem = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->nelem;
  int32_t _3709_nnz = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->nnz;
  bool _3710_hassp = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->hassp;
  int32_t _3711_ptr = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->ptr_base;
  int32_t _3712_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->ncodeatom;
  int32_t _3713_sp = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->sp_base;
  int32_t _3714_nidxs = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->nidxs_base;
  int32_t _3715_cof = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->cof_base;
  int32_t _3716_cconst = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->cconst_base;
  int32_t _3717_ptrcode = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->codeptr_base;
  int32_t _3718_code = mosek::fusion::p_WorkStack::_get_impl(_3702_ws)->code_base;
  int32_t _3719_rnd = p->getND();
  int32_t _3720_rnelem = p->getNumNonzero();
  int32_t _3721_rnnz = safe_mul( _3709_nnz,p->getNumNonzero() );
  bool _3722_rhassp = (p->getNumNonzero() < p->getSize());
  int32_t _10971_;
  bool _10972_ = (_3712_ncodeatom > (int)0);
  if (_10972_)
  {
    _10971_ = safe_add( safe_mul( _3712_ncodeatom,_3720_rnelem ),safe_mul( _3721_rnnz,(int)4 ) );
  }
  else
  {
    _10971_ = safe_mul( _3721_rnnz,(int)3 );
  }
  int32_t _3723_rncodeatom = _10971_;
  int32_t _3724_pidxs = _3703_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3725_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3703_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__3725_xi32(_3725_xi32 ? _3725_xi32->raw() : nullptr,_3725_xi32 ? _3725_xi32->size(0) : 0);
  p->getAllIndexes(_3725_xi32,_3724_pidxs);
  _3701_rs->alloc_expr(_3719_rnd,_3720_rnelem,_3721_rnnz,_3722_rhassp,_3723_rncodeatom);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3726_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__3726_ri64(_3726_ri64 ? _3726_ri64->raw() : nullptr,_3726_ri64 ? _3726_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3727_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->f64;
  _checked_ptr_1<double> _ptr__3727_rf64(_3727_rf64 ? _3727_rf64->raw() : nullptr,_3727_rf64 ? _3727_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3728_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__3728_ri32(_3728_ri32 ? _3728_ri32->raw() : nullptr,_3728_ri32 ? _3728_ri32->size(0) : 0);
  int32_t _3729_rptr = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->ptr_base;
  int32_t _3730_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->nidxs_base;
  int32_t _3731_rsp = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->sp_base;
  int32_t _3732_rcof = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->cof_base;
  bool _3733_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->hassp;
  int32_t _3734_rshape = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->shape_base;
  int32_t _3735_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->codeptr_base;
  int32_t _3736_rcode = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->code_base;
  int32_t _3737_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3701_rs)->cconst_base;
  {
    int32_t _10973_ = (int)0;
    int32_t _10974_ = _3721_rnnz;
    for (int32_t _3738_i = _10973_; _3738_i < _10974_; ++_3738_i)
    {
      {
        _ptr__3727_rf64[safe_add( _3732_rcof,_3738_i )] = 0.0;
      }
    }
    int32_t _10975_ = (int)0;
    int32_t _10976_ = safe_add( _3720_rnelem,(int)1 );
    for (int32_t _3739_i = _10975_; _3739_i < _10976_; ++_3739_i)
    {
      {
        _ptr__3728_ri32[safe_add( _3729_rptr,_3739_i )] = safe_mul( _3739_i,_3709_nnz );
      }
    }
    int32_t _10977_ = (int)0;
    int32_t _10978_ = _3719_rnd;
    for (int32_t _3740_i = _10977_; _3740_i < _10978_; ++_3740_i)
    {
      {
        _ptr__3728_ri32[safe_add( _3734_rshape,_3740_i )] = p->getDim(_3740_i);
      }
    }
    if (_3733_rhassp)
    {
      {
        p->getSp(_3726_ri64,_3731_rsp);
      }
    }
    {}
    int32_t _10979_ = (int)0;
    int32_t _10980_ = _3721_rnnz;
    for (int32_t _3741_i = _10979_; _3741_i < _10980_; ++_3741_i)
    {
      {
        _ptr__3726_ri64[safe_add( _3730_rnidxs,_3741_i )] = (-(int)999);
      }
    }
    {
      int32_t _3742_k = (int)0;
      int32_t _10981_ = (int)0;
      int32_t _10982_ = _3720_rnelem;
      for (int32_t _3743_i = _10981_; _3743_i < _10982_; ++_3743_i)
      {
        {
          int32_t _10983_ = (int)0;
          int32_t _10984_ = _3709_nnz;
          for (int32_t _3744_j = _10983_; _3744_j < _10984_; ++_3744_j)
          {
            {
              _ptr__3726_ri64[safe_add( _3730_rnidxs,_3742_k )] = _ptr__3705_wi64[safe_add( _3714_nidxs,_3744_j )];
              ++ _3742_k;
            }
          }
        }
      }
    }
    if ((_3723_rncodeatom > (int)0))
    {
      {
        _ptr__3728_ri32[_3735_rcodeptr] = (int)0;
      }
    }
    {}
    {
      if ((_3712_ncodeatom == (int)0))
      {
        {
          int32_t _3745_nzi = (int)0;
          int32_t _3746_codei = (int)0;
          int32_t _10985_ = (int)0;
          int32_t _10986_ = _3720_rnelem;
          for (int32_t _3747_i = _10985_; _3747_i < _10986_; ++_3747_i)
          {
            {
              int32_t _10987_ = (int)0;
              int32_t _10988_ = _3709_nnz;
              for (int32_t _3748_k = _10987_; _3748_k < _10988_; ++_3748_k)
              {
                {
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3746_codei )] = 2;
                  _ptr__3727_rf64[safe_add( _3737_rcconst,_3746_codei )] = _ptr__3706_wf64[safe_add( _3715_cof,_3748_k )];
                  ++ _3746_codei;
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3746_codei )] = 1;
                  _ptr__3727_rf64[safe_add( _3737_rcconst,_3746_codei )] = _ptr__3725_xi32[safe_add( _3724_pidxs,_3747_i )];
                  ++ _3746_codei;
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3746_codei )] = 5;
                  ++ _3746_codei;
                  _ptr__3728_ri32[safe_add( safe_add( _3735_rcodeptr,_3745_nzi ),(int)1 )] = _3746_codei;
                  ++ _3745_nzi;
                }
              }
            }
          }
        }
      }
      else
      {
        {
          int32_t _3749_codei = (int)0;
          int32_t _3750_nzi = (int)0;
          int32_t _10989_ = (int)0;
          int32_t _10990_ = _3720_rnelem;
          for (int32_t _3751_i = _10989_; _3751_i < _10990_; ++_3751_i)
          {
            {
              int32_t _10991_ = (int)0;
              int32_t _10992_ = _3709_nnz;
              for (int32_t _3752_k = _10991_; _3752_k < _10992_; ++_3752_k)
              {
                {
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3749_codei )] = 2;
                  _ptr__3727_rf64[safe_add( _3737_rcconst,_3749_codei )] = _ptr__3706_wf64[safe_add( _3715_cof,_3752_k )];
                  ++ _3749_codei;
                  int32_t _10993_ = _ptr__3704_wi32[safe_add( _3717_ptrcode,_3752_k )];
                  int32_t _10994_ = _ptr__3704_wi32[safe_add( safe_add( _3717_ptrcode,_3752_k ),(int)1 )];
                  for (int32_t _3753_l = _10993_; _3753_l < _10994_; ++_3753_l)
                  {
                    {
                      _ptr__3728_ri32[safe_add( _3736_rcode,_3749_codei )] = _ptr__3704_wi32[safe_add( _3718_code,_3753_l )];
                      _ptr__3727_rf64[safe_add( _3737_rcconst,_3749_codei )] = _ptr__3706_wf64[safe_add( _3716_cconst,_3753_l )];
                      ++ _3749_codei;
                    }
                  }
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3749_codei )] = 3;
                  ++ _3749_codei;
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3749_codei )] = 1;
                  _ptr__3727_rf64[safe_add( _3737_rcconst,_3749_codei )] = _ptr__3725_xi32[safe_add( _3724_pidxs,_3751_i )];
                  ++ _3749_codei;
                  _ptr__3728_ri32[safe_add( _3736_rcode,_3749_codei )] = 5;
                  ++ _3749_codei;
                  _ptr__3728_ri32[safe_add( safe_add( _3735_rcodeptr,_3750_nzi ),(int)1 )] = _3749_codei;
                  ++ _3750_nzi;
                }
              }
            }
          }
        }
      }
    }
  }
  _3703_xs->clear();
}
// End mosek.fusion.ExprMulParamScalarExpr.eval

// Begin mosek.fusion.ExprMulParamScalarExpr.toString
// Method mosek.fusion.ExprMulParamScalarExpr.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:2731:6-160
std::string mosek::fusion::ExprMulParamScalarExpr :: toString() { return mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamScalarExpr::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamScalarExpr("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamScalarExpr.toString

void mosek::fusion::p_ExprMulParamScalarExpr::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamScalarExpr::destroy() { mosek::fusion::p_ExprMulParamScalarExpr::_get_impl(this)->destroy(); }
// } class ExprMulParamScalarExpr
// class ExprMulParamScalar { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:2592:4-2716:5
mosek::fusion::ExprMulParamScalar::ExprMulParamScalar(mosek::fusion::p_ExprMulParamScalar *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamScalar()" << this << std::endl; */ }
mosek::fusion::ExprMulParamScalar::~ExprMulParamScalar() {  /* std::cout << "~ExprMulParamScalar()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamScalar::p_ExprMulParamScalar
  (::mosek::fusion::ExprMulParamScalar * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamScalar.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:2596:6-2603:7
mosek::fusion::ExprMulParamScalar::t mosek::fusion::p_ExprMulParamScalar::_new_ExprMulParamScalar
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3754_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3755_e)
{ return new mosek::fusion::ExprMulParamScalar(_3754_p,_3755_e); }
mosek::fusion::ExprMulParamScalar::ExprMulParamScalar
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3754_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3755_e) : 
   ExprMulParamScalar(new mosek::fusion::p_ExprMulParamScalar(this))
{ mosek::fusion::p_ExprMulParamScalar::_get_impl(this)->_initialize(_3754_p,_3755_e); }
void mosek::fusion::p_ExprMulParamScalar::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _3754_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3755_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_3755_e->getShape());
    mosek::fusion::p_ExprMulParamScalar::_get_impl(::mosek::fusion::ExprMulParamScalar::t(_pubthis))->p = _3754_p;
    mosek::fusion::p_ExprMulParamScalar::_get_impl(::mosek::fusion::ExprMulParamScalar::t(_pubthis))->e = _3755_e;
    if ((_3754_p->getND() != (int)0))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamScalar.ctor

// Begin mosek.fusion.ExprMulParamScalar.eval
// Method mosek.fusion.ExprMulParamScalar.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:2607:6-2715:7
void mosek::fusion::ExprMulParamScalar :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3756_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3757_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3758_xs) { mosek::fusion::p_ExprMulParamScalar::_get_impl(this)->eval(_3756_rs,_3757_ws,_3758_xs); }
void mosek::fusion::p_ExprMulParamScalar::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3756_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3757_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3758_xs)
{
  e->eval(_3757_ws,_3756_rs,_3758_xs);
  _3757_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3759_wi32 = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__3759_wi32(_3759_wi32 ? _3759_wi32->raw() : nullptr,_3759_wi32 ? _3759_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3760_wi64 = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__3760_wi64(_3760_wi64 ? _3760_wi64->raw() : nullptr,_3760_wi64 ? _3760_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3761_wf64 = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->f64;
  _checked_ptr_1<double> _ptr__3761_wf64(_3761_wf64 ? _3761_wf64->raw() : nullptr,_3761_wf64 ? _3761_wf64->size(0) : 0);
  int32_t _3762_nd = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->nd;
  int32_t _3763_nelem = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->nelem;
  int32_t _3764_nnz = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->nnz;
  bool _3765_hassp = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->hassp;
  int32_t _3766_ptr = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->ptr_base;
  int32_t _3767_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->ncodeatom;
  int32_t _3768_shape = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->shape_base;
  int32_t _3769_sp = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->sp_base;
  int32_t _3770_nidxs = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->nidxs_base;
  int32_t _3771_cof = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->cof_base;
  int32_t _3772_cconst = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->cconst_base;
  int32_t _3773_ptrcode = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->codeptr_base;
  int32_t _3774_code = mosek::fusion::p_WorkStack::_get_impl(_3757_ws)->code_base;
  int32_t _3775_rnd = _3762_nd;
  int32_t _3776_rnelem = _3763_nelem;
  int32_t _3777_rnnz = _3764_nnz;
  bool _3778_rhassp = (p->getNumNonzero() < p->getSize());
  int32_t _10995_;
  bool _10996_ = (_3767_ncodeatom == (int)0);
  if (_10996_)
  {
    _10995_ = safe_mul( _3764_nnz,(int)3 );
  }
  else
  {
    _10995_ = safe_add( safe_mul( _3764_nnz,(int)4 ),_3767_ncodeatom );
  }
  int32_t _3779_rncodeatom = _10995_;
  _3756_rs->alloc_expr(_3775_rnd,_3776_rnelem,_3777_rnnz,_3778_rhassp,_3779_rncodeatom);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3780_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__3780_ri64(_3780_ri64 ? _3780_ri64->raw() : nullptr,_3780_ri64 ? _3780_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3781_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->f64;
  _checked_ptr_1<double> _ptr__3781_rf64(_3781_rf64 ? _3781_rf64->raw() : nullptr,_3781_rf64 ? _3781_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3782_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__3782_ri32(_3782_ri32 ? _3782_ri32->raw() : nullptr,_3782_ri32 ? _3782_ri32->size(0) : 0);
  int32_t _3783_rptr = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->ptr_base;
  int32_t _3784_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->nidxs_base;
  int32_t _3785_rsp = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->sp_base;
  int32_t _3786_rcof = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->cof_base;
  bool _3787_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->hassp;
  int32_t _3788_rshape = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->shape_base;
  int32_t _3789_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->codeptr_base;
  int32_t _3790_rcode = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->code_base;
  int32_t _3791_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3756_rs)->cconst_base;
  int32_t _3792_pidx0 = p->getIndex((int)0);
  {
    int32_t _10997_ = (int)0;
    int32_t _10998_ = _3777_rnnz;
    for (int32_t _3793_i = _10997_; _3793_i < _10998_; ++_3793_i)
    {
      {
        _ptr__3781_rf64[safe_add( _3786_rcof,_3793_i )] = 0.0;
      }
    }
    int32_t _10999_ = (int)0;
    int32_t _11000_ = safe_add( _3776_rnelem,(int)1 );
    for (int32_t _3794_i = _10999_; _3794_i < _11000_; ++_3794_i)
    {
      {
        _ptr__3782_ri32[safe_add( _3783_rptr,_3794_i )] = _ptr__3759_wi32[safe_add( _3766_ptr,_3794_i )];
      }
    }
    int32_t _11001_ = (int)0;
    int32_t _11002_ = _3775_rnd;
    for (int32_t _3795_i = _11001_; _3795_i < _11002_; ++_3795_i)
    {
      {
        _ptr__3782_ri32[safe_add( _3788_rshape,_3795_i )] = _ptr__3759_wi32[safe_add( _3768_shape,_3795_i )];
      }
    }
    int32_t _11003_ = (int)0;
    int32_t _11004_ = _3764_nnz;
    for (int32_t _3796_i = _11003_; _3796_i < _11004_; ++_3796_i)
    {
      {
        _ptr__3780_ri64[safe_add( _3784_rnidxs,_3796_i )] = _ptr__3760_wi64[safe_add( _3770_nidxs,_3796_i )];
      }
    }
    if (_3787_rhassp)
    {
      {
        int32_t _11005_ = (int)0;
        int32_t _11006_ = _3776_rnelem;
        for (int32_t _3797_i = _11005_; _3797_i < _11006_; ++_3797_i)
        {
          {
            _ptr__3780_ri64[safe_add( _3785_rsp,_3797_i )] = _ptr__3760_wi64[safe_add( _3769_sp,_3797_i )];
          }
        }
      }
    }
    {}
    int32_t _3798_codei = (int)0;
    if ((_3779_rncodeatom > (int)0))
    {
      {
        _ptr__3782_ri32[_3789_rcodeptr] = (int)0;
      }
    }
    {}
    int32_t _11007_ = (int)0;
    int32_t _11008_ = _3764_nnz;
    for (int32_t _3799_i = _11007_; _3799_i < _11008_; ++_3799_i)
    {
      {
        _ptr__3782_ri32[safe_add( _3790_rcode,_3798_codei )] = 2;
        _ptr__3781_rf64[safe_add( _3791_rcconst,_3798_codei )] = _ptr__3761_wf64[safe_add( _3771_cof,_3799_i )];
        ++ _3798_codei;
        if ((_3767_ncodeatom > (int)0))
        {
          {
            int32_t _11009_ = _ptr__3759_wi32[safe_add( _3773_ptrcode,_3799_i )];
            int32_t _11010_ = _ptr__3759_wi32[safe_add( safe_add( _3773_ptrcode,_3799_i ),(int)1 )];
            for (int32_t _3800_j = _11009_; _3800_j < _11010_; ++_3800_j)
            {
              {
                _ptr__3782_ri32[safe_add( _3790_rcode,_3798_codei )] = _ptr__3759_wi32[safe_add( _3774_code,_3800_j )];
                _ptr__3781_rf64[safe_add( _3791_rcconst,_3798_codei )] = _ptr__3761_wf64[safe_add( _3772_cconst,_3800_j )];
                ++ _3798_codei;
              }
            }
            _ptr__3782_ri32[safe_add( _3790_rcode,_3798_codei )] = 3;
            ++ _3798_codei;
          }
        }
        {}
        _ptr__3782_ri32[safe_add( _3790_rcode,_3798_codei )] = 1;
        _ptr__3781_rf64[safe_add( _3791_rcconst,_3798_codei )] = _3792_pidx0;
        ++ _3798_codei;
        _ptr__3782_ri32[safe_add( _3790_rcode,_3798_codei )] = 5;
        ++ _3798_codei;
        _ptr__3782_ri32[safe_add( safe_add( _3789_rcodeptr,_3799_i ),(int)1 )] = _3798_codei;
      }
    }
  }
  _3758_xs->clear();
}
// End mosek.fusion.ExprMulParamScalar.eval

// Begin mosek.fusion.ExprMulParamScalar.toString
// Method mosek.fusion.ExprMulParamScalar.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:2605:6-156
std::string mosek::fusion::ExprMulParamScalar :: toString() { return mosek::fusion::p_ExprMulParamScalar::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamScalar::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamScalar("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamScalar.toString

void mosek::fusion::p_ExprMulParamScalar::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamScalar::destroy() { mosek::fusion::p_ExprMulParamScalar::_get_impl(this)->destroy(); }
// } class ExprMulParamScalar
// class ExprMulParamDiagLeft { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:2223:4-2586:5
mosek::fusion::ExprMulParamDiagLeft::ExprMulParamDiagLeft(mosek::fusion::p_ExprMulParamDiagLeft *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamDiagLeft()" << this << std::endl; */ }
mosek::fusion::ExprMulParamDiagLeft::~ExprMulParamDiagLeft() {  /* std::cout << "~ExprMulParamDiagLeft()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamDiagLeft::p_ExprMulParamDiagLeft
  (::mosek::fusion::ExprMulParamDiagLeft * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamDiagLeft.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:2227:6-2237:7
mosek::fusion::ExprMulParamDiagLeft::t mosek::fusion::p_ExprMulParamDiagLeft::_new_ExprMulParamDiagLeft
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3801_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3802_e)
{ return new mosek::fusion::ExprMulParamDiagLeft(_3801_p,_3802_e); }
mosek::fusion::ExprMulParamDiagLeft::ExprMulParamDiagLeft
  (monty::rc_ptr< ::mosek::fusion::Parameter > _3801_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3802_e) : 
   ExprMulParamDiagLeft(new mosek::fusion::p_ExprMulParamDiagLeft(this))
{ mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(this)->_initialize(_3801_p,_3802_e); }
void mosek::fusion::p_ExprMulParamDiagLeft::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _3801_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _3802_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3802_e->getDim((int)1))}));
    mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(::mosek::fusion::ExprMulParamDiagLeft::t(_pubthis))->p = _3801_p;
    mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(::mosek::fusion::ExprMulParamDiagLeft::t(_pubthis))->e = _3802_e;
    if (((_3801_p->getND() != (int)2) || (_3802_e->getND() != (int)2)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
    if (((_3801_p->getDim((int)1) != _3802_e->getDim((int)0)) || (_3801_p->getDim((int)0) != _3802_e->getDim((int)1))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamDiagLeft.ctor

// Begin mosek.fusion.ExprMulParamDiagLeft.eval
// Method mosek.fusion.ExprMulParamDiagLeft.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:2240:6-2585:7
void mosek::fusion::ExprMulParamDiagLeft :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3803_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3804_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3805_xs) { mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(this)->eval(_3803_rs,_3804_ws,_3805_xs); }
void mosek::fusion::p_ExprMulParamDiagLeft::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3803_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3804_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3805_xs)
{
  e->eval(_3804_ws,_3803_rs,_3805_xs);
  _3804_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3806_wi32 = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__3806_wi32(_3806_wi32 ? _3806_wi32->raw() : nullptr,_3806_wi32 ? _3806_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3807_wi64 = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__3807_wi64(_3807_wi64 ? _3807_wi64->raw() : nullptr,_3807_wi64 ? _3807_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3808_wf64 = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->f64;
  _checked_ptr_1<double> _ptr__3808_wf64(_3808_wf64 ? _3808_wf64->raw() : nullptr,_3808_wf64 ? _3808_wf64->size(0) : 0);
  int32_t _3809_nd = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->nd;
  int32_t _3810_nelem = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->nelem;
  int32_t _3811_nnz = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->nnz;
  bool _3812_hassp = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->hassp;
  int32_t _3813_ptr = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->ptr_base;
  int32_t _3814_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->ncodeatom;
  int32_t _3815_shape = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->shape_base;
  int32_t _3816_sp = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->sp_base;
  int32_t _3817_nidxs = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->nidxs_base;
  int32_t _3818_cof = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->cof_base;
  int32_t _3819_cconst = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->cconst_base;
  int32_t _3820_codeptr = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->codeptr_base;
  int32_t _3821_code = mosek::fusion::p_WorkStack::_get_impl(_3804_ws)->code_base;
  if (((_3809_nd != (int)2) || ((_ptr__3806_wi32[_3815_shape] != p->getDim((int)1)) || (_ptr__3806_wi32[safe_add( _3815_shape,(int)1 )] != p->getDim((int)0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
    }
  }
  {}
  int32_t _3822_pnnz = p->getNumNonzero();
  int32_t _3823_psp = _3805_xs->alloci64(_3822_pnnz);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3824_xi64 = mosek::fusion::p_WorkStack::_get_impl(_3805_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__3824_xi64(_3824_xi64 ? _3824_xi64->raw() : nullptr,_3824_xi64 ? _3824_xi64->size(0) : 0);
  p->getSp(_3824_xi64,_3823_psp);
  int32_t _3825_pdim0 = p->getDim((int)0);
  int32_t _3826_pdim1 = p->getDim((int)1);
  int32_t _3827_edim0 = _ptr__3806_wi32[_3815_shape];
  int32_t _3828_edim1 = _ptr__3806_wi32[safe_add( _3815_shape,(int)1 )];
  int32_t _3829_pidxs = _3805_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3830_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3805_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__3830_xi32(_3830_xi32 ? _3830_xi32->raw() : nullptr,_3830_xi32 ? _3830_xi32->size(0) : 0);
  p->getAllIndexes(_3830_xi32,_3829_pidxs);
  if (_3812_hassp)
  {
    {
      int32_t _3831_eperm = _3805_xs->alloci32(_3810_nelem);
      int32_t _3832_eptr = _3805_xs->alloci32(safe_add( _3828_edim1,(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3833_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3805_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__3833_xi32(_3833_xi32 ? _3833_xi32->raw() : nullptr,_3833_xi32 ? _3833_xi32->size(0) : 0);
      int32_t _11011_ = (int)0;
      int32_t _11012_ = safe_add( _3828_edim1,(int)1 );
      for (int32_t _3834_i = _11011_; _3834_i < _11012_; ++_3834_i)
      {
        {
          _ptr__3833_xi32[safe_add( _3832_eptr,_3834_i )] = (int)0;
        }
      }
      int32_t _11013_ = (int)0;
      int32_t _11014_ = _3810_nelem;
      for (int32_t _3835_i = _11013_; _3835_i < _11014_; ++_3835_i)
      {
        {
          ++ _ptr__3833_xi32[safe_add( safe_add( _3832_eptr,(_ptr__3807_wi64[safe_add( _3816_sp,_3835_i )] % _3828_edim1) ),(int)1 )];
        }
      }
      int32_t _11015_ = (int)0;
      int32_t _11016_ = _3828_edim1;
      for (int32_t _3836_i = _11015_; _3836_i < _11016_; ++_3836_i)
      {
        {
          _ptr__3833_xi32[safe_add( safe_add( _3832_eptr,_3836_i ),(int)1 )] += _ptr__3833_xi32[safe_add( _3832_eptr,_3836_i )];
        }
      }
      int32_t _11017_ = (int)0;
      int32_t _11018_ = _3810_nelem;
      for (int32_t _3837_i = _11017_; _3837_i < _11018_; ++_3837_i)
      {
        {
          int64_t _3838_colidx = (_ptr__3807_wi64[safe_add( _3816_sp,_3837_i )] % _3828_edim1);
          _ptr__3833_xi32[safe_add( _3831_eperm,_ptr__3833_xi32[safe_add( _3832_eptr,_3838_colidx )] )] = _3837_i;
          ++ _ptr__3833_xi32[safe_add( _3832_eptr,_3838_colidx )];
        }
      }
      int32_t _3839_rnelem = (int)0;
      int32_t _3840_rnnz = (int)0;
      int32_t _3841_rncodeatom = (int)0;
      {
        int32_t _3842_pe = (int)0;
        int32_t _3843_pp = (int)0;
        while ( ((_3843_pp < _3822_pnnz) && (_3842_pe < _3810_nelem)) )
        {
          {
            int32_t _3844_eidx = _ptr__3833_xi32[safe_add( _3831_eperm,_3842_pe )];
            int64_t _3845_psubi = (_ptr__3824_xi64[safe_add( _3823_psp,_3843_pp )] / _3826_pdim1);
            int64_t _3846_esubj = (_ptr__3807_wi64[safe_add( _3816_sp,_3844_eidx )] % _3828_edim1);
            if ((_3845_psubi < _3846_esubj))
            {
              {
                while ( ((_3843_pp < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3843_pp )] < safe_mul( safe_add( _3845_psubi,(int)1 ),_3826_pdim1 ))) )
                {
                  {
                    ++ _3843_pp;
                  }
                }
              }
            }
            else if((_3846_esubj < _3845_psubi))
            {
              {
                while ( ((_3842_pe < _3822_pnnz) && ((_ptr__3807_wi64[safe_add( _3816_sp,_ptr__3833_xi32[safe_add( _3831_eperm,_3842_pe )] )] % _3828_edim1) == _3846_esubj)) )
                {
                  {
                    ++ _3842_pe;
                  }
                }
              }
            }
            else
            {
              {
                int32_t _3847_ie = _3842_pe;
                int32_t _3848_ip = _3843_pp;
                while ( ((_3843_pp < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3843_pp )] < safe_mul( safe_add( _3845_psubi,(int)1 ),_3826_pdim1 ))) )
                {
                  {
                    ++ _3843_pp;
                  }
                }
                while ( ((_3842_pe < _3822_pnnz) && ((_ptr__3807_wi64[safe_add( _3816_sp,_ptr__3833_xi32[safe_add( _3831_eperm,_3842_pe )] )] % _3828_edim1) == _3846_esubj)) )
                {
                  {
                    ++ _3842_pe;
                  }
                }
                bool _3849_haselm = false;
                while ( ((_3848_ip < _3843_pp) && (_3847_ie < _3842_pe)) )
                {
                  {
                    int64_t _3850_psubj = (_ptr__3824_xi64[safe_add( _3823_psp,_3848_ip )] % _3826_pdim1);
                    int32_t _3851_eidx = _ptr__3833_xi32[safe_add( _3831_eperm,_3847_ie )];
                    int64_t _3852_esubi = (_ptr__3807_wi64[safe_add( _3816_sp,_3851_eidx )] / _3828_edim1);
                    if ((_3850_psubj < _3852_esubi))
                    {
                      {
                        ++ _3848_ip;
                      }
                    }
                    else if((_3850_psubj > _3852_esubi))
                    {
                      {
                        ++ _3847_ie;
                      }
                    }
                    else
                    {
                      {
                        _3840_rnnz += (_ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3851_eidx ),(int)1 )] - _ptr__3806_wi32[safe_add( _3813_ptr,_3851_eidx )]);
                        _3849_haselm = true;
                        int32_t _3853_n = (_ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3851_eidx ),(int)1 )] - _ptr__3806_wi32[safe_add( _3813_ptr,_3851_eidx )]);
                        int32_t _11019_;
                        bool _11020_ = (_3814_ncodeatom > (int)0);
                        if (_11020_)
                        {
                          _11019_ = safe_add( (_ptr__3806_wi32[safe_add( _3820_codeptr,_ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3851_eidx ),(int)1 )] )] - _ptr__3806_wi32[safe_add( _3820_codeptr,_ptr__3806_wi32[safe_add( _3813_ptr,_3851_eidx )] )]),safe_mul( (int)4,_3853_n ) );
                        }
                        else
                        {
                          _11019_ = safe_mul( (int)3,_3853_n );
                        }
                        _3841_rncodeatom += _11019_;
                        ++ _3848_ip;
                        ++ _3847_ie;
                      }
                    }
                  }
                }
                if (_3849_haselm)
                {
                  {
                    ++ _3839_rnelem;
                  }
                }
                {}
              }
            }
          }
        }
      }
      int32_t _3854_rnd = (int)1;
      bool _3855_rhassp = (_3839_rnelem < _3825_pdim0);
      _3803_rs->alloc_expr(_3854_rnd,_3839_rnelem,_3840_rnnz,_3855_rhassp,_3841_rncodeatom);
      int32_t _3856_rptr = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->ptr_base;
      int32_t _3857_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->nidxs_base;
      int32_t _11021_;
      bool _11022_ = _3855_rhassp;
      if (_11022_)
      {
        _11021_ = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->sp_base;
      }
      else
      {
        _11021_ = _3803_rs->alloci64(_3839_rnelem);
      }
      int32_t _3858_rsp = _11021_;
      int32_t _3859_rcof = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->cof_base;
      bool _3860_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->hassp;
      int32_t _3861_rshape = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->shape_base;
      int32_t _3862_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->codeptr_base;
      int32_t _3863_rcode = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->code_base;
      int32_t _3864_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _3865_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__3865_ri64(_3865_ri64 ? _3865_ri64->raw() : nullptr,_3865_ri64 ? _3865_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3866_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->f64;
      _checked_ptr_1<double> _ptr__3866_rf64(_3866_rf64 ? _3866_rf64->raw() : nullptr,_3866_rf64 ? _3866_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3867_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__3867_ri32(_3867_ri32 ? _3867_ri32->raw() : nullptr,_3867_ri32 ? _3867_ri32->size(0) : 0);
      if ((_3839_rnelem > (int)0))
      {
        {
          _ptr__3867_ri32[_3856_rptr] = (int)0;
          if ((_3840_rnnz > (int)0))
          {
            {
              _ptr__3867_ri32[_3862_rcodeptr] = (int)0;
            }
          }
          {}
          _ptr__3867_ri32[_3861_rshape] = (int32_t)_3825_pdim0;
          int32_t _3868_codei = (int)0;
          int32_t _3869_elmi = (int)0;
          int32_t _3870_nzi = (int)0;
          int32_t _3871_pe = (int)0;
          int32_t _3872_pp = (int)0;
          while ( ((_3872_pp < _3822_pnnz) && (_3871_pe < _3810_nelem)) )
          {
            {
              int32_t _3873_eidx = _ptr__3833_xi32[safe_add( _3831_eperm,_3871_pe )];
              int64_t _3874_psubi = (_ptr__3824_xi64[safe_add( _3823_psp,_3872_pp )] / _3826_pdim1);
              int64_t _3875_esubj = (_ptr__3807_wi64[safe_add( _3816_sp,_3873_eidx )] % _3828_edim1);
              if ((_3874_psubi < _3875_esubj))
              {
                {
                  while ( ((_3872_pp < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3872_pp )] < safe_mul( safe_add( _3874_psubi,(int)1 ),_3826_pdim1 ))) )
                  {
                    {
                      ++ _3872_pp;
                    }
                  }
                }
              }
              else if((_3875_esubj < _3874_psubi))
              {
                {
                  while ( ((_3871_pe < _3822_pnnz) && ((_ptr__3807_wi64[safe_add( _3816_sp,_ptr__3833_xi32[safe_add( _3831_eperm,_3871_pe )] )] % _3828_edim1) == _3875_esubj)) )
                  {
                    {
                      ++ _3871_pe;
                    }
                  }
                }
              }
              else
              {
                {
                  int32_t _3876_ie = _3871_pe;
                  int32_t _3877_ip = _3872_pp;
                  while ( ((_3872_pp < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3872_pp )] < safe_mul( safe_add( _3874_psubi,(int)1 ),_3826_pdim1 ))) )
                  {
                    {
                      ++ _3872_pp;
                    }
                  }
                  while ( ((_3871_pe < _3822_pnnz) && ((_ptr__3807_wi64[safe_add( _3816_sp,_ptr__3833_xi32[safe_add( _3831_eperm,_3871_pe )] )] % _3828_edim1) == _3875_esubj)) )
                  {
                    {
                      ++ _3871_pe;
                    }
                  }
                  int32_t _3878_numelm = (int)0;
                  while ( ((_3877_ip < _3872_pp) && (_3876_ie < _3871_pe)) )
                  {
                    {
                      int64_t _3879_psubj = (_ptr__3824_xi64[safe_add( _3823_psp,_3877_ip )] % _3826_pdim1);
                      int32_t _3880_eidx = _ptr__3833_xi32[safe_add( _3831_eperm,_3876_ie )];
                      int64_t _3881_esubi = (_ptr__3807_wi64[safe_add( _3816_sp,_3880_eidx )] / _3828_edim1);
                      if ((_3879_psubj < _3881_esubi))
                      {
                        {
                          ++ _3877_ip;
                        }
                      }
                      else if((_3879_psubj > _3881_esubi))
                      {
                        {
                          ++ _3876_ie;
                        }
                      }
                      else
                      {
                        {
                          int32_t _11023_ = _ptr__3806_wi32[safe_add( _3813_ptr,_3880_eidx )];
                          int32_t _11024_ = _ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3880_eidx ),(int)1 )];
                          for (int32_t _3882_i = _11023_; _3882_i < _11024_; ++_3882_i)
                          {
                            {
                              _ptr__3866_rf64[safe_add( _3859_rcof,_3870_nzi )] = 0.0;
                              _ptr__3865_ri64[safe_add( _3857_rnidxs,_3870_nzi )] = _ptr__3807_wi64[safe_add( _3817_nidxs,_3882_i )];
                              _ptr__3867_ri32[safe_add( _3863_rcode,_3868_codei )] = 2;
                              _ptr__3866_rf64[safe_add( _3864_rcconst,_3868_codei )] = _ptr__3808_wf64[safe_add( _3818_cof,_3882_i )];
                              ++ _3868_codei;
                              if ((_3814_ncodeatom > (int)0))
                              {
                                {
                                  int32_t _11025_ = _ptr__3806_wi32[safe_add( _3820_codeptr,_3882_i )];
                                  int32_t _11026_ = _ptr__3806_wi32[safe_add( safe_add( _3820_codeptr,_3882_i ),(int)1 )];
                                  for (int32_t _3883_k = _11025_; _3883_k < _11026_; ++_3883_k)
                                  {
                                    {
                                      _ptr__3867_ri32[safe_add( _3863_rcode,_3868_codei )] = _ptr__3806_wi32[safe_add( _3821_code,_3883_k )];
                                      _ptr__3866_rf64[safe_add( _3864_rcconst,_3868_codei )] = _ptr__3808_wf64[safe_add( _3819_cconst,_3883_k )];
                                      ++ _3868_codei;
                                    }
                                  }
                                  _ptr__3867_ri32[safe_add( _3863_rcode,_3868_codei )] = 3;
                                  ++ _3868_codei;
                                }
                              }
                              {}
                              _ptr__3867_ri32[safe_add( _3863_rcode,_3868_codei )] = 1;
                              _ptr__3866_rf64[safe_add( _3864_rcconst,_3868_codei )] = _ptr__3833_xi32[safe_add( _3829_pidxs,_3877_ip )];
                              ++ _3868_codei;
                              _ptr__3867_ri32[safe_add( _3863_rcode,_3868_codei )] = 5;
                              ++ _3868_codei;
                              _ptr__3867_ri32[safe_add( safe_add( _3862_rcodeptr,_3870_nzi ),(int)1 )] = _3868_codei;
                              ++ _3870_nzi;
                            }
                          }
                          ++ _3877_ip;
                          ++ _3876_ie;
                          ++ _3878_numelm;
                        }
                      }
                    }
                  }
                  if ((_3878_numelm > (int)0))
                  {
                    {
                      _ptr__3865_ri64[safe_add( _3858_rsp,_3869_elmi )] = _3874_psubi;
                      _ptr__3867_ri32[safe_add( safe_add( _3856_rptr,_3869_elmi ),(int)1 )] = _3870_nzi;
                      ++ _3869_elmi;
                    }
                  }
                  {}
                }
              }
            }
          }
        }
      }
      {}
      if ((!_3860_rhassp))
      {
        {
          _3803_rs->popi64(_3839_rnelem);
        }
      }
      {}
      _3805_xs->clear();
    }
  }
  else
  {
    {
      int32_t _3884_rnelem = (int)0;
      int32_t _3885_rnnz = (int)0;
      int32_t _3886_rncodeatom = (int)0;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3887_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3805_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__3887_xi32(_3887_xi32 ? _3887_xi32->raw() : nullptr,_3887_xi32 ? _3887_xi32->size(0) : 0);
      {
        int32_t _3888_pi = (int)0;
        while ( (_3888_pi < _3822_pnnz) )
        {
          {
            int64_t _3889_prow = (_ptr__3824_xi64[safe_add( _3823_psp,_3888_pi )] / _3826_pdim1);
            int64_t _3890_prowend = safe_mul( safe_add( _3889_prow,(int)1 ),_3826_pdim1 );
            bool _3891_haselm = false;
            while ( ((_3888_pi < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3888_pi )] < _3890_prowend)) )
            {
              {
                int64_t _3892_pcol = (_ptr__3824_xi64[safe_add( _3823_psp,_3888_pi )] % _3826_pdim1);
                int64_t _3893_eidx = safe_add( safe_mul( _3892_pcol,_3828_edim1 ),_3889_prow );
                int32_t _3894_n = (_ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3893_eidx ),(int)1 )] - _ptr__3806_wi32[safe_add( _3813_ptr,_3893_eidx )]);
                _3885_rnnz += _3894_n;
                _3891_haselm = true;
                int32_t _11027_;
                bool _11028_ = (_3814_ncodeatom > (int)0);
                if (_11028_)
                {
                  _11027_ = safe_add( (_ptr__3806_wi32[safe_add( _3820_codeptr,_ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3893_eidx ),(int)1 )] )] - _ptr__3806_wi32[safe_add( _3820_codeptr,_ptr__3806_wi32[safe_add( _3813_ptr,_3893_eidx )] )]),safe_mul( _3894_n,(int)4 ) );
                }
                else
                {
                  _11027_ = safe_mul( _3894_n,(int)3 );
                }
                _3886_rncodeatom += _11027_;
                ++ _3888_pi;
              }
            }
            if (_3891_haselm)
            {
              {
                ++ _3884_rnelem;
              }
            }
            {}
          }
        }
      }
      int32_t _3895_rnd = (int)1;
      bool _3896_rhassp = (_3884_rnelem < _3825_pdim0);
      _3803_rs->alloc_expr(_3895_rnd,_3884_rnelem,_3885_rnnz,_3896_rhassp,_3886_rncodeatom);
      int32_t _3897_rptr = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->ptr_base;
      int32_t _3898_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->nidxs_base;
      int32_t _11029_;
      bool _11030_ = _3896_rhassp;
      if (_11030_)
      {
        _11029_ = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->sp_base;
      }
      else
      {
        _11029_ = _3803_rs->alloci64(_3884_rnelem);
      }
      int32_t _3899_rsp = _11029_;
      int32_t _3900_rcof = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->cof_base;
      bool _3901_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->hassp;
      int32_t _3902_rshape = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->shape_base;
      int32_t _3903_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->codeptr_base;
      int32_t _3904_rcode = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->code_base;
      int32_t _3905_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _3906_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__3906_ri64(_3906_ri64 ? _3906_ri64->raw() : nullptr,_3906_ri64 ? _3906_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3907_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->f64;
      _checked_ptr_1<double> _ptr__3907_rf64(_3907_rf64 ? _3907_rf64->raw() : nullptr,_3907_rf64 ? _3907_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3908_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3803_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__3908_ri32(_3908_ri32 ? _3908_ri32->raw() : nullptr,_3908_ri32 ? _3908_ri32->size(0) : 0);
      {
        _ptr__3908_ri32[_3897_rptr] = (int)0;
        if ((_3886_rncodeatom > (int)0))
        {
          {
            _ptr__3908_ri32[_3903_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__3908_ri32[_3902_rshape] = (int32_t)_3825_pdim0;
        int32_t _3909_codei = (int)0;
        int32_t _3910_elmi = (int)0;
        int32_t _3911_nzi = (int)0;
        int32_t _3912_pi = (int)0;
        while ( (_3912_pi < _3822_pnnz) )
        {
          {
            int64_t _3913_psubi = (_ptr__3824_xi64[safe_add( _3823_psp,_3912_pi )] / _3826_pdim1);
            int64_t _3914_prowend = safe_mul( safe_add( _3913_psubi,(int)1 ),_3826_pdim1 );
            int32_t _3915_numelm = (int)0;
            while ( ((_3912_pi < _3822_pnnz) && (_ptr__3824_xi64[safe_add( _3823_psp,_3912_pi )] < _3914_prowend)) )
            {
              {
                int64_t _3916_psubj = (_ptr__3824_xi64[safe_add( _3823_psp,_3912_pi )] % _3826_pdim1);
                int64_t _3917_eidx = safe_add( safe_mul( _3916_psubj,_3828_edim1 ),_3913_psubi );
                int32_t _11031_ = _ptr__3806_wi32[safe_add( _3813_ptr,_3917_eidx )];
                int32_t _11032_ = _ptr__3806_wi32[safe_add( safe_add( _3813_ptr,_3917_eidx ),(int)1 )];
                for (int32_t _3918_k = _11031_; _3918_k < _11032_; ++_3918_k)
                {
                  {
                    _ptr__3906_ri64[safe_add( _3898_rnidxs,_3911_nzi )] = _ptr__3807_wi64[safe_add( _3817_nidxs,_3918_k )];
                    _ptr__3907_rf64[safe_add( _3900_rcof,_3911_nzi )] = 0.0;
                    _ptr__3908_ri32[safe_add( _3904_rcode,_3909_codei )] = 2;
                    _ptr__3907_rf64[safe_add( _3905_rcconst,_3909_codei )] = _ptr__3808_wf64[safe_add( _3818_cof,_3918_k )];
                    ++ _3909_codei;
                    if ((_3814_ncodeatom > (int)0))
                    {
                      {
                        int32_t _11033_ = _ptr__3806_wi32[safe_add( _3820_codeptr,_3918_k )];
                        int32_t _11034_ = _ptr__3806_wi32[safe_add( safe_add( _3820_codeptr,_3918_k ),(int)1 )];
                        for (int32_t _3919_l = _11033_; _3919_l < _11034_; ++_3919_l)
                        {
                          {
                            _ptr__3908_ri32[safe_add( _3904_rcode,_3909_codei )] = _ptr__3806_wi32[safe_add( _3821_code,_3919_l )];
                            _ptr__3907_rf64[safe_add( _3905_rcconst,_3909_codei )] = _ptr__3808_wf64[safe_add( _3819_cconst,_3919_l )];
                            ++ _3909_codei;
                          }
                        }
                        _ptr__3908_ri32[safe_add( _3904_rcode,_3909_codei )] = 3;
                        ++ _3909_codei;
                      }
                    }
                    {}
                    _ptr__3908_ri32[safe_add( _3904_rcode,_3909_codei )] = 1;
                    _ptr__3907_rf64[safe_add( _3905_rcconst,_3909_codei )] = _ptr__3887_xi32[safe_add( _3829_pidxs,_3912_pi )];
                    ++ _3909_codei;
                    _ptr__3908_ri32[safe_add( _3904_rcode,_3909_codei )] = 5;
                    ++ _3909_codei;
                    _ptr__3908_ri32[safe_add( safe_add( _3903_rcodeptr,_3911_nzi ),(int)1 )] = _3909_codei;
                    ++ _3911_nzi;
                  }
                }
                ++ _3915_numelm;
                ++ _3912_pi;
              }
            }
            if ((_3915_numelm > (int)0))
            {
              {
                _ptr__3906_ri64[safe_add( _3899_rsp,_3910_elmi )] = _3913_psubi;
                _ptr__3908_ri32[safe_add( safe_add( _3897_rptr,_3910_elmi ),(int)1 )] = _3911_nzi;
                ++ _3910_elmi;
              }
            }
            {}
          }
        }
      }
      if ((!_3901_rhassp))
      {
        {
          _3803_rs->popi64(_3884_rnelem);
        }
      }
      {}
      _3805_xs->clear();
    }
  }
}
// End mosek.fusion.ExprMulParamDiagLeft.eval

// Begin mosek.fusion.ExprMulParamDiagLeft.toString
// Method mosek.fusion.ExprMulParamDiagLeft.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:2238:6-158
std::string mosek::fusion::ExprMulParamDiagLeft :: toString() { return mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamDiagLeft::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamDiagLeft("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamDiagLeft.toString

void mosek::fusion::p_ExprMulParamDiagLeft::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamDiagLeft::destroy() { mosek::fusion::p_ExprMulParamDiagLeft::_get_impl(this)->destroy(); }
// } class ExprMulParamDiagLeft
// class ExprMulParamDiagRight { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:1842:4-2220:5
mosek::fusion::ExprMulParamDiagRight::ExprMulParamDiagRight(mosek::fusion::p_ExprMulParamDiagRight *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamDiagRight()" << this << std::endl; */ }
mosek::fusion::ExprMulParamDiagRight::~ExprMulParamDiagRight() {  /* std::cout << "~ExprMulParamDiagRight()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamDiagRight::p_ExprMulParamDiagRight
  (::mosek::fusion::ExprMulParamDiagRight * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamDiagRight.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:1846:6-1856:7
mosek::fusion::ExprMulParamDiagRight::t mosek::fusion::p_ExprMulParamDiagRight::_new_ExprMulParamDiagRight
  (monty::rc_ptr< ::mosek::fusion::Expression > _3920_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3921_p)
{ return new mosek::fusion::ExprMulParamDiagRight(_3920_e,_3921_p); }
mosek::fusion::ExprMulParamDiagRight::ExprMulParamDiagRight
  (monty::rc_ptr< ::mosek::fusion::Expression > _3920_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3921_p) : 
   ExprMulParamDiagRight(new mosek::fusion::p_ExprMulParamDiagRight(this))
{ mosek::fusion::p_ExprMulParamDiagRight::_get_impl(this)->_initialize(_3920_e,_3921_p); }
void mosek::fusion::p_ExprMulParamDiagRight::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _3920_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _3921_p)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_3920_e->getDim((int)0))}));
    mosek::fusion::p_ExprMulParamDiagRight::_get_impl(::mosek::fusion::ExprMulParamDiagRight::t(_pubthis))->p = _3921_p;
    mosek::fusion::p_ExprMulParamDiagRight::_get_impl(::mosek::fusion::ExprMulParamDiagRight::t(_pubthis))->e = _3920_e;
    if (((_3921_p->getND() != (int)2) || (_3920_e->getND() != (int)2)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
    if (((_3921_p->getDim((int)1) != _3920_e->getDim((int)0)) || (_3921_p->getDim((int)0) != _3920_e->getDim((int)1))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamDiagRight.ctor

// Begin mosek.fusion.ExprMulParamDiagRight.eval
// Method mosek.fusion.ExprMulParamDiagRight.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:1860:6-2219:7
void mosek::fusion::ExprMulParamDiagRight :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3922_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3923_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3924_xs) { mosek::fusion::p_ExprMulParamDiagRight::_get_impl(this)->eval(_3922_rs,_3923_ws,_3924_xs); }
void mosek::fusion::p_ExprMulParamDiagRight::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _3922_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _3923_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _3924_xs)
{
  e->eval(_3923_ws,_3922_rs,_3924_xs);
  _3923_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3925_wi32 = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__3925_wi32(_3925_wi32 ? _3925_wi32->raw() : nullptr,_3925_wi32 ? _3925_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3926_wi64 = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__3926_wi64(_3926_wi64 ? _3926_wi64->raw() : nullptr,_3926_wi64 ? _3926_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _3927_wf64 = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->f64;
  _checked_ptr_1<double> _ptr__3927_wf64(_3927_wf64 ? _3927_wf64->raw() : nullptr,_3927_wf64 ? _3927_wf64->size(0) : 0);
  int32_t _3928_nd = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->nd;
  int32_t _3929_nelem = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->nelem;
  int32_t _3930_nnz = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->nnz;
  bool _3931_hassp = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->hassp;
  int32_t _3932_ptr = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->ptr_base;
  int32_t _3933_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->ncodeatom;
  int32_t _3934_shape = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->shape_base;
  int32_t _3935_sp = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->sp_base;
  int32_t _3936_nidxs = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->nidxs_base;
  int32_t _3937_cof = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->cof_base;
  int32_t _3938_cconst = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->cconst_base;
  int32_t _3939_codeptr = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->codeptr_base;
  int32_t _3940_code = mosek::fusion::p_WorkStack::_get_impl(_3923_ws)->code_base;
  if (((_3928_nd != (int)2) || ((_ptr__3925_wi32[_3934_shape] != p->getDim((int)1)) || (_ptr__3925_wi32[safe_add( _3934_shape,(int)1 )] != p->getDim((int)0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
    }
  }
  {}
  int32_t _3941_pnnz = p->getNumNonzero();
  int32_t _3942_psp = _3924_xs->alloci64(_3941_pnnz);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _3943_xi64 = mosek::fusion::p_WorkStack::_get_impl(_3924_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__3943_xi64(_3943_xi64 ? _3943_xi64->raw() : nullptr,_3943_xi64 ? _3943_xi64->size(0) : 0);
  int32_t _3944_pidxs = _3924_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3945_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3924_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__3945_xi32(_3945_xi32 ? _3945_xi32->raw() : nullptr,_3945_xi32 ? _3945_xi32->size(0) : 0);
  p->getAllIndexes(_3945_xi32,_3944_pidxs);
  p->getSp(_3943_xi64,_3942_psp);
  int32_t _3946_pdim0 = p->getDim((int)0);
  int32_t _3947_pdim1 = p->getDim((int)1);
  int32_t _3948_edim0 = _ptr__3925_wi32[_3934_shape];
  int32_t _3949_edim1 = _ptr__3925_wi32[safe_add( _3934_shape,(int)1 )];
  int32_t _3950_pperm = _3924_xs->alloci32(_3941_pnnz);
  int32_t _3951_pptr = _3924_xs->alloci32(safe_add( _3947_pdim1,(int)1 ));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _3952_xi32 = mosek::fusion::p_WorkStack::_get_impl(_3924_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__3952_xi32(_3952_xi32 ? _3952_xi32->raw() : nullptr,_3952_xi32 ? _3952_xi32->size(0) : 0);
  int32_t _11035_ = (int)0;
  int32_t _11036_ = safe_add( _3947_pdim1,(int)1 );
  for (int32_t _3953_i = _11035_; _3953_i < _11036_; ++_3953_i)
  {
    {
      _ptr__3952_xi32[safe_add( _3951_pptr,_3953_i )] = (int)0;
    }
  }
  int32_t _11037_ = (int)0;
  int32_t _11038_ = _3941_pnnz;
  for (int32_t _3954_i = _11037_; _3954_i < _11038_; ++_3954_i)
  {
    {
      ++ _ptr__3952_xi32[safe_add( safe_add( _3951_pptr,(_ptr__3943_xi64[safe_add( _3942_psp,_3954_i )] % _3947_pdim1) ),(int)1 )];
    }
  }
  int32_t _11039_ = (int)1;
  int32_t _11040_ = _3947_pdim1;
  for (int32_t _3955_i = _11039_; _3955_i < _11040_; ++_3955_i)
  {
    {
      _ptr__3952_xi32[safe_add( _3951_pptr,_3955_i )] += _ptr__3952_xi32[(safe_add( _3951_pptr,_3955_i ) - (int)1)];
    }
  }
  int32_t _11041_ = (int)0;
  int32_t _11042_ = _3941_pnnz;
  for (int32_t _3956_i = _11041_; _3956_i < _11042_; ++_3956_i)
  {
    {
      int64_t _3957_colidx = (_ptr__3943_xi64[safe_add( _3942_psp,_3956_i )] % _3947_pdim1);
      _ptr__3952_xi32[safe_add( _3950_pperm,_ptr__3952_xi32[safe_add( _3951_pptr,_3957_colidx )] )] = _3956_i;
      ++ _ptr__3952_xi32[safe_add( _3951_pptr,_3957_colidx )];
    }
  }
  if (_3931_hassp)
  {
    {
      int32_t _3958_rncodeatom = (int)0;
      int32_t _3959_rnelem = (int)0;
      int32_t _3960_rnnz = (int)0;
      int32_t _3961_i1 = (int)0;
      int32_t _3962_i0 = (int)0;
      while ( ((_3962_i0 < _3929_nelem) && (_3961_i1 < _3941_pnnz)) )
      {
        {
          int64_t _3963_esubi = (_ptr__3926_wi64[safe_add( _3935_sp,_3962_i0 )] / _3949_edim1);
          int64_t _3964_psubj = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3961_i1 )] )] % _3947_pdim1);
          if ((_3963_esubi < _3964_psubj))
          {
            {
              ++ _3962_i0;
            }
          }
          else if((_3963_esubi > _3964_psubj))
          {
            {
              ++ _3961_i1;
            }
          }
          else
          {
            {
              int32_t _3965_b0 = _3962_i0;
              ++ _3962_i0;
              int32_t _3966_b1 = _3961_i1;
              ++ _3961_i1;
              while ( ((_3962_i0 < _3929_nelem) && ((_ptr__3926_wi64[safe_add( _3935_sp,_3962_i0 )] / _3949_edim1) == _3963_esubi)) )
              {
                {
                  ++ _3962_i0;
                }
              }
              while ( ((_3961_i1 < _3941_pnnz) && ((_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3961_i1 )] )] % _3947_pdim1) == _3964_psubj)) )
              {
                {
                  ++ _3961_i1;
                }
              }
              int32_t _3967_p1 = _3966_b1;
              int32_t _3968_p0 = _3965_b0;
              bool _3969_haselm = false;
              while ( ((_3968_p0 < _3962_i0) && (_3967_p1 < _3961_i1)) )
              {
                {
                  int64_t _3970_esubj = (_ptr__3926_wi64[safe_add( _3935_sp,_3968_p0 )] % _3949_edim1);
                  int64_t _3971_psubi = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3967_p1 )] )] / _3947_pdim1);
                  if ((_3970_esubj < _3971_psubi))
                  {
                    {
                      ++ _3968_p0;
                    }
                  }
                  else if((_3970_esubj > _3971_psubi))
                  {
                    {
                      ++ _3967_p1;
                    }
                  }
                  else
                  {
                    {
                      _3969_haselm = true;
                      int32_t _3972_n = (_ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_3968_p0 ),(int)1 )] - _ptr__3925_wi32[safe_add( _3932_ptr,_3968_p0 )]);
                      _3960_rnnz += _3972_n;
                      int32_t _11043_;
                      bool _11044_ = (_3933_ncodeatom > (int)0);
                      if (_11044_)
                      {
                        _11043_ = safe_add( (_ptr__3925_wi32[safe_add( _3939_codeptr,_ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_3968_p0 ),(int)1 )] )] - _ptr__3925_wi32[safe_add( _3939_codeptr,_ptr__3925_wi32[safe_add( _3932_ptr,_3968_p0 )] )]),safe_mul( _3972_n,(int)4 ) );
                      }
                      else
                      {
                        _11043_ = safe_mul( _3972_n,(int)3 );
                      }
                      _3958_rncodeatom += _11043_;
                      ++ _3968_p0;
                      ++ _3967_p1;
                    }
                  }
                }
              }
              if (_3969_haselm)
              {
                {
                  ++ _3959_rnelem;
                }
              }
              {}
            }
          }
        }
      }
      int32_t _3973_rnd = (int)1;
      bool _3974_rhassp = (_3959_rnelem < _3948_edim0);
      _3922_rs->alloc_expr(_3973_rnd,_3959_rnelem,_3960_rnnz,_3974_rhassp,_3958_rncodeatom);
      int32_t _3975_rptr = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->ptr_base;
      int32_t _3976_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->nidxs_base;
      int32_t _11045_;
      bool _11046_ = _3974_rhassp;
      if (_11046_)
      {
        _11045_ = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->sp_base;
      }
      else
      {
        _11045_ = _3922_rs->alloci64(_3959_rnelem);
      }
      int32_t _3977_rsp = _11045_;
      int32_t _3978_rcof = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->cof_base;
      bool _3979_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->hassp;
      int32_t _3980_rshape = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->shape_base;
      int32_t _3981_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->codeptr_base;
      int32_t _3982_rcode = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->code_base;
      int32_t _3983_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _3984_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__3984_ri64(_3984_ri64 ? _3984_ri64->raw() : nullptr,_3984_ri64 ? _3984_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _3985_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->f64;
      _checked_ptr_1<double> _ptr__3985_rf64(_3985_rf64 ? _3985_rf64->raw() : nullptr,_3985_rf64 ? _3985_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _3986_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__3986_ri32(_3986_ri32 ? _3986_ri32->raw() : nullptr,_3986_ri32 ? _3986_ri32->size(0) : 0);
      if ((_3959_rnelem > (int)0))
      {
        {
          _ptr__3986_ri32[_3975_rptr] = (int)0;
          if ((_3958_rncodeatom > (int)0))
          {
            {
              _ptr__3986_ri32[_3981_rcodeptr] = (int)0;
            }
          }
          {}
          _ptr__3986_ri32[_3980_rshape] = (int32_t)_3948_edim0;
          int32_t _3987_codei = (int)0;
          int32_t _3988_elmi = (int)0;
          int32_t _3989_nzi = (int)0;
          int32_t _3990_i1 = (int)0;
          int32_t _3991_i0 = (int)0;
          while ( ((_3991_i0 < _3929_nelem) && (_3990_i1 < _3941_pnnz)) )
          {
            {
              int64_t _3992_esubi = (_ptr__3926_wi64[safe_add( _3935_sp,_3991_i0 )] / _3949_edim1);
              int64_t _3993_psubj = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3990_i1 )] )] % _3947_pdim1);
              if ((_3992_esubi < _3993_psubj))
              {
                {
                  while ( ((_3991_i0 < _3929_nelem) && ((_ptr__3926_wi64[safe_add( _3935_sp,_3991_i0 )] / _3949_edim1) == _3992_esubi)) )
                  {
                    {
                      ++ _3991_i0;
                    }
                  }
                }
              }
              else if((_3992_esubi > _3993_psubj))
              {
                {
                  while ( ((_3990_i1 < _3941_pnnz) && ((_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3990_i1 )] )] % _3947_pdim1) == _3993_psubj)) )
                  {
                    {
                      ++ _3990_i1;
                    }
                  }
                }
              }
              else
              {
                {
                  int32_t _3994_b0 = _3991_i0;
                  ++ _3991_i0;
                  int32_t _3995_b1 = _3990_i1;
                  ++ _3990_i1;
                  while ( ((_3991_i0 < _3929_nelem) && ((_ptr__3926_wi64[safe_add( _3935_sp,_3991_i0 )] / _3949_edim1) == _3992_esubi)) )
                  {
                    {
                      ++ _3991_i0;
                    }
                  }
                  while ( ((_3990_i1 < _3941_pnnz) && ((_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3990_i1 )] )] % _3947_pdim1) == _3993_psubj)) )
                  {
                    {
                      ++ _3990_i1;
                    }
                  }
                  int32_t _3996_p1 = _3995_b1;
                  int32_t _3997_p0 = _3994_b0;
                  int32_t _3998_numelm = (int)0;
                  while ( ((_3997_p0 < _3991_i0) && (_3996_p1 < _3990_i1)) )
                  {
                    {
                      int64_t _3999_esubj = (_ptr__3926_wi64[safe_add( _3935_sp,_3997_p0 )] % _3949_edim1);
                      int64_t _4000_psubi = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_3996_p1 )] )] / _3947_pdim1);
                      if ((_3999_esubj < _4000_psubi))
                      {
                        {
                          ++ _3997_p0;
                        }
                      }
                      else if((_3999_esubj > _4000_psubi))
                      {
                        {
                          ++ _3996_p1;
                        }
                      }
                      else
                      {
                        {
                          int32_t _11047_ = _ptr__3925_wi32[safe_add( _3932_ptr,_3997_p0 )];
                          int32_t _11048_ = _ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_3997_p0 ),(int)1 )];
                          for (int32_t _4001_j = _11047_; _4001_j < _11048_; ++_4001_j)
                          {
                            {
                              _ptr__3984_ri64[safe_add( _3976_rnidxs,_3989_nzi )] = _ptr__3926_wi64[safe_add( _3936_nidxs,_4001_j )];
                              _ptr__3985_rf64[safe_add( _3978_rcof,_3989_nzi )] = 0.0;
                              _ptr__3986_ri32[safe_add( _3982_rcode,_3987_codei )] = 2;
                              _ptr__3985_rf64[safe_add( _3983_rcconst,_3987_codei )] = _ptr__3927_wf64[safe_add( _3937_cof,_4001_j )];
                              ++ _3987_codei;
                              if ((_3933_ncodeatom > (int)0))
                              {
                                {
                                  int32_t _11049_ = _ptr__3925_wi32[safe_add( _3939_codeptr,_4001_j )];
                                  int32_t _11050_ = _ptr__3925_wi32[safe_add( safe_add( _3939_codeptr,_4001_j ),(int)1 )];
                                  for (int32_t _4002_k = _11049_; _4002_k < _11050_; ++_4002_k)
                                  {
                                    {
                                      _ptr__3986_ri32[safe_add( _3982_rcode,_3987_codei )] = _ptr__3925_wi32[safe_add( _3940_code,_4002_k )];
                                      _ptr__3985_rf64[safe_add( _3983_rcconst,_3987_codei )] = _ptr__3927_wf64[safe_add( _3938_cconst,_4002_k )];
                                      ++ _3987_codei;
                                    }
                                  }
                                  _ptr__3986_ri32[safe_add( _3982_rcode,_3987_codei )] = 3;
                                  ++ _3987_codei;
                                }
                              }
                              {}
                              _ptr__3986_ri32[safe_add( _3982_rcode,_3987_codei )] = 1;
                              _ptr__3985_rf64[safe_add( _3983_rcconst,_3987_codei )] = _ptr__3952_xi32[safe_add( _3944_pidxs,_ptr__3952_xi32[safe_add( _3950_pperm,_3996_p1 )] )];
                              ++ _3987_codei;
                              _ptr__3986_ri32[safe_add( _3982_rcode,_3987_codei )] = 5;
                              ++ _3987_codei;
                              _ptr__3986_ri32[safe_add( safe_add( _3981_rcodeptr,_3989_nzi ),(int)1 )] = _3987_codei;
                              ++ _3989_nzi;
                            }
                          }
                          ++ _3998_numelm;
                          ++ _3997_p0;
                          ++ _3996_p1;
                        }
                      }
                    }
                  }
                  if ((_3998_numelm > (int)0))
                  {
                    {
                      _ptr__3984_ri64[safe_add( _3977_rsp,_3988_elmi )] = _3992_esubi;
                      _ptr__3986_ri32[safe_add( safe_add( _3975_rptr,_3988_elmi ),(int)1 )] = _3989_nzi;
                      ++ _3988_elmi;
                    }
                  }
                  {}
                }
              }
            }
          }
          if ((_3959_rnelem > _ptr__3986_ri32[_3980_rshape]))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid shape"));
            }
          }
          {}
          if ((_3988_elmi != _3959_rnelem))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num elements"));
            }
          }
          {}
          if ((_3989_nzi != _3960_rnnz))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num nonzeros"));
            }
          }
          {}
        }
      }
      {}
      if ((!_3979_rhassp))
      {
        {
          _3922_rs->popi64(_3959_rnelem);
        }
      }
      {}
      _3924_xs->clear();
    }
  }
  else
  {
    {
      int32_t _4003_rncodeatom = (int)0;
      int32_t _4004_rnelem = (int)0;
      int32_t _4005_rnnz = (int)0;
      int32_t _4006_i1 = (int)0;
      while ( (_4006_i1 < _3941_pnnz) )
      {
        {
          int64_t _4007_psubj = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4006_i1 )] )] % _3947_pdim1);
          int32_t _4008_b1 = _4006_i1;
          ++ _4006_i1;
          while ( ((_4006_i1 < _3941_pnnz) && ((_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4006_i1 )] )] % _3947_pdim1) == _4007_psubj)) )
          {
            {
              ++ _4006_i1;
            }
          }
          int32_t _11051_ = _4008_b1;
          int32_t _11052_ = _4006_i1;
          for (int32_t _4009_k1 = _11051_; _4009_k1 < _11052_; ++_4009_k1)
          {
            {
              int64_t _4010_psubi = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4006_i1 )] )] / _3947_pdim1);
              int64_t _4011_eidx = safe_add( safe_mul( _4007_psubj,_3949_edim1 ),_4010_psubi );
              int32_t _4012_n = (_ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_4011_eidx ),(int)1 )] - _ptr__3925_wi32[safe_add( _3932_ptr,_4011_eidx )]);
              _4005_rnnz += _4012_n;
              int32_t _11053_;
              bool _11054_ = (_3933_ncodeatom > (int)0);
              if (_11054_)
              {
                _11053_ = safe_add( (_ptr__3925_wi32[safe_add( _3939_codeptr,_ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_4011_eidx ),(int)1 )] )] - _ptr__3925_wi32[safe_add( _3939_codeptr,_ptr__3925_wi32[safe_add( _3932_ptr,_4011_eidx )] )]),safe_mul( _4012_n,(int)4 ) );
              }
              else
              {
                _11053_ = safe_mul( _4012_n,(int)3 );
              }
              _4003_rncodeatom += _11053_;
            }
          }
          ++ _4004_rnelem;
        }
      }
      int32_t _4013_rnd = (int)1;
      bool _4014_rhassp = (_4004_rnelem < _3948_edim0);
      _3922_rs->alloc_expr(_4013_rnd,_4004_rnelem,_4005_rnnz,_4014_rhassp,_4003_rncodeatom);
      int32_t _4015_rptr = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->ptr_base;
      int32_t _4016_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->nidxs_base;
      int32_t _11055_;
      bool _11056_ = _4014_rhassp;
      if (_11056_)
      {
        _11055_ = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->sp_base;
      }
      else
      {
        _11055_ = _3922_rs->alloci64(_4004_rnelem);
      }
      int32_t _4017_rsp = _11055_;
      int32_t _4018_rcof = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->cof_base;
      bool _4019_rhassp = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->hassp;
      int32_t _4020_rshape = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->shape_base;
      int32_t _4021_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->codeptr_base;
      int32_t _4022_rcode = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->code_base;
      int32_t _4023_rcconst = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4024_ri64 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4024_ri64(_4024_ri64 ? _4024_ri64->raw() : nullptr,_4024_ri64 ? _4024_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4025_rf64 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->f64;
      _checked_ptr_1<double> _ptr__4025_rf64(_4025_rf64 ? _4025_rf64->raw() : nullptr,_4025_rf64 ? _4025_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4026_ri32 = mosek::fusion::p_WorkStack::_get_impl(_3922_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4026_ri32(_4026_ri32 ? _4026_ri32->raw() : nullptr,_4026_ri32 ? _4026_ri32->size(0) : 0);
      {
        _ptr__4026_ri32[_4015_rptr] = (int)0;
        if ((_4003_rncodeatom > (int)0))
        {
          {
            _ptr__4026_ri32[_4021_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__4026_ri32[_4020_rshape] = (int32_t)_3948_edim0;
        int32_t _4027_codei = (int)0;
        int32_t _4028_elmi = (int)0;
        int32_t _4029_nzi = (int)0;
        int32_t _4030_i1 = (int)0;
        while ( (_4030_i1 < _3941_pnnz) )
        {
          {
            int64_t _4031_psubj = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4030_i1 )] )] % _3947_pdim1);
            int32_t _4032_b1 = _4030_i1;
            ++ _4030_i1;
            while ( ((_4030_i1 < _3941_pnnz) && ((_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4030_i1 )] )] % _3947_pdim1) == _4031_psubj)) )
            {
              {
                ++ _4030_i1;
              }
            }
            int32_t _11057_ = _4032_b1;
            int32_t _11058_ = _4030_i1;
            for (int32_t _4033_k1 = _11057_; _4033_k1 < _11058_; ++_4033_k1)
            {
              {
                int64_t _4034_psubi = (_ptr__3943_xi64[safe_add( _3942_psp,_ptr__3952_xi32[safe_add( _3950_pperm,_4033_k1 )] )] / _3947_pdim1);
                int64_t _4035_eidx = safe_add( safe_mul( _4031_psubj,_3949_edim1 ),_4034_psubi );
                int32_t _11059_ = _ptr__3925_wi32[safe_add( _3932_ptr,_4035_eidx )];
                int32_t _11060_ = _ptr__3925_wi32[safe_add( safe_add( _3932_ptr,_4035_eidx ),(int)1 )];
                for (int32_t _4036_i = _11059_; _4036_i < _11060_; ++_4036_i)
                {
                  {
                    _ptr__4024_ri64[safe_add( _4016_rnidxs,_4029_nzi )] = _ptr__3926_wi64[safe_add( _3936_nidxs,_4036_i )];
                    _ptr__4025_rf64[safe_add( _4018_rcof,_4029_nzi )] = 0.0;
                    _ptr__4026_ri32[safe_add( _4022_rcode,_4027_codei )] = 2;
                    _ptr__4025_rf64[safe_add( _4023_rcconst,_4027_codei )] = _ptr__3927_wf64[safe_add( _3937_cof,_4036_i )];
                    ++ _4027_codei;
                    if ((_3933_ncodeatom > (int)0))
                    {
                      {
                        int32_t _11061_ = _ptr__3925_wi32[safe_add( _3939_codeptr,_4036_i )];
                        int32_t _11062_ = _ptr__3925_wi32[safe_add( safe_add( _3939_codeptr,_4036_i ),(int)1 )];
                        for (int32_t _4037_k = _11061_; _4037_k < _11062_; ++_4037_k)
                        {
                          {
                            _ptr__4026_ri32[safe_add( _4022_rcode,_4027_codei )] = _ptr__3925_wi32[safe_add( _3940_code,_4037_k )];
                            _ptr__4025_rf64[safe_add( _4023_rcconst,_4027_codei )] = _ptr__3927_wf64[safe_add( _3938_cconst,_4037_k )];
                            ++ _4027_codei;
                          }
                        }
                        _ptr__4026_ri32[safe_add( _4022_rcode,_4027_codei )] = 3;
                        ++ _4027_codei;
                      }
                    }
                    {}
                    _ptr__4026_ri32[safe_add( _4022_rcode,_4027_codei )] = 1;
                    _ptr__4025_rf64[safe_add( _4023_rcconst,_4027_codei )] = _ptr__3952_xi32[safe_add( _3944_pidxs,_ptr__3952_xi32[safe_add( _3950_pperm,_4033_k1 )] )];
                    ++ _4027_codei;
                    _ptr__4026_ri32[safe_add( _4022_rcode,_4027_codei )] = 5;
                    ++ _4027_codei;
                    _ptr__4026_ri32[safe_add( safe_add( _4021_rcodeptr,_4029_nzi ),(int)1 )] = _4027_codei;
                    ++ _4029_nzi;
                  }
                }
              }
            }
            _ptr__4024_ri64[safe_add( _4017_rsp,_4028_elmi )] = _4031_psubj;
            _ptr__4026_ri32[safe_add( safe_add( _4015_rptr,_4028_elmi ),(int)1 )] = _4029_nzi;
            ++ _4028_elmi;
          }
        }
        if ((_4004_rnelem > _ptr__4026_ri32[_4020_rshape]))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid shape"));
          }
        }
        {}
        if ((_4028_elmi != _4004_rnelem))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num elements"));
          }
        }
        {}
        if ((_4029_nzi != _4005_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num nonzeros"));
          }
        }
        {}
      }
      if ((!_4019_rhassp))
      {
        {
          _3922_rs->popi64(_4004_rnelem);
        }
      }
      {}
      _3924_xs->clear();
    }
  }
}
// End mosek.fusion.ExprMulParamDiagRight.eval

// Begin mosek.fusion.ExprMulParamDiagRight.toString
// Method mosek.fusion.ExprMulParamDiagRight.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:1858:6-159
std::string mosek::fusion::ExprMulParamDiagRight :: toString() { return mosek::fusion::p_ExprMulParamDiagRight::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamDiagRight::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamDiagRight("))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamDiagRight.toString

void mosek::fusion::p_ExprMulParamDiagRight::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamDiagRight::destroy() { mosek::fusion::p_ExprMulParamDiagRight::_get_impl(this)->destroy(); }
// } class ExprMulParamDiagRight
// class ExprDotParam { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:1641:4-1837:5
mosek::fusion::ExprDotParam::ExprDotParam(mosek::fusion::p_ExprDotParam *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprDotParam()" << this << std::endl; */ }
mosek::fusion::ExprDotParam::~ExprDotParam() {  /* std::cout << "~ExprDotParam()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprDotParam::p_ExprDotParam
  (::mosek::fusion::ExprDotParam * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprDotParam.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:1645:6-1655:7
mosek::fusion::ExprDotParam::t mosek::fusion::p_ExprDotParam::_new_ExprDotParam
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4038_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4039_e)
{ return new mosek::fusion::ExprDotParam(_4038_p,_4039_e); }
mosek::fusion::ExprDotParam::ExprDotParam
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4038_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4039_e) : 
   ExprDotParam(new mosek::fusion::p_ExprDotParam(this))
{ mosek::fusion::p_ExprDotParam::_get_impl(this)->_initialize(_4038_p,_4039_e); }
void mosek::fusion::p_ExprDotParam::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _4038_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4039_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))));
    mosek::fusion::p_ExprDotParam::_get_impl(::mosek::fusion::ExprDotParam::t(_pubthis))->p = _4038_p;
    mosek::fusion::p_ExprDotParam::_get_impl(::mosek::fusion::ExprDotParam::t(_pubthis))->e = _4039_e;
    if ((_4038_p->getND() != _4039_e->getND()))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    {}
    int32_t _11063_ = (int)0;
    int32_t _11064_ = _4038_p->getND();
    for (int32_t _4040_i = _11063_; _4040_i < _11064_; ++_4040_i)
    {
      {
        if ((_4038_p->getDim(_4040_i) != _4039_e->getDim(_4040_i)))
        {
          {
            throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
          }
        }
        {}
      }
    }
  }
}
// mosek.fusion.ExprDotParam.ctor

// Begin mosek.fusion.ExprDotParam.eval
// Method mosek.fusion.ExprDotParam.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:1659:6-1836:7
void mosek::fusion::ExprDotParam :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4041_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4042_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4043_xs) { mosek::fusion::p_ExprDotParam::_get_impl(this)->eval(_4041_rs,_4042_ws,_4043_xs); }
void mosek::fusion::p_ExprDotParam::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4041_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4042_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4043_xs)
{
  e->eval(_4042_ws,_4041_rs,_4043_xs);
  _4042_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4044_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4044_wi32(_4044_wi32 ? _4044_wi32->raw() : nullptr,_4044_wi32 ? _4044_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4045_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4045_wi64(_4045_wi64 ? _4045_wi64->raw() : nullptr,_4045_wi64 ? _4045_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4046_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->f64;
  _checked_ptr_1<double> _ptr__4046_wf64(_4046_wf64 ? _4046_wf64->raw() : nullptr,_4046_wf64 ? _4046_wf64->size(0) : 0);
  int32_t _4047_nd = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->nd;
  int32_t _4048_nelem = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->nelem;
  int32_t _4049_nnz = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->nnz;
  bool _4050_hassp = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->hassp;
  int32_t _4051_ptr = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->ptr_base;
  int32_t _4052_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->ncodeatom;
  int32_t _4053_shape = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->shape_base;
  int32_t _4054_sp = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->sp_base;
  int32_t _4055_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->nidxs_base;
  int32_t _4056_cof = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->cof_base;
  int32_t _4057_cconst = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->cconst_base;
  int32_t _4058_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->codeptr_base;
  int32_t _4059_code = mosek::fusion::p_WorkStack::_get_impl(_4042_ws)->code_base;
  int32_t _4060_pnnz = p->getNumNonzero();
  int32_t _4061_psp = _4043_xs->alloci64(_4060_pnnz);
  p->getSp(mosek::fusion::p_WorkStack::_get_impl(_4043_xs)->i64,_4061_psp);
  int32_t _4062_pidxs = _4043_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4063_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4043_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4063_xi32(_4063_xi32 ? _4063_xi32->raw() : nullptr,_4063_xi32 ? _4063_xi32->size(0) : 0);
  p->getAllIndexes(_4063_xi32,_4062_pidxs);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4064_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4043_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__4064_xi64(_4064_xi64 ? _4064_xi64->raw() : nullptr,_4064_xi64 ? _4064_xi64->size(0) : 0);
  int32_t _4065_rnnz = (int)0;
  int32_t _4066_rnelem = (int)1;
  int32_t _4067_rncodeatom = (int)0;
  if (_4050_hassp)
  {
    {
      int32_t _4068_ei = (int)0;
      int32_t _4069_pi = (int)0;
      while ( ((_4068_ei < _4048_nelem) && (_4069_pi < _4060_pnnz)) )
      {
        {
          if ((_ptr__4045_wi64[safe_add( _4054_sp,_4068_ei )] < _ptr__4064_xi64[safe_add( _4061_psp,_4069_pi )]))
          {
            {
              ++ _4068_ei;
            }
          }
          else if((_ptr__4045_wi64[safe_add( _4054_sp,_4068_ei )] > _ptr__4064_xi64[safe_add( _4061_psp,_4069_pi )]))
          {
            {
              ++ _4069_pi;
            }
          }
          else
          {
            {
              int32_t _4070_n = (_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_4068_ei ),(int)1 )] - _ptr__4044_wi32[safe_add( _4051_ptr,_4068_ei )]);
              _4065_rnnz += _4070_n;
              int32_t _11065_;
              bool _11066_ = (_4052_ncodeatom > (int)0);
              if (_11066_)
              {
                _11065_ = safe_add( (_ptr__4044_wi32[safe_add( _4058_codeptr,_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_4068_ei ),(int)1 )] )] - _ptr__4044_wi32[safe_add( _4058_codeptr,_ptr__4044_wi32[safe_add( _4051_ptr,_4068_ei )] )]),safe_mul( (int)4,_4070_n ) );
              }
              else
              {
                _11065_ = safe_mul( (int)3,_4070_n );
              }
              _4067_rncodeatom += _11065_;
              ++ _4068_ei;
              ++ _4069_pi;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _11067_ = (int)0;
      int32_t _11068_ = _4060_pnnz;
      for (int32_t _4071_i = _11067_; _4071_i < _11068_; ++_4071_i)
      {
        {
          _4065_rnnz += (_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4071_i )] ),(int)1 )] - _ptr__4044_wi32[safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4071_i )] )]);
        }
      }
      if ((_4052_ncodeatom > (int)0))
      {
        {
          int32_t _11069_ = (int)0;
          int32_t _11070_ = _4060_pnnz;
          for (int32_t _4072_i = _11069_; _4072_i < _11070_; ++_4072_i)
          {
            {
              _4067_rncodeatom += safe_add( (_ptr__4044_wi32[safe_add( _4058_codeptr,_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4072_i )] ),(int)1 )] )] - _ptr__4044_wi32[safe_add( _4058_codeptr,_ptr__4044_wi32[safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4072_i )] )] )]),safe_mul( (int)4,(_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4072_i )] ),(int)1 )] - _ptr__4044_wi32[safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4072_i )] )]) ) );
            }
          }
        }
      }
      else
      {
        {
          int32_t _11071_ = (int)0;
          int32_t _11072_ = _4060_pnnz;
          for (int32_t _4073_i = _11071_; _4073_i < _11072_; ++_4073_i)
          {
            {
              _4067_rncodeatom += safe_mul( (int)3,(_ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4073_i )] ),(int)1 )] - _ptr__4044_wi32[safe_add( _4051_ptr,_ptr__4064_xi64[safe_add( _4061_psp,_4073_i )] )]) );
            }
          }
        }
      }
    }
  }
  int64_t _4074_rsz = (int)1;
  int32_t _11073_ = (int)0;
  int32_t _11074_ = _4047_nd;
  for (int32_t _4075_i = _11073_; _4075_i < _11074_; ++_4075_i)
  {
    {
      _4074_rsz *= _ptr__4044_wi32[safe_add( _4053_shape,_4075_i )];
    }
  }
  _4041_rs->alloc_expr((int)0,_4066_rnelem,_4065_rnnz,false,_4067_rncodeatom);
  int32_t _4076_rptr = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->ptr_base;
  int32_t _4077_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->nidxs_base;
  int32_t _4078_rcof = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->cof_base;
  bool _4079_rhassp = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->hassp;
  int32_t _4080_rshape = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->shape_base;
  int32_t _4081_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->codeptr_base;
  int32_t _4082_rcode = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->code_base;
  int32_t _4083_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4084_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__4084_ri64(_4084_ri64 ? _4084_ri64->raw() : nullptr,_4084_ri64 ? _4084_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4085_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->f64;
  _checked_ptr_1<double> _ptr__4085_rf64(_4085_rf64 ? _4085_rf64->raw() : nullptr,_4085_rf64 ? _4085_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4086_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4041_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__4086_ri32(_4086_ri32 ? _4086_ri32->raw() : nullptr,_4086_ri32 ? _4086_ri32->size(0) : 0);
  _ptr__4086_ri32[_4076_rptr] = (int)0;
  _ptr__4086_ri32[safe_add( _4076_rptr,(int)1 )] = _4065_rnnz;
  if ((_4067_rncodeatom > (int)0))
  {
    {
      _ptr__4086_ri32[_4081_rcodeptr] = (int)0;
    }
  }
  {}
  if (_4050_hassp)
  {
    {
      int32_t _4087_codei = (int)0;
      int32_t _4088_nzi = (int)0;
      int32_t _4089_elmi = (int)0;
      int32_t _4090_ei = (int)0;
      int32_t _4091_pi = (int)0;
      while ( ((_4090_ei < _4048_nelem) && (_4091_pi < _4060_pnnz)) )
      {
        {
          if ((_ptr__4045_wi64[safe_add( _4054_sp,_4090_ei )] < _ptr__4064_xi64[safe_add( _4061_psp,_4091_pi )]))
          {
            {
              ++ _4090_ei;
            }
          }
          else if((_ptr__4045_wi64[safe_add( _4054_sp,_4090_ei )] > _ptr__4064_xi64[safe_add( _4061_psp,_4091_pi )]))
          {
            {
              ++ _4091_pi;
            }
          }
          else
          {
            {
              int32_t _11075_ = _ptr__4044_wi32[safe_add( _4051_ptr,_4090_ei )];
              int32_t _11076_ = _ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_4090_ei ),(int)1 )];
              for (int32_t _4092_i = _11075_; _4092_i < _11076_; ++_4092_i)
              {
                {
                  _ptr__4084_ri64[safe_add( _4077_rnidxs,_4088_nzi )] = _ptr__4045_wi64[safe_add( _4055_nidxs,_4092_i )];
                  _ptr__4085_rf64[safe_add( _4078_rcof,_4088_nzi )] = 0.0;
                  _ptr__4086_ri32[safe_add( _4082_rcode,_4087_codei )] = 2;
                  _ptr__4085_rf64[safe_add( _4083_rcconst,_4087_codei )] = _ptr__4046_wf64[safe_add( _4056_cof,_4092_i )];
                  ++ _4087_codei;
                  if ((_4052_ncodeatom > (int)0))
                  {
                    {
                      int32_t _11077_ = _ptr__4044_wi32[safe_add( _4058_codeptr,_4092_i )];
                      int32_t _11078_ = _ptr__4044_wi32[safe_add( safe_add( _4058_codeptr,_4092_i ),(int)1 )];
                      for (int32_t _4093_k = _11077_; _4093_k < _11078_; ++_4093_k)
                      {
                        {
                          _ptr__4086_ri32[safe_add( _4082_rcode,_4087_codei )] = _ptr__4044_wi32[safe_add( _4059_code,_4093_k )];
                          _ptr__4085_rf64[safe_add( _4083_rcconst,_4087_codei )] = _ptr__4046_wf64[safe_add( _4057_cconst,_4093_k )];
                          ++ _4087_codei;
                        }
                      }
                      _ptr__4086_ri32[safe_add( _4082_rcode,_4087_codei )] = 3;
                      ++ _4087_codei;
                    }
                  }
                  {}
                  _ptr__4086_ri32[safe_add( _4082_rcode,_4087_codei )] = 1;
                  _ptr__4085_rf64[safe_add( _4083_rcconst,_4087_codei )] = _ptr__4063_xi32[safe_add( _4062_pidxs,_4091_pi )];
                  ++ _4087_codei;
                  _ptr__4086_ri32[safe_add( _4082_rcode,_4087_codei )] = 5;
                  ++ _4087_codei;
                  _ptr__4086_ri32[safe_add( safe_add( _4081_rcodeptr,_4088_nzi ),(int)1 )] = _4087_codei;
                  ++ _4088_nzi;
                }
              }
              ++ _4090_ei;
              ++ _4091_pi;
            }
          }
        }
      }
      if ((_4089_elmi != _4066_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken elmi"));
        }
      }
      {}
      if ((_4088_nzi != _4065_rnnz))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken nzi"));
        }
      }
      {}
      if ((_4087_codei != _4067_rncodeatom))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken codei"));
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _4094_codei = (int)0;
      int32_t _4095_nzi = (int)0;
      int32_t _11079_ = (int)0;
      int32_t _11080_ = _4060_pnnz;
      for (int32_t _4096_pi = _11079_; _4096_pi < _11080_; ++_4096_pi)
      {
        {
          int32_t _4097_elmi = _4096_pi;
          int64_t _4098_ei = _ptr__4064_xi64[safe_add( _4061_psp,_4096_pi )];
          int32_t _11081_ = _ptr__4044_wi32[safe_add( _4051_ptr,_4098_ei )];
          int32_t _11082_ = _ptr__4044_wi32[safe_add( safe_add( _4051_ptr,_4098_ei ),(int)1 )];
          for (int32_t _4099_i = _11081_; _4099_i < _11082_; ++_4099_i)
          {
            {
              _ptr__4084_ri64[safe_add( _4077_rnidxs,_4095_nzi )] = _ptr__4045_wi64[safe_add( _4055_nidxs,_4099_i )];
              _ptr__4085_rf64[safe_add( _4078_rcof,_4095_nzi )] = 0.0;
              _ptr__4086_ri32[safe_add( _4082_rcode,_4094_codei )] = 2;
              _ptr__4085_rf64[safe_add( _4083_rcconst,_4094_codei )] = _ptr__4046_wf64[safe_add( _4056_cof,_4099_i )];
              ++ _4094_codei;
              if ((_4052_ncodeatom > (int)0))
              {
                {
                  int32_t _11083_ = _ptr__4044_wi32[safe_add( _4058_codeptr,_4099_i )];
                  int32_t _11084_ = _ptr__4044_wi32[safe_add( safe_add( _4058_codeptr,_4099_i ),(int)1 )];
                  for (int32_t _4100_k = _11083_; _4100_k < _11084_; ++_4100_k)
                  {
                    {
                      _ptr__4086_ri32[safe_add( _4082_rcode,_4094_codei )] = _ptr__4044_wi32[safe_add( _4059_code,_4100_k )];
                      _ptr__4085_rf64[safe_add( _4083_rcconst,_4094_codei )] = _ptr__4046_wf64[safe_add( _4057_cconst,_4100_k )];
                      ++ _4094_codei;
                    }
                  }
                  _ptr__4086_ri32[safe_add( _4082_rcode,_4094_codei )] = 3;
                  ++ _4094_codei;
                }
              }
              {}
              _ptr__4086_ri32[safe_add( _4082_rcode,_4094_codei )] = 1;
              _ptr__4085_rf64[safe_add( _4083_rcconst,_4094_codei )] = _ptr__4063_xi32[safe_add( _4062_pidxs,_4096_pi )];
              ++ _4094_codei;
              _ptr__4086_ri32[safe_add( _4082_rcode,_4094_codei )] = 5;
              ++ _4094_codei;
              _ptr__4086_ri32[safe_add( safe_add( _4081_rcodeptr,_4095_nzi ),(int)1 )] = _4094_codei;
              ++ _4095_nzi;
            }
          }
        }
      }
      if ((_4095_nzi != _4065_rnnz))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid nzi"));
        }
      }
      {}
      if ((_4094_codei != _4067_rncodeatom))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid codei"));
        }
      }
      {}
    }
  }
  _4043_xs->clear();
}
// End mosek.fusion.ExprDotParam.eval

// Begin mosek.fusion.ExprDotParam.toString
// Method mosek.fusion.ExprDotParam.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:1657:6-150
std::string mosek::fusion::ExprDotParam :: toString() { return mosek::fusion::p_ExprDotParam::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprDotParam::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprDotParam("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprDotParam.toString

void mosek::fusion::p_ExprDotParam::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprDotParam::destroy() { mosek::fusion::p_ExprDotParam::_get_impl(this)->destroy(); }
// } class ExprDotParam
// class ExprMulParamElem { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:1410:4-1636:5
mosek::fusion::ExprMulParamElem::ExprMulParamElem(mosek::fusion::p_ExprMulParamElem *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamElem()" << this << std::endl; */ }
mosek::fusion::ExprMulParamElem::~ExprMulParamElem() {  /* std::cout << "~ExprMulParamElem()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamElem::p_ExprMulParamElem
  (::mosek::fusion::ExprMulParamElem * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamElem.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:1414:6-1424:7
mosek::fusion::ExprMulParamElem::t mosek::fusion::p_ExprMulParamElem::_new_ExprMulParamElem
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4101_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4102_e)
{ return new mosek::fusion::ExprMulParamElem(_4101_p,_4102_e); }
mosek::fusion::ExprMulParamElem::ExprMulParamElem
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4101_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4102_e) : 
   ExprMulParamElem(new mosek::fusion::p_ExprMulParamElem(this))
{ mosek::fusion::p_ExprMulParamElem::_get_impl(this)->_initialize(_4101_p,_4102_e); }
void mosek::fusion::p_ExprMulParamElem::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _4101_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4102_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_4102_e->getShape());
    mosek::fusion::p_ExprMulParamElem::_get_impl(::mosek::fusion::ExprMulParamElem::t(_pubthis))->p = _4101_p;
    mosek::fusion::p_ExprMulParamElem::_get_impl(::mosek::fusion::ExprMulParamElem::t(_pubthis))->e = _4102_e;
    if ((_4101_p->getND() != _4102_e->getND()))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    {}
    int32_t _11085_ = (int)0;
    int32_t _11086_ = _4101_p->getND();
    for (int32_t _4103_i = _11085_; _4103_i < _11086_; ++_4103_i)
    {
      {
        if ((_4101_p->getDim(_4103_i) != _4102_e->getDim(_4103_i)))
        {
          {
            throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
          }
        }
        {}
      }
    }
  }
}
// mosek.fusion.ExprMulParamElem.ctor

// Begin mosek.fusion.ExprMulParamElem.eval
// Method mosek.fusion.ExprMulParamElem.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:1428:6-1635:7
void mosek::fusion::ExprMulParamElem :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4104_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4105_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4106_xs) { mosek::fusion::p_ExprMulParamElem::_get_impl(this)->eval(_4104_rs,_4105_ws,_4106_xs); }
void mosek::fusion::p_ExprMulParamElem::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4104_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4105_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4106_xs)
{
  e->eval(_4105_ws,_4104_rs,_4106_xs);
  _4105_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4107_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4107_wi32(_4107_wi32 ? _4107_wi32->raw() : nullptr,_4107_wi32 ? _4107_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4108_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4108_wi64(_4108_wi64 ? _4108_wi64->raw() : nullptr,_4108_wi64 ? _4108_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4109_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->f64;
  _checked_ptr_1<double> _ptr__4109_wf64(_4109_wf64 ? _4109_wf64->raw() : nullptr,_4109_wf64 ? _4109_wf64->size(0) : 0);
  int32_t _4110_nd = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->nd;
  int32_t _4111_nelem = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->nelem;
  int32_t _4112_nnz = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->nnz;
  bool _4113_hassp = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->hassp;
  int32_t _4114_ptr = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->ptr_base;
  int32_t _4115_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->ncodeatom;
  int32_t _4116_shape = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->shape_base;
  int32_t _4117_sp = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->sp_base;
  int32_t _4118_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->nidxs_base;
  int32_t _4119_cof = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->cof_base;
  int32_t _4120_cconst = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->cconst_base;
  int32_t _4121_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->codeptr_base;
  int32_t _4122_code = mosek::fusion::p_WorkStack::_get_impl(_4105_ws)->code_base;
  int32_t _4123_pnnz = p->getNumNonzero();
  int32_t _4124_psp = _4106_xs->alloci64(_4123_pnnz);
  p->getSp(mosek::fusion::p_WorkStack::_get_impl(_4106_xs)->i64,_4124_psp);
  int32_t _4125_pidxs = _4106_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4126_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4106_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4126_xi32(_4126_xi32 ? _4126_xi32->raw() : nullptr,_4126_xi32 ? _4126_xi32->size(0) : 0);
  p->getAllIndexes(_4126_xi32,_4125_pidxs);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4127_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4106_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__4127_xi64(_4127_xi64 ? _4127_xi64->raw() : nullptr,_4127_xi64 ? _4127_xi64->size(0) : 0);
  int32_t _4128_rnd = _4110_nd;
  int32_t _4129_rnnz = (int)0;
  int32_t _4130_rnelem = (int)0;
  int32_t _4131_rncodeatom = (int)0;
  if (_4113_hassp)
  {
    {
      int32_t _4132_ei = (int)0;
      int32_t _4133_pi = (int)0;
      while ( ((_4132_ei < _4111_nelem) && (_4133_pi < _4123_pnnz)) )
      {
        {
          if ((_ptr__4108_wi64[safe_add( _4117_sp,_4132_ei )] < _ptr__4127_xi64[safe_add( _4124_psp,_4133_pi )]))
          {
            {
              ++ _4132_ei;
            }
          }
          else if((_ptr__4108_wi64[safe_add( _4117_sp,_4132_ei )] > _ptr__4127_xi64[safe_add( _4124_psp,_4133_pi )]))
          {
            {
              ++ _4133_pi;
            }
          }
          else
          {
            {
              int32_t _4134_n = (_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_4132_ei ),(int)1 )] - _ptr__4107_wi32[safe_add( _4114_ptr,_4132_ei )]);
              _4129_rnnz += _4134_n;
              int32_t _11087_;
              bool _11088_ = (_4115_ncodeatom > (int)0);
              if (_11088_)
              {
                _11087_ = safe_add( (_ptr__4107_wi32[safe_add( _4121_codeptr,_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_4132_ei ),(int)1 )] )] - _ptr__4107_wi32[safe_add( _4121_codeptr,_ptr__4107_wi32[safe_add( _4114_ptr,_4132_ei )] )]),safe_mul( (int)4,_4134_n ) );
              }
              else
              {
                _11087_ = safe_mul( (int)3,_4134_n );
              }
              _4131_rncodeatom += _11087_;
              _4130_rnelem += (int)1;
              ++ _4132_ei;
              ++ _4133_pi;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      _4130_rnelem = _4123_pnnz;
      int32_t _11089_ = (int)0;
      int32_t _11090_ = _4123_pnnz;
      for (int32_t _4135_i = _11089_; _4135_i < _11090_; ++_4135_i)
      {
        {
          _4129_rnnz += (_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4135_i )] ),(int)1 )] - _ptr__4107_wi32[safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4135_i )] )]);
        }
      }
      if ((_4115_ncodeatom > (int)0))
      {
        {
          int32_t _11091_ = (int)0;
          int32_t _11092_ = _4123_pnnz;
          for (int32_t _4136_i = _11091_; _4136_i < _11092_; ++_4136_i)
          {
            {
              _4131_rncodeatom += safe_add( (_ptr__4107_wi32[safe_add( _4121_codeptr,_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4136_i )] ),(int)1 )] )] - _ptr__4107_wi32[safe_add( _4121_codeptr,_ptr__4107_wi32[safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4136_i )] )] )]),safe_mul( (int)4,(_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4136_i )] ),(int)1 )] - _ptr__4107_wi32[safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4136_i )] )]) ) );
            }
          }
        }
      }
      else
      {
        {
          int32_t _11093_ = (int)0;
          int32_t _11094_ = _4123_pnnz;
          for (int32_t _4137_i = _11093_; _4137_i < _11094_; ++_4137_i)
          {
            {
              _4131_rncodeatom += safe_mul( (int)3,(_ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4137_i )] ),(int)1 )] - _ptr__4107_wi32[safe_add( _4114_ptr,_ptr__4127_xi64[safe_add( _4124_psp,_4137_i )] )]) );
            }
          }
        }
      }
    }
  }
  int64_t _4138_rsz = (int)1;
  int32_t _11095_ = (int)0;
  int32_t _11096_ = _4110_nd;
  for (int32_t _4139_i = _11095_; _4139_i < _11096_; ++_4139_i)
  {
    {
      _4138_rsz *= _ptr__4107_wi32[safe_add( _4116_shape,_4139_i )];
    }
  }
  bool _4140_rhassp = (_4130_rnelem < _4138_rsz);
  _4104_rs->alloc_expr(_4128_rnd,_4130_rnelem,_4129_rnnz,_4140_rhassp,_4131_rncodeatom);
  int32_t _4141_rptr = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->ptr_base;
  int32_t _4142_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->nidxs_base;
  int32_t _11097_;
  bool _11098_ = _4140_rhassp;
  if (_11098_)
  {
    _11097_ = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->sp_base;
  }
  else
  {
    _11097_ = _4104_rs->alloci64(_4130_rnelem);
  }
  int32_t _4143_rsp = _11097_;
  int32_t _4144_rcof = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->cof_base;
  bool _4145_rhassp = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->hassp;
  int32_t _4146_rshape = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->shape_base;
  int32_t _4147_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->codeptr_base;
  int32_t _4148_rcode = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->code_base;
  int32_t _4149_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4150_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__4150_ri64(_4150_ri64 ? _4150_ri64->raw() : nullptr,_4150_ri64 ? _4150_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4151_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->f64;
  _checked_ptr_1<double> _ptr__4151_rf64(_4151_rf64 ? _4151_rf64->raw() : nullptr,_4151_rf64 ? _4151_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4152_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4104_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__4152_ri32(_4152_ri32 ? _4152_ri32->raw() : nullptr,_4152_ri32 ? _4152_ri32->size(0) : 0);
  int32_t _11099_ = (int)0;
  int32_t _11100_ = _4110_nd;
  for (int32_t _4153_i = _11099_; _4153_i < _11100_; ++_4153_i)
  {
    {
      _ptr__4152_ri32[safe_add( _4146_rshape,_4153_i )] = _ptr__4107_wi32[safe_add( _4116_shape,_4153_i )];
    }
  }
  _ptr__4152_ri32[_4141_rptr] = (int)0;
  if ((_4131_rncodeatom > (int)0))
  {
    {
      _ptr__4152_ri32[_4147_rcodeptr] = (int)0;
    }
  }
  {}
  if (_4113_hassp)
  {
    {
      int32_t _4154_codei = (int)0;
      int32_t _4155_nzi = (int)0;
      int32_t _4156_elmi = (int)0;
      int32_t _4157_ei = (int)0;
      int32_t _4158_pi = (int)0;
      while ( ((_4157_ei < _4111_nelem) && (_4158_pi < _4123_pnnz)) )
      {
        {
          if ((_ptr__4108_wi64[safe_add( _4117_sp,_4157_ei )] < _ptr__4127_xi64[safe_add( _4124_psp,_4158_pi )]))
          {
            {
              ++ _4157_ei;
            }
          }
          else if((_ptr__4108_wi64[safe_add( _4117_sp,_4157_ei )] > _ptr__4127_xi64[safe_add( _4124_psp,_4158_pi )]))
          {
            {
              ++ _4158_pi;
            }
          }
          else
          {
            {
              int32_t _11101_ = _ptr__4107_wi32[safe_add( _4114_ptr,_4157_ei )];
              int32_t _11102_ = _ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_4157_ei ),(int)1 )];
              for (int32_t _4159_i = _11101_; _4159_i < _11102_; ++_4159_i)
              {
                {
                  _ptr__4150_ri64[safe_add( _4142_rnidxs,_4155_nzi )] = _ptr__4108_wi64[safe_add( _4118_nidxs,_4159_i )];
                  _ptr__4151_rf64[safe_add( _4144_rcof,_4155_nzi )] = 0.0;
                  _ptr__4152_ri32[safe_add( _4148_rcode,_4154_codei )] = 2;
                  _ptr__4151_rf64[safe_add( _4149_rcconst,_4154_codei )] = _ptr__4109_wf64[safe_add( _4119_cof,_4159_i )];
                  ++ _4154_codei;
                  if ((_4115_ncodeatom > (int)0))
                  {
                    {
                      int32_t _11103_ = _ptr__4107_wi32[safe_add( _4121_codeptr,_4159_i )];
                      int32_t _11104_ = _ptr__4107_wi32[safe_add( safe_add( _4121_codeptr,_4159_i ),(int)1 )];
                      for (int32_t _4160_k = _11103_; _4160_k < _11104_; ++_4160_k)
                      {
                        {
                          _ptr__4152_ri32[safe_add( _4148_rcode,_4154_codei )] = _ptr__4107_wi32[safe_add( _4122_code,_4160_k )];
                          _ptr__4151_rf64[safe_add( _4149_rcconst,_4154_codei )] = _ptr__4109_wf64[safe_add( _4120_cconst,_4160_k )];
                          ++ _4154_codei;
                        }
                      }
                      _ptr__4152_ri32[safe_add( _4148_rcode,_4154_codei )] = 3;
                      ++ _4154_codei;
                    }
                  }
                  {}
                  _ptr__4152_ri32[safe_add( _4148_rcode,_4154_codei )] = 1;
                  _ptr__4151_rf64[safe_add( _4149_rcconst,_4154_codei )] = _ptr__4126_xi32[safe_add( _4125_pidxs,_4158_pi )];
                  ++ _4154_codei;
                  _ptr__4152_ri32[safe_add( _4148_rcode,_4154_codei )] = 5;
                  ++ _4154_codei;
                  _ptr__4152_ri32[safe_add( safe_add( _4147_rcodeptr,_4155_nzi ),(int)1 )] = _4154_codei;
                  ++ _4155_nzi;
                }
              }
              _ptr__4150_ri64[safe_add( _4143_rsp,_4156_elmi )] = _ptr__4108_wi64[safe_add( _4117_sp,_4157_ei )];
              _ptr__4152_ri32[safe_add( safe_add( _4141_rptr,_4156_elmi ),(int)1 )] = _4155_nzi;
              ++ _4156_elmi;
              ++ _4157_ei;
              ++ _4158_pi;
            }
          }
        }
      }
      if ((_4156_elmi != _4130_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken elmi"));
        }
      }
      {}
      if ((_4155_nzi != _4129_rnnz))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken nzi"));
        }
      }
      {}
      if ((_4154_codei != _4131_rncodeatom))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: broken codei"));
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _4161_codei = (int)0;
      int32_t _4162_nzi = (int)0;
      int32_t _11105_ = (int)0;
      int32_t _11106_ = _4123_pnnz;
      for (int32_t _4163_pi = _11105_; _4163_pi < _11106_; ++_4163_pi)
      {
        {
          int32_t _4164_elmi = _4163_pi;
          int64_t _4165_ei = _ptr__4127_xi64[safe_add( _4124_psp,_4163_pi )];
          int32_t _11107_ = _ptr__4107_wi32[safe_add( _4114_ptr,_4165_ei )];
          int32_t _11108_ = _ptr__4107_wi32[safe_add( safe_add( _4114_ptr,_4165_ei ),(int)1 )];
          for (int32_t _4166_i = _11107_; _4166_i < _11108_; ++_4166_i)
          {
            {
              _ptr__4150_ri64[safe_add( _4142_rnidxs,_4162_nzi )] = _ptr__4108_wi64[safe_add( _4118_nidxs,_4166_i )];
              _ptr__4151_rf64[safe_add( _4144_rcof,_4162_nzi )] = 0.0;
              _ptr__4152_ri32[safe_add( _4148_rcode,_4161_codei )] = 2;
              _ptr__4151_rf64[safe_add( _4149_rcconst,_4161_codei )] = _ptr__4109_wf64[safe_add( _4119_cof,_4166_i )];
              ++ _4161_codei;
              if ((_4115_ncodeatom > (int)0))
              {
                {
                  int32_t _11109_ = _ptr__4107_wi32[safe_add( _4121_codeptr,_4166_i )];
                  int32_t _11110_ = _ptr__4107_wi32[safe_add( safe_add( _4121_codeptr,_4166_i ),(int)1 )];
                  for (int32_t _4167_k = _11109_; _4167_k < _11110_; ++_4167_k)
                  {
                    {
                      _ptr__4152_ri32[safe_add( _4148_rcode,_4161_codei )] = _ptr__4107_wi32[safe_add( _4122_code,_4167_k )];
                      _ptr__4151_rf64[safe_add( _4149_rcconst,_4161_codei )] = _ptr__4109_wf64[safe_add( _4120_cconst,_4167_k )];
                      ++ _4161_codei;
                    }
                  }
                  _ptr__4152_ri32[safe_add( _4148_rcode,_4161_codei )] = 3;
                  ++ _4161_codei;
                }
              }
              {}
              _ptr__4152_ri32[safe_add( _4148_rcode,_4161_codei )] = 1;
              _ptr__4151_rf64[safe_add( _4149_rcconst,_4161_codei )] = _ptr__4126_xi32[safe_add( _4125_pidxs,_4163_pi )];
              ++ _4161_codei;
              _ptr__4152_ri32[safe_add( _4148_rcode,_4161_codei )] = 5;
              ++ _4161_codei;
              _ptr__4152_ri32[safe_add( safe_add( _4147_rcodeptr,_4162_nzi ),(int)1 )] = _4161_codei;
              ++ _4162_nzi;
            }
          }
          _ptr__4150_ri64[safe_add( _4143_rsp,_4164_elmi )] = _4165_ei;
          _ptr__4152_ri32[safe_add( safe_add( _4141_rptr,_4164_elmi ),(int)1 )] = _4162_nzi;
        }
      }
      if ((_4131_rncodeatom != _4161_codei))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Invalid code list result"));
        }
      }
      {}
    }
  }
  if ((!_4145_rhassp))
  {
    {
      _4104_rs->popi64(_4130_rnelem);
    }
  }
  {}
  _4106_xs->clear();
}
// End mosek.fusion.ExprMulParamElem.eval

// Begin mosek.fusion.ExprMulParamElem.toString
// Method mosek.fusion.ExprMulParamElem.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:1426:6-154
std::string mosek::fusion::ExprMulParamElem :: toString() { return mosek::fusion::p_ExprMulParamElem::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamElem::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamElem("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamElem.toString

void mosek::fusion::p_ExprMulParamElem::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamElem::destroy() { mosek::fusion::p_ExprMulParamElem::_get_impl(this)->destroy(); }
// } class ExprMulParamElem
// class ExprMulParamRight { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:1028:4-1406:5
mosek::fusion::ExprMulParamRight::ExprMulParamRight(mosek::fusion::p_ExprMulParamRight *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamRight()" << this << std::endl; */ }
mosek::fusion::ExprMulParamRight::~ExprMulParamRight() {  /* std::cout << "~ExprMulParamRight()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamRight::p_ExprMulParamRight
  (::mosek::fusion::ExprMulParamRight * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamRight.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:1032:6-1041:7
mosek::fusion::ExprMulParamRight::t mosek::fusion::p_ExprMulParamRight::_new_ExprMulParamRight
  (monty::rc_ptr< ::mosek::fusion::Expression > _4168_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _4169_p)
{ return new mosek::fusion::ExprMulParamRight(_4168_e,_4169_p); }
mosek::fusion::ExprMulParamRight::ExprMulParamRight
  (monty::rc_ptr< ::mosek::fusion::Expression > _4168_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _4169_p) : 
   ExprMulParamRight(new mosek::fusion::p_ExprMulParamRight(this))
{ mosek::fusion::p_ExprMulParamRight::_get_impl(this)->_initialize(_4168_e,_4169_p); }
void mosek::fusion::p_ExprMulParamRight::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _4168_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _4169_p)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_4168_e->getDim((int)0)),(int32_t)(_4169_p->getDim((int)1))}));
    mosek::fusion::p_ExprMulParamRight::_get_impl(::mosek::fusion::ExprMulParamRight::t(_pubthis))->p = _4169_p;
    mosek::fusion::p_ExprMulParamRight::_get_impl(::mosek::fusion::ExprMulParamRight::t(_pubthis))->e = _4168_e;
    if (((_4169_p->getND() != (int)2) || (_4168_e->getND() != (int)2)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
    if ((_4169_p->getDim((int)0) != _4168_e->getDim((int)1)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamRight.ctor

// Begin mosek.fusion.ExprMulParamRight.eval
// Method mosek.fusion.ExprMulParamRight.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:1045:6-1405:7
void mosek::fusion::ExprMulParamRight :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4170_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4171_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4172_xs) { mosek::fusion::p_ExprMulParamRight::_get_impl(this)->eval(_4170_rs,_4171_ws,_4172_xs); }
void mosek::fusion::p_ExprMulParamRight::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4170_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4171_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4172_xs)
{
  e->eval(_4171_ws,_4170_rs,_4172_xs);
  _4171_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4173_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4173_wi32(_4173_wi32 ? _4173_wi32->raw() : nullptr,_4173_wi32 ? _4173_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4174_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4174_wi64(_4174_wi64 ? _4174_wi64->raw() : nullptr,_4174_wi64 ? _4174_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4175_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->f64;
  _checked_ptr_1<double> _ptr__4175_wf64(_4175_wf64 ? _4175_wf64->raw() : nullptr,_4175_wf64 ? _4175_wf64->size(0) : 0);
  int32_t _4176_nd = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->nd;
  int32_t _4177_nelem = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->nelem;
  int32_t _4178_nnz = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->nnz;
  bool _4179_hassp = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->hassp;
  int32_t _4180_ptr = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->ptr_base;
  int32_t _4181_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->ncodeatom;
  int32_t _4182_shape = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->shape_base;
  int32_t _4183_sp = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->sp_base;
  int32_t _4184_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->nidxs_base;
  int32_t _4185_cof = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->cof_base;
  int32_t _4186_cconst = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->cconst_base;
  int32_t _4187_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->codeptr_base;
  int32_t _4188_code = mosek::fusion::p_WorkStack::_get_impl(_4171_ws)->code_base;
  if (((_4176_nd != (int)2) || (p->getDim((int)0) != _ptr__4173_wi32[safe_add( _4182_shape,(int)1 )])))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  int32_t _4189_edim0 = _ptr__4173_wi32[_4182_shape];
  int32_t _4190_edim1 = _ptr__4173_wi32[safe_add( _4182_shape,(int)1 )];
  int32_t _4191_pdim0 = p->getDim((int)0);
  int32_t _4192_pdim1 = p->getDim((int)1);
  int32_t _4193_pnnz = p->getNumNonzero();
  int32_t _4194_pidxs = _4172_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4195_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4195_xi32(_4195_xi32 ? _4195_xi32->raw() : nullptr,_4195_xi32 ? _4195_xi32->size(0) : 0);
  p->getAllIndexes(_4195_xi32,_4194_pidxs);
  int32_t _4196_pperm = _4172_xs->alloci32(_4193_pnnz);
  int32_t _4197_psp = _4172_xs->alloci64(_4193_pnnz);
  p->getSp(mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i64,_4197_psp);
  {
    int32_t _4198_pptr = _4172_xs->alloci32(safe_add( _4192_pdim1,(int)1 ));
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4199_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i32;
    _checked_ptr_1<int32_t> _ptr__4199_xi32(_4199_xi32 ? _4199_xi32->raw() : nullptr,_4199_xi32 ? _4199_xi32->size(0) : 0);
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4200_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i64;
    _checked_ptr_1<int64_t> _ptr__4200_xi64(_4200_xi64 ? _4200_xi64->raw() : nullptr,_4200_xi64 ? _4200_xi64->size(0) : 0);
    int32_t _11111_ = (int)0;
    int32_t _11112_ = safe_add( _4192_pdim1,(int)1 );
    for (int32_t _4201_i = _11111_; _4201_i < _11112_; ++_4201_i)
    {
      {
        _ptr__4199_xi32[safe_add( _4198_pptr,_4201_i )] = (int)0;
      }
    }
    int32_t _11113_ = (int)0;
    int32_t _11114_ = _4193_pnnz;
    for (int32_t _4202_i = _11113_; _4202_i < _11114_; ++_4202_i)
    {
      {
        ++ _ptr__4199_xi32[safe_add( safe_add( _4198_pptr,(_ptr__4200_xi64[safe_add( _4197_psp,_4202_i )] % _4192_pdim1) ),(int)1 )];
      }
    }
    int32_t _11115_ = (int)0;
    int32_t _11116_ = _4192_pdim1;
    for (int32_t _4203_i = _11115_; _4203_i < _11116_; ++_4203_i)
    {
      {
        _ptr__4199_xi32[safe_add( safe_add( _4198_pptr,_4203_i ),(int)1 )] += _ptr__4199_xi32[safe_add( _4198_pptr,_4203_i )];
      }
    }
    int32_t _11117_ = (int)0;
    int32_t _11118_ = _4193_pnnz;
    for (int32_t _4204_i = _11117_; _4204_i < _11118_; ++_4204_i)
    {
      {
        _ptr__4199_xi32[safe_add( _4196_pperm,_ptr__4199_xi32[safe_add( _4198_pptr,(_ptr__4200_xi64[safe_add( _4197_psp,_4204_i )] % _4192_pdim1) )] )] = _4204_i;
        ++ _ptr__4199_xi32[safe_add( _4198_pptr,(_ptr__4200_xi64[safe_add( _4197_psp,_4204_i )] % _4192_pdim1) )];
      }
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4205_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4205_xi32(_4205_xi32 ? _4205_xi32->raw() : nullptr,_4205_xi32 ? _4205_xi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4206_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4172_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__4206_xi64(_4206_xi64 ? _4206_xi64->raw() : nullptr,_4206_xi64 ? _4206_xi64->size(0) : 0);
  int32_t _4207_rncodeatom = (int)0;
  int32_t _4208_rnelem = (int)0;
  int32_t _4209_rnnz = (int)0;
  if (((!p->isSparse()) && (!_4179_hassp)))
  {
    {
      _4209_rnnz = safe_mul( _4178_nnz,_4192_pdim1 );
      _4208_rnelem = safe_mul( _4189_edim0,_4192_pdim1 );
      int32_t _11119_;
      bool _11120_ = (_4181_ncodeatom > (int)0);
      if (_11120_)
      {
        _11119_ = safe_mul( safe_add( _4181_ncodeatom,safe_mul( _4178_nnz,(int)4 ) ),_4192_pdim1 );
      }
      else
      {
        _11119_ = safe_mul( safe_mul( _4178_nnz,_4192_pdim1 ),(int)3 );
      }
      _4207_rncodeatom = _11119_;
    }
  }
  else if((!_4179_hassp))
  {
    {
      int32_t _4210_i1 = (int)0;
      while ( (_4210_i1 < _4193_pnnz) )
      {
        {
          int64_t _4211_psubj = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4210_i1 )] )] % _4192_pdim1);
          int32_t _4212_b1 = _4210_i1;
          while ( ((_4210_i1 < _4193_pnnz) && ((_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4210_i1 )] )] % _4192_pdim1) == _4211_psubj)) )
          {
            {
              int64_t _4213_psubi = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4210_i1 )] )] / _4192_pdim1);
              int32_t _11121_ = (int)0;
              int32_t _11122_ = _4189_edim0;
              for (int32_t _4214_i0 = _11121_; _4214_i0 < _11122_; ++_4214_i0)
              {
                {
                  int64_t _4215_eidx = safe_add( safe_mul( _4214_i0,_4190_edim1 ),_4213_psubi );
                  int32_t _4216_n = (_ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4215_eidx ),(int)1 )] - _ptr__4173_wi32[safe_add( _4180_ptr,_4215_eidx )]);
                  _4209_rnnz += _4216_n;
                  int32_t _11123_;
                  bool _11124_ = (_4181_ncodeatom > (int)0);
                  if (_11124_)
                  {
                    _11123_ = safe_add( (_ptr__4173_wi32[safe_add( _4187_codeptr,_ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4215_eidx ),(int)1 )] )] - _ptr__4173_wi32[safe_add( _4187_codeptr,_ptr__4173_wi32[safe_add( _4180_ptr,_4215_eidx )] )]),safe_mul( _4216_n,(int)4 ) );
                  }
                  else
                  {
                    _11123_ = safe_mul( _4216_n,(int)3 );
                  }
                  _4207_rncodeatom += _11123_;
                }
              }
              ++ _4210_i1;
            }
          }
          _4208_rnelem += _4189_edim0;
        }
      }
    }
  }
  else
  {
    {
      int32_t _4217_i0 = (int)0;
      while ( (_4217_i0 < _4177_nelem) )
      {
        {
          int64_t _4218_erow = (_ptr__4174_wi64[safe_add( _4183_sp,_4217_i0 )] / _4190_edim1);
          int32_t _4219_b0 = _4217_i0;
          int64_t _4220_rowend = safe_mul( safe_add( _4218_erow,(int)1 ),_4190_edim1 );
          while ( ((_4217_i0 < _4177_nelem) && (_ptr__4174_wi64[safe_add( _4183_sp,_4217_i0 )] < _4220_rowend)) )
          {
            {
              ++ _4217_i0;
            }
          }
          int32_t _4221_i1 = (int)0;
          while ( (_4221_i1 < _4193_pnnz) )
          {
            {
              int64_t _4222_pcol = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4221_i1 )] )] % _4192_pdim1);
              int32_t _4223_b1 = _4221_i1;
              while ( ((_4221_i1 < _4193_pnnz) && (_4222_pcol == (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4221_i1 )] )] % _4192_pdim1))) )
              {
                {
                  ++ _4221_i1;
                }
              }
              int32_t _4224_nentryelm = (int)0;
              int32_t _4225_ii1 = _4223_b1;
              int32_t _4226_ii0 = _4219_b0;
              while ( ((_4226_ii0 < _4217_i0) && (_4225_ii1 < _4221_i1)) )
              {
                {
                  int64_t _4227_ecol = (_ptr__4174_wi64[safe_add( _4183_sp,_4226_ii0 )] % _4190_edim1);
                  int64_t _4228_prow = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4225_ii1 )] )] / _4192_pdim1);
                  if ((_4227_ecol < _4228_prow))
                  {
                    {
                      ++ _4226_ii0;
                    }
                  }
                  else if((_4227_ecol > _4228_prow))
                  {
                    {
                      ++ _4225_ii1;
                    }
                  }
                  else
                  {
                    {
                      int32_t _4229_n = (_ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4226_ii0 ),(int)1 )] - _ptr__4173_wi32[safe_add( _4180_ptr,_4226_ii0 )]);
                      _4209_rnnz += _4229_n;
                      int32_t _11125_;
                      bool _11126_ = (_4181_ncodeatom > (int)0);
                      if (_11126_)
                      {
                        _11125_ = safe_add( (_ptr__4173_wi32[safe_add( _4187_codeptr,_ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4226_ii0 ),(int)1 )] )] - _ptr__4173_wi32[safe_add( _4187_codeptr,_ptr__4173_wi32[safe_add( _4180_ptr,_4226_ii0 )] )]),safe_mul( _4229_n,(int)4 ) );
                      }
                      else
                      {
                        _11125_ = safe_mul( _4229_n,(int)3 );
                      }
                      _4207_rncodeatom += _11125_;
                      ++ _4226_ii0;
                      ++ _4225_ii1;
                      ++ _4224_nentryelm;
                    }
                  }
                }
              }
              if ((_4224_nentryelm > (int)0))
              {
                {
                  ++ _4208_rnelem;
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  int32_t _4230_rnd = (int)2;
  bool _4231_rhassp = (_4208_rnelem < safe_mul( _4192_pdim1,_4189_edim0 ));
  _4170_rs->alloc_expr(_4230_rnd,_4208_rnelem,_4209_rnnz,_4231_rhassp,_4207_rncodeatom);
  int32_t _4232_rptr = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->ptr_base;
  int32_t _4233_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->nidxs_base;
  int32_t _11127_;
  bool _11128_ = _4231_rhassp;
  if (_11128_)
  {
    _11127_ = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->sp_base;
  }
  else
  {
    _11127_ = _4170_rs->alloci64(_4208_rnelem);
  }
  int32_t _4234_rsp = _11127_;
  int32_t _4235_rcof = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->cof_base;
  bool _4236_rhassp = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->hassp;
  int32_t _4237_rshape = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->shape_base;
  int32_t _4238_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->codeptr_base;
  int32_t _4239_rcode = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->code_base;
  int32_t _4240_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4241_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__4241_ri64(_4241_ri64 ? _4241_ri64->raw() : nullptr,_4241_ri64 ? _4241_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4242_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->f64;
  _checked_ptr_1<double> _ptr__4242_rf64(_4242_rf64 ? _4242_rf64->raw() : nullptr,_4242_rf64 ? _4242_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4243_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4170_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__4243_ri32(_4243_ri32 ? _4243_ri32->raw() : nullptr,_4243_ri32 ? _4243_ri32->size(0) : 0);
  _ptr__4243_ri32[_4232_rptr] = (int)0;
  if ((_4207_rncodeatom > (int)0))
  {
    {
      _ptr__4243_ri32[_4238_rcodeptr] = (int)0;
    }
  }
  {}
  _ptr__4243_ri32[_4237_rshape] = _4189_edim0;
  _ptr__4243_ri32[safe_add( _4237_rshape,(int)1 )] = _4192_pdim1;
  int32_t _4244_codei = (int)0;
  int32_t _4245_elmi = (int)0;
  int32_t _4246_nzi = (int)0;
  if ((!_4179_hassp))
  {
    {
      int32_t _11129_ = (int)0;
      int32_t _11130_ = _4189_edim0;
      for (int32_t _4247_i = _11129_; _4247_i < _11130_; ++_4247_i)
      {
        {
          int32_t _4248_i1 = (int)0;
          while ( (_4248_i1 < _4193_pnnz) )
          {
            {
              int32_t _4249_b1 = _4248_i1;
              int64_t _4250_psubj = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4248_i1 )] )] % _4192_pdim1);
              while ( ((_4248_i1 < _4193_pnnz) && (_4250_psubj == (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4248_i1 )] )] % _4192_pdim1))) )
              {
                {
                  ++ _4248_i1;
                }
              }
              int32_t _4251_ii1 = _4249_b1;
              while ( (_4251_ii1 < _4248_i1) )
              {
                {
                  int64_t _4252_psubi = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4251_ii1 )] )] / _4192_pdim1);
                  int64_t _4253_eidx = safe_add( safe_mul( _4247_i,_4190_edim1 ),_4252_psubi );
                  int32_t _4254_pidx = _ptr__4205_xi32[safe_add( _4194_pidxs,_ptr__4205_xi32[safe_add( _4196_pperm,_4251_ii1 )] )];
                  int32_t _11131_ = _ptr__4173_wi32[safe_add( _4180_ptr,_4253_eidx )];
                  int32_t _11132_ = _ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4253_eidx ),(int)1 )];
                  for (int32_t _4255_k = _11131_; _4255_k < _11132_; ++_4255_k)
                  {
                    {
                      _ptr__4241_ri64[safe_add( _4233_rnidxs,_4246_nzi )] = _ptr__4174_wi64[safe_add( _4184_nidxs,_4255_k )];
                      _ptr__4242_rf64[safe_add( _4235_rcof,_4246_nzi )] = (int)0;
                      _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 2;
                      _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _ptr__4175_wf64[safe_add( _4185_cof,_4255_k )];
                      ++ _4244_codei;
                      if ((_4181_ncodeatom > (int)0))
                      {
                        {
                          int32_t _11133_ = _ptr__4173_wi32[safe_add( _4187_codeptr,_4255_k )];
                          int32_t _11134_ = _ptr__4173_wi32[safe_add( safe_add( _4187_codeptr,_4255_k ),(int)1 )];
                          for (int32_t _4256_l = _11133_; _4256_l < _11134_; ++_4256_l)
                          {
                            {
                              _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = _ptr__4173_wi32[safe_add( _4188_code,_4256_l )];
                              _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _ptr__4175_wf64[safe_add( _4186_cconst,_4256_l )];
                              ++ _4244_codei;
                            }
                          }
                          _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 3;
                          ++ _4244_codei;
                        }
                      }
                      {}
                      _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 1;
                      _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _4254_pidx;
                      ++ _4244_codei;
                      _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 5;
                      ++ _4244_codei;
                      _ptr__4243_ri32[safe_add( safe_add( _4238_rcodeptr,_4246_nzi ),(int)1 )] = _4244_codei;
                      ++ _4246_nzi;
                    }
                  }
                  ++ _4251_ii1;
                }
              }
              _ptr__4243_ri32[safe_add( safe_add( _4232_rptr,_4245_elmi ),(int)1 )] = _4246_nzi;
              _ptr__4241_ri64[safe_add( _4234_rsp,_4245_elmi )] = safe_add( safe_mul( _4247_i,_4192_pdim1 ),_4250_psubj );
              ++ _4245_elmi;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _4257_i0 = (int)0;
      while ( (_4257_i0 < _4177_nelem) )
      {
        {
          int64_t _4258_erow = (_ptr__4174_wi64[safe_add( _4183_sp,_4257_i0 )] / _4190_edim1);
          int32_t _4259_b0 = _4257_i0;
          int64_t _4260_rowend = safe_mul( safe_add( _4258_erow,(int)1 ),_4190_edim1 );
          while ( ((_4257_i0 < _4177_nelem) && (_ptr__4174_wi64[safe_add( _4183_sp,_4257_i0 )] < _4260_rowend)) )
          {
            {
              ++ _4257_i0;
            }
          }
          int32_t _4261_i1 = (int)0;
          while ( (_4261_i1 < _4193_pnnz) )
          {
            {
              int64_t _4262_pcol = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4261_i1 )] )] % _4192_pdim1);
              int32_t _4263_b1 = _4261_i1;
              while ( ((_4261_i1 < _4193_pnnz) && (_4262_pcol == (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4261_i1 )] )] % _4192_pdim1))) )
              {
                {
                  ++ _4261_i1;
                }
              }
              int32_t _4264_nentryelm = (int)0;
              int32_t _4265_ii1 = _4263_b1;
              int32_t _4266_ii0 = _4259_b0;
              while ( ((_4266_ii0 < _4257_i0) && (_4265_ii1 < _4261_i1)) )
              {
                {
                  int64_t _4267_ecol = (_ptr__4174_wi64[safe_add( _4183_sp,_4266_ii0 )] % _4190_edim1);
                  int64_t _4268_prow = (_ptr__4206_xi64[safe_add( _4197_psp,_ptr__4205_xi32[safe_add( _4196_pperm,_4265_ii1 )] )] / _4192_pdim1);
                  if ((_4267_ecol < _4268_prow))
                  {
                    {
                      ++ _4266_ii0;
                    }
                  }
                  else if((_4267_ecol > _4268_prow))
                  {
                    {
                      ++ _4265_ii1;
                    }
                  }
                  else
                  {
                    {
                      int32_t _4269_pidx = _ptr__4205_xi32[safe_add( _4194_pidxs,_ptr__4205_xi32[safe_add( _4196_pperm,_4265_ii1 )] )];
                      int32_t _11135_ = _ptr__4173_wi32[safe_add( _4180_ptr,_4266_ii0 )];
                      int32_t _11136_ = _ptr__4173_wi32[safe_add( safe_add( _4180_ptr,_4266_ii0 ),(int)1 )];
                      for (int32_t _4270_k = _11135_; _4270_k < _11136_; ++_4270_k)
                      {
                        {
                          _ptr__4241_ri64[safe_add( _4233_rnidxs,_4246_nzi )] = _ptr__4174_wi64[safe_add( _4184_nidxs,_4270_k )];
                          _ptr__4242_rf64[safe_add( _4235_rcof,_4246_nzi )] = (int)0;
                          _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 2;
                          _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _ptr__4175_wf64[safe_add( _4185_cof,_4270_k )];
                          ++ _4244_codei;
                          if ((_4181_ncodeatom > (int)0))
                          {
                            {
                              int32_t _11137_ = _ptr__4173_wi32[safe_add( _4187_codeptr,_4270_k )];
                              int32_t _11138_ = _ptr__4173_wi32[safe_add( safe_add( _4187_codeptr,_4270_k ),(int)1 )];
                              for (int32_t _4271_l = _11137_; _4271_l < _11138_; ++_4271_l)
                              {
                                {
                                  _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = _ptr__4173_wi32[safe_add( _4188_code,_4271_l )];
                                  _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _ptr__4175_wf64[safe_add( _4186_cconst,_4271_l )];
                                  ++ _4244_codei;
                                }
                              }
                              _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 3;
                              ++ _4244_codei;
                            }
                          }
                          {}
                          _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 1;
                          _ptr__4242_rf64[safe_add( _4240_rcconst,_4244_codei )] = _4269_pidx;
                          ++ _4244_codei;
                          _ptr__4243_ri32[safe_add( _4239_rcode,_4244_codei )] = 5;
                          ++ _4244_codei;
                          _ptr__4243_ri32[safe_add( safe_add( _4238_rcodeptr,_4246_nzi ),(int)1 )] = _4244_codei;
                          ++ _4246_nzi;
                        }
                      }
                      ++ _4266_ii0;
                      ++ _4265_ii1;
                      ++ _4264_nentryelm;
                    }
                  }
                }
              }
              if ((_4264_nentryelm > (int)0))
              {
                {
                  _ptr__4243_ri32[safe_add( safe_add( _4232_rptr,_4245_elmi ),(int)1 )] = _4246_nzi;
                  _ptr__4241_ri64[safe_add( _4234_rsp,_4245_elmi )] = safe_add( safe_mul( _4258_erow,_4192_pdim1 ),_4262_pcol );
                  ++ _4245_elmi;
                }
              }
              {}
            }
          }
        }
      }
    }
  }
  if ((!_4236_rhassp))
  {
    {
      _4170_rs->popi64(_4208_rnelem);
    }
  }
  {}
  if ((_4245_elmi != _4208_rnelem))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("broken elmi"));
    }
  }
  {}
  if ((_4246_nzi != _4209_rnnz))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("broken nzi"));
    }
  }
  {}
  if ((_4244_codei != _4207_rncodeatom))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("broken codei"));
    }
  }
  {}
  _4172_xs->clear();
}
// End mosek.fusion.ExprMulParamRight.eval

// Begin mosek.fusion.ExprMulParamRight.toString
// Method mosek.fusion.ExprMulParamRight.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:1043:6-155
std::string mosek::fusion::ExprMulParamRight :: toString() { return mosek::fusion::p_ExprMulParamRight::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamRight::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamRight("))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamRight.toString

void mosek::fusion::p_ExprMulParamRight::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamRight::destroy() { mosek::fusion::p_ExprMulParamRight::_get_impl(this)->destroy(); }
// } class ExprMulParamRight
// class ExprMulParamLeft { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:533:4-1023:5
mosek::fusion::ExprMulParamLeft::ExprMulParamLeft(mosek::fusion::p_ExprMulParamLeft *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulParamLeft()" << this << std::endl; */ }
mosek::fusion::ExprMulParamLeft::~ExprMulParamLeft() {  /* std::cout << "~ExprMulParamLeft()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulParamLeft::p_ExprMulParamLeft
  (::mosek::fusion::ExprMulParamLeft * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulParamLeft.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:537:6-546:7
mosek::fusion::ExprMulParamLeft::t mosek::fusion::p_ExprMulParamLeft::_new_ExprMulParamLeft
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4272_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4273_e)
{ return new mosek::fusion::ExprMulParamLeft(_4272_p,_4273_e); }
mosek::fusion::ExprMulParamLeft::ExprMulParamLeft
  (monty::rc_ptr< ::mosek::fusion::Parameter > _4272_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4273_e) : 
   ExprMulParamLeft(new mosek::fusion::p_ExprMulParamLeft(this))
{ mosek::fusion::p_ExprMulParamLeft::_get_impl(this)->_initialize(_4272_p,_4273_e); }
void mosek::fusion::p_ExprMulParamLeft::_initialize  (monty::rc_ptr< ::mosek::fusion::Parameter > _4272_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _4273_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_4272_p->getDim((int)0)),(int32_t)(_4273_e->getDim((int)1))}));
    mosek::fusion::p_ExprMulParamLeft::_get_impl(::mosek::fusion::ExprMulParamLeft::t(_pubthis))->p = _4272_p;
    mosek::fusion::p_ExprMulParamLeft::_get_impl(::mosek::fusion::ExprMulParamLeft::t(_pubthis))->e = _4273_e;
    if (((_4272_p->getND() != (int)2) || (_4273_e->getND() != (int)2)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
      }
    }
    {}
    if ((_4272_p->getDim((int)1) != _4273_e->getDim((int)0)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulParamLeft.ctor

// Begin mosek.fusion.ExprMulParamLeft.eval
// Method mosek.fusion.ExprMulParamLeft.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:550:6-1022:7
void mosek::fusion::ExprMulParamLeft :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4274_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4275_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4276_xs) { mosek::fusion::p_ExprMulParamLeft::_get_impl(this)->eval(_4274_rs,_4275_ws,_4276_xs); }
void mosek::fusion::p_ExprMulParamLeft::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4274_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4275_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4276_xs)
{
  e->eval(_4275_ws,_4274_rs,_4276_xs);
  _4275_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4277_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4277_wi32(_4277_wi32 ? _4277_wi32->raw() : nullptr,_4277_wi32 ? _4277_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4278_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4278_wi64(_4278_wi64 ? _4278_wi64->raw() : nullptr,_4278_wi64 ? _4278_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4279_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->f64;
  _checked_ptr_1<double> _ptr__4279_wf64(_4279_wf64 ? _4279_wf64->raw() : nullptr,_4279_wf64 ? _4279_wf64->size(0) : 0);
  int32_t _4280_nd = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->nd;
  int32_t _4281_nelem = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->nelem;
  int32_t _4282_nnz = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->nnz;
  bool _4283_hassp = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->hassp;
  int32_t _4284_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->ncodeatom;
  int32_t _4285_ptr = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->ptr_base;
  int32_t _4286_code = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->code_base;
  int32_t _4287_cconst = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->cconst_base;
  int32_t _4288_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->codeptr_base;
  int32_t _4289_shape = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->shape_base;
  int32_t _4290_sp = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->sp_base;
  int32_t _4291_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->nidxs_base;
  int32_t _4292_cof = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->cof_base;
  int32_t _4293_consts = mosek::fusion::p_WorkStack::_get_impl(_4275_ws)->cconst_base;
  if (((_4280_nd != (int)2) || (_ptr__4277_wi32[_4289_shape] != p->getDim((int)1))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  int32_t _4294_pdim0 = p->getDim((int)0);
  int32_t _4295_pdim1 = p->getDim((int)1);
  int32_t _4296_edim0 = _ptr__4277_wi32[_4289_shape];
  int32_t _4297_edim1 = _ptr__4277_wi32[safe_add( _4289_shape,(int)1 )];
  int32_t _4298_pnnz = p->getNumNonzero();
  int32_t _4299_pidxs = _4276_xs->alloci32(p->getNumNonzero());
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4300_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4276_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4300_xi32(_4300_xi32 ? _4300_xi32->raw() : nullptr,_4300_xi32 ? _4300_xi32->size(0) : 0);
  p->getAllIndexes(_4300_xi32,_4299_pidxs);
  if (((!_4283_hassp) && (!p->isSparse())))
  {
    {
      int32_t _4301_rnd = (int)2;
      int32_t _4302_rnelem = safe_mul( _4297_edim1,p->getDim((int)0) );
      int32_t _4303_rnnz = safe_mul( _4282_nnz,p->getDim((int)0) );
      int32_t _11139_;
      bool _11140_ = (_4284_ncodeatom > (int)0);
      if (_11140_)
      {
        _11139_ = safe_add( safe_mul( p->getDim((int)0),_4284_ncodeatom ),safe_mul( (int)4,_4303_rnnz ) );
      }
      else
      {
        _11139_ = safe_mul( (int)3,_4303_rnnz );
      }
      int32_t _4304_rncodeatom = _11139_;
      bool _4305_rhassp = false;
      _4274_rs->alloc_expr(_4301_rnd,_4302_rnelem,_4303_rnnz,_4305_rhassp,_4304_rncodeatom);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4306_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4306_ri64(_4306_ri64 ? _4306_ri64->raw() : nullptr,_4306_ri64 ? _4306_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4307_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->f64;
      _checked_ptr_1<double> _ptr__4307_rf64(_4307_rf64 ? _4307_rf64->raw() : nullptr,_4307_rf64 ? _4307_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4308_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4308_ri32(_4308_ri32 ? _4308_ri32->raw() : nullptr,_4308_ri32 ? _4308_ri32->size(0) : 0);
      int32_t _4309_rptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->ptr_base;
      int32_t _4310_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->nidxs_base;
      int32_t _4311_rcof = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cof_base;
      int32_t _4312_rcode = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->code_base;
      int32_t _4313_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->codeptr_base;
      int32_t _4314_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cconst_base;
      bool _4315_rhassp = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->hassp;
      int32_t _4316_rshape = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->shape_base;
      _ptr__4308_ri32[_4316_rshape] = _4294_pdim0;
      _ptr__4308_ri32[safe_add( _4316_rshape,(int)1 )] = _4297_edim1;
      {
        _ptr__4308_ri32[_4309_rptr] = (int)0;
        _ptr__4308_ri32[_4313_rcodeptr] = (int)0;
        int32_t _4317_nzi = (int)0;
        int32_t _4318_elmi = (int)0;
        int32_t _4319_codei = (int)0;
        int32_t _11141_ = (int)0;
        int32_t _11142_ = p->getDim((int)0);
        for (int32_t _4320_i = _11141_; _4320_i < _11142_; ++_4320_i)
        {
          {
            int32_t _11143_ = (int)0;
            int32_t _11144_ = e->getDim((int)1);
            for (int32_t _4321_j = _11143_; _4321_j < _11144_; ++_4321_j)
            {
              {
                int32_t _11145_ = (int)0;
                int32_t _11146_ = p->getDim((int)1);
                for (int32_t _4322_k = _11145_; _4322_k < _11146_; ++_4322_k)
                {
                  {
                    int32_t _11147_ = _ptr__4277_wi32[safe_add( safe_add( _4285_ptr,safe_mul( _4322_k,_4297_edim1 ) ),_4321_j )];
                    int32_t _11148_ = _ptr__4277_wi32[safe_add( safe_add( safe_add( _4285_ptr,safe_mul( _4322_k,_4297_edim1 ) ),_4321_j ),(int)1 )];
                    for (int32_t _4323_l = _11147_; _4323_l < _11148_; ++_4323_l)
                    {
                      {
                        _ptr__4306_ri64[safe_add( _4310_rnidxs,_4317_nzi )] = _ptr__4278_wi64[safe_add( _4291_nidxs,_4323_l )];
                        _ptr__4307_rf64[safe_add( _4311_rcof,_4317_nzi )] = 0.0;
                        _ptr__4308_ri32[safe_add( _4312_rcode,_4319_codei )] = 2;
                        _ptr__4307_rf64[safe_add( _4314_rcconst,_4319_codei )] = _ptr__4279_wf64[safe_add( _4292_cof,_4323_l )];
                        ++ _4319_codei;
                        if ((_4284_ncodeatom > (int)0))
                        {
                          {
                            int32_t _11149_ = _ptr__4277_wi32[safe_add( _4288_codeptr,_4323_l )];
                            int32_t _11150_ = _ptr__4277_wi32[safe_add( safe_add( _4288_codeptr,_4323_l ),(int)1 )];
                            for (int32_t _4324_m = _11149_; _4324_m < _11150_; ++_4324_m)
                            {
                              {
                                _ptr__4308_ri32[safe_add( _4312_rcode,_4319_codei )] = _ptr__4277_wi32[safe_add( _4286_code,_4324_m )];
                                _ptr__4307_rf64[safe_add( _4314_rcconst,_4319_codei )] = _ptr__4279_wf64[safe_add( _4287_cconst,_4324_m )];
                                ++ _4319_codei;
                              }
                            }
                            _ptr__4308_ri32[safe_add( _4312_rcode,_4319_codei )] = 3;
                            ++ _4319_codei;
                          }
                        }
                        {}
                        _ptr__4308_ri32[safe_add( _4312_rcode,_4319_codei )] = 1;
                        _ptr__4307_rf64[safe_add( _4314_rcconst,_4319_codei )] = _ptr__4300_xi32[safe_add( safe_add( _4299_pidxs,safe_mul( _4320_i,_4295_pdim1 ) ),_4322_k )];
                        ++ _4319_codei;
                        _ptr__4308_ri32[safe_add( _4312_rcode,_4319_codei )] = 5;
                        ++ _4319_codei;
                        _ptr__4308_ri32[safe_add( safe_add( _4313_rcodeptr,_4317_nzi ),(int)1 )] = _4319_codei;
                        ++ _4317_nzi;
                      }
                    }
                  }
                }
                _ptr__4308_ri32[safe_add( safe_add( _4309_rptr,_4318_elmi ),(int)1 )] = _4317_nzi;
                ++ _4318_elmi;
              }
            }
          }
        }
        if ((_4319_codei != _4304_rncodeatom))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect a-code length"));
          }
        }
        {}
        if ((_4317_nzi != _4303_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nnz length"));
          }
        }
        {}
        if ((_4318_elmi != _4302_rnelem))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nelem length"));
          }
        }
        {}
        int32_t _11151_ = (int)0;
        int32_t _11152_ = _4302_rnelem;
        for (int32_t _4325_i = _11151_; _4325_i < _11152_; ++_4325_i)
        {
          {
            if ((_ptr__4308_ri32[safe_add( _4309_rptr,_4325_i )] > _ptr__4308_ri32[safe_add( safe_add( _4309_rptr,_4325_i ),(int)1 )]))
            {
              {
                throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect ptr indexes"));
              }
            }
            {}
          }
        }
      }
    }
  }
  else if((!_4283_hassp))
  {
    {
      int32_t _4326_numpnz = _4281_nelem;
      int32_t _4327_pnelem = _4298_pnnz;
      int32_t _4328_xpsp = _4276_xs->alloci64(_4327_pnelem);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4329_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4276_xs)->i64;
      _checked_ptr_1<int64_t> _ptr__4329_xi64(_4329_xi64 ? _4329_xi64->raw() : nullptr,_4329_xi64 ? _4329_xi64->size(0) : 0);
      p->getSp(_4329_xi64,_4328_xpsp);
      int32_t _4330_rnelem = (int)0;
      int32_t _4331_rnnz = (int)0;
      int32_t _4332_rncodeatom = (int)0;
      {
        int32_t _4333_i0 = (int)0;
        while ( (_4333_i0 < _4298_pnnz) )
        {
          {
            int32_t _4334_ii = (int32_t)(_ptr__4329_xi64[safe_add( _4328_xpsp,_4333_i0 )] / _4295_pdim1);
            int32_t _4335_prowb = _4333_i0;
            ++ _4333_i0;
            while ( ((_4333_i0 < _4298_pnnz) && (_ptr__4329_xi64[safe_add( _4328_xpsp,_4333_i0 )] < safe_mul( safe_add( _4334_ii,(int)1 ),_4295_pdim1 ))) )
            {
              {
                ++ _4333_i0;
              }
            }
            int32_t _4336_prowe = _4333_i0;
            int32_t _11153_ = (int)0;
            int32_t _11154_ = _4297_edim1;
            for (int32_t _4337_jj = _11153_; _4337_jj < _11154_; ++_4337_jj)
            {
              {
                int32_t _11155_ = _4335_prowb;
                int32_t _11156_ = _4336_prowe;
                for (int32_t _4338_i = _11155_; _4338_i < _11156_; ++_4338_i)
                {
                  {
                    int64_t _4339_eidx = safe_add( safe_mul( (_ptr__4329_xi64[safe_add( _4328_xpsp,_4338_i )] % _4295_pdim1),_4297_edim1 ),_4337_jj );
                    int32_t _4340_n = (_ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4339_eidx ),(int)1 )] - _ptr__4277_wi32[safe_add( _4285_ptr,_4339_eidx )]);
                    _4331_rnnz += _4340_n;
                    if ((_4284_ncodeatom > (int)0))
                    {
                      {
                        _4332_rncodeatom += safe_add( (_ptr__4277_wi32[safe_add( _4288_codeptr,_ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4339_eidx ),(int)1 )] )] - _ptr__4277_wi32[safe_add( _4288_codeptr,_ptr__4277_wi32[safe_add( _4285_ptr,_4339_eidx )] )]),safe_mul( (int)4,_4340_n ) );
                      }
                    }
                    else
                    {
                      {
                        _4332_rncodeatom += safe_mul( (int)3,_4340_n );
                      }
                    }
                  }
                }
                ++ _4330_rnelem;
              }
            }
          }
        }
      }
      bool _4341_rhassp = (_4330_rnelem < safe_mul( _4294_pdim0,_4297_edim1 ));
      int32_t _4342_rnd = (int)2;
      _4274_rs->alloc_expr(_4342_rnd,_4330_rnelem,_4331_rnnz,_4341_rhassp,_4332_rncodeatom);
      int32_t _4343_rptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->ptr_base;
      int32_t _4344_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->nidxs_base;
      int32_t _11157_;
      bool _11158_ = _4341_rhassp;
      if (_11158_)
      {
        _11157_ = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->sp_base;
      }
      else
      {
        _11157_ = _4274_rs->alloci64(_4330_rnelem);
      }
      int32_t _4345_rsp = _11157_;
      int32_t _4346_rcof = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cof_base;
      bool _4347_rhassp = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->hassp;
      int32_t _4348_rshape = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->shape_base;
      int32_t _4349_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->codeptr_base;
      int32_t _4350_rcode = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->code_base;
      int32_t _4351_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4352_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4352_ri64(_4352_ri64 ? _4352_ri64->raw() : nullptr,_4352_ri64 ? _4352_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4353_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->f64;
      _checked_ptr_1<double> _ptr__4353_rf64(_4353_rf64 ? _4353_rf64->raw() : nullptr,_4353_rf64 ? _4353_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4354_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4354_ri32(_4354_ri32 ? _4354_ri32->raw() : nullptr,_4354_ri32 ? _4354_ri32->size(0) : 0);
      _ptr__4354_ri32[_4348_rshape] = _4294_pdim0;
      _ptr__4354_ri32[safe_add( _4348_rshape,(int)1 )] = _4297_edim1;
      {
        int32_t _4355_nzi = (int)0;
        int32_t _4356_elmi = (int)0;
        int32_t _4357_codei = (int)0;
        if ((_4332_rncodeatom > (int)0))
        {
          {
            _ptr__4354_ri32[_4349_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__4354_ri32[_4343_rptr] = (int)0;
        int32_t _11159_ = (int)0;
        int32_t _11160_ = _4331_rnnz;
        for (int32_t _4358_i = _11159_; _4358_i < _11160_; ++_4358_i)
        {
          {
            _ptr__4353_rf64[safe_add( _4346_rcof,_4358_i )] = 0.0;
          }
        }
        int32_t _4359_i0 = (int)0;
        while ( (_4359_i0 < _4298_pnnz) )
        {
          {
            int32_t _4360_ii = (int32_t)(_ptr__4329_xi64[safe_add( _4328_xpsp,_4359_i0 )] / _4295_pdim1);
            int32_t _4361_prowb = _4359_i0;
            ++ _4359_i0;
            while ( ((_4359_i0 < _4298_pnnz) && (_ptr__4329_xi64[safe_add( _4328_xpsp,_4359_i0 )] < safe_mul( safe_add( _4360_ii,(int)1 ),_4295_pdim1 ))) )
            {
              {
                ++ _4359_i0;
              }
            }
            int32_t _4362_prowe = _4359_i0;
            int32_t _11161_ = (int)0;
            int32_t _11162_ = _4297_edim1;
            for (int32_t _4363_jj = _11161_; _4363_jj < _11162_; ++_4363_jj)
            {
              {
                int32_t _11163_ = _4361_prowb;
                int32_t _11164_ = _4362_prowe;
                for (int32_t _4364_i = _11163_; _4364_i < _11164_; ++_4364_i)
                {
                  {
                    int64_t _4365_eidx = safe_add( safe_mul( (_ptr__4329_xi64[safe_add( _4328_xpsp,_4364_i )] % _4295_pdim1),_4297_edim1 ),_4363_jj );
                    int32_t _11165_ = _ptr__4277_wi32[safe_add( _4285_ptr,_4365_eidx )];
                    int32_t _11166_ = _ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4365_eidx ),(int)1 )];
                    for (int32_t _4366_k = _11165_; _4366_k < _11166_; ++_4366_k)
                    {
                      {
                        _ptr__4352_ri64[safe_add( _4344_rnidxs,_4355_nzi )] = _ptr__4278_wi64[safe_add( _4291_nidxs,_4366_k )];
                        _ptr__4354_ri32[safe_add( _4350_rcode,_4357_codei )] = 2;
                        _ptr__4353_rf64[safe_add( _4351_rcconst,_4357_codei )] = _ptr__4279_wf64[safe_add( _4292_cof,_4366_k )];
                        ++ _4357_codei;
                        if ((_4284_ncodeatom > (int)0))
                        {
                          {
                            int32_t _11167_ = _ptr__4277_wi32[safe_add( _4288_codeptr,_4366_k )];
                            int32_t _11168_ = _ptr__4277_wi32[safe_add( safe_add( _4288_codeptr,_4366_k ),(int)1 )];
                            for (int32_t _4367_l = _11167_; _4367_l < _11168_; ++_4367_l)
                            {
                              {
                                _ptr__4354_ri32[safe_add( _4350_rcode,_4357_codei )] = _ptr__4277_wi32[safe_add( _4286_code,_4367_l )];
                                _ptr__4353_rf64[safe_add( _4351_rcconst,_4357_codei )] = _ptr__4279_wf64[safe_add( _4287_cconst,_4367_l )];
                                ++ _4357_codei;
                              }
                            }
                            _ptr__4354_ri32[safe_add( _4350_rcode,_4357_codei )] = 3;
                            ++ _4357_codei;
                          }
                        }
                        {}
                        _ptr__4354_ri32[safe_add( _4350_rcode,_4357_codei )] = 1;
                        _ptr__4353_rf64[safe_add( _4351_rcconst,_4357_codei )] = _ptr__4300_xi32[safe_add( _4299_pidxs,_4364_i )];
                        ++ _4357_codei;
                        _ptr__4354_ri32[safe_add( _4350_rcode,_4357_codei )] = 5;
                        ++ _4357_codei;
                        _ptr__4354_ri32[safe_add( safe_add( _4349_rcodeptr,_4355_nzi ),(int)1 )] = _4357_codei;
                        ++ _4355_nzi;
                      }
                    }
                  }
                }
                _ptr__4354_ri32[safe_add( safe_add( _4343_rptr,_4356_elmi ),(int)1 )] = _4355_nzi;
                _ptr__4352_ri64[safe_add( _4345_rsp,_4356_elmi )] = safe_add( safe_mul( (int64_t)_4360_ii,_4297_edim1 ),_4363_jj );
                ++ _4356_elmi;
              }
            }
          }
        }
        if ((_4357_codei != _4332_rncodeatom))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect code list"));
          }
        }
        {}
        if ((_4355_nzi != _4331_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nnz length"));
          }
        }
        {}
        if ((_4356_elmi != _4330_rnelem))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nelem length"));
          }
        }
        {}
        if ((_ptr__4354_ri32[safe_add( _4343_rptr,_4330_rnelem )] != _4331_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect ptr"));
          }
        }
        {}
      }
      if ((!_4347_rhassp))
      {
        {
          _4274_rs->popi64(_4330_rnelem);
        }
      }
      {}
      _4276_xs->clear();
    }
  }
  else
  {
    {
      int32_t _4368_numpnz = _4281_nelem;
      int32_t _4369_xperm = _4276_xs->alloci32(_4368_numpnz);
      int32_t _4370_pnelem = p->getNumNonzero();
      int32_t _4371_xpsp = _4276_xs->alloci64(_4370_pnelem);
      int32_t _4372_xptr = _4276_xs->alloci32(safe_add( _ptr__4277_wi32[safe_add( _4289_shape,(int)1 )],(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4373_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4276_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__4373_xi32(_4373_xi32 ? _4373_xi32->raw() : nullptr,_4373_xi32 ? _4373_xi32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4374_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4276_xs)->i64;
      _checked_ptr_1<int64_t> _ptr__4374_xi64(_4374_xi64 ? _4374_xi64->raw() : nullptr,_4374_xi64 ? _4374_xi64->size(0) : 0);
      p->getSp(_4374_xi64,_4371_xpsp);
      {
        int32_t _4375_d1 = _ptr__4277_wi32[safe_add( _4289_shape,(int)1 )];
        int32_t _11169_ = (int)0;
        int32_t _11170_ = safe_add( _ptr__4277_wi32[safe_add( _4289_shape,(int)1 )],(int)1 );
        for (int32_t _4376_i = _11169_; _4376_i < _11170_; ++_4376_i)
        {
          {
            _ptr__4373_xi32[safe_add( _4372_xptr,_4376_i )] = (int)0;
          }
        }
        int32_t _11171_ = (int)0;
        int32_t _11172_ = _4281_nelem;
        for (int32_t _4377_i = _11171_; _4377_i < _11172_; ++_4377_i)
        {
          {
            ++ _ptr__4373_xi32[safe_add( safe_add( _4372_xptr,(_ptr__4278_wi64[safe_add( _4290_sp,_4377_i )] % _4375_d1) ),(int)1 )];
          }
        }
        int32_t _11173_ = (int)0;
        int32_t _11174_ = _4375_d1;
        for (int32_t _4378_i = _11173_; _4378_i < _11174_; ++_4378_i)
        {
          {
            _ptr__4373_xi32[safe_add( safe_add( _4372_xptr,_4378_i ),(int)1 )] += _ptr__4373_xi32[safe_add( _4372_xptr,_4378_i )];
          }
        }
        int32_t _11175_ = (int)0;
        int32_t _11176_ = _4281_nelem;
        for (int32_t _4379_i = _11175_; _4379_i < _11176_; ++_4379_i)
        {
          {
            _ptr__4373_xi32[safe_add( _4369_xperm,_ptr__4373_xi32[safe_add( _4372_xptr,(_ptr__4278_wi64[safe_add( _4290_sp,_4379_i )] % _4375_d1) )] )] = _4379_i;
            ++ _ptr__4373_xi32[safe_add( _4372_xptr,(_ptr__4278_wi64[safe_add( _4290_sp,_4379_i )] % _4375_d1) )];
          }
        }
      }
      int32_t _4380_rnelem = (int)0;
      int32_t _4381_rnnz = (int)0;
      int32_t _4382_rncodeatom = (int)0;
      int32_t _4383_edim1 = _ptr__4277_wi32[safe_add( _4289_shape,(int)1 )];
      int32_t _4384_edim0 = _ptr__4277_wi32[_4289_shape];
      int32_t _4385_pdim1 = p->getDim((int)1);
      int32_t _4386_pdim0 = p->getDim((int)0);
      {
        int32_t _4387_prowp = (int)0;
        while ( (_4387_prowp < _4370_pnelem) )
        {
          {
            int32_t _4388_prowb = _4387_prowp;
            int64_t _4389_ri = (_ptr__4374_xi64[safe_add( _4371_xpsp,_4387_prowp )] / _4385_pdim1);
            while ( ((_4387_prowp < _4370_pnelem) && (_ptr__4374_xi64[safe_add( _4371_xpsp,_4387_prowp )] < safe_mul( safe_add( _4389_ri,(int)1 ),_4385_pdim1 ))) )
            {
              {
                ++ _4387_prowp;
              }
            }
            int32_t _4390_ecolp = (int)0;
            while ( (_4390_ecolp < _4281_nelem) )
            {
              {
                int32_t _4391_ecolb = _4390_ecolp;
                int64_t _4392_rj = (_ptr__4278_wi64[safe_add( _4290_sp,_ptr__4373_xi32[safe_add( _4369_xperm,_4390_ecolp )] )] % _4383_edim1);
                ++ _4390_ecolp;
                while ( ((_4390_ecolp < _4281_nelem) && ((_ptr__4278_wi64[safe_add( _4290_sp,_ptr__4373_xi32[safe_add( _4369_xperm,_4390_ecolp )] )] % _4383_edim1) == _4392_rj)) )
                {
                  {
                    ++ _4390_ecolp;
                  }
                }
                int32_t _4393_ep = _4391_ecolb;
                int32_t _4394_pp = _4388_prowb;
                bool _4395_exist = false;
                int32_t _4396_rownnz = (int)0;
                while ( ((_4394_pp < _4387_prowp) && (_4393_ep < _4390_ecolp)) )
                {
                  {
                    int32_t _4397_eidx = _ptr__4373_xi32[safe_add( _4369_xperm,_4393_ep )];
                    if (((_ptr__4374_xi64[safe_add( _4371_xpsp,_4394_pp )] % _4385_pdim1) < (_ptr__4278_wi64[safe_add( _4290_sp,_4397_eidx )] / _4383_edim1)))
                    {
                      {
                        ++ _4394_pp;
                      }
                    }
                    else if(((_ptr__4374_xi64[safe_add( _4371_xpsp,_4394_pp )] % _4385_pdim1) > (_ptr__4278_wi64[safe_add( _4290_sp,_4397_eidx )] / _4383_edim1)))
                    {
                      {
                        ++ _4393_ep;
                      }
                    }
                    else
                    {
                      {
                        int32_t _4398_n = (_ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4397_eidx ),(int)1 )] - _ptr__4277_wi32[safe_add( _4285_ptr,_4397_eidx )]);
                        _4381_rnnz += _4398_n;
                        int32_t _11177_;
                        bool _11178_ = (_4284_ncodeatom > (int)0);
                        if (_11178_)
                        {
                          _11177_ = safe_add( (_ptr__4277_wi32[safe_add( _4288_codeptr,_ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4397_eidx ),(int)1 )] )] - _ptr__4277_wi32[safe_add( _4288_codeptr,_ptr__4277_wi32[safe_add( _4285_ptr,_4397_eidx )] )]),safe_mul( (int)4,_4398_n ) );
                        }
                        else
                        {
                          _11177_ = safe_mul( (int)3,_4398_n );
                        }
                        _4382_rncodeatom += _11177_;
                        ++ _4393_ep;
                        ++ _4394_pp;
                        ++ _4396_rownnz;
                      }
                    }
                  }
                }
                if ((_4396_rownnz > (int)0))
                {
                  {
                    ++ _4380_rnelem;
                  }
                }
                {}
              }
            }
          }
        }
      }
      int32_t _4399_rnd = (int)2;
      bool _4400_rhassp = (_4380_rnelem < safe_mul( _4386_pdim0,_4383_edim1 ));
      _4274_rs->alloc_expr(_4399_rnd,_4380_rnelem,_4381_rnnz,_4400_rhassp,_4382_rncodeatom);
      int32_t _4401_rptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->ptr_base;
      int32_t _4402_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->nidxs_base;
      int32_t _11179_;
      bool _11180_ = _4400_rhassp;
      if (_11180_)
      {
        _11179_ = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->sp_base;
      }
      else
      {
        _11179_ = _4274_rs->alloci64(_4380_rnelem);
      }
      int32_t _4403_rsp = _11179_;
      int32_t _4404_rcof = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cof_base;
      int32_t _4405_rshape = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->shape_base;
      int32_t _4406_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->codeptr_base;
      int32_t _4407_rcode = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->code_base;
      int32_t _4408_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4409_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4409_ri64(_4409_ri64 ? _4409_ri64->raw() : nullptr,_4409_ri64 ? _4409_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4410_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->f64;
      _checked_ptr_1<double> _ptr__4410_rf64(_4410_rf64 ? _4410_rf64->raw() : nullptr,_4410_rf64 ? _4410_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4411_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4274_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4411_ri32(_4411_ri32 ? _4411_ri32->raw() : nullptr,_4411_ri32 ? _4411_ri32->size(0) : 0);
      int32_t _11181_ = (int)0;
      int32_t _11182_ = safe_add( _4380_rnelem,(int)1 );
      for (int32_t _4412_i = _11181_; _4412_i < _11182_; ++_4412_i)
      {
        {
          _ptr__4411_ri32[safe_add( _4401_rptr,_4412_i )] = (-(int)9999);
        }
      }
      {
        _ptr__4411_ri32[_4401_rptr] = (int)0;
        if ((_4382_rncodeatom > (int)0))
        {
          {
            _ptr__4411_ri32[_4406_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__4411_ri32[_4405_rshape] = _4386_pdim0;
        _ptr__4411_ri32[safe_add( _4405_rshape,(int)1 )] = _4383_edim1;
        int32_t _4413_nzi = (int)0;
        int32_t _4414_elmi = (int)0;
        int32_t _4415_codei = (int)0;
        int32_t _11183_ = (int)0;
        int32_t _11184_ = _4381_rnnz;
        for (int32_t _4416_i = _11183_; _4416_i < _11184_; ++_4416_i)
        {
          {
            _ptr__4410_rf64[safe_add( _4404_rcof,_4416_i )] = 0.0;
          }
        }
        int32_t _4417_prowp = (int)0;
        while ( (_4417_prowp < _4370_pnelem) )
        {
          {
            int32_t _4418_prowb = _4417_prowp;
            int64_t _4419_ri = (_ptr__4374_xi64[safe_add( _4371_xpsp,_4417_prowp )] / _4385_pdim1);
            while ( ((_4417_prowp < _4370_pnelem) && (_ptr__4374_xi64[safe_add( _4371_xpsp,_4417_prowp )] < safe_mul( safe_add( _4419_ri,(int)1 ),_4385_pdim1 ))) )
            {
              {
                ++ _4417_prowp;
              }
            }
            int32_t _4420_ecolp = (int)0;
            while ( (_4420_ecolp < _4281_nelem) )
            {
              {
                int32_t _4421_ecolb = _4420_ecolp;
                int64_t _4422_rj = (_ptr__4278_wi64[safe_add( _4290_sp,_ptr__4373_xi32[safe_add( _4369_xperm,_4420_ecolp )] )] % _4383_edim1);
                ++ _4420_ecolp;
                while ( ((_4420_ecolp < _4281_nelem) && ((_ptr__4278_wi64[safe_add( _4290_sp,_ptr__4373_xi32[safe_add( _4369_xperm,_4420_ecolp )] )] % _4383_edim1) == _4422_rj)) )
                {
                  {
                    ++ _4420_ecolp;
                  }
                }
                int32_t _4423_ep = _4421_ecolb;
                int32_t _4424_pp = _4418_prowb;
                int32_t _4425_nsumelm = (int)0;
                while ( ((_4424_pp < _4417_prowp) && (_4423_ep < _4420_ecolp)) )
                {
                  {
                    int32_t _4426_eidx = _ptr__4373_xi32[safe_add( _4369_xperm,_4423_ep )];
                    if (((_ptr__4374_xi64[safe_add( _4371_xpsp,_4424_pp )] % _4385_pdim1) < (_ptr__4278_wi64[safe_add( _4290_sp,_4426_eidx )] / _4383_edim1)))
                    {
                      {
                        ++ _4424_pp;
                      }
                    }
                    else if(((_ptr__4374_xi64[safe_add( _4371_xpsp,_4424_pp )] % _4385_pdim1) > (_ptr__4278_wi64[safe_add( _4290_sp,_4426_eidx )] / _4383_edim1)))
                    {
                      {
                        ++ _4423_ep;
                      }
                    }
                    else
                    {
                      {
                        int32_t _11185_ = _ptr__4277_wi32[safe_add( _4285_ptr,_4426_eidx )];
                        int32_t _11186_ = _ptr__4277_wi32[safe_add( safe_add( _4285_ptr,_4426_eidx ),(int)1 )];
                        for (int32_t _4427_i = _11185_; _4427_i < _11186_; ++_4427_i)
                        {
                          {
                            _ptr__4409_ri64[safe_add( _4402_rnidxs,_4413_nzi )] = _ptr__4278_wi64[safe_add( _4291_nidxs,_4427_i )];
                            _ptr__4411_ri32[safe_add( _4407_rcode,_4415_codei )] = 2;
                            _ptr__4410_rf64[safe_add( _4408_rcconst,_4415_codei )] = _ptr__4279_wf64[safe_add( _4292_cof,_4427_i )];
                            ++ _4415_codei;
                            if ((_4284_ncodeatom > (int)0))
                            {
                              {
                                int32_t _11187_ = _ptr__4277_wi32[safe_add( _4288_codeptr,_4427_i )];
                                int32_t _11188_ = _ptr__4277_wi32[safe_add( safe_add( _4288_codeptr,_4427_i ),(int)1 )];
                                for (int32_t _4428_k = _11187_; _4428_k < _11188_; ++_4428_k)
                                {
                                  {
                                    _ptr__4411_ri32[safe_add( _4407_rcode,_4415_codei )] = _ptr__4277_wi32[safe_add( _4286_code,_4428_k )];
                                    _ptr__4410_rf64[safe_add( _4408_rcconst,_4415_codei )] = _ptr__4279_wf64[safe_add( _4287_cconst,_4428_k )];
                                    ++ _4415_codei;
                                  }
                                }
                                _ptr__4411_ri32[safe_add( _4407_rcode,_4415_codei )] = 3;
                                ++ _4415_codei;
                              }
                            }
                            {}
                            _ptr__4411_ri32[safe_add( _4407_rcode,_4415_codei )] = 1;
                            _ptr__4410_rf64[safe_add( _4408_rcconst,_4415_codei )] = _ptr__4373_xi32[safe_add( _4299_pidxs,_4424_pp )];
                            ++ _4415_codei;
                            _ptr__4411_ri32[safe_add( _4407_rcode,_4415_codei )] = 5;
                            ++ _4415_codei;
                            _ptr__4411_ri32[safe_add( safe_add( _4406_rcodeptr,_4413_nzi ),(int)1 )] = _4415_codei;
                            ++ _4413_nzi;
                          }
                        }
                        ++ _4425_nsumelm;
                        ++ _4424_pp;
                        ++ _4423_ep;
                      }
                    }
                  }
                }
                if ((_4425_nsumelm > (int)0))
                {
                  {
                    _ptr__4409_ri64[safe_add( _4403_rsp,_4414_elmi )] = safe_add( safe_mul( _4419_ri,_4383_edim1 ),_4422_rj );
                    _ptr__4411_ri32[safe_add( safe_add( _4401_rptr,_4414_elmi ),(int)1 )] = _4413_nzi;
                    ++ _4414_elmi;
                  }
                }
                {}
              }
            }
          }
        }
        if ((_4415_codei != _4382_rncodeatom))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect a-code length"));
          }
        }
        {}
        if ((_4413_nzi != _4381_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nnz length"));
          }
        }
        {}
        if ((_4414_elmi != _4380_rnelem))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect nelem length"));
          }
        }
        {}
        if ((_ptr__4411_ri32[safe_add( _4401_rptr,_4414_elmi )] != _4381_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal! Incorrect ptr"));
          }
        }
        {}
      }
      if ((!_4400_rhassp))
      {
        {
          _4274_rs->popi64(_4380_rnelem);
        }
      }
      {}
    }
  }
  _4276_xs->clear();
}
// End mosek.fusion.ExprMulParamLeft.eval

// Begin mosek.fusion.ExprMulParamLeft.toString
// Method mosek.fusion.ExprMulParamLeft.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:548:6-154
std::string mosek::fusion::ExprMulParamLeft :: toString() { return mosek::fusion::p_ExprMulParamLeft::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulParamLeft::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulParamLeft("))->__mosek_2fusion_2Utils_2StringBuffer__a(p->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulParamLeft.toString

void mosek::fusion::p_ExprMulParamLeft::destroy()
{
  e.reset();
  p.reset();
}
void mosek::fusion::ExprMulParamLeft::destroy() { mosek::fusion::p_ExprMulParamLeft::_get_impl(this)->destroy(); }
// } class ExprMulParamLeft
// class ParameterImpl { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:108:4-514:5
mosek::fusion::ParameterImpl::ParameterImpl(mosek::fusion::p_ParameterImpl *_impl) : _impl(_impl) { /*std::cout << "ParameterImpl() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ParameterImpl::~ParameterImpl() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ParameterImpl::p_ParameterImpl
  (::mosek::fusion::ParameterImpl * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.ParameterImpl.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:126:6-132:7
mosek::fusion::ParameterImpl::t mosek::fusion::p_ParameterImpl::_new_ParameterImpl
  (monty::rc_ptr< ::mosek::fusion::ParameterImpl > _4429_other,
    monty::rc_ptr< ::mosek::fusion::Model > _4430_model)
{ return new mosek::fusion::ParameterImpl(_4429_other,_4430_model); }
mosek::fusion::ParameterImpl::ParameterImpl
  (monty::rc_ptr< ::mosek::fusion::ParameterImpl > _4429_other,
    monty::rc_ptr< ::mosek::fusion::Model > _4430_model) : 
   ParameterImpl(new mosek::fusion::p_ParameterImpl(this))
{ mosek::fusion::p_ParameterImpl::_get_impl(this)->_initialize(_4429_other,_4430_model); }
void mosek::fusion::p_ParameterImpl::_initialize  (monty::rc_ptr< ::mosek::fusion::ParameterImpl > _4429_other,
    monty::rc_ptr< ::mosek::fusion::Model > _4430_model)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->model = _4430_model;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->shape = mosek::fusion::p_ParameterImpl::_get_impl(_4429_other)->shape;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->sp = mosek::fusion::p_ParameterImpl::_get_impl(_4429_other)->sp;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->size = mosek::fusion::p_ParameterImpl::_get_impl(_4429_other)->size;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->nidxs = mosek::fusion::p_ParameterImpl::_get_impl(_4429_other)->nidxs;
  }
}
// mosek.fusion.ParameterImpl.ctor

// mosek.fusion.ParameterImpl.ctor @ bld/docker-win/final/default/src/fusion/Parameter.monty:115:6-124:7
mosek::fusion::ParameterImpl::t mosek::fusion::p_ParameterImpl::_new_ParameterImpl
  (monty::rc_ptr< ::mosek::fusion::Model > _4431_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4432_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4433_sp,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4434_nidxs)
{ return new mosek::fusion::ParameterImpl(_4431_model,_4432_shape,_4433_sp,_4434_nidxs); }
mosek::fusion::ParameterImpl::ParameterImpl
  (monty::rc_ptr< ::mosek::fusion::Model > _4431_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4432_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4433_sp,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4434_nidxs) : 
   ParameterImpl(new mosek::fusion::p_ParameterImpl(this))
{ mosek::fusion::p_ParameterImpl::_get_impl(this)->_initialize(_4431_model,_4432_shape,_4433_sp,_4434_nidxs); }
void mosek::fusion::p_ParameterImpl::_initialize  (monty::rc_ptr< ::mosek::fusion::Model > _4431_model,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4432_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4433_sp,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4434_nidxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__4432_shape(_4432_shape ? _4432_shape->raw() : nullptr, _4432_shape ? _4432_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__4433_sp(_4433_sp ? _4433_sp->raw() : nullptr, _4433_sp ? _4433_sp->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__4434_nidxs(_4434_nidxs ? _4434_nidxs->raw() : nullptr, _4434_nidxs ? _4434_nidxs->size(0) : 0);
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->model = _4431_model;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->shape = ::mosek::fusion::Utils::Tools::arraycopy(_4432_shape);
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->sp = _4433_sp;
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->size = ::mosek::fusion::p_Set::size(_4432_shape);
    mosek::fusion::p_ParameterImpl::_get_impl(::mosek::fusion::ParameterImpl::t(_pubthis))->nidxs = ::mosek::fusion::Utils::Tools::arraycopy(_4434_nidxs);
  }
}
// mosek.fusion.ParameterImpl.ctor

// Begin mosek.fusion.ParameterImpl.clone
// Method mosek.fusion.ParameterImpl.clone @ bld/docker-win/final/default/src/fusion/Parameter.monty:511:6-513:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__clone(monty::rc_ptr< ::mosek::fusion::Model > _4435_m) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__clone(_4435_m); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::clone(monty::rc_ptr< ::mosek::fusion::Model > _4435_m) { return __mosek_2fusion_2ParameterImpl__clone(_4435_m); }
/* override: mosek.fusion.Parameter.clone*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__clone(monty::rc_ptr< ::mosek::fusion::Model > _4435_m) { return __mosek_2fusion_2ParameterImpl__clone(_4435_m); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__clone(monty::rc_ptr< ::mosek::fusion::Model > _4435_m)
{
  return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(::mosek::fusion::ParameterImpl::t(_pubthis),_4435_m)).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.ParameterImpl.clone

// Begin mosek.fusion.ParameterImpl.toString
// Method mosek.fusion.ParameterImpl.toString @ bld/docker-win/final/default/src/fusion/Parameter.monty:496:6-508:7
std::string mosek::fusion::ParameterImpl :: toString() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ParameterImpl::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _4436_r = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Parameter(("));
  if (((int)((shape)->size(0)) > (int)0))
  {
    {
      _4436_r->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)((int)0)));
      int32_t _11189_ = (int)1;
      int32_t _11190_ = (int)((shape)->size(0));
      for (int32_t _4437_i = _11189_; _4437_i < _11190_; ++_4437_i)
      {
        {
          _4436_r->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*shape)(_4437_i)));
        }
      }
    }
  }
  {}
  _4436_r->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  if ((NULL != sp.get()))
  {
    {
      _4436_r->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",sparse"));
    }
  }
  {}
  _4436_r->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _4436_r->toString();
}
// End mosek.fusion.ParameterImpl.toString

// Begin mosek.fusion.ParameterImpl.pick
// Method mosek.fusion.ParameterImpl.pick @ bld/docker-win/final/default/src/fusion/Parameter.monty:435:6-493:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4438_midxs) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__pick(_4438_midxs); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4438_midxs) { return __mosek_2fusion_2ParameterImpl__pick(_4438_midxs); }
/* override: mosek.fusion.Parameter.pick*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4438_midxs) { return __mosek_2fusion_2ParameterImpl__pick(_4438_midxs); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4438_midxs)
{
  if (((int)((shape)->size(0)) != (int)((_4438_midxs)->size(1))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  bool _4439_invalidindex = false;
  int32_t _11191_ = (int)0;
  int32_t _11192_ = (int)((_4438_midxs)->size(0));
  for (int32_t _4440_i = _11191_; _4440_i < _11192_; ++_4440_i)
  {
    {
      int32_t _11193_ = (int)0;
      int32_t _11194_ = (int)((_4438_midxs)->size(1));
      for (int32_t _4441_j = _11193_; _4441_j < _11194_; ++_4441_j)
      {
        {
          if (((((*_4438_midxs)(_4440_i,_4441_j)) < (int)0) || (((*_4438_midxs)(_4440_i,_4441_j)) >= ((*shape)(_4441_j)))))
          {
            {
              _4439_invalidindex = true;
            }
          }
          {}
        }
      }
    }
  }
  if (_4439_invalidindex)
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  int32_t _4442_nd = (int)((shape)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4443_strides = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4442_nd)));
  _checked_ptr_1<int64_t> _ptr__4443_strides(_4443_strides ? _4443_strides->raw() : nullptr,_4443_strides ? _4443_strides->size(0) : 0);
  _ptr__4443_strides[(_4442_nd - (int)1)] = (int)1;
  int32_t _11195_ = (int)1;
  int32_t _11196_ = _4442_nd;
  for (int32_t _4444_i = _11195_; _4444_i < _11196_; ++_4444_i)
  {
    {
      _ptr__4443_strides[((_4442_nd - _4444_i) - (int)1)] = safe_mul( _ptr__4443_strides[(_4442_nd - _4444_i)],((*shape)((_4442_nd - _4444_i))) );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4445_rshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_4438_midxs)->size(0)))});
  _checked_ptr_1<int32_t> _ptr__4445_rshape(_4445_rshape ? _4445_rshape->raw() : nullptr,_4445_rshape ? _4445_rshape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4446_idxs;
  _checked_ptr_1<int32_t> _ptr__4446_idxs(_4446_idxs ? _4446_idxs->raw() : nullptr,_4446_idxs ? _4446_idxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4447_rsp = nullptr;
  _checked_ptr_1<int64_t> _ptr__4447_rsp(_4447_rsp ? _4447_rsp->raw() : nullptr,_4447_rsp ? _4447_rsp->size(0) : 0);
  if ((NULL == sp.get()))
  {
    {
      _4446_idxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)((_4438_midxs)->size(0)))));
      _ptr__4446_idxs.update(_4446_idxs ? _4446_idxs->raw() : nullptr, _4446_idxs ? _4446_idxs->size(0) : 0);
      {
        int32_t _11197_ = (int)0;
        int32_t _11198_ = (int)((_4438_midxs)->size(0));
        for (int32_t _4448_i = _11197_; _4448_i < _11198_; ++_4448_i)
        {
          {
            int64_t _4449_ii = (int64_t)0;
            int32_t _11199_ = (int)0;
            int32_t _11200_ = _4442_nd;
            for (int32_t _4450_j = _11199_; _4450_j < _11200_; ++_4450_j)
            {
              {
                _4449_ii += safe_mul( _ptr__4443_strides[_4450_j],((*_4438_midxs)(_4448_i,_4450_j)) );
              }
            }
            _ptr__4446_idxs[_4448_i] = ((*nidxs)(_4449_ii));
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _4451_nnz = (int)0;
      int32_t _11201_ = (int)0;
      int32_t _11202_ = (int)((_4438_midxs)->size(0));
      for (int32_t _4452_i = _11201_; _4452_i < _11202_; ++_4452_i)
      {
        {
          int64_t _4453_ii = (int64_t)0;
          int32_t _11203_ = (int)0;
          int32_t _11204_ = _4442_nd;
          for (int32_t _4454_j = _11203_; _4454_j < _11204_; ++_4454_j)
          {
            {
              _4453_ii += safe_mul( _ptr__4443_strides[_4454_j],((*_4438_midxs)(_4452_i,_4454_j)) );
            }
          }
          if ((::mosek::fusion::p_CommonTools::binarySearch(sp,_4453_ii) >= (int)0))
          {
            {
              ++ _4451_nnz;
            }
          }
          {}
        }
      }
      _4446_idxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4451_nnz)));
      _ptr__4446_idxs.update(_4446_idxs ? _4446_idxs->raw() : nullptr, _4446_idxs ? _4446_idxs->size(0) : 0);
      _4447_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4451_nnz)));
      _ptr__4447_rsp.update(_4447_rsp ? _4447_rsp->raw() : nullptr, _4447_rsp ? _4447_rsp->size(0) : 0);
      {
        int32_t _4455_k = (int)0;
        int32_t _11205_ = (int)0;
        int32_t _11206_ = (int)((_4438_midxs)->size(0));
        for (int32_t _4456_i = _11205_; _4456_i < _11206_; ++_4456_i)
        {
          {
            int64_t _4457_ii = (int64_t)0;
            int32_t _11207_ = (int)0;
            int32_t _11208_ = _4442_nd;
            for (int32_t _4458_j = _11207_; _4458_j < _11208_; ++_4458_j)
            {
              {
                _4457_ii += safe_mul( _ptr__4443_strides[_4458_j],((*_4438_midxs)(_4456_i,_4458_j)) );
              }
            }
            int32_t _4459_iidx = ::mosek::fusion::p_CommonTools::binarySearch(sp,_4457_ii);
            if ((_4459_iidx >= (int)0))
            {
              {
                _ptr__4446_idxs[_4455_k] = ((*nidxs)(_4459_iidx));
                _ptr__4447_rsp[_4455_k] = _4456_i;
                ++ _4455_k;
              }
            }
            {}
          }
        }
      }
      if ((_4451_nnz == (int)((_4438_midxs)->size(0))))
      {
        {
          _4447_rsp = nullptr;
          _ptr__4447_rsp.update(_4447_rsp ? _4447_rsp->raw() : nullptr, _4447_rsp ? _4447_rsp->size(0) : 0);
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,_4445_rshape,_4447_rsp,_4446_idxs)).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.ParameterImpl.pick

// Begin mosek.fusion.ParameterImpl.pick
// Method mosek.fusion.ParameterImpl.pick @ bld/docker-win/final/default/src/fusion/Parameter.monty:394:6-433:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4460_idxs) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__pick(_4460_idxs); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4460_idxs) { return __mosek_2fusion_2ParameterImpl__pick(_4460_idxs); }
/* override: mosek.fusion.Parameter.pick*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4460_idxs) { return __mosek_2fusion_2ParameterImpl__pick(_4460_idxs); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4460_idxs)
{
  _checked_ptr_1<int32_t> _ptr__4460_idxs(_4460_idxs ? _4460_idxs->raw() : nullptr, _4460_idxs ? _4460_idxs->size(0) : 0);
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  bool _4461_invalidindex = false;
  int32_t _11209_ = (int)0;
  int32_t _11210_ = (int)((_4460_idxs)->size(0));
  for (int32_t _4462_i = _11209_; _4462_i < _11210_; ++_4462_i)
  {
    {
      if (((_ptr__4460_idxs[_4462_i] < (int)0) || (_ptr__4460_idxs[_4462_i] >= ((*shape)((int)0)))))
      {
        {
          _4461_invalidindex = true;
        }
      }
      {}
    }
  }
  if (_4461_invalidindex)
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4463_rnidxs;
  _checked_ptr_1<int32_t> _ptr__4463_rnidxs(_4463_rnidxs ? _4463_rnidxs->raw() : nullptr,_4463_rnidxs ? _4463_rnidxs->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4464_rsp = nullptr;
  _checked_ptr_1<int64_t> _ptr__4464_rsp(_4464_rsp ? _4464_rsp->raw() : nullptr,_4464_rsp ? _4464_rsp->size(0) : 0);
  if ((NULL == sp.get()))
  {
    {
      std::vector<int32_t> _11211_;
      for (int32_t _4465_i = (int)0, _11212_ = (int)((_4460_idxs)->size(0)); _4465_i < _11212_ ; ++_4465_i)
      {
        _11211_.push_back(((*nidxs)(_ptr__4460_idxs[_4465_i])));
      }
      auto _11213_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11211_.size()),_11211_.begin(),_11211_.end()));
      _4463_rnidxs = _11213_;
      _ptr__4463_rnidxs.update(_4463_rnidxs ? _4463_rnidxs->raw() : nullptr, _4463_rnidxs ? _4463_rnidxs->size(0) : 0);
    }
  }
  else
  {
    {
      int32_t _4466_nnz = (int)0;
      int32_t _11214_ = (int)0;
      int32_t _11215_ = (int)((_4460_idxs)->size(0));
      for (int32_t _4467_i = _11214_; _4467_i < _11215_; ++_4467_i)
      {
        {
          if ((::mosek::fusion::p_CommonTools::binarySearch(sp,(int64_t)(_ptr__4460_idxs[_4467_i])) >= (int)0))
          {
            {
              ++ _4466_nnz;
            }
          }
          {}
        }
      }
      _4463_rnidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4466_nnz)));
      _ptr__4463_rnidxs.update(_4463_rnidxs ? _4463_rnidxs->raw() : nullptr, _4463_rnidxs ? _4463_rnidxs->size(0) : 0);
      _4464_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4466_nnz)));
      _ptr__4464_rsp.update(_4464_rsp ? _4464_rsp->raw() : nullptr, _4464_rsp ? _4464_rsp->size(0) : 0);
      int32_t _4468_k = (int)0;
      int32_t _11216_ = (int)0;
      int32_t _11217_ = (int)((_4460_idxs)->size(0));
      for (int32_t _4469_i = _11216_; _4469_i < _11217_; ++_4469_i)
      {
        {
          int32_t _4470_j = ::mosek::fusion::p_CommonTools::binarySearch(sp,(int64_t)(_ptr__4460_idxs[_4469_i]));
          if ((_4470_j >= (int)0))
          {
            {
              _ptr__4464_rsp[_4468_k] = _4469_i;
              _ptr__4463_rnidxs[_4468_k] = ((*nidxs)(_4470_j));
              ++ _4468_k;
            }
          }
          {}
        }
      }
      if ((_4466_nnz == (int)((_4460_idxs)->size(0))))
      {
        {
          _4464_rsp = nullptr;
          _ptr__4464_rsp.update(_4464_rsp ? _4464_rsp->raw() : nullptr, _4464_rsp ? _4464_rsp->size(0) : 0);
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_4460_idxs)->size(0)))}),_4464_rsp,_4463_rnidxs)).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.ParameterImpl.pick

// Begin mosek.fusion.ParameterImpl.index
// Method mosek.fusion.ParameterImpl.index @ bld/docker-win/final/default/src/fusion/Parameter.monty:366:6-392:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _4471_indexes) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__index(_4471_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _4471_indexes) { return __mosek_2fusion_2ParameterImpl__index(_4471_indexes); }
/* override: mosek.fusion.Expression.index*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::__mosek_2fusion_2Expression__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _4471_indexes) { return __mosek_2fusion_2ParameterImpl__index(_4471_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _4471_indexes)
{
  _checked_ptr_1<int32_t> _ptr__4471_indexes(_4471_indexes ? _4471_indexes->raw() : nullptr, _4471_indexes ? _4471_indexes->size(0) : 0);
  if (((int)((shape)->size(0)) != (int)((_4471_indexes)->size(0))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Index has incorrect dimension"));
    }
  }
  else
  {
    {
      int32_t _11218_ = (int)0;
      int32_t _11219_ = (int)((_4471_indexes)->size(0));
      for (int32_t _4472_i = _11218_; _4472_i < _11219_; ++_4472_i)
      {
        {
          if (((_ptr__4471_indexes[_4472_i] < (int)0) || (_ptr__4471_indexes[_4472_i] >= ((*shape)(_4472_i)))))
          {
            {
              throw ::mosek::fusion::IndexError(std::string ("Index out of bounds"));
            }
          }
          {}
        }
      }
    }
  }
  if ((NULL == sp.get()))
  {
    {
      int32_t _4473_nd = (int)((_4471_indexes)->size(0));
      int64_t _4474_ix = _ptr__4471_indexes[(_4473_nd - (int)1)];
      int32_t _11220_ = (int)1;
      int32_t _11221_ = _4473_nd;
      for (int32_t _4475_i = _11220_; _4475_i < _11221_; ++_4475_i)
      {
        {
          _4474_ix = safe_add( safe_mul( _4474_ix,((*shape)((_4473_nd - _4475_i))) ),_ptr__4471_indexes[((_4473_nd - _4475_i) - (int)1)] );
        }
      }
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*nidxs)(_4474_ix)))}))).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      int32_t _4476_nd = (int)((_4471_indexes)->size(0));
      int64_t _4477_ix = _ptr__4471_indexes[(_4476_nd - (int)1)];
      int32_t _11222_ = (int)1;
      int32_t _11223_ = _4476_nd;
      for (int32_t _4478_i = _11222_; _4478_i < _11223_; ++_4478_i)
      {
        {
          _4477_ix = safe_add( safe_mul( _4477_ix,((*shape)((_4476_nd - _4478_i))) ),_ptr__4471_indexes[((_4476_nd - _4478_i) - (int)1)] );
        }
      }
      int32_t _4479_j = (int)0;
      while ( ((_4479_j < (int)((sp)->size(0))) && (((*sp)(_4479_j)) < _4477_ix)) )
      {
        {
          ++ _4479_j;
        }
      }
      if (((_4479_j < (int)((sp)->size(0))) && (((*sp)(_4479_j)) == _4477_ix)))
      {
        {
          return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*nidxs)(_4479_j)))}))).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))))).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
}
// End mosek.fusion.ParameterImpl.index

// Begin mosek.fusion.ParameterImpl.index
// Method mosek.fusion.ParameterImpl.index @ bld/docker-win/final/default/src/fusion/Parameter.monty:348:6-364:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__index(int32_t _4480_i) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__index(_4480_i); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::index(int32_t _4480_i) { return __mosek_2fusion_2ParameterImpl__index(_4480_i); }
/* override: mosek.fusion.Expression.index*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::__mosek_2fusion_2Expression__index(int32_t _4480_i) { return __mosek_2fusion_2ParameterImpl__index(_4480_i); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__index(int32_t _4480_i)
{
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Index has incorrect dimension"));
    }
  }
  else if(((_4480_i < (int)0) || (_4480_i >= ((*shape)((int)0)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Index out of bounds"));
    }
  }
  {}
  if ((NULL == sp.get()))
  {
    {
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*nidxs)(_4480_i)))}))).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      int32_t _4481_j = (int)0;
      while ( ((_4481_j < (int)((sp)->size(0))) && (((*sp)(_4481_j)) < _4480_i)) )
      {
        {
          ++ _4481_j;
        }
      }
      if (((_4481_j < (int)((sp)->size(0))) && (((*sp)(_4481_j)) == _4480_i)))
      {
        {
          return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),nullptr,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((*nidxs)(_4481_j)))}))).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))))).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
}
// End mosek.fusion.ParameterImpl.index

// Begin mosek.fusion.ParameterImpl.eval
// Method mosek.fusion.ParameterImpl.eval @ bld/docker-win/final/default/src/fusion/Parameter.monty:307:6-345:7
void mosek::fusion::ParameterImpl :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4482_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4483_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4484_xs) { mosek::fusion::p_ParameterImpl::_get_impl(this)->eval(_4482_rs,_4483_ws,_4484_xs); }
void mosek::fusion::p_ParameterImpl::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4482_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4483_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4484_xs)
{
  int32_t _4485_nd = (int)((shape)->size(0));
  int32_t _4486_nelem = (int)((nidxs)->size(0));
  bool _4487_hassp = (NULL != sp.get());
  _4482_rs->alloc_expr(_4485_nd,_4486_nelem,(int)((nidxs)->size(0)),_4487_hassp,(int)((nidxs)->size(0)));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4488_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__4488_ri32(_4488_ri32 ? _4488_ri32->raw() : nullptr,_4488_ri32 ? _4488_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4489_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__4489_ri64(_4489_ri64 ? _4489_ri64->raw() : nullptr,_4489_ri64 ? _4489_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4490_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->f64;
  _checked_ptr_1<double> _ptr__4490_rf64(_4490_rf64 ? _4490_rf64->raw() : nullptr,_4490_rf64 ? _4490_rf64->size(0) : 0);
  int32_t _4491_rptr = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->ptr_base;
  int32_t _4492_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->nidxs_base;
  int32_t _4493_rcof = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->cof_base;
  int32_t _4494_rshape = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->shape_base;
  int32_t _4495_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->codeptr_base;
  int32_t _4496_rcode = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->code_base;
  int32_t _4497_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->cconst_base;
  int32_t _4498_rsp = mosek::fusion::p_WorkStack::_get_impl(_4482_rs)->sp_base;
  {
    _ptr__4488_ri32[_4491_rptr] = (int)0;
    int32_t _11224_ = (int)0;
    int32_t _11225_ = _4485_nd;
    for (int32_t _4499_i = _11224_; _4499_i < _11225_; ++_4499_i)
    {
      {
        _ptr__4488_ri32[safe_add( _4494_rshape,_4499_i )] = ((*shape)(_4499_i));
      }
    }
    int32_t _11226_ = (int)0;
    int32_t _11227_ = _4486_nelem;
    for (int32_t _4500_i = _11226_; _4500_i < _11227_; ++_4500_i)
    {
      {
        _ptr__4489_ri64[safe_add( _4492_rnidxs,_4500_i )] = (int)0;
      }
    }
    int32_t _11228_ = (int)0;
    int32_t _11229_ = _4486_nelem;
    for (int32_t _4501_i = _11228_; _4501_i < _11229_; ++_4501_i)
    {
      {
        _ptr__4490_rf64[safe_add( _4493_rcof,_4501_i )] = 0.0;
      }
    }
    int32_t _11230_ = (int)0;
    int32_t _11231_ = safe_add( _4486_nelem,(int)1 );
    for (int32_t _4502_i = _11230_; _4502_i < _11231_; ++_4502_i)
    {
      {
        _ptr__4488_ri32[safe_add( _4491_rptr,_4502_i )] = _4502_i;
      }
    }
    if ((_4486_nelem > (int)0))
    {
      {
        int32_t _11232_ = (int)0;
        int32_t _11233_ = safe_add( _4486_nelem,(int)1 );
        for (int32_t _4503_i = _11232_; _4503_i < _11233_; ++_4503_i)
        {
          {
            _ptr__4488_ri32[safe_add( _4495_rcodeptr,_4503_i )] = _4503_i;
          }
        }
      }
    }
    {}
    if (_4487_hassp)
    {
      {
        int32_t _11234_ = (int)0;
        int32_t _11235_ = _4486_nelem;
        for (int32_t _4504_i = _11234_; _4504_i < _11235_; ++_4504_i)
        {
          {
            _ptr__4489_ri64[safe_add( _4498_rsp,_4504_i )] = ((*sp)(_4504_i));
          }
        }
      }
    }
    {}
    int32_t _11236_ = (int)0;
    int32_t _11237_ = _4486_nelem;
    for (int32_t _4505_i = _11236_; _4505_i < _11237_; ++_4505_i)
    {
      {
        _ptr__4488_ri32[safe_add( _4496_rcode,_4505_i )] = (int)1;
        _ptr__4490_rf64[safe_add( _4497_rcconst,_4505_i )] = ((*nidxs)(_4505_i));
      }
    }
  }
}
// End mosek.fusion.ParameterImpl.eval

// Begin mosek.fusion.ParameterImpl.getSp
// Method mosek.fusion.ParameterImpl.getSp @ bld/docker-win/final/default/src/fusion/Parameter.monty:297:6-304:7
void mosek::fusion::ParameterImpl :: getSp(std::shared_ptr< monty::ndarray< int64_t,1 > > _4506_dest,int32_t _4507_offset) { mosek::fusion::p_ParameterImpl::_get_impl(this)->getSp(_4506_dest,_4507_offset); }
void mosek::fusion::p_ParameterImpl::getSp(std::shared_ptr< monty::ndarray< int64_t,1 > > _4506_dest,int32_t _4507_offset)
{
  _checked_ptr_1<int64_t> _ptr__4506_dest(_4506_dest ? _4506_dest->raw() : nullptr, _4506_dest ? _4506_dest->size(0) : 0);
  if ((NULL != sp.get()))
  {
    {
      int32_t _11238_ = (int)0;
      int32_t _11239_ = (int)((sp)->size(0));
      for (int32_t _4508_i = _11238_; _4508_i < _11239_; ++_4508_i)
      {
        {
          _ptr__4506_dest[safe_add( _4508_i,_4507_offset )] = ((*sp)(_4508_i));
        }
      }
    }
  }
  else
  {
    {
      int32_t _11240_ = (int)0;
      int32_t _11241_ = (int)((nidxs)->size(0));
      for (int32_t _4509_i = _11240_; _4509_i < _11241_; ++_4509_i)
      {
        {
          _ptr__4506_dest[safe_add( _4509_i,_4507_offset )] = _4509_i;
        }
      }
    }
  }
}
// End mosek.fusion.ParameterImpl.getSp

// Begin mosek.fusion.ParameterImpl.isSparse
// Method mosek.fusion.ParameterImpl.isSparse @ bld/docker-win/final/default/src/fusion/Parameter.monty:295:6-58
bool mosek::fusion::ParameterImpl :: isSparse() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->isSparse(); }
bool mosek::fusion::p_ParameterImpl::isSparse()
{
  return (NULL != sp.get());
}
// End mosek.fusion.ParameterImpl.isSparse

// Begin mosek.fusion.ParameterImpl.slice
// Method mosek.fusion.ParameterImpl.slice @ bld/docker-win/final/default/src/fusion/Parameter.monty:237:6-293:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4510_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4511_astop) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__slice(_4510_astart,_4511_astop); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4510_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4511_astop) { return __mosek_2fusion_2ParameterImpl__slice(_4510_astart,_4511_astop); }
/* override: mosek.fusion.Parameter.slice*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4510_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4511_astop) { return __mosek_2fusion_2ParameterImpl__slice(_4510_astart,_4511_astop); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4510_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4511_astop)
{
  _checked_ptr_1<int32_t> _ptr__4510_astart(_4510_astart ? _4510_astart->raw() : nullptr, _4510_astart ? _4510_astart->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__4511_astop(_4511_astop ? _4511_astop->raw() : nullptr, _4511_astop ? _4511_astop->size(0) : 0);
  if ((((int)((_4510_astart)->size(0)) != (int)((_4511_astop)->size(0))) || ((int)((_4510_astart)->size(0)) != (int)((shape)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid index dimension"));
    }
  }
  {}
  int32_t _4512_nd = (int)((_4510_astart)->size(0));
  int32_t _11242_ = (int)0;
  int32_t _11243_ = _4512_nd;
  for (int32_t _4513_i = _11242_; _4513_i < _11243_; ++_4513_i)
  {
    {
      if (((_ptr__4510_astart[_4513_i] < (int)0) || ((_ptr__4510_astart[_4513_i] >= _ptr__4511_astop[_4513_i]) || (_ptr__4511_astop[_4513_i] > ((*shape)(_4513_i))))))
      {
        {
          throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4514_stride = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4512_nd)));
  _checked_ptr_1<int64_t> _ptr__4514_stride(_4514_stride ? _4514_stride->raw() : nullptr,_4514_stride ? _4514_stride->size(0) : 0);
  _ptr__4514_stride[(_4512_nd - (int)1)] = (int)1;
  int32_t _11244_ = (int)1;
  int32_t _11245_ = _4512_nd;
  for (int32_t _4515_i = _11244_; _4515_i < _11245_; ++_4515_i)
  {
    {
      _ptr__4514_stride[((_4512_nd - _4515_i) - (int)1)] = safe_mul( _ptr__4514_stride[(_4512_nd - _4515_i)],((*shape)(_4515_i)) );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4516_index = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4512_nd)));
  _checked_ptr_1<int32_t> _ptr__4516_index(_4516_index ? _4516_index->raw() : nullptr,_4516_index ? _4516_index->size(0) : 0);
  std::vector<int32_t> _11246_;
  for (int32_t _4518_i = (int)0, _11247_ = _4512_nd; _4518_i < _11247_ ; ++_4518_i)
  {
    _11246_.push_back((_ptr__4511_astop[_4518_i] - _ptr__4510_astart[_4518_i]));
  }
  auto _11248_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11246_.size()),_11246_.begin(),_11246_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4517_rshape = _11248_;
  _checked_ptr_1<int32_t> _ptr__4517_rshape(_4517_rshape ? _4517_rshape->raw() : nullptr,_4517_rshape ? _4517_rshape->size(0) : 0);
  if ((NULL == sp.get()))
  {
    {
      int32_t _4519_count = (int)1;
      int32_t _11249_ = (int)0;
      int32_t _11250_ = _4512_nd;
      for (int32_t _4520_i = _11249_; _4520_i < _11250_; ++_4520_i)
      {
        {
          _4519_count *= _ptr__4517_rshape[_4520_i];
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4521_rnidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4519_count)));
      _checked_ptr_1<int32_t> _ptr__4521_rnidxs(_4521_rnidxs ? _4521_rnidxs->raw() : nullptr,_4521_rnidxs ? _4521_rnidxs->size(0) : 0);
      int32_t _4522_k = (int)0;
      int32_t _11251_ = (int)0;
      int32_t _11252_ = (int)((nidxs)->size(0));
      for (int32_t _4523_i = _11251_; _4523_i < _11252_; ++_4523_i)
      {
        {
          int32_t _11253_ = (int)0;
          int32_t _11254_ = _4512_nd;
          for (int32_t _4524_j = _11253_; _4524_j < _11254_; ++_4524_j)
          {
            {
              _ptr__4516_index[_4524_j] = (int32_t)((_4523_i / _ptr__4514_stride[_4524_j]) % ((*shape)(_4524_j)));
            }
          }
          bool _4525_inslice = true;
          int32_t _11255_ = (int)0;
          int32_t _11256_ = _4512_nd;
          for (int32_t _4526_j = _11255_; _4526_j < _11256_; ++_4526_j)
          {
            {
              _4525_inslice = (_4525_inslice && ((_ptr__4510_astart[_4526_j] <= _ptr__4516_index[_4526_j]) && (_ptr__4516_index[_4526_j] < _ptr__4511_astop[_4526_j])));
            }
          }
          if (_4525_inslice)
          {
            {
              _ptr__4521_rnidxs[_4522_k] = ((*nidxs)(_4523_i));
              ++ _4522_k;
            }
          }
          {}
        }
      }
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,_4517_rshape,nullptr,_4521_rnidxs)).as<::mosek::fusion::Parameter>();
    }
  }
  else
  {
    {
      int32_t _4527_count = (int)0;
      int32_t _11257_ = (int)0;
      int32_t _11258_ = (int)((nidxs)->size(0));
      for (int32_t _4528_i = _11257_; _4528_i < _11258_; ++_4528_i)
      {
        {
          int32_t _11259_ = (int)0;
          int32_t _11260_ = _4512_nd;
          for (int32_t _4529_j = _11259_; _4529_j < _11260_; ++_4529_j)
          {
            {
              _ptr__4516_index[_4529_j] = (int32_t)((((*sp)(_4528_i)) / _ptr__4514_stride[_4529_j]) % ((*shape)(_4529_j)));
            }
          }
          bool _4530_inslice = true;
          int32_t _11261_ = (int)0;
          int32_t _11262_ = _4512_nd;
          for (int32_t _4531_j = _11261_; _4531_j < _11262_; ++_4531_j)
          {
            {
              _4530_inslice = (_4530_inslice && ((_ptr__4510_astart[_4531_j] <= _ptr__4516_index[_4531_j]) && (_ptr__4516_index[_4531_j] < _ptr__4511_astop[_4531_j])));
            }
          }
          if (_4530_inslice)
          {
            {
              ++ _4527_count;
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4532_rnidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4527_count)));
      _checked_ptr_1<int32_t> _ptr__4532_rnidxs(_4532_rnidxs ? _4532_rnidxs->raw() : nullptr,_4532_rnidxs ? _4532_rnidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4533_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4527_count)));
      _checked_ptr_1<int64_t> _ptr__4533_rsp(_4533_rsp ? _4533_rsp->raw() : nullptr,_4533_rsp ? _4533_rsp->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4534_rstride = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4512_nd)));
      _checked_ptr_1<int64_t> _ptr__4534_rstride(_4534_rstride ? _4534_rstride->raw() : nullptr,_4534_rstride ? _4534_rstride->size(0) : 0);
      _ptr__4534_rstride[(_4512_nd - (int)1)] = (int)1;
      int32_t _11263_ = (int)1;
      int32_t _11264_ = _4512_nd;
      for (int32_t _4535_i = _11263_; _4535_i < _11264_; ++_4535_i)
      {
        {
          _ptr__4534_rstride[((_4512_nd - _4535_i) - (int)1)] = safe_mul( _ptr__4534_rstride[(_4512_nd - _4535_i)],_ptr__4517_rshape[_4535_i] );
        }
      }
      int32_t _4536_k = (int)0;
      int32_t _11265_ = (int)0;
      int32_t _11266_ = (int)((nidxs)->size(0));
      for (int32_t _4537_i = _11265_; _4537_i < _11266_; ++_4537_i)
      {
        {
          int32_t _11267_ = (int)0;
          int32_t _11268_ = _4512_nd;
          for (int32_t _4538_j = _11267_; _4538_j < _11268_; ++_4538_j)
          {
            {
              _ptr__4516_index[_4537_i] = (int32_t)((((*sp)(_4537_i)) / _ptr__4514_stride[_4538_j]) % ((*shape)(_4538_j)));
            }
          }
          bool _4539_inslice = true;
          int32_t _11269_ = (int)0;
          int32_t _11270_ = _4512_nd;
          for (int32_t _4540_j = _11269_; _4540_j < _11270_; ++_4540_j)
          {
            {
              _4539_inslice = (_4539_inslice && ((_ptr__4510_astart[_4540_j] <= _ptr__4516_index[_4540_j]) && (_ptr__4516_index[_4540_j] < _ptr__4511_astop[_4540_j])));
            }
          }
          if (_4539_inslice)
          {
            {
              int64_t _4541_ri = (int64_t)0;
              int32_t _11271_ = (int)0;
              int32_t _11272_ = _4512_nd;
              for (int32_t _4542_j = _11271_; _4542_j < _11272_; ++_4542_j)
              {
                {
                  _4541_ri += safe_mul( (_ptr__4516_index[_4542_j] - _ptr__4510_astart[_4542_j]),_ptr__4534_rstride[_4542_j] );
                }
              }
              _ptr__4533_rsp[_4536_k] = _4541_ri;
              _ptr__4532_rnidxs[_4536_k] = ((*nidxs)(_4537_i));
              ++ _4536_k;
            }
          }
          {}
        }
      }
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,_4517_rshape,_4533_rsp,_4532_rnidxs)).as<::mosek::fusion::Parameter>();
    }
  }
}
// End mosek.fusion.ParameterImpl.slice

// Begin mosek.fusion.ParameterImpl.slice
// Method mosek.fusion.ParameterImpl.slice @ bld/docker-win/final/default/src/fusion/Parameter.monty:210:6-235:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__slice(int32_t _4543_start,int32_t _4544_stop) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__slice(_4543_start,_4544_stop); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::slice(int32_t _4543_start,int32_t _4544_stop) { return __mosek_2fusion_2ParameterImpl__slice(_4543_start,_4544_stop); }
/* override: mosek.fusion.Parameter.slice*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__slice(int32_t _4543_start,int32_t _4544_stop) { return __mosek_2fusion_2ParameterImpl__slice(_4543_start,_4544_stop); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__slice(int32_t _4543_start,int32_t _4544_stop)
{
  if (((int)((shape)->size(0)) != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid index dimension"));
    }
  }
  {}
  if (((_4543_start < (int)0) || ((_4543_start >= _4544_stop) || (_4544_stop > size))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid index"));
    }
  }
  {}
  if ((NULL == sp.get()))
  {
    {
      std::vector<int32_t> _11273_;
      for (int32_t _4545_i = _4543_start, _11274_ = _4544_stop; _4545_i < _11274_ ; ++_4545_i)
      {
        _11273_.push_back(((*nidxs)(_4545_i)));
      }
      auto _11275_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11273_.size()),_11273_.begin(),_11273_.end()));
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((_4544_stop - _4543_start))}),nullptr,_11275_)).as<::mosek::fusion::Parameter>();
    }
  }
  else
  {
    {
      int32_t _4546_count = (int)0;
      int32_t _11276_ = (int)0;
      int32_t _11277_ = (int)((sp)->size(0));
      for (int32_t _4547_i = _11276_; _4547_i < _11277_; ++_4547_i)
      {
        {
          if (((_4543_start <= ((*sp)(_4547_i))) && (((*sp)(_4547_i)) < _4544_stop)))
          {
            {
              ++ _4546_count;
            }
          }
          {}
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4548_rnidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_4546_count)));
      _checked_ptr_1<int32_t> _ptr__4548_rnidxs(_4548_rnidxs ? _4548_rnidxs->raw() : nullptr,_4548_rnidxs ? _4548_rnidxs->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4549_rsp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4546_count)));
      _checked_ptr_1<int64_t> _ptr__4549_rsp(_4549_rsp ? _4549_rsp->raw() : nullptr,_4549_rsp ? _4549_rsp->size(0) : 0);
      int32_t _4550_k = (int)0;
      int32_t _11278_ = (int)0;
      int32_t _11279_ = (int)((sp)->size(0));
      for (int32_t _4551_i = _11278_; _4551_i < _11279_; ++_4551_i)
      {
        {
          if (((_4543_start <= ((*sp)(_4551_i))) && (((*sp)(_4551_i)) < _4544_stop)))
          {
            {
              _ptr__4548_rnidxs[_4550_k] = ((*nidxs)(_4551_i));
              _ptr__4549_rsp[_4550_k] = (((*sp)(_4550_k)) - _4543_start);
              ++ _4550_k;
            }
          }
          {}
        }
      }
      return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((_4544_stop - _4543_start))}),_4549_rsp,_4548_rnidxs)).as<::mosek::fusion::Parameter>();
    }
  }
}
// End mosek.fusion.ParameterImpl.slice

// Begin mosek.fusion.ParameterImpl.reshape
// Method mosek.fusion.ParameterImpl.reshape @ bld/docker-win/final/default/src/fusion/Parameter.monty:204:6-208:7
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _4552_dims) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__reshape(_4552_dims); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _4552_dims) { return __mosek_2fusion_2ParameterImpl__reshape(_4552_dims); }
/* override: mosek.fusion.Parameter.reshape*/
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _4552_dims) { return __mosek_2fusion_2ParameterImpl__reshape(_4552_dims); }
monty::rc_ptr< ::mosek::fusion::Parameter > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _4552_dims)
{
  _checked_ptr_1<int32_t> _ptr__4552_dims(_4552_dims ? _4552_dims->raw() : nullptr, _4552_dims ? _4552_dims->size(0) : 0);
  if ((::mosek::fusion::p_Set::size(_4552_dims) != ::mosek::fusion::p_Set::size(shape)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Incompatible shape for resize"));
    }
  }
  {}
  return (::mosek::fusion::p_ParameterImpl::_new_ParameterImpl(model,_4552_dims,sp,nidxs)).as<::mosek::fusion::Parameter>();
}
// End mosek.fusion.ParameterImpl.reshape

// Begin mosek.fusion.ParameterImpl.asExpr
// Method mosek.fusion.ParameterImpl.asExpr @ bld/docker-win/final/default/src/fusion/Parameter.monty:202:6-75
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__asExpr() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__asExpr(); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::asExpr() { return __mosek_2fusion_2ParameterImpl__asExpr(); }
/* override: mosek.fusion.Parameter.asExpr*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__asExpr() { return __mosek_2fusion_2ParameterImpl__asExpr(); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__asExpr()
{
  return (::mosek::fusion::p_ExprParameter::_new_ExprParameter((::mosek::fusion::ParameterImpl::t(_pubthis)).as<::mosek::fusion::Parameter>())).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.ParameterImpl.asExpr

// Begin mosek.fusion.ParameterImpl.getSize
// Method mosek.fusion.ParameterImpl.getSize @ bld/docker-win/final/default/src/fusion/Parameter.monty:200:6-69
int64_t mosek::fusion::ParameterImpl :: getSize() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getSize(); }
int64_t mosek::fusion::p_ParameterImpl::getSize()
{
  return ::mosek::fusion::p_Set::size(shape);
}
// End mosek.fusion.ParameterImpl.getSize

// Begin mosek.fusion.ParameterImpl.getNumNonzero
// Method mosek.fusion.ParameterImpl.getNumNonzero @ bld/docker-win/final/default/src/fusion/Parameter.monty:199:6-64
int32_t mosek::fusion::ParameterImpl :: getNumNonzero() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getNumNonzero(); }
int32_t mosek::fusion::p_ParameterImpl::getNumNonzero()
{
  return (int)((nidxs)->size(0));
}
// End mosek.fusion.ParameterImpl.getNumNonzero

// Begin mosek.fusion.ParameterImpl.getND
// Method mosek.fusion.ParameterImpl.getND @ bld/docker-win/final/default/src/fusion/Parameter.monty:198:6-64
int32_t mosek::fusion::ParameterImpl :: getND() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getND(); }
int32_t mosek::fusion::p_ParameterImpl::getND()
{
  return (int)((shape)->size(0));
}
// End mosek.fusion.ParameterImpl.getND

// Begin mosek.fusion.ParameterImpl.getShape
// Method mosek.fusion.ParameterImpl.getShape @ bld/docker-win/final/default/src/fusion/Parameter.monty:197:6-82
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::ParameterImpl :: getShape() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getShape(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ParameterImpl::getShape()
{
  return ::mosek::fusion::Utils::Tools::arraycopy(shape);
}
// End mosek.fusion.ParameterImpl.getShape

// Begin mosek.fusion.ParameterImpl.getDim
// Method mosek.fusion.ParameterImpl.getDim @ bld/docker-win/final/default/src/fusion/Parameter.monty:196:6-69
int32_t mosek::fusion::ParameterImpl :: getDim(int32_t _4553_i) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getDim(_4553_i); }
int32_t mosek::fusion::p_ParameterImpl::getDim(int32_t _4553_i)
{
  return ((*shape)(_4553_i));
}
// End mosek.fusion.ParameterImpl.getDim

// Begin mosek.fusion.ParameterImpl.getAllIndexes
// Method mosek.fusion.ParameterImpl.getAllIndexes @ bld/docker-win/final/default/src/fusion/Parameter.monty:191:6-194:7
void mosek::fusion::ParameterImpl :: getAllIndexes(std::shared_ptr< monty::ndarray< int32_t,1 > > _4554_dst,int32_t _4555_ofs) { mosek::fusion::p_ParameterImpl::_get_impl(this)->getAllIndexes(_4554_dst,_4555_ofs); }
void mosek::fusion::p_ParameterImpl::getAllIndexes(std::shared_ptr< monty::ndarray< int32_t,1 > > _4554_dst,int32_t _4555_ofs)
{
  _checked_ptr_1<int32_t> _ptr__4554_dst(_4554_dst ? _4554_dst->raw() : nullptr, _4554_dst ? _4554_dst->size(0) : 0);
  int32_t _11280_ = (int)0;
  int32_t _11281_ = (int)((nidxs)->size(0));
  for (int32_t _4556_i = _11280_; _4556_i < _11281_; ++_4556_i)
  {
    {
      _ptr__4554_dst[safe_add( _4555_ofs,_4556_i )] = ((*nidxs)(_4556_i));
    }
  }
}
// End mosek.fusion.ParameterImpl.getAllIndexes

// Begin mosek.fusion.ParameterImpl.getIndex
// Method mosek.fusion.ParameterImpl.getIndex @ bld/docker-win/final/default/src/fusion/Parameter.monty:188:6-190:7
int32_t mosek::fusion::ParameterImpl :: getIndex(int32_t _4557_i) { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getIndex(_4557_i); }
int32_t mosek::fusion::p_ParameterImpl::getIndex(int32_t _4557_i)
{
  return ((*nidxs)(_4557_i));
}
// End mosek.fusion.ParameterImpl.getIndex

// Begin mosek.fusion.ParameterImpl.getValue
// Method mosek.fusion.ParameterImpl.getValue @ bld/docker-win/final/default/src/fusion/Parameter.monty:183:6-185:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::ParameterImpl :: getValue() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->getValue(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_ParameterImpl::getValue()
{
  return mosek::fusion::p_Model::_get_impl(model.get())->getParameterValue(nidxs);
}
// End mosek.fusion.ParameterImpl.getValue

// Begin mosek.fusion.ParameterImpl.setValue
// Method mosek.fusion.ParameterImpl.setValue @ bld/docker-win/final/default/src/fusion/Parameter.monty:161:6-179:7
void mosek::fusion::ParameterImpl :: setValue(std::shared_ptr< monty::ndarray< double,2 > > _4558_values2) { mosek::fusion::p_ParameterImpl::_get_impl(this)->setValue(_4558_values2); }
void mosek::fusion::p_ParameterImpl::setValue(std::shared_ptr< monty::ndarray< double,2 > > _4558_values2)
{
  if (((_pubthis->getND() != (int)2) || (((int)((_4558_values2)->size(0)) != ((*shape)((int)0))) || ((int)((_4558_values2)->size(1)) != ((*shape)((int)1))))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching value shape"));
    }
  }
  {}
  if ((NULL == sp.get()))
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _4559_vals = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( ((*shape)((int)0)),((*shape)((int)1)) ))));
      _checked_ptr_1<double> _ptr__4559_vals(_4559_vals ? _4559_vals->raw() : nullptr,_4559_vals ? _4559_vals->size(0) : 0);
      int32_t _11282_ = (int)0;
      int32_t _11283_ = ((*shape)((int)0));
      for (int32_t _4560_i = _11282_; _4560_i < _11283_; ++_4560_i)
      {
        {
          int32_t _11284_ = (int)0;
          int32_t _11285_ = ((*shape)((int)1));
          for (int32_t _4561_j = _11284_; _4561_j < _11285_; ++_4561_j)
          {
            {
              _ptr__4559_vals[safe_add( safe_mul( _4560_i,((*shape)((int)1)) ),_4561_j )] = ((*_4558_values2)(_4560_i,_4561_j));
            }
          }
        }
      }
      mosek::fusion::p_Model::_get_impl(model.get())->setParameterValue(nidxs,_4559_vals);
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _4562_vals = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((sp)->size(0)))));
      _checked_ptr_1<double> _ptr__4562_vals(_4562_vals ? _4562_vals->raw() : nullptr,_4562_vals ? _4562_vals->size(0) : 0);
      int32_t _11286_ = (int)0;
      int32_t _11287_ = (int)((sp)->size(0));
      for (int32_t _4563_i = _11286_; _4563_i < _11287_; ++_4563_i)
      {
        {
          _ptr__4562_vals[_4563_i] = ((*_4558_values2)((((*sp)(_4563_i)) / ((*shape)((int)1))),(((*sp)(_4563_i)) % ((*shape)((int)1)))));
        }
      }
      mosek::fusion::p_Model::_get_impl(model.get())->setParameterValue(nidxs,_4562_vals);
    }
  }
}
// End mosek.fusion.ParameterImpl.setValue

// Begin mosek.fusion.ParameterImpl.setValue
// Method mosek.fusion.ParameterImpl.setValue @ bld/docker-win/final/default/src/fusion/Parameter.monty:142:6-159:7
void mosek::fusion::ParameterImpl :: setValue(std::shared_ptr< monty::ndarray< double,1 > > _4564_values) { mosek::fusion::p_ParameterImpl::_get_impl(this)->setValue(_4564_values); }
void mosek::fusion::p_ParameterImpl::setValue(std::shared_ptr< monty::ndarray< double,1 > > _4564_values)
{
  _checked_ptr_1<double> _ptr__4564_values(_4564_values ? _4564_values->raw() : nullptr, _4564_values ? _4564_values->size(0) : 0);
  if ((NULL == sp.get()))
  {
    {
      if (((int)((_4564_values)->size(0)) != (int)((nidxs)->size(0))))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Length of value array is incorrect"));
        }
      }
      else
      {
        {
          mosek::fusion::p_Model::_get_impl(model.get())->setParameterValue(nidxs,_4564_values);
        }
      }
    }
  }
  else
  {
    {
      if (((int)((_4564_values)->size(0)) != _pubthis->getSize()))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Length of value array is incorrect"));
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< double,1 > > _4565_cvals = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)((nidxs)->size(0)))));
          _checked_ptr_1<double> _ptr__4565_cvals(_4565_cvals ? _4565_cvals->raw() : nullptr,_4565_cvals ? _4565_cvals->size(0) : 0);
          int32_t _11288_ = (int)0;
          int32_t _11289_ = (int)((nidxs)->size(0));
          for (int32_t _4566_i = _11288_; _4566_i < _11289_; ++_4566_i)
          {
            {
              _ptr__4565_cvals[_4566_i] = _ptr__4564_values[((*sp)(_4566_i))];
            }
          }
          mosek::fusion::p_Model::_get_impl(model.get())->setParameterValue(nidxs,_4565_cvals);
        }
      }
    }
  }
}
// End mosek.fusion.ParameterImpl.setValue

// Begin mosek.fusion.ParameterImpl.setValue
// Method mosek.fusion.ParameterImpl.setValue @ bld/docker-win/final/default/src/fusion/Parameter.monty:135:6-140:7
void mosek::fusion::ParameterImpl :: setValue(double _4567_value) { mosek::fusion::p_ParameterImpl::_get_impl(this)->setValue(_4567_value); }
void mosek::fusion::p_ParameterImpl::setValue(double _4567_value)
{
  std::shared_ptr< monty::ndarray< double,1 > > _4568_vals = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(size)));
  _checked_ptr_1<double> _ptr__4568_vals(_4568_vals ? _4568_vals->raw() : nullptr,_4568_vals ? _4568_vals->size(0) : 0);
  int32_t _11290_ = (int)0;
  int64_t _11291_ = size;
  for (int64_t _4569_i = _11290_; _4569_i < _11291_; ++_4569_i)
  {
    {
      _ptr__4568_vals[_4569_i] = _4567_value;
    }
  }
  mosek::fusion::p_Model::_get_impl(model.get())->setParameterValue(nidxs,_4568_vals);
}
// End mosek.fusion.ParameterImpl.setValue

// Begin mosek.fusion.ParameterImpl.getModel
// Method mosek.fusion.ParameterImpl.getModel @ bld/docker-win/final/default/src/fusion/Parameter.monty:134:6-54
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::ParameterImpl :: __mosek_2fusion_2ParameterImpl__getModel() { return mosek::fusion::p_ParameterImpl::_get_impl(this)->__mosek_2fusion_2ParameterImpl__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::ParameterImpl::getModel() { return __mosek_2fusion_2ParameterImpl__getModel(); }
/* override: mosek.fusion.Parameter.getModel*/
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::ParameterImpl::__mosek_2fusion_2Parameter__getModel() { return __mosek_2fusion_2ParameterImpl__getModel(); }
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_ParameterImpl::__mosek_2fusion_2ParameterImpl__getModel()
{
  return model;
}
// End mosek.fusion.ParameterImpl.getModel

void mosek::fusion::p_ParameterImpl::destroy()
{
  nidxs.reset();
  sp.reset();
  shape.reset();
  model.reset();
}
void mosek::fusion::ParameterImpl::destroy() { mosek::fusion::p_ParameterImpl::_get_impl(this)->destroy(); }
// } class ParameterImpl
// class Parameter { // @ bld/docker-win/final/default/src/fusion/Parameter.monty:71:4-105:5
// Begin mosek.fusion.Parameter.clone
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::clone(monty::rc_ptr< ::mosek::fusion::Model > _4570_m) { return __mosek_2fusion_2Parameter__clone(_4570_m); }
// End mosek.fusion.Parameter.clone

// Begin mosek.fusion.Parameter.getModel
monty::rc_ptr< mosek::fusion::Model > mosek::fusion::Parameter::getModel() { return __mosek_2fusion_2Parameter__getModel(); }
// End mosek.fusion.Parameter.getModel

// Begin mosek.fusion.Parameter.getSize
// End mosek.fusion.Parameter.getSize

// Begin mosek.fusion.Parameter.getAllIndexes
// End mosek.fusion.Parameter.getAllIndexes

// Begin mosek.fusion.Parameter.getIndex
// End mosek.fusion.Parameter.getIndex

// Begin mosek.fusion.Parameter.getSp
// End mosek.fusion.Parameter.getSp

// Begin mosek.fusion.Parameter.getShape
// End mosek.fusion.Parameter.getShape

// Begin mosek.fusion.Parameter.getND
// End mosek.fusion.Parameter.getND

// Begin mosek.fusion.Parameter.getDim
// End mosek.fusion.Parameter.getDim

// Begin mosek.fusion.Parameter.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Parameter::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4577_midxs) { return __mosek_2fusion_2Parameter__pick(_4577_midxs); }
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _4577_midxs) { return __mosek_2fusion_2Parameter__pick(_4577_midxs); }
// End mosek.fusion.Parameter.pick

// Begin mosek.fusion.Parameter.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Parameter::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4578_idxs) { return __mosek_2fusion_2Parameter__pick(_4578_idxs); }
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _4578_idxs) { return __mosek_2fusion_2Parameter__pick(_4578_idxs); }
// End mosek.fusion.Parameter.pick

// Begin mosek.fusion.Parameter.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Parameter::__mosek_2fusion_2Expression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4579_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4580_astop) { return __mosek_2fusion_2Parameter__slice(_4579_astart,_4580_astop); }
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _4579_astart,std::shared_ptr< monty::ndarray< int32_t,1 > > _4580_astop) { return __mosek_2fusion_2Parameter__slice(_4579_astart,_4580_astop); }
// End mosek.fusion.Parameter.slice

// Begin mosek.fusion.Parameter.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Parameter::__mosek_2fusion_2Expression__slice(int32_t _4581_start,int32_t _4582_stop) { return __mosek_2fusion_2Parameter__slice(_4581_start,_4582_stop); }
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::slice(int32_t _4581_start,int32_t _4582_stop) { return __mosek_2fusion_2Parameter__slice(_4581_start,_4582_stop); }
// End mosek.fusion.Parameter.slice

// Begin mosek.fusion.Parameter.isSparse
// End mosek.fusion.Parameter.isSparse

// Begin mosek.fusion.Parameter.reshape
monty::rc_ptr< mosek::fusion::Parameter > mosek::fusion::Parameter::reshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _4583_dims) { return __mosek_2fusion_2Parameter__reshape(_4583_dims); }
// End mosek.fusion.Parameter.reshape

// Begin mosek.fusion.Parameter.getNumNonzero
// End mosek.fusion.Parameter.getNumNonzero

// Begin mosek.fusion.Parameter.asExpr
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Parameter::asExpr() { return __mosek_2fusion_2Parameter__asExpr(); }
// End mosek.fusion.Parameter.asExpr

// Begin mosek.fusion.Parameter.getValue
// End mosek.fusion.Parameter.getValue

// Begin mosek.fusion.Parameter.setValue
// End mosek.fusion.Parameter.setValue

// Begin mosek.fusion.Parameter.setValue
// End mosek.fusion.Parameter.setValue

// Begin mosek.fusion.Parameter.setValue
// End mosek.fusion.Parameter.setValue

// } class Parameter
// class ExprOptimizeCode { // @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:515:4-1220:5
mosek::fusion::ExprOptimizeCode::ExprOptimizeCode(mosek::fusion::p_ExprOptimizeCode *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprOptimizeCode()" << this << std::endl; */ }
mosek::fusion::ExprOptimizeCode::~ExprOptimizeCode() {  /* std::cout << "~ExprOptimizeCode()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprOptimizeCode::p_ExprOptimizeCode
  (::mosek::fusion::ExprOptimizeCode * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprOptimizeCode.ctor @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:517:6-520:7
mosek::fusion::ExprOptimizeCode::t mosek::fusion::p_ExprOptimizeCode::_new_ExprOptimizeCode
  (monty::rc_ptr< ::mosek::fusion::Expression > _4587_expr)
{ return new mosek::fusion::ExprOptimizeCode(_4587_expr); }
mosek::fusion::ExprOptimizeCode::ExprOptimizeCode
  (monty::rc_ptr< ::mosek::fusion::Expression > _4587_expr) : 
   ExprOptimizeCode(new mosek::fusion::p_ExprOptimizeCode(this))
{ mosek::fusion::p_ExprOptimizeCode::_get_impl(this)->_initialize(_4587_expr); }
void mosek::fusion::p_ExprOptimizeCode::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _4587_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_4587_expr->getShape());
    mosek::fusion::p_ExprOptimizeCode::_get_impl(::mosek::fusion::ExprOptimizeCode::t(_pubthis))->expr = _4587_expr;
  }
}
// mosek.fusion.ExprOptimizeCode.ctor

// Begin mosek.fusion.ExprOptimizeCode.compress_code
// Method mosek.fusion.ExprOptimizeCode.compress_code @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:777:6-1219:7
void mosek::fusion::p_ExprOptimizeCode::compress_code(monty::rc_ptr< ::mosek::fusion::WorkStack > _4588_xs,int32_t _4589_n,std::shared_ptr< monty::ndarray< int32_t,1 > > _4590_code,int32_t _4591_code_base,std::shared_ptr< monty::ndarray< int32_t,1 > > _4592_ptr,int32_t _4593_ptr_base,std::shared_ptr< monty::ndarray< double,1 > > _4594_fixterm,int32_t _4595_fixterm_base,std::shared_ptr< monty::ndarray< double,1 > > _4596_code_consts,int32_t _4597_code_consts_base,int32_t _4598_target_code_base,int32_t _4599_target_const_base,int32_t _4600_target_ptr_base)
{
  _checked_ptr_1<int32_t> _ptr__4590_code(_4590_code ? _4590_code->raw() : nullptr, _4590_code ? _4590_code->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__4592_ptr(_4592_ptr ? _4592_ptr->raw() : nullptr, _4592_ptr ? _4592_ptr->size(0) : 0);
  _checked_ptr_1<double> _ptr__4594_fixterm(_4594_fixterm ? _4594_fixterm->raw() : nullptr, _4594_fixterm ? _4594_fixterm->size(0) : 0);
  _checked_ptr_1<double> _ptr__4596_code_consts(_4596_code_consts ? _4596_code_consts->raw() : nullptr, _4596_code_consts ? _4596_code_consts->size(0) : 0);
  int32_t _4601_ncodeatoms = _ptr__4592_ptr[safe_add( _4593_ptr_base,_4589_n )];
  int32_t _4602_stack = _4588_xs->alloci32(safe_add( _4601_ncodeatoms,(int)2 ));
  int32_t _4603_stackp = (int)0;
  int32_t _4604_chld = _4588_xs->alloci32(safe_add( _4601_ncodeatoms,(int)2 ));
  int32_t _4605_chld_ptr = _4588_xs->alloci32(safe_add( _4601_ncodeatoms,(int)3 ));
  int32_t _4606_tcconst = _4588_xs->allocf64(safe_add( _4601_ncodeatoms,(int)2 ));
  int32_t _4607_tcode = _4588_xs->alloci32(safe_add( _4601_ncodeatoms,(int)2 ));
  int32_t _4608_tcodep = (int)0;
  int32_t _4609_error_at = (-(int)1);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4610_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4610_xi32(_4610_xi32 ? _4610_xi32->raw() : nullptr,_4610_xi32 ? _4610_xi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4611_xf64 = mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->f64;
  _checked_ptr_1<double> _ptr__4611_xf64(_4611_xf64 ? _4611_xf64->raw() : nullptr,_4611_xf64 ? _4611_xf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4612_target_code = _4610_xi32;
  _checked_ptr_1<int32_t> _ptr__4612_target_code(_4612_target_code ? _4612_target_code->raw() : nullptr,_4612_target_code ? _4612_target_code->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4613_target_const = _4611_xf64;
  _checked_ptr_1<double> _ptr__4613_target_const(_4613_target_const ? _4613_target_const->raw() : nullptr,_4613_target_const ? _4613_target_const->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4614_target_ptr = _4610_xi32;
  _checked_ptr_1<int32_t> _ptr__4614_target_ptr(_4614_target_ptr ? _4614_target_ptr->raw() : nullptr,_4614_target_ptr ? _4614_target_ptr->size(0) : 0);
  int32_t _4615_xpi32 = mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pi32;
  int32_t _4616_xpi64 = mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pi64;
  int32_t _4617_xpf64 = mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pf64;
  _ptr__4614_target_ptr[_4600_target_ptr_base] = (int)0;
  int32_t _4618_codei = (int)0;
  int32_t _11292_ = (int)0;
  int32_t _11293_ = _4589_n;
  for (int32_t _4619_i = _11292_; _4619_i < _11293_; ++_4619_i)
  {
    {
      int32_t _4620_e = _ptr__4592_ptr[safe_add( safe_add( _4593_ptr_base,_4619_i ),(int)1 )];
      int32_t _4621_b = _ptr__4592_ptr[safe_add( _4593_ptr_base,_4619_i )];
      if ((_4609_error_at < (int)0))
      {
        {
          _4603_stackp = (int)0;
          _4608_tcodep = (int)0;
          _ptr__4610_xi32[_4605_chld_ptr] = (int)0;
          int32_t _11294_ = (int)0;
          int32_t _11295_ = (_4620_e - _4621_b);
          for (int32_t _4622_j = _11294_; _4622_j < _11295_; ++_4622_j)
          {
            {
              _ptr__4612_target_code[safe_add( _4607_tcode,_4622_j )] = (-(int)9999);
            }
          }
          int32_t _11296_ = _4621_b;
          int32_t _11297_ = _4620_e;
          for (int32_t _4623_j = _11296_; _4623_j < _11297_; ++_4623_j)
          {
            {
              int32_t _4624_opcode = _ptr__4590_code[safe_add( _4591_code_base,_4623_j )];
              double _4625_oparg = _ptr__4596_code_consts[safe_add( _4597_code_consts_base,_4623_j )];
              if ((_4624_opcode == 0))
              {
                {
                }
              }
              else if((_4624_opcode == 2))
              {
                {
                  _ptr__4612_target_code[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                  _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4625_oparg;
                  _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                  _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                  ++ _4603_stackp;
                  ++ _4608_tcodep;
                }
              }
              else if((_4624_opcode == 1))
              {
                {
                  _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = _4624_opcode;
                  _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4625_oparg;
                  _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                  _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                  ++ _4603_stackp;
                  ++ _4608_tcodep;
                }
              }
              else if((_4624_opcode == 3))
              {
                {
                  if ((_4603_stackp >= (int)2))
                  {
                    {
                      int32_t _4626_i1 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      int32_t _4627_i0 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      if (((_ptr__4610_xi32[safe_add( _4607_tcode,_4627_i0 )] == 2) && (_ptr__4610_xi32[safe_add( _4607_tcode,_4626_i1 )] == 2)))
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = (_ptr__4611_xf64[safe_add( _4606_tcconst,_4627_i0 )] + _ptr__4611_xf64[safe_add( _4606_tcconst,_4626_i1 )]);
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4627_i0 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4627_i0 )] <= 0.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4627_i0 )] >= 0.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = 0.0;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4626_i1;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4626_i1 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4626_i1 )] <= 0.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4626_i1 )] >= 0.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4627_i0;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)2 );
                          _ptr__4610_xi32[safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] )] = _4627_i0;
                          _ptr__4610_xi32[safe_add( safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] ),(int)1 )] = _4626_i1;
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = _4624_opcode;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4625_oparg;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                    }
                  }
                  else
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                }
              }
              else if((_4624_opcode == 5))
              {
                {
                  if ((_4603_stackp >= (int)2))
                  {
                    {
                      int32_t _4628_i1 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      int32_t _4629_i0 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      if (((_ptr__4610_xi32[safe_add( _4607_tcode,_4629_i0 )] == 2) && (_ptr__4610_xi32[safe_add( _4607_tcode,_4628_i1 )] == 2)))
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = (_ptr__4611_xf64[safe_add( _4606_tcconst,_4629_i0 )] * _ptr__4611_xf64[safe_add( _4606_tcconst,_4628_i1 )]);
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4629_i0 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4629_i0 )] <= 0.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4629_i0 )] >= 0.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = 0.0;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4628_i1 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4628_i1 )] <= 0.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4628_i1 )] >= 0.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = 0.0;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4628_i1 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4628_i1 )] <= 1.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4628_i1 )] >= 1.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)1 );
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4629_i0;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else if(((_ptr__4610_xi32[safe_add( _4607_tcode,_4629_i0 )] == 2) && ((_ptr__4611_xf64[safe_add( _4606_tcconst,_4629_i0 )] <= 1.0) && (_ptr__4611_xf64[safe_add( _4606_tcconst,_4629_i0 )] >= 1.0))))
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)1 );
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4628_i1;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else
                      {
                        {
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)2 );
                          _ptr__4610_xi32[safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] )] = _4629_i0;
                          _ptr__4610_xi32[safe_add( safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] ),(int)1 )] = _4628_i1;
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 5;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4625_oparg;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                    }
                  }
                  else
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                }
              }
              else if((_4624_opcode == 4))
              {
                {
                  if ((_4603_stackp >= (int)1))
                  {
                    {
                      int32_t _4630_i0 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      if ((_ptr__4610_xi32[safe_add( _4607_tcode,_4630_i0 )] == 2))
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = (-_ptr__4611_xf64[safe_add( _4606_tcconst,_4630_i0 )]);
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = _ptr__4590_code[safe_add( _4591_code_base,_4623_j )];
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)1 );
                          _ptr__4610_xi32[safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] )] = _4630_i0;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                    }
                  }
                  else
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                }
              }
              else if((_4624_opcode == 6))
              {
                {
                  if ((_4603_stackp >= (int)1))
                  {
                    {
                      int32_t _4631_i0 = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                      -- _4603_stackp;
                      if ((_ptr__4610_xi32[safe_add( _4607_tcode,_4631_i0 )] == 2))
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                          _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = (1.0 / _ptr__4611_xf64[safe_add( _4606_tcconst,_4631_i0 )]);
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                      else
                      {
                        {
                          _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = _ptr__4590_code[safe_add( _4591_code_base,_4623_j )];
                          _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],(int)1 );
                          _ptr__4610_xi32[safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] )] = _4631_i0;
                          _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                          ++ _4603_stackp;
                          ++ _4608_tcodep;
                        }
                      }
                    }
                  }
                  else
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                }
              }
              else if((_4624_opcode == 8))
              {
                {
                  int32_t _4632_num = (int32_t)_4625_oparg;
                  if ((_4632_num < (int)0))
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                  else if((_4632_num > _4603_stackp))
                  {
                    {
                      _4609_error_at = _4623_j;
                    }
                  }
                  else if((_4632_num == (int)0))
                  {
                    {
                      _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                      _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = 0.0;
                      _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                      _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                      ++ _4603_stackp;
                      ++ _4608_tcodep;
                    }
                  }
                  else if((_4632_num == (int)1))
                  {
                    {
                      _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = (int)0;
                      _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                      _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                      ++ _4603_stackp;
                      ++ _4608_tcodep;
                    }
                  }
                  else
                  {
                    {
                      std::vector<int32_t> _11298_;
                      for (int32_t _4634_j = (int)0, _11299_ = _4632_num; _4634_j < _11299_ ; ++_4634_j)
                      {
                        _11298_.push_back(_ptr__4610_xi32[((safe_add( _4602_stack,_4603_stackp ) - (int)1) - _4634_j)]);
                      }
                      auto _11300_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11298_.size()),_11298_.begin(),_11298_.end()));
                      std::shared_ptr< monty::ndarray< int32_t,1 > > _4633_ii = _11300_;
                      _checked_ptr_1<int32_t> _ptr__4633_ii(_4633_ii ? _4633_ii->raw() : nullptr,_4633_ii ? _4633_ii->size(0) : 0);
                      _4603_stackp -= _4632_num;
                      {
                        int32_t _4635_i1 = (_4632_num - (int)1);
                        int32_t _4636_i0 = (int)0;
                        while ( (_4636_i0 < _4635_i1) )
                        {
                          {
                            while ( ((_4636_i0 < _4635_i1) && (_ptr__4610_xi32[safe_add( _4607_tcode,_ptr__4633_ii[_4636_i0] )] == 2)) )
                            {
                              {
                                ++ _4636_i0;
                              }
                            }
                            while ( ((_4636_i0 < _4635_i1) && (_ptr__4610_xi32[safe_add( _4607_tcode,_ptr__4633_ii[_4635_i1] )] != 2)) )
                            {
                              {
                                -- _4635_i1;
                              }
                            }
                            if ((_4636_i0 < _4635_i1))
                            {
                              {
                                int32_t _4637_t = _ptr__4633_ii[_4636_i0];
                                _ptr__4633_ii[_4636_i0] = _ptr__4633_ii[_4635_i1];
                                _ptr__4633_ii[_4635_i1] = _4637_t;
                                ++ _4636_i0;
                                -- _4635_i1;
                              }
                            }
                            {}
                          }
                        }
                        double _4638_val = 0.0;
                        int32_t _4639_numconstelm = (int)0;
                        while ( ((_4639_numconstelm < _4632_num) && (_ptr__4610_xi32[safe_add( _4607_tcode,_ptr__4633_ii[_4639_numconstelm] )] == 2)) )
                        {
                          {
                            _4638_val += _ptr__4611_xf64[safe_add( _4606_tcconst,_ptr__4633_ii[_4639_numconstelm] )];
                            ++ _4639_numconstelm;
                          }
                        }
                        int32_t _11301_;
                        bool _11302_ = (_4639_numconstelm > (int)0);
                        if (_11302_)
                        {
                          _11301_ = safe_add( (_4632_num - _4639_numconstelm),(int)1 );
                        }
                        else
                        {
                          _11301_ = _4632_num;
                        }
                        int32_t _4640_numsumelm = _11301_;
                        int32_t _4641_p = (int)0;
                        if ((_4639_numconstelm < (int)2))
                        {
                          {
                            int32_t _11303_ = (int)0;
                            int32_t _11304_ = _4632_num;
                            for (int32_t _4642_j = _11303_; _4642_j < _11304_; ++_4642_j)
                            {
                              {
                                _ptr__4610_xi32[safe_add( safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] ),_4642_j )] = _ptr__4633_ii[_4642_j];
                              }
                            }
                            _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],_4632_num );
                            _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 8;
                            _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4632_num;
                            _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                            ++ _4603_stackp;
                            ++ _4608_tcodep;
                          }
                        }
                        else
                        {
                          {
                            _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 2;
                            _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4638_val;
                            _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )];
                            ++ _4608_tcodep;
                            if ((_4639_numconstelm == _4632_num))
                            {
                              {
                                _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = (_4608_tcodep - (int)1);
                                ++ _4603_stackp;
                              }
                            }
                            else
                            {
                              {
                                _ptr__4610_xi32[safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] )] = (_4608_tcodep - (int)1);
                                int32_t _11305_ = _4639_numconstelm;
                                int32_t _11306_ = _4632_num;
                                for (int32_t _4643_j = _11305_; _4643_j < _11306_; ++_4643_j)
                                {
                                  {
                                    _ptr__4610_xi32[safe_add( (safe_add( safe_add( _4604_chld,_ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )] ),_4643_j ) - _4639_numconstelm),(int)1 )] = _ptr__4633_ii[_4643_j];
                                  }
                                }
                                _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4608_tcodep ),(int)1 )] = safe_add( _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4608_tcodep )],_4640_numsumelm );
                                _ptr__4610_xi32[safe_add( _4607_tcode,_4608_tcodep )] = 8;
                                _ptr__4611_xf64[safe_add( _4606_tcconst,_4608_tcodep )] = _4640_numsumelm;
                                _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _4608_tcodep;
                                ++ _4603_stackp;
                                ++ _4608_tcodep;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              else
              {
                {
                  _4609_error_at = _4623_j;
                }
              }
            }
          }
        }
      }
      {}
      if (((_4609_error_at < (int)0) && (_4603_stackp != (int)1)))
      {
        {
          _4609_error_at = _4608_tcodep;
        }
      }
      {}
      if ((_4609_error_at < (int)0))
      {
        {
          int32_t _4644_p0 = _4618_codei;
          int32_t _4645_p = _4644_p0;
          if ((_ptr__4610_xi32[safe_add( _4607_tcode,_ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)] )] == 2))
          {
            {
              _ptr__4594_fixterm[safe_add( _4595_fixterm_base,_4619_i )] += _ptr__4611_xf64[safe_add( _4606_tcconst,_ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)] )];
              _ptr__4612_target_code[safe_add( _4598_target_code_base,_4645_p )] = 10;
              _ptr__4613_target_const[safe_add( _4599_target_const_base,_4645_p )] = 0.0;
              ++ _4645_p;
            }
          }
          else
          {
            {
              if (((_ptr__4594_fixterm[safe_add( _4595_fixterm_base,_4619_i )] < (int)0) || ((int)0 < _ptr__4594_fixterm[safe_add( _4595_fixterm_base,_4619_i )])))
              {
                {
                  _ptr__4612_target_code[safe_add( _4598_target_code_base,_4645_p )] = 3;
                  ++ _4645_p;
                  _ptr__4612_target_code[safe_add( _4598_target_code_base,_4645_p )] = 2;
                  _ptr__4613_target_const[safe_add( _4599_target_const_base,_4645_p )] = _ptr__4594_fixterm[safe_add( _4595_fixterm_base,_4619_i )];
                  ++ _4645_p;
                  _ptr__4594_fixterm[safe_add( _4595_fixterm_base,_4619_i )] = (int)0;
                }
              }
              {}
              while ( (_4603_stackp > (int)0) )
              {
                {
                  int32_t _4646_k = _ptr__4610_xi32[(safe_add( _4602_stack,_4603_stackp ) - (int)1)];
                  -- _4603_stackp;
                  int32_t _4647_op = _ptr__4610_xi32[safe_add( _4607_tcode,_4646_k )];
                  double _4648_arg = _ptr__4611_xf64[safe_add( _4606_tcconst,_4646_k )];
                  _ptr__4612_target_code[safe_add( _4598_target_code_base,_4645_p )] = _4647_op;
                  _ptr__4613_target_const[safe_add( _4599_target_const_base,_4645_p )] = _4648_arg;
                  ++ _4645_p;
                  int32_t _11307_ = _ptr__4610_xi32[safe_add( _4605_chld_ptr,_4646_k )];
                  int32_t _11308_ = _ptr__4610_xi32[safe_add( safe_add( _4605_chld_ptr,_4646_k ),(int)1 )];
                  for (int32_t _4649_l = _11307_; _4649_l < _11308_; ++_4649_l)
                  {
                    {
                      _ptr__4610_xi32[safe_add( _4602_stack,_4603_stackp )] = _ptr__4610_xi32[safe_add( _4604_chld,_4649_l )];
                      ++ _4603_stackp;
                    }
                  }
                }
              }
              int32_t _4650_p1 = _4645_p;
              -- _4650_p1;
              while ( (_4644_p0 < _4650_p1) )
              {
                {
                  int32_t _4651_ta = _ptr__4612_target_code[safe_add( _4598_target_code_base,_4644_p0 )];
                  double _4652_v = _ptr__4613_target_const[safe_add( _4599_target_const_base,_4644_p0 )];
                  _ptr__4612_target_code[safe_add( _4598_target_code_base,_4644_p0 )] = _ptr__4612_target_code[safe_add( _4598_target_code_base,_4650_p1 )];
                  _ptr__4613_target_const[safe_add( _4599_target_const_base,_4644_p0 )] = _ptr__4613_target_const[safe_add( _4599_target_const_base,_4650_p1 )];
                  _ptr__4612_target_code[safe_add( _4598_target_code_base,_4650_p1 )] = _4651_ta;
                  _ptr__4613_target_const[safe_add( _4599_target_const_base,_4650_p1 )] = _4652_v;
                  ++ _4644_p0;
                  -- _4650_p1;
                }
              }
            }
          }
          _ptr__4614_target_ptr[safe_add( safe_add( _4600_target_ptr_base,_4619_i ),(int)1 )] = _4645_p;
          _4618_codei = _4645_p;
        }
      }
      {}
    }
  }
  mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pi32 = _4615_xpi32;
  mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pi64 = _4616_xpi64;
  mosek::fusion::p_WorkStack::_get_impl(_4588_xs)->pf64 = _4617_xpf64;
  if ((_4609_error_at >= (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal error: Invalid parameterization code list"));
    }
  }
  {}
}
// End mosek.fusion.ExprOptimizeCode.compress_code

// Begin mosek.fusion.ExprOptimizeCode.eval
// Method mosek.fusion.ExprOptimizeCode.eval @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:526:6-760:7
void mosek::fusion::ExprOptimizeCode :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4653_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4654_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4655_xs) { mosek::fusion::p_ExprOptimizeCode::_get_impl(this)->eval(_4653_rs,_4654_ws,_4655_xs); }
void mosek::fusion::p_ExprOptimizeCode::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4653_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4654_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4655_xs)
{
  expr->eval(_4654_ws,_4653_rs,_4655_xs);
  _4654_ws->peek_expr();
  _4654_ws->pop_expr();
  int32_t _4656_nd = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->nd;
  int32_t _4657_shape = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->shape_base;
  int32_t _4658_nelem = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->nelem;
  int32_t _4659_nnz = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->nnz;
  bool _4660_hassp = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->hassp;
  int32_t _4661_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->ncodeatom;
  int32_t _4662_ptr = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->ptr_base;
  int32_t _4663_sp = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->sp_base;
  int32_t _4664_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->nidxs_base;
  int32_t _4665_cof = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->cof_base;
  int32_t _4666_code = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->code_base;
  int32_t _4667_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->codeptr_base;
  int32_t _4668_cconst = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4669_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4669_wi32(_4669_wi32 ? _4669_wi32->raw() : nullptr,_4669_wi32 ? _4669_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4670_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4670_wi64(_4670_wi64 ? _4670_wi64->raw() : nullptr,_4670_wi64 ? _4670_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4671_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4654_ws)->f64;
  _checked_ptr_1<double> _ptr__4671_wf64(_4671_wf64 ? _4671_wf64->raw() : nullptr,_4671_wf64 ? _4671_wf64->size(0) : 0);
  if ((_4661_ncodeatom == (int)0))
  {
    {
      _4653_rs->alloc_expr(_4656_nd,_4658_nelem,_4659_nnz,_4660_hassp,(int)0);
      int32_t _4672_rptr = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->ptr_base;
      int32_t _4673_rsp = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->sp_base;
      int32_t _4674_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->nidxs_base;
      int32_t _4675_rcof = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->cof_base;
      int32_t _4676_rshape = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->shape_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4677_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4677_ri32(_4677_ri32 ? _4677_ri32->raw() : nullptr,_4677_ri32 ? _4677_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4678_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4678_ri64(_4678_ri64 ? _4678_ri64->raw() : nullptr,_4678_ri64 ? _4678_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4679_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->f64;
      _checked_ptr_1<double> _ptr__4679_rf64(_4679_rf64 ? _4679_rf64->raw() : nullptr,_4679_rf64 ? _4679_rf64->size(0) : 0);
      int32_t _11309_ = (int)0;
      int32_t _11310_ = safe_add( _4658_nelem,(int)1 );
      for (int32_t _4680_i = _11309_; _4680_i < _11310_; ++_4680_i)
      {
        {
          _ptr__4677_ri32[safe_add( _4672_rptr,_4680_i )] = _ptr__4669_wi32[safe_add( _4662_ptr,_4680_i )];
        }
      }
      int32_t _11311_ = (int)0;
      int32_t _11312_ = _4656_nd;
      for (int32_t _4681_i = _11311_; _4681_i < _11312_; ++_4681_i)
      {
        {
          _ptr__4677_ri32[safe_add( _4676_rshape,_4681_i )] = _ptr__4669_wi32[safe_add( _4657_shape,_4681_i )];
        }
      }
      int32_t _11313_ = (int)0;
      int32_t _11314_ = _4659_nnz;
      for (int32_t _4682_i = _11313_; _4682_i < _11314_; ++_4682_i)
      {
        {
          _ptr__4678_ri64[safe_add( _4674_rnidxs,_4682_i )] = _ptr__4670_wi64[safe_add( _4664_nidxs,_4682_i )];
        }
      }
      int32_t _11315_ = (int)0;
      int32_t _11316_ = _4659_nnz;
      for (int32_t _4683_i = _11315_; _4683_i < _11316_; ++_4683_i)
      {
        {
          _ptr__4679_rf64[safe_add( _4675_rcof,_4683_i )] = _ptr__4671_wf64[safe_add( _4665_cof,_4683_i )];
        }
      }
      if (_4660_hassp)
      {
        {
          int32_t _11317_ = (int)0;
          int32_t _11318_ = _4658_nelem;
          for (int32_t _4684_i = _11317_; _4684_i < _11318_; ++_4684_i)
          {
            {
              _ptr__4678_ri64[safe_add( _4673_rsp,_4684_i )] = _ptr__4670_wi64[safe_add( _4663_sp,_4684_i )];
            }
          }
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _4685_xcode = _4655_xs->alloci32(safe_add( _4661_ncodeatom,safe_mul( _4659_nnz,(int)2 ) ));
      int32_t _4686_xcodeptr = _4655_xs->alloci32(safe_add( _4659_nnz,(int)1 ));
      int32_t _4687_xcconst = _4655_xs->allocf64(safe_add( _4661_ncodeatom,safe_mul( _4659_nnz,(int)2 ) ));
      ::mosek::fusion::p_ExprOptimizeCode::compress_code(_4655_xs,_4659_nnz,_4669_wi32,_4666_code,_4669_wi32,_4667_codeptr,_4671_wf64,_4665_cof,_4671_wf64,_4668_cconst,_4685_xcode,_4687_xcconst,_4686_xcodeptr);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4688_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4655_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__4688_xi32(_4688_xi32 ? _4688_xi32->raw() : nullptr,_4688_xi32 ? _4688_xi32->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4689_xf64 = mosek::fusion::p_WorkStack::_get_impl(_4655_xs)->f64;
      _checked_ptr_1<double> _ptr__4689_xf64(_4689_xf64 ? _4689_xf64->raw() : nullptr,_4689_xf64 ? _4689_xf64->size(0) : 0);
      int32_t _4690_rncodeatom = (int)0;
      int32_t _4691_rnnz = (int)0;
      int32_t _4692_rnelem = (int)0;
      int32_t _11319_ = (int)0;
      int32_t _11320_ = _4658_nelem;
      for (int32_t _4693_i = _11319_; _4693_i < _11320_; ++_4693_i)
      {
        {
          int32_t _4694_elmnz = (int)0;
          int32_t _11321_ = _ptr__4669_wi32[safe_add( _4662_ptr,_4693_i )];
          int32_t _11322_ = _ptr__4669_wi32[safe_add( safe_add( _4662_ptr,_4693_i ),(int)1 )];
          for (int32_t _4695_j = _11321_; _4695_j < _11322_; ++_4695_j)
          {
            {
              if (((_ptr__4671_wf64[safe_add( _4665_cof,_4695_j )] < (int)0) || ((int)0 < _ptr__4671_wf64[safe_add( _4665_cof,_4695_j )])))
              {
                {
                  ++ _4691_rnnz;
                  ++ _4694_elmnz;
                  ++ _4690_rncodeatom;
                }
              }
              else
              {
                {
                  if (((_ptr__4688_xi32[safe_add( safe_add( _4686_xcodeptr,_4695_j ),(int)1 )] - _ptr__4688_xi32[safe_add( _4686_xcodeptr,_4695_j )]) > (int)1))
                  {
                    {
                      ++ _4691_rnnz;
                      ++ _4694_elmnz;
                      _4690_rncodeatom += (_ptr__4688_xi32[safe_add( safe_add( _4686_xcodeptr,_4695_j ),(int)1 )] - _ptr__4688_xi32[safe_add( _4686_xcodeptr,_4695_j )]);
                    }
                  }
                  else
                  {
                    {
                      if ((_ptr__4688_xi32[safe_add( _4685_xcode,_ptr__4688_xi32[safe_add( _4686_xcodeptr,_4695_j )] )] != 10))
                      {
                        {
                          ++ _4691_rnnz;
                          ++ _4694_elmnz;
                          ++ _4690_rncodeatom;
                        }
                      }
                      {}
                    }
                  }
                }
              }
            }
          }
          if ((_4694_elmnz > (int)0))
          {
            {
              ++ _4692_rnelem;
            }
          }
          {}
        }
      }
      bool _4696_rhassp = false;
      {
        int64_t _4697_sz = (int64_t)1;
        int32_t _11323_ = (int)0;
        int32_t _11324_ = _4656_nd;
        for (int32_t _4698_i = _11323_; _4698_i < _11324_; ++_4698_i)
        {
          {
            _4697_sz *= _ptr__4669_wi32[safe_add( _4657_shape,_4698_i )];
          }
        }
        _4696_rhassp = (_4697_sz > _4692_rnelem);
      }
      _4653_rs->alloc_expr(_4656_nd,_4692_rnelem,_4691_rnnz,_4696_rhassp,_4690_rncodeatom);
      int32_t _4699_rptr = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->ptr_base;
      int32_t _4700_rsp = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->sp_base;
      int32_t _4701_rshape = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->shape_base;
      int32_t _4702_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->nidxs_base;
      int32_t _4703_rcof = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->cof_base;
      int32_t _4704_rcode = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->code_base;
      int32_t _4705_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->codeptr_base;
      int32_t _4706_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4707_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4707_ri32(_4707_ri32 ? _4707_ri32->raw() : nullptr,_4707_ri32 ? _4707_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4708_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4708_ri64(_4708_ri64 ? _4708_ri64->raw() : nullptr,_4708_ri64 ? _4708_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4709_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4653_rs)->f64;
      _checked_ptr_1<double> _ptr__4709_rf64(_4709_rf64 ? _4709_rf64->raw() : nullptr,_4709_rf64 ? _4709_rf64->size(0) : 0);
      int32_t _11325_ = (int)0;
      int32_t _11326_ = _4656_nd;
      for (int32_t _4710_i = _11325_; _4710_i < _11326_; ++_4710_i)
      {
        {
          _ptr__4707_ri32[safe_add( _4701_rshape,_4710_i )] = _ptr__4669_wi32[safe_add( _4657_shape,_4710_i )];
        }
      }
      if ((_4661_ncodeatom == (int)0))
      {
        {
          int32_t _11327_ = (int)0;
          int32_t _11328_ = _4659_nnz;
          for (int32_t _4711_i = _11327_; _4711_i < _11328_; ++_4711_i)
          {
            {
              _ptr__4708_ri64[safe_add( _4702_rnidxs,_4711_i )] = _ptr__4670_wi64[safe_add( _4664_nidxs,_4711_i )];
            }
          }
          int32_t _11329_ = (int)0;
          int32_t _11330_ = _4659_nnz;
          for (int32_t _4712_i = _11329_; _4712_i < _11330_; ++_4712_i)
          {
            {
              _ptr__4709_rf64[safe_add( _4703_rcof,_4712_i )] = _ptr__4671_wf64[safe_add( _4665_cof,_4712_i )];
            }
          }
          int32_t _11331_ = (int)0;
          int32_t _11332_ = safe_add( _4658_nelem,(int)1 );
          for (int32_t _4713_i = _11331_; _4713_i < _11332_; ++_4713_i)
          {
            {
              _ptr__4707_ri32[safe_add( _4699_rptr,_4713_i )] = _ptr__4707_ri32[safe_add( _4662_ptr,_4713_i )];
            }
          }
          if (_4660_hassp)
          {
            {
              int32_t _11333_ = (int)0;
              int32_t _11334_ = _4658_nelem;
              for (int32_t _4714_i = _11333_; _4714_i < _11334_; ++_4714_i)
              {
                {
                  _ptr__4708_ri64[safe_add( _4700_rsp,_4714_i )] = _ptr__4708_ri64[safe_add( _4663_sp,_4714_i )];
                }
              }
            }
          }
          {}
        }
      }
      else
      {
        {
          int32_t _4715_codei = (int)0;
          int32_t _4716_elmi = (int)0;
          int32_t _4717_nzi = (int)0;
          _ptr__4707_ri32[_4699_rptr] = (int)0;
          if ((_4690_rncodeatom > (int)0))
          {
            {
              _ptr__4707_ri32[_4705_rcodeptr] = (int)0;
            }
          }
          {}
          int32_t _11335_ = (int)0;
          int32_t _11336_ = _4658_nelem;
          for (int32_t _4718_i = _11335_; _4718_i < _11336_; ++_4718_i)
          {
            {
              int32_t _4719_elmnz = (int)0;
              int32_t _11337_ = _ptr__4669_wi32[safe_add( _4662_ptr,_4718_i )];
              int32_t _11338_ = _ptr__4669_wi32[safe_add( safe_add( _4662_ptr,_4718_i ),(int)1 )];
              for (int32_t _4720_j = _11337_; _4720_j < _11338_; ++_4720_j)
              {
                {
                  if (((_ptr__4671_wf64[safe_add( _4665_cof,_4720_j )] < (int)0) || ((int)0 < _ptr__4671_wf64[safe_add( _4665_cof,_4720_j )])))
                  {
                    {
                      _ptr__4708_ri64[safe_add( _4702_rnidxs,_4717_nzi )] = _ptr__4670_wi64[safe_add( _4664_nidxs,_4720_j )];
                      _ptr__4709_rf64[safe_add( _4703_rcof,_4717_nzi )] = _ptr__4671_wf64[safe_add( _4665_cof,_4720_j )];
                      _ptr__4707_ri32[safe_add( _4704_rcode,_4715_codei )] = _ptr__4688_xi32[safe_add( _4685_xcode,_ptr__4688_xi32[safe_add( _4686_xcodeptr,_4720_j )] )];
                      _ptr__4709_rf64[safe_add( _4706_rcconst,_4715_codei )] = _ptr__4689_xf64[safe_add( _4687_xcconst,_ptr__4688_xi32[safe_add( _4686_xcodeptr,_4720_j )] )];
                      ++ _4715_codei;
                      _ptr__4707_ri32[safe_add( safe_add( _4705_rcodeptr,_4717_nzi ),(int)1 )] = _4715_codei;
                      ++ _4717_nzi;
                      ++ _4719_elmnz;
                    }
                  }
                  else
                  {
                    {
                      if ((((_ptr__4688_xi32[safe_add( safe_add( _4686_xcodeptr,_4720_j ),(int)1 )] - _ptr__4688_xi32[safe_add( _4686_xcodeptr,_4720_j )]) > (int)1) || (_ptr__4688_xi32[safe_add( _4685_xcode,_ptr__4688_xi32[safe_add( _4686_xcodeptr,_4720_j )] )] != 10)))
                      {
                        {
                          _ptr__4708_ri64[safe_add( _4702_rnidxs,_4717_nzi )] = _ptr__4670_wi64[safe_add( _4664_nidxs,_4720_j )];
                          _ptr__4709_rf64[safe_add( _4703_rcof,_4717_nzi )] = 0.0;
                          int32_t _11339_ = _ptr__4688_xi32[safe_add( _4686_xcodeptr,_4720_j )];
                          int32_t _11340_ = _ptr__4688_xi32[safe_add( safe_add( _4686_xcodeptr,_4720_j ),(int)1 )];
                          for (int32_t _4721_k = _11339_; _4721_k < _11340_; ++_4721_k)
                          {
                            {
                              _ptr__4707_ri32[safe_add( _4704_rcode,_4715_codei )] = _ptr__4688_xi32[safe_add( _4685_xcode,_4721_k )];
                              _ptr__4709_rf64[safe_add( _4706_rcconst,_4715_codei )] = _ptr__4689_xf64[safe_add( _4687_xcconst,_4721_k )];
                              ++ _4715_codei;
                            }
                          }
                          _ptr__4707_ri32[safe_add( safe_add( _4705_rcodeptr,_4717_nzi ),(int)1 )] = _4715_codei;
                          ++ _4717_nzi;
                          ++ _4719_elmnz;
                        }
                      }
                      {}
                    }
                  }
                }
              }
              if ((_4719_elmnz > (int)0))
              {
                {
                  _ptr__4707_ri32[safe_add( safe_add( _4699_rptr,_4716_elmi ),(int)1 )] = _4717_nzi;
                  if (_4696_rhassp)
                  {
                    {
                      if (_4660_hassp)
                      {
                        {
                          _ptr__4708_ri64[safe_add( _4700_rsp,_4716_elmi )] = _ptr__4670_wi64[safe_add( _4663_sp,_4718_i )];
                        }
                      }
                      else
                      {
                        {
                          _ptr__4708_ri64[safe_add( _4700_rsp,_4716_elmi )] = _4718_i;
                        }
                      }
                    }
                  }
                  {}
                  ++ _4716_elmi;
                }
              }
              {}
            }
          }
          if ((_4716_elmi != _4692_rnelem))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect result nelem"));
            }
          }
          {}
          if ((_4717_nzi != _4691_rnnz))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect result nnz"));
            }
          }
          {}
          if ((_4715_codei != _4690_rncodeatom))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect result num code atoms"));
            }
          }
          {}
          if ((_4690_rncodeatom > (int)0))
          {
            {
              if ((_ptr__4707_ri32[safe_add( _4705_rcodeptr,_4691_rnnz )] != _4690_rncodeatom))
              {
                {
                  throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect codeptr"));
                }
              }
              {}
            }
          }
          {}
        }
      }
    }
  }
}
// End mosek.fusion.ExprOptimizeCode.eval

// Begin mosek.fusion.ExprOptimizeCode.toString
// Method mosek.fusion.ExprOptimizeCode.toString @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:522:6-524:7
std::string mosek::fusion::ExprOptimizeCode :: toString() { return mosek::fusion::p_ExprOptimizeCode::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprOptimizeCode::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprOptimizeCode("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprOptimizeCode.toString

void mosek::fusion::p_ExprOptimizeCode::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprOptimizeCode::destroy() { mosek::fusion::p_ExprOptimizeCode::_get_impl(this)->destroy(); }
// } class ExprOptimizeCode
// class ExprCompress { // @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:11:4-504:5
mosek::fusion::ExprCompress::ExprCompress(mosek::fusion::p_ExprCompress *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprCompress()" << this << std::endl; */ }
mosek::fusion::ExprCompress::~ExprCompress() {  /* std::cout << "~ExprCompress()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprCompress::p_ExprCompress
  (::mosek::fusion::ExprCompress * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprCompress.ctor @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:16:6-19:7
mosek::fusion::ExprCompress::t mosek::fusion::p_ExprCompress::_new_ExprCompress
  (monty::rc_ptr< ::mosek::fusion::Expression > _4722_expr)
{ return new mosek::fusion::ExprCompress(_4722_expr); }
mosek::fusion::ExprCompress::ExprCompress
  (monty::rc_ptr< ::mosek::fusion::Expression > _4722_expr) : 
   ExprCompress(new mosek::fusion::p_ExprCompress(this))
{ mosek::fusion::p_ExprCompress::_get_impl(this)->_initialize(_4722_expr); }
void mosek::fusion::p_ExprCompress::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _4722_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_4722_expr->getShape());
    mosek::fusion::p_ExprCompress::_get_impl(::mosek::fusion::ExprCompress::t(_pubthis))->expr = _4722_expr;
  }
}
// mosek.fusion.ExprCompress.ctor

// Begin mosek.fusion.ExprCompress.arg_sort
// Method mosek.fusion.ExprCompress.arg_sort @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:371:6-503:7
void mosek::fusion::ExprCompress::arg_sort
  ( monty::rc_ptr< ::mosek::fusion::WorkStack > _4723_ws,
    monty::rc_ptr< ::mosek::fusion::WorkStack > _4724_xs,
    int32_t _4725_perm,
    int32_t _4726_nelem,
    int32_t _4727_nnz,
    int32_t _4728_ptr,
    int32_t _4729_nidxs) { mosek::fusion::p_ExprCompress::arg_sort(_4723_ws,_4724_xs,_4725_perm,_4726_nelem,_4727_nnz,_4728_ptr,_4729_nidxs); }
void mosek::fusion::p_ExprCompress::arg_sort(monty::rc_ptr< ::mosek::fusion::WorkStack > _4723_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4724_xs,int32_t _4725_perm,int32_t _4726_nelem,int32_t _4727_nnz,int32_t _4728_ptr,int32_t _4729_nidxs)
{
  int32_t _4730_maxrow = (int)0;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4731_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4723_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4731_wi32(_4731_wi32 ? _4731_wi32->raw() : nullptr,_4731_wi32 ? _4731_wi32->size(0) : 0);
  int32_t _11341_ = (int)0;
  int32_t _11342_ = _4726_nelem;
  for (int32_t _4732_i = _11341_; _4732_i < _11342_; ++_4732_i)
  {
    {
      if (((_ptr__4731_wi32[safe_add( safe_add( _4728_ptr,_4732_i ),(int)1 )] - _ptr__4731_wi32[safe_add( _4728_ptr,_4732_i )]) > _4730_maxrow))
      {
        {
          _4730_maxrow = (_ptr__4731_wi32[safe_add( safe_add( _4728_ptr,_4732_i ),(int)1 )] - _ptr__4731_wi32[safe_add( _4728_ptr,_4732_i )]);
        }
      }
      {}
    }
  }
  int32_t _11343_;
  bool _11344_ = (_4730_maxrow > (int)2);
  if (_11344_)
  {
    _11343_ = _4724_xs->alloci32(safe_mul( _4730_maxrow,(int)2 ));
  }
  else
  {
    _11343_ = (int)99999;
  }
  int32_t _4733_workspace = _11343_;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4734_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4724_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__4734_xi32(_4734_xi32 ? _4734_xi32->raw() : nullptr,_4734_xi32 ? _4734_xi32->size(0) : 0);
  _4731_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4723_ws)->i32;
  _ptr__4731_wi32.update(_4731_wi32 ? _4731_wi32->raw() : nullptr, _4731_wi32 ? _4731_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4735_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4723_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4735_wi64(_4735_wi64 ? _4735_wi64->raw() : nullptr,_4735_wi64 ? _4735_wi64->size(0) : 0);
  int32_t _11345_ = (int)0;
  int32_t _11346_ = _4726_nelem;
  for (int32_t _4736_i = _11345_; _4736_i < _11346_; ++_4736_i)
  {
    {
      int32_t _4737_p0 = _ptr__4731_wi32[safe_add( _4728_ptr,_4736_i )];
      int32_t _4738_p1 = _ptr__4731_wi32[safe_add( safe_add( _4728_ptr,_4736_i ),(int)1 )];
      int32_t _4739_n = (_4738_p1 - _4737_p0);
      if ((_4739_n == (int)0))
      {
        {
        }
      }
      else if((_4739_n == (int)1))
      {
        {
          _ptr__4734_xi32[safe_add( _4725_perm,_4737_p0 )] = _4737_p0;
        }
      }
      else if((_4739_n == (int)2))
      {
        {
          if ((_ptr__4735_wi64[safe_add( _4729_nidxs,_4737_p0 )] <= _ptr__4735_wi64[safe_add( safe_add( _4729_nidxs,_4737_p0 ),(int)1 )]))
          {
            {
              _ptr__4734_xi32[safe_add( _4725_perm,_4737_p0 )] = _4737_p0;
              _ptr__4734_xi32[safe_add( safe_add( _4725_perm,_4737_p0 ),(int)1 )] = safe_add( _4737_p0,(int)1 );
            }
          }
          else
          {
            {
              _ptr__4734_xi32[safe_add( _4725_perm,_4737_p0 )] = safe_add( _4737_p0,(int)1 );
              _ptr__4734_xi32[safe_add( safe_add( _4725_perm,_4737_p0 ),(int)1 )] = _4737_p0;
            }
          }
        }
      }
      else
      {
        {
          int64_t _4740_vmin = _ptr__4735_wi64[safe_add( _4729_nidxs,_4737_p0 )];
          int64_t _4741_vmax = _ptr__4735_wi64[safe_add( _4729_nidxs,_4737_p0 )];
          bool _4742_sorted = false;
          int32_t _11347_ = safe_add( _4737_p0,(int)1 );
          int32_t _11348_ = _4738_p1;
          for (int32_t _4743_i = _11347_; _4743_i < _11348_; ++_4743_i)
          {
            {
              _4742_sorted = (_4742_sorted && (_ptr__4735_wi64[(safe_add( _4729_nidxs,_4743_i ) - (int)1)] <= _ptr__4735_wi64[safe_add( _4729_nidxs,_4743_i )]));
              if ((_4740_vmin > _ptr__4735_wi64[safe_add( _4729_nidxs,_4743_i )]))
              {
                {
                  _4740_vmin = _ptr__4735_wi64[safe_add( _4729_nidxs,_4743_i )];
                }
              }
              {}
              if ((_4741_vmax < _ptr__4735_wi64[safe_add( _4729_nidxs,_4743_i )]))
              {
                {
                  _4741_vmax = _ptr__4735_wi64[safe_add( _4729_nidxs,_4743_i )];
                }
              }
              {}
            }
          }
          if (_4742_sorted)
          {
            {
              int32_t _11349_ = _4737_p0;
              int32_t _11350_ = _4738_p1;
              for (int32_t _4744_i = _11349_; _4744_i < _11350_; ++_4744_i)
              {
                {
                  _ptr__4734_xi32[safe_add( _4725_perm,_4744_i )] = _4744_i;
                }
              }
            }
          }
          else if((safe_add( (_4741_vmax - _4740_vmin),(int)1 ) <= _4739_n))
          {
            {
              int64_t _4745_m = safe_add( (_4741_vmax - _4740_vmin),(int)1 );
              int32_t _11351_ = (int)0;
              int64_t _11352_ = safe_add( _4745_m,(int)1 );
              for (int64_t _4746_j = _11351_; _4746_j < _11352_; ++_4746_j)
              {
                {
                  _ptr__4734_xi32[safe_add( _4733_workspace,_4746_j )] = (int)0;
                }
              }
              int32_t _11353_ = _4737_p0;
              int32_t _11354_ = _4738_p1;
              for (int32_t _4747_j = _11353_; _4747_j < _11354_; ++_4747_j)
              {
                {
                  ++ _ptr__4734_xi32[safe_add( (safe_add( _4733_workspace,_ptr__4735_wi64[safe_add( _4729_nidxs,_4747_j )] ) - _4740_vmin),(int)1 )];
                }
              }
              int32_t _11355_ = (int)0;
              int64_t _11356_ = _4745_m;
              for (int64_t _4748_j = _11355_; _4748_j < _11356_; ++_4748_j)
              {
                {
                  _ptr__4734_xi32[safe_add( safe_add( _4733_workspace,_4748_j ),(int)1 )] += _ptr__4734_xi32[safe_add( _4733_workspace,_4748_j )];
                }
              }
              int32_t _11357_ = _4737_p0;
              int32_t _11358_ = _4738_p1;
              for (int32_t _4749_j = _11357_; _4749_j < _11358_; ++_4749_j)
              {
                {
                  _ptr__4734_xi32[safe_add( safe_add( _4725_perm,_4737_p0 ),_ptr__4734_xi32[(safe_add( _4733_workspace,_ptr__4735_wi64[safe_add( _4729_nidxs,_4749_j )] ) - _4740_vmin)] )] = _4749_j;
                  ++ _ptr__4734_xi32[(safe_add( _4733_workspace,_ptr__4735_wi64[safe_add( _4729_nidxs,_4749_j )] ) - _4740_vmin)];
                }
              }
            }
          }
          else
          {
            {
              int32_t _4750_blocksize = (int)1;
              int32_t _4751_perm1 = _4733_workspace;
              int32_t _4752_perm2 = safe_add( _4733_workspace,_4739_n );
              int32_t _11359_ = (int)0;
              int32_t _11360_ = _4739_n;
              for (int32_t _4753_j = _11359_; _4753_j < _11360_; ++_4753_j)
              {
                {
                  _ptr__4734_xi32[safe_add( _4751_perm1,_4753_j )] = _4753_j;
                }
              }
              while ( (_4750_blocksize < _4739_n) )
              {
                {
                  int32_t _4754_mergesize = safe_mul( _4750_blocksize,(int)2 );
                  int32_t _4755_nummerges = (_4739_n / _4754_mergesize);
                  if ((safe_add( safe_mul( _4755_nummerges,_4754_mergesize ),_4750_blocksize ) < _4739_n))
                  {
                    {
                      ++ _4755_nummerges;
                    }
                  }
                  {}
                  int32_t _4756_k = (int)0;
                  int32_t _11361_ = (int)0;
                  int32_t _11362_ = _4755_nummerges;
                  for (int32_t _4757_j = _11361_; _4757_j < _11362_; ++_4757_j)
                  {
                    {
                      int32_t _4758_a0 = safe_mul( _4757_j,_4754_mergesize );
                      int32_t _4759_a1 = safe_add( _4758_a0,_4750_blocksize );
                      int32_t _4760_b0 = _4759_a1;
                      int32_t _4761_b1 = safe_add( _4760_b0,_4750_blocksize );
                      if ((_4761_b1 > _4739_n))
                      {
                        {
                          _4761_b1 = _4739_n;
                        }
                      }
                      {}
                      while ( ((_4758_a0 < _4759_a1) && (_4760_b0 < _4761_b1)) )
                      {
                        {
                          if ((_ptr__4735_wi64[safe_add( safe_add( _4729_nidxs,_ptr__4734_xi32[safe_add( _4751_perm1,_4758_a0 )] ),_4737_p0 )] <= _ptr__4735_wi64[safe_add( safe_add( _4729_nidxs,_ptr__4734_xi32[safe_add( _4751_perm1,_4760_b0 )] ),_4737_p0 )]))
                          {
                            {
                              _ptr__4734_xi32[safe_add( _4752_perm2,_4756_k )] = _ptr__4734_xi32[safe_add( _4751_perm1,_4758_a0 )];
                              ++ _4756_k;
                              ++ _4758_a0;
                            }
                          }
                          else
                          {
                            {
                              _ptr__4734_xi32[safe_add( _4752_perm2,_4756_k )] = _ptr__4734_xi32[safe_add( _4751_perm1,_4760_b0 )];
                              ++ _4756_k;
                              ++ _4760_b0;
                            }
                          }
                        }
                      }
                      while ( (_4758_a0 < _4759_a1) )
                      {
                        {
                          _ptr__4734_xi32[safe_add( _4752_perm2,_4756_k )] = _ptr__4734_xi32[safe_add( _4751_perm1,_4758_a0 )];
                          ++ _4756_k;
                          ++ _4758_a0;
                        }
                      }
                      while ( (_4760_b0 < _4761_b1) )
                      {
                        {
                          _ptr__4734_xi32[safe_add( _4752_perm2,_4756_k )] = _ptr__4734_xi32[safe_add( _4751_perm1,_4760_b0 )];
                          ++ _4756_k;
                          ++ _4760_b0;
                        }
                      }
                    }
                  }
                  if ((safe_mul( _4755_nummerges,_4754_mergesize ) < _4739_n))
                  {
                    {
                      int32_t _4762_b = safe_mul( _4755_nummerges,_4754_mergesize );
                      while ( (_4762_b < _4739_n) )
                      {
                        {
                          _ptr__4734_xi32[safe_add( _4752_perm2,_4756_k )] = _ptr__4734_xi32[safe_add( _4751_perm1,_4762_b )];
                          ++ _4762_b;
                          ++ _4756_k;
                        }
                      }
                    }
                  }
                  {}
                  int32_t _4763_tmp = _4751_perm1;
                  _4751_perm1 = _4752_perm2;
                  _4752_perm2 = _4763_tmp;
                  _4750_blocksize *= (int)2;
                }
              }
              int32_t _11363_ = (int)0;
              int32_t _11364_ = _4739_n;
              for (int32_t _4764_i = _11363_; _4764_i < _11364_; ++_4764_i)
              {
                {
                  _ptr__4734_xi32[safe_add( safe_add( _4725_perm,_4737_p0 ),_4764_i )] = safe_add( _ptr__4734_xi32[safe_add( _4751_perm1,_4764_i )],_4737_p0 );
                }
              }
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprCompress.arg_sort

// Begin mosek.fusion.ExprCompress.merge_sort
// Method mosek.fusion.ExprCompress.merge_sort @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:310:6-369:7
void mosek::fusion::ExprCompress::merge_sort
  ( int32_t _4765_origperm1,
    int32_t _4766_origperm2,
    int32_t _4767_nelem,
    int32_t _4768_nnz,
    int32_t _4769_ptr_base,
    int32_t _4770_nidxs_base,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4771_wi32,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4772_wi64) { mosek::fusion::p_ExprCompress::merge_sort(_4765_origperm1,_4766_origperm2,_4767_nelem,_4768_nnz,_4769_ptr_base,_4770_nidxs_base,_4771_wi32,_4772_wi64); }
void mosek::fusion::p_ExprCompress::merge_sort(int32_t _4765_origperm1,int32_t _4766_origperm2,int32_t _4767_nelem,int32_t _4768_nnz,int32_t _4769_ptr_base,int32_t _4770_nidxs_base,std::shared_ptr< monty::ndarray< int32_t,1 > > _4771_wi32,std::shared_ptr< monty::ndarray< int64_t,1 > > _4772_wi64)
{
  _checked_ptr_1<int32_t> _ptr__4771_wi32(_4771_wi32 ? _4771_wi32->raw() : nullptr, _4771_wi32 ? _4771_wi32->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__4772_wi64(_4772_wi64 ? _4772_wi64->raw() : nullptr, _4772_wi64 ? _4772_wi64->size(0) : 0);
  int32_t _4773_perm1 = _4765_origperm1;
  int32_t _4774_perm2 = _4766_origperm2;
  int32_t _11365_ = (int)0;
  int32_t _11366_ = _4768_nnz;
  for (int32_t _4775_j = _11365_; _4775_j < _11366_; ++_4775_j)
  {
    {
      _ptr__4771_wi32[safe_add( _4773_perm1,_4775_j )] = _4775_j;
    }
  }
  int32_t _11367_ = (int)0;
  int32_t _11368_ = _4767_nelem;
  for (int32_t _4776_i = _11367_; _4776_i < _11368_; ++_4776_i)
  {
    {
      _4773_perm1 = _4765_origperm1;
      _4774_perm2 = _4766_origperm2;
      int32_t _4777_p1 = _ptr__4771_wi32[safe_add( safe_add( _4769_ptr_base,_4776_i ),(int)1 )];
      int32_t _4778_p0 = _ptr__4771_wi32[safe_add( _4769_ptr_base,_4776_i )];
      if ((safe_add( _4778_p0,(int)1 ) < _4777_p1))
      {
        {
          int32_t _4779_n = (_4777_p1 - _4778_p0);
          int32_t _4780_lg2n = (int)0;
          while ( (_4779_n > (int)1) )
          {
            {
              ++ _4780_lg2n;
              _4779_n /= (int)2;
            }
          }
          _4779_n = (_4777_p1 - _4778_p0);
          int32_t _4781_blocksz = (int)1;
          int32_t _11369_ = (int)0;
          int32_t _11370_ = safe_add( _4780_lg2n,(int)1 );
          for (int32_t _4782_k = _11369_; _4782_k < _11370_; ++_4782_k)
          {
            {
              int32_t _4783_numblocks = ((safe_add( _4779_n,_4781_blocksz ) - (int)1) / _4781_blocksz);
              int32_t _4784_nmerge = (_4783_numblocks / (int)2);
              int32_t _4785_kk = _4778_p0;
              int32_t _11371_ = (int)0;
              int32_t _11372_ = _4784_nmerge;
              for (int32_t _4786_ii_ = _11371_; _4786_ii_ < _11372_; ++_4786_ii_)
              {
                {
                  int32_t _4787_ii = safe_mul( safe_mul( _4786_ii_,_4781_blocksz ),(int)2 );
                  int32_t _11373_;
                  bool _11374_ = (safe_add( safe_add( _4778_p0,_4787_ii ),safe_mul( (int)2,_4781_blocksz ) ) < _4777_p1);
                  if (_11374_)
                  {
                    _11373_ = safe_add( safe_add( _4778_p0,_4787_ii ),safe_mul( (int)2,_4781_blocksz ) );
                  }
                  else
                  {
                    _11373_ = _4777_p1;
                  }
                  int32_t _4788_jj1e = _11373_;
                  int32_t _4789_jj1 = safe_add( safe_add( _4778_p0,_4787_ii ),_4781_blocksz );
                  int32_t _4790_jj0e = safe_add( safe_add( _4778_p0,_4787_ii ),_4781_blocksz );
                  int32_t _4791_jj0 = safe_add( _4778_p0,_4787_ii );
                  while ( ((_4791_jj0 < _4790_jj0e) && (_4789_jj1 < _4788_jj1e)) )
                  {
                    {
                      if ((_ptr__4772_wi64[safe_add( _4770_nidxs_base,_ptr__4771_wi32[safe_add( _4773_perm1,_4791_jj0 )] )] <= _ptr__4772_wi64[safe_add( _4770_nidxs_base,_ptr__4771_wi32[safe_add( _4773_perm1,_4789_jj1 )] )]))
                      {
                        {
                          _ptr__4771_wi32[safe_add( _4774_perm2,_4785_kk )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4791_jj0 )];
                          ++ _4785_kk;
                          ++ _4791_jj0;
                        }
                      }
                      else
                      {
                        {
                          _ptr__4771_wi32[safe_add( _4774_perm2,_4785_kk )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4789_jj1 )];
                          ++ _4785_kk;
                          ++ _4789_jj1;
                        }
                      }
                    }
                  }
                  while ( (_4791_jj0 < _4790_jj0e) )
                  {
                    {
                      _ptr__4771_wi32[safe_add( _4774_perm2,_4785_kk )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4791_jj0 )];
                      ++ _4785_kk;
                      ++ _4791_jj0;
                    }
                  }
                  while ( (_4789_jj1 < _4788_jj1e) )
                  {
                    {
                      _ptr__4771_wi32[safe_add( _4774_perm2,_4785_kk )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4789_jj1 )];
                      ++ _4785_kk;
                      ++ _4789_jj1;
                    }
                  }
                }
              }
              int32_t _11375_ = _4785_kk;
              int32_t _11376_ = _4777_p1;
              for (int32_t _4792_ii = _11375_; _4792_ii < _11376_; ++_4792_ii)
              {
                {
                  _ptr__4771_wi32[safe_add( _4774_perm2,_4792_ii )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4792_ii )];
                }
              }
              int32_t _4793_tmp = _4773_perm1;
              _4773_perm1 = _4774_perm2;
              _4774_perm2 = _4793_tmp;
              _4781_blocksz *= (int)2;
            }
          }
        }
      }
      {}
      int32_t _11377_ = _4778_p0;
      int32_t _11378_ = _4777_p1;
      for (int32_t _4794_i = _11377_; _4794_i < _11378_; ++_4794_i)
      {
        {
          _ptr__4771_wi32[safe_add( _4765_origperm1,_4794_i )] = _ptr__4771_wi32[safe_add( _4773_perm1,_4794_i )];
        }
      }
    }
  }
}
// End mosek.fusion.ExprCompress.merge_sort

// Begin mosek.fusion.ExprCompress.eval
// Method mosek.fusion.ExprCompress.eval @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:21:6-306:7
void mosek::fusion::ExprCompress :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4795_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4796_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4797_xs) { mosek::fusion::p_ExprCompress::_get_impl(this)->eval(_4795_rs,_4796_ws,_4797_xs); }
void mosek::fusion::p_ExprCompress::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4795_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4796_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4797_xs)
{
  expr->eval(_4796_ws,_4795_rs,_4797_xs);
  _4796_ws->pop_expr();
  int32_t _4798_nd = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->nd;
  int32_t _4799_shape = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->shape_base;
  int32_t _4800_nelem = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->nelem;
  int32_t _4801_nnz = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->nnz;
  bool _4802_hassp = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->hassp;
  int32_t _4803_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->ncodeatom;
  int32_t _4804_ptr = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->ptr_base;
  int32_t _4805_sp = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->sp_base;
  int32_t _4806_nidxs = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->nidxs_base;
  int32_t _4807_cof = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->cof_base;
  int32_t _4808_code = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->code_base;
  int32_t _4809_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->codeptr_base;
  int32_t _4810_cconst = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4811_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4811_wi32(_4811_wi32 ? _4811_wi32->raw() : nullptr,_4811_wi32 ? _4811_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4812_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4812_wi64(_4812_wi64 ? _4812_wi64->raw() : nullptr,_4812_wi64 ? _4812_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4813_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4796_ws)->f64;
  _checked_ptr_1<double> _ptr__4813_wf64(_4813_wf64 ? _4813_wf64->raw() : nullptr,_4813_wf64 ? _4813_wf64->size(0) : 0);
  bool _4814_iscompact = true;
  {
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4815_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4797_xs)->i32;
    _checked_ptr_1<int32_t> _ptr__4815_xi32(_4815_xi32 ? _4815_xi32->raw() : nullptr,_4815_xi32 ? _4815_xi32->size(0) : 0);
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4816_xi64 = mosek::fusion::p_WorkStack::_get_impl(_4797_xs)->i64;
    _checked_ptr_1<int64_t> _ptr__4816_xi64(_4816_xi64 ? _4816_xi64->raw() : nullptr,_4816_xi64 ? _4816_xi64->size(0) : 0);
    std::shared_ptr< monty::ndarray< double,1 > > _4817_xf64 = mosek::fusion::p_WorkStack::_get_impl(_4797_xs)->f64;
    _checked_ptr_1<double> _ptr__4817_xf64(_4817_xf64 ? _4817_xf64->raw() : nullptr,_4817_xf64 ? _4817_xf64->size(0) : 0);
    int32_t _11379_ = (int)0;
    int32_t _11380_ = _4800_nelem;
    for (int32_t _4818_i = _11379_; _4818_i < _11380_; ++_4818_i)
    {
      {
        int32_t _11381_ = _ptr__4811_wi32[safe_add( _4804_ptr,_4818_i )];
        int32_t _11382_ = (_ptr__4811_wi32[safe_add( safe_add( _4804_ptr,_4818_i ),(int)1 )] - (int)1);
        for (int32_t _4819_j = _11381_; _4819_j < _11382_; ++_4819_j)
        {
          {
            _4814_iscompact = (_4814_iscompact && (_ptr__4812_wi64[safe_add( _4806_nidxs,_4819_j )] < _ptr__4812_wi64[safe_add( safe_add( _4806_nidxs,_4819_j ),(int)1 )]));
          }
        }
      }
    }
    if (_4814_iscompact)
    {
      {
        if ((_4803_ncodeatom > (int)0))
        {
          {
            int32_t _11383_ = (int)0;
            int32_t _11384_ = _4801_nnz;
            for (int32_t _4820_j = _11383_; _4820_j < _11384_; ++_4820_j)
            {
              {
                _4814_iscompact = (_4814_iscompact && ((!((_ptr__4813_wf64[safe_add( _4807_cof,_4820_j )] >= 0.0) && (0.0 >= _ptr__4813_wf64[safe_add( _4807_cof,_4820_j )]))) || (((_ptr__4811_wi32[safe_add( safe_add( _4809_codeptr,_4820_j ),(int)1 )] - _ptr__4811_wi32[safe_add( _4809_codeptr,_4820_j )]) == (int)0) || (!(((_ptr__4811_wi32[safe_add( safe_add( _4809_codeptr,_4820_j ),(int)1 )] - _ptr__4811_wi32[safe_add( _4809_codeptr,_4820_j )]) == (int)1) && ((_ptr__4811_wi32[safe_add( _4808_code,_ptr__4811_wi32[safe_add( _4809_codeptr,_4820_j )] )] == 2) && (!((_ptr__4813_wf64[safe_add( _4810_cconst,_ptr__4811_wi32[safe_add( _4809_codeptr,_4820_j )] )] <= 0.0) && (_ptr__4813_wf64[safe_add( _4810_cconst,_ptr__4811_wi32[safe_add( _4809_codeptr,_4820_j )] )] >= 0.0)))))))));
              }
            }
          }
        }
        else
        {
          {
            int32_t _11385_ = (int)0;
            int32_t _11386_ = _4801_nnz;
            for (int32_t _4821_j = _11385_; _4821_j < _11386_; ++_4821_j)
            {
              {
                _4814_iscompact = (_4814_iscompact && (!((_ptr__4813_wf64[safe_add( _4807_cof,_4821_j )] <= 0.0) && (0.0 <= _ptr__4813_wf64[safe_add( _4807_cof,_4821_j )]))));
              }
            }
          }
        }
      }
    }
    {}
  }
  if (_4814_iscompact)
  {
    {
      _4795_rs->alloc_expr(_4798_nd,_4800_nelem,_4801_nnz,_4802_hassp,_4803_ncodeatom);
      int32_t _4822_rptr = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->ptr_base;
      int32_t _4823_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->nidxs_base;
      int32_t _4824_rsp = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->sp_base;
      int32_t _4825_rcof = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->cof_base;
      int32_t _4826_rshape = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->shape_base;
      int32_t _4827_rcode = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->code_base;
      int32_t _4828_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->codeptr_base;
      int32_t _4829_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4830_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4830_ri32(_4830_ri32 ? _4830_ri32->raw() : nullptr,_4830_ri32 ? _4830_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4831_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4831_ri64(_4831_ri64 ? _4831_ri64->raw() : nullptr,_4831_ri64 ? _4831_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4832_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->f64;
      _checked_ptr_1<double> _ptr__4832_rf64(_4832_rf64 ? _4832_rf64->raw() : nullptr,_4832_rf64 ? _4832_rf64->size(0) : 0);
      {
        int32_t _11387_ = (int)0;
        int32_t _11388_ = _4798_nd;
        for (int32_t _4833_i = _11387_; _4833_i < _11388_; ++_4833_i)
        {
          {
            _ptr__4830_ri32[safe_add( _4826_rshape,_4833_i )] = _ptr__4811_wi32[safe_add( _4799_shape,_4833_i )];
          }
        }
        int32_t _11389_ = (int)0;
        int32_t _11390_ = safe_add( _4800_nelem,(int)1 );
        for (int32_t _4834_i = _11389_; _4834_i < _11390_; ++_4834_i)
        {
          {
            _ptr__4830_ri32[safe_add( _4822_rptr,_4834_i )] = _ptr__4811_wi32[safe_add( _4804_ptr,_4834_i )];
          }
        }
        int32_t _11391_ = (int)0;
        int32_t _11392_ = _4801_nnz;
        for (int32_t _4835_i = _11391_; _4835_i < _11392_; ++_4835_i)
        {
          {
            _ptr__4831_ri64[safe_add( _4823_rnidxs,_4835_i )] = _ptr__4812_wi64[safe_add( _4806_nidxs,_4835_i )];
          }
        }
        int32_t _11393_ = (int)0;
        int32_t _11394_ = _4801_nnz;
        for (int32_t _4836_i = _11393_; _4836_i < _11394_; ++_4836_i)
        {
          {
            _ptr__4832_rf64[safe_add( _4825_rcof,_4836_i )] = _ptr__4813_wf64[safe_add( _4807_cof,_4836_i )];
          }
        }
        if (_4802_hassp)
        {
          {
            int32_t _11395_ = (int)0;
            int32_t _11396_ = _4800_nelem;
            for (int32_t _4837_i = _11395_; _4837_i < _11396_; ++_4837_i)
            {
              {
                _ptr__4831_ri64[safe_add( _4824_rsp,_4837_i )] = _ptr__4812_wi64[safe_add( _4805_sp,_4837_i )];
              }
            }
          }
        }
        {}
        if ((_4803_ncodeatom > (int)0))
        {
          {
            int32_t _11397_ = (int)0;
            int32_t _11398_ = _4803_ncodeatom;
            for (int32_t _4838_i = _11397_; _4838_i < _11398_; ++_4838_i)
            {
              {
                _ptr__4830_ri32[safe_add( _4827_rcode,_4838_i )] = _ptr__4811_wi32[safe_add( _4808_code,_4838_i )];
              }
            }
            int32_t _11399_ = (int)0;
            int32_t _11400_ = _4803_ncodeatom;
            for (int32_t _4839_i = _11399_; _4839_i < _11400_; ++_4839_i)
            {
              {
                _ptr__4832_rf64[safe_add( _4829_rcconst,_4839_i )] = _ptr__4813_wf64[safe_add( _4810_cconst,_4839_i )];
              }
            }
            int32_t _11401_ = (int)0;
            int32_t _11402_ = safe_add( _4801_nnz,(int)1 );
            for (int32_t _4840_i = _11401_; _4840_i < _11402_; ++_4840_i)
            {
              {
                _ptr__4830_ri32[safe_add( _4828_rcodeptr,_4840_i )] = _ptr__4811_wi32[safe_add( _4809_codeptr,_4840_i )];
              }
            }
          }
        }
        {}
      }
      if ((_4803_ncodeatom > (int)0))
      {
        {
          if ((_ptr__4830_ri32[safe_add( _4828_rcodeptr,_4801_nnz )] != _4803_ncodeatom))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect codeptr"));
            }
          }
          {}
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _4841_perm1 = _4797_xs->alloci32(_4801_nnz);
      ::mosek::fusion::p_ExprCompress::arg_sort(_4796_ws,_4797_xs,_4841_perm1,_4800_nelem,_4801_nnz,_4804_ptr,_4806_nidxs);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4842_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4797_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__4842_xi32(_4842_xi32 ? _4842_xi32->raw() : nullptr,_4842_xi32 ? _4842_xi32->size(0) : 0);
      int32_t _4843_rnnz = (int)0;
      int32_t _4844_rncodeatom = _4803_ncodeatom;
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _4845_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->i32;
        _checked_ptr_1<int32_t> _ptr__4845_ri32(_4845_ri32 ? _4845_ri32->raw() : nullptr,_4845_ri32 ? _4845_ri32->size(0) : 0);
        int32_t _11403_ = (int)0;
        int32_t _11404_ = _4800_nelem;
        for (int32_t _4846_i = _11403_; _4846_i < _11404_; ++_4846_i)
        {
          {
            int32_t _4847_pe = _ptr__4811_wi32[safe_add( safe_add( _4804_ptr,_4846_i ),(int)1 )];
            int32_t _4848_pb = _ptr__4811_wi32[safe_add( _4804_ptr,_4846_i )];
            if ((_4848_pb < _4847_pe))
            {
              {
                int32_t _4849_p = _4848_pb;
                while ( (_4849_p < _4847_pe) )
                {
                  {
                    double _4850_c = 0.0;
                    bool _4851_cnonzero = false;
                    int64_t _4852_varidx = _ptr__4812_wi64[safe_add( _4806_nidxs,_ptr__4842_xi32[safe_add( _4841_perm1,_4849_p )] )];
                    int32_t _4853_p0 = _4849_p;
                    while ( ((_4849_p < _4847_pe) && (_ptr__4812_wi64[safe_add( _4806_nidxs,_ptr__4842_xi32[safe_add( _4841_perm1,_4849_p )] )] == _4852_varidx)) )
                    {
                      {
                        double _4854_ci = _ptr__4813_wf64[safe_add( _4807_cof,_ptr__4842_xi32[safe_add( _4841_perm1,_4849_p )] )];
                        _4851_cnonzero = (_4851_cnonzero || (!((_4854_ci <= 0.0) && (_4854_ci >= 0.0))));
                        _4850_c += _4854_ci;
                        ++ _4849_p;
                      }
                    }
                    if ((_4851_cnonzero || (_4803_ncodeatom > (int)0)))
                    {
                      {
                        ++ _4843_rnnz;
                        if (((safe_add( _4853_p0,(int)1 ) < _4849_p) && (_4803_ncodeatom > (int)0)))
                        {
                          {
                            _4844_rncodeatom += (int)1;
                          }
                        }
                        {}
                      }
                    }
                    {}
                  }
                }
              }
            }
            {}
          }
        }
      }
      _4795_rs->alloc_expr(_4798_nd,_4800_nelem,_4843_rnnz,_4802_hassp,_4844_rncodeatom);
      int32_t _4855_rnidx = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->nidxs_base;
      int32_t _4856_rshape = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->shape_base;
      int32_t _4857_rsp = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->sp_base;
      int32_t _4858_rcof = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->cof_base;
      int32_t _4859_rptr = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->ptr_base;
      int32_t _4860_rcode = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->code_base;
      int32_t _4861_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->codeptr_base;
      int32_t _4862_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4863_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4863_ri32(_4863_ri32 ? _4863_ri32->raw() : nullptr,_4863_ri32 ? _4863_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4864_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4864_ri64(_4864_ri64 ? _4864_ri64->raw() : nullptr,_4864_ri64 ? _4864_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4865_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4795_rs)->f64;
      _checked_ptr_1<double> _ptr__4865_rf64(_4865_rf64 ? _4865_rf64->raw() : nullptr,_4865_rf64 ? _4865_rf64->size(0) : 0);
      {
        int32_t _11405_ = (int)0;
        int32_t _11406_ = _4798_nd;
        for (int32_t _4866_i = _11405_; _4866_i < _11406_; ++_4866_i)
        {
          {
            _ptr__4863_ri32[safe_add( _4856_rshape,_4866_i )] = _ptr__4811_wi32[safe_add( _4799_shape,_4866_i )];
          }
        }
        if (_4802_hassp)
        {
          {
            int32_t _11407_ = (int)0;
            int32_t _11408_ = _4800_nelem;
            for (int32_t _4867_i = _11407_; _4867_i < _11408_; ++_4867_i)
            {
              {
                _ptr__4864_ri64[safe_add( _4857_rsp,_4867_i )] = _ptr__4812_wi64[safe_add( _4805_sp,_4867_i )];
              }
            }
          }
        }
        {}
        int32_t _4868_nzi = (int)0;
        int32_t _4869_codei = (int)0;
        {
          _ptr__4863_ri32[_4859_rptr] = (int)0;
          if ((_4844_rncodeatom > (int)0))
          {
            {
              _ptr__4863_ri32[_4861_rcodeptr] = (int)0;
            }
          }
          {}
          int32_t _11409_ = (int)0;
          int32_t _11410_ = _4800_nelem;
          for (int32_t _4870_elmi = _11409_; _4870_elmi < _11410_; ++_4870_elmi)
          {
            {
              int32_t _4871_pe = _ptr__4811_wi32[safe_add( safe_add( _4804_ptr,_4870_elmi ),(int)1 )];
              int32_t _4872_pb = _ptr__4811_wi32[safe_add( _4804_ptr,_4870_elmi )];
              if ((_4872_pb < _4871_pe))
              {
                {
                  int32_t _4873_p = _4872_pb;
                  int32_t _4874_p0 = _4873_p;
                  while ( (_4873_p < _4871_pe) )
                  {
                    {
                      double _4875_c = 0.0;
                      bool _4876_cnonzero = false;
                      int32_t _4877_p0e = safe_add( _4873_p,(int)1 );
                      int32_t _4878_p0b = _4873_p;
                      int64_t _4879_varidx = _ptr__4812_wi64[safe_add( _4806_nidxs,_ptr__4842_xi32[safe_add( _4841_perm1,_4878_p0b )] )];
                      while ( ((_4877_p0e < _4871_pe) && (_ptr__4812_wi64[safe_add( _4806_nidxs,_ptr__4842_xi32[safe_add( _4841_perm1,_4877_p0e )] )] == _4879_varidx)) )
                      {
                        {
                          ++ _4877_p0e;
                        }
                      }
                      if ((_4803_ncodeatom > (int)0))
                      {
                        {
                          while ( (_4873_p < _4877_p0e) )
                          {
                            {
                              double _4880_ci = _ptr__4813_wf64[safe_add( _4807_cof,_ptr__4842_xi32[safe_add( _4841_perm1,_4873_p )] )];
                              _4876_cnonzero = (_4876_cnonzero || (!((_4880_ci <= 0.0) && (_4880_ci >= 0.0))));
                              _4875_c += _4880_ci;
                              int32_t _11411_ = _ptr__4811_wi32[safe_add( _4809_codeptr,_ptr__4842_xi32[safe_add( _4841_perm1,_4873_p )] )];
                              int32_t _11412_ = _ptr__4811_wi32[safe_add( safe_add( _4809_codeptr,_ptr__4842_xi32[safe_add( _4841_perm1,_4873_p )] ),(int)1 )];
                              for (int32_t _4881_l = _11411_; _4881_l < _11412_; ++_4881_l)
                              {
                                {
                                  _ptr__4863_ri32[safe_add( _4860_rcode,_4869_codei )] = _ptr__4811_wi32[safe_add( _4808_code,_4881_l )];
                                  _ptr__4865_rf64[safe_add( _4862_rcconst,_4869_codei )] = _ptr__4813_wf64[safe_add( _4810_cconst,_4881_l )];
                                  ++ _4869_codei;
                                }
                              }
                              ++ _4873_p;
                            }
                          }
                          if (((_4877_p0e - _4878_p0b) > (int)1))
                          {
                            {
                              _ptr__4863_ri32[safe_add( _4860_rcode,_4869_codei )] = 8;
                              _ptr__4865_rf64[safe_add( _4862_rcconst,_4869_codei )] = (_4877_p0e - _4878_p0b);
                              ++ _4869_codei;
                            }
                          }
                          {}
                          _ptr__4863_ri32[safe_add( safe_add( _4861_rcodeptr,_4868_nzi ),(int)1 )] = _4869_codei;
                          _ptr__4864_ri64[safe_add( _4855_rnidx,_4868_nzi )] = _4879_varidx;
                          _ptr__4865_rf64[safe_add( _4858_rcof,_4868_nzi )] = _4875_c;
                          ++ _4868_nzi;
                        }
                      }
                      else
                      {
                        {
                          while ( (_4873_p < _4877_p0e) )
                          {
                            {
                              double _4882_ci = _ptr__4813_wf64[safe_add( _4807_cof,_ptr__4842_xi32[safe_add( _4841_perm1,_4873_p )] )];
                              _4876_cnonzero = (_4876_cnonzero || (!((_4882_ci <= 0.0) && (_4882_ci >= 0.0))));
                              _4875_c += _4882_ci;
                              ++ _4873_p;
                            }
                          }
                          if (_4876_cnonzero)
                          {
                            {
                              _ptr__4864_ri64[safe_add( _4855_rnidx,_4868_nzi )] = _4879_varidx;
                              _ptr__4865_rf64[safe_add( _4858_rcof,_4868_nzi )] = _4875_c;
                              ++ _4868_nzi;
                            }
                          }
                          {}
                        }
                      }
                    }
                  }
                }
              }
              {}
              _ptr__4863_ri32[safe_add( safe_add( _4859_rptr,_4870_elmi ),(int)1 )] = _4868_nzi;
            }
          }
        }
        if ((_4844_rncodeatom != _4869_codei))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid ncodeatom"));
          }
        }
        {}
        if ((_4868_nzi != _4843_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nnz"));
          }
        }
        {}
        if ((_4843_rnnz != _ptr__4863_ri32[safe_add( _4859_rptr,_4800_nelem )]))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid ptr"));
          }
        }
        {}
      }
      if ((_4844_rncodeatom > (int)0))
      {
        {
          if ((_ptr__4863_ri32[safe_add( _4861_rcodeptr,_4843_rnnz )] != _4844_rncodeatom))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect codeptr"));
            }
          }
          {}
        }
      }
      {}
    }
  }
  _4797_xs->clear();
}
// End mosek.fusion.ExprCompress.eval

// Begin mosek.fusion.ExprCompress.toString
// Method mosek.fusion.ExprCompress.toString @ bld/docker-win/final/default/src/fusion/ExprCompress.monty:14:6-130
std::string mosek::fusion::ExprCompress :: toString() { return mosek::fusion::p_ExprCompress::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprCompress::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprCompress("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprCompress.toString

void mosek::fusion::p_ExprCompress::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprCompress::destroy() { mosek::fusion::p_ExprCompress::_get_impl(this)->destroy(); }
// } class ExprCompress
// class ExprConst { // @ bld/docker-win/final/default/src/fusion/ExprConst.monty:4:4-80:5
mosek::fusion::ExprConst::ExprConst(mosek::fusion::p_ExprConst *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprConst()" << this << std::endl; */ }
mosek::fusion::ExprConst::~ExprConst() {  /* std::cout << "~ExprConst()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprConst::p_ExprConst
  (::mosek::fusion::ExprConst * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprConst.ctor @ bld/docker-win/final/default/src/fusion/ExprConst.monty:37:6-42:7
mosek::fusion::ExprConst::t mosek::fusion::p_ExprConst::_new_ExprConst
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4883_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4884_sparsity,
    std::shared_ptr< monty::ndarray< double,1 > > _4885_bfix)
{ return new mosek::fusion::ExprConst(_4883_shape,_4884_sparsity,_4885_bfix); }
mosek::fusion::ExprConst::ExprConst
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4883_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4884_sparsity,
    std::shared_ptr< monty::ndarray< double,1 > > _4885_bfix) : 
   ExprConst(new mosek::fusion::p_ExprConst(this))
{ mosek::fusion::p_ExprConst::_get_impl(this)->_initialize(_4883_shape,_4884_sparsity,_4885_bfix); }
void mosek::fusion::p_ExprConst::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4883_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4884_sparsity,
    std::shared_ptr< monty::ndarray< double,1 > > _4885_bfix)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__4883_shape(_4883_shape ? _4883_shape->raw() : nullptr, _4883_shape ? _4883_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__4884_sparsity(_4884_sparsity ? _4884_sparsity->raw() : nullptr, _4884_sparsity ? _4884_sparsity->size(0) : 0);
    _checked_ptr_1<double> _ptr__4885_bfix(_4885_bfix ? _4885_bfix->raw() : nullptr, _4885_bfix ? _4885_bfix->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(_4883_shape);
    mosek::fusion::p_ExprConst::_get_impl(::mosek::fusion::ExprConst::t(_pubthis))->bfix = ::mosek::fusion::Utils::Tools::arraycopy(_4885_bfix);
    std::shared_ptr< monty::ndarray< int64_t,1 > > _11413_;
    bool _11414_ = (NULL != _4884_sparsity.get());
    if (_11414_)
    {
      _11413_ = ::mosek::fusion::Utils::Tools::arraycopy(_4884_sparsity);
    }
    else
    {
      _11413_ = nullptr;
    }
    mosek::fusion::p_ExprConst::_get_impl(::mosek::fusion::ExprConst::t(_pubthis))->sparsity = _11413_;
    ::mosek::fusion::p_ExprConst::validate(_4883_shape,_4885_bfix,_4884_sparsity);
  }
}
// mosek.fusion.ExprConst.ctor

// mosek.fusion.ExprConst.ctor @ bld/docker-win/final/default/src/fusion/ExprConst.monty:28:6-35:7
mosek::fusion::ExprConst::t mosek::fusion::p_ExprConst::_new_ExprConst
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4886_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4887_sparsity,
    double _4888_bfix)
{ return new mosek::fusion::ExprConst(_4886_shape,_4887_sparsity,_4888_bfix); }
mosek::fusion::ExprConst::ExprConst
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4886_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4887_sparsity,
    double _4888_bfix) : 
   ExprConst(new mosek::fusion::p_ExprConst(this))
{ mosek::fusion::p_ExprConst::_get_impl(this)->_initialize(_4886_shape,_4887_sparsity,_4888_bfix); }
void mosek::fusion::p_ExprConst::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _4886_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4887_sparsity,
    double _4888_bfix)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__4886_shape(_4886_shape ? _4886_shape->raw() : nullptr, _4886_shape ? _4886_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__4887_sparsity(_4887_sparsity ? _4887_sparsity->raw() : nullptr, _4887_sparsity ? _4887_sparsity->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(_4886_shape);
    int64_t _11415_;
    bool _11416_ = (NULL == _4887_sparsity.get());
    if (_11416_)
    {
      _11415_ = ::mosek::fusion::p_Set::size(_4886_shape);
    }
    else
    {
      _11415_ = (int)((_4887_sparsity)->size(0));
    }
    int64_t _4889_n = _11415_;
    std::vector<double> _11417_;
    for (int64_t _4890_i = (int)0, _11418_ = _4889_n; _4890_i < _11418_ ; ++_4890_i)
    {
      _11417_.push_back(_4888_bfix);
    }
    auto _11419_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_11417_.size()),_11417_.begin(),_11417_.end()));
    mosek::fusion::p_ExprConst::_get_impl(::mosek::fusion::ExprConst::t(_pubthis))->bfix = _11419_;
    std::shared_ptr< monty::ndarray< int64_t,1 > > _11420_;
    bool _11421_ = (NULL != _4887_sparsity.get());
    if (_11421_)
    {
      _11420_ = ::mosek::fusion::Utils::Tools::arraycopy(_4887_sparsity);
    }
    else
    {
      _11420_ = nullptr;
    }
    mosek::fusion::p_ExprConst::_get_impl(::mosek::fusion::ExprConst::t(_pubthis))->sparsity = _11420_;
    ::mosek::fusion::p_ExprConst::validate(_4886_shape,mosek::fusion::p_ExprConst::_get_impl(::mosek::fusion::ExprConst::t(_pubthis))->bfix,_4887_sparsity);
  }
}
// mosek.fusion.ExprConst.ctor

// Begin mosek.fusion.ExprConst.eval
// Method mosek.fusion.ExprConst.eval @ bld/docker-win/final/default/src/fusion/ExprConst.monty:44:6-79:7
void mosek::fusion::ExprConst :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4891_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4892_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4893_xs) { mosek::fusion::p_ExprConst::_get_impl(this)->eval(_4891_rs,_4892_ws,_4893_xs); }
void mosek::fusion::p_ExprConst::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4891_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4892_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4893_xs)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4894_shape = _pubthis->getShape();
  _checked_ptr_1<int32_t> _ptr__4894_shape(_4894_shape ? _4894_shape->raw() : nullptr,_4894_shape ? _4894_shape->size(0) : 0);
  int32_t _4895_nd = (int)((_4894_shape)->size(0));
  int32_t _4896_nnz = (int)0;
  int32_t _11422_ = (int)0;
  int32_t _11423_ = (int)((bfix)->size(0));
  for (int32_t _4897_i = _11422_; _4897_i < _11423_; ++_4897_i)
  {
    {
      if ((!((((*bfix)(_4897_i)) <= 0.0) && (((*bfix)(_4897_i)) >= 0.0))))
      {
        {
          ++ _4896_nnz;
        }
      }
      {}
    }
  }
  int32_t _4898_nelem = (int)((bfix)->size(0));
  bool _4899_hassp = ((NULL != sparsity.get()) && ((int)((sparsity)->size(0)) < ::mosek::fusion::p_Set::size(_4894_shape)));
  _4891_rs->alloc_expr(_4895_nd,_4898_nelem,_4896_nnz,_4899_hassp,(int)0);
  int32_t _4900_rshape = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->shape_base;
  int32_t _4901_rptr = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->ptr_base;
  int32_t _4902_rsp = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->sp_base;
  int32_t _4903_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->nidxs_base;
  int32_t _4904_rcof = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->cof_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4905_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__4905_ri32(_4905_ri32 ? _4905_ri32->raw() : nullptr,_4905_ri32 ? _4905_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4906_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__4906_ri64(_4906_ri64 ? _4906_ri64->raw() : nullptr,_4906_ri64 ? _4906_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4907_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4891_rs)->f64;
  _checked_ptr_1<double> _ptr__4907_rf64(_4907_rf64 ? _4907_rf64->raw() : nullptr,_4907_rf64 ? _4907_rf64->size(0) : 0);
  int32_t _11424_ = (int)0;
  int32_t _11425_ = _4895_nd;
  for (int32_t _4908_i = _11424_; _4908_i < _11425_; ++_4908_i)
  {
    {
      _ptr__4905_ri32[safe_add( _4900_rshape,_4908_i )] = _ptr__4894_shape[_4908_i];
    }
  }
  int32_t _4909_nzi = (int)0;
  _ptr__4905_ri32[_4901_rptr] = (int)0;
  if (_4899_hassp)
  {
    {
      int32_t _11426_ = (int)0;
      int32_t _11427_ = _4898_nelem;
      for (int32_t _4910_i = _11426_; _4910_i < _11427_; ++_4910_i)
      {
        {
          _ptr__4906_ri64[safe_add( _4902_rsp,_4910_i )] = ((*sparsity)(_4910_i));
        }
      }
    }
  }
  {}
  int32_t _11428_ = (int)0;
  int32_t _11429_ = _4898_nelem;
  for (int32_t _4911_i = _11428_; _4911_i < _11429_; ++_4911_i)
  {
    {
      if ((!((((*bfix)(_4911_i)) <= 0.0) && (((*bfix)(_4911_i)) >= 0.0))))
      {
        {
          _ptr__4906_ri64[safe_add( _4903_rnidxs,_4909_nzi )] = (int)0;
          _ptr__4907_rf64[safe_add( _4904_rcof,_4909_nzi )] = ((*bfix)(_4911_i));
          ++ _4909_nzi;
        }
      }
      {}
      _ptr__4905_ri32[safe_add( safe_add( _4901_rptr,_4911_i ),(int)1 )] = _4909_nzi;
    }
  }
}
// End mosek.fusion.ExprConst.eval

// Begin mosek.fusion.ExprConst.validate
// Method mosek.fusion.ExprConst.validate @ bld/docker-win/final/default/src/fusion/ExprConst.monty:10:6-26:7
void mosek::fusion::p_ExprConst::validate(std::shared_ptr< monty::ndarray< int32_t,1 > > _4912_shape,std::shared_ptr< monty::ndarray< double,1 > > _4913_bfix,std::shared_ptr< monty::ndarray< int64_t,1 > > _4914_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__4912_shape(_4912_shape ? _4912_shape->raw() : nullptr, _4912_shape ? _4912_shape->size(0) : 0);
  _checked_ptr_1<double> _ptr__4913_bfix(_4913_bfix ? _4913_bfix->raw() : nullptr, _4913_bfix ? _4913_bfix->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__4914_sparsity(_4914_sparsity ? _4914_sparsity->raw() : nullptr, _4914_sparsity ? _4914_sparsity->size(0) : 0);
  int64_t _4915_sz = ::mosek::fusion::p_Set::size(_4912_shape);
  if ((NULL != _4914_sparsity.get()))
  {
    {
      if (((int)((_4914_sparsity)->size(0)) != (int)((_4913_bfix)->size(0))))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Mismatching data lengths"));
        }
      }
      {}
      bool _4916_err = false;
      int32_t _11430_ = (int)0;
      int32_t _11431_ = (int)((_4914_sparsity)->size(0));
      for (int32_t _4917_i = _11430_; _4917_i < _11431_; ++_4917_i)
      {
        {
          if (((_ptr__4914_sparsity[_4917_i] < (int)0) || (_ptr__4914_sparsity[_4917_i] >= _4915_sz)))
          {
            {
              _4916_err = true;
            }
          }
          {}
        }
      }
      if (_4916_err)
      {
        {
          throw ::mosek::fusion::IndexError(std::string ("Invalid sparsity index"));
        }
      }
      {}
    }
  }
  else
  {
    {
      if (((int)((_4913_bfix)->size(0)) != _4915_sz))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Mismatching data length"));
        }
      }
      {}
    }
  }
}
// End mosek.fusion.ExprConst.validate

// Begin mosek.fusion.ExprConst.toString
// Method mosek.fusion.ExprConst.toString @ bld/docker-win/final/default/src/fusion/ExprConst.monty:8:6-63
std::string mosek::fusion::ExprConst :: toString() { return mosek::fusion::p_ExprConst::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprConst::toString()
{
  return std::string ("ExprConst()");
}
// End mosek.fusion.ExprConst.toString

void mosek::fusion::p_ExprConst::destroy()
{
  sparsity.reset();
  bfix.reset();
}
void mosek::fusion::ExprConst::destroy() { mosek::fusion::p_ExprConst::_get_impl(this)->destroy(); }
// } class ExprConst
// class ExprPick { // @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:187:4-390:5
mosek::fusion::ExprPick::ExprPick(mosek::fusion::p_ExprPick *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprPick()" << this << std::endl; */ }
mosek::fusion::ExprPick::~ExprPick() {  /* std::cout << "~ExprPick()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprPick::p_ExprPick
  (::mosek::fusion::ExprPick * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprPick.ctor @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:210:6-239:7
mosek::fusion::ExprPick::t mosek::fusion::p_ExprPick::_new_ExprPick
  (monty::rc_ptr< ::mosek::fusion::Expression > _4918_expr,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _4919_idxs)
{ return new mosek::fusion::ExprPick(_4918_expr,_4919_idxs); }
mosek::fusion::ExprPick::ExprPick
  (monty::rc_ptr< ::mosek::fusion::Expression > _4918_expr,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _4919_idxs) : 
   ExprPick(new mosek::fusion::p_ExprPick(this))
{ mosek::fusion::p_ExprPick::_get_impl(this)->_initialize(_4918_expr,_4919_idxs); }
void mosek::fusion::p_ExprPick::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _4918_expr,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _4919_idxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_4919_idxs)->size(0)))}));
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4920_shape = _4918_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__4920_shape(_4920_shape ? _4920_shape->raw() : nullptr,_4920_shape ? _4920_shape->size(0) : 0);
    int32_t _4921_nd = (int)((_4920_shape)->size(0));
    mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->expr = _4918_expr;
    mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_4919_idxs)->size(0)))));
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4922_this_idxs = mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->idxs;
    _checked_ptr_1<int64_t> _ptr__4922_this_idxs(_4922_this_idxs ? _4922_this_idxs->raw() : nullptr,_4922_this_idxs ? _4922_this_idxs->size(0) : 0);
    if (((int)((_4919_idxs)->size(1)) != _4921_nd))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching shape and index dimensions"));
      }
    }
    {}
    bool _4923_wrongindex = false;
    int32_t _11432_ = (int)0;
    int32_t _11433_ = (int)((_4919_idxs)->size(0));
    for (int32_t _4924_i = _11432_; _4924_i < _11433_; ++_4924_i)
    {
      {
        int32_t _11434_ = (int)0;
        int32_t _11435_ = _4921_nd;
        for (int32_t _4925_j = _11434_; _4925_j < _11435_; ++_4925_j)
        {
          {
            if (((((*_4919_idxs)(_4924_i,_4925_j)) < (int)0) || (((*_4919_idxs)(_4924_i,_4925_j)) >= _ptr__4920_shape[_4925_j])))
            {
              {
                _4923_wrongindex = true;
              }
            }
            {}
          }
        }
      }
    }
    if (_4923_wrongindex)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Pick index out of bounds"));
      }
    }
    {}
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4926_st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_4921_nd)));
      _checked_ptr_1<int64_t> _ptr__4926_st(_4926_st ? _4926_st->raw() : nullptr,_4926_st ? _4926_st->size(0) : 0);
      _ptr__4926_st[(_4921_nd - (int)1)] = (int)1;
      int32_t _11436_ = (int)1;
      int32_t _11437_ = _4921_nd;
      for (int32_t _4927_i = _11436_; _4927_i < _11437_; ++_4927_i)
      {
        {
          _ptr__4926_st[((_4921_nd - _4927_i) - (int)1)] = safe_mul( _ptr__4926_st[(_4921_nd - _4927_i)],_ptr__4920_shape[(_4921_nd - _4927_i)] );
        }
      }
      int32_t _11438_ = (int)0;
      int32_t _11439_ = (int)((_4919_idxs)->size(0));
      for (int32_t _4928_i = _11438_; _4928_i < _11439_; ++_4928_i)
      {
        {
          int64_t _4929_ii = (int64_t)0;
          int32_t _11440_ = (int)0;
          int32_t _11441_ = _4921_nd;
          for (int32_t _4930_j = _11440_; _4930_j < _11441_; ++_4930_j)
          {
            {
              _4929_ii += safe_mul( _ptr__4926_st[_4930_j],((*_4919_idxs)(_4928_i,_4930_j)) );
            }
          }
          _ptr__4922_this_idxs[_4928_i] = _4929_ii;
        }
      }
    }
  }
}
// mosek.fusion.ExprPick.ctor

// mosek.fusion.ExprPick.ctor @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:191:6-206:7
mosek::fusion::ExprPick::t mosek::fusion::p_ExprPick::_new_ExprPick
  (monty::rc_ptr< ::mosek::fusion::Expression > _4931_expr,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4932_idxs)
{ return new mosek::fusion::ExprPick(_4931_expr,_4932_idxs); }
mosek::fusion::ExprPick::ExprPick
  (monty::rc_ptr< ::mosek::fusion::Expression > _4931_expr,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4932_idxs) : 
   ExprPick(new mosek::fusion::p_ExprPick(this))
{ mosek::fusion::p_ExprPick::_get_impl(this)->_initialize(_4931_expr,_4932_idxs); }
void mosek::fusion::p_ExprPick::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _4931_expr,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _4932_idxs)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int64_t> _ptr__4932_idxs(_4932_idxs ? _4932_idxs->raw() : nullptr, _4932_idxs ? _4932_idxs->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_4932_idxs)->size(0)))}));
    mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->expr = _4931_expr;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _4933_shape = _4931_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__4933_shape(_4933_shape ? _4933_shape->raw() : nullptr,_4933_shape ? _4933_shape->size(0) : 0);
    int64_t _4934_size = ::mosek::fusion::p_Set::size(_4933_shape);
    bool _4935_wrongindex = false;
    int32_t _11442_ = (int)0;
    int32_t _11443_ = (int)((_4932_idxs)->size(0));
    for (int32_t _4936_i = _11442_; _4936_i < _11443_; ++_4936_i)
    {
      {
        if (((_ptr__4932_idxs[_4936_i] < (int)0) || (_ptr__4932_idxs[_4936_i] >= _4934_size)))
        {
          {
            _4935_wrongindex = true;
          }
        }
        {}
      }
    }
    if (_4935_wrongindex)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Pick index out of bounds"));
      }
    }
    {}
    mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->idxs = ::mosek::fusion::Utils::Tools::arraycopy(_4932_idxs);
  }
}
// mosek.fusion.ExprPick.ctor

// Begin mosek.fusion.ExprPick.eval
// Method mosek.fusion.ExprPick.eval @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:241:6-389:7
void mosek::fusion::ExprPick :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4937_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4938_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4939_xs) { mosek::fusion::p_ExprPick::_get_impl(this)->eval(_4937_rs,_4938_ws,_4939_xs); }
void mosek::fusion::p_ExprPick::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _4937_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _4938_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _4939_xs)
{
  expr->eval(_4938_ws,_4937_rs,_4939_xs);
  _4938_ws->pop_expr();
  int32_t _4940_nd = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->nd;
  int32_t _4941_shape = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->shape_base;
  int32_t _4942_nelem = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->nelem;
  int32_t _4943_nnz = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->nnz;
  int32_t _4944_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->ncodeatom;
  bool _4945_hassp = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->hassp;
  int32_t _4946_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->ptr_base;
  int32_t _4947_sp_base = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->sp_base;
  int32_t _4948_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->nidxs_base;
  int32_t _4949_cof_base = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->cof_base;
  int32_t _4950_code = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->code_base;
  int32_t _4951_codeptr = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->codeptr_base;
  int32_t _4952_cconst = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _4953_wi32 = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__4953_wi32(_4953_wi32 ? _4953_wi32->raw() : nullptr,_4953_wi32 ? _4953_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4954_wi64 = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__4954_wi64(_4954_wi64 ? _4954_wi64->raw() : nullptr,_4954_wi64 ? _4954_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _4955_wf64 = mosek::fusion::p_WorkStack::_get_impl(_4938_ws)->f64;
  _checked_ptr_1<double> _ptr__4955_wf64(_4955_wf64 ? _4955_wf64->raw() : nullptr,_4955_wf64 ? _4955_wf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _4956_idxs = mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->idxs;
  _checked_ptr_1<int64_t> _ptr__4956_idxs(_4956_idxs ? _4956_idxs->raw() : nullptr,_4956_idxs ? _4956_idxs->size(0) : 0);
  if ((!_4945_hassp))
  {
    {
      int32_t _4957_rnelem = (int)((_4956_idxs)->size(0));
      int32_t _4958_rnd = (int)1;
      int32_t _4959_rnnz = (int)0;
      int32_t _4960_rncodeatom = (int)0;
      int32_t _11444_ = (int)0;
      int32_t _11445_ = (int)((_4956_idxs)->size(0));
      for (int32_t _4961_i = _11444_; _4961_i < _11445_; ++_4961_i)
      {
        {
          _4959_rnnz += (_ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_ptr__4956_idxs[_4961_i] ),(int)1 )] - _ptr__4953_wi32[safe_add( _4946_ptr_base,_ptr__4956_idxs[_4961_i] )]);
          if ((_4944_ncodeatom > (int)0))
          {
            {
              _4960_rncodeatom += (_ptr__4953_wi32[safe_add( _4951_codeptr,_ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_ptr__4956_idxs[_4961_i] ),(int)1 )] )] - _ptr__4953_wi32[safe_add( _4951_codeptr,_ptr__4953_wi32[safe_add( _4946_ptr_base,_ptr__4956_idxs[_4961_i] )] )]);
            }
          }
          {}
        }
      }
      _4937_rs->alloc_expr(_4958_rnd,_4957_rnelem,_4959_rnnz,false,_4960_rncodeatom);
      int32_t _4962_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->cof_base;
      int32_t _4963_rnidxs_base = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->nidxs_base;
      int32_t _4964_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->ptr_base;
      int32_t _4965_rshape_base = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->shape_base;
      int32_t _4966_rcode = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->code_base;
      int32_t _4967_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->codeptr_base;
      int32_t _4968_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->cconst_base;
      {
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4969_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4969_ri32(_4969_ri32 ? _4969_ri32->raw() : nullptr,_4969_ri32 ? _4969_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4970_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4970_ri64(_4970_ri64 ? _4970_ri64->raw() : nullptr,_4970_ri64 ? _4970_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4971_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->f64;
      _checked_ptr_1<double> _ptr__4971_rf64(_4971_rf64 ? _4971_rf64->raw() : nullptr,_4971_rf64 ? _4971_rf64->size(0) : 0);
      _ptr__4969_ri32[_4965_rshape_base] = (int)((_4956_idxs)->size(0));
      int32_t _4972_codei = (int)0;
      int32_t _4973_knz = (int)0;
      _ptr__4969_ri32[_4964_rptr_base] = (int)0;
      if ((_4960_rncodeatom > (int)0))
      {
        {
          _ptr__4969_ri32[_4967_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _11446_ = (int)0;
      int32_t _11447_ = (int)((_4956_idxs)->size(0));
      for (int32_t _4974_i = _11446_; _4974_i < _11447_; ++_4974_i)
      {
        {
          int32_t _11448_ = _ptr__4953_wi32[safe_add( _4946_ptr_base,_ptr__4956_idxs[_4974_i] )];
          int32_t _11449_ = _ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_ptr__4956_idxs[_4974_i] ),(int)1 )];
          for (int32_t _4975_j = _11448_; _4975_j < _11449_; ++_4975_j)
          {
            {
              _ptr__4970_ri64[safe_add( _4963_rnidxs_base,_4973_knz )] = _ptr__4954_wi64[safe_add( _4948_nidxs_base,_4975_j )];
              _ptr__4971_rf64[safe_add( _4962_rcof_base,_4973_knz )] = _ptr__4955_wf64[safe_add( _4949_cof_base,_4975_j )];
              if ((_4960_rncodeatom > (int)0))
              {
                {
                  int32_t _11450_ = _ptr__4953_wi32[safe_add( _4951_codeptr,_4975_j )];
                  int32_t _11451_ = _ptr__4953_wi32[safe_add( safe_add( _4951_codeptr,_4975_j ),(int)1 )];
                  for (int32_t _4976_k = _11450_; _4976_k < _11451_; ++_4976_k)
                  {
                    {
                      _ptr__4969_ri32[safe_add( _4966_rcode,_4972_codei )] = _ptr__4953_wi32[safe_add( _4950_code,_4976_k )];
                      _ptr__4971_rf64[safe_add( _4968_rcconst,_4972_codei )] = _ptr__4955_wf64[safe_add( _4952_cconst,_4976_k )];
                      ++ _4972_codei;
                    }
                  }
                  _ptr__4969_ri32[safe_add( safe_add( _4967_rcodeptr,_4973_knz ),(int)1 )] = _4972_codei;
                }
              }
              {}
              ++ _4973_knz;
            }
          }
          _ptr__4969_ri32[safe_add( safe_add( _4964_rptr_base,_4974_i ),(int)1 )] = _4973_knz;
        }
      }
    }
  }
  else
  {
    {
      int32_t _4977_rnd = (int)1;
      int32_t _4978_rnelem = (int)((_4956_idxs)->size(0));
      int32_t _4979_rnnz = (int)0;
      int32_t _4980_rncodeatom = (int)0;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4981_idxs = mosek::fusion::p_ExprPick::_get_impl(::mosek::fusion::ExprPick::t(_pubthis))->idxs;
      _checked_ptr_1<int64_t> _ptr__4981_idxs(_4981_idxs ? _4981_idxs->raw() : nullptr,_4981_idxs ? _4981_idxs->size(0) : 0);
      int32_t _4982_tidxs = _4939_xs->alloci32((int)((_4981_idxs)->size(0)));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4983_xi32 = mosek::fusion::p_WorkStack::_get_impl(_4939_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__4983_xi32(_4983_xi32 ? _4983_xi32->raw() : nullptr,_4983_xi32 ? _4983_xi32->size(0) : 0);
      int32_t _11452_ = (int)0;
      int32_t _11453_ = (int)((_4981_idxs)->size(0));
      for (int32_t _4984_i = _11452_; _4984_i < _11453_; ++_4984_i)
      {
        {
          int32_t _4985_b1 = _4942_nelem;
          int32_t _4986_b0 = (int)0;
          while ( (_4986_b0 < _4985_b1) )
          {
            {
              int32_t _4987_pi = (safe_add( _4985_b1,_4986_b0 ) / (int)2);
              if ((_ptr__4954_wi64[safe_add( _4947_sp_base,_4987_pi )] >= _ptr__4981_idxs[_4984_i]))
              {
                {
                  _4985_b1 = _4987_pi;
                }
              }
              else
              {
                {
                  _4986_b0 = safe_add( _4987_pi,(int)1 );
                }
              }
            }
          }
          if (((_4986_b0 < _4942_nelem) && (_ptr__4954_wi64[safe_add( _4947_sp_base,_4986_b0 )] == _ptr__4981_idxs[_4984_i])))
          {
            {
              _ptr__4983_xi32[safe_add( _4982_tidxs,_4984_i )] = _4986_b0;
              _4979_rnnz += (_ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_4986_b0 ),(int)1 )] - _ptr__4953_wi32[safe_add( _4946_ptr_base,_4986_b0 )]);
              if ((_4944_ncodeatom > (int)0))
              {
                {
                  _4980_rncodeatom += (_ptr__4953_wi32[safe_add( _4951_codeptr,_ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_ptr__4981_idxs[_4984_i] ),(int)1 )] )] - _ptr__4953_wi32[safe_add( _4951_codeptr,_ptr__4953_wi32[safe_add( _4946_ptr_base,_ptr__4981_idxs[_4984_i] )] )]);
                }
              }
              {}
            }
          }
          else
          {
            {
              _ptr__4983_xi32[safe_add( _4982_tidxs,_4984_i )] = (-(int)1);
            }
          }
        }
      }
      _4937_rs->alloc_expr(_4977_rnd,_4978_rnelem,_4979_rnnz,false,_4980_rncodeatom);
      int32_t _4988_rptr = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->ptr_base;
      int32_t _4989_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->nidxs_base;
      int32_t _4990_rcof = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->cof_base;
      int32_t _4991_rshape = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->shape_base;
      int32_t _4992_rcode = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->code_base;
      int32_t _4993_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->codeptr_base;
      int32_t _4994_rcconst = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _4995_ri32 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__4995_ri32(_4995_ri32 ? _4995_ri32->raw() : nullptr,_4995_ri32 ? _4995_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _4996_ri64 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__4996_ri64(_4996_ri64 ? _4996_ri64->raw() : nullptr,_4996_ri64 ? _4996_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _4997_rf64 = mosek::fusion::p_WorkStack::_get_impl(_4937_rs)->f64;
      _checked_ptr_1<double> _ptr__4997_rf64(_4997_rf64 ? _4997_rf64->raw() : nullptr,_4997_rf64 ? _4997_rf64->size(0) : 0);
      _ptr__4995_ri32[_4991_rshape] = (int)((_4981_idxs)->size(0));
      _ptr__4995_ri32[_4988_rptr] = (int)0;
      if ((_4980_rncodeatom > (int)0))
      {
        {
          _ptr__4995_ri32[_4993_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _4998_codei = (int)0;
      int32_t _4999_k = (int)0;
      int32_t _11454_ = (int)0;
      int32_t _11455_ = (int)((_4981_idxs)->size(0));
      for (int32_t _5000_i = _11454_; _5000_i < _11455_; ++_5000_i)
      {
        {
          if ((_ptr__4983_xi32[safe_add( _4982_tidxs,_5000_i )] >= (int)0))
          {
            {
              int32_t _5001_b0 = _ptr__4983_xi32[safe_add( _4982_tidxs,_5000_i )];
              int32_t _11456_ = _ptr__4953_wi32[safe_add( _4946_ptr_base,_5001_b0 )];
              int32_t _11457_ = _ptr__4953_wi32[safe_add( safe_add( _4946_ptr_base,_5001_b0 ),(int)1 )];
              for (int32_t _5002_j = _11456_; _5002_j < _11457_; ++_5002_j)
              {
                {
                  _ptr__4996_ri64[safe_add( _4989_rnidxs,_4999_k )] = _ptr__4954_wi64[safe_add( _4948_nidxs_base,_5002_j )];
                  _ptr__4997_rf64[safe_add( _4990_rcof,_4999_k )] = _ptr__4955_wf64[safe_add( _4949_cof_base,_5002_j )];
                  if ((_4980_rncodeatom > (int)0))
                  {
                    {
                      int32_t _11458_ = _ptr__4953_wi32[safe_add( _4951_codeptr,_5002_j )];
                      int32_t _11459_ = _ptr__4953_wi32[safe_add( safe_add( _4951_codeptr,_5002_j ),(int)1 )];
                      for (int32_t _5003_l = _11458_; _5003_l < _11459_; ++_5003_l)
                      {
                        {
                          _ptr__4995_ri32[safe_add( _4992_rcode,_4998_codei )] = _ptr__4953_wi32[safe_add( _4950_code,_5003_l )];
                          _ptr__4997_rf64[safe_add( _4994_rcconst,_4998_codei )] = _ptr__4955_wf64[safe_add( _4952_cconst,_5003_l )];
                          ++ _4998_codei;
                        }
                      }
                      _ptr__4995_ri32[safe_add( safe_add( _4993_rcodeptr,_4999_k ),(int)1 )] = _4998_codei;
                    }
                  }
                  {}
                  ++ _4999_k;
                }
              }
            }
          }
          {}
          _ptr__4995_ri32[safe_add( safe_add( _4988_rptr,_5000_i ),(int)1 )] = _4999_k;
        }
      }
    }
  }
}
// End mosek.fusion.ExprPick.eval

// Begin mosek.fusion.ExprPick.toString
// Method mosek.fusion.ExprPick.toString @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:208:6-62
std::string mosek::fusion::ExprPick :: toString() { return mosek::fusion::p_ExprPick::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprPick::toString()
{
  return std::string ("ExprPick()");
}
// End mosek.fusion.ExprPick.toString

void mosek::fusion::p_ExprPick::destroy()
{
  idxs.reset();
  expr.reset();
}
void mosek::fusion::ExprPick::destroy() { mosek::fusion::p_ExprPick::_get_impl(this)->destroy(); }
// } class ExprPick
// class ExprSlice { // @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:4:4-183:5
mosek::fusion::ExprSlice::ExprSlice(mosek::fusion::p_ExprSlice *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprSlice()" << this << std::endl; */ }
mosek::fusion::ExprSlice::~ExprSlice() {  /* std::cout << "~ExprSlice()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprSlice::p_ExprSlice
  (::mosek::fusion::ExprSlice * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprSlice.ctor @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:28:6-34:7
mosek::fusion::ExprSlice::t mosek::fusion::p_ExprSlice::_new_ExprSlice
  (monty::rc_ptr< ::mosek::fusion::Expression > _5004_expr,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5005_first,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5006_last)
{ return new mosek::fusion::ExprSlice(_5004_expr,_5005_first,_5006_last); }
mosek::fusion::ExprSlice::ExprSlice
  (monty::rc_ptr< ::mosek::fusion::Expression > _5004_expr,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5005_first,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5006_last) : 
   ExprSlice(new mosek::fusion::p_ExprSlice(this))
{ mosek::fusion::p_ExprSlice::_get_impl(this)->_initialize(_5004_expr,_5005_first,_5006_last); }
void mosek::fusion::p_ExprSlice::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5004_expr,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5005_first,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5006_last)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5005_first(_5005_first ? _5005_first->raw() : nullptr, _5005_first ? _5005_first->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5006_last(_5006_last ? _5006_last->raw() : nullptr, _5006_last ? _5006_last->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprSlice::makeShape(_5004_expr->getShape(),_5005_first,_5006_last));
    mosek::fusion::p_ExprSlice::_get_impl(::mosek::fusion::ExprSlice::t(_pubthis))->expr = _5004_expr;
    mosek::fusion::p_ExprSlice::_get_impl(::mosek::fusion::ExprSlice::t(_pubthis))->first = _5005_first;
    mosek::fusion::p_ExprSlice::_get_impl(::mosek::fusion::ExprSlice::t(_pubthis))->last = _5006_last;
  }
}
// mosek.fusion.ExprSlice.ctor

// Begin mosek.fusion.ExprSlice.eval
// Method mosek.fusion.ExprSlice.eval @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:36:6-182:7
void mosek::fusion::ExprSlice :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5007_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5008_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5009_xs) { mosek::fusion::p_ExprSlice::_get_impl(this)->eval(_5007_rs,_5008_ws,_5009_xs); }
void mosek::fusion::p_ExprSlice::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5007_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5008_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5009_xs)
{
  expr->eval(_5008_ws,_5007_rs,_5009_xs);
  _5008_ws->pop_expr();
  int32_t _5010_nd = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->nd;
  int32_t _5011_nelem = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->nelem;
  int32_t _5012_nnz = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->nnz;
  int32_t _5013_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->ncodeatom;
  bool _5014_hassp = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->hassp;
  int32_t _5015_shape_base = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->shape_base;
  int32_t _5016_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->ptr_base;
  int32_t _5017_sp_base = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->sp_base;
  int32_t _5018_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->nidxs_base;
  int32_t _5019_cof_base = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->cof_base;
  int32_t _5020_code = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->code_base;
  int32_t _5021_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->codeptr_base;
  int32_t _5022_cconst = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5023_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5023_wi32(_5023_wi32 ? _5023_wi32->raw() : nullptr,_5023_wi32 ? _5023_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5024_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5024_wi64(_5024_wi64 ? _5024_wi64->raw() : nullptr,_5024_wi64 ? _5024_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5025_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5008_ws)->f64;
  _checked_ptr_1<double> _ptr__5025_wf64(_5025_wf64 ? _5025_wf64->raw() : nullptr,_5025_wf64 ? _5025_wf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5026_st = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5010_nd)));
  _checked_ptr_1<int64_t> _ptr__5026_st(_5026_st ? _5026_st->raw() : nullptr,_5026_st ? _5026_st->size(0) : 0);
  _ptr__5026_st[(_5010_nd - (int)1)] = (int)1;
  int32_t _11460_ = (int)1;
  int32_t _11461_ = _5010_nd;
  for (int32_t _5027_i = _11460_; _5027_i < _11461_; ++_5027_i)
  {
    {
      _ptr__5026_st[((_5010_nd - _5027_i) - (int)1)] = safe_mul( _ptr__5026_st[(_5010_nd - _5027_i)],_ptr__5023_wi32[(safe_add( _5015_shape_base,_5010_nd ) - _5027_i)] );
    }
  }
  int32_t _5028_rncodeatom = (int)0;
  int32_t _5029_rnelem = (int)0;
  int32_t _5030_rnnz = (int)0;
  if (_5014_hassp)
  {
    {
      int32_t _11462_ = (int)0;
      int32_t _11463_ = _5011_nelem;
      for (int32_t _5031_i = _11462_; _5031_i < _11463_; ++_5031_i)
      {
        {
          bool _5032_in_bounds = true;
          int32_t _11464_ = (int)0;
          int32_t _11465_ = _5010_nd;
          for (int32_t _5033_j = _11464_; _5033_j < _11465_; ++_5033_j)
          {
            {
              int64_t _5034_kj = ((_ptr__5024_wi64[safe_add( _5017_sp_base,_5031_i )] / _ptr__5026_st[_5033_j]) % _ptr__5023_wi32[safe_add( _5015_shape_base,_5033_j )]);
              _5032_in_bounds = (_5032_in_bounds && ((_5034_kj >= ((*first)(_5033_j))) && (_5034_kj < ((*last)(_5033_j)))));
            }
          }
          if (_5032_in_bounds)
          {
            {
              _5030_rnnz += (_ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5031_i ),(int)1 )] - _ptr__5023_wi32[safe_add( _5016_ptr_base,_5031_i )]);
              if ((_5013_ncodeatom > (int)0))
              {
                {
                  _5028_rncodeatom += (_ptr__5023_wi32[safe_add( _5021_codeptr,_ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5031_i ),(int)1 )] )] - _ptr__5023_wi32[safe_add( _5021_codeptr,_ptr__5023_wi32[safe_add( _5016_ptr_base,_5031_i )] )]);
                }
              }
              {}
              ++ _5029_rnelem;
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      _5029_rnelem = (int)1;
      int32_t _11466_ = (int)0;
      int32_t _11467_ = _5010_nd;
      for (int32_t _5035_i = _11466_; _5035_i < _11467_; ++_5035_i)
      {
        {
          _5029_rnelem *= (((*last)(_5035_i)) - ((*first)(_5035_i)));
        }
      }
      int32_t _11468_ = (int)0;
      int32_t _11469_ = _5011_nelem;
      for (int32_t _5036_i = _11468_; _5036_i < _11469_; ++_5036_i)
      {
        {
          bool _5037_in_bounds = true;
          int32_t _11470_ = (int)0;
          int32_t _11471_ = _5010_nd;
          for (int32_t _5038_j = _11470_; _5038_j < _11471_; ++_5038_j)
          {
            {
              int64_t _5039_kj = ((_5036_i / _ptr__5026_st[_5038_j]) % _ptr__5023_wi32[safe_add( _5015_shape_base,_5038_j )]);
              _5037_in_bounds = (_5037_in_bounds && ((_5039_kj >= ((*first)(_5038_j))) && (_5039_kj < ((*last)(_5038_j)))));
            }
          }
          if (_5037_in_bounds)
          {
            {
              _5030_rnnz += (_ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5036_i ),(int)1 )] - _ptr__5023_wi32[safe_add( _5016_ptr_base,_5036_i )]);
              if ((_5013_ncodeatom > (int)0))
              {
                {
                  _5028_rncodeatom += (_ptr__5023_wi32[safe_add( _5021_codeptr,_ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5036_i ),(int)1 )] )] - _ptr__5023_wi32[safe_add( _5021_codeptr,_ptr__5023_wi32[safe_add( _5016_ptr_base,_5036_i )] )]);
                }
              }
              {}
            }
          }
          {}
        }
      }
    }
  }
  std::vector<int32_t> _11472_;
  for (int32_t _5041_i = (int)0, _11473_ = _5010_nd; _5041_i < _11473_ ; ++_5041_i)
  {
    _11472_.push_back((((*last)(_5041_i)) - ((*first)(_5041_i))));
  }
  auto _11474_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11472_.size()),_11472_.begin(),_11472_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5040_rshape = _11474_;
  _checked_ptr_1<int32_t> _ptr__5040_rshape(_5040_rshape ? _5040_rshape->raw() : nullptr,_5040_rshape ? _5040_rshape->size(0) : 0);
  bool _5042_rhassp = (_5029_rnelem < ::mosek::fusion::p_Set::size(_5040_rshape));
  _5007_rs->alloc_expr(_5010_nd,_5029_rnelem,_5030_rnnz,_5042_rhassp,_5028_rncodeatom);
  int32_t _5043_rshape_base = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->shape_base;
  int32_t _5044_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->cof_base;
  int32_t _5045_rnidx_base = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->nidxs_base;
  int32_t _11475_;
  bool _11476_ = _5042_rhassp;
  if (_11476_)
  {
    _11475_ = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->sp_base;
  }
  else
  {
    _11475_ = _5007_rs->alloci64(_5029_rnelem);
  }
  int32_t _5046_rsp_base = _11475_;
  int32_t _5047_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->ptr_base;
  int32_t _5048_rcode = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->code_base;
  int32_t _5049_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->codeptr_base;
  int32_t _5050_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5051_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5051_ri32(_5051_ri32 ? _5051_ri32->raw() : nullptr,_5051_ri32 ? _5051_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5052_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5052_ri64(_5052_ri64 ? _5052_ri64->raw() : nullptr,_5052_ri64 ? _5052_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5053_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5007_rs)->f64;
  _checked_ptr_1<double> _ptr__5053_rf64(_5053_rf64 ? _5053_rf64->raw() : nullptr,_5053_rf64 ? _5053_rf64->size(0) : 0);
  int32_t _11477_ = (int)0;
  int32_t _11478_ = _5010_nd;
  for (int32_t _5054_i = _11477_; _5054_i < _11478_; ++_5054_i)
  {
    {
      _ptr__5051_ri32[safe_add( _5043_rshape_base,_5054_i )] = _ptr__5040_rshape[_5054_i];
    }
  }
  _ptr__5051_ri32[_5047_rptr_base] = (int)0;
  if ((_5028_rncodeatom > (int)0))
  {
    {
      _ptr__5051_ri32[_5049_rcodeptr] = (int)0;
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5055_rst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5010_nd)));
  _checked_ptr_1<int64_t> _ptr__5055_rst(_5055_rst ? _5055_rst->raw() : nullptr,_5055_rst ? _5055_rst->size(0) : 0);
  _ptr__5055_rst[(_5010_nd - (int)1)] = (int)1;
  int32_t _11479_ = (int)1;
  int32_t _11480_ = _5010_nd;
  for (int32_t _5056_j = _11479_; _5056_j < _11480_; ++_5056_j)
  {
    {
      _ptr__5055_rst[((_5010_nd - _5056_j) - (int)1)] = safe_mul( _ptr__5055_rst[(_5010_nd - _5056_j)],_ptr__5040_rshape[(_5010_nd - _5056_j)] );
    }
  }
  int32_t _5057_codei = (int)0;
  int32_t _5058_kelem = (int)0;
  int32_t _5059_knz = (int)0;
  if (_5014_hassp)
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5060_key = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5010_nd)));
      _checked_ptr_1<int32_t> _ptr__5060_key(_5060_key ? _5060_key->raw() : nullptr,_5060_key ? _5060_key->size(0) : 0);
      int32_t _11481_ = (int)0;
      int32_t _11482_ = _5011_nelem;
      for (int32_t _5061_i = _11481_; _5061_i < _11482_; ++_5061_i)
      {
        {
          bool _5062_in_bounds = true;
          int32_t _11483_ = (int)0;
          int32_t _11484_ = _5010_nd;
          for (int32_t _5063_j = _11483_; _5063_j < _11484_; ++_5063_j)
          {
            {
              _ptr__5060_key[_5063_j] = (int32_t)((_ptr__5024_wi64[safe_add( _5017_sp_base,_5061_i )] / _ptr__5026_st[_5063_j]) % _ptr__5023_wi32[safe_add( _5015_shape_base,_5063_j )]);
              _5062_in_bounds = (_5062_in_bounds && ((_ptr__5060_key[_5063_j] >= ((*first)(_5063_j))) && (_ptr__5060_key[_5063_j] < ((*last)(_5063_j)))));
            }
          }
          if (_5062_in_bounds)
          {
            {
              int32_t _11485_ = _ptr__5023_wi32[safe_add( _5016_ptr_base,_5061_i )];
              int32_t _11486_ = _ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5061_i ),(int)1 )];
              for (int32_t _5064_j = _11485_; _5064_j < _11486_; ++_5064_j)
              {
                {
                  _ptr__5052_ri64[safe_add( _5045_rnidx_base,_5059_knz )] = _ptr__5024_wi64[safe_add( _5018_nidxs_base,_5064_j )];
                  _ptr__5053_rf64[safe_add( _5044_rcof_base,_5059_knz )] = _ptr__5025_wf64[safe_add( _5019_cof_base,_5064_j )];
                  if ((_5028_rncodeatom > (int)0))
                  {
                    {
                      int32_t _11487_ = _ptr__5023_wi32[safe_add( _5021_codeptr,_5064_j )];
                      int32_t _11488_ = _ptr__5023_wi32[safe_add( safe_add( _5021_codeptr,_5064_j ),(int)1 )];
                      for (int32_t _5065_k = _11487_; _5065_k < _11488_; ++_5065_k)
                      {
                        {
                          _ptr__5051_ri32[safe_add( _5048_rcode,_5057_codei )] = _ptr__5023_wi32[safe_add( _5020_code,_5065_k )];
                          _ptr__5053_rf64[safe_add( _5050_rcconst,_5057_codei )] = _ptr__5025_wf64[safe_add( _5022_cconst,_5065_k )];
                          ++ _5057_codei;
                        }
                      }
                      _ptr__5051_ri32[safe_add( safe_add( _5049_rcodeptr,_5059_knz ),(int)1 )] = _5057_codei;
                    }
                  }
                  {}
                  ++ _5059_knz;
                }
              }
              int64_t _5066_newidx = (int64_t)0;
              int32_t _11489_ = (int)0;
              int32_t _11490_ = _5010_nd;
              for (int32_t _5067_j = _11489_; _5067_j < _11490_; ++_5067_j)
              {
                {
                  _5066_newidx += safe_mul( _ptr__5055_rst[_5067_j],(_ptr__5060_key[_5067_j] - ((*first)(_5067_j))) );
                }
              }
              _ptr__5052_ri64[safe_add( _5046_rsp_base,_5058_kelem )] = _5066_newidx;
              _ptr__5051_ri32[safe_add( safe_add( _5047_rptr_base,_5058_kelem ),(int)1 )] = _5059_knz;
              ++ _5058_kelem;
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      int32_t _11491_ = (int)0;
      int32_t _11492_ = _5011_nelem;
      for (int32_t _5068_i = _11491_; _5068_i < _11492_; ++_5068_i)
      {
        {
          bool _5069_in_bounds = true;
          int32_t _11493_ = (int)0;
          int32_t _11494_ = _5010_nd;
          for (int32_t _5070_j = _11493_; _5070_j < _11494_; ++_5070_j)
          {
            {
              int64_t _5071_kj = ((_5068_i / _ptr__5026_st[_5070_j]) % _ptr__5023_wi32[safe_add( _5015_shape_base,_5070_j )]);
              _5069_in_bounds = (_5069_in_bounds && ((_5071_kj >= ((*first)(_5070_j))) && (_5071_kj < ((*last)(_5070_j)))));
            }
          }
          if (_5069_in_bounds)
          {
            {
              int32_t _11495_ = _ptr__5023_wi32[safe_add( _5016_ptr_base,_5068_i )];
              int32_t _11496_ = _ptr__5023_wi32[safe_add( safe_add( _5016_ptr_base,_5068_i ),(int)1 )];
              for (int32_t _5072_j = _11495_; _5072_j < _11496_; ++_5072_j)
              {
                {
                  _ptr__5052_ri64[safe_add( _5045_rnidx_base,_5059_knz )] = _ptr__5024_wi64[safe_add( _5018_nidxs_base,_5072_j )];
                  _ptr__5053_rf64[safe_add( _5044_rcof_base,_5059_knz )] = _ptr__5025_wf64[safe_add( _5019_cof_base,_5072_j )];
                  if ((_5028_rncodeatom > (int)0))
                  {
                    {
                      int32_t _11497_ = _ptr__5023_wi32[safe_add( _5021_codeptr,_5072_j )];
                      int32_t _11498_ = _ptr__5023_wi32[safe_add( safe_add( _5021_codeptr,_5072_j ),(int)1 )];
                      for (int32_t _5073_k = _11497_; _5073_k < _11498_; ++_5073_k)
                      {
                        {
                          _ptr__5051_ri32[safe_add( _5048_rcode,_5057_codei )] = _ptr__5023_wi32[safe_add( _5020_code,_5073_k )];
                          _ptr__5053_rf64[safe_add( _5050_rcconst,_5057_codei )] = _ptr__5025_wf64[safe_add( _5022_cconst,_5073_k )];
                          ++ _5057_codei;
                        }
                      }
                      _ptr__5051_ri32[safe_add( safe_add( _5049_rcodeptr,_5059_knz ),(int)1 )] = _5057_codei;
                    }
                  }
                  {}
                  ++ _5059_knz;
                }
              }
              _ptr__5051_ri32[safe_add( safe_add( _5047_rptr_base,_5058_kelem ),(int)1 )] = _5059_knz;
              ++ _5058_kelem;
            }
          }
          {}
        }
      }
    }
  }
  if ((!_5042_rhassp))
  {
    {
      _5007_rs->popi64(_5029_rnelem);
    }
  }
  {}
}
// End mosek.fusion.ExprSlice.eval

// Begin mosek.fusion.ExprSlice.makeShape
// Method mosek.fusion.ExprSlice.makeShape @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:17:6-24:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprSlice::makeShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _5074_shape,std::shared_ptr< monty::ndarray< int32_t,1 > > _5075_first,std::shared_ptr< monty::ndarray< int32_t,1 > > _5076_last)
{
  _checked_ptr_1<int32_t> _ptr__5074_shape(_5074_shape ? _5074_shape->raw() : nullptr, _5074_shape ? _5074_shape->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5075_first(_5075_first ? _5075_first->raw() : nullptr, _5075_first ? _5075_first->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5076_last(_5076_last ? _5076_last->raw() : nullptr, _5076_last ? _5076_last->size(0) : 0);
  if ((((int)((_5074_shape)->size(0)) != (int)((_5075_first)->size(0))) || ((int)((_5074_shape)->size(0)) != (int)((_5076_last)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid or mismatching index lengths"));
    }
  }
  {}
  int32_t _11499_ = (int)0;
  int32_t _11500_ = (int)((_5074_shape)->size(0));
  for (int32_t _5077_i = _11499_; _5077_i < _11500_; ++_5077_i)
  {
    {
      if (((_ptr__5075_first[_5077_i] < (int)0) || ((_ptr__5076_last[_5077_i] < _ptr__5075_first[_5077_i]) || (_ptr__5076_last[_5077_i] > _ptr__5074_shape[_5077_i]))))
      {
        {
          throw ::mosek::fusion::IndexError(std::string ("Slice is out of bounds"));
        }
      }
      {}
    }
  }
  std::vector<int32_t> _11501_;
  for (int32_t _5078_i = (int)0, _11502_ = (int)((_5074_shape)->size(0)); _5078_i < _11502_ ; ++_5078_i)
  {
    _11501_.push_back((_ptr__5076_last[_5078_i] - _ptr__5075_first[_5078_i]));
  }
  auto _11503_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11501_.size()),_11501_.begin(),_11501_.end()));
  return _11503_;
}
// End mosek.fusion.ExprSlice.makeShape

// Begin mosek.fusion.ExprSlice.toString
// Method mosek.fusion.ExprSlice.toString @ bld/docker-win/final/default/src/fusion/ExprSlice.monty:9:6-15:7
std::string mosek::fusion::ExprSlice :: toString() { return mosek::fusion::p_ExprSlice::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprSlice::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _5079_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprSlice(["))->__mosek_2fusion_2Utils_2StringBuffer__a(((*first)((int)0)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (":"))->__mosek_2fusion_2Utils_2StringBuffer__a(((*last)((int)0)));
  int32_t _11504_ = (int)1;
  int32_t _11505_ = (int)((first)->size(0));
  for (int32_t _5080_i = _11504_; _5080_i < _11505_; ++_5080_i)
  {
    {
      _5079_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*first)(_5080_i)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (":"))->__mosek_2fusion_2Utils_2StringBuffer__a(((*last)(_5080_i)));
    }
  }
  _5079_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("],"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _5079_sb->toString();
}
// End mosek.fusion.ExprSlice.toString

void mosek::fusion::p_ExprSlice::destroy()
{
  last.reset();
  first.reset();
  expr.reset();
}
void mosek::fusion::ExprSlice::destroy() { mosek::fusion::p_ExprSlice::_get_impl(this)->destroy(); }
// } class ExprSlice
// class ExprPermuteDims { // @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:153:4-295:5
mosek::fusion::ExprPermuteDims::ExprPermuteDims(mosek::fusion::p_ExprPermuteDims *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprPermuteDims()" << this << std::endl; */ }
mosek::fusion::ExprPermuteDims::~ExprPermuteDims() {  /* std::cout << "~ExprPermuteDims()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprPermuteDims::p_ExprPermuteDims
  (::mosek::fusion::ExprPermuteDims * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprPermuteDims.ctor @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:167:6-184:7
mosek::fusion::ExprPermuteDims::t mosek::fusion::p_ExprPermuteDims::_new_ExprPermuteDims
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5081_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5082_expr)
{ return new mosek::fusion::ExprPermuteDims(_5081_perm,_5082_expr); }
mosek::fusion::ExprPermuteDims::ExprPermuteDims
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5081_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5082_expr) : 
   ExprPermuteDims(new mosek::fusion::p_ExprPermuteDims(this))
{ mosek::fusion::p_ExprPermuteDims::_get_impl(this)->_initialize(_5081_perm,_5082_expr); }
void mosek::fusion::p_ExprPermuteDims::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5081_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5082_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5081_perm(_5081_perm ? _5081_perm->raw() : nullptr, _5081_perm ? _5081_perm->size(0) : 0);
    mosek::fusion::p_ExprPermuteDims::_initialize(_5081_perm,_5082_expr,(int)1);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5083_shape = _5082_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__5083_shape(_5083_shape ? _5083_shape->raw() : nullptr,_5083_shape ? _5083_shape->size(0) : 0);
    if (((int)((_5081_perm)->size(0)) != (int)((_5083_shape)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Invalid dimension permutation"));
      }
    }
    {}
    std::vector<int32_t> _11506_;
    for (int32_t _5085_i = (int)0, _11507_ = (int)((_5081_perm)->size(0)); _5085_i < _11507_ ; ++_5085_i)
    {
      _11506_.push_back((int)0);
    }
    auto _11508_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11506_.size()),_11506_.begin(),_11506_.end()));
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5084_check = _11508_;
    _checked_ptr_1<int32_t> _ptr__5084_check(_5084_check ? _5084_check->raw() : nullptr,_5084_check ? _5084_check->size(0) : 0);
    int32_t _11509_ = (int)0;
    int32_t _11510_ = (int)((_5084_check)->size(0));
    for (int32_t _5086_i = _11509_; _5086_i < _11510_; ++_5086_i)
    {
      {
        if (((_ptr__5081_perm[_5086_i] < (int)0) || (_ptr__5081_perm[_5086_i] > (int)((_5083_shape)->size(0)))))
        {
          {
            throw ::mosek::fusion::LengthError(std::string ("Invalid dimension permutation"));
          }
        }
        {}
        ++ _ptr__5084_check[_ptr__5081_perm[_5086_i]];
      }
    }
    int32_t _11511_ = (int)0;
    int32_t _11512_ = (int)((_5084_check)->size(0));
    for (int32_t _5087_i = _11511_; _5087_i < _11512_; ++_5087_i)
    {
      {
        if (((_ptr__5084_check[_5087_i] < (int)1) || (_ptr__5084_check[_5087_i] > (int)1)))
        {
          {
            throw ::mosek::fusion::LengthError(std::string ("Invalid dimension permutation"));
          }
        }
        {}
      }
    }
  }
}
// mosek.fusion.ExprPermuteDims.ctor

// mosek.fusion.ExprPermuteDims.ctor @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:161:6-165:7
mosek::fusion::ExprPermuteDims::t mosek::fusion::p_ExprPermuteDims::_new_ExprPermuteDims
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5088_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5089_expr,
    int32_t _5090_validated)
{ return new mosek::fusion::ExprPermuteDims(_5088_perm,_5089_expr,_5090_validated); }
mosek::fusion::ExprPermuteDims::ExprPermuteDims
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5088_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5089_expr,
    int32_t _5090_validated) : 
   ExprPermuteDims(new mosek::fusion::p_ExprPermuteDims(this))
{ mosek::fusion::p_ExprPermuteDims::_get_impl(this)->_initialize(_5088_perm,_5089_expr,_5090_validated); }
void mosek::fusion::p_ExprPermuteDims::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _5088_perm,
    monty::rc_ptr< ::mosek::fusion::Expression > _5089_expr,
    int32_t _5090_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5088_perm(_5088_perm ? _5088_perm->raw() : nullptr, _5088_perm ? _5088_perm->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprPermuteDims::computeshape(_5088_perm,_5089_expr->getShape()));
    mosek::fusion::p_ExprPermuteDims::_get_impl(::mosek::fusion::ExprPermuteDims::t(_pubthis))->expr = _5089_expr;
    dperm = ::mosek::fusion::Utils::Tools::arraycopy(_5088_perm);
  }
}
// mosek.fusion.ExprPermuteDims.ctor

// Begin mosek.fusion.ExprPermuteDims.eval
// Method mosek.fusion.ExprPermuteDims.eval @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:186:6-294:7
void mosek::fusion::ExprPermuteDims :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5091_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5092_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5093_xs) { mosek::fusion::p_ExprPermuteDims::_get_impl(this)->eval(_5091_rs,_5092_ws,_5093_xs); }
void mosek::fusion::p_ExprPermuteDims::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5091_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5092_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5093_xs)
{
  expr->eval(_5092_ws,_5091_rs,_5093_xs);
  _5092_ws->pop_expr();
  int32_t _5094_nd = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->nd;
  int32_t _5095_nelem = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->nelem;
  int32_t _5096_nnz = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->nnz;
  int32_t _5097_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->ncodeatom;
  bool _5098_hassp = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->hassp;
  int32_t _5099_shape_base = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->shape_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5100_stride = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5094_nd)));
  _checked_ptr_1<int64_t> _ptr__5100_stride(_5100_stride ? _5100_stride->raw() : nullptr,_5100_stride ? _5100_stride->size(0) : 0);
  _ptr__5100_stride[(_5094_nd - (int)1)] = (int)1;
  int32_t _11513_ = (int)1;
  int32_t _11514_ = _5094_nd;
  for (int32_t _5101_i = _11513_; _5101_i < _11514_; ++_5101_i)
  {
    {
      _ptr__5100_stride[((_5094_nd - _5101_i) - (int)1)] = safe_mul( _ptr__5100_stride[(_5094_nd - _5101_i)],((*mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->i32)((safe_add( _5099_shape_base,_5094_nd ) - _5101_i))) );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5102_dstride = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5094_nd)));
  _checked_ptr_1<int32_t> _ptr__5102_dstride(_5102_dstride ? _5102_dstride->raw() : nullptr,_5102_dstride ? _5102_dstride->size(0) : 0);
  _ptr__5102_dstride[(_5094_nd - (int)1)] = (int)1;
  int32_t _11515_ = (int)1;
  int32_t _11516_ = _5094_nd;
  for (int32_t _5103_i = _11515_; _5103_i < _11516_; ++_5103_i)
  {
    {
      _ptr__5102_dstride[((_5094_nd - _5103_i) - (int)1)] = safe_mul( _ptr__5102_dstride[(_5094_nd - _5103_i)],((*mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->i32)(safe_add( _5099_shape_base,((*dperm)((_5094_nd - _5103_i))) ))) );
    }
  }
  int32_t _5104_eptr_base = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->ptr_base;
  int32_t _5105_esp_base = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->sp_base;
  int32_t _5106_enidxs_base = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->nidxs_base;
  int32_t _5107_ecof_base = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->cof_base;
  int32_t _5108_code = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->code_base;
  int32_t _5109_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->codeptr_base;
  int32_t _5110_cconst = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5111_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5111_wi32(_5111_wi32 ? _5111_wi32->raw() : nullptr,_5111_wi32 ? _5111_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5112_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5112_wi64(_5112_wi64 ? _5112_wi64->raw() : nullptr,_5112_wi64 ? _5112_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5113_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5092_ws)->f64;
  _checked_ptr_1<double> _ptr__5113_wf64(_5113_wf64 ? _5113_wf64->raw() : nullptr,_5113_wf64 ? _5113_wf64->size(0) : 0);
  _5091_rs->alloc_expr(_5094_nd,_5095_nelem,_5096_nnz,_5098_hassp,_5097_ncodeatom);
  int32_t _5114_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->ptr_base;
  int32_t _5115_rshape = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->shape_base;
  int32_t _5116_rnidxs_base = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->nidxs_base;
  int32_t _5117_rsp_base = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->sp_base;
  int32_t _5118_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->cof_base;
  int32_t _5119_rcode = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->code_base;
  int32_t _5120_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->codeptr_base;
  int32_t _5121_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5122_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5122_ri32(_5122_ri32 ? _5122_ri32->raw() : nullptr,_5122_ri32 ? _5122_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5123_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5123_ri64(_5123_ri64 ? _5123_ri64->raw() : nullptr,_5123_ri64 ? _5123_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5124_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5091_rs)->f64;
  _checked_ptr_1<double> _ptr__5124_rf64(_5124_rf64 ? _5124_rf64->raw() : nullptr,_5124_rf64 ? _5124_rf64->size(0) : 0);
  int32_t _11517_ = (int)0;
  int32_t _11518_ = _5094_nd;
  for (int32_t _5125_i = _11517_; _5125_i < _11518_; ++_5125_i)
  {
    {
      _ptr__5122_ri32[safe_add( _5115_rshape,_5125_i )] = _ptr__5111_wi32[safe_add( _5099_shape_base,((*dperm)(_5125_i)) )];
    }
  }
  if (_5098_hassp)
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5126_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5095_nelem)));
      _checked_ptr_1<int64_t> _ptr__5126_sp(_5126_sp ? _5126_sp->raw() : nullptr,_5126_sp ? _5126_sp->size(0) : 0);
      {
        int32_t _11519_ = (int)0;
        int32_t _11520_ = _5095_nelem;
        for (int32_t _5127_i = _11519_; _5127_i < _11520_; ++_5127_i)
        {
          {
            int64_t _5128_p = (int64_t)0;
            int32_t _11521_ = (int)0;
            int32_t _11522_ = _5094_nd;
            for (int32_t _5129_j = _11521_; _5129_j < _11522_; ++_5129_j)
            {
              {
                _5128_p += safe_mul( ((_ptr__5112_wi64[safe_add( _5105_esp_base,_5127_i )] / _ptr__5100_stride[_5129_j]) % _ptr__5111_wi32[safe_add( _5099_shape_base,_5129_j )]),_ptr__5102_dstride[((*dperm)(_5129_j))] );
              }
            }
            _ptr__5126_sp[_5127_i] = _5128_p;
          }
        }
      }
      std::vector<int64_t> _11523_;
      for (int32_t _5131_i = (int)0, _11524_ = _5095_nelem; _5131_i < _11524_ ; ++_5131_i)
      {
        _11523_.push_back(_5131_i);
      }
      auto _11525_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_11523_.size()),_11523_.begin(),_11523_.end()));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5130_perm = _11525_;
      _checked_ptr_1<int64_t> _ptr__5130_perm(_5130_perm ? _5130_perm->raw() : nullptr,_5130_perm ? _5130_perm->size(0) : 0);
      ::mosek::fusion::p_CommonTools::argQsort(_5130_perm,_5126_sp,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)((int)0),(int64_t)(_5095_nelem));
      _ptr__5122_ri32[_5114_rptr_base] = (int)0;
      if ((_5097_ncodeatom > (int)0))
      {
        {
          _ptr__5122_ri32[_5120_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _5132_codei = (int)0;
      int32_t _5133_kelem = (int)0;
      int32_t _5134_knz = (int)0;
      int32_t _11526_ = (int)0;
      int32_t _11527_ = _5095_nelem;
      for (int32_t _5135_i = _11526_; _5135_i < _11527_; ++_5135_i)
      {
        {
          int64_t _5136_ii = _ptr__5130_perm[_5135_i];
          int32_t _11528_ = _ptr__5111_wi32[safe_add( _5104_eptr_base,_5136_ii )];
          int32_t _11529_ = _ptr__5111_wi32[safe_add( safe_add( _5104_eptr_base,_5136_ii ),(int)1 )];
          for (int32_t _5137_j = _11528_; _5137_j < _11529_; ++_5137_j)
          {
            {
              _ptr__5123_ri64[safe_add( _5116_rnidxs_base,_5134_knz )] = _ptr__5112_wi64[safe_add( _5106_enidxs_base,_5137_j )];
              _ptr__5124_rf64[safe_add( _5118_rcof_base,_5134_knz )] = _ptr__5113_wf64[safe_add( _5107_ecof_base,_5137_j )];
              if ((_5097_ncodeatom > (int)0))
              {
                {
                  int32_t _11530_ = _ptr__5111_wi32[safe_add( _5109_codeptr,_5137_j )];
                  int32_t _11531_ = _ptr__5111_wi32[safe_add( safe_add( _5109_codeptr,_5137_j ),(int)1 )];
                  for (int32_t _5138_l = _11530_; _5138_l < _11531_; ++_5138_l)
                  {
                    {
                      _ptr__5122_ri32[safe_add( _5119_rcode,_5132_codei )] = _ptr__5111_wi32[safe_add( _5108_code,_5138_l )];
                      _ptr__5124_rf64[safe_add( _5121_rcconst,_5132_codei )] = _ptr__5113_wf64[safe_add( _5110_cconst,_5138_l )];
                      ++ _5132_codei;
                    }
                  }
                  _ptr__5122_ri32[safe_add( safe_add( _5120_rcodeptr,_5134_knz ),(int)1 )] = _5132_codei;
                }
              }
              {}
              ++ _5134_knz;
            }
          }
          _ptr__5123_ri64[safe_add( _5117_rsp_base,_5135_i )] = _ptr__5126_sp[_5136_ii];
          ++ _5133_kelem;
          _ptr__5122_ri32[safe_add( safe_add( _5114_rptr_base,_5135_i ),(int)1 )] = _5134_knz;
        }
      }
    }
  }
  else
  {
    {
      _ptr__5122_ri32[_5114_rptr_base] = (int)0;
      if ((_5097_ncodeatom > (int)0))
      {
        {
          _ptr__5122_ri32[_5120_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _5139_codei = (int)0;
      int32_t _5140_kelem = (int)0;
      int32_t _5141_knz = (int)0;
      int32_t _11532_ = (int)0;
      int32_t _11533_ = _5095_nelem;
      for (int32_t _5142_i = _11532_; _5142_i < _11533_; ++_5142_i)
      {
        {
          int64_t _5143_ii = (int64_t)0;
          int32_t _11534_ = (int)0;
          int32_t _11535_ = _5094_nd;
          for (int32_t _5144_j = _11534_; _5144_j < _11535_; ++_5144_j)
          {
            {
              _5143_ii += safe_mul( ((_5142_i / _ptr__5100_stride[((*dperm)(_5144_j))]) % _ptr__5111_wi32[safe_add( _5099_shape_base,((*dperm)(_5144_j)) )]),_ptr__5102_dstride[_5144_j] );
            }
          }
          int32_t _11536_ = _ptr__5111_wi32[safe_add( _5104_eptr_base,_5143_ii )];
          int32_t _11537_ = _ptr__5111_wi32[safe_add( safe_add( _5104_eptr_base,_5143_ii ),(int)1 )];
          for (int32_t _5145_j = _11536_; _5145_j < _11537_; ++_5145_j)
          {
            {
              _ptr__5123_ri64[safe_add( _5116_rnidxs_base,_5141_knz )] = _ptr__5112_wi64[safe_add( _5106_enidxs_base,_5145_j )];
              _ptr__5124_rf64[safe_add( _5118_rcof_base,_5141_knz )] = _ptr__5113_wf64[safe_add( _5107_ecof_base,_5145_j )];
              if ((_5097_ncodeatom > (int)0))
              {
                {
                  int32_t _11538_ = _ptr__5111_wi32[safe_add( _5109_codeptr,_5145_j )];
                  int32_t _11539_ = _ptr__5111_wi32[safe_add( safe_add( _5109_codeptr,_5145_j ),(int)1 )];
                  for (int32_t _5146_l = _11538_; _5146_l < _11539_; ++_5146_l)
                  {
                    {
                      _ptr__5122_ri32[safe_add( _5119_rcode,_5139_codei )] = _ptr__5111_wi32[safe_add( _5108_code,_5146_l )];
                      _ptr__5124_rf64[safe_add( _5121_rcconst,_5139_codei )] = _ptr__5113_wf64[safe_add( _5110_cconst,_5146_l )];
                      ++ _5139_codei;
                    }
                  }
                  _ptr__5122_ri32[safe_add( safe_add( _5120_rcodeptr,_5141_knz ),(int)1 )] = _5139_codei;
                }
              }
              {}
              ++ _5141_knz;
            }
          }
          ++ _5140_kelem;
          _ptr__5122_ri32[safe_add( _5114_rptr_base,_5140_kelem )] = _5141_knz;
        }
      }
    }
  }
}
// End mosek.fusion.ExprPermuteDims.eval

// Begin mosek.fusion.ExprPermuteDims.computeshape
// Method mosek.fusion.ExprPermuteDims.computeshape @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:157:6-159:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprPermuteDims::computeshape(std::shared_ptr< monty::ndarray< int32_t,1 > > _5147_perm,std::shared_ptr< monty::ndarray< int32_t,1 > > _5148_shape)
{
  _checked_ptr_1<int32_t> _ptr__5147_perm(_5147_perm ? _5147_perm->raw() : nullptr, _5147_perm ? _5147_perm->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5148_shape(_5148_shape ? _5148_shape->raw() : nullptr, _5148_shape ? _5148_shape->size(0) : 0);
  std::vector<int32_t> _11540_;
  for (int32_t _5149_i = (int)0, _11541_ = (int)((_5147_perm)->size(0)); _5149_i < _11541_ ; ++_5149_i)
  {
    _11540_.push_back(_ptr__5148_shape[_ptr__5147_perm[_5149_i]]);
  }
  auto _11542_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11540_.size()),_11540_.begin(),_11540_.end()));
  return _11542_;
}
// End mosek.fusion.ExprPermuteDims.computeshape

void mosek::fusion::p_ExprPermuteDims::destroy()
{
  dperm.reset();
  expr.reset();
}
void mosek::fusion::ExprPermuteDims::destroy() { mosek::fusion::p_ExprPermuteDims::_get_impl(this)->destroy(); }
// } class ExprPermuteDims
// class ExprTranspose { // @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:4:4-145:5
mosek::fusion::ExprTranspose::ExprTranspose(mosek::fusion::p_ExprTranspose *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprTranspose()" << this << std::endl; */ }
mosek::fusion::ExprTranspose::~ExprTranspose() {  /* std::cout << "~ExprTranspose()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprTranspose::p_ExprTranspose
  (::mosek::fusion::ExprTranspose * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprTranspose.ctor @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:19:6-22:7
mosek::fusion::ExprTranspose::t mosek::fusion::p_ExprTranspose::_new_ExprTranspose
  (monty::rc_ptr< ::mosek::fusion::Expression > _5150_expr)
{ return new mosek::fusion::ExprTranspose(_5150_expr); }
mosek::fusion::ExprTranspose::ExprTranspose
  (monty::rc_ptr< ::mosek::fusion::Expression > _5150_expr) : 
   ExprTranspose(new mosek::fusion::p_ExprTranspose(this))
{ mosek::fusion::p_ExprTranspose::_get_impl(this)->_initialize(_5150_expr); }
void mosek::fusion::p_ExprTranspose::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5150_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprTranspose::transposeShape(_5150_expr->getShape()));
    mosek::fusion::p_ExprTranspose::_get_impl(::mosek::fusion::ExprTranspose::t(_pubthis))->expr = _5150_expr;
  }
}
// mosek.fusion.ExprTranspose.ctor

// Begin mosek.fusion.ExprTranspose.eval
// Method mosek.fusion.ExprTranspose.eval @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:24:6-144:7
void mosek::fusion::ExprTranspose :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5151_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5152_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5153_xs) { mosek::fusion::p_ExprTranspose::_get_impl(this)->eval(_5151_rs,_5152_ws,_5153_xs); }
void mosek::fusion::p_ExprTranspose::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5151_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5152_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5153_xs)
{
  expr->eval(_5152_ws,_5151_rs,_5153_xs);
  _5152_ws->pop_expr();
  if ((mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->nd != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  else
  {
    {
      int32_t _5154_shape_base = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->shape_base;
      int32_t _5155_nelem = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->nelem;
      int32_t _5156_nnz = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->nnz;
      bool _5157_hassp = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->hassp;
      int32_t _5158_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->ncodeatom;
      int32_t _5159_eptr_base = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->ptr_base;
      int32_t _5160_esp_base = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->sp_base;
      int32_t _5161_enidx_base = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->nidxs_base;
      int32_t _5162_ecof_base = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->cof_base;
      int32_t _5163_code = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->code_base;
      int32_t _5164_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->codeptr_base;
      int32_t _5165_cconst = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->cconst_base;
      int32_t _5166_dim0 = ((*mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->i32)(_5154_shape_base));
      int32_t _5167_dim1 = ((*mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->i32)(safe_add( _5154_shape_base,(int)1 )));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5168_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->i32;
      _checked_ptr_1<int32_t> _ptr__5168_wi32(_5168_wi32 ? _5168_wi32->raw() : nullptr,_5168_wi32 ? _5168_wi32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5169_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->i64;
      _checked_ptr_1<int64_t> _ptr__5169_wi64(_5169_wi64 ? _5169_wi64->raw() : nullptr,_5169_wi64 ? _5169_wi64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5170_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5152_ws)->f64;
      _checked_ptr_1<double> _ptr__5170_wf64(_5170_wf64 ? _5170_wf64->raw() : nullptr,_5170_wf64 ? _5170_wf64->size(0) : 0);
      _5151_rs->alloc_expr((int)2,_5155_nelem,_5156_nnz,_5157_hassp,_5158_ncodeatom);
      int32_t _5171_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->ptr_base;
      int32_t _5172_rnidx_base = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->nidxs_base;
      int32_t _5173_rsp_base = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->sp_base;
      int32_t _5174_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->cof_base;
      int32_t _5175_rshape_base = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->shape_base;
      int32_t _5176_rcode = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->code_base;
      int32_t _5177_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->codeptr_base;
      int32_t _5178_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5179_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__5179_ri32(_5179_ri32 ? _5179_ri32->raw() : nullptr,_5179_ri32 ? _5179_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5180_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__5180_ri64(_5180_ri64 ? _5180_ri64->raw() : nullptr,_5180_ri64 ? _5180_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5181_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5151_rs)->f64;
      _checked_ptr_1<double> _ptr__5181_rf64(_5181_rf64 ? _5181_rf64->raw() : nullptr,_5181_rf64 ? _5181_rf64->size(0) : 0);
      _ptr__5179_ri32[_5175_rshape_base] = _5167_dim1;
      _ptr__5179_ri32[safe_add( _5175_rshape_base,(int)1 )] = _5166_dim0;
      _ptr__5179_ri32[_5171_rptr_base] = (int)0;
      if ((_5158_ncodeatom > (int)0))
      {
        {
          _ptr__5179_ri32[_5177_rcodeptr] = (int)0;
        }
      }
      {}
      if (_5157_hassp)
      {
        {
          int32_t _5182_perm = _5153_xs->alloci32(_5155_nelem);
          int32_t _5183_ptr = _5153_xs->alloci32(safe_add( _5167_dim1,(int)1 ));
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5184_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5153_xs)->i32;
          _checked_ptr_1<int32_t> _ptr__5184_xi32(_5184_xi32 ? _5184_xi32->raw() : nullptr,_5184_xi32 ? _5184_xi32->size(0) : 0);
          {
            int32_t _11543_ = (int)0;
            int32_t _11544_ = safe_add( _5167_dim1,(int)1 );
            for (int32_t _5185_i = _11543_; _5185_i < _11544_; ++_5185_i)
            {
              {
                _ptr__5184_xi32[safe_add( _5183_ptr,_5185_i )] = (int)0;
              }
            }
            int32_t _11545_ = (int)0;
            int32_t _11546_ = _5155_nelem;
            for (int32_t _5186_i = _11545_; _5186_i < _11546_; ++_5186_i)
            {
              {
                ++ _ptr__5184_xi32[safe_add( safe_add( _5183_ptr,(_ptr__5169_wi64[safe_add( _5160_esp_base,_5186_i )] % _5167_dim1) ),(int)1 )];
              }
            }
            int32_t _11547_ = (int)0;
            int32_t _11548_ = _5167_dim1;
            for (int32_t _5187_i = _11547_; _5187_i < _11548_; ++_5187_i)
            {
              {
                _ptr__5184_xi32[safe_add( safe_add( _5183_ptr,_5187_i ),(int)1 )] += _ptr__5184_xi32[safe_add( _5183_ptr,_5187_i )];
              }
            }
            int32_t _11549_ = (int)0;
            int32_t _11550_ = _5155_nelem;
            for (int32_t _5188_i = _11549_; _5188_i < _11550_; ++_5188_i)
            {
              {
                int64_t _5189_j = (_ptr__5169_wi64[safe_add( _5160_esp_base,_5188_i )] % _5167_dim1);
                _ptr__5184_xi32[safe_add( _5182_perm,_ptr__5184_xi32[safe_add( _5183_ptr,_5189_j )] )] = _5188_i;
                ++ _ptr__5184_xi32[safe_add( _5183_ptr,_5189_j )];
              }
            }
            _ptr__5179_ri32[_5171_rptr_base] = (int)0;
            int32_t _5190_codei = (int)0;
            int32_t _5191_p = (int)0;
            int32_t _11551_ = (int)0;
            int32_t _11552_ = _5155_nelem;
            for (int32_t _5192_i = _11551_; _5192_i < _11552_; ++_5192_i)
            {
              {
                int32_t _5193_j = _ptr__5184_xi32[safe_add( _5182_perm,_5192_i )];
                int32_t _11553_ = _ptr__5168_wi32[safe_add( _5159_eptr_base,_5193_j )];
                int32_t _11554_ = _ptr__5168_wi32[safe_add( safe_add( _5159_eptr_base,_5193_j ),(int)1 )];
                for (int32_t _5194_k = _11553_; _5194_k < _11554_; ++_5194_k)
                {
                  {
                    _ptr__5180_ri64[safe_add( _5172_rnidx_base,_5191_p )] = _ptr__5169_wi64[safe_add( _5161_enidx_base,_5194_k )];
                    _ptr__5181_rf64[safe_add( _5174_rcof_base,_5191_p )] = _ptr__5170_wf64[safe_add( _5162_ecof_base,_5194_k )];
                    if ((_5158_ncodeatom > (int)0))
                    {
                      {
                        int32_t _11555_ = _ptr__5168_wi32[safe_add( _5164_codeptr,_5194_k )];
                        int32_t _11556_ = _ptr__5168_wi32[safe_add( safe_add( _5164_codeptr,_5194_k ),(int)1 )];
                        for (int32_t _5195_l = _11555_; _5195_l < _11556_; ++_5195_l)
                        {
                          {
                            _ptr__5179_ri32[safe_add( _5176_rcode,_5190_codei )] = _ptr__5168_wi32[safe_add( _5163_code,_5195_l )];
                            _ptr__5181_rf64[safe_add( _5178_rcconst,_5190_codei )] = _ptr__5170_wf64[safe_add( _5165_cconst,_5195_l )];
                            ++ _5190_codei;
                          }
                        }
                        _ptr__5179_ri32[safe_add( safe_add( _5177_rcodeptr,_5191_p ),(int)1 )] = _5190_codei;
                      }
                    }
                    {}
                    ++ _5191_p;
                  }
                }
                int64_t _5196_ii = (_ptr__5169_wi64[safe_add( _5160_esp_base,_5193_j )] / _5167_dim1);
                int64_t _5197_jj = (_ptr__5169_wi64[safe_add( _5160_esp_base,_5193_j )] % _5167_dim1);
                _ptr__5179_ri32[safe_add( safe_add( _5171_rptr_base,_5192_i ),(int)1 )] = _5191_p;
                _ptr__5180_ri64[safe_add( _5173_rsp_base,_5192_i )] = safe_add( safe_mul( _5197_jj,_5166_dim0 ),_5196_ii );
              }
            }
          }
        }
      }
      else
      {
        {
          _ptr__5179_ri32[_5171_rptr_base] = (int)0;
          int32_t _5198_codei = (int)0;
          int32_t _5199_rinz = (int)0;
          int32_t _5200_wi = (int)0;
          int32_t _11557_ = (int)0;
          int32_t _11558_ = _5167_dim1;
          for (int32_t _5201_i = _11557_; _5201_i < _11558_; ++_5201_i)
          {
            {
              int32_t _11559_ = (int)0;
              int32_t _11560_ = _5166_dim0;
              for (int32_t _5202_j = _11559_; _5202_j < _11560_; ++_5202_j)
              {
                {
                  int32_t _5203_p = safe_add( safe_mul( _5202_j,_5167_dim1 ),_5201_i );
                  int32_t _11561_ = _ptr__5168_wi32[safe_add( _5159_eptr_base,_5203_p )];
                  int32_t _11562_ = _ptr__5168_wi32[safe_add( safe_add( _5159_eptr_base,_5203_p ),(int)1 )];
                  for (int32_t _5204_k = _11561_; _5204_k < _11562_; ++_5204_k)
                  {
                    {
                      _ptr__5180_ri64[safe_add( _5172_rnidx_base,_5199_rinz )] = _ptr__5169_wi64[safe_add( _5161_enidx_base,_5204_k )];
                      _ptr__5181_rf64[safe_add( _5174_rcof_base,_5199_rinz )] = _ptr__5170_wf64[safe_add( _5162_ecof_base,_5204_k )];
                      if ((_5158_ncodeatom > (int)0))
                      {
                        {
                          int32_t _11563_ = _ptr__5168_wi32[safe_add( _5164_codeptr,_5204_k )];
                          int32_t _11564_ = _ptr__5168_wi32[safe_add( safe_add( _5164_codeptr,_5204_k ),(int)1 )];
                          for (int32_t _5205_l = _11563_; _5205_l < _11564_; ++_5205_l)
                          {
                            {
                              _ptr__5179_ri32[safe_add( _5176_rcode,_5198_codei )] = _ptr__5168_wi32[safe_add( _5163_code,_5205_l )];
                              _ptr__5181_rf64[safe_add( _5178_rcconst,_5198_codei )] = _ptr__5170_wf64[safe_add( _5165_cconst,_5205_l )];
                              ++ _5198_codei;
                            }
                          }
                          _ptr__5179_ri32[safe_add( safe_add( _5177_rcodeptr,_5199_rinz ),(int)1 )] = _5198_codei;
                        }
                      }
                      {}
                      ++ _5199_rinz;
                    }
                  }
                  _ptr__5179_ri32[safe_add( safe_add( _5171_rptr_base,_5200_wi ),(int)1 )] = _5199_rinz;
                  ++ _5200_wi;
                }
              }
            }
          }
        }
      }
      _5153_xs->clear();
    }
  }
}
// End mosek.fusion.ExprTranspose.eval

// Begin mosek.fusion.ExprTranspose.toString
// Method mosek.fusion.ExprTranspose.toString @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:14:6-16:7
std::string mosek::fusion::ExprTranspose :: toString() { return mosek::fusion::p_ExprTranspose::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprTranspose::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprTranspose("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprTranspose.toString

// Begin mosek.fusion.ExprTranspose.transposeShape
// Method mosek.fusion.ExprTranspose.transposeShape @ bld/docker-win/final/default/src/fusion/ExprTranspose.monty:7:6-12:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprTranspose::transposeShape(std::shared_ptr< monty::ndarray< int32_t,1 > > _5206_shape)
{
  _checked_ptr_1<int32_t> _ptr__5206_shape(_5206_shape ? _5206_shape->raw() : nullptr, _5206_shape ? _5206_shape->size(0) : 0);
  if (((int)((_5206_shape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  else
  {
    {
      return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__5206_shape[(int)1]),(int32_t)(_ptr__5206_shape[(int)0])});
    }
  }
}
// End mosek.fusion.ExprTranspose.transposeShape

void mosek::fusion::p_ExprTranspose::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprTranspose::destroy() { mosek::fusion::p_ExprTranspose::_get_impl(this)->destroy(); }
// } class ExprTranspose
// class ExprRepeat { // @ bld/docker-win/final/default/src/fusion/ExprStack.monty:435:4-628:5
mosek::fusion::ExprRepeat::ExprRepeat(mosek::fusion::p_ExprRepeat *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprRepeat()" << this << std::endl; */ }
mosek::fusion::ExprRepeat::~ExprRepeat() {  /* std::cout << "~ExprRepeat()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprRepeat::p_ExprRepeat
  (::mosek::fusion::ExprRepeat * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprRepeat.ctor @ bld/docker-win/final/default/src/fusion/ExprStack.monty:459:6-464:7
mosek::fusion::ExprRepeat::t mosek::fusion::p_ExprRepeat::_new_ExprRepeat
  (monty::rc_ptr< ::mosek::fusion::Expression > _5207_expr,
    int32_t _5208_dim,
    int32_t _5209_n)
{ return new mosek::fusion::ExprRepeat(_5207_expr,_5208_dim,_5209_n); }
mosek::fusion::ExprRepeat::ExprRepeat
  (monty::rc_ptr< ::mosek::fusion::Expression > _5207_expr,
    int32_t _5208_dim,
    int32_t _5209_n) : 
   ExprRepeat(new mosek::fusion::p_ExprRepeat(this))
{ mosek::fusion::p_ExprRepeat::_get_impl(this)->_initialize(_5207_expr,_5208_dim,_5209_n); }
void mosek::fusion::p_ExprRepeat::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5207_expr,
    int32_t _5208_dim,
    int32_t _5209_n)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprRepeat::getshape(_5207_expr,_5208_dim,_5209_n));
    mosek::fusion::p_ExprRepeat::_get_impl(::mosek::fusion::ExprRepeat::t(_pubthis))->expr = _5207_expr;
    mosek::fusion::p_ExprRepeat::_get_impl(::mosek::fusion::ExprRepeat::t(_pubthis))->dim = _5208_dim;
    mosek::fusion::p_ExprRepeat::_get_impl(::mosek::fusion::ExprRepeat::t(_pubthis))->n = _5209_n;
  }
}
// mosek.fusion.ExprRepeat.ctor

// Begin mosek.fusion.ExprRepeat.eval
// Method mosek.fusion.ExprRepeat.eval @ bld/docker-win/final/default/src/fusion/ExprStack.monty:466:6-627:7
void mosek::fusion::ExprRepeat :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5210_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5211_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5212_xs) { mosek::fusion::p_ExprRepeat::_get_impl(this)->eval(_5210_rs,_5211_ws,_5212_xs); }
void mosek::fusion::p_ExprRepeat::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5210_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5211_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5212_xs)
{
  expr->eval(_5211_ws,_5210_rs,_5212_xs);
  _5211_ws->pop_expr();
  int32_t _5213_nd = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->nd;
  int32_t _5214_shape = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->shape_base;
  int32_t _5215_nelem = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->nelem;
  int32_t _5216_nnz = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->nnz;
  int32_t _5217_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->ncodeatom;
  bool _5218_hassp = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->hassp;
  int32_t _5219_ptr = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->ptr_base;
  int32_t _5220_sp = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->sp_base;
  int32_t _5221_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->nidxs_base;
  int32_t _5222_cof = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->cof_base;
  int32_t _5223_code = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->code_base;
  int32_t _5224_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->codeptr_base;
  int32_t _5225_cconst = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5226_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5226_wi32(_5226_wi32 ? _5226_wi32->raw() : nullptr,_5226_wi32 ? _5226_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5227_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5227_wi64(_5227_wi64 ? _5227_wi64->raw() : nullptr,_5227_wi64 ? _5227_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5228_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5211_ws)->f64;
  _checked_ptr_1<double> _ptr__5228_wf64(_5228_wf64 ? _5228_wf64->raw() : nullptr,_5228_wf64 ? _5228_wf64->size(0) : 0);
  int32_t _11565_;
  bool _11566_ = (dim < _5213_nd);
  if (_11566_)
  {
    _11565_ = _5213_nd;
  }
  else
  {
    _11565_ = safe_add( _5213_nd,(int)1 );
  }
  int32_t _5229_rnd = _11565_;
  int32_t _5230_rnelem = safe_mul( _5215_nelem,n );
  int32_t _5231_rnnz = safe_mul( _5216_nnz,n );
  int32_t _5232_rncodeatom = safe_mul( _5217_ncodeatom,n );
  _5210_rs->alloc_expr(_5229_rnd,_5230_rnelem,_5231_rnnz,_5218_hassp,_5232_rncodeatom);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5233_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5233_ri32(_5233_ri32 ? _5233_ri32->raw() : nullptr,_5233_ri32 ? _5233_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5234_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5234_ri64(_5234_ri64 ? _5234_ri64->raw() : nullptr,_5234_ri64 ? _5234_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5235_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->f64;
  _checked_ptr_1<double> _ptr__5235_rf64(_5235_rf64 ? _5235_rf64->raw() : nullptr,_5235_rf64 ? _5235_rf64->size(0) : 0);
  int32_t _5236_rshape = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->shape_base;
  int32_t _5237_rptr = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->ptr_base;
  int32_t _5238_rsp = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->sp_base;
  int32_t _5239_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->nidxs_base;
  int32_t _5240_rcof = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->cof_base;
  int32_t _5241_rcode = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->code_base;
  int32_t _5242_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->codeptr_base;
  int32_t _5243_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5210_rs)->cconst_base;
  int32_t _5244_d0 = (int)1;
  int32_t _11567_ = (int)0;
  int32_t _11568_ = dim;
  for (int32_t _5245_i = _11567_; _5245_i < _11568_; ++_5245_i)
  {
    {
      _5244_d0 *= _ptr__5226_wi32[safe_add( _5214_shape,_5245_i )];
    }
  }
  int32_t _11569_;
  bool _11570_ = (dim < _5213_nd);
  if (_11570_)
  {
    _11569_ = _ptr__5226_wi32[safe_add( _5214_shape,dim )];
  }
  else
  {
    _11569_ = (int)1;
  }
  int32_t _5246_d1 = _11569_;
  int32_t _5247_rd1 = safe_mul( n,_5246_d1 );
  int32_t _5248_d2 = (int)1;
  int32_t _11571_ = safe_add( dim,(int)1 );
  int32_t _11572_ = _5213_nd;
  for (int32_t _5249_i = _11571_; _5249_i < _11572_; ++_5249_i)
  {
    {
      _5248_d2 *= _ptr__5226_wi32[safe_add( _5214_shape,_5249_i )];
    }
  }
  {
    int32_t _11573_ = (int)0;
    int32_t _11574_ = _5213_nd;
    for (int32_t _5250_i = _11573_; _5250_i < _11574_; ++_5250_i)
    {
      {
        _ptr__5233_ri32[safe_add( _5236_rshape,_5250_i )] = _ptr__5226_wi32[safe_add( _5214_shape,_5250_i )];
      }
    }
    _ptr__5233_ri32[safe_add( _5236_rshape,dim )] = _5247_rd1;
    _ptr__5233_ri32[_5237_rptr] = (int)0;
    if ((_5232_rncodeatom != (int)0))
    {
      {
        _ptr__5233_ri32[_5242_rcodeptr] = (int)0;
      }
    }
    {}
    if (_5218_hassp)
    {
      {
        int32_t _5251_codei = (int)0;
        int32_t _5252_ni = (int)0;
        int32_t _5253_ei = (int)0;
        int32_t _5254_elmi = (int)0;
        int32_t _5255_nzi = (int)0;
        while ( (_5253_ei < _5215_nelem) )
        {
          {
            int64_t _5256_nidx = _ptr__5227_wi64[safe_add( _5220_sp,_5253_ei )];
            int64_t _5257_ninext = safe_add( (_5256_nidx - (_5256_nidx % safe_mul( _5246_d1,_5248_d2 ))),safe_mul( _5246_d1,_5248_d2 ) );
            int32_t _5258_eb = _5253_ei;
            ++ _5253_ei;
            while ( ((_5253_ei < _5215_nelem) && (_ptr__5227_wi64[safe_add( _5220_sp,_5253_ei )] < _5257_ninext)) )
            {
              {
                ++ _5253_ei;
              }
            }
            int32_t _5259_ee = _5253_ei;
            int32_t _11575_ = (int)0;
            int32_t _11576_ = n;
            for (int32_t _5260_i = _11575_; _5260_i < _11576_; ++_5260_i)
            {
              {
                int32_t _11577_ = _5258_eb;
                int32_t _11578_ = _5259_ee;
                for (int32_t _5261_j = _11577_; _5261_j < _11578_; ++_5261_j)
                {
                  {
                    int64_t _5262_i0 = (_ptr__5227_wi64[safe_add( _5220_sp,_5261_j )] / safe_mul( _5246_d1,_5248_d2 ));
                    int64_t _5263_i1 = ((_ptr__5227_wi64[safe_add( _5220_sp,_5261_j )] / _5248_d2) % _5246_d1);
                    int64_t _5264_i2 = (_ptr__5227_wi64[safe_add( _5220_sp,_5261_j )] % _5248_d2);
                    int32_t _11579_ = _ptr__5226_wi32[safe_add( _5219_ptr,_5261_j )];
                    int32_t _11580_ = _ptr__5226_wi32[safe_add( safe_add( _5219_ptr,_5261_j ),(int)1 )];
                    for (int32_t _5265_k = _11579_; _5265_k < _11580_; ++_5265_k)
                    {
                      {
                        _ptr__5234_ri64[safe_add( _5239_rnidxs,_5255_nzi )] = _ptr__5227_wi64[safe_add( _5221_nidxs,_5265_k )];
                        _ptr__5235_rf64[safe_add( _5240_rcof,_5255_nzi )] = _ptr__5228_wf64[safe_add( _5222_cof,_5265_k )];
                        if ((_5217_ncodeatom > (int)0))
                        {
                          {
                            int32_t _11581_ = _ptr__5226_wi32[safe_add( _5224_codeptr,_5265_k )];
                            int32_t _11582_ = _ptr__5226_wi32[safe_add( safe_add( _5224_codeptr,_5265_k ),(int)1 )];
                            for (int32_t _5266_l = _11581_; _5266_l < _11582_; ++_5266_l)
                            {
                              {
                                _ptr__5233_ri32[safe_add( _5241_rcode,_5251_codei )] = _ptr__5226_wi32[safe_add( _5223_code,_5266_l )];
                                _ptr__5235_rf64[safe_add( _5243_rcconst,_5251_codei )] = _ptr__5228_wf64[safe_add( _5225_cconst,_5266_l )];
                                ++ _5251_codei;
                              }
                            }
                            _ptr__5233_ri32[safe_add( safe_add( _5242_rcodeptr,_5255_nzi ),(int)1 )] = _5251_codei;
                          }
                        }
                        {}
                        ++ _5255_nzi;
                      }
                    }
                    _ptr__5233_ri32[safe_add( safe_add( _5237_rptr,_5254_elmi ),(int)1 )] = _5255_nzi;
                    _ptr__5234_ri64[safe_add( _5238_rsp,_5254_elmi )] = safe_add( safe_mul( safe_add( safe_add( safe_mul( _5262_i0,_5247_rd1 ),safe_mul( _5260_i,_5246_d1 ) ),_5263_i1 ),_5248_d2 ),_5264_i2 );
                    ++ _5254_elmi;
                  }
                }
              }
            }
          }
        }
      }
    }
    else
    {
      {
        int32_t _5267_codei = (int)0;
        int32_t _5268_elmi = (int)0;
        int32_t _5269_nzi = (int)0;
        int32_t _5270_p0 = (int)0;
        int32_t _11583_ = (int)0;
        int32_t _11584_ = _5244_d0;
        for (int32_t _5271_i0 = _11583_; _5271_i0 < _11584_; ++_5271_i0)
        {
          {
            int32_t _11585_ = (int)0;
            int32_t _11586_ = n;
            for (int32_t _5272_i1 = _11585_; _5272_i1 < _11586_; ++_5272_i1)
            {
              {
                int32_t _5273_p = safe_mul( safe_mul( _5271_i0,_5246_d1 ),_5248_d2 );
                int32_t _11587_ = (int)0;
                int32_t _11588_ = safe_mul( _5246_d1,_5248_d2 );
                for (int32_t _5274_i2 = _11587_; _5274_i2 < _11588_; ++_5274_i2)
                {
                  {
                    int32_t _11589_ = _ptr__5226_wi32[safe_add( _5219_ptr,_5273_p )];
                    int32_t _11590_ = _ptr__5226_wi32[safe_add( safe_add( _5219_ptr,_5273_p ),(int)1 )];
                    for (int32_t _5275_k = _11589_; _5275_k < _11590_; ++_5275_k)
                    {
                      {
                        _ptr__5234_ri64[safe_add( _5239_rnidxs,_5269_nzi )] = _ptr__5227_wi64[safe_add( _5221_nidxs,_5275_k )];
                        _ptr__5235_rf64[safe_add( _5240_rcof,_5269_nzi )] = _ptr__5228_wf64[safe_add( _5222_cof,_5275_k )];
                        if ((_5217_ncodeatom > (int)0))
                        {
                          {
                            int32_t _11591_ = _ptr__5226_wi32[safe_add( _5224_codeptr,_5275_k )];
                            int32_t _11592_ = _ptr__5226_wi32[safe_add( safe_add( _5224_codeptr,_5275_k ),(int)1 )];
                            for (int32_t _5276_l = _11591_; _5276_l < _11592_; ++_5276_l)
                            {
                              {
                                _ptr__5233_ri32[safe_add( _5241_rcode,_5267_codei )] = _ptr__5226_wi32[safe_add( _5223_code,_5276_l )];
                                _ptr__5235_rf64[safe_add( _5243_rcconst,_5267_codei )] = _ptr__5228_wf64[safe_add( _5225_cconst,_5276_l )];
                                ++ _5267_codei;
                              }
                            }
                            _ptr__5233_ri32[safe_add( safe_add( _5242_rcodeptr,_5269_nzi ),(int)1 )] = _5267_codei;
                          }
                        }
                        {}
                        ++ _5269_nzi;
                      }
                    }
                    _ptr__5233_ri32[safe_add( safe_add( _5237_rptr,_5268_elmi ),(int)1 )] = _5269_nzi;
                    ++ _5268_elmi;
                    ++ _5273_p;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprRepeat.eval

// Begin mosek.fusion.ExprRepeat.getshape
// Method mosek.fusion.ExprRepeat.getshape @ bld/docker-win/final/default/src/fusion/ExprStack.monty:444:6-457:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprRepeat::getshape(monty::rc_ptr< ::mosek::fusion::Expression > _5277_e,int32_t _5278_dim,int32_t _5279_n)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5280_shape_ = _5277_e->getShape();
  _checked_ptr_1<int32_t> _ptr__5280_shape_(_5280_shape_ ? _5280_shape_->raw() : nullptr,_5280_shape_ ? _5280_shape_->size(0) : 0);
  int32_t _5281_nd = (int)((_5280_shape_)->size(0));
  if ((_5278_dim < _5281_nd))
  {
    {
      _ptr__5280_shape_[_5278_dim] *= _5279_n;
      return _5280_shape_;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _11593_;
      bool _11594_ = (_5278_dim == _5281_nd);
      if (_11594_)
      {
        _11593_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _5281_nd,(int)1 ))));
      }
      else
      {
        _11593_ = _5280_shape_;
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5282_shape = _11593_;
      _checked_ptr_1<int32_t> _ptr__5282_shape(_5282_shape ? _5282_shape->raw() : nullptr,_5282_shape ? _5282_shape->size(0) : 0);
      int32_t _11595_ = (int)0;
      int32_t _11596_ = _5281_nd;
      for (int32_t _5283_i = _11595_; _5283_i < _11596_; ++_5283_i)
      {
        {
          _ptr__5282_shape[_5283_i] = _ptr__5280_shape_[_5283_i];
        }
      }
      _ptr__5282_shape[_5278_dim] = _5279_n;
      return _5282_shape;
    }
  }
}
// End mosek.fusion.ExprRepeat.getshape

// Begin mosek.fusion.ExprRepeat.toString
// Method mosek.fusion.ExprRepeat.toString @ bld/docker-win/final/default/src/fusion/ExprStack.monty:440:6-442:7
std::string mosek::fusion::ExprRepeat :: toString() { return mosek::fusion::p_ExprRepeat::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprRepeat::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprRepeat(dim="))->__mosek_2fusion_2Utils_2StringBuffer__a(dim)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprRepeat.toString

void mosek::fusion::p_ExprRepeat::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprRepeat::destroy() { mosek::fusion::p_ExprRepeat::_get_impl(this)->destroy(); }
// } class ExprRepeat
// class ExprStack { // @ bld/docker-win/final/default/src/fusion/ExprStack.monty:4:4-431:5
mosek::fusion::ExprStack::ExprStack(mosek::fusion::p_ExprStack *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprStack()" << this << std::endl; */ }
mosek::fusion::ExprStack::~ExprStack() {  /* std::cout << "~ExprStack()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprStack::p_ExprStack
  (::mosek::fusion::ExprStack * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprStack.ctor @ bld/docker-win/final/default/src/fusion/ExprStack.monty:49:6-53:7
mosek::fusion::ExprStack::t mosek::fusion::p_ExprStack::_new_ExprStack
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _5284_exprs,
    int32_t _5285_dim)
{ return new mosek::fusion::ExprStack(_5284_exprs,_5285_dim); }
mosek::fusion::ExprStack::ExprStack
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _5284_exprs,
    int32_t _5285_dim) : 
   ExprStack(new mosek::fusion::p_ExprStack(this))
{ mosek::fusion::p_ExprStack::_get_impl(this)->_initialize(_5284_exprs,_5285_dim); }
void mosek::fusion::p_ExprStack::_initialize  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _5284_exprs,
    int32_t _5285_dim)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprStack::getshape(_5284_exprs,_5285_dim));
    std::vector<monty::rc_ptr< ::mosek::fusion::Expression >> _11597_;
    for (int32_t _5286_i = (int)0, _11598_ = (int)((_5284_exprs)->size(0)); _5286_i < _11598_ ; ++_5286_i)
    {
      _11597_.push_back(((*_5284_exprs)(_5286_i)));
    }
    auto _11599_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_11597_.size()),_11597_.begin(),_11597_.end()));
    mosek::fusion::p_ExprStack::_get_impl(::mosek::fusion::ExprStack::t(_pubthis))->exprs = _11599_;
    mosek::fusion::p_ExprStack::_get_impl(::mosek::fusion::ExprStack::t(_pubthis))->dim = _5285_dim;
  }
}
// mosek.fusion.ExprStack.ctor

// Begin mosek.fusion.ExprStack.eval
// Method mosek.fusion.ExprStack.eval @ bld/docker-win/final/default/src/fusion/ExprStack.monty:55:6-430:7
void mosek::fusion::ExprStack :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5287_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5288_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5289_xs) { mosek::fusion::p_ExprStack::_get_impl(this)->eval(_5287_rs,_5288_ws,_5289_xs); }
void mosek::fusion::p_ExprStack::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5287_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5288_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5289_xs)
{
  int32_t _5290_n = (int)((exprs)->size(0));
  if ((_5290_n == (int)1))
  {
    {
      ((*exprs)((int)0))->eval(_5287_rs,_5288_ws,_5289_xs);
    }
  }
  else
  {
    {
      int32_t _11600_ = (int)0;
      int32_t _11601_ = _5290_n;
      for (int32_t _5291_i = _11600_; _5291_i < _11601_; ++_5291_i)
      {
        {
          ((*exprs)(((_5290_n - _5291_i) - (int)1)))->eval(_5288_ws,_5287_rs,_5289_xs);
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5292_nds = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5292_nds(_5292_nds ? _5292_nds->raw() : nullptr,_5292_nds ? _5292_nds->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5293_shape_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5293_shape_base(_5293_shape_base ? _5293_shape_base->raw() : nullptr,_5293_shape_base ? _5293_shape_base->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5294_nelem = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5294_nelem(_5294_nelem ? _5294_nelem->raw() : nullptr,_5294_nelem ? _5294_nelem->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5295_nnz = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5295_nnz(_5295_nnz ? _5295_nnz->raw() : nullptr,_5295_nnz ? _5295_nnz->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5296_ncodeatom = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5296_ncodeatom(_5296_ncodeatom ? _5296_ncodeatom->raw() : nullptr,_5296_ncodeatom ? _5296_ncodeatom->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5297_hassp = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5297_hassp(_5297_hassp ? _5297_hassp->raw() : nullptr,_5297_hassp ? _5297_hassp->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5298_ptr_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5298_ptr_base(_5298_ptr_base ? _5298_ptr_base->raw() : nullptr,_5298_ptr_base ? _5298_ptr_base->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5299_nidxs_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5299_nidxs_base(_5299_nidxs_base ? _5299_nidxs_base->raw() : nullptr,_5299_nidxs_base ? _5299_nidxs_base->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5300_sp_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5300_sp_base(_5300_sp_base ? _5300_sp_base->raw() : nullptr,_5300_sp_base ? _5300_sp_base->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5301_cof_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5301_cof_base(_5301_cof_base ? _5301_cof_base->raw() : nullptr,_5301_cof_base ? _5301_cof_base->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5302_code = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5302_code(_5302_code ? _5302_code->raw() : nullptr,_5302_code ? _5302_code->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5303_codeptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5303_codeptr(_5303_codeptr ? _5303_codeptr->raw() : nullptr,_5303_codeptr ? _5303_codeptr->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5304_cconst = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5304_cconst(_5304_cconst ? _5304_cconst->raw() : nullptr,_5304_cconst ? _5304_cconst->size(0) : 0);
      int32_t _11602_ = (int)0;
      int32_t _11603_ = _5290_n;
      for (int32_t _5305_i = _11602_; _5305_i < _11603_; ++_5305_i)
      {
        {
          _5288_ws->pop_expr();
          _ptr__5292_nds[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->nd;
          _ptr__5293_shape_base[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->shape_base;
          _ptr__5294_nelem[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->nelem;
          _ptr__5295_nnz[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->nnz;
          _ptr__5296_ncodeatom[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->ncodeatom;
          int32_t _11604_;
          bool _11605_ = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->hassp;
          if (_11605_)
          {
            _11604_ = (int)1;
          }
          else
          {
            _11604_ = (int)0;
          }
          _ptr__5297_hassp[_5305_i] = _11604_;
          _ptr__5298_ptr_base[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->ptr_base;
          _ptr__5300_sp_base[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->sp_base;
          _ptr__5299_nidxs_base[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->nidxs_base;
          _ptr__5301_cof_base[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->cof_base;
          _ptr__5302_code[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->code_base;
          _ptr__5303_codeptr[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->codeptr_base;
          _ptr__5304_cconst[_5305_i] = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->cconst_base;
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5306_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->i32;
      _checked_ptr_1<int32_t> _ptr__5306_wi32(_5306_wi32 ? _5306_wi32->raw() : nullptr,_5306_wi32 ? _5306_wi32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5307_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->i64;
      _checked_ptr_1<int64_t> _ptr__5307_wi64(_5307_wi64 ? _5307_wi64->raw() : nullptr,_5307_wi64 ? _5307_wi64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5308_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5288_ws)->f64;
      _checked_ptr_1<double> _ptr__5308_wf64(_5308_wf64 ? _5308_wf64->raw() : nullptr,_5308_wf64 ? _5308_wf64->size(0) : 0);
      int32_t _5309_nd = _ptr__5292_nds[(int)0];
      int32_t _5310_shape = _ptr__5293_shape_base[(int)0];
      bool _5311_dense = (_ptr__5297_hassp[(int)0] == (int)0);
      bool _5312_mismatching_dims = false;
      int32_t _11606_ = (int)1;
      int32_t _11607_ = _5290_n;
      for (int32_t _5313_i = _11606_; _5313_i < _11607_; ++_5313_i)
      {
        {
          _5312_mismatching_dims = (_5312_mismatching_dims || ((dim != _5313_i) && (_ptr__5292_nds[_5313_i] != _5309_nd)));
          if ((!_5312_mismatching_dims))
          {
            {
              int32_t _11608_ = (int)0;
              int32_t _11609_ = dim;
              for (int32_t _5314_j = _11608_; _5314_j < _11609_; ++_5314_j)
              {
                {
                  _5312_mismatching_dims = (_5312_mismatching_dims || (_ptr__5306_wi32[safe_add( _5310_shape,_5314_j )] != _ptr__5306_wi32[safe_add( _ptr__5293_shape_base[_5313_i],_5314_j )]));
                }
              }
            }
          }
          {}
          if ((!_5312_mismatching_dims))
          {
            {
              int32_t _11610_ = safe_add( dim,(int)1 );
              int32_t _11611_ = _5309_nd;
              for (int32_t _5315_j = _11610_; _5315_j < _11611_; ++_5315_j)
              {
                {
                  _5312_mismatching_dims = (_5312_mismatching_dims || (_ptr__5306_wi32[safe_add( _5310_shape,_5315_j )] != _ptr__5306_wi32[safe_add( _ptr__5293_shape_base[_5313_i],_5315_j )]));
                }
              }
            }
          }
          {}
          _5311_dense = (_5311_dense && ((int)0 == _ptr__5297_hassp[_5313_i]));
        }
      }
      if (_5312_mismatching_dims)
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression dimensions"));
        }
      }
      {}
      int32_t _5316_sdim = (int)0;
      if ((dim < _5309_nd))
      {
        {
          int32_t _11612_ = (int)0;
          int32_t _11613_ = _5290_n;
          for (int32_t _5317_i = _11612_; _5317_i < _11613_; ++_5317_i)
          {
            {
              _5316_sdim += _ptr__5306_wi32[safe_add( _ptr__5293_shape_base[_5317_i],dim )];
            }
          }
        }
      }
      else
      {
        {
          _5316_sdim = _5290_n;
        }
      }
      int32_t _11614_;
      bool _11615_ = (dim < _5309_nd);
      if (_11615_)
      {
        _11614_ = _5309_nd;
      }
      else
      {
        _11614_ = safe_add( _5309_nd,(int)1 );
      }
      int32_t _5318_rnd = _11614_;
      if ((_5318_rnd != _pubthis->getND()))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Mismatching dimensions"));
        }
      }
      {}
      int32_t _5319_rncodeatom = (int)0;
      int32_t _5320_rnelem = (int)0;
      int32_t _5321_rnnz = (int)0;
      bool _5322_parameterized = false;
      {
        int32_t _11616_ = (int)0;
        int32_t _11617_ = _5290_n;
        for (int32_t _5323_i = _11616_; _5323_i < _11617_; ++_5323_i)
        {
          {
            _5322_parameterized = (_5322_parameterized || (_ptr__5296_ncodeatom[_5323_i] > (int)0));
          }
        }
        int32_t _11618_ = (int)0;
        int32_t _11619_ = _5290_n;
        for (int32_t _5324_i = _11618_; _5324_i < _11619_; ++_5324_i)
        {
          {
            _5321_rnnz += _ptr__5295_nnz[_5324_i];
          }
        }
        int32_t _11620_ = (int)0;
        int32_t _11621_ = _5290_n;
        for (int32_t _5325_i = _11620_; _5325_i < _11621_; ++_5325_i)
        {
          {
            _5320_rnelem += _ptr__5294_nelem[_5325_i];
          }
        }
        if (_5322_parameterized)
        {
          {
            int32_t _11622_ = (int)0;
            int32_t _11623_ = _5290_n;
            for (int32_t _5326_i = _11622_; _5326_i < _11623_; ++_5326_i)
            {
              {
                int32_t _11624_;
                bool _11625_ = (_ptr__5296_ncodeatom[_5326_i] > (int)0);
                if (_11625_)
                {
                  _11624_ = _ptr__5296_ncodeatom[_5326_i];
                }
                else
                {
                  _11624_ = _ptr__5295_nnz[_5326_i];
                }
                _5319_rncodeatom += _11624_;
              }
            }
          }
        }
        {}
      }
      int32_t _5327_d0 = (int)1;
      int32_t _11626_ = (int)0;
      int32_t _11627_ = dim;
      for (int32_t _5328_i = _11626_; _5328_i < _11627_; ++_5328_i)
      {
        {
          _5327_d0 *= _ptr__5306_wi32[safe_add( _5310_shape,_5328_i )];
        }
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _11628_;
      bool _11629_ = (dim < _5309_nd);
      if (_11629_)
      {
        std::vector<int32_t> _11630_;
        for (int32_t _5330_i = (int)0, _11631_ = _5290_n; _5330_i < _11631_ ; ++_5330_i)
        {
          _11630_.push_back(_ptr__5306_wi32[safe_add( _ptr__5293_shape_base[_5330_i],dim )]);
        }
        auto _11632_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11630_.size()),_11630_.begin(),_11630_.end()));
        _11628_ = _11632_;
      }
      else
      {
        std::vector<int32_t> _11633_;
        for (int32_t _5331_i = (int)0, _11634_ = _5290_n; _5331_i < _11634_ ; ++_5331_i)
        {
          _11633_.push_back((int)1);
        }
        auto _11635_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_11633_.size()),_11633_.begin(),_11633_.end()));
        _11628_ = _11635_;
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5329_d1s = _11628_;
      _checked_ptr_1<int32_t> _ptr__5329_d1s(_5329_d1s ? _5329_d1s->raw() : nullptr,_5329_d1s ? _5329_d1s->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5332_offset = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_5290_n)));
      _checked_ptr_1<int32_t> _ptr__5332_offset(_5332_offset ? _5332_offset->raw() : nullptr,_5332_offset ? _5332_offset->size(0) : 0);
      _ptr__5332_offset[(int)0] = (int)0;
      int32_t _11636_ = (int)1;
      int32_t _11637_ = _5290_n;
      for (int32_t _5333_i = _11636_; _5333_i < _11637_; ++_5333_i)
      {
        {
          _ptr__5332_offset[_5333_i] = safe_add( _ptr__5332_offset[(_5333_i - (int)1)],_ptr__5329_d1s[(_5333_i - (int)1)] );
        }
      }
      int32_t _5334_d1 = (int)0;
      int32_t _11638_ = (int)0;
      int32_t _11639_ = _5290_n;
      for (int32_t _5335_i = _11638_; _5335_i < _11639_; ++_5335_i)
      {
        {
          _5334_d1 += _ptr__5329_d1s[_5335_i];
        }
      }
      int32_t _5336_d2 = (int)1;
      int32_t _11640_ = safe_add( dim,(int)1 );
      int32_t _11641_ = _5309_nd;
      for (int32_t _5337_i = _11640_; _5337_i < _11641_; ++_5337_i)
      {
        {
          _5336_d2 *= _ptr__5306_wi32[safe_add( _5310_shape,_5337_i )];
        }
      }
      if (_5311_dense)
      {
        {
          _5287_rs->alloc_expr(_5318_rnd,_5320_rnelem,_5321_rnnz,false,_5319_rncodeatom);
          int32_t _5338_rptr = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->ptr_base;
          int32_t _5339_rshape = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->shape_base;
          int32_t _5340_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->nidxs_base;
          int32_t _5341_rcof = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->cof_base;
          int32_t _5342_rcode = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->code_base;
          int32_t _5343_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->codeptr_base;
          int32_t _5344_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->cconst_base;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5345_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__5345_ri32(_5345_ri32 ? _5345_ri32->raw() : nullptr,_5345_ri32 ? _5345_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _5346_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__5346_ri64(_5346_ri64 ? _5346_ri64->raw() : nullptr,_5346_ri64 ? _5346_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _5347_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->f64;
          _checked_ptr_1<double> _ptr__5347_rf64(_5347_rf64 ? _5347_rf64->raw() : nullptr,_5347_rf64 ? _5347_rf64->size(0) : 0);
          int32_t _11642_;
          bool _11643_ = (_5319_rncodeatom > (int)0);
          if (_11643_)
          {
            _11642_ = _5289_xs->alloci32(safe_add( _5320_rnelem,(int)1 ));
          }
          else
          {
            _11642_ = (-(int)9999);
          }
          int32_t _5348_xcodeptr = _11642_;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5349_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5289_xs)->i32;
          _checked_ptr_1<int32_t> _ptr__5349_xi32(_5349_xi32 ? _5349_xi32->raw() : nullptr,_5349_xi32 ? _5349_xi32->size(0) : 0);
          int32_t _11644_ = (int)0;
          int32_t _11645_ = _5309_nd;
          for (int32_t _5350_i = _11644_; _5350_i < _11645_; ++_5350_i)
          {
            {
              _ptr__5345_ri32[safe_add( _5339_rshape,_5350_i )] = _ptr__5306_wi32[safe_add( _5310_shape,_5350_i )];
            }
          }
          _ptr__5345_ri32[safe_add( _5339_rshape,dim )] = _5316_sdim;
          {
            int32_t _5351_codei = (int)0;
            int32_t _5352_elmi = (int)0;
            int32_t _5353_nzi = (int)0;
            _ptr__5345_ri32[_5338_rptr] = (int)0;
            if (_5322_parameterized)
            {
              {
                _ptr__5345_ri32[_5343_rcodeptr] = (int)0;
              }
            }
            {}
            int32_t _11646_ = (int)0;
            int32_t _11647_ = _5327_d0;
            for (int32_t _5354_i0 = _11646_; _5354_i0 < _11647_; ++_5354_i0)
            {
              {
                int32_t _11648_ = (int)0;
                int32_t _11649_ = _5290_n;
                for (int32_t _5355_i = _11648_; _5355_i < _11649_; ++_5355_i)
                {
                  {
                    int32_t _11650_ = (int)0;
                    int32_t _11651_ = _ptr__5329_d1s[_5355_i];
                    for (int32_t _5356_i1z = _11650_; _5356_i1z < _11651_; ++_5356_i1z)
                    {
                      {
                        int32_t _11652_ = (int)0;
                        int32_t _11653_ = _5336_d2;
                        for (int32_t _5357_i2 = _11652_; _5357_i2 < _11653_; ++_5357_i2)
                        {
                          {
                            int32_t _5358_j = safe_add( safe_add( safe_mul( safe_mul( _5354_i0,_ptr__5329_d1s[_5355_i] ),_5336_d2 ),safe_mul( _5356_i1z,_5336_d2 ) ),_5357_i2 );
                            int32_t _11654_ = _ptr__5306_wi32[safe_add( _ptr__5298_ptr_base[_5355_i],_5358_j )];
                            int32_t _11655_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5298_ptr_base[_5355_i],_5358_j ),(int)1 )];
                            for (int32_t _5359_k = _11654_; _5359_k < _11655_; ++_5359_k)
                            {
                              {
                                _ptr__5346_ri64[safe_add( _5340_rnidxs,_5353_nzi )] = _ptr__5307_wi64[safe_add( _ptr__5299_nidxs_base[_5355_i],_5359_k )];
                                _ptr__5347_rf64[safe_add( _5341_rcof,_5353_nzi )] = _ptr__5308_wf64[safe_add( _ptr__5301_cof_base[_5355_i],_5359_k )];
                                if ((_ptr__5296_ncodeatom[_5355_i] > (int)0))
                                {
                                  {
                                    int32_t _11656_ = _ptr__5306_wi32[safe_add( _ptr__5303_codeptr[_5355_i],_5359_k )];
                                    int32_t _11657_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5303_codeptr[_5355_i],_5359_k ),(int)1 )];
                                    for (int32_t _5360_l = _11656_; _5360_l < _11657_; ++_5360_l)
                                    {
                                      {
                                        _ptr__5345_ri32[safe_add( _5342_rcode,_5351_codei )] = _ptr__5306_wi32[safe_add( _ptr__5302_code[_5355_i],_5360_l )];
                                        _ptr__5347_rf64[safe_add( _5344_rcconst,_5351_codei )] = _ptr__5308_wf64[safe_add( _ptr__5304_cconst[_5355_i],_5360_l )];
                                        ++ _5351_codei;
                                      }
                                    }
                                    _ptr__5345_ri32[safe_add( safe_add( _5343_rcodeptr,_5353_nzi ),(int)1 )] = _5351_codei;
                                  }
                                }
                                else if(_5322_parameterized)
                                {
                                  {
                                    _ptr__5345_ri32[safe_add( _5342_rcode,_5351_codei )] = 2;
                                    _ptr__5347_rf64[safe_add( _5344_rcconst,_5351_codei )] = 0.0;
                                    ++ _5351_codei;
                                    _ptr__5345_ri32[safe_add( safe_add( _5343_rcodeptr,_5353_nzi ),(int)1 )] = _5351_codei;
                                  }
                                }
                                {}
                                ++ _5353_nzi;
                              }
                            }
                            _ptr__5345_ri32[safe_add( safe_add( _5338_rptr,_5352_elmi ),(int)1 )] = _5353_nzi;
                            ++ _5352_elmi;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      else
      {
        {
          int32_t _5361_rshapesize = (int)1;
          int32_t _11658_ = (int)0;
          int32_t _11659_ = dim;
          for (int32_t _5362_i = _11658_; _5362_i < _11659_; ++_5362_i)
          {
            {
              _5361_rshapesize *= _ptr__5306_wi32[safe_add( _5310_shape,_5362_i )];
            }
          }
          _5361_rshapesize *= _5316_sdim;
          int32_t _11660_ = safe_add( dim,(int)1 );
          int32_t _11661_ = _5309_nd;
          for (int32_t _5363_i = _11660_; _5363_i < _11661_; ++_5363_i)
          {
            {
              _5361_rshapesize *= _ptr__5306_wi32[safe_add( _5310_shape,_5363_i )];
            }
          }
          bool _5364_rhassp = (_5320_rnelem < _5361_rshapesize);
          _5287_rs->alloc_expr(_5318_rnd,_5320_rnelem,_5321_rnnz,_5364_rhassp,_5319_rncodeatom);
          int32_t _5365_rptr = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->ptr_base;
          int32_t _5366_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->nidxs_base;
          int32_t _11662_;
          bool _11663_ = _5364_rhassp;
          if (_11663_)
          {
            _11662_ = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->sp_base;
          }
          else
          {
            _11662_ = _5287_rs->alloci64(_5320_rnelem);
          }
          int32_t _5367_rsp = _11662_;
          int32_t _5368_rcof = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->cof_base;
          int32_t _5369_rcode = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->code_base;
          int32_t _5370_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->codeptr_base;
          int32_t _5371_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->cconst_base;
          int32_t _5372_rshape = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->shape_base;
          int32_t _11664_ = (int)0;
          int32_t _11665_ = _5309_nd;
          for (int32_t _5373_i = _11664_; _5373_i < _11665_; ++_5373_i)
          {
            {
              ((*mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i32)(safe_add( _5372_rshape,_5373_i ))) = _ptr__5306_wi32[safe_add( _5310_shape,_5373_i )];
            }
          }
          ((*mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i32)(safe_add( _5372_rshape,dim ))) = _5316_sdim;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5374_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__5374_ri32(_5374_ri32 ? _5374_ri32->raw() : nullptr,_5374_ri32 ? _5374_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _5375_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__5375_ri64(_5375_ri64 ? _5375_ri64->raw() : nullptr,_5375_ri64 ? _5375_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _5376_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5287_rs)->f64;
          _checked_ptr_1<double> _ptr__5376_rf64(_5376_rf64 ? _5376_rf64->raw() : nullptr,_5376_rf64 ? _5376_rf64->size(0) : 0);
          if ((dim == (int)0))
          {
            {
              int32_t _5377_codei = (int)0;
              int32_t _5378_nzi = (int)0;
              int32_t _5379_elmi = (int)0;
              int64_t _5380_spofs = (int64_t)0;
              _ptr__5374_ri32[_5365_rptr] = (int)0;
              if ((_5319_rncodeatom > (int)0))
              {
                {
                  _ptr__5374_ri32[_5370_rcodeptr] = (int)0;
                }
              }
              {}
              int32_t _11666_ = (int)0;
              int32_t _11667_ = _5290_n;
              for (int32_t _5381_i = _11666_; _5381_i < _11667_; ++_5381_i)
              {
                {
                  int32_t _11668_ = (int)0;
                  int32_t _11669_ = _ptr__5294_nelem[_5381_i];
                  for (int32_t _5382_j = _11668_; _5382_j < _11669_; ++_5382_j)
                  {
                    {
                      int32_t _11670_ = _ptr__5306_wi32[safe_add( _ptr__5298_ptr_base[_5381_i],_5382_j )];
                      int32_t _11671_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5298_ptr_base[_5381_i],_5382_j ),(int)1 )];
                      for (int32_t _5383_k = _11670_; _5383_k < _11671_; ++_5383_k)
                      {
                        {
                          _ptr__5375_ri64[safe_add( _5366_rnidxs,_5378_nzi )] = _ptr__5307_wi64[safe_add( _ptr__5299_nidxs_base[_5381_i],_5383_k )];
                          _ptr__5376_rf64[safe_add( _5368_rcof,_5378_nzi )] = _ptr__5308_wf64[safe_add( _ptr__5301_cof_base[_5381_i],_5383_k )];
                          if ((_ptr__5296_ncodeatom[_5381_i] > (int)0))
                          {
                            {
                              int32_t _11672_ = _ptr__5306_wi32[safe_add( _ptr__5303_codeptr[_5381_i],_5383_k )];
                              int32_t _11673_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5303_codeptr[_5381_i],_5383_k ),(int)1 )];
                              for (int32_t _5384_l = _11672_; _5384_l < _11673_; ++_5384_l)
                              {
                                {
                                  _ptr__5374_ri32[safe_add( _5369_rcode,_5377_codei )] = _ptr__5306_wi32[safe_add( _ptr__5302_code[_5381_i],_5384_l )];
                                  _ptr__5376_rf64[safe_add( _5371_rcconst,_5377_codei )] = _ptr__5308_wf64[safe_add( _ptr__5304_cconst[_5381_i],_5384_l )];
                                  ++ _5377_codei;
                                }
                              }
                              _ptr__5374_ri32[safe_add( safe_add( _5370_rcodeptr,_5378_nzi ),(int)1 )] = _5377_codei;
                            }
                          }
                          else if((_5319_rncodeatom > (int)0))
                          {
                            {
                              _ptr__5374_ri32[safe_add( _5369_rcode,_5377_codei )] = 2;
                              _ptr__5376_rf64[safe_add( _5371_rcconst,_5377_codei )] = 0.0;
                              ++ _5377_codei;
                              _ptr__5374_ri32[safe_add( safe_add( _5370_rcodeptr,_5378_nzi ),(int)1 )] = _5377_codei;
                            }
                          }
                          {}
                          ++ _5378_nzi;
                        }
                      }
                      _ptr__5374_ri32[safe_add( safe_add( _5365_rptr,_5379_elmi ),(int)1 )] = _5378_nzi;
                      if ((_ptr__5297_hassp[_5381_i] != (int)0))
                      {
                        {
                          _ptr__5375_ri64[safe_add( _5367_rsp,_5379_elmi )] = safe_add( _5380_spofs,_ptr__5307_wi64[safe_add( _ptr__5300_sp_base[_5381_i],_5382_j )] );
                        }
                      }
                      else
                      {
                        {
                          _ptr__5375_ri64[safe_add( _5367_rsp,_5379_elmi )] = safe_add( _5380_spofs,_5382_j );
                        }
                      }
                      ++ _5379_elmi;
                    }
                  }
                  int64_t _5385_sz = (int64_t)1;
                  int32_t _11674_ = (int)0;
                  int32_t _11675_ = _5309_nd;
                  for (int32_t _5386_j = _11674_; _5386_j < _11675_; ++_5386_j)
                  {
                    {
                      _5385_sz *= _ptr__5306_wi32[safe_add( _ptr__5293_shape_base[_5381_i],_5386_j )];
                    }
                  }
                  _5380_spofs += _5385_sz;
                }
              }
            }
          }
          else
          {
            {
              int32_t _5387_maxdim = (int)0;
              int32_t _11676_ = (int)0;
              int32_t _11677_ = _5318_rnd;
              for (int32_t _5388_i = _11676_; _5388_i < _11677_; ++_5388_i)
              {
                {
                  if ((_5387_maxdim < _ptr__5374_ri32[safe_add( _5372_rshape,_5388_i )]))
                  {
                    {
                      _5387_maxdim = _ptr__5374_ri32[safe_add( _5372_rshape,_5388_i )];
                    }
                  }
                  {}
                }
              }
              int32_t _5389_tsp = _5289_xs->alloci64(_5320_rnelem);
              int32_t _5390_ti = _5289_xs->alloci32(_5320_rnelem);
              int32_t _5391_tj = _5289_xs->alloci32(_5320_rnelem);
              int32_t _5392_curperm = _5289_xs->alloci32(_5320_rnelem);
              int32_t _5393_tgtperm = _5289_xs->alloci32(_5320_rnelem);
              int32_t _5394_xptr = _5289_xs->alloci32(safe_add( _5387_maxdim,(int)1 ));
              std::shared_ptr< monty::ndarray< int32_t,1 > > _5395_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5289_xs)->i32;
              _checked_ptr_1<int32_t> _ptr__5395_xi32(_5395_xi32 ? _5395_xi32->raw() : nullptr,_5395_xi32 ? _5395_xi32->size(0) : 0);
              std::shared_ptr< monty::ndarray< int64_t,1 > > _5396_xi64 = mosek::fusion::p_WorkStack::_get_impl(_5289_xs)->i64;
              _checked_ptr_1<int64_t> _ptr__5396_xi64(_5396_xi64 ? _5396_xi64->raw() : nullptr,_5396_xi64 ? _5396_xi64->size(0) : 0);
              {
                int32_t _5397_elmi = (int)0;
                int32_t _11678_ = (int)0;
                int32_t _11679_ = _5290_n;
                for (int32_t _5398_i = _11678_; _5398_i < _11679_; ++_5398_i)
                {
                  {
                    int32_t _5399_d1 = _ptr__5329_d1s[_5398_i];
                    int32_t _5400_s0 = safe_mul( _5399_d1,_5336_d2 );
                    int32_t _5401_s1 = _5336_d2;
                    if ((_ptr__5297_hassp[_5398_i] != (int)0))
                    {
                      {
                        int32_t _11680_ = (int)0;
                        int32_t _11681_ = _ptr__5294_nelem[_5398_i];
                        for (int32_t _5402_j = _11680_; _5402_j < _11681_; ++_5402_j)
                        {
                          {
                            int64_t _5403_i0 = (_ptr__5307_wi64[safe_add( _ptr__5300_sp_base[_5398_i],_5402_j )] / _5400_s0);
                            int64_t _5404_i1 = ((_ptr__5307_wi64[safe_add( _ptr__5300_sp_base[_5398_i],_5402_j )] / _5401_s1) % _5399_d1);
                            int64_t _5405_i2 = (_ptr__5307_wi64[safe_add( _ptr__5300_sp_base[_5398_i],_5402_j )] % _5336_d2);
                            _ptr__5396_xi64[safe_add( _5389_tsp,_5397_elmi )] = safe_add( safe_mul( safe_add( safe_add( safe_mul( _5403_i0,_5316_sdim ),_5404_i1 ),_ptr__5332_offset[_5398_i] ),_5336_d2 ),_5405_i2 );
                            _ptr__5395_xi32[safe_add( _5390_ti,_5397_elmi )] = _5398_i;
                            _ptr__5395_xi32[safe_add( _5391_tj,_5397_elmi )] = _5402_j;
                            ++ _5397_elmi;
                          }
                        }
                      }
                    }
                    else
                    {
                      {
                        int32_t _11682_ = (int)0;
                        int32_t _11683_ = _ptr__5294_nelem[_5398_i];
                        for (int32_t _5406_j = _11682_; _5406_j < _11683_; ++_5406_j)
                        {
                          {
                            int64_t _5407_i0 = ((int64_t)_5406_j / _5400_s0);
                            int64_t _5408_i1 = (((int64_t)_5406_j / _5401_s1) % _5399_d1);
                            int64_t _5409_i2 = ((int64_t)_5406_j % _5336_d2);
                            _ptr__5396_xi64[safe_add( _5389_tsp,_5397_elmi )] = safe_add( safe_mul( safe_add( safe_add( safe_mul( _5407_i0,_5316_sdim ),_5408_i1 ),_ptr__5332_offset[_5398_i] ),_5336_d2 ),_5409_i2 );
                            _ptr__5395_xi32[safe_add( _5390_ti,_5397_elmi )] = _5398_i;
                            _ptr__5395_xi32[safe_add( _5391_tj,_5397_elmi )] = _5406_j;
                            ++ _5397_elmi;
                          }
                        }
                      }
                    }
                  }
                }
              }
              {
                std::shared_ptr< monty::ndarray< int64_t,1 > > _5410_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5318_rnd)));
                _checked_ptr_1<int64_t> _ptr__5410_s(_5410_s ? _5410_s->raw() : nullptr,_5410_s ? _5410_s->size(0) : 0);
                _ptr__5410_s[(_5318_rnd - (int)1)] = (int)1;
                int32_t _11684_ = (int)1;
                int32_t _11685_ = _5318_rnd;
                for (int32_t _5411_i = _11684_; _5411_i < _11685_; ++_5411_i)
                {
                  {
                    _ptr__5410_s[((_5318_rnd - _5411_i) - (int)1)] = safe_mul( _ptr__5410_s[(_5318_rnd - _5411_i)],_ptr__5374_ri32[(safe_add( _5372_rshape,_5318_rnd ) - _5411_i)] );
                  }
                }
                int32_t _11686_ = (int)0;
                int32_t _11687_ = _5320_rnelem;
                for (int32_t _5412_i = _11686_; _5412_i < _11687_; ++_5412_i)
                {
                  {
                    _ptr__5395_xi32[safe_add( _5392_curperm,_5412_i )] = _5412_i;
                  }
                }
                int32_t _11688_ = (int)0;
                int32_t _11689_ = _5318_rnd;
                for (int32_t _5413_ii = _11688_; _5413_ii < _11689_; ++_5413_ii)
                {
                  {
                    int32_t _5414_i = ((_5318_rnd - _5413_ii) - (int)1);
                    int32_t _5415_di = _ptr__5374_ri32[safe_add( _5372_rshape,_5414_i )];
                    int32_t _11690_ = (int)0;
                    int32_t _11691_ = safe_add( _5415_di,(int)1 );
                    for (int32_t _5416_k = _11690_; _5416_k < _11691_; ++_5416_k)
                    {
                      {
                        _ptr__5395_xi32[safe_add( _5394_xptr,_5416_k )] = (int)0;
                      }
                    }
                    int32_t _11692_ = (int)0;
                    int32_t _11693_ = _5320_rnelem;
                    for (int32_t _5417_kk = _11692_; _5417_kk < _11693_; ++_5417_kk)
                    {
                      {
                        int32_t _5418_k = _ptr__5395_xi32[safe_add( _5392_curperm,_5417_kk )];
                        int64_t _5419_sub = ((_ptr__5396_xi64[safe_add( _5389_tsp,_5418_k )] / _ptr__5410_s[_5414_i]) % _5415_di);
                        ++ _ptr__5395_xi32[safe_add( safe_add( _5394_xptr,_5419_sub ),(int)1 )];
                      }
                    }
                    {
                      int32_t _11694_ = (int)0;
                      int32_t _11695_ = _5415_di;
                      for (int32_t _5420_k = _11694_; _5420_k < _11695_; ++_5420_k)
                      {
                        {
                          _ptr__5395_xi32[safe_add( safe_add( _5394_xptr,_5420_k ),(int)1 )] += _ptr__5395_xi32[safe_add( _5394_xptr,_5420_k )];
                        }
                      }
                      int32_t _11696_ = (int)0;
                      int32_t _11697_ = _5320_rnelem;
                      for (int32_t _5421_kk = _11696_; _5421_kk < _11697_; ++_5421_kk)
                      {
                        {
                          int32_t _5422_k = _ptr__5395_xi32[safe_add( _5392_curperm,_5421_kk )];
                          int64_t _5423_sub = ((_ptr__5396_xi64[safe_add( _5389_tsp,_5422_k )] / _ptr__5410_s[_5414_i]) % _5415_di);
                          _ptr__5395_xi32[safe_add( _5393_tgtperm,_ptr__5395_xi32[safe_add( _5394_xptr,_5423_sub )] )] = _5422_k;
                          ++ _ptr__5395_xi32[safe_add( _5394_xptr,_5423_sub )];
                        }
                      }
                    }
                    int32_t _5424_tmp = _5392_curperm;
                    _5392_curperm = _5393_tgtperm;
                    _5393_tgtperm = _5424_tmp;
                  }
                }
              }
              {
                int32_t _5425_codei = (int)0;
                int32_t _5426_nzi = (int)0;
                _ptr__5374_ri32[_5365_rptr] = (int)0;
                if ((_5319_rncodeatom > (int)0))
                {
                  {
                    _ptr__5374_ri32[_5370_rcodeptr] = (int)0;
                  }
                }
                {}
                int32_t _11698_ = (int)0;
                int32_t _11699_ = _5320_rnelem;
                for (int32_t _5427_elmi = _11698_; _5427_elmi < _11699_; ++_5427_elmi)
                {
                  {
                    int32_t _5428_pelmi = _ptr__5395_xi32[safe_add( _5392_curperm,_5427_elmi )];
                    int32_t _5429_i = _ptr__5395_xi32[safe_add( _5390_ti,_5428_pelmi )];
                    int32_t _5430_j = _ptr__5395_xi32[safe_add( _5391_tj,_5428_pelmi )];
                    int32_t _11700_ = _ptr__5306_wi32[safe_add( _ptr__5298_ptr_base[_5429_i],_5430_j )];
                    int32_t _11701_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5298_ptr_base[_5429_i],_5430_j ),(int)1 )];
                    for (int32_t _5431_k = _11700_; _5431_k < _11701_; ++_5431_k)
                    {
                      {
                        _ptr__5375_ri64[safe_add( _5366_rnidxs,_5426_nzi )] = _ptr__5307_wi64[safe_add( _ptr__5299_nidxs_base[_5429_i],_5431_k )];
                        _ptr__5376_rf64[safe_add( _5368_rcof,_5426_nzi )] = _ptr__5308_wf64[safe_add( _ptr__5301_cof_base[_5429_i],_5431_k )];
                        if ((_ptr__5296_ncodeatom[_5429_i] > (int)0))
                        {
                          {
                            int32_t _11702_ = _ptr__5306_wi32[safe_add( _ptr__5303_codeptr[_5429_i],_5431_k )];
                            int32_t _11703_ = _ptr__5306_wi32[safe_add( safe_add( _ptr__5303_codeptr[_5429_i],_5431_k ),(int)1 )];
                            for (int32_t _5432_l = _11702_; _5432_l < _11703_; ++_5432_l)
                            {
                              {
                                _ptr__5374_ri32[safe_add( _5369_rcode,_5425_codei )] = _ptr__5306_wi32[safe_add( _ptr__5302_code[_5429_i],_5432_l )];
                                _ptr__5376_rf64[safe_add( _5371_rcconst,_5425_codei )] = _ptr__5308_wf64[safe_add( _ptr__5304_cconst[_5429_i],_5432_l )];
                                ++ _5425_codei;
                              }
                            }
                            _ptr__5374_ri32[safe_add( safe_add( _5370_rcodeptr,_5426_nzi ),(int)1 )] = _5425_codei;
                          }
                        }
                        else if(_5322_parameterized)
                        {
                          {
                            _ptr__5374_ri32[safe_add( _5369_rcode,_5425_codei )] = 2;
                            _ptr__5376_rf64[safe_add( _5371_rcconst,_5425_codei )] = 0.0;
                            ++ _5425_codei;
                            _ptr__5374_ri32[safe_add( safe_add( _5370_rcodeptr,_5426_nzi ),(int)1 )] = _5425_codei;
                          }
                        }
                        {}
                        ++ _5426_nzi;
                      }
                    }
                    _ptr__5374_ri32[safe_add( safe_add( _5365_rptr,_5427_elmi ),(int)1 )] = _5426_nzi;
                    _ptr__5375_ri64[safe_add( _5367_rsp,_5427_elmi )] = _ptr__5396_xi64[safe_add( _5389_tsp,_5428_pelmi )];
                  }
                }
              }
            }
          }
          if ((!_5364_rhassp))
          {
            {
              _5287_rs->popi64(_5320_rnelem);
            }
          }
          {}
        }
      }
    }
  }
}
// End mosek.fusion.ExprStack.eval

// Begin mosek.fusion.ExprStack.getshape
// Method mosek.fusion.ExprStack.getshape @ bld/docker-win/final/default/src/fusion/ExprStack.monty:16:6-47:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprStack::getshape(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _5433_es,int32_t _5434_dim)
{
  if (((int)((_5433_es)->size(0)) == (int)0))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Cannot stack empty list"));
    }
  }
  else if(((int)((_5433_es)->size(0)) == (int)1))
  {
    {
      return ((*_5433_es)((int)0))->getShape();
    }
  }
  else
  {
    {
      std::vector<std::shared_ptr< monty::ndarray< int32_t,1 > >> _11704_;
      for (int32_t _5436_i = (int)0, _11705_ = (int)((_5433_es)->size(0)); _5436_i < _11705_ ; ++_5436_i)
      {
        _11704_.push_back(((*_5433_es)(_5436_i))->getShape());
      }
      auto _11706_ = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 >(monty::shape(_11704_.size()),_11704_.begin(),_11704_.end()));
      std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _5435_shapes = _11706_;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5437_shape = ((*_5435_shapes)((int)0));
      _checked_ptr_1<int32_t> _ptr__5437_shape(_5437_shape ? _5437_shape->raw() : nullptr,_5437_shape ? _5437_shape->size(0) : 0);
      int32_t _5438_nd = (int)((_5437_shape)->size(0));
      int32_t _11707_ = (int)1;
      int32_t _11708_ = (int)((_5435_shapes)->size(0));
      for (int32_t _5439_i = _11707_; _5439_i < _11708_; ++_5439_i)
      {
        {
          if ((_5438_nd != (int)((((*_5435_shapes)(_5439_i)))->size(0))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression dimensions"));
            }
          }
          {}
          int32_t _11709_ = (int)0;
          int32_t _11710_ = _5434_dim;
          for (int32_t _5440_j = _11709_; _5440_j < _11710_; ++_5440_j)
          {
            {
              if ((_ptr__5437_shape[_5440_j] != ((*((*_5435_shapes)(_5439_i)))(_5440_j))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("mismatching expression dimensions"));
                }
              }
              {}
            }
          }
          int32_t _11711_ = safe_add( _5434_dim,(int)1 );
          int32_t _11712_ = _5438_nd;
          for (int32_t _5441_j = _11711_; _5441_j < _11712_; ++_5441_j)
          {
            {
              if ((_ptr__5437_shape[_5441_j] != ((*((*_5435_shapes)(_5439_i)))(_5441_j))))
              {
                {
                  throw ::mosek::fusion::DimensionError(std::string ("mismatching expression dimensions"));
                }
              }
              {}
            }
          }
        }
      }
      if ((_5434_dim == _5438_nd))
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5442_resshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _5438_nd,(int)1 ))));
          _checked_ptr_1<int32_t> _ptr__5442_resshape(_5442_resshape ? _5442_resshape->raw() : nullptr,_5442_resshape ? _5442_resshape->size(0) : 0);
          int32_t _11713_ = (int)0;
          int32_t _11714_ = _5438_nd;
          for (int32_t _5443_i = _11713_; _5443_i < _11714_; ++_5443_i)
          {
            {
              _ptr__5442_resshape[_5443_i] = _ptr__5437_shape[_5443_i];
            }
          }
          _ptr__5442_resshape[_5438_nd] = (int)((_5435_shapes)->size(0));
          return _5442_resshape;
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _5444_resshape = _5437_shape;
          _checked_ptr_1<int32_t> _ptr__5444_resshape(_5444_resshape ? _5444_resshape->raw() : nullptr,_5444_resshape ? _5444_resshape->size(0) : 0);
          int32_t _11715_ = (int)1;
          int32_t _11716_ = (int)((_5435_shapes)->size(0));
          for (int32_t _5445_i = _11715_; _5445_i < _11716_; ++_5445_i)
          {
            {
              _ptr__5444_resshape[_5434_dim] += ((*((*_5435_shapes)(_5445_i)))(_5434_dim));
            }
          }
          return _5444_resshape;
        }
      }
    }
  }
}
// End mosek.fusion.ExprStack.getshape

// Begin mosek.fusion.ExprStack.toString
// Method mosek.fusion.ExprStack.toString @ bld/docker-win/final/default/src/fusion/ExprStack.monty:8:6-14:7
std::string mosek::fusion::ExprStack :: toString() { return mosek::fusion::p_ExprStack::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprStack::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _5446_b = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprStack(dim="))->__mosek_2fusion_2Utils_2StringBuffer__a(dim)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",["))->__mosek_2fusion_2Utils_2StringBuffer__a(((*exprs)((int)0))->toString());
  int32_t _11717_ = (int)1;
  int32_t _11718_ = (int)((exprs)->size(0));
  for (int32_t _5447_i = _11717_; _5447_i < _11718_; ++_5447_i)
  {
    {
      _5446_b->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*exprs)(_5447_i))->toString());
    }
  }
  _5446_b->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("])"));
  return _5446_b->toString();
}
// End mosek.fusion.ExprStack.toString

void mosek::fusion::p_ExprStack::destroy()
{
  exprs.reset();
}
void mosek::fusion::ExprStack::destroy() { mosek::fusion::p_ExprStack::_get_impl(this)->destroy(); }
// } class ExprStack
// class ExprInner { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2320:4-2512:5
mosek::fusion::ExprInner::ExprInner(mosek::fusion::p_ExprInner *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprInner()" << this << std::endl; */ }
mosek::fusion::ExprInner::~ExprInner() {  /* std::cout << "~ExprInner()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprInner::p_ExprInner
  (::mosek::fusion::ExprInner * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprInner.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2352:6-2380:7
mosek::fusion::ExprInner::t mosek::fusion::p_ExprInner::_new_ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5448_expr3,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5449_vsub3,
    std::shared_ptr< monty::ndarray< double,1 > > _5450_vcof3)
{ return new mosek::fusion::ExprInner(_5448_expr3,_5449_vsub3,_5450_vcof3); }
mosek::fusion::ExprInner::ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5448_expr3,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5449_vsub3,
    std::shared_ptr< monty::ndarray< double,1 > > _5450_vcof3) : 
   ExprInner(new mosek::fusion::p_ExprInner(this))
{ mosek::fusion::p_ExprInner::_get_impl(this)->_initialize(_5448_expr3,_5449_vsub3,_5450_vcof3); }
void mosek::fusion::p_ExprInner::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5448_expr3,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5449_vsub3,
    std::shared_ptr< monty::ndarray< double,1 > > _5450_vcof3)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int64_t> _ptr__5449_vsub3(_5449_vsub3 ? _5449_vsub3->raw() : nullptr, _5449_vsub3 ? _5449_vsub3->size(0) : 0);
    _checked_ptr_1<double> _ptr__5450_vcof3(_5450_vcof3 ? _5450_vcof3->raw() : nullptr, _5450_vcof3 ? _5450_vcof3->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))));
    mosek::fusion::p_ExprInner::_get_impl(::mosek::fusion::ExprInner::t(_pubthis))->expr = _5448_expr3;
    mosek::fusion::p_ExprInner::_get_impl(::mosek::fusion::ExprInner::t(_pubthis))->vsub = _5449_vsub3;
    mosek::fusion::p_ExprInner::_get_impl(::mosek::fusion::ExprInner::t(_pubthis))->vcof = _5450_vcof3;
    if (((int)((_5449_vsub3)->size(0)) != (int)((_5450_vcof3)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Mismatching lengths of vcof and vsub"));
      }
    }
    {}
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5451_shp = _5448_expr3->getShape();
    _checked_ptr_1<int32_t> _ptr__5451_shp(_5451_shp ? _5451_shp->raw() : nullptr,_5451_shp ? _5451_shp->size(0) : 0);
    int64_t _5452_size = ::mosek::fusion::p_Set::size(_5451_shp);
    bool _5453_err_sorted = false;
    bool _5454_err_bounds = false;
    {
      int32_t _11719_ = (int)1;
      int32_t _11720_ = (int)((_5449_vsub3)->size(0));
      for (int32_t _5455_i = _11719_; _5455_i < _11720_; ++_5455_i)
      {
        {
          if ((_ptr__5449_vsub3[_5455_i] <= _ptr__5449_vsub3[(_5455_i - (int)1)]))
          {
            {
              _5453_err_sorted = true;
            }
          }
          {}
        }
      }
      if (((int)((_5449_vsub3)->size(0)) > (int)0))
      {
        {
          if (((_ptr__5449_vsub3[(int)0] < (int)0) || (_ptr__5449_vsub3[((int)((_5449_vsub3)->size(0)) - (int)1)] > _5452_size)))
          {
            {
              _5454_err_bounds = true;
            }
          }
          {}
        }
      }
      {}
    }
    if (_5453_err_sorted)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Unordered coefficcient subscripts"));
      }
    }
    {}
    if (_5454_err_bounds)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Coefficient subscript out of bounds"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprInner.ctor

// mosek.fusion.ExprInner.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2343:6-2350:7
mosek::fusion::ExprInner::t mosek::fusion::p_ExprInner::_new_ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5456_expr2,
    std::shared_ptr< monty::ndarray< double,1 > > _5457_vcof2)
{ return new mosek::fusion::ExprInner(_5456_expr2,_5457_vcof2); }
mosek::fusion::ExprInner::ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5456_expr2,
    std::shared_ptr< monty::ndarray< double,1 > > _5457_vcof2) : 
   ExprInner(new mosek::fusion::p_ExprInner(this))
{ mosek::fusion::p_ExprInner::_get_impl(this)->_initialize(_5456_expr2,_5457_vcof2); }
void mosek::fusion::p_ExprInner::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5456_expr2,
    std::shared_ptr< monty::ndarray< double,1 > > _5457_vcof2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__5457_vcof2(_5457_vcof2 ? _5457_vcof2->raw() : nullptr, _5457_vcof2 ? _5457_vcof2->size(0) : 0);
    mosek::fusion::p_ExprInner::_initialize(_5456_expr2,::mosek::fusion::p_ExprInner::range((int)((_5457_vcof2)->size(0))),_5457_vcof2);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5458_eshape = _5456_expr2->getShape();
    _checked_ptr_1<int32_t> _ptr__5458_eshape(_5458_eshape ? _5458_eshape->raw() : nullptr,_5458_eshape ? _5458_eshape->size(0) : 0);
    if ((((int)((_5458_eshape)->size(0)) != (int)1) || (_ptr__5458_eshape[(int)0] != (int)((_5457_vcof2)->size(0)))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions of operands"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprInner.ctor

// mosek.fusion.ExprInner.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2339:6-2341:7
mosek::fusion::ExprInner::t mosek::fusion::p_ExprInner::_new_ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5459_expr1,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _5460_vsub1,
    std::shared_ptr< monty::ndarray< double,1 > > _5461_vcof1)
{ return new mosek::fusion::ExprInner(_5459_expr1,_5460_vsub1,_5461_vcof1); }
mosek::fusion::ExprInner::ExprInner
  (monty::rc_ptr< ::mosek::fusion::Expression > _5459_expr1,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _5460_vsub1,
    std::shared_ptr< monty::ndarray< double,1 > > _5461_vcof1) : 
   ExprInner(new mosek::fusion::p_ExprInner(this))
{ mosek::fusion::p_ExprInner::_get_impl(this)->_initialize(_5459_expr1,_5460_vsub1,_5461_vcof1); }
void mosek::fusion::p_ExprInner::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _5459_expr1,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _5460_vsub1,
    std::shared_ptr< monty::ndarray< double,1 > > _5461_vcof1)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__5461_vcof1(_5461_vcof1 ? _5461_vcof1->raw() : nullptr, _5461_vcof1 ? _5461_vcof1->size(0) : 0);
    mosek::fusion::p_ExprInner::_initialize(_5459_expr1,::mosek::fusion::p_ExprInner::convert(_5459_expr1->getShape(),_5460_vsub1),_5461_vcof1);
  }
}
// mosek.fusion.ExprInner.ctor

// Begin mosek.fusion.ExprInner.eval
// Method mosek.fusion.ExprInner.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2382:6-2511:7
void mosek::fusion::ExprInner :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5462_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5463_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5464_xs) { mosek::fusion::p_ExprInner::_get_impl(this)->eval(_5462_rs,_5463_ws,_5464_xs); }
void mosek::fusion::p_ExprInner::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5462_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5463_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5464_xs)
{
  expr->eval(_5463_ws,_5462_rs,_5464_xs);
  _5463_ws->pop_expr();
  int32_t _5465_nd = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->nd;
  int32_t _5466_nelem = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->nelem;
  int32_t _5467_nnz = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->nnz;
  int32_t _5468_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->ncodeatom;
  bool _5469_hassp = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->hassp;
  int32_t _5470_shape = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->shape_base;
  int32_t _5471_ptr = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->ptr_base;
  int32_t _5472_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->nidxs_base;
  int32_t _5473_sp = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->sp_base;
  int32_t _5474_cof = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->cof_base;
  int32_t _5475_code = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->code_base;
  int32_t _5476_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->codeptr_base;
  int32_t _5477_cconst = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5478_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5478_wi32(_5478_wi32 ? _5478_wi32->raw() : nullptr,_5478_wi32 ? _5478_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5479_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5479_wi64(_5479_wi64 ? _5479_wi64->raw() : nullptr,_5479_wi64 ? _5479_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5480_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5463_ws)->f64;
  _checked_ptr_1<double> _ptr__5480_wf64(_5480_wf64 ? _5480_wf64->raw() : nullptr,_5480_wf64 ? _5480_wf64->size(0) : 0);
  int32_t _5481_rnnz = (int)0;
  if (_5469_hassp)
  {
    {
      int32_t _5482_i1 = (int)0;
      int32_t _5483_i0 = (int)0;
      while ( ((_5483_i0 < (int)((vsub)->size(0))) && (_5482_i1 < _5466_nelem)) )
      {
        {
          if ((_ptr__5479_wi64[safe_add( _5473_sp,_5482_i1 )] < ((*vsub)(_5483_i0))))
          {
            {
              ++ _5482_i1;
            }
          }
          else if((_ptr__5479_wi64[safe_add( _5473_sp,_5482_i1 )] > ((*vsub)(_5483_i0))))
          {
            {
              ++ _5483_i0;
            }
          }
          else
          {
            {
              _5481_rnnz += (_ptr__5478_wi32[safe_add( safe_add( _5471_ptr,_5482_i1 ),(int)1 )] - _ptr__5478_wi32[safe_add( _5471_ptr,_5482_i1 )]);
              ++ _5483_i0;
              ++ _5482_i1;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _11721_ = (int)0;
      int32_t _11722_ = (int)((vsub)->size(0));
      for (int32_t _5484_i = _11721_; _5484_i < _11722_; ++_5484_i)
      {
        {
          _5481_rnnz += (_ptr__5478_wi32[safe_add( safe_add( _5471_ptr,((*vsub)(_5484_i)) ),(int)1 )] - _ptr__5478_wi32[safe_add( _5471_ptr,((*vsub)(_5484_i)) )]);
        }
      }
    }
  }
  int32_t _11723_;
  bool _11724_ = (_5468_ncodeatom > (int)0);
  if (_11724_)
  {
    _11723_ = safe_add( _5468_ncodeatom,safe_mul( (int)2,_5467_nnz ) );
  }
  else
  {
    _11723_ = (int)0;
  }
  int32_t _5485_rncodeatom = _11723_;
  _5462_rs->alloc_expr((int)0,(int)1,_5481_rnnz,false,_5485_rncodeatom);
  int32_t _5486_rptr = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->ptr_base;
  int32_t _5487_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->nidxs_base;
  int32_t _5488_rcof = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->cof_base;
  int32_t _5489_rcode = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->code_base;
  int32_t _5490_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->codeptr_base;
  int32_t _5491_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5492_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5492_ri32(_5492_ri32 ? _5492_ri32->raw() : nullptr,_5492_ri32 ? _5492_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5493_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5493_ri64(_5493_ri64 ? _5493_ri64->raw() : nullptr,_5493_ri64 ? _5493_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5494_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5462_rs)->f64;
  _checked_ptr_1<double> _ptr__5494_rf64(_5494_rf64 ? _5494_rf64->raw() : nullptr,_5494_rf64 ? _5494_rf64->size(0) : 0);
  _ptr__5492_ri32[_5486_rptr] = (int)0;
  _ptr__5492_ri32[safe_add( _5486_rptr,(int)1 )] = _5481_rnnz;
  if ((_5485_rncodeatom > (int)0))
  {
    {
      _ptr__5492_ri32[_5490_rcodeptr] = (int)0;
    }
  }
  {}
  int32_t _5495_codei = (int)0;
  int32_t _5496_k = (int)0;
  if (_5469_hassp)
  {
    {
      int32_t _5497_i1 = (int)0;
      int32_t _5498_i0 = (int)0;
      while ( ((_5498_i0 < (int)((vsub)->size(0))) && (_5497_i1 < _5466_nelem)) )
      {
        {
          if ((_ptr__5479_wi64[safe_add( _5473_sp,_5497_i1 )] < ((*vsub)(_5498_i0))))
          {
            {
              ++ _5497_i1;
            }
          }
          else if((_ptr__5479_wi64[safe_add( _5473_sp,_5497_i1 )] > ((*vsub)(_5498_i0))))
          {
            {
              ++ _5498_i0;
            }
          }
          else
          {
            {
              int32_t _5499_p0 = _ptr__5478_wi32[safe_add( _5471_ptr,_5497_i1 )];
              int32_t _5500_p1 = _ptr__5478_wi32[safe_add( safe_add( _5471_ptr,_5497_i1 ),(int)1 )];
              int32_t _11725_ = _5499_p0;
              int32_t _11726_ = _5500_p1;
              for (int32_t _5501_j = _11725_; _5501_j < _11726_; ++_5501_j)
              {
                {
                  _ptr__5493_ri64[safe_add( _5487_rnidxs,_5496_k )] = _ptr__5479_wi64[safe_add( _5472_nidxs,_5501_j )];
                  _ptr__5494_rf64[safe_add( _5488_rcof,_5496_k )] = (((*vcof)(_5498_i0)) * _ptr__5480_wf64[safe_add( _5474_cof,_5501_j )]);
                  if ((_5485_rncodeatom > (int)0))
                  {
                    {
                      int32_t _11727_ = _ptr__5478_wi32[safe_add( _5476_codeptr,_5501_j )];
                      int32_t _11728_ = _ptr__5478_wi32[safe_add( safe_add( _5476_codeptr,_5501_j ),(int)1 )];
                      for (int32_t _5502_l = _11727_; _5502_l < _11728_; ++_5502_l)
                      {
                        {
                          _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = _ptr__5478_wi32[safe_add( _5475_code,_5502_l )];
                          _ptr__5494_rf64[safe_add( _5491_rcconst,_5495_codei )] = _ptr__5480_wf64[safe_add( _5477_cconst,_5502_l )];
                          ++ _5495_codei;
                        }
                      }
                      _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = 2;
                      _ptr__5494_rf64[safe_add( _5491_rcconst,_5495_codei )] = ((*vcof)(_5498_i0));
                      ++ _5495_codei;
                      _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = 5;
                      ++ _5495_codei;
                      _ptr__5492_ri32[safe_add( safe_add( _5490_rcodeptr,_5496_k ),(int)1 )] = _5495_codei;
                    }
                  }
                  {}
                  ++ _5496_k;
                }
              }
              ++ _5498_i0;
              ++ _5497_i1;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _11729_ = (int)0;
      int32_t _11730_ = (int)((vsub)->size(0));
      for (int32_t _5503_i = _11729_; _5503_i < _11730_; ++_5503_i)
      {
        {
          int32_t _5504_p0 = _ptr__5478_wi32[safe_add( _5471_ptr,((*vsub)(_5503_i)) )];
          int32_t _5505_p1 = _ptr__5478_wi32[safe_add( safe_add( _5471_ptr,((*vsub)(_5503_i)) ),(int)1 )];
          int32_t _11731_ = _5504_p0;
          int32_t _11732_ = _5505_p1;
          for (int32_t _5506_j = _11731_; _5506_j < _11732_; ++_5506_j)
          {
            {
              _ptr__5493_ri64[safe_add( _5487_rnidxs,_5496_k )] = _ptr__5479_wi64[safe_add( _5472_nidxs,_5506_j )];
              _ptr__5494_rf64[safe_add( _5488_rcof,_5496_k )] = (((*vcof)(_5503_i)) * _ptr__5480_wf64[safe_add( _5474_cof,_5506_j )]);
              if ((_5485_rncodeatom > (int)0))
              {
                {
                  int32_t _11733_ = _ptr__5478_wi32[safe_add( _5476_codeptr,_5506_j )];
                  int32_t _11734_ = _ptr__5478_wi32[safe_add( safe_add( _5476_codeptr,_5506_j ),(int)1 )];
                  for (int32_t _5507_l = _11733_; _5507_l < _11734_; ++_5507_l)
                  {
                    {
                      _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = _ptr__5478_wi32[safe_add( _5475_code,_5507_l )];
                      _ptr__5494_rf64[safe_add( _5491_rcconst,_5495_codei )] = _ptr__5480_wf64[safe_add( _5477_cconst,_5507_l )];
                      ++ _5495_codei;
                    }
                  }
                  _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = 2;
                  _ptr__5494_rf64[safe_add( _5491_rcconst,_5495_codei )] = ((*vcof)(_5503_i));
                  ++ _5495_codei;
                  _ptr__5492_ri32[safe_add( _5489_rcode,_5495_codei )] = 5;
                  ++ _5495_codei;
                  _ptr__5492_ri32[safe_add( safe_add( _5490_rcodeptr,_5496_k ),(int)1 )] = _5495_codei;
                }
              }
              {}
              ++ _5496_k;
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprInner.eval

// Begin mosek.fusion.ExprInner.range
// Method mosek.fusion.ExprInner.range @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2337:6-90
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_ExprInner::range(int32_t _5508_n)
{
  std::vector<int64_t> _11735_;
  for (int32_t _5509_i = (int)0, _11736_ = _5508_n; _5509_i < _11736_ ; ++_5509_i)
  {
    _11735_.push_back(_5509_i);
  }
  auto _11737_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_11735_.size()),_11735_.begin(),_11735_.end()));
  return _11737_;
}
// End mosek.fusion.ExprInner.range

// Begin mosek.fusion.ExprInner.convert
// Method mosek.fusion.ExprInner.convert @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2327:6-2335:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_ExprInner::convert(std::shared_ptr< monty::ndarray< int32_t,1 > > _5510_shape,std::shared_ptr< monty::ndarray< int32_t,2 > > _5511_vsub)
{
  _checked_ptr_1<int32_t> _ptr__5510_shape(_5510_shape ? _5510_shape->raw() : nullptr, _5510_shape ? _5510_shape->size(0) : 0);
  int32_t _5512_nd = (int)((_5510_shape)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5513_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_5512_nd)));
  _checked_ptr_1<int64_t> _ptr__5513_s(_5513_s ? _5513_s->raw() : nullptr,_5513_s ? _5513_s->size(0) : 0);
  _ptr__5513_s[(_5512_nd - (int)1)] = (int)1;
  int32_t _11738_ = (int)1;
  int32_t _11739_ = _5512_nd;
  for (int32_t _5514_i = _11738_; _5514_i < _11739_; ++_5514_i)
  {
    {
      _ptr__5513_s[((_5512_nd - _5514_i) - (int)1)] = safe_mul( _ptr__5513_s[(_5512_nd - _5514_i)],_ptr__5510_shape[(_5512_nd - _5514_i)] );
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5515_res = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_5511_vsub)->size(0)))));
  _checked_ptr_1<int64_t> _ptr__5515_res(_5515_res ? _5515_res->raw() : nullptr,_5515_res ? _5515_res->size(0) : 0);
  int32_t _11740_ = (int)0;
  int32_t _11741_ = (int)((_5511_vsub)->size(0));
  for (int32_t _5516_i = _11740_; _5516_i < _11741_; ++_5516_i)
  {
    {
      int32_t _11742_ = (int)0;
      int32_t _11743_ = _5512_nd;
      for (int32_t _5517_j = _11742_; _5517_j < _11743_; ++_5517_j)
      {
        {
          _ptr__5515_res[_5516_i] += safe_mul( _ptr__5513_s[_5517_j],((*_5511_vsub)(_5516_i,_5517_j)) );
        }
      }
    }
  }
  return _5515_res;
}
// End mosek.fusion.ExprInner.convert

// Begin mosek.fusion.ExprInner.toString
// Method mosek.fusion.ExprInner.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2325:6-64
std::string mosek::fusion::ExprInner :: toString() { return mosek::fusion::p_ExprInner::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprInner::toString()
{
  return std::string ("ExprInner()");
}
// End mosek.fusion.ExprInner.toString

void mosek::fusion::p_ExprInner::destroy()
{
  vcof.reset();
  vsub.reset();
  expr.reset();
}
void mosek::fusion::ExprInner::destroy() { mosek::fusion::p_ExprInner::_get_impl(this)->destroy(); }
// } class ExprInner
// class ExprMulDiagRight { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1961:4-2316:5
mosek::fusion::ExprMulDiagRight::ExprMulDiagRight(mosek::fusion::p_ExprMulDiagRight *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulDiagRight()" << this << std::endl; */ }
mosek::fusion::ExprMulDiagRight::~ExprMulDiagRight() {  /* std::cout << "~ExprMulDiagRight()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulDiagRight::p_ExprMulDiagRight
  (::mosek::fusion::ExprMulDiagRight * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulDiagRight.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2047:6-2065:7
mosek::fusion::ExprMulDiagRight::t mosek::fusion::p_ExprMulDiagRight::_new_ExprMulDiagRight
  (int32_t _5518_mdim0,
    int32_t _5519_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5520_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5521_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5522_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5523_expr,
    int32_t _5524_validated)
{ return new mosek::fusion::ExprMulDiagRight(_5518_mdim0,_5519_mdim1,_5520_msubi,_5521_msubj,_5522_mval,_5523_expr,_5524_validated); }
mosek::fusion::ExprMulDiagRight::ExprMulDiagRight
  (int32_t _5518_mdim0,
    int32_t _5519_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5520_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5521_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5522_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5523_expr,
    int32_t _5524_validated) : 
   ExprMulDiagRight(new mosek::fusion::p_ExprMulDiagRight(this))
{ mosek::fusion::p_ExprMulDiagRight::_get_impl(this)->_initialize(_5518_mdim0,_5519_mdim1,_5520_msubi,_5521_msubj,_5522_mval,_5523_expr,_5524_validated); }
void mosek::fusion::p_ExprMulDiagRight::_initialize  (int32_t _5518_mdim0,
    int32_t _5519_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5520_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5521_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5522_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5523_expr,
    int32_t _5524_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5520_msubi(_5520_msubi ? _5520_msubi->raw() : nullptr, _5520_msubi ? _5520_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5521_msubj(_5521_msubj ? _5521_msubj->raw() : nullptr, _5521_msubj ? _5521_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5522_mval(_5522_mval ? _5522_mval->raw() : nullptr, _5522_mval ? _5522_mval->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_5519_mdim1)}));
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->mdim0 = _5518_mdim0;
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->mdim1 = _5519_mdim1;
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->msubi = _5520_msubi;
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->msubj = _5521_msubj;
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->mval = _5522_mval;
    mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->expr = _5523_expr;
  }
}
// mosek.fusion.ExprMulDiagRight.ctor

// mosek.fusion.ExprMulDiagRight.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2035:6-2045:7
mosek::fusion::ExprMulDiagRight::t mosek::fusion::p_ExprMulDiagRight::_new_ExprMulDiagRight
  (int32_t _5525_mdim0,
    int32_t _5526_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5527_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5528_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5529_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5530_expr)
{ return new mosek::fusion::ExprMulDiagRight(_5525_mdim0,_5526_mdim1,_5527_msubi,_5528_msubj,_5529_mval,_5530_expr); }
mosek::fusion::ExprMulDiagRight::ExprMulDiagRight
  (int32_t _5525_mdim0,
    int32_t _5526_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5527_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5528_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5529_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5530_expr) : 
   ExprMulDiagRight(new mosek::fusion::p_ExprMulDiagRight(this))
{ mosek::fusion::p_ExprMulDiagRight::_get_impl(this)->_initialize(_5525_mdim0,_5526_mdim1,_5527_msubi,_5528_msubj,_5529_mval,_5530_expr); }
void mosek::fusion::p_ExprMulDiagRight::_initialize  (int32_t _5525_mdim0,
    int32_t _5526_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5527_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5528_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5529_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5530_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5527_msubi(_5527_msubi ? _5527_msubi->raw() : nullptr, _5527_msubi ? _5527_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5528_msubj(_5528_msubj ? _5528_msubj->raw() : nullptr, _5528_msubj ? _5528_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5529_mval(_5529_mval ? _5529_mval->raw() : nullptr, _5529_mval ? _5529_mval->size(0) : 0);
    mosek::fusion::p_ExprMulDiagRight::_initialize(_5525_mdim0,_5526_mdim1,_5527_msubi,_5528_msubj,_5529_mval,_5530_expr,::mosek::fusion::p_ExprMulDiagRight::validate(_5525_mdim0,_5526_mdim1,_5527_msubi,_5528_msubj,_5529_mval,_5530_expr));
  }
}
// mosek.fusion.ExprMulDiagRight.ctor

// Begin mosek.fusion.ExprMulDiagRight.eval
// Method mosek.fusion.ExprMulDiagRight.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:2068:6-2315:7
void mosek::fusion::ExprMulDiagRight :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5531_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5532_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5533_xs) { mosek::fusion::p_ExprMulDiagRight::_get_impl(this)->eval(_5531_rs,_5532_ws,_5533_xs); }
void mosek::fusion::p_ExprMulDiagRight::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5531_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5532_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5533_xs)
{
  mosek::fusion::p_ExprMulDiagRight::_get_impl(::mosek::fusion::ExprMulDiagRight::t(_pubthis))->expr->eval(_5532_ws,_5531_rs,_5533_xs);
  _5532_ws->pop_expr();
  int32_t _5534_nd = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->nd;
  int32_t _5535_nnz = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->nnz;
  int32_t _5536_nelem = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->nelem;
  int32_t _5537_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->ncodeatom;
  bool _5538_hassp = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->hassp;
  int32_t _5539_shape = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->shape_base;
  int32_t _5540_ptr = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->ptr_base;
  int32_t _5541_sp = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->sp_base;
  int32_t _5542_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->nidxs_base;
  int32_t _5543_cof = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->cof_base;
  int32_t _5544_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->codeptr_base;
  int32_t _5545_code = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->code_base;
  int32_t _5546_cconst = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5547_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5547_wi32(_5547_wi32 ? _5547_wi32->raw() : nullptr,_5547_wi32 ? _5547_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5548_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5548_wi64(_5548_wi64 ? _5548_wi64->raw() : nullptr,_5548_wi64 ? _5548_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5549_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5532_ws)->f64;
  _checked_ptr_1<double> _ptr__5549_wf64(_5549_wf64 ? _5549_wf64->raw() : nullptr,_5549_wf64 ? _5549_wf64->size(0) : 0);
  int32_t _5550_edim0 = _ptr__5547_wi32[_5539_shape];
  int32_t _5551_edim1 = _ptr__5547_wi32[safe_add( _5539_shape,(int)1 )];
  int32_t _5552_mnnz = (int)((mval)->size(0));
  int32_t _5553_xmperm = _5533_xs->alloci32(_5552_mnnz);
  int32_t _5554_xmcolptr = _5533_xs->alloci32(safe_add( mdim1,(int)1 ));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5555_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5533_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__5555_xi32(_5555_xi32 ? _5555_xi32->raw() : nullptr,_5555_xi32 ? _5555_xi32->size(0) : 0);
  {
    int32_t _11744_ = (int)0;
    int32_t _11745_ = safe_add( mdim1,(int)1 );
    for (int32_t _5556_i = _11744_; _5556_i < _11745_; ++_5556_i)
    {
      {
        _ptr__5555_xi32[safe_add( _5554_xmcolptr,_5556_i )] = (int)0;
      }
    }
    int32_t _11746_ = (int)0;
    int32_t _11747_ = _5552_mnnz;
    for (int32_t _5557_i = _11746_; _5557_i < _11747_; ++_5557_i)
    {
      {
        ++ _ptr__5555_xi32[safe_add( safe_add( _5554_xmcolptr,((*msubj)(_5557_i)) ),(int)1 )];
      }
    }
    int32_t _11748_ = (int)0;
    int32_t _11749_ = mdim1;
    for (int32_t _5558_i = _11748_; _5558_i < _11749_; ++_5558_i)
    {
      {
        _ptr__5555_xi32[safe_add( safe_add( _5554_xmcolptr,_5558_i ),(int)1 )] += _ptr__5555_xi32[safe_add( _5554_xmcolptr,_5558_i )];
      }
    }
    int32_t _11750_ = (int)0;
    int32_t _11751_ = _5552_mnnz;
    for (int32_t _5559_i = _11750_; _5559_i < _11751_; ++_5559_i)
    {
      {
        _ptr__5555_xi32[safe_add( _5553_xmperm,_ptr__5555_xi32[safe_add( _5554_xmcolptr,((*msubj)(_5559_i)) )] )] = _5559_i;
        ++ _ptr__5555_xi32[safe_add( _5554_xmcolptr,((*msubj)(_5559_i)) )];
      }
    }
    int32_t _11752_ = (int)0;
    int32_t _11753_ = mdim1;
    for (int32_t _5560_i = _11752_; _5560_i < _11753_; ++_5560_i)
    {
      {
        _ptr__5555_xi32[(safe_add( _5554_xmcolptr,mdim1 ) - _5560_i)] = _ptr__5555_xi32[((safe_add( _5554_xmcolptr,mdim1 ) - _5560_i) - (int)1)];
      }
    }
    _ptr__5555_xi32[_5554_xmcolptr] = (int)0;
  }
  int32_t _5561_rncodeatom = (int)0;
  int32_t _5562_rnnz = (int)0;
  int32_t _5563_rnelem = (int)0;
  if ((!_5538_hassp))
  {
    {
      int32_t _5564_i1 = (int)0;
      while ( (_5564_i1 < _5552_mnnz) )
      {
        {
          int32_t _5565_mcol = ((*msubj)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5564_i1 )]));
          int32_t _5566_b1 = _5564_i1;
          while ( ((_5564_i1 < _5552_mnnz) && (_5565_mcol == ((*msubj)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5564_i1 )])))) )
          {
            {
              ++ _5564_i1;
            }
          }
          int32_t _11754_ = _5566_b1;
          int32_t _11755_ = _5564_i1;
          for (int32_t _5567_i = _11754_; _5567_i < _11755_; ++_5567_i)
          {
            {
              int32_t _5568_eidx = safe_add( safe_mul( ((*msubj)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5567_i )])),_5551_edim1 ),((*msubi)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5567_i )])) );
              _5562_rnnz += (_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5568_eidx ),(int)1 )] - _ptr__5547_wi32[safe_add( _5540_ptr,_5568_eidx )]);
              if ((_5537_ncodeatom > (int)0))
              {
                {
                  _5561_rncodeatom += safe_add( (_ptr__5547_wi32[safe_add( _5544_codeptr,_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5568_eidx ),(int)1 )] )] - _ptr__5547_wi32[safe_add( _5544_codeptr,_ptr__5547_wi32[safe_add( _5540_ptr,_5568_eidx )] )]),safe_mul( (int)2,(_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5568_eidx ),(int)1 )] - _ptr__5547_wi32[safe_add( _5540_ptr,_5568_eidx )]) ) );
                }
              }
              {}
            }
          }
          ++ _5563_rnelem;
        }
      }
    }
  }
  else
  {
    {
      int32_t _5569_i1 = (int)0;
      int32_t _5570_i0 = (int)0;
      int32_t _11756_ = (int)0;
      int32_t _11757_ = mdim1;
      for (int32_t _5571_i = _11756_; _5571_i < _11757_; ++_5571_i)
      {
        {
          int32_t _5572_b1 = _5569_i1;
          int32_t _5573_b0 = _5570_i0;
          while ( ((_5569_i1 < _5552_mnnz) && (_5571_i == ((*msubj)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5569_i1 )])))) )
          {
            {
              ++ _5569_i1;
            }
          }
          while ( ((_5570_i0 < _5536_nelem) && (_5571_i == (_ptr__5548_wi64[safe_add( _5541_sp,_5570_i0 )] / _5551_edim1))) )
          {
            {
              ++ _5570_i0;
            }
          }
          int32_t _5574_ii1 = _5572_b1;
          int32_t _5575_ii0 = _5573_b0;
          int32_t _5576_rownnz = (int)0;
          while ( ((_5575_ii0 < _5570_i0) && (_5574_ii1 < _5569_i1)) )
          {
            {
              if (((_ptr__5548_wi64[safe_add( _5541_sp,_5575_ii0 )] % _5551_edim1) < ((*msubi)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5574_ii1 )]))))
              {
                {
                  ++ _5575_ii0;
                }
              }
              else if(((_ptr__5548_wi64[safe_add( _5541_sp,_5575_ii0 )] % _5551_edim1) > ((*msubi)(_ptr__5555_xi32[safe_add( _5553_xmperm,_5574_ii1 )]))))
              {
                {
                  ++ _5574_ii1;
                }
              }
              else
              {
                {
                  _5562_rnnz += (_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5575_ii0 ),(int)1 )] - _ptr__5547_wi32[safe_add( _5540_ptr,_5575_ii0 )]);
                  if ((_5537_ncodeatom > (int)0))
                  {
                    {
                      _5561_rncodeatom += safe_add( (_ptr__5547_wi32[safe_add( _5544_codeptr,_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5575_ii0 ),(int)1 )] )] - _ptr__5547_wi32[safe_add( _5544_codeptr,_ptr__5547_wi32[safe_add( _5540_ptr,_5575_ii0 )] )]),safe_mul( (int)2,(_ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5575_ii0 ),(int)1 )] - _ptr__5547_wi32[safe_add( _5540_ptr,_5575_ii0 )]) ) );
                    }
                  }
                  {}
                  ++ _5576_rownnz;
                  ++ _5575_ii0;
                  ++ _5574_ii1;
                }
              }
            }
          }
          if ((_5576_rownnz > (int)0))
          {
            {
              ++ _5563_rnelem;
            }
          }
          {}
        }
      }
    }
  }
  bool _5577_rhassp = (_5563_rnelem < _5550_edim0);
  _5531_rs->alloc_expr((int)1,_5563_rnelem,_5562_rnnz,_5577_rhassp,_5561_rncodeatom);
  int32_t _5578_rptr = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->ptr_base;
  int32_t _5579_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->nidxs_base;
  int32_t _11758_;
  bool _11759_ = _5577_rhassp;
  if (_11759_)
  {
    _11758_ = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->sp_base;
  }
  else
  {
    _11758_ = _5531_rs->alloci64(_5563_rnelem);
  }
  int32_t _5580_rsp = _11758_;
  int32_t _5581_rcof = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->cof_base;
  int32_t _5582_rshape = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->shape_base;
  int32_t _5583_rcode = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->code_base;
  int32_t _5584_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->codeptr_base;
  int32_t _5585_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5586_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5586_ri64(_5586_ri64 ? _5586_ri64->raw() : nullptr,_5586_ri64 ? _5586_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5587_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->f64;
  _checked_ptr_1<double> _ptr__5587_rf64(_5587_rf64 ? _5587_rf64->raw() : nullptr,_5587_rf64 ? _5587_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5588_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5531_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5588_ri32(_5588_ri32 ? _5588_ri32->raw() : nullptr,_5588_ri32 ? _5588_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5589_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5533_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__5589_xi32(_5589_xi32 ? _5589_xi32->raw() : nullptr,_5589_xi32 ? _5589_xi32->size(0) : 0);
  {
    int32_t _5590_codei = (int)0;
    int32_t _5591_nzi = (int)0;
    int32_t _5592_elmi = (int)0;
    _ptr__5588_ri32[_5578_rptr] = (int)0;
    if ((_5561_rncodeatom > (int)0))
    {
      {
        _ptr__5588_ri32[_5584_rcodeptr] = (int)0;
      }
    }
    {}
    _ptr__5588_ri32[_5582_rshape] = mdim1;
    if ((!_5538_hassp))
    {
      {
        int32_t _5593_i1 = (int)0;
        while ( (_5593_i1 < _5552_mnnz) )
        {
          {
            int32_t _5594_mcol = ((*msubj)(_ptr__5589_xi32[safe_add( _5553_xmperm,_5593_i1 )]));
            int32_t _5595_b1 = _5593_i1;
            while ( ((_5593_i1 < _5552_mnnz) && (_5594_mcol == ((*msubj)(_ptr__5589_xi32[safe_add( _5553_xmperm,_5593_i1 )])))) )
            {
              {
                ++ _5593_i1;
              }
            }
            int32_t _11760_ = _5595_b1;
            int32_t _11761_ = _5593_i1;
            for (int32_t _5596_i = _11760_; _5596_i < _11761_; ++_5596_i)
            {
              {
                int32_t _5597_midx = _ptr__5589_xi32[safe_add( _5553_xmperm,_5596_i )];
                int32_t _5598_eidx = safe_add( safe_mul( ((*msubj)(_5597_midx)),_5551_edim1 ),((*msubi)(_5597_midx)) );
                int32_t _11762_ = _ptr__5547_wi32[safe_add( _5540_ptr,_5598_eidx )];
                int32_t _11763_ = _ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5598_eidx ),(int)1 )];
                for (int32_t _5599_j = _11762_; _5599_j < _11763_; ++_5599_j)
                {
                  {
                    _ptr__5586_ri64[safe_add( _5579_rnidxs,_5591_nzi )] = _ptr__5548_wi64[safe_add( _5542_nidxs,_5599_j )];
                    _ptr__5587_rf64[safe_add( _5581_rcof,_5591_nzi )] = (_ptr__5549_wf64[safe_add( _5543_cof,_5599_j )] * ((*mval)(_5597_midx)));
                    if ((_5537_ncodeatom > (int)0))
                    {
                      {
                        int32_t _11764_ = _ptr__5547_wi32[safe_add( _5544_codeptr,_5599_j )];
                        int32_t _11765_ = _ptr__5547_wi32[safe_add( safe_add( _5544_codeptr,_5599_j ),(int)1 )];
                        for (int32_t _5600_k = _11764_; _5600_k < _11765_; ++_5600_k)
                        {
                          {
                            _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = _ptr__5547_wi32[safe_add( _5545_code,_5600_k )];
                            _ptr__5587_rf64[safe_add( _5585_rcconst,_5590_codei )] = _ptr__5549_wf64[safe_add( _5546_cconst,_5600_k )];
                            ++ _5590_codei;
                          }
                        }
                        _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = 2;
                        _ptr__5587_rf64[safe_add( _5585_rcconst,_5590_codei )] = ((*mval)(_5597_midx));
                        ++ _5590_codei;
                        _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = 5;
                        ++ _5590_codei;
                        _ptr__5588_ri32[safe_add( safe_add( _5584_rcodeptr,_5591_nzi ),(int)1 )] = _5590_codei;
                      }
                    }
                    {}
                    ++ _5591_nzi;
                  }
                }
              }
            }
            _ptr__5586_ri64[safe_add( _5580_rsp,_5592_elmi )] = _5594_mcol;
            _ptr__5588_ri32[safe_add( safe_add( _5578_rptr,_5592_elmi ),(int)1 )] = _5591_nzi;
            ++ _5592_elmi;
          }
        }
      }
    }
    else
    {
      {
        int32_t _5601_i1 = (int)0;
        int32_t _5602_i0 = (int)0;
        int32_t _11766_ = (int)0;
        int32_t _11767_ = mdim1;
        for (int32_t _5603_i = _11766_; _5603_i < _11767_; ++_5603_i)
        {
          {
            int32_t _5604_b1 = _5601_i1;
            int32_t _5605_b0 = _5602_i0;
            while ( ((_5602_i0 < _5536_nelem) && (_5603_i == (_ptr__5548_wi64[safe_add( _5541_sp,_5602_i0 )] / _5551_edim1))) )
            {
              {
                ++ _5602_i0;
              }
            }
            while ( ((_5601_i1 < _5552_mnnz) && (_5603_i == ((*msubj)(_ptr__5589_xi32[safe_add( _5553_xmperm,_5601_i1 )])))) )
            {
              {
                ++ _5601_i1;
              }
            }
            int32_t _5606_ii1 = _5604_b1;
            int32_t _5607_ii0 = _5605_b0;
            int32_t _5608_rownnz = (int)0;
            while ( ((_5607_ii0 < _5602_i0) && (_5606_ii1 < _5601_i1)) )
            {
              {
                if (((_ptr__5548_wi64[safe_add( _5541_sp,_5607_ii0 )] % _5551_edim1) < ((*msubi)(_ptr__5589_xi32[safe_add( _5553_xmperm,_5606_ii1 )]))))
                {
                  {
                    ++ _5607_ii0;
                  }
                }
                else if(((_ptr__5548_wi64[safe_add( _5541_sp,_5607_ii0 )] % _5551_edim1) > ((*msubi)(_ptr__5589_xi32[safe_add( _5553_xmperm,_5606_ii1 )]))))
                {
                  {
                    ++ _5606_ii1;
                  }
                }
                else
                {
                  {
                    int32_t _5609_midx = _ptr__5589_xi32[safe_add( _5553_xmperm,_5606_ii1 )];
                    int32_t _11768_ = _ptr__5547_wi32[safe_add( _5540_ptr,_5607_ii0 )];
                    int32_t _11769_ = _ptr__5547_wi32[safe_add( safe_add( _5540_ptr,_5607_ii0 ),(int)1 )];
                    for (int32_t _5610_j = _11768_; _5610_j < _11769_; ++_5610_j)
                    {
                      {
                        _ptr__5586_ri64[safe_add( _5579_rnidxs,_5591_nzi )] = _ptr__5548_wi64[safe_add( _5542_nidxs,_5610_j )];
                        _ptr__5587_rf64[safe_add( _5581_rcof,_5591_nzi )] = (_ptr__5549_wf64[safe_add( _5543_cof,_5610_j )] * ((*mval)(_5609_midx)));
                        if ((_5537_ncodeatom > (int)0))
                        {
                          {
                            int32_t _11770_ = _ptr__5547_wi32[safe_add( _5544_codeptr,_5610_j )];
                            int32_t _11771_ = _ptr__5547_wi32[safe_add( safe_add( _5544_codeptr,_5610_j ),(int)1 )];
                            for (int32_t _5611_k = _11770_; _5611_k < _11771_; ++_5611_k)
                            {
                              {
                                _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = _ptr__5547_wi32[safe_add( _5545_code,_5611_k )];
                                _ptr__5587_rf64[safe_add( _5585_rcconst,_5590_codei )] = _ptr__5549_wf64[safe_add( _5546_cconst,_5611_k )];
                                ++ _5590_codei;
                              }
                            }
                            _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = 2;
                            _ptr__5587_rf64[safe_add( _5585_rcconst,_5590_codei )] = ((*mval)(_5609_midx));
                            ++ _5590_codei;
                            _ptr__5588_ri32[safe_add( _5583_rcode,_5590_codei )] = 5;
                            ++ _5590_codei;
                            _ptr__5588_ri32[safe_add( safe_add( _5584_rcodeptr,_5591_nzi ),(int)1 )] = _5590_codei;
                          }
                        }
                        {}
                        ++ _5591_nzi;
                      }
                    }
                    ++ _5608_rownnz;
                    ++ _5607_ii0;
                    ++ _5606_ii1;
                  }
                }
              }
            }
            if ((_5608_rownnz > (int)0))
            {
              {
                _ptr__5588_ri32[safe_add( safe_add( _5578_rptr,_5592_elmi ),(int)1 )] = _5591_nzi;
                _ptr__5586_ri64[safe_add( _5580_rsp,_5592_elmi )] = _5603_i;
                ++ _5592_elmi;
              }
            }
            {}
          }
        }
      }
    }
    if ((!_5577_rhassp))
    {
      {
        _5531_rs->popi64(_5563_rnelem);
      }
    }
    {}
    if ((!(_5562_rnnz == _5591_nzi)))
    {
      {
        throw ::mosek::fusion::UnexpectedError(std::string ("Incorrect number of non-zeros"));
      }
    }
    {}
    if ((!(_5563_rnelem == _5592_elmi)))
    {
      {
        throw ::mosek::fusion::UnexpectedError(std::string ("Incorrect number of elements"));
      }
    }
    {}
  }
  _5533_xs->clear();
}
// End mosek.fusion.ExprMulDiagRight.eval

// Begin mosek.fusion.ExprMulDiagRight.validate
// Method mosek.fusion.ExprMulDiagRight.validate @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1974:6-2020:7
int32_t mosek::fusion::p_ExprMulDiagRight::validate(int32_t _5612_mdim0,int32_t _5613_mdim1,std::shared_ptr< monty::ndarray< int32_t,1 > > _5614_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _5615_msubj,std::shared_ptr< monty::ndarray< double,1 > > _5616_mval,monty::rc_ptr< ::mosek::fusion::Expression > _5617_expr)
{
  _checked_ptr_1<int32_t> _ptr__5614_msubi(_5614_msubi ? _5614_msubi->raw() : nullptr, _5614_msubi ? _5614_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5615_msubj(_5615_msubj ? _5615_msubj->raw() : nullptr, _5615_msubj ? _5615_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__5616_mval(_5616_mval ? _5616_mval->raw() : nullptr, _5616_mval ? _5616_mval->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5618_eshape = _5617_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__5618_eshape(_5618_eshape ? _5618_eshape->raw() : nullptr,_5618_eshape ? _5618_eshape->size(0) : 0);
  if (((int)((_5618_eshape)->size(0)) > (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  int32_t _5619_edim0 = _ptr__5618_eshape[(int)0];
  int32_t _5620_edim1 = _ptr__5618_eshape[(int)1];
  if (((_5612_mdim0 < (int)0) || ((_5613_mdim1 < (int)0) || ((_5619_edim0 < (int)0) || (_5620_edim1 < (int)0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if (((_5612_mdim0 != _5620_edim1) || (_5613_mdim1 != _5619_edim0)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  if ((((int)((_5614_msubi)->size(0)) != (int)((_5615_msubj)->size(0))) || ((int)((_5614_msubi)->size(0)) != (int)((_5616_mval)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  int32_t _5621_mnnz = (int)((_5614_msubi)->size(0));
  bool _5622_err_data = false;
  bool _5623_err_sorted = false;
  {
    int32_t _11772_ = (int)0;
    int32_t _11773_ = _5621_mnnz;
    for (int32_t _5624_i = _11772_; _5624_i < _11773_; ++_5624_i)
    {
      {
        if (((_ptr__5614_msubi[_5624_i] < (int)0) || ((_ptr__5614_msubi[_5624_i] >= _5612_mdim0) || ((_ptr__5615_msubj[_5624_i] < (int)0) || (_ptr__5615_msubj[_5624_i] >= _5613_mdim1)))))
        {
          {
            _5622_err_data = true;
          }
        }
        {}
      }
    }
    int32_t _11774_ = (int)0;
    int32_t _11775_ = (_5621_mnnz - (int)1);
    for (int32_t _5625_i = _11774_; _5625_i < _11775_; ++_5625_i)
    {
      {
        if (((_ptr__5614_msubi[_5625_i] > _ptr__5614_msubi[safe_add( _5625_i,(int)1 )]) || ((_ptr__5614_msubi[_5625_i] == _ptr__5614_msubi[safe_add( _5625_i,(int)1 )]) && (_ptr__5615_msubj[_5625_i] >= _ptr__5615_msubj[safe_add( _5625_i,(int)1 )]))))
        {
          {
            _5623_err_sorted = true;
          }
        }
        {}
      }
    }
  }
  if (_5622_err_data)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  if (_5623_err_sorted)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Unsorted matrix data"));
    }
  }
  {}
  return (int)1;
}
// End mosek.fusion.ExprMulDiagRight.validate

// Begin mosek.fusion.ExprMulDiagRight.toString
// Method mosek.fusion.ExprMulDiagRight.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1972:6-137
std::string mosek::fusion::ExprMulDiagRight :: toString() { return mosek::fusion::p_ExprMulDiagRight::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulDiagRight::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulDiagRight("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",m)"))->toString();
}
// End mosek.fusion.ExprMulDiagRight.toString

void mosek::fusion::p_ExprMulDiagRight::destroy()
{
  expr.reset();
  mval.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulDiagRight::destroy() { mosek::fusion::p_ExprMulDiagRight::_get_impl(this)->destroy(); }
// } class ExprMulDiagRight
// class ExprMulDiagLeft { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1578:4-1947:5
mosek::fusion::ExprMulDiagLeft::ExprMulDiagLeft(mosek::fusion::p_ExprMulDiagLeft *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulDiagLeft()" << this << std::endl; */ }
mosek::fusion::ExprMulDiagLeft::~ExprMulDiagLeft() {  /* std::cout << "~ExprMulDiagLeft()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulDiagLeft::p_ExprMulDiagLeft
  (::mosek::fusion::ExprMulDiagLeft * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulDiagLeft.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1663:6-1682:7
mosek::fusion::ExprMulDiagLeft::t mosek::fusion::p_ExprMulDiagLeft::_new_ExprMulDiagLeft
  (int32_t _5626_mdim0,
    int32_t _5627_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5628_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5629_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5630_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5631_expr,
    int32_t _5632_validated)
{ return new mosek::fusion::ExprMulDiagLeft(_5626_mdim0,_5627_mdim1,_5628_msubi,_5629_msubj,_5630_mval,_5631_expr,_5632_validated); }
mosek::fusion::ExprMulDiagLeft::ExprMulDiagLeft
  (int32_t _5626_mdim0,
    int32_t _5627_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5628_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5629_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5630_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5631_expr,
    int32_t _5632_validated) : 
   ExprMulDiagLeft(new mosek::fusion::p_ExprMulDiagLeft(this))
{ mosek::fusion::p_ExprMulDiagLeft::_get_impl(this)->_initialize(_5626_mdim0,_5627_mdim1,_5628_msubi,_5629_msubj,_5630_mval,_5631_expr,_5632_validated); }
void mosek::fusion::p_ExprMulDiagLeft::_initialize  (int32_t _5626_mdim0,
    int32_t _5627_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5628_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5629_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5630_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5631_expr,
    int32_t _5632_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5628_msubi(_5628_msubi ? _5628_msubi->raw() : nullptr, _5628_msubi ? _5628_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5629_msubj(_5629_msubj ? _5629_msubj->raw() : nullptr, _5629_msubj ? _5629_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5630_mval(_5630_mval ? _5630_mval->raw() : nullptr, _5630_mval ? _5630_mval->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_5626_mdim0)}));
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->mdim0 = _5626_mdim0;
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->mdim1 = _5627_mdim1;
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->msubi = _5628_msubi;
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->msubj = _5629_msubj;
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->mval = _5630_mval;
    mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->expr = _5631_expr;
  }
}
// mosek.fusion.ExprMulDiagLeft.ctor

// mosek.fusion.ExprMulDiagLeft.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1651:6-1661:7
mosek::fusion::ExprMulDiagLeft::t mosek::fusion::p_ExprMulDiagLeft::_new_ExprMulDiagLeft
  (int32_t _5633_mdim0,
    int32_t _5634_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5635_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5636_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5637_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5638_expr)
{ return new mosek::fusion::ExprMulDiagLeft(_5633_mdim0,_5634_mdim1,_5635_msubi,_5636_msubj,_5637_mval,_5638_expr); }
mosek::fusion::ExprMulDiagLeft::ExprMulDiagLeft
  (int32_t _5633_mdim0,
    int32_t _5634_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5635_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5636_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5637_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5638_expr) : 
   ExprMulDiagLeft(new mosek::fusion::p_ExprMulDiagLeft(this))
{ mosek::fusion::p_ExprMulDiagLeft::_get_impl(this)->_initialize(_5633_mdim0,_5634_mdim1,_5635_msubi,_5636_msubj,_5637_mval,_5638_expr); }
void mosek::fusion::p_ExprMulDiagLeft::_initialize  (int32_t _5633_mdim0,
    int32_t _5634_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5635_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5636_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5637_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5638_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5635_msubi(_5635_msubi ? _5635_msubi->raw() : nullptr, _5635_msubi ? _5635_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5636_msubj(_5636_msubj ? _5636_msubj->raw() : nullptr, _5636_msubj ? _5636_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5637_mval(_5637_mval ? _5637_mval->raw() : nullptr, _5637_mval ? _5637_mval->size(0) : 0);
    mosek::fusion::p_ExprMulDiagLeft::_initialize(_5633_mdim0,_5634_mdim1,_5635_msubi,_5636_msubj,_5637_mval,_5638_expr,::mosek::fusion::p_ExprMulDiagLeft::validate(_5633_mdim0,_5634_mdim1,_5635_msubi,_5636_msubj,_5637_mval,_5638_expr));
  }
}
// mosek.fusion.ExprMulDiagLeft.ctor

// Begin mosek.fusion.ExprMulDiagLeft.eval
// Method mosek.fusion.ExprMulDiagLeft.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1685:6-1946:7
void mosek::fusion::ExprMulDiagLeft :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5639_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5640_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5641_xs) { mosek::fusion::p_ExprMulDiagLeft::_get_impl(this)->eval(_5639_rs,_5640_ws,_5641_xs); }
void mosek::fusion::p_ExprMulDiagLeft::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5639_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5640_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5641_xs)
{
  mosek::fusion::p_ExprMulDiagLeft::_get_impl(::mosek::fusion::ExprMulDiagLeft::t(_pubthis))->expr->eval(_5640_ws,_5639_rs,_5641_xs);
  _5640_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5642_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5642_wi32(_5642_wi32 ? _5642_wi32->raw() : nullptr,_5642_wi32 ? _5642_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5643_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5643_wi64(_5643_wi64 ? _5643_wi64->raw() : nullptr,_5643_wi64 ? _5643_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5644_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->f64;
  _checked_ptr_1<double> _ptr__5644_wf64(_5644_wf64 ? _5644_wf64->raw() : nullptr,_5644_wf64 ? _5644_wf64->size(0) : 0);
  int32_t _5645_nd = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->nd;
  int32_t _5646_nelem = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->nelem;
  int32_t _5647_nnz = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->nnz;
  bool _5648_hassp = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->hassp;
  int32_t _5649_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->ncodeatom;
  int32_t _5650_ptr = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->ptr_base;
  int32_t _5651_code = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->code_base;
  int32_t _5652_cconst = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->cconst_base;
  int32_t _5653_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->codeptr_base;
  int32_t _5654_shape = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->shape_base;
  int32_t _5655_sp = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->sp_base;
  int32_t _5656_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->nidxs_base;
  int32_t _5657_cof = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->cof_base;
  int32_t _5658_consts = mosek::fusion::p_WorkStack::_get_impl(_5640_ws)->cconst_base;
  if ((_5645_nd != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operator shape for multiplication"));
    }
  }
  {}
  int32_t _5659_edim0 = _ptr__5642_wi32[_5654_shape];
  int32_t _5660_edim1 = _ptr__5642_wi32[safe_add( _5654_shape,(int)1 )];
  int32_t _5661_mnumnz = (int)((msubi)->size(0));
  if ((!_5648_hassp))
  {
    {
      int32_t _5662_rnnz = (int)0;
      int32_t _5663_rnelem = (int)0;
      int32_t _5664_rncodeatom = (int)0;
      int32_t _5665_i = (int)0;
      while ( (_5665_i < (int)((msubi)->size(0))) )
      {
        {
          int32_t _5666_i0 = ((*msubi)(_5665_i));
          while ( ((_5665_i < (int)((msubi)->size(0))) && (((*msubi)(_5665_i)) == _5666_i0)) )
          {
            {
              int32_t _5667_idx = safe_add( safe_mul( ((*msubj)(_5665_i)),_5660_edim1 ),((*msubi)(_5665_i)) );
              _5662_rnnz += (_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5667_idx ),(int)1 )] - _ptr__5642_wi32[safe_add( _5650_ptr,_5667_idx )]);
              if ((_5649_ncodeatom > (int)0))
              {
                {
                  _5664_rncodeatom += safe_add( (_ptr__5642_wi32[safe_add( _5653_codeptr,_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5667_idx ),(int)1 )] )] - _ptr__5642_wi32[safe_add( _5653_codeptr,_ptr__5642_wi32[safe_add( _5650_ptr,_5667_idx )] )]),safe_mul( (int)2,(_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5667_idx ),(int)1 )] - _ptr__5642_wi32[safe_add( _5650_ptr,_5667_idx )]) ) );
                }
              }
              {}
              ++ _5665_i;
            }
          }
          ++ _5663_rnelem;
        }
      }
      bool _5668_rhassp = (_5663_rnelem < mdim0);
      _5639_rs->alloc_expr((int)1,_5663_rnelem,_5662_rnnz,_5668_rhassp,_5664_rncodeatom);
      int32_t _5669_rptr = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->ptr_base;
      int32_t _5670_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->nidxs_base;
      int32_t _11776_;
      bool _11777_ = _5668_rhassp;
      if (_11777_)
      {
        _11776_ = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->sp_base;
      }
      else
      {
        _11776_ = _5639_rs->alloci64(_5663_rnelem);
      }
      int32_t _5671_rsp = _11776_;
      int32_t _5672_rcof = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->cof_base;
      int32_t _5673_rshape = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->shape_base;
      int32_t _5674_rcode = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->code_base;
      int32_t _5675_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->codeptr_base;
      int32_t _5676_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5677_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__5677_ri64(_5677_ri64 ? _5677_ri64->raw() : nullptr,_5677_ri64 ? _5677_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5678_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->f64;
      _checked_ptr_1<double> _ptr__5678_rf64(_5678_rf64 ? _5678_rf64->raw() : nullptr,_5678_rf64 ? _5678_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5679_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__5679_ri32(_5679_ri32 ? _5679_ri32->raw() : nullptr,_5679_ri32 ? _5679_ri32->size(0) : 0);
      {
        _ptr__5679_ri32[_5669_rptr] = (int)0;
        if ((_5649_ncodeatom > (int)0))
        {
          {
            _ptr__5679_ri32[_5675_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__5679_ri32[_5673_rshape] = mdim0;
        int32_t _5680_nzi = (int)0;
        int32_t _5681_elmi = (int)0;
        int32_t _5682_codei = (int)0;
        {
        }
        {
          int32_t _5683_i = (int)0;
          while ( (_5683_i < (int)((msubi)->size(0))) )
          {
            {
              int32_t _5684_i0 = ((*msubi)(_5683_i));
              while ( ((_5683_i < (int)((msubi)->size(0))) && (((*msubi)(_5683_i)) == _5684_i0)) )
              {
                {
                  int32_t _5685_idx = safe_add( safe_mul( ((*msubj)(_5683_i)),_5660_edim1 ),((*msubi)(_5683_i)) );
                  int32_t _11778_ = _ptr__5642_wi32[safe_add( _5650_ptr,_5685_idx )];
                  int32_t _11779_ = _ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5685_idx ),(int)1 )];
                  for (int32_t _5686_j = _11778_; _5686_j < _11779_; ++_5686_j)
                  {
                    {
                      _ptr__5677_ri64[safe_add( _5670_rnidxs,_5680_nzi )] = _ptr__5643_wi64[safe_add( _5656_nidxs,_5686_j )];
                      _ptr__5678_rf64[safe_add( _5672_rcof,_5680_nzi )] = (_ptr__5644_wf64[safe_add( _5657_cof,_5686_j )] * ((*mval)(_5683_i)));
                      if ((_5664_rncodeatom > (int)0))
                      {
                        {
                          int32_t _11780_ = _ptr__5642_wi32[safe_add( _5653_codeptr,_5686_j )];
                          int32_t _11781_ = _ptr__5642_wi32[safe_add( safe_add( _5653_codeptr,_5686_j ),(int)1 )];
                          for (int32_t _5687_k = _11780_; _5687_k < _11781_; ++_5687_k)
                          {
                            {
                              _ptr__5679_ri32[safe_add( _5674_rcode,_5682_codei )] = _ptr__5642_wi32[safe_add( _5651_code,_5687_k )];
                              _ptr__5678_rf64[safe_add( _5676_rcconst,_5682_codei )] = _ptr__5644_wf64[safe_add( _5652_cconst,_5687_k )];
                              ++ _5682_codei;
                            }
                          }
                          _ptr__5679_ri32[safe_add( _5674_rcode,_5682_codei )] = 2;
                          _ptr__5678_rf64[safe_add( _5676_rcconst,_5682_codei )] = ((*mval)(_5683_i));
                          ++ _5682_codei;
                          _ptr__5679_ri32[safe_add( _5674_rcode,_5682_codei )] = 5;
                          ++ _5682_codei;
                          _ptr__5679_ri32[safe_add( safe_add( _5675_rcodeptr,_5680_nzi ),(int)1 )] = _5682_codei;
                        }
                      }
                      {}
                      ++ _5680_nzi;
                    }
                  }
                  ++ _5683_i;
                }
              }
              _ptr__5679_ri32[safe_add( safe_add( _5669_rptr,_5681_elmi ),(int)1 )] = _5680_nzi;
              _ptr__5677_ri64[safe_add( _5671_rsp,_5681_elmi )] = _5684_i0;
              ++ _5681_elmi;
            }
          }
        }
      }
      if ((!_5668_rhassp))
      {
        {
          _5639_rs->popi64(_5663_rnelem);
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _5688_xecolptr = _5641_xs->alloci32(safe_add( _5660_edim1,(int)1 ));
      int32_t _5689_xeperm = _5641_xs->alloci32(_5646_nelem);
      int32_t _5690_xmptr = _5641_xs->alloci32(safe_add( mdim0,(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5691_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5641_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__5691_xi32(_5691_xi32 ? _5691_xi32->raw() : nullptr,_5691_xi32 ? _5691_xi32->size(0) : 0);
      int32_t _5692_rncodeatom = (int)0;
      int32_t _5693_rnnz = (int)0;
      int32_t _5694_rnelem = (int)0;
      {
        int32_t _11782_ = (int)0;
        int32_t _11783_ = safe_add( _5660_edim1,(int)1 );
        for (int32_t _5695_i = _11782_; _5695_i < _11783_; ++_5695_i)
        {
          {
            _ptr__5691_xi32[safe_add( _5688_xecolptr,_5695_i )] = (int)0;
          }
        }
        int32_t _11784_ = (int)0;
        int32_t _11785_ = _5646_nelem;
        for (int32_t _5696_i = _11784_; _5696_i < _11785_; ++_5696_i)
        {
          {
            ++ _ptr__5691_xi32[safe_add( safe_add( _5688_xecolptr,(_ptr__5643_wi64[safe_add( _5655_sp,_5696_i )] % _5660_edim1) ),(int)1 )];
          }
        }
        int32_t _11786_ = (int)0;
        int32_t _11787_ = _5660_edim1;
        for (int32_t _5697_i = _11786_; _5697_i < _11787_; ++_5697_i)
        {
          {
            _ptr__5691_xi32[safe_add( safe_add( _5688_xecolptr,_5697_i ),(int)1 )] += _ptr__5691_xi32[safe_add( _5688_xecolptr,_5697_i )];
          }
        }
        int32_t _11788_ = (int)0;
        int32_t _11789_ = _5646_nelem;
        for (int32_t _5698_i = _11788_; _5698_i < _11789_; ++_5698_i)
        {
          {
            int64_t _5699_ej = (_ptr__5643_wi64[safe_add( _5655_sp,_5698_i )] % _5660_edim1);
            _ptr__5691_xi32[safe_add( _5689_xeperm,_ptr__5691_xi32[safe_add( _5688_xecolptr,_5699_ej )] )] = _5698_i;
            ++ _ptr__5691_xi32[safe_add( _5688_xecolptr,_5699_ej )];
          }
        }
        int32_t _11790_ = (int)0;
        int32_t _11791_ = _5660_edim1;
        for (int32_t _5700_i = _11790_; _5700_i < _11791_; ++_5700_i)
        {
          {
            _ptr__5691_xi32[(safe_add( _5688_xecolptr,_5660_edim1 ) - _5700_i)] = _ptr__5691_xi32[((safe_add( _5688_xecolptr,_5660_edim1 ) - _5700_i) - (int)1)];
          }
        }
        _ptr__5691_xi32[_5688_xecolptr] = (int)0;
        int32_t _5701_ie = (int)0;
        int32_t _5702_im = (int)0;
        while ( ((_5702_im < (int)((msubi)->size(0))) && (_5701_ie < _5646_nelem)) )
        {
          {
            if ((((*msubi)(_5702_im)) < (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5701_ie )] )] % _5660_edim1)))
            {
              {
                ++ _5702_im;
              }
            }
            else if((((*msubi)(_5702_im)) > (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5701_ie )] )] % _5660_edim1)))
            {
              {
                ++ _5701_ie;
              }
            }
            else
            {
              {
                int32_t _5703_elmnnz = (int)0;
                int64_t _5704_ecol = (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5701_ie )] )] % _5660_edim1);
                int32_t _5705_mb = _5702_im;
                while ( ((_5702_im < (int)((msubi)->size(0))) && (((*msubi)(_5702_im)) == ((*msubi)(_5705_mb)))) )
                {
                  {
                    ++ _5702_im;
                  }
                }
                int32_t _5706_eb = _5701_ie;
                while ( ((_5701_ie < _5646_nelem) && ((_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5701_ie )] )] % _5660_edim1) == _5704_ecol)) )
                {
                  {
                    ++ _5701_ie;
                  }
                }
                int32_t _5707_i1 = _5706_eb;
                int32_t _5708_i0 = _5705_mb;
                int32_t _5709_elmnz = (int)0;
                while ( ((_5708_i0 < _5702_im) && (_5707_i1 < _5701_ie)) )
                {
                  {
                    int32_t _5710_eidx = _ptr__5691_xi32[safe_add( _5689_xeperm,_5707_i1 )];
                    if ((((*msubj)(_5708_i0)) < (_ptr__5643_wi64[safe_add( _5655_sp,_5710_eidx )] / _5660_edim1)))
                    {
                      {
                        ++ _5708_i0;
                      }
                    }
                    else if((((*msubj)(_5708_i0)) > (_ptr__5643_wi64[safe_add( _5655_sp,_5710_eidx )] / _5660_edim1)))
                    {
                      {
                        ++ _5707_i1;
                      }
                    }
                    else
                    {
                      {
                        _5693_rnnz += (_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5710_eidx ),(int)1 )] - _ptr__5642_wi32[safe_add( _5650_ptr,_5710_eidx )]);
                        if ((_5649_ncodeatom > (int)0))
                        {
                          {
                            _5692_rncodeatom += safe_add( (_ptr__5642_wi32[safe_add( _5653_codeptr,_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5710_eidx ),(int)1 )] )] - _ptr__5642_wi32[safe_add( _5653_codeptr,_ptr__5642_wi32[safe_add( _5650_ptr,_5710_eidx )] )]),safe_mul( (int)2,(_ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5710_eidx ),(int)1 )] - _ptr__5642_wi32[safe_add( _5650_ptr,_5710_eidx )]) ) );
                          }
                        }
                        {}
                        ++ _5709_elmnz;
                        ++ _5708_i0;
                        ++ _5707_i1;
                      }
                    }
                  }
                }
                if ((_5709_elmnz > (int)0))
                {
                  {
                    ++ _5694_rnelem;
                  }
                }
                {}
              }
            }
          }
        }
      }
      bool _5711_rhassp = (_5694_rnelem < mdim0);
      _5639_rs->alloc_expr((int)1,_5694_rnelem,_5693_rnnz,_5711_rhassp,_5692_rncodeatom);
      int32_t _5712_rptr = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->ptr_base;
      int32_t _5713_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->nidxs_base;
      int32_t _11792_;
      bool _11793_ = _5711_rhassp;
      if (_11793_)
      {
        _11792_ = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->sp_base;
      }
      else
      {
        _11792_ = _5639_rs->alloci64(_5694_rnelem);
      }
      int32_t _5714_rsp = _11792_;
      int32_t _5715_rcof = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->cof_base;
      int32_t _5716_rshape = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->shape_base;
      int32_t _5717_rcode = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->code_base;
      int32_t _5718_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->codeptr_base;
      int32_t _5719_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5720_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__5720_ri64(_5720_ri64 ? _5720_ri64->raw() : nullptr,_5720_ri64 ? _5720_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5721_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->f64;
      _checked_ptr_1<double> _ptr__5721_rf64(_5721_rf64 ? _5721_rf64->raw() : nullptr,_5721_rf64 ? _5721_rf64->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5722_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5639_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__5722_ri32(_5722_ri32 ? _5722_ri32->raw() : nullptr,_5722_ri32 ? _5722_ri32->size(0) : 0);
      {
        int32_t _5723_elmi = (int)0;
        int32_t _5724_nzi = (int)0;
        int32_t _5725_codei = (int)0;
        int32_t _5726_ie = (int)0;
        int32_t _5727_im = (int)0;
        _ptr__5722_ri32[_5712_rptr] = (int)0;
        if ((_5649_ncodeatom > (int)0))
        {
          {
            _ptr__5722_ri32[_5718_rcodeptr] = (int)0;
          }
        }
        {}
        _ptr__5722_ri32[_5716_rshape] = mdim0;
        while ( ((_5727_im < (int)((msubi)->size(0))) && (_5726_ie < _5646_nelem)) )
        {
          {
            if ((((*msubi)(_5727_im)) < (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5726_ie )] )] % _5660_edim1)))
            {
              {
                ++ _5727_im;
              }
            }
            else if((((*msubi)(_5727_im)) > (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5726_ie )] )] % _5660_edim1)))
            {
              {
                ++ _5726_ie;
              }
            }
            else
            {
              {
                int32_t _5728_elmnnz = (int)0;
                int64_t _5729_ecol = (_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5726_ie )] )] % _5660_edim1);
                int32_t _5730_mb = _5727_im;
                while ( ((_5727_im < (int)((msubi)->size(0))) && (((*msubi)(_5727_im)) == ((*msubi)(_5730_mb)))) )
                {
                  {
                    ++ _5727_im;
                  }
                }
                int32_t _5731_eb = _5726_ie;
                while ( ((_5726_ie < _5646_nelem) && ((_ptr__5643_wi64[safe_add( _5655_sp,_ptr__5691_xi32[safe_add( _5689_xeperm,_5726_ie )] )] % _5660_edim1) == _5729_ecol)) )
                {
                  {
                    ++ _5726_ie;
                  }
                }
                int32_t _5732_i1 = _5731_eb;
                int32_t _5733_i0 = _5730_mb;
                int32_t _5734_elmnz = (int)0;
                int32_t _5735_mrow = ((*msubi)(_5730_mb));
                while ( ((_5733_i0 < _5727_im) && (_5732_i1 < _5726_ie)) )
                {
                  {
                    int32_t _5736_eidx = _ptr__5691_xi32[safe_add( _5689_xeperm,_5732_i1 )];
                    if ((((*msubj)(_5733_i0)) < (_ptr__5643_wi64[safe_add( _5655_sp,_5736_eidx )] / _5660_edim1)))
                    {
                      {
                        ++ _5733_i0;
                      }
                    }
                    else if((((*msubj)(_5733_i0)) > (_ptr__5643_wi64[safe_add( _5655_sp,_5736_eidx )] / _5660_edim1)))
                    {
                      {
                        ++ _5732_i1;
                      }
                    }
                    else
                    {
                      {
                        int32_t _11794_ = _ptr__5642_wi32[safe_add( _5650_ptr,_5736_eidx )];
                        int32_t _11795_ = _ptr__5642_wi32[safe_add( safe_add( _5650_ptr,_5736_eidx ),(int)1 )];
                        for (int32_t _5737_j = _11794_; _5737_j < _11795_; ++_5737_j)
                        {
                          {
                            _ptr__5720_ri64[safe_add( _5713_rnidxs,_5724_nzi )] = _ptr__5643_wi64[safe_add( _5656_nidxs,_5737_j )];
                            _ptr__5721_rf64[safe_add( _5715_rcof,_5724_nzi )] = (_ptr__5644_wf64[safe_add( _5657_cof,_5737_j )] * ((*mval)(_5733_i0)));
                            if ((_5649_ncodeatom > (int)0))
                            {
                              {
                                int32_t _11796_ = _ptr__5642_wi32[safe_add( _5653_codeptr,_5737_j )];
                                int32_t _11797_ = _ptr__5642_wi32[safe_add( safe_add( _5653_codeptr,_5737_j ),(int)1 )];
                                for (int32_t _5738_k = _11796_; _5738_k < _11797_; ++_5738_k)
                                {
                                  {
                                    _ptr__5722_ri32[safe_add( _5717_rcode,_5725_codei )] = _ptr__5642_wi32[safe_add( _5651_code,_5738_k )];
                                    _ptr__5721_rf64[safe_add( _5719_rcconst,_5725_codei )] = _ptr__5644_wf64[safe_add( _5652_cconst,_5738_k )];
                                    ++ _5725_codei;
                                  }
                                }
                                _ptr__5722_ri32[safe_add( _5717_rcode,_5725_codei )] = 2;
                                _ptr__5721_rf64[safe_add( _5719_rcconst,_5725_codei )] = ((*mval)(_5733_i0));
                                ++ _5725_codei;
                                _ptr__5722_ri32[safe_add( _5717_rcode,_5725_codei )] = 5;
                                ++ _5725_codei;
                                _ptr__5722_ri32[safe_add( safe_add( _5718_rcodeptr,_5724_nzi ),(int)1 )] = _5725_codei;
                              }
                            }
                            {}
                            ++ _5724_nzi;
                            ++ _5734_elmnz;
                          }
                        }
                        ++ _5733_i0;
                        ++ _5732_i1;
                      }
                    }
                  }
                }
                if ((_5734_elmnz > (int)0))
                {
                  {
                    _ptr__5722_ri32[safe_add( safe_add( _5712_rptr,_5723_elmi ),(int)1 )] = _5724_nzi;
                    _ptr__5720_ri64[safe_add( _5714_rsp,_5723_elmi )] = _5735_mrow;
                    ++ _5723_elmi;
                  }
                }
                {}
              }
            }
          }
        }
        if ((_5724_nzi != _5693_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of non-zeros"));
          }
        }
        {}
        if ((_5723_elmi != _5694_rnelem))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of elements"));
          }
        }
        {}
      }
      if ((!_5711_rhassp))
      {
        {
          _5639_rs->popi64(_5694_rnelem);
        }
      }
      {}
    }
  }
  _5641_xs->clear();
}
// End mosek.fusion.ExprMulDiagLeft.eval

// Begin mosek.fusion.ExprMulDiagLeft.validate
// Method mosek.fusion.ExprMulDiagLeft.validate @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1591:6-1635:7
int32_t mosek::fusion::p_ExprMulDiagLeft::validate(int32_t _5739_mdim0,int32_t _5740_mdim1,std::shared_ptr< monty::ndarray< int32_t,1 > > _5741_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _5742_msubj,std::shared_ptr< monty::ndarray< double,1 > > _5743_mval,monty::rc_ptr< ::mosek::fusion::Expression > _5744_expr)
{
  _checked_ptr_1<int32_t> _ptr__5741_msubi(_5741_msubi ? _5741_msubi->raw() : nullptr, _5741_msubi ? _5741_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5742_msubj(_5742_msubj ? _5742_msubj->raw() : nullptr, _5742_msubj ? _5742_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__5743_mval(_5743_mval ? _5743_mval->raw() : nullptr, _5743_mval ? _5743_mval->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5745_eshape = _5744_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__5745_eshape(_5745_eshape ? _5745_eshape->raw() : nullptr,_5745_eshape ? _5745_eshape->size(0) : 0);
  if (((int)((_5745_eshape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  int32_t _5746_edim0 = _ptr__5745_eshape[(int)0];
  int32_t _5747_edim1 = _ptr__5745_eshape[(int)1];
  if (((_5739_mdim0 < (int)0) || (_5740_mdim1 < (int)0)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if (((_5740_mdim1 != _5746_edim0) || (_5739_mdim0 != _5747_edim1)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  if ((((int)((_5741_msubi)->size(0)) != (int)((_5742_msubj)->size(0))) || ((int)((_5741_msubi)->size(0)) != (int)((_5743_mval)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  int32_t _5748_mnnz = (int)((_5741_msubi)->size(0));
  bool _5749_err_data = false;
  bool _5750_err_sorted = false;
  {
    int32_t _11798_ = (int)0;
    int32_t _11799_ = _5748_mnnz;
    for (int32_t _5751_i = _11798_; _5751_i < _11799_; ++_5751_i)
    {
      {
        if (((_ptr__5741_msubi[_5751_i] < (int)0) || ((_ptr__5741_msubi[_5751_i] >= _5739_mdim0) || ((_ptr__5742_msubj[_5751_i] < (int)0) || (_ptr__5742_msubj[_5751_i] >= _5740_mdim1)))))
        {
          {
            _5749_err_data = true;
          }
        }
        {}
      }
    }
    int32_t _11800_ = (int)0;
    int32_t _11801_ = (_5748_mnnz - (int)1);
    for (int32_t _5752_i = _11800_; _5752_i < _11801_; ++_5752_i)
    {
      {
        if (((_ptr__5741_msubi[_5752_i] > _ptr__5741_msubi[safe_add( _5752_i,(int)1 )]) || ((_ptr__5741_msubi[_5752_i] == _ptr__5741_msubi[safe_add( _5752_i,(int)1 )]) && (_ptr__5742_msubj[_5752_i] >= _ptr__5742_msubj[safe_add( _5752_i,(int)1 )]))))
        {
          {
            _5750_err_sorted = true;
          }
        }
        {}
      }
    }
  }
  if (_5749_err_data)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  if (_5750_err_sorted)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Unsorted matrix data"));
    }
  }
  {}
  return (int)1;
}
// End mosek.fusion.ExprMulDiagLeft.validate

// Begin mosek.fusion.ExprMulDiagLeft.toString
// Method mosek.fusion.ExprMulDiagLeft.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1589:6-136
std::string mosek::fusion::ExprMulDiagLeft :: toString() { return mosek::fusion::p_ExprMulDiagLeft::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulDiagLeft::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulDiagLeft(m,"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulDiagLeft.toString

void mosek::fusion::p_ExprMulDiagLeft::destroy()
{
  expr.reset();
  mval.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulDiagLeft::destroy() { mosek::fusion::p_ExprMulDiagLeft::_get_impl(this)->destroy(); }
// } class ExprMulDiagLeft
// class ExprMulElement { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1361:4-1562:5
mosek::fusion::ExprMulElement::ExprMulElement(mosek::fusion::p_ExprMulElement *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulElement()" << this << std::endl; */ }
mosek::fusion::ExprMulElement::~ExprMulElement() {  /* std::cout << "~ExprMulElement()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulElement::p_ExprMulElement
  (::mosek::fusion::ExprMulElement * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulElement.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1376:6-1401:7
mosek::fusion::ExprMulElement::t mosek::fusion::p_ExprMulElement::_new_ExprMulElement
  (std::shared_ptr< monty::ndarray< double,1 > > _5753_mcof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5754_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5755_expr)
{ return new mosek::fusion::ExprMulElement(_5753_mcof,_5754_msp,_5755_expr); }
mosek::fusion::ExprMulElement::ExprMulElement
  (std::shared_ptr< monty::ndarray< double,1 > > _5753_mcof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5754_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5755_expr) : 
   ExprMulElement(new mosek::fusion::p_ExprMulElement(this))
{ mosek::fusion::p_ExprMulElement::_get_impl(this)->_initialize(_5753_mcof,_5754_msp,_5755_expr); }
void mosek::fusion::p_ExprMulElement::_initialize  (std::shared_ptr< monty::ndarray< double,1 > > _5753_mcof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5754_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5755_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__5753_mcof(_5753_mcof ? _5753_mcof->raw() : nullptr, _5753_mcof ? _5753_mcof->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__5754_msp(_5754_msp ? _5754_msp->raw() : nullptr, _5754_msp ? _5754_msp->size(0) : 0);
    mosek::fusion::p_ExprMulElement::_initialize(_5753_mcof,_5754_msp,_5755_expr,(int)1);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5756_eshape = _5755_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__5756_eshape(_5756_eshape ? _5756_eshape->raw() : nullptr,_5756_eshape ? _5756_eshape->size(0) : 0);
    if (((int)((_5753_mcof)->size(0)) != (int)((_5754_msp)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Invalid matrix specification"));
      }
    }
    {}
    int64_t _5757_sz = ::mosek::fusion::p_Set::size(_5756_eshape);
    bool _5758_err_data = false;
    bool _5759_err_sorted = false;
    {
      int32_t _11802_ = (int)0;
      int32_t _11803_ = (int)((_5754_msp)->size(0));
      for (int32_t _5760_i = _11802_; _5760_i < _11803_; ++_5760_i)
      {
        {
          if (((_ptr__5754_msp[_5760_i] < (int)0) || (_ptr__5754_msp[_5760_i] >= _5757_sz)))
          {
            {
              _5758_err_data = true;
            }
          }
          {}
        }
      }
      int32_t _11804_ = (int)0;
      int32_t _11805_ = ((int)((_5754_msp)->size(0)) - (int)1);
      for (int32_t _5761_i = _11804_; _5761_i < _11805_; ++_5761_i)
      {
        {
          if ((_ptr__5754_msp[_5761_i] >= _ptr__5754_msp[safe_add( _5761_i,(int)1 )]))
          {
            {
              _5759_err_sorted = true;
            }
          }
          {}
        }
      }
    }
    if (_5758_err_data)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Invalid matrix data"));
      }
    }
    {}
    if (_5759_err_sorted)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Matrix data not sorted"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulElement.ctor

// mosek.fusion.ExprMulElement.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1369:6-1374:7
mosek::fusion::ExprMulElement::t mosek::fusion::p_ExprMulElement::_new_ExprMulElement
  (std::shared_ptr< monty::ndarray< double,1 > > _5762_cof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5763_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5764_expr,
    int32_t _5765_validated)
{ return new mosek::fusion::ExprMulElement(_5762_cof,_5763_msp,_5764_expr,_5765_validated); }
mosek::fusion::ExprMulElement::ExprMulElement
  (std::shared_ptr< monty::ndarray< double,1 > > _5762_cof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5763_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5764_expr,
    int32_t _5765_validated) : 
   ExprMulElement(new mosek::fusion::p_ExprMulElement(this))
{ mosek::fusion::p_ExprMulElement::_get_impl(this)->_initialize(_5762_cof,_5763_msp,_5764_expr,_5765_validated); }
void mosek::fusion::p_ExprMulElement::_initialize  (std::shared_ptr< monty::ndarray< double,1 > > _5762_cof,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _5763_msp,
    monty::rc_ptr< ::mosek::fusion::Expression > _5764_expr,
    int32_t _5765_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__5762_cof(_5762_cof ? _5762_cof->raw() : nullptr, _5762_cof ? _5762_cof->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__5763_msp(_5763_msp ? _5763_msp->raw() : nullptr, _5763_msp ? _5763_msp->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(_5764_expr->getShape());
    mosek::fusion::p_ExprMulElement::_get_impl(::mosek::fusion::ExprMulElement::t(_pubthis))->expr = _5764_expr;
    mosek::fusion::p_ExprMulElement::_get_impl(::mosek::fusion::ExprMulElement::t(_pubthis))->mcof = _5762_cof;
    mosek::fusion::p_ExprMulElement::_get_impl(::mosek::fusion::ExprMulElement::t(_pubthis))->msp = _5763_msp;
  }
}
// mosek.fusion.ExprMulElement.ctor

// Begin mosek.fusion.ExprMulElement.eval
// Method mosek.fusion.ExprMulElement.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1403:6-1561:7
void mosek::fusion::ExprMulElement :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5766_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5767_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5768_xs) { mosek::fusion::p_ExprMulElement::_get_impl(this)->eval(_5766_rs,_5767_ws,_5768_xs); }
void mosek::fusion::p_ExprMulElement::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5766_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5767_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5768_xs)
{
  expr->eval(_5767_ws,_5766_rs,_5768_xs);
  _5767_ws->pop_expr();
  int32_t _5769_nd = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->nd;
  int32_t _5770_nelem = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->nelem;
  int32_t _5771_nnz = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->nnz;
  int32_t _5772_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->ncodeatom;
  bool _5773_hassp = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->hassp;
  int32_t _5774_shape = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->shape_base;
  int32_t _5775_ptr = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->ptr_base;
  int32_t _5776_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->nidxs_base;
  int32_t _5777_sp = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->sp_base;
  int32_t _5778_cof = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->cof_base;
  int32_t _5779_code = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->code_base;
  int32_t _5780_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->codeptr_base;
  int32_t _5781_cconst = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5782_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5782_wi32(_5782_wi32 ? _5782_wi32->raw() : nullptr,_5782_wi32 ? _5782_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5783_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5783_wi64(_5783_wi64 ? _5783_wi64->raw() : nullptr,_5783_wi64 ? _5783_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5784_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5767_ws)->f64;
  _checked_ptr_1<double> _ptr__5784_wf64(_5784_wf64 ? _5784_wf64->raw() : nullptr,_5784_wf64 ? _5784_wf64->size(0) : 0);
  int32_t _5785_rncodeatom = (int)0;
  int32_t _5786_rnnz = (int)0;
  int32_t _5787_rnelem = (int)0;
  if ((!_5773_hassp))
  {
    {
      _5787_rnelem = (int)((msp)->size(0));
      int32_t _11806_ = (int)0;
      int32_t _11807_ = (int)((msp)->size(0));
      for (int32_t _5788_i = _11806_; _5788_i < _11807_; ++_5788_i)
      {
        {
          _5786_rnnz += (_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,((*msp)(_5788_i)) ),(int)1 )] - _ptr__5782_wi32[safe_add( _5775_ptr,((*msp)(_5788_i)) )]);
        }
      }
      if ((_5772_ncodeatom > (int)0))
      {
        {
          int32_t _11808_ = (int)0;
          int32_t _11809_ = (int)((msp)->size(0));
          for (int32_t _5789_i = _11808_; _5789_i < _11809_; ++_5789_i)
          {
            {
              _5785_rncodeatom += safe_add( (_ptr__5782_wi32[safe_add( _5780_codeptr,_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,((*msp)(_5789_i)) ),(int)1 )] )] - _ptr__5782_wi32[safe_add( _5780_codeptr,_ptr__5782_wi32[safe_add( _5775_ptr,((*msp)(_5789_i)) )] )]),safe_mul( (int)2,(_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,((*msp)(_5789_i)) ),(int)1 )] - _ptr__5782_wi32[safe_add( _5775_ptr,((*msp)(_5789_i)) )]) ) );
            }
          }
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _5790_e0 = (int)((msp)->size(0));
      int32_t _5791_i0 = (int)0;
      int32_t _5792_e1 = _5770_nelem;
      int32_t _5793_i1 = (int)0;
      while ( ((_5791_i0 < _5790_e0) && (_5793_i1 < _5792_e1)) )
      {
        {
          if ((((*msp)(_5791_i0)) < _ptr__5783_wi64[safe_add( _5777_sp,_5793_i1 )]))
          {
            {
              ++ _5791_i0;
            }
          }
          else if((((*msp)(_5791_i0)) > _ptr__5783_wi64[safe_add( _5777_sp,_5793_i1 )]))
          {
            {
              ++ _5793_i1;
            }
          }
          else
          {
            {
              _5786_rnnz += (_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,_5793_i1 ),(int)1 )] - _ptr__5782_wi32[safe_add( _5775_ptr,_5793_i1 )]);
              if ((_5772_ncodeatom > (int)0))
              {
                {
                  _5785_rncodeatom += safe_add( (_ptr__5782_wi32[safe_add( _5780_codeptr,_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,_5793_i1 ),(int)1 )] )] - _ptr__5782_wi32[safe_add( _5780_codeptr,_ptr__5782_wi32[safe_add( _5775_ptr,_5793_i1 )] )]),safe_mul( (int)2,(_ptr__5782_wi32[safe_add( safe_add( _5775_ptr,_5793_i1 ),(int)1 )] - _ptr__5782_wi32[safe_add( _5775_ptr,_5793_i1 )]) ) );
                }
              }
              {}
              ++ _5791_i0;
              ++ _5793_i1;
              ++ _5787_rnelem;
            }
          }
        }
      }
    }
  }
  int64_t _5794_rsize = (int64_t)1;
  int32_t _11810_ = (int)0;
  int32_t _11811_ = _5769_nd;
  for (int32_t _5795_i = _11810_; _5795_i < _11811_; ++_5795_i)
  {
    {
      _5794_rsize *= _ptr__5782_wi32[safe_add( _5774_shape,_5795_i )];
    }
  }
  bool _5796_rhassp = (_5787_rnelem < _5794_rsize);
  int32_t _5797_rnd = _5769_nd;
  _5766_rs->alloc_expr(_5797_rnd,_5787_rnelem,_5786_rnnz,_5796_rhassp,_5785_rncodeatom);
  int32_t _5798_rptr = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->ptr_base;
  int32_t _5799_rshape = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->shape_base;
  int32_t _5800_rnidx = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->nidxs_base;
  int32_t _11812_;
  bool _11813_ = _5796_rhassp;
  if (_11813_)
  {
    _11812_ = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->sp_base;
  }
  else
  {
    _11812_ = _5766_rs->alloci64(_5787_rnelem);
  }
  int32_t _5801_rsp = _11812_;
  int32_t _5802_rcof = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->cof_base;
  int32_t _5803_rcode = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->code_base;
  int32_t _5804_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->codeptr_base;
  int32_t _5805_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5806_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5806_ri32(_5806_ri32 ? _5806_ri32->raw() : nullptr,_5806_ri32 ? _5806_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5807_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5807_ri64(_5807_ri64 ? _5807_ri64->raw() : nullptr,_5807_ri64 ? _5807_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5808_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5766_rs)->f64;
  _checked_ptr_1<double> _ptr__5808_rf64(_5808_rf64 ? _5808_rf64->raw() : nullptr,_5808_rf64 ? _5808_rf64->size(0) : 0);
  {
    int32_t _5809_codei = (int)0;
    int32_t _5810_elmi = (int)0;
    int32_t _5811_nzi = (int)0;
    _ptr__5806_ri32[_5798_rptr] = (int)0;
    if ((_5785_rncodeatom > (int)0))
    {
      {
        _ptr__5806_ri32[_5804_rcodeptr] = (int)0;
      }
    }
    {}
    int32_t _11814_ = (int)0;
    int32_t _11815_ = _5797_rnd;
    for (int32_t _5812_i = _11814_; _5812_i < _11815_; ++_5812_i)
    {
      {
        _ptr__5806_ri32[safe_add( _5799_rshape,_5812_i )] = _ptr__5782_wi32[safe_add( _5774_shape,_5812_i )];
      }
    }
    if ((!_5773_hassp))
    {
      {
        int32_t _11816_ = (int)0;
        int32_t _11817_ = (int)((msp)->size(0));
        for (int32_t _5813_i = _11816_; _5813_i < _11817_; ++_5813_i)
        {
          {
            int32_t _5814_p0 = _ptr__5782_wi32[safe_add( _5775_ptr,((*msp)(_5813_i)) )];
            int32_t _5815_p1 = _ptr__5782_wi32[safe_add( safe_add( _5775_ptr,((*msp)(_5813_i)) ),(int)1 )];
            int32_t _11818_ = _5814_p0;
            int32_t _11819_ = _5815_p1;
            for (int32_t _5816_p = _11818_; _5816_p < _11819_; ++_5816_p)
            {
              {
                _ptr__5807_ri64[safe_add( _5800_rnidx,_5811_nzi )] = _ptr__5783_wi64[safe_add( _5776_nidxs,_5816_p )];
                _ptr__5808_rf64[safe_add( _5802_rcof,_5811_nzi )] = (_ptr__5784_wf64[safe_add( _5778_cof,_5816_p )] * ((*mcof)(_5813_i)));
                if ((_5772_ncodeatom > (int)0))
                {
                  {
                    int32_t _11820_ = _ptr__5782_wi32[safe_add( _5780_codeptr,_5816_p )];
                    int32_t _11821_ = _ptr__5782_wi32[safe_add( safe_add( _5780_codeptr,_5816_p ),(int)1 )];
                    for (int32_t _5817_l = _11820_; _5817_l < _11821_; ++_5817_l)
                    {
                      {
                        _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = _ptr__5782_wi32[safe_add( _5779_code,_5817_l )];
                        _ptr__5808_rf64[safe_add( _5805_rcconst,_5809_codei )] = _ptr__5784_wf64[safe_add( _5781_cconst,_5817_l )];
                        ++ _5809_codei;
                      }
                    }
                    _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = 2;
                    _ptr__5808_rf64[safe_add( _5805_rcconst,_5809_codei )] = ((*mcof)(_5813_i));
                    ++ _5809_codei;
                    _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = 5;
                    ++ _5809_codei;
                    _ptr__5806_ri32[safe_add( safe_add( _5804_rcodeptr,_5811_nzi ),(int)1 )] = _5809_codei;
                  }
                }
                {}
                ++ _5811_nzi;
              }
            }
            _ptr__5806_ri32[safe_add( safe_add( _5798_rptr,_5813_i ),(int)1 )] = _5811_nzi;
            _ptr__5807_ri64[safe_add( _5801_rsp,_5813_i )] = ((*msp)(_5813_i));
          }
        }
      }
    }
    else
    {
      {
        int32_t _5818_e0 = (int)((msp)->size(0));
        int32_t _5819_i0 = (int)0;
        int32_t _5820_e1 = _5770_nelem;
        int32_t _5821_i1 = (int)0;
        while ( ((_5819_i0 < _5818_e0) && (_5821_i1 < _5820_e1)) )
        {
          {
            if ((((*msp)(_5819_i0)) < _ptr__5783_wi64[safe_add( _5777_sp,_5821_i1 )]))
            {
              {
                ++ _5819_i0;
              }
            }
            else if((((*msp)(_5819_i0)) > _ptr__5783_wi64[safe_add( _5777_sp,_5821_i1 )]))
            {
              {
                ++ _5821_i1;
              }
            }
            else
            {
              {
                int32_t _5822_p0 = _ptr__5782_wi32[safe_add( _5775_ptr,_5821_i1 )];
                int32_t _5823_p1 = _ptr__5782_wi32[safe_add( safe_add( _5775_ptr,_5821_i1 ),(int)1 )];
                int32_t _11822_ = _5822_p0;
                int32_t _11823_ = _5823_p1;
                for (int32_t _5824_j = _11822_; _5824_j < _11823_; ++_5824_j)
                {
                  {
                    _ptr__5807_ri64[safe_add( _5800_rnidx,_5811_nzi )] = _ptr__5783_wi64[safe_add( _5776_nidxs,_5824_j )];
                    _ptr__5808_rf64[safe_add( _5802_rcof,_5811_nzi )] = (_ptr__5784_wf64[safe_add( _5776_nidxs,_5824_j )] * ((*mcof)(_5819_i0)));
                    if ((_5772_ncodeatom > (int)0))
                    {
                      {
                        int32_t _11824_ = _ptr__5782_wi32[safe_add( _5780_codeptr,_5824_j )];
                        int32_t _11825_ = _ptr__5782_wi32[safe_add( safe_add( _5780_codeptr,_5824_j ),(int)1 )];
                        for (int32_t _5825_l = _11824_; _5825_l < _11825_; ++_5825_l)
                        {
                          {
                            _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = _ptr__5782_wi32[safe_add( _5779_code,_5825_l )];
                            _ptr__5808_rf64[safe_add( _5805_rcconst,_5809_codei )] = _ptr__5784_wf64[safe_add( _5781_cconst,_5825_l )];
                            ++ _5809_codei;
                          }
                        }
                        _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = 2;
                        _ptr__5808_rf64[safe_add( _5805_rcconst,_5809_codei )] = ((*mcof)(_5819_i0));
                        ++ _5809_codei;
                        _ptr__5806_ri32[safe_add( _5803_rcode,_5809_codei )] = 5;
                        ++ _5809_codei;
                        _ptr__5806_ri32[safe_add( safe_add( _5804_rcodeptr,_5811_nzi ),(int)1 )] = _5809_codei;
                      }
                    }
                    {}
                    ++ _5811_nzi;
                  }
                }
                _ptr__5806_ri32[safe_add( safe_add( _5798_rptr,_5810_elmi ),(int)1 )] = _5811_nzi;
                _ptr__5807_ri64[safe_add( _5801_rsp,_5810_elmi )] = ((*msp)(_5819_i0));
                ++ _5810_elmi;
                ++ _5819_i0;
                ++ _5821_i1;
              }
            }
          }
        }
      }
    }
  }
  if ((!_5796_rhassp))
  {
    {
      _5766_rs->popi64(_5787_rnelem);
    }
  }
  {}
}
// End mosek.fusion.ExprMulElement.eval

// Begin mosek.fusion.ExprMulElement.toString
// Method mosek.fusion.ExprMulElement.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1367:6-135
std::string mosek::fusion::ExprMulElement :: toString() { return mosek::fusion::p_ExprMulElement::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulElement::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulElement(M,"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulElement.toString

void mosek::fusion::p_ExprMulElement::destroy()
{
  expr.reset();
  msp.reset();
  mcof.reset();
}
void mosek::fusion::ExprMulElement::destroy() { mosek::fusion::p_ExprMulElement::_get_impl(this)->destroy(); }
// } class ExprMulElement
// class ExprMulScalarConst { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1258:4-1349:5
mosek::fusion::ExprMulScalarConst::ExprMulScalarConst(mosek::fusion::p_ExprMulScalarConst *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulScalarConst()" << this << std::endl; */ }
mosek::fusion::ExprMulScalarConst::~ExprMulScalarConst() {  /* std::cout << "~ExprMulScalarConst()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulScalarConst::p_ExprMulScalarConst
  (::mosek::fusion::ExprMulScalarConst * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulScalarConst.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1267:6-1272:7
mosek::fusion::ExprMulScalarConst::t mosek::fusion::p_ExprMulScalarConst::_new_ExprMulScalarConst
  (double _5826_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _5827_expr)
{ return new mosek::fusion::ExprMulScalarConst(_5826_c,_5827_expr); }
mosek::fusion::ExprMulScalarConst::ExprMulScalarConst
  (double _5826_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _5827_expr) : 
   ExprMulScalarConst(new mosek::fusion::p_ExprMulScalarConst(this))
{ mosek::fusion::p_ExprMulScalarConst::_get_impl(this)->_initialize(_5826_c,_5827_expr); }
void mosek::fusion::p_ExprMulScalarConst::_initialize  (double _5826_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _5827_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_5827_expr->getShape());
    mosek::fusion::p_ExprMulScalarConst::_get_impl(::mosek::fusion::ExprMulScalarConst::t(_pubthis))->c = _5826_c;
    mosek::fusion::p_ExprMulScalarConst::_get_impl(::mosek::fusion::ExprMulScalarConst::t(_pubthis))->expr = _5827_expr;
  }
}
// mosek.fusion.ExprMulScalarConst.ctor

// Begin mosek.fusion.ExprMulScalarConst.eval
// Method mosek.fusion.ExprMulScalarConst.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1274:6-1348:7
void mosek::fusion::ExprMulScalarConst :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5828_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5829_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5830_xs) { mosek::fusion::p_ExprMulScalarConst::_get_impl(this)->eval(_5828_rs,_5829_ws,_5830_xs); }
void mosek::fusion::p_ExprMulScalarConst::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5828_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5829_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5830_xs)
{
  expr->eval(_5829_ws,_5828_rs,_5830_xs);
  _5829_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5831_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5831_wi32(_5831_wi32 ? _5831_wi32->raw() : nullptr,_5831_wi32 ? _5831_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5832_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5832_wi64(_5832_wi64 ? _5832_wi64->raw() : nullptr,_5832_wi64 ? _5832_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5833_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->f64;
  _checked_ptr_1<double> _ptr__5833_wf64(_5833_wf64 ? _5833_wf64->raw() : nullptr,_5833_wf64 ? _5833_wf64->size(0) : 0);
  int32_t _5834_nd = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->nd;
  int32_t _5835_nelem = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->nelem;
  int32_t _5836_nnz = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->nnz;
  bool _5837_hassp = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->hassp;
  int32_t _5838_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->ncodeatom;
  int32_t _5839_ptr = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->ptr_base;
  int32_t _5840_code = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->code_base;
  int32_t _5841_cconst = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->cconst_base;
  int32_t _5842_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->codeptr_base;
  int32_t _5843_shape = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->shape_base;
  int32_t _5844_sp = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->sp_base;
  int32_t _5845_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->nidxs_base;
  int32_t _5846_cof = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->cof_base;
  int32_t _5847_consts = mosek::fusion::p_WorkStack::_get_impl(_5829_ws)->cconst_base;
  int32_t _11826_;
  bool _11827_ = (_5838_ncodeatom == (int)0);
  if (_11827_)
  {
    _11826_ = (int)0;
  }
  else
  {
    _11826_ = safe_add( _5838_ncodeatom,safe_mul( (int)2,_5836_nnz ) );
  }
  int32_t _5848_rncodeatom = _11826_;
  _5828_rs->alloc_expr(_5834_nd,_5835_nelem,_5836_nnz,_5837_hassp,_5848_rncodeatom);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5849_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__5849_ri64(_5849_ri64 ? _5849_ri64->raw() : nullptr,_5849_ri64 ? _5849_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5850_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->f64;
  _checked_ptr_1<double> _ptr__5850_rf64(_5850_rf64 ? _5850_rf64->raw() : nullptr,_5850_rf64 ? _5850_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5851_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__5851_ri32(_5851_ri32 ? _5851_ri32->raw() : nullptr,_5851_ri32 ? _5851_ri32->size(0) : 0);
  int32_t _5852_rptr = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->ptr_base;
  int32_t _5853_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->nidxs_base;
  int32_t _5854_rcof = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->cof_base;
  int32_t _5855_rcode = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->code_base;
  int32_t _5856_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->codeptr_base;
  int32_t _5857_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->cconst_base;
  bool _5858_rhassp = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->hassp;
  int32_t _5859_rshape = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->shape_base;
  int32_t _5860_rsp = mosek::fusion::p_WorkStack::_get_impl(_5828_rs)->sp_base;
  {
    int32_t _11828_ = (int)0;
    int32_t _11829_ = safe_add( _5835_nelem,(int)1 );
    for (int32_t _5861_i = _11828_; _5861_i < _11829_; ++_5861_i)
    {
      {
        _ptr__5851_ri32[safe_add( _5852_rptr,_5861_i )] = _ptr__5831_wi32[safe_add( _5839_ptr,_5861_i )];
      }
    }
    int32_t _11830_ = (int)0;
    int32_t _11831_ = _5836_nnz;
    for (int32_t _5862_i = _11830_; _5862_i < _11831_; ++_5862_i)
    {
      {
        _ptr__5849_ri64[safe_add( _5853_rnidxs,_5862_i )] = _ptr__5832_wi64[safe_add( _5845_nidxs,_5862_i )];
        _ptr__5850_rf64[safe_add( _5854_rcof,_5862_i )] = (_ptr__5833_wf64[safe_add( _5846_cof,_5862_i )] * c);
      }
    }
    if (_5837_hassp)
    {
      {
        int32_t _11832_ = (int)0;
        int32_t _11833_ = _5835_nelem;
        for (int32_t _5863_i = _11832_; _5863_i < _11833_; ++_5863_i)
        {
          {
            _ptr__5849_ri64[safe_add( _5860_rsp,_5863_i )] = _ptr__5832_wi64[safe_add( _5844_sp,_5863_i )];
          }
        }
      }
    }
    {}
    int32_t _11834_ = (int)0;
    int32_t _11835_ = _5834_nd;
    for (int32_t _5864_i = _11834_; _5864_i < _11835_; ++_5864_i)
    {
      {
        _ptr__5851_ri32[safe_add( _5859_rshape,_5864_i )] = _ptr__5831_wi32[safe_add( _5843_shape,_5864_i )];
      }
    }
    if ((_5838_ncodeatom > (int)0))
    {
      {
        _ptr__5851_ri32[_5856_rcodeptr] = (int)0;
        int32_t _5865_codei = (int)0;
        int32_t _11836_ = (int)0;
        int32_t _11837_ = _5836_nnz;
        for (int32_t _5866_j = _11836_; _5866_j < _11837_; ++_5866_j)
        {
          {
            int32_t _11838_ = _ptr__5831_wi32[safe_add( _5842_codeptr,_5866_j )];
            int32_t _11839_ = _ptr__5831_wi32[safe_add( safe_add( _5842_codeptr,_5866_j ),(int)1 )];
            for (int32_t _5867_k = _11838_; _5867_k < _11839_; ++_5867_k)
            {
              {
                _ptr__5851_ri32[safe_add( _5855_rcode,_5865_codei )] = _ptr__5831_wi32[safe_add( _5840_code,_5867_k )];
                _ptr__5850_rf64[safe_add( _5857_rcconst,_5865_codei )] = _ptr__5833_wf64[safe_add( _5841_cconst,_5867_k )];
                ++ _5865_codei;
              }
            }
            _ptr__5851_ri32[safe_add( _5855_rcode,_5865_codei )] = 2;
            _ptr__5850_rf64[safe_add( _5857_rcconst,_5865_codei )] = c;
            ++ _5865_codei;
            _ptr__5851_ri32[safe_add( _5855_rcode,_5865_codei )] = 5;
            ++ _5865_codei;
            _ptr__5851_ri32[safe_add( safe_add( _5856_rcodeptr,_5866_j ),(int)1 )] = _5865_codei;
          }
        }
      }
    }
    {}
  }
}
// End mosek.fusion.ExprMulScalarConst.eval

// Begin mosek.fusion.ExprMulScalarConst.toString
// Method mosek.fusion.ExprMulScalarConst.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1265:6-73
std::string mosek::fusion::ExprMulScalarConst :: toString() { return mosek::fusion::p_ExprMulScalarConst::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulScalarConst::toString()
{
  return std::string ("ExprMulScalarConst()");
}
// End mosek.fusion.ExprMulScalarConst.toString

void mosek::fusion::p_ExprMulScalarConst::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprMulScalarConst::destroy() { mosek::fusion::p_ExprMulScalarConst::_get_impl(this)->destroy(); }
// } class ExprMulScalarConst
// class ExprScalarMul { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1054:4-1247:5
mosek::fusion::ExprScalarMul::ExprScalarMul(mosek::fusion::p_ExprScalarMul *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprScalarMul()" << this << std::endl; */ }
mosek::fusion::ExprScalarMul::~ExprScalarMul() {  /* std::cout << "~ExprScalarMul()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprScalarMul::p_ExprScalarMul
  (::mosek::fusion::ExprScalarMul * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprScalarMul.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1133:6-1152:7
mosek::fusion::ExprScalarMul::t mosek::fusion::p_ExprScalarMul::_new_ExprScalarMul
  (int32_t _5868_mdim0,
    int32_t _5869_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5870_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5871_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5872_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5873_expr,
    int32_t _5874_validated)
{ return new mosek::fusion::ExprScalarMul(_5868_mdim0,_5869_mdim1,_5870_msubi,_5871_msubj,_5872_mval,_5873_expr,_5874_validated); }
mosek::fusion::ExprScalarMul::ExprScalarMul
  (int32_t _5868_mdim0,
    int32_t _5869_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5870_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5871_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5872_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5873_expr,
    int32_t _5874_validated) : 
   ExprScalarMul(new mosek::fusion::p_ExprScalarMul(this))
{ mosek::fusion::p_ExprScalarMul::_get_impl(this)->_initialize(_5868_mdim0,_5869_mdim1,_5870_msubi,_5871_msubj,_5872_mval,_5873_expr,_5874_validated); }
void mosek::fusion::p_ExprScalarMul::_initialize  (int32_t _5868_mdim0,
    int32_t _5869_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5870_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5871_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5872_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5873_expr,
    int32_t _5874_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5870_msubi(_5870_msubi ? _5870_msubi->raw() : nullptr, _5870_msubi ? _5870_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5871_msubj(_5871_msubj ? _5871_msubj->raw() : nullptr, _5871_msubj ? _5871_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5872_mval(_5872_mval ? _5872_mval->raw() : nullptr, _5872_mval ? _5872_mval->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_5868_mdim0),(int32_t)(_5869_mdim1)}));
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->mdim0 = _5868_mdim0;
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->mdim1 = _5869_mdim1;
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->msubi = _5870_msubi;
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->msubj = _5871_msubj;
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->mval = _5872_mval;
    mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->expr = _5873_expr;
  }
}
// mosek.fusion.ExprScalarMul.ctor

// mosek.fusion.ExprScalarMul.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1121:6-1131:7
mosek::fusion::ExprScalarMul::t mosek::fusion::p_ExprScalarMul::_new_ExprScalarMul
  (int32_t _5875_mdim0,
    int32_t _5876_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5877_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5878_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5879_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5880_expr)
{ return new mosek::fusion::ExprScalarMul(_5875_mdim0,_5876_mdim1,_5877_msubi,_5878_msubj,_5879_mval,_5880_expr); }
mosek::fusion::ExprScalarMul::ExprScalarMul
  (int32_t _5875_mdim0,
    int32_t _5876_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5877_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5878_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5879_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5880_expr) : 
   ExprScalarMul(new mosek::fusion::p_ExprScalarMul(this))
{ mosek::fusion::p_ExprScalarMul::_get_impl(this)->_initialize(_5875_mdim0,_5876_mdim1,_5877_msubi,_5878_msubj,_5879_mval,_5880_expr); }
void mosek::fusion::p_ExprScalarMul::_initialize  (int32_t _5875_mdim0,
    int32_t _5876_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5877_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5878_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5879_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5880_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5877_msubi(_5877_msubi ? _5877_msubi->raw() : nullptr, _5877_msubi ? _5877_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5878_msubj(_5878_msubj ? _5878_msubj->raw() : nullptr, _5878_msubj ? _5878_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5879_mval(_5879_mval ? _5879_mval->raw() : nullptr, _5879_mval ? _5879_mval->size(0) : 0);
    mosek::fusion::p_ExprScalarMul::_initialize(_5875_mdim0,_5876_mdim1,_5877_msubi,_5878_msubj,_5879_mval,_5880_expr,::mosek::fusion::p_ExprScalarMul::validate(_5875_mdim0,_5876_mdim1,_5877_msubi,_5878_msubj,_5879_mval,_5880_expr));
  }
}
// mosek.fusion.ExprScalarMul.ctor

// Begin mosek.fusion.ExprScalarMul.eval
// Method mosek.fusion.ExprScalarMul.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1154:6-1246:7
void mosek::fusion::ExprScalarMul :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5881_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5882_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5883_xs) { mosek::fusion::p_ExprScalarMul::_get_impl(this)->eval(_5881_rs,_5882_ws,_5883_xs); }
void mosek::fusion::p_ExprScalarMul::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5881_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5882_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5883_xs)
{
  mosek::fusion::p_ExprScalarMul::_get_impl(::mosek::fusion::ExprScalarMul::t(_pubthis))->expr->eval(_5882_ws,_5881_rs,_5883_xs);
  _5882_ws->pop_expr();
  int32_t _5884_nd = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->nd;
  int32_t _5885_nelem = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->nelem;
  int32_t _5886_nnz = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->nnz;
  bool _5887_hassp = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->hassp;
  int32_t _5888_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->ncodeatom;
  int32_t _5889_ptr = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->ptr_base;
  int32_t _5890_sp = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->sp_base;
  int32_t _5891_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->nidxs_base;
  int32_t _5892_cof = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->cof_base;
  int32_t _5893_code = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->code_base;
  int32_t _5894_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->codeptr_base;
  int32_t _5895_cconst = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5896_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5896_wi32(_5896_wi32 ? _5896_wi32->raw() : nullptr,_5896_wi32 ? _5896_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5897_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5897_wi64(_5897_wi64 ? _5897_wi64->raw() : nullptr,_5897_wi64 ? _5897_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5898_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5882_ws)->f64;
  _checked_ptr_1<double> _ptr__5898_wf64(_5898_wf64 ? _5898_wf64->raw() : nullptr,_5898_wf64 ? _5898_wf64->size(0) : 0);
  int32_t _5899_mnumnz = (int)((mval)->size(0));
  if ((_5884_nd != (int)0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid expression shape"));
    }
  }
  {}
  if ((_5885_nelem == (int)0))
  {
    {
      _5881_rs->alloc_expr((int)2,(int)0,(int)0,true);
      ((*mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->i32)(mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->shape_base)) = mdim0;
      ((*mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->i32)(safe_add( mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->shape_base,(int)1 ))) = mdim1;
    }
  }
  else
  {
    {
      int32_t _11840_;
      bool _11841_ = (_5888_ncodeatom > (int)0);
      if (_11841_)
      {
        _11840_ = safe_mul( (int)2,_5886_nnz );
      }
      else
      {
        _11840_ = (int)0;
      }
      int32_t _5900_rncodeatom = safe_mul( _5899_mnumnz,safe_add( _5888_ncodeatom,_11840_ ) );
      _5881_rs->alloc_expr((int)2,_5899_mnumnz,safe_mul( _5899_mnumnz,_5886_nnz ),true,_5900_rncodeatom);
      int32_t _5901_rptr = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->ptr_base;
      int32_t _5902_rnidx = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->nidxs_base;
      int32_t _5903_rsp = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->sp_base;
      int32_t _5904_rcof = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->cof_base;
      int32_t _5905_rshape = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->shape_base;
      int32_t _5906_rcode = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->code_base;
      int32_t _5907_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->codeptr_base;
      int32_t _5908_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5909_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__5909_ri32(_5909_ri32 ? _5909_ri32->raw() : nullptr,_5909_ri32 ? _5909_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _5910_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__5910_ri64(_5910_ri64 ? _5910_ri64->raw() : nullptr,_5910_ri64 ? _5910_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _5911_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5881_rs)->f64;
      _checked_ptr_1<double> _ptr__5911_rf64(_5911_rf64 ? _5911_rf64->raw() : nullptr,_5911_rf64 ? _5911_rf64->size(0) : 0);
      _ptr__5909_ri32[_5905_rshape] = mdim0;
      _ptr__5909_ri32[safe_add( _5905_rshape,(int)1 )] = mdim1;
      int32_t _5912_codei = (int)0;
      int32_t _5913_nzi = (int)0;
      _ptr__5909_ri32[_5901_rptr] = (int)0;
      if ((_5888_ncodeatom > (int)0))
      {
        {
          _ptr__5909_ri32[_5907_rcodeptr] = (int)0;
          int32_t _11842_ = (int)0;
          int32_t _11843_ = _5899_mnumnz;
          for (int32_t _5914_i = _11842_; _5914_i < _11843_; ++_5914_i)
          {
            {
              int32_t _11844_ = (int)0;
              int32_t _11845_ = _5886_nnz;
              for (int32_t _5915_j = _11844_; _5915_j < _11845_; ++_5915_j)
              {
                {
                  _ptr__5910_ri64[safe_add( _5902_rnidx,_5913_nzi )] = _ptr__5897_wi64[safe_add( _5891_nidxs,_5915_j )];
                  _ptr__5911_rf64[safe_add( _5904_rcof,_5913_nzi )] = (_ptr__5898_wf64[safe_add( _5892_cof,_5915_j )] * ((*mval)(_5914_i)));
                  int32_t _11846_ = _ptr__5896_wi32[safe_add( _5894_codeptr,_5915_j )];
                  int32_t _11847_ = _ptr__5896_wi32[safe_add( safe_add( _5894_codeptr,_5915_j ),(int)1 )];
                  for (int32_t _5916_k = _11846_; _5916_k < _11847_; ++_5916_k)
                  {
                    {
                      _ptr__5909_ri32[safe_add( _5906_rcode,_5912_codei )] = _ptr__5896_wi32[safe_add( _5893_code,_5916_k )];
                      _ptr__5911_rf64[safe_add( _5908_rcconst,_5912_codei )] = _ptr__5898_wf64[safe_add( _5895_cconst,_5916_k )];
                      ++ _5912_codei;
                    }
                  }
                  _ptr__5909_ri32[safe_add( _5906_rcode,_5912_codei )] = 2;
                  _ptr__5911_rf64[safe_add( _5908_rcconst,_5912_codei )] = ((*mval)(_5914_i));
                  ++ _5912_codei;
                  _ptr__5909_ri32[safe_add( _5906_rcode,_5912_codei )] = 5;
                  ++ _5912_codei;
                  _ptr__5909_ri32[safe_add( safe_add( _5907_rcodeptr,_5913_nzi ),(int)1 )] = _5912_codei;
                  ++ _5913_nzi;
                }
              }
              _ptr__5910_ri64[safe_add( _5903_rsp,_5914_i )] = safe_add( safe_mul( ((*msubi)(_5914_i)),mdim1 ),((*msubj)(_5914_i)) );
              _ptr__5909_ri32[safe_add( safe_add( _5901_rptr,_5914_i ),(int)1 )] = _5913_nzi;
            }
          }
        }
      }
      else
      {
        {
          int32_t _11848_ = (int)0;
          int32_t _11849_ = _5899_mnumnz;
          for (int32_t _5917_i = _11848_; _5917_i < _11849_; ++_5917_i)
          {
            {
              int32_t _11850_ = (int)0;
              int32_t _11851_ = _5886_nnz;
              for (int32_t _5918_j = _11850_; _5918_j < _11851_; ++_5918_j)
              {
                {
                  _ptr__5910_ri64[safe_add( _5902_rnidx,_5913_nzi )] = _ptr__5897_wi64[safe_add( _5891_nidxs,_5918_j )];
                  _ptr__5911_rf64[safe_add( _5904_rcof,_5913_nzi )] = (_ptr__5898_wf64[safe_add( _5892_cof,_5918_j )] * ((*mval)(_5917_i)));
                  ++ _5913_nzi;
                }
              }
              _ptr__5910_ri64[safe_add( _5903_rsp,_5917_i )] = safe_add( safe_mul( ((*msubi)(_5917_i)),mdim1 ),((*msubj)(_5917_i)) );
              _ptr__5909_ri32[safe_add( safe_add( _5901_rptr,_5917_i ),(int)1 )] = _5913_nzi;
            }
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprScalarMul.eval

// Begin mosek.fusion.ExprScalarMul.validate
// Method mosek.fusion.ExprScalarMul.validate @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1067:6-1106:7
int32_t mosek::fusion::p_ExprScalarMul::validate(int32_t _5919_mdim0,int32_t _5920_mdim1,std::shared_ptr< monty::ndarray< int32_t,1 > > _5921_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _5922_msubj,std::shared_ptr< monty::ndarray< double,1 > > _5923_mval,monty::rc_ptr< ::mosek::fusion::Expression > _5924_expr)
{
  _checked_ptr_1<int32_t> _ptr__5921_msubi(_5921_msubi ? _5921_msubi->raw() : nullptr, _5921_msubi ? _5921_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__5922_msubj(_5922_msubj ? _5922_msubj->raw() : nullptr, _5922_msubj ? _5922_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__5923_mval(_5923_mval ? _5923_mval->raw() : nullptr, _5923_mval ? _5923_mval->size(0) : 0);
  int32_t _5925_nd = _5924_expr->getND();
  if ((_5925_nd != (int)0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if (((_5919_mdim0 < (int)0) || (_5920_mdim1 < (int)0)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if ((((int)((_5921_msubi)->size(0)) != (int)((_5922_msubj)->size(0))) || ((int)((_5921_msubi)->size(0)) != (int)((_5923_mval)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  int32_t _5926_mnnz = (int)((_5921_msubi)->size(0));
  bool _5927_err_data = false;
  bool _5928_err_sorted = false;
  {
    int32_t _11852_ = (int)0;
    int32_t _11853_ = _5926_mnnz;
    for (int32_t _5929_i = _11852_; _5929_i < _11853_; ++_5929_i)
    {
      {
        if (((_ptr__5921_msubi[_5929_i] < (int)0) || ((_ptr__5921_msubi[_5929_i] >= _5919_mdim0) || ((_ptr__5922_msubj[_5929_i] < (int)0) || (_ptr__5922_msubj[_5929_i] >= _5920_mdim1)))))
        {
          {
            _5927_err_data = true;
          }
        }
        {}
      }
    }
    int32_t _11854_ = (int)0;
    int32_t _11855_ = (_5926_mnnz - (int)1);
    for (int32_t _5930_i = _11854_; _5930_i < _11855_; ++_5930_i)
    {
      {
        if (((_ptr__5921_msubi[_5930_i] > _ptr__5921_msubi[safe_add( _5930_i,(int)1 )]) || ((_ptr__5921_msubi[_5930_i] == _ptr__5921_msubi[safe_add( _5930_i,(int)1 )]) && (_ptr__5922_msubj[_5930_i] >= _ptr__5922_msubj[safe_add( _5930_i,(int)1 )]))))
        {
          {
            _5928_err_sorted = true;
          }
        }
        {}
      }
    }
  }
  if (_5927_err_data)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  if (_5928_err_sorted)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Unsorted matrix data"));
    }
  }
  {}
  return (int)1;
}
// End mosek.fusion.ExprScalarMul.validate

// Begin mosek.fusion.ExprScalarMul.toString
// Method mosek.fusion.ExprScalarMul.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:1065:6-134
std::string mosek::fusion::ExprScalarMul :: toString() { return mosek::fusion::p_ExprScalarMul::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprScalarMul::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprScalarMul(M,"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprScalarMul.toString

void mosek::fusion::p_ExprScalarMul::destroy()
{
  expr.reset();
  mval.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprScalarMul::destroy() { mosek::fusion::p_ExprScalarMul::_get_impl(this)->destroy(); }
// } class ExprScalarMul
// class ExprMulRight { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:480:4-1041:5
mosek::fusion::ExprMulRight::ExprMulRight(mosek::fusion::p_ExprMulRight *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulRight()" << this << std::endl; */ }
mosek::fusion::ExprMulRight::~ExprMulRight() {  /* std::cout << "~ExprMulRight()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulRight::p_ExprMulRight
  (::mosek::fusion::ExprMulRight * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulRight.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:575:6-593:7
mosek::fusion::ExprMulRight::t mosek::fusion::p_ExprMulRight::_new_ExprMulRight
  (int32_t _5931_mdim0,
    int32_t _5932_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5933_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5934_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5935_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5936_expr,
    int32_t _5937_validated)
{ return new mosek::fusion::ExprMulRight(_5931_mdim0,_5932_mdim1,_5933_msubi,_5934_msubj,_5935_mval,_5936_expr,_5937_validated); }
mosek::fusion::ExprMulRight::ExprMulRight
  (int32_t _5931_mdim0,
    int32_t _5932_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5933_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5934_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5935_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5936_expr,
    int32_t _5937_validated) : 
   ExprMulRight(new mosek::fusion::p_ExprMulRight(this))
{ mosek::fusion::p_ExprMulRight::_get_impl(this)->_initialize(_5931_mdim0,_5932_mdim1,_5933_msubi,_5934_msubj,_5935_mval,_5936_expr,_5937_validated); }
void mosek::fusion::p_ExprMulRight::_initialize  (int32_t _5931_mdim0,
    int32_t _5932_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5933_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5934_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5935_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5936_expr,
    int32_t _5937_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5933_msubi(_5933_msubi ? _5933_msubi->raw() : nullptr, _5933_msubi ? _5933_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5934_msubj(_5934_msubj ? _5934_msubj->raw() : nullptr, _5934_msubj ? _5934_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5935_mval(_5935_mval ? _5935_mval->raw() : nullptr, _5935_mval ? _5935_mval->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprMulRight::computeshape(_5932_mdim1,_5936_expr->getShape()));
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->mdim0 = _5931_mdim0;
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->mdim1 = _5932_mdim1;
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->msubi = _5933_msubi;
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->msubj = _5934_msubj;
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->mval = _5935_mval;
    mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->expr = _5936_expr;
  }
}
// mosek.fusion.ExprMulRight.ctor

// mosek.fusion.ExprMulRight.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:556:6-566:7
mosek::fusion::ExprMulRight::t mosek::fusion::p_ExprMulRight::_new_ExprMulRight
  (int32_t _5938_mdim0,
    int32_t _5939_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5940_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5941_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5942_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5943_expr)
{ return new mosek::fusion::ExprMulRight(_5938_mdim0,_5939_mdim1,_5940_msubi,_5941_msubj,_5942_mval,_5943_expr); }
mosek::fusion::ExprMulRight::ExprMulRight
  (int32_t _5938_mdim0,
    int32_t _5939_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5940_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5941_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5942_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5943_expr) : 
   ExprMulRight(new mosek::fusion::p_ExprMulRight(this))
{ mosek::fusion::p_ExprMulRight::_get_impl(this)->_initialize(_5938_mdim0,_5939_mdim1,_5940_msubi,_5941_msubj,_5942_mval,_5943_expr); }
void mosek::fusion::p_ExprMulRight::_initialize  (int32_t _5938_mdim0,
    int32_t _5939_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5940_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _5941_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _5942_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _5943_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__5940_msubi(_5940_msubi ? _5940_msubi->raw() : nullptr, _5940_msubi ? _5940_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__5941_msubj(_5941_msubj ? _5941_msubj->raw() : nullptr, _5941_msubj ? _5941_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__5942_mval(_5942_mval ? _5942_mval->raw() : nullptr, _5942_mval ? _5942_mval->size(0) : 0);
    mosek::fusion::p_ExprMulRight::_initialize(_5938_mdim0,_5939_mdim1,_5940_msubi,_5941_msubj,_5942_mval,_5943_expr,::mosek::fusion::p_ExprMulRight::validate(_5938_mdim0,_5939_mdim1,_5940_msubi,_5941_msubj,_5942_mval,_5943_expr));
  }
}
// mosek.fusion.ExprMulRight.ctor

// Begin mosek.fusion.ExprMulRight.eval
// Method mosek.fusion.ExprMulRight.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:596:6-1040:7
void mosek::fusion::ExprMulRight :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5944_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5945_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5946_xs) { mosek::fusion::p_ExprMulRight::_get_impl(this)->eval(_5944_rs,_5945_ws,_5946_xs); }
void mosek::fusion::p_ExprMulRight::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _5944_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _5945_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _5946_xs)
{
  mosek::fusion::p_ExprMulRight::_get_impl(::mosek::fusion::ExprMulRight::t(_pubthis))->expr->eval(_5945_ws,_5944_rs,_5946_xs);
  _5945_ws->pop_expr();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _5947_wi32 = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__5947_wi32(_5947_wi32 ? _5947_wi32->raw() : nullptr,_5947_wi32 ? _5947_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _5948_wi64 = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__5948_wi64(_5948_wi64 ? _5948_wi64->raw() : nullptr,_5948_wi64 ? _5948_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _5949_wf64 = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->f64;
  _checked_ptr_1<double> _ptr__5949_wf64(_5949_wf64 ? _5949_wf64->raw() : nullptr,_5949_wf64 ? _5949_wf64->size(0) : 0);
  int32_t _5950_nd = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->nd;
  if ((_5950_nd != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operator shape for multiplication"));
    }
  }
  {}
  int32_t _5951_nelem = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->nelem;
  int32_t _5952_nnz = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->nnz;
  int32_t _5953_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->ncodeatom;
  bool _5954_hassp = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->hassp;
  int32_t _5955_ptr = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->ptr_base;
  int32_t _5956_shape = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->shape_base;
  int32_t _5957_sp = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->sp_base;
  int32_t _5958_nidxs = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->nidxs_base;
  int32_t _5959_cof = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->cof_base;
  int32_t _5960_codeptr = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->codeptr_base;
  int32_t _5961_code = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->code_base;
  int32_t _5962_cconst = mosek::fusion::p_WorkStack::_get_impl(_5945_ws)->cconst_base;
  int32_t _5963_edim0 = _ptr__5947_wi32[_5956_shape];
  int32_t _5964_edim1 = _ptr__5947_wi32[safe_add( _5956_shape,(int)1 )];
  int32_t _5965_mnnz = (int)((mval)->size(0));
  bool _5966_msp = (_5965_mnnz < safe_mul( (int64_t)mdim0,(int64_t)mdim1 ));
  if (_5966_msp)
  {
    {
      int32_t _5967_mcolptr = _5946_xs->alloci32(safe_add( mdim1,(int)1 ));
      int32_t _5968_mperm = _5946_xs->alloci32(_5965_mnnz);
      int32_t _5969_erowptr = _5946_xs->alloci32(safe_add( _5963_edim0,(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _5970_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5946_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__5970_xi32(_5970_xi32 ? _5970_xi32->raw() : nullptr,_5970_xi32 ? _5970_xi32->size(0) : 0);
      {
        int32_t _11856_ = (int)0;
        int32_t _11857_ = safe_add( mdim1,(int)1 );
        for (int32_t _5971_i = _11856_; _5971_i < _11857_; ++_5971_i)
        {
          {
            _ptr__5970_xi32[safe_add( _5967_mcolptr,_5971_i )] = (int)0;
          }
        }
        int32_t _11858_ = (int)0;
        int32_t _11859_ = _5965_mnnz;
        for (int32_t _5972_i = _11858_; _5972_i < _11859_; ++_5972_i)
        {
          {
            ++ _ptr__5970_xi32[safe_add( safe_add( _5967_mcolptr,((*msubj)(_5972_i)) ),(int)1 )];
          }
        }
        int32_t _11860_ = (int)0;
        int32_t _11861_ = mdim1;
        for (int32_t _5973_i = _11860_; _5973_i < _11861_; ++_5973_i)
        {
          {
            _ptr__5970_xi32[safe_add( safe_add( _5967_mcolptr,_5973_i ),(int)1 )] += _ptr__5970_xi32[safe_add( _5967_mcolptr,_5973_i )];
          }
        }
        int32_t _11862_ = (int)0;
        int32_t _11863_ = _5965_mnnz;
        for (int32_t _5974_i = _11862_; _5974_i < _11863_; ++_5974_i)
        {
          {
            _ptr__5970_xi32[safe_add( _5968_mperm,_ptr__5970_xi32[safe_add( _5967_mcolptr,((*msubj)(_5974_i)) )] )] = _5974_i;
            ++ _ptr__5970_xi32[safe_add( _5967_mcolptr,((*msubj)(_5974_i)) )];
          }
        }
        int32_t _11864_ = (int)0;
        int32_t _11865_ = mdim1;
        for (int32_t _5975_i = _11864_; _5975_i < _11865_; ++_5975_i)
        {
          {
            _ptr__5970_xi32[(safe_add( _5967_mcolptr,mdim1 ) - _5975_i)] = _ptr__5970_xi32[((safe_add( _5967_mcolptr,mdim1 ) - _5975_i) - (int)1)];
          }
        }
        _ptr__5970_xi32[_5967_mcolptr] = (int)0;
        int32_t _11866_ = (int)0;
        int32_t _11867_ = safe_add( _5963_edim0,(int)1 );
        for (int32_t _5976_i = _11866_; _5976_i < _11867_; ++_5976_i)
        {
          {
            _ptr__5970_xi32[safe_add( _5969_erowptr,_5976_i )] = (int)0;
          }
        }
      }
      if (_5954_hassp)
      {
        {
          int32_t _5977_rncodeatom = (int)0;
          int32_t _5978_rnelem = (int)0;
          int64_t _5979_rnnz = (int64_t)0;
          {
            int32_t _5980_i0 = (int)0;
            while ( (_5980_i0 < _5951_nelem) )
            {
              {
                int64_t _5981_erow = (_ptr__5948_wi64[safe_add( _5957_sp,_5980_i0 )] / _5964_edim1);
                int32_t _5982_b0 = _5980_i0;
                ++ _5980_i0;
                while ( ((_5980_i0 < _5951_nelem) && ((_ptr__5948_wi64[safe_add( _5957_sp,_5980_i0 )] / _5964_edim1) == _5981_erow)) )
                {
                  {
                    ++ _5980_i0;
                  }
                }
                int32_t _5983_e0 = _5980_i0;
                int32_t _5984_i1 = (int)0;
                while ( (_5984_i1 < _5965_mnnz) )
                {
                  {
                    int32_t _5985_mcol = ((*msubj)(_ptr__5970_xi32[safe_add( _5968_mperm,_5984_i1 )]));
                    int32_t _5986_b1 = _5984_i1;
                    ++ _5984_i1;
                    while ( ((_5984_i1 < _5965_mnnz) && (((*msubj)(_ptr__5970_xi32[safe_add( _5968_mperm,_5984_i1 )])) == _5985_mcol)) )
                    {
                      {
                        ++ _5984_i1;
                      }
                    }
                    int32_t _5987_e1 = _5984_i1;
                    bool _5988_hasnz = false;
                    int32_t _5989_ii1 = _5986_b1;
                    int32_t _5990_ii0 = _5982_b0;
                    while ( ((_5990_ii0 < _5983_e0) && (_5989_ii1 < _5987_e1)) )
                    {
                      {
                        int32_t _5991_ip1 = _ptr__5970_xi32[safe_add( _5968_mperm,_5989_ii1 )];
                        if (((_ptr__5948_wi64[safe_add( _5957_sp,_5990_ii0 )] % _5964_edim1) < ((*msubi)(_5991_ip1))))
                        {
                          {
                            ++ _5990_ii0;
                          }
                        }
                        else if(((_ptr__5948_wi64[safe_add( _5957_sp,_5990_ii0 )] % _5964_edim1) > ((*msubi)(_5991_ip1))))
                        {
                          {
                            ++ _5989_ii1;
                          }
                        }
                        else
                        {
                          {
                            if (((((*mval)(_5991_ip1)) > (int)0) || ((int)0 < ((*mval)(_5991_ip1)))))
                            {
                              {
                                _5979_rnnz += (_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_5990_ii0 ),(int)1 )] - _ptr__5947_wi32[safe_add( _5955_ptr,_5990_ii0 )]);
                                if ((_5953_ncodeatom > (int)0))
                                {
                                  {
                                    _5977_rncodeatom += safe_add( (_ptr__5947_wi32[safe_add( _5960_codeptr,_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_5990_ii0 ),(int)1 )] )] - _ptr__5947_wi32[safe_add( _5960_codeptr,_ptr__5947_wi32[safe_add( _5955_ptr,_5990_ii0 )] )]),safe_mul( (int)2,(_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_5990_ii0 ),(int)1 )] - _ptr__5947_wi32[safe_add( _5955_ptr,_5990_ii0 )]) ) );
                                  }
                                }
                                {}
                                _5988_hasnz = true;
                              }
                            }
                            {}
                            ++ _5990_ii0;
                            ++ _5989_ii1;
                          }
                        }
                      }
                    }
                    if (_5988_hasnz)
                    {
                      {
                        ++ _5978_rnelem;
                      }
                    }
                    {}
                  }
                }
              }
            }
          }
          bool _5992_rhassp = (_5978_rnelem < safe_mul( _5963_edim0,mdim1 ));
          _5944_rs->alloc_expr((int)2,_5978_rnelem,(int32_t)_5979_rnnz,_5992_rhassp,_5977_rncodeatom);
          int32_t _5993_rptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->ptr_base;
          int32_t _5994_ridxs = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->nidxs_base;
          int32_t _11868_;
          bool _11869_ = _5992_rhassp;
          if (_11869_)
          {
            _11868_ = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->sp_base;
          }
          else
          {
            _11868_ = _5944_rs->alloci64(_5978_rnelem);
          }
          int32_t _5995_rsp = _11868_;
          int32_t _5996_rcof = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cof_base;
          int32_t _5997_rshape = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->shape_base;
          int32_t _5998_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->codeptr_base;
          int32_t _5999_rcode = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->code_base;
          int32_t _6000_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cconst_base;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _6001_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__6001_ri32(_6001_ri32 ? _6001_ri32->raw() : nullptr,_6001_ri32 ? _6001_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6002_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__6002_ri64(_6002_ri64 ? _6002_ri64->raw() : nullptr,_6002_ri64 ? _6002_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _6003_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->f64;
          _checked_ptr_1<double> _ptr__6003_rf64(_6003_rf64 ? _6003_rf64->raw() : nullptr,_6003_rf64 ? _6003_rf64->size(0) : 0);
          _ptr__6001_ri32[_5997_rshape] = _5963_edim0;
          _ptr__6001_ri32[safe_add( _5997_rshape,(int)1 )] = mdim1;
          _ptr__6001_ri32[_5993_rptr] = (int)0;
          if ((_5977_rncodeatom > (int)0))
          {
            {
              _ptr__6001_ri32[_5998_rcodeptr] = (int)0;
            }
          }
          {}
          {
            int32_t _6004_i0 = (int)0;
            int32_t _6005_codei = (int)0;
            int32_t _6006_elmi = (int)0;
            int32_t _6007_nzi = (int)0;
            while ( (_6004_i0 < _5951_nelem) )
            {
              {
                int64_t _6008_erow = (_ptr__5948_wi64[safe_add( _5957_sp,_6004_i0 )] / _5964_edim1);
                int32_t _6009_b0 = _6004_i0;
                ++ _6004_i0;
                while ( ((_6004_i0 < _5951_nelem) && ((_ptr__5948_wi64[safe_add( _5957_sp,_6004_i0 )] / _5964_edim1) == _6008_erow)) )
                {
                  {
                    ++ _6004_i0;
                  }
                }
                int32_t _6010_e0 = _6004_i0;
                int32_t _6011_i1 = (int)0;
                while ( (_6011_i1 < _5965_mnnz) )
                {
                  {
                    int32_t _6012_mcol = ((*msubj)(_ptr__5970_xi32[safe_add( _5968_mperm,_6011_i1 )]));
                    int32_t _6013_b1 = _6011_i1;
                    ++ _6011_i1;
                    while ( ((_6011_i1 < _5965_mnnz) && (((*msubj)(_ptr__5970_xi32[safe_add( _5968_mperm,_6011_i1 )])) == _6012_mcol)) )
                    {
                      {
                        ++ _6011_i1;
                      }
                    }
                    int32_t _6014_e1 = _6011_i1;
                    int32_t _6015_ii1 = _6013_b1;
                    int32_t _6016_ii0 = _6009_b0;
                    bool _6017_hasnz = false;
                    while ( ((_6016_ii0 < _6010_e0) && (_6015_ii1 < _6014_e1)) )
                    {
                      {
                        int32_t _6018_ip1 = _ptr__5970_xi32[safe_add( _5968_mperm,_6015_ii1 )];
                        if (((_ptr__5948_wi64[safe_add( _5957_sp,_6016_ii0 )] % _5964_edim1) < ((*msubi)(_6018_ip1))))
                        {
                          {
                            ++ _6016_ii0;
                          }
                        }
                        else if(((_ptr__5948_wi64[safe_add( _5957_sp,_6016_ii0 )] % _5964_edim1) > ((*msubi)(_6018_ip1))))
                        {
                          {
                            ++ _6015_ii1;
                          }
                        }
                        else
                        {
                          {
                            if (((((*mval)(_6018_ip1)) > (int)0) || ((int)0 < ((*mval)(_6018_ip1)))))
                            {
                              {
                                int32_t _11870_ = _ptr__5947_wi32[safe_add( _5955_ptr,_6016_ii0 )];
                                int32_t _11871_ = _ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6016_ii0 ),(int)1 )];
                                for (int32_t _6019_k = _11870_; _6019_k < _11871_; ++_6019_k)
                                {
                                  {
                                    _ptr__6002_ri64[safe_add( _5994_ridxs,_6007_nzi )] = _ptr__5948_wi64[safe_add( _5958_nidxs,_6019_k )];
                                    _ptr__6003_rf64[safe_add( _5996_rcof,_6007_nzi )] = (_ptr__5949_wf64[safe_add( _5959_cof,_6019_k )] * ((*mval)(_6018_ip1)));
                                    if ((_5953_ncodeatom > (int)0))
                                    {
                                      {
                                        int32_t _11872_ = _ptr__5947_wi32[safe_add( _5960_codeptr,_6019_k )];
                                        int32_t _11873_ = _ptr__5947_wi32[safe_add( safe_add( _5960_codeptr,_6019_k ),(int)1 )];
                                        for (int32_t _6020_l = _11872_; _6020_l < _11873_; ++_6020_l)
                                        {
                                          {
                                            _ptr__6001_ri32[safe_add( _5999_rcode,_6005_codei )] = _ptr__5947_wi32[safe_add( _5961_code,_6020_l )];
                                            _ptr__6003_rf64[safe_add( _6000_rcconst,_6005_codei )] = _ptr__5949_wf64[safe_add( _5962_cconst,_6020_l )];
                                            ++ _6005_codei;
                                          }
                                        }
                                        _ptr__6001_ri32[safe_add( _5999_rcode,_6005_codei )] = 2;
                                        _ptr__6003_rf64[safe_add( _6000_rcconst,_6005_codei )] = ((*mval)(_6015_ii1));
                                        ++ _6005_codei;
                                        _ptr__6001_ri32[safe_add( _5999_rcode,_6005_codei )] = 5;
                                        ++ _6005_codei;
                                        _ptr__6001_ri32[safe_add( safe_add( _5998_rcodeptr,_6007_nzi ),(int)1 )] = _6005_codei;
                                      }
                                    }
                                    {}
                                    ++ _6007_nzi;
                                  }
                                }
                                _6017_hasnz = true;
                              }
                            }
                            {}
                            ++ _6016_ii0;
                            ++ _6015_ii1;
                          }
                        }
                      }
                    }
                    if (_6017_hasnz)
                    {
                      {
                        _ptr__6001_ri32[safe_add( safe_add( _5993_rptr,_6006_elmi ),(int)1 )] = _6007_nzi;
                        _ptr__6002_ri64[safe_add( _5995_rsp,_6006_elmi )] = safe_add( safe_mul( _6008_erow,mdim1 ),_6012_mcol );
                        ++ _6006_elmi;
                      }
                    }
                    {}
                  }
                }
              }
            }
            if ((_6007_nzi != _5979_rnnz))
            {
              {
                throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid nnz"));
              }
            }
            {}
            if ((_6006_elmi != _5978_rnelem))
            {
              {
                throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid nnz"));
              }
            }
            {}
            if ((_ptr__6001_ri32[safe_add( _5993_rptr,_5978_rnelem )] != _5979_rnnz))
            {
              {
                throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid nnz"));
              }
            }
            {}
          }
          if ((!_5992_rhassp))
          {
            {
              _5944_rs->popi64(_5978_rnelem);
            }
          }
          {}
        }
      }
      else
      {
        {
          int32_t _6021_rncodeatom = (int)0;
          int32_t _6022_rnelem = safe_mul( _5963_edim0,mdim1 );
          int32_t _6023_rnnz = (int)0;
          int32_t _11874_ = (int)0;
          int32_t _11875_ = _5963_edim0;
          for (int32_t _6024_i = _11874_; _6024_i < _11875_; ++_6024_i)
          {
            {
              int32_t _11876_ = (int)0;
              int32_t _11877_ = mdim1;
              for (int32_t _6025_j = _11876_; _6025_j < _11877_; ++_6025_j)
              {
                {
                  int32_t _11878_ = _ptr__5970_xi32[safe_add( _5967_mcolptr,_6025_j )];
                  int32_t _11879_ = _ptr__5970_xi32[safe_add( safe_add( _5967_mcolptr,_6025_j ),(int)1 )];
                  for (int32_t _6026_i1 = _11878_; _6026_i1 < _11879_; ++_6026_i1)
                  {
                    {
                      int32_t _6027_ii1 = _ptr__5970_xi32[safe_add( _5968_mperm,_6026_i1 )];
                      int32_t _6028_i0 = safe_add( safe_mul( _6024_i,_5964_edim1 ),((*msubi)(_6027_ii1)) );
                      _6023_rnnz += (_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6028_i0 ),(int)1 )] - _ptr__5947_wi32[safe_add( _5955_ptr,_6028_i0 )]);
                      if ((_5953_ncodeatom > (int)0))
                      {
                        {
                          _6021_rncodeatom += safe_add( (_ptr__5947_wi32[safe_add( _5960_codeptr,_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6028_i0 ),(int)1 )] )] - _ptr__5947_wi32[safe_add( _5960_codeptr,_ptr__5947_wi32[safe_add( _5955_ptr,_6028_i0 )] )]),safe_mul( (int)2,(_ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6028_i0 ),(int)1 )] - _ptr__5947_wi32[safe_add( _5955_ptr,_6028_i0 )]) ) );
                        }
                      }
                      {}
                    }
                  }
                }
              }
            }
          }
          bool _6029_rhassp = (_6022_rnelem < safe_mul( _5963_edim0,mdim1 ));
          if ((!(_6023_rnnz <= (int)0x7fffffff)))
          {
            {
              throw ::mosek::fusion::LengthError(std::string ("Maximum number of nonzeros exceeded in multiplication"));
            }
          }
          {}
          _5944_rs->alloc_expr((int)2,_6022_rnelem,(int32_t)_6023_rnnz,_6029_rhassp,_6021_rncodeatom);
          int32_t _6030_rshape = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->shape_base;
          int32_t _6031_rptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->ptr_base;
          int32_t _6032_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->nidxs_base;
          int32_t _11880_;
          bool _11881_ = _6029_rhassp;
          if (_11881_)
          {
            _11880_ = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->sp_base;
          }
          else
          {
            _11880_ = _5944_rs->alloci64(_6022_rnelem);
          }
          int32_t _6033_rsp = _11880_;
          int32_t _6034_rcof = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cof_base;
          int32_t _6035_rcode = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->code_base;
          int32_t _6036_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->codeptr_base;
          int32_t _6037_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cconst_base;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _6038_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__6038_ri32(_6038_ri32 ? _6038_ri32->raw() : nullptr,_6038_ri32 ? _6038_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6039_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__6039_ri64(_6039_ri64 ? _6039_ri64->raw() : nullptr,_6039_ri64 ? _6039_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _6040_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->f64;
          _checked_ptr_1<double> _ptr__6040_rf64(_6040_rf64 ? _6040_rf64->raw() : nullptr,_6040_rf64 ? _6040_rf64->size(0) : 0);
          _ptr__6038_ri32[_6030_rshape] = _5963_edim0;
          _ptr__6038_ri32[safe_add( _6030_rshape,(int)1 )] = mdim1;
          int32_t _6041_codei = (int)0;
          int32_t _6042_relm = (int)0;
          int32_t _6043_nzi = (int)0;
          _ptr__6038_ri32[_6031_rptr] = (int)0;
          if ((_6021_rncodeatom > (int)0))
          {
            {
              _ptr__6038_ri32[_6036_rcodeptr] = (int)0;
            }
          }
          {}
          int32_t _11882_ = (int)0;
          int32_t _11883_ = _5963_edim0;
          for (int32_t _6044_i = _11882_; _6044_i < _11883_; ++_6044_i)
          {
            {
              int32_t _11884_ = (int)0;
              int32_t _11885_ = mdim1;
              for (int32_t _6045_j = _11884_; _6045_j < _11885_; ++_6045_j)
              {
                {
                  int32_t _6046_b0 = safe_mul( _6044_i,_5964_edim1 );
                  int32_t _11886_ = _ptr__5970_xi32[safe_add( _5967_mcolptr,_6045_j )];
                  int32_t _11887_ = _ptr__5970_xi32[safe_add( safe_add( _5967_mcolptr,_6045_j ),(int)1 )];
                  for (int32_t _6047_i1 = _11886_; _6047_i1 < _11887_; ++_6047_i1)
                  {
                    {
                      int32_t _6048_ii1 = _ptr__5970_xi32[safe_add( _5968_mperm,_6047_i1 )];
                      int32_t _6049_i0 = safe_add( _6046_b0,((*msubi)(_6048_ii1)) );
                      if ((_6021_rncodeatom == (int)0))
                      {
                        {
                          int32_t _11888_ = _ptr__5947_wi32[safe_add( _5955_ptr,_6049_i0 )];
                          int32_t _11889_ = _ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6049_i0 ),(int)1 )];
                          for (int32_t _6050_k = _11888_; _6050_k < _11889_; ++_6050_k)
                          {
                            {
                              _ptr__6039_ri64[safe_add( _6032_rnidxs,_6043_nzi )] = _ptr__5948_wi64[safe_add( _5958_nidxs,_6050_k )];
                              _ptr__6040_rf64[safe_add( _6034_rcof,_6043_nzi )] = (_ptr__5949_wf64[safe_add( _5959_cof,_6050_k )] * ((*mval)(_6048_ii1)));
                              ++ _6043_nzi;
                            }
                          }
                        }
                      }
                      else
                      {
                        {
                          int32_t _11890_ = _ptr__5947_wi32[safe_add( _5955_ptr,_6049_i0 )];
                          int32_t _11891_ = _ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6049_i0 ),(int)1 )];
                          for (int32_t _6051_k = _11890_; _6051_k < _11891_; ++_6051_k)
                          {
                            {
                              _ptr__6039_ri64[safe_add( _6032_rnidxs,_6043_nzi )] = _ptr__5948_wi64[safe_add( _5958_nidxs,_6051_k )];
                              _ptr__6040_rf64[safe_add( _6034_rcof,_6043_nzi )] = (_ptr__5949_wf64[safe_add( _5959_cof,_6051_k )] * ((*mval)(_6048_ii1)));
                              int32_t _11892_ = _ptr__5947_wi32[safe_add( _5960_codeptr,_6051_k )];
                              int32_t _11893_ = _ptr__5947_wi32[safe_add( safe_add( _5960_codeptr,_6051_k ),(int)1 )];
                              for (int32_t _6052_l = _11892_; _6052_l < _11893_; ++_6052_l)
                              {
                                {
                                  _ptr__6038_ri32[safe_add( _6035_rcode,_6041_codei )] = _ptr__5947_wi32[safe_add( _5961_code,_6052_l )];
                                  _ptr__6040_rf64[safe_add( _6037_rcconst,_6041_codei )] = _ptr__5949_wf64[safe_add( _5962_cconst,_6052_l )];
                                  ++ _6041_codei;
                                }
                              }
                              _ptr__6038_ri32[safe_add( _6035_rcode,_6041_codei )] = 2;
                              _ptr__6040_rf64[safe_add( _6037_rcconst,_6041_codei )] = ((*mval)(_6048_ii1));
                              ++ _6041_codei;
                              _ptr__6038_ri32[safe_add( _6035_rcode,_6041_codei )] = 5;
                              ++ _6041_codei;
                              _ptr__6038_ri32[safe_add( safe_add( _6036_rcodeptr,_6043_nzi ),(int)1 )] = _6041_codei;
                              ++ _6043_nzi;
                            }
                          }
                        }
                      }
                    }
                  }
                  _ptr__6038_ri32[safe_add( safe_add( _6031_rptr,_6042_relm ),(int)1 )] = _6043_nzi;
                  _ptr__6039_ri64[safe_add( _6033_rsp,_6042_relm )] = safe_add( safe_mul( _6044_i,mdim1 ),_6045_j );
                  ++ _6042_relm;
                }
              }
            }
          }
          if ((!_6029_rhassp))
          {
            {
              _5944_rs->popi64(_6022_rnelem);
            }
          }
          {}
        }
      }
      _5946_xs->clear();
    }
  }
  else
  {
    {
      int32_t _6053_xrowptr = _5946_xs->alloci32(safe_add( _5963_edim0,(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6054_xi32 = mosek::fusion::p_WorkStack::_get_impl(_5946_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__6054_xi32(_6054_xi32 ? _6054_xi32->raw() : nullptr,_6054_xi32 ? _6054_xi32->size(0) : 0);
      int32_t _11894_ = (int)0;
      int32_t _11895_ = safe_add( _5963_edim0,(int)1 );
      for (int32_t _6055_i = _11894_; _6055_i < _11895_; ++_6055_i)
      {
        {
          _ptr__6054_xi32[safe_add( _6053_xrowptr,_6055_i )] = (int)0;
        }
      }
      int64_t _6056_rnnz = safe_mul( (int64_t)_5952_nnz,mdim1 );
      int32_t _6057_rnelem = safe_mul( _5963_edim0,mdim1 );
      int32_t _11896_;
      bool _11897_ = (_5953_ncodeatom == (int)0);
      if (_11897_)
      {
        _11896_ = (int)0;
      }
      else
      {
        _11896_ = safe_mul( (int32_t)_6056_rnnz,(int)2 );
      }
      int32_t _6058_rncodeatom = safe_add( safe_mul( _5953_ncodeatom,mdim1 ),_11896_ );
      bool _6059_rhassp = false;
      int32_t _6060_rnd = (int)2;
      if ((!(_6056_rnnz <= (int)0x7fffffff)))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Maximum number of nonzeros exceeded in multiplication"));
        }
      }
      {}
      _5944_rs->alloc_expr(_6060_rnd,_6057_rnelem,(int32_t)_6056_rnnz,_6059_rhassp,_6058_rncodeatom);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6061_ri32 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6061_ri32(_6061_ri32 ? _6061_ri32->raw() : nullptr,_6061_ri32 ? _6061_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6062_ri64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6062_ri64(_6062_ri64 ? _6062_ri64->raw() : nullptr,_6062_ri64 ? _6062_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6063_rf64 = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->f64;
      _checked_ptr_1<double> _ptr__6063_rf64(_6063_rf64 ? _6063_rf64->raw() : nullptr,_6063_rf64 ? _6063_rf64->size(0) : 0);
      int32_t _6064_rshape = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->shape_base;
      int32_t _6065_rptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->ptr_base;
      int32_t _6066_ridxs = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->nidxs_base;
      int32_t _6067_rsp = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->sp_base;
      int32_t _6068_rcof = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cof_base;
      int32_t _6069_rcode = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->code_base;
      int32_t _6070_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->codeptr_base;
      int32_t _6071_rcconst = mosek::fusion::p_WorkStack::_get_impl(_5944_rs)->cconst_base;
      _ptr__6061_ri32[_6064_rshape] = _5963_edim0;
      _ptr__6061_ri32[safe_add( _6064_rshape,(int)1 )] = mdim1;
      int32_t _6072_codei = (int)0;
      int32_t _6073_nzi = (int)0;
      int32_t _6074_elmi = (int)0;
      _ptr__6061_ri32[_6065_rptr] = (int)0;
      if ((_6058_rncodeatom > (int)0))
      {
        {
          _ptr__6061_ri32[_6070_rcodeptr] = (int)0;
        }
      }
      {}
      if (_5954_hassp)
      {
        {
          {
            int32_t _11898_ = (int)0;
            int32_t _11899_ = _5951_nelem;
            for (int32_t _6075_i = _11898_; _6075_i < _11899_; ++_6075_i)
            {
              {
                ++ _ptr__6054_xi32[safe_add( safe_add( _6053_xrowptr,(_ptr__5948_wi64[safe_add( _5957_sp,_6075_i )] / _5964_edim1) ),(int)1 )];
              }
            }
            int32_t _11900_ = (int)0;
            int32_t _11901_ = _5963_edim0;
            for (int32_t _6076_i = _11900_; _6076_i < _11901_; ++_6076_i)
            {
              {
                _ptr__6054_xi32[safe_add( safe_add( _6053_xrowptr,_6076_i ),(int)1 )] += _ptr__6054_xi32[safe_add( _6053_xrowptr,_6076_i )];
              }
            }
            int32_t _11902_ = (int)0;
            int32_t _11903_ = _5963_edim0;
            for (int32_t _6077_i = _11902_; _6077_i < _11903_; ++_6077_i)
            {
              {
                int32_t _11904_ = (int)0;
                int32_t _11905_ = mdim1;
                for (int32_t _6078_j = _11904_; _6078_j < _11905_; ++_6078_j)
                {
                  {
                    int32_t _11906_ = _ptr__6054_xi32[safe_add( _6053_xrowptr,_6077_i )];
                    int32_t _11907_ = _ptr__6054_xi32[safe_add( safe_add( _6053_xrowptr,_6077_i ),(int)1 )];
                    for (int32_t _6079_i0 = _11906_; _6079_i0 < _11907_; ++_6079_i0)
                    {
                      {
                        int64_t _6080_ii1 = safe_add( _6078_j,safe_mul( (_ptr__5948_wi64[safe_add( _5957_sp,_6079_i0 )] % _5964_edim1),mdim1 ) );
                        int32_t _11908_ = _ptr__5947_wi32[safe_add( _5955_ptr,_6079_i0 )];
                        int32_t _11909_ = _ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6079_i0 ),(int)1 )];
                        for (int32_t _6081_k = _11908_; _6081_k < _11909_; ++_6081_k)
                        {
                          {
                            _ptr__6062_ri64[safe_add( _6066_ridxs,_6073_nzi )] = _ptr__5948_wi64[safe_add( _5958_nidxs,_6081_k )];
                            _ptr__6063_rf64[safe_add( _6068_rcof,_6073_nzi )] = (_ptr__5949_wf64[safe_add( _5959_cof,_6081_k )] * ((*mval)(_6080_ii1)));
                            if ((_5953_ncodeatom > (int)0))
                            {
                              {
                                int32_t _11910_ = _ptr__5947_wi32[safe_add( _5960_codeptr,_6081_k )];
                                int32_t _11911_ = _ptr__5947_wi32[safe_add( safe_add( _5960_codeptr,_6081_k ),(int)1 )];
                                for (int32_t _6082_l = _11910_; _6082_l < _11911_; ++_6082_l)
                                {
                                  {
                                    _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = _ptr__5947_wi32[safe_add( _5961_code,_6082_l )];
                                    _ptr__6063_rf64[safe_add( _6071_rcconst,_6072_codei )] = _ptr__5949_wf64[safe_add( _5962_cconst,_6082_l )];
                                    ++ _6072_codei;
                                  }
                                }
                                _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = 2;
                                _ptr__6063_rf64[safe_add( _6071_rcconst,_6072_codei )] = ((*mval)(_6080_ii1));
                                ++ _6072_codei;
                                _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = 5;
                                ++ _6072_codei;
                                _ptr__6061_ri32[safe_add( safe_add( _6070_rcodeptr,_6073_nzi ),(int)1 )] = _6072_codei;
                              }
                            }
                            {}
                            ++ _6073_nzi;
                          }
                        }
                      }
                    }
                    _ptr__6061_ri32[safe_add( safe_add( _6065_rptr,_6074_elmi ),(int)1 )] = _6073_nzi;
                    ++ _6074_elmi;
                  }
                }
              }
            }
          }
          if ((_6073_nzi != _6056_rnnz))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num nonzeros"));
            }
          }
          {}
          if ((_6074_elmi != _6057_rnelem))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num elements"));
            }
          }
          {}
          if ((_6072_codei != _6058_rncodeatom))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid num code atoms"));
            }
          }
          {}
        }
      }
      else
      {
        {
          int32_t _11912_ = (int)0;
          int32_t _11913_ = _5963_edim0;
          for (int32_t _6083_i = _11912_; _6083_i < _11913_; ++_6083_i)
          {
            {
              int32_t _11914_ = (int)0;
              int32_t _11915_ = mdim1;
              for (int32_t _6084_j = _11914_; _6084_j < _11915_; ++_6084_j)
              {
                {
                  int32_t _11916_ = (int)0;
                  int32_t _11917_ = _5964_edim1;
                  for (int32_t _6085_ii = _11916_; _6085_ii < _11917_; ++_6085_ii)
                  {
                    {
                      int32_t _6086_i0 = safe_add( safe_mul( _6083_i,_5964_edim1 ),_6085_ii );
                      int32_t _6087_ii1 = safe_add( _6084_j,safe_mul( _6085_ii,mdim1 ) );
                      int32_t _11918_ = _ptr__5947_wi32[safe_add( _5955_ptr,_6086_i0 )];
                      int32_t _11919_ = _ptr__5947_wi32[safe_add( safe_add( _5955_ptr,_6086_i0 ),(int)1 )];
                      for (int32_t _6088_k = _11918_; _6088_k < _11919_; ++_6088_k)
                      {
                        {
                          _ptr__6062_ri64[safe_add( _6066_ridxs,_6073_nzi )] = _ptr__5948_wi64[safe_add( _5958_nidxs,_6088_k )];
                          _ptr__6063_rf64[safe_add( _6068_rcof,_6073_nzi )] = (_ptr__5949_wf64[safe_add( _5959_cof,_6088_k )] * ((*mval)(_6087_ii1)));
                          if ((_5953_ncodeatom > (int)0))
                          {
                            {
                              int32_t _11920_ = _ptr__5947_wi32[safe_add( _5960_codeptr,_6088_k )];
                              int32_t _11921_ = _ptr__5947_wi32[safe_add( safe_add( _5960_codeptr,_6088_k ),(int)1 )];
                              for (int32_t _6089_l = _11920_; _6089_l < _11921_; ++_6089_l)
                              {
                                {
                                  _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = _ptr__5947_wi32[safe_add( _5961_code,_6089_l )];
                                  _ptr__6063_rf64[safe_add( _6071_rcconst,_6072_codei )] = _ptr__5949_wf64[safe_add( _5962_cconst,_6089_l )];
                                  ++ _6072_codei;
                                }
                              }
                              _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = 2;
                              _ptr__6063_rf64[safe_add( _6071_rcconst,_6072_codei )] = ((*mval)(_6087_ii1));
                              ++ _6072_codei;
                              _ptr__6061_ri32[safe_add( _6069_rcode,_6072_codei )] = 5;
                              ++ _6072_codei;
                              _ptr__6061_ri32[safe_add( safe_add( _6070_rcodeptr,_6073_nzi ),(int)1 )] = _6072_codei;
                            }
                          }
                          {}
                          ++ _6073_nzi;
                        }
                      }
                    }
                  }
                  _ptr__6061_ri32[safe_add( safe_add( _6065_rptr,_6074_elmi ),(int)1 )] = _6073_nzi;
                  ++ _6074_elmi;
                }
              }
            }
          }
        }
      }
      _5946_xs->clear();
    }
  }
}
// End mosek.fusion.ExprMulRight.eval

// Begin mosek.fusion.ExprMulRight.computeshape
// Method mosek.fusion.ExprMulRight.computeshape @ bld/docker-win/final/default/src/fusion/ExprMul.monty:568:6-573:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprMulRight::computeshape(int32_t _6090_d0,std::shared_ptr< monty::ndarray< int32_t,1 > > _6091_ds)
{
  _checked_ptr_1<int32_t> _ptr__6091_ds(_6091_ds ? _6091_ds->raw() : nullptr, _6091_ds ? _6091_ds->size(0) : 0);
  if (((int)((_6091_ds)->size(0)) == (int)1))
  {
    {
      return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_6090_d0)});
    }
  }
  else
  {
    {
      return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__6091_ds[(int)0]),(int32_t)(_6090_d0)});
    }
  }
}
// End mosek.fusion.ExprMulRight.computeshape

// Begin mosek.fusion.ExprMulRight.validate
// Method mosek.fusion.ExprMulRight.validate @ bld/docker-win/final/default/src/fusion/ExprMul.monty:495:6-541:7
int32_t mosek::fusion::p_ExprMulRight::validate(int32_t _6092_mdim0,int32_t _6093_mdim1,std::shared_ptr< monty::ndarray< int32_t,1 > > _6094_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _6095_msubj,std::shared_ptr< monty::ndarray< double,1 > > _6096_mval,monty::rc_ptr< ::mosek::fusion::Expression > _6097_expr)
{
  _checked_ptr_1<int32_t> _ptr__6094_msubi(_6094_msubi ? _6094_msubi->raw() : nullptr, _6094_msubi ? _6094_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__6095_msubj(_6095_msubj ? _6095_msubj->raw() : nullptr, _6095_msubj ? _6095_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__6096_mval(_6096_mval ? _6096_mval->raw() : nullptr, _6096_mval ? _6096_mval->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6098_eshape = _6097_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__6098_eshape(_6098_eshape ? _6098_eshape->raw() : nullptr,_6098_eshape ? _6098_eshape->size(0) : 0);
  if (((int)((_6098_eshape)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  int32_t _6099_edim0 = _ptr__6098_eshape[(int)0];
  int32_t _6100_edim1 = _ptr__6098_eshape[(int)1];
  if (((_6092_mdim0 < (int)0) || ((_6093_mdim1 < (int)0) || ((_6099_edim0 < (int)0) || (_6100_edim1 < (int)0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if ((_6092_mdim0 != _6100_edim1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  if ((((int)((_6094_msubi)->size(0)) != (int)((_6095_msubj)->size(0))) || ((int)((_6094_msubi)->size(0)) != (int)((_6096_mval)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  int32_t _6101_mnnz = (int)((_6094_msubi)->size(0));
  {
    bool _6102_err = false;
    int32_t _11922_ = (int)0;
    int32_t _11923_ = _6101_mnnz;
    for (int32_t _6103_i = _11922_; _6103_i < _11923_; ++_6103_i)
    {
      {
        _6102_err = (_6102_err || ((_ptr__6094_msubi[_6103_i] < (int)0) || ((_ptr__6094_msubi[_6103_i] >= _6092_mdim0) || ((_ptr__6095_msubj[_6103_i] < (int)0) || (_ptr__6095_msubj[_6103_i] >= _6093_mdim1)))));
      }
    }
    if (_6102_err)
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
      }
    }
    {}
  }
  {
    bool _6104_err = false;
    int32_t _11924_ = (int)0;
    int32_t _11925_ = (_6101_mnnz - (int)1);
    for (int32_t _6105_i = _11924_; _6105_i < _11925_; ++_6105_i)
    {
      {
        _6104_err = (_6104_err || ((_ptr__6094_msubi[_6105_i] > _ptr__6094_msubi[safe_add( _6105_i,(int)1 )]) || ((_ptr__6094_msubi[_6105_i] == _ptr__6094_msubi[safe_add( _6105_i,(int)1 )]) && (_ptr__6095_msubj[_6105_i] >= _ptr__6095_msubj[safe_add( _6105_i,(int)1 )]))));
      }
    }
    if (_6104_err)
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Unsorted matrix data"));
      }
    }
    {}
  }
  return (int)1;
}
// End mosek.fusion.ExprMulRight.validate

// Begin mosek.fusion.ExprMulRight.toString
// Method mosek.fusion.ExprMulRight.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:491:6-493:7
std::string mosek::fusion::ExprMulRight :: toString() { return mosek::fusion::p_ExprMulRight::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulRight::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulRight(M,"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulRight.toString

void mosek::fusion::p_ExprMulRight::destroy()
{
  expr.reset();
  mval.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulRight::destroy() { mosek::fusion::p_ExprMulRight::_get_impl(this)->destroy(); }
// } class ExprMulRight
// class ExprMulLeft { // @ bld/docker-win/final/default/src/fusion/ExprMul.monty:12:4-469:5
mosek::fusion::ExprMulLeft::ExprMulLeft(mosek::fusion::p_ExprMulLeft *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulLeft()" << this << std::endl; */ }
mosek::fusion::ExprMulLeft::~ExprMulLeft() {  /* std::cout << "~ExprMulLeft()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulLeft::p_ExprMulLeft
  (::mosek::fusion::ExprMulLeft * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulLeft.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:104:6-123:7
mosek::fusion::ExprMulLeft::t mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft
  (int32_t _6106_mdim0,
    int32_t _6107_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6108_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6109_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6110_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6111_expr,
    int32_t _6112_validated)
{ return new mosek::fusion::ExprMulLeft(_6106_mdim0,_6107_mdim1,_6108_msubi,_6109_msubj,_6110_mval,_6111_expr,_6112_validated); }
mosek::fusion::ExprMulLeft::ExprMulLeft
  (int32_t _6106_mdim0,
    int32_t _6107_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6108_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6109_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6110_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6111_expr,
    int32_t _6112_validated) : 
   ExprMulLeft(new mosek::fusion::p_ExprMulLeft(this))
{ mosek::fusion::p_ExprMulLeft::_get_impl(this)->_initialize(_6106_mdim0,_6107_mdim1,_6108_msubi,_6109_msubj,_6110_mval,_6111_expr,_6112_validated); }
void mosek::fusion::p_ExprMulLeft::_initialize  (int32_t _6106_mdim0,
    int32_t _6107_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6108_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6109_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6110_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6111_expr,
    int32_t _6112_validated)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6108_msubi(_6108_msubi ? _6108_msubi->raw() : nullptr, _6108_msubi ? _6108_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6109_msubj(_6109_msubj ? _6109_msubj->raw() : nullptr, _6109_msubj ? _6109_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6110_mval(_6110_mval ? _6110_mval->raw() : nullptr, _6110_mval ? _6110_mval->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprMulLeft::computeshape(_6106_mdim0,_6107_mdim1,_6111_expr->getShape()));
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->mdim0 = _6106_mdim0;
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->mdim1 = _6107_mdim1;
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->msubi = _6108_msubi;
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->msubj = _6109_msubj;
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->mval = _6110_mval;
    mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->expr = _6111_expr;
  }
}
// mosek.fusion.ExprMulLeft.ctor

// mosek.fusion.ExprMulLeft.ctor @ bld/docker-win/final/default/src/fusion/ExprMul.monty:84:6-94:7
mosek::fusion::ExprMulLeft::t mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft
  (int32_t _6113_mdim0,
    int32_t _6114_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6115_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6116_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6117_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6118_expr)
{ return new mosek::fusion::ExprMulLeft(_6113_mdim0,_6114_mdim1,_6115_msubi,_6116_msubj,_6117_mval,_6118_expr); }
mosek::fusion::ExprMulLeft::ExprMulLeft
  (int32_t _6113_mdim0,
    int32_t _6114_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6115_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6116_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6117_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6118_expr) : 
   ExprMulLeft(new mosek::fusion::p_ExprMulLeft(this))
{ mosek::fusion::p_ExprMulLeft::_get_impl(this)->_initialize(_6113_mdim0,_6114_mdim1,_6115_msubi,_6116_msubj,_6117_mval,_6118_expr); }
void mosek::fusion::p_ExprMulLeft::_initialize  (int32_t _6113_mdim0,
    int32_t _6114_mdim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6115_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6116_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6117_mval,
    monty::rc_ptr< ::mosek::fusion::Expression > _6118_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6115_msubi(_6115_msubi ? _6115_msubi->raw() : nullptr, _6115_msubi ? _6115_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6116_msubj(_6116_msubj ? _6116_msubj->raw() : nullptr, _6116_msubj ? _6116_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6117_mval(_6117_mval ? _6117_mval->raw() : nullptr, _6117_mval ? _6117_mval->size(0) : 0);
    mosek::fusion::p_ExprMulLeft::_initialize(_6113_mdim0,_6114_mdim1,_6115_msubi,_6116_msubj,_6117_mval,_6118_expr,::mosek::fusion::p_ExprMulLeft::validate(_6113_mdim0,_6114_mdim1,_6115_msubi,_6116_msubj,_6117_mval,_6118_expr));
  }
}
// mosek.fusion.ExprMulLeft.ctor

// Begin mosek.fusion.ExprMulLeft.eval
// Method mosek.fusion.ExprMulLeft.eval @ bld/docker-win/final/default/src/fusion/ExprMul.monty:125:6-468:7
void mosek::fusion::ExprMulLeft :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6119_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6120_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6121_xs) { mosek::fusion::p_ExprMulLeft::_get_impl(this)->eval(_6119_rs,_6120_ws,_6121_xs); }
void mosek::fusion::p_ExprMulLeft::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6119_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6120_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6121_xs)
{
  mosek::fusion::p_ExprMulLeft::_get_impl(::mosek::fusion::ExprMulLeft::t(_pubthis))->expr->eval(_6120_ws,_6119_rs,_6121_xs);
  _6120_ws->pop_expr();
  int32_t _6122_nd = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->nd;
  int32_t _6123_nnz = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->nnz;
  int32_t _6124_nelem = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->nelem;
  int32_t _6125_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->ncodeatom;
  bool _6126_hassp = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->hassp;
  int32_t _6127_shape = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->shape_base;
  int32_t _6128_ptr = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->ptr_base;
  int32_t _6129_sp = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->sp_base;
  int32_t _6130_nidxs = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->nidxs_base;
  int32_t _6131_cof = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->cof_base;
  int32_t _6132_codeptr = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->codeptr_base;
  int32_t _6133_code = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->code_base;
  int32_t _6134_cconst = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6135_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6135_wi32(_6135_wi32 ? _6135_wi32->raw() : nullptr,_6135_wi32 ? _6135_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6136_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6136_wi64(_6136_wi64 ? _6136_wi64->raw() : nullptr,_6136_wi64 ? _6136_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6137_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6120_ws)->f64;
  _checked_ptr_1<double> _ptr__6137_wf64(_6137_wf64 ? _6137_wf64->raw() : nullptr,_6137_wf64 ? _6137_wf64->size(0) : 0);
  if ((_6122_nd != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operator shape for multiplication"));
    }
  }
  {}
  int32_t _6138_eperm = (int)9999;
  int32_t _6139_esubi = (int)9999;
  int32_t _6140_eptr = (int)9999;
  int32_t _6141_edim0 = _ptr__6135_wi32[_6127_shape];
  int32_t _6142_edim1 = _ptr__6135_wi32[safe_add( _6127_shape,(int)1 )];
  int32_t _6143_mnnz = (int)((msubi)->size(0));
  bool _6144_missp = (_6143_mnnz < safe_mul( (int64_t)mdim0,(int64_t)mdim1 ));
  bool _6145_rhassp = false;
  int32_t _6146_rncodeatom = (int)0;
  int32_t _6147_rnelem = (int)0;
  int64_t _6148_rnnz = (int64_t)0;
  if (_6126_hassp)
  {
    {
      _6138_eperm = _6121_xs->alloci32(_6124_nelem);
      _6139_esubi = _6121_xs->alloci32(_6124_nelem);
      _6140_eptr = _6121_xs->alloci32(safe_add( _6142_edim1,(int)1 ));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6149_xi32 = mosek::fusion::p_WorkStack::_get_impl(_6121_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__6149_xi32(_6149_xi32 ? _6149_xi32->raw() : nullptr,_6149_xi32 ? _6149_xi32->size(0) : 0);
      {
        int32_t _11926_ = (int)0;
        int32_t _11927_ = safe_add( _6142_edim1,(int)1 );
        for (int32_t _6150_i = _11926_; _6150_i < _11927_; ++_6150_i)
        {
          {
            _ptr__6149_xi32[safe_add( _6140_eptr,_6150_i )] = (int)0;
          }
        }
        int32_t _11928_ = (int)0;
        int32_t _11929_ = _6124_nelem;
        for (int32_t _6151_i = _11928_; _6151_i < _11929_; ++_6151_i)
        {
          {
            ++ _ptr__6149_xi32[safe_add( safe_add( _6140_eptr,(_ptr__6136_wi64[safe_add( _6129_sp,_6151_i )] % _6142_edim1) ),(int)1 )];
          }
        }
        int32_t _11930_ = (int)0;
        int32_t _11931_ = _6142_edim1;
        for (int32_t _6152_i = _11930_; _6152_i < _11931_; ++_6152_i)
        {
          {
            _ptr__6149_xi32[safe_add( safe_add( _6140_eptr,_6152_i ),(int)1 )] += _ptr__6149_xi32[safe_add( _6140_eptr,_6152_i )];
          }
        }
        int32_t _11932_ = (int)0;
        int32_t _11933_ = _6124_nelem;
        for (int32_t _6153_i = _11932_; _6153_i < _11933_; ++_6153_i)
        {
          {
            int64_t _6154_j = (_ptr__6136_wi64[safe_add( _6129_sp,_6153_i )] % _6142_edim1);
            _ptr__6149_xi32[safe_add( _6138_eperm,_ptr__6149_xi32[safe_add( _6140_eptr,_6154_j )] )] = _6153_i;
            ++ _ptr__6149_xi32[safe_add( _6140_eptr,_6154_j )];
          }
        }
        int32_t _11934_ = (int)0;
        int32_t _11935_ = _6142_edim1;
        for (int32_t _6155_i = _11934_; _6155_i < _11935_; ++_6155_i)
        {
          {
            _ptr__6149_xi32[(safe_add( _6140_eptr,_6142_edim1 ) - _6155_i)] = _ptr__6149_xi32[((safe_add( _6140_eptr,_6142_edim1 ) - _6155_i) - (int)1)];
          }
        }
        _ptr__6149_xi32[_6140_eptr] = (int)0;
      }
      if (_6144_missp)
      {
        {
          int32_t _6156_mp = (int)0;
          while ( (_6156_mp < _6143_mnnz) )
          {
            {
              int32_t _6157_i = ((*msubi)(_6156_mp));
              int32_t _6158_me = safe_add( _6156_mp,(int)1 );
              while ( ((_6158_me < _6143_mnnz) && (((*msubi)(_6158_me)) == ((*msubi)(_6156_mp)))) )
              {
                {
                  ++ _6158_me;
                }
              }
              int32_t _11936_ = (int)0;
              int32_t _11937_ = _6142_edim1;
              for (int32_t _6159_j = _11936_; _6159_j < _11937_; ++_6159_j)
              {
                {
                  bool _6160_hasnz = false;
                  int32_t _6161_e0 = _6158_me;
                  int32_t _6162_i0 = _6156_mp;
                  int32_t _6163_ee1 = _ptr__6149_xi32[safe_add( safe_add( _6140_eptr,_6159_j ),(int)1 )];
                  int32_t _6164_ii1 = _ptr__6149_xi32[safe_add( _6140_eptr,_6159_j )];
                  while ( ((_6162_i0 < _6161_e0) && (_6164_ii1 < _6163_ee1)) )
                  {
                    {
                      int32_t _6165_i1 = _ptr__6149_xi32[safe_add( _6138_eperm,_6164_ii1 )];
                      if ((((*msubj)(_6162_i0)) < (_ptr__6136_wi64[safe_add( _6129_sp,_6165_i1 )] / _6142_edim1)))
                      {
                        {
                          ++ _6162_i0;
                        }
                      }
                      else if((((*msubj)(_6162_i0)) > (_ptr__6136_wi64[safe_add( _6129_sp,_6165_i1 )] / _6142_edim1)))
                      {
                        {
                          ++ _6164_ii1;
                        }
                      }
                      else
                      {
                        {
                          _6160_hasnz = true;
                          _6148_rnnz += (_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6165_i1 ),(int)1 )] - _ptr__6135_wi32[safe_add( _6128_ptr,_6165_i1 )]);
                          if ((_6125_ncodeatom > (int)0))
                          {
                            {
                              _6146_rncodeatom += safe_add( (_ptr__6135_wi32[safe_add( _6132_codeptr,_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6165_i1 ),(int)1 )] )] - _ptr__6135_wi32[safe_add( _6132_codeptr,_ptr__6135_wi32[safe_add( _6128_ptr,_6165_i1 )] )]),safe_mul( (int)2,(_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6165_i1 ),(int)1 )] - _ptr__6135_wi32[safe_add( _6128_ptr,_6165_i1 )]) ) );
                            }
                          }
                          {}
                          ++ _6164_ii1;
                          ++ _6162_i0;
                        }
                      }
                    }
                  }
                  if (_6160_hasnz)
                  {
                    {
                      ++ _6147_rnelem;
                    }
                  }
                  {}
                }
              }
              _6156_mp = _6158_me;
            }
          }
        }
      }
      else
      {
        {
          _6147_rnelem = safe_mul( mdim0,_6142_edim1 );
          _6148_rnnz = safe_mul( (int64_t)_6123_nnz,mdim0 );
          if ((_6125_ncodeatom > (int)0))
          {
            {
              _6146_rncodeatom = (int32_t)safe_add( safe_mul( _6125_ncodeatom,mdim0 ),safe_mul( (int)2,_6148_rnnz ) );
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      if (_6144_missp)
      {
        {
          int32_t _6166_mp = (int)0;
          while ( (_6166_mp < _6143_mnnz) )
          {
            {
              int32_t _6167_me = safe_add( _6166_mp,(int)1 );
              while ( ((_6167_me < _6143_mnnz) && (((*msubi)(_6166_mp)) == ((*msubi)(_6167_me)))) )
              {
                {
                  ++ _6167_me;
                }
              }
              int32_t _6168_i = ((*msubi)(_6166_mp));
              int32_t _11938_ = (int)0;
              int32_t _11939_ = _6142_edim1;
              for (int32_t _6169_j = _11938_; _6169_j < _11939_; ++_6169_j)
              {
                {
                  bool _6170_hasnz = false;
                  int32_t _11940_ = _6166_mp;
                  int32_t _11941_ = _6167_me;
                  for (int32_t _6171_i0 = _11940_; _6171_i0 < _11941_; ++_6171_i0)
                  {
                    {
                      int32_t _6172_i1 = safe_add( safe_mul( ((*msubj)(_6171_i0)),_6142_edim1 ),_6169_j );
                      _6148_rnnz += (_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6172_i1 ),(int)1 )] - _ptr__6135_wi32[safe_add( _6128_ptr,_6172_i1 )]);
                      if ((_6125_ncodeatom > (int)0))
                      {
                        {
                          _6146_rncodeatom += safe_add( (_ptr__6135_wi32[safe_add( _6132_codeptr,_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6172_i1 ),(int)1 )] )] - _ptr__6135_wi32[safe_add( _6132_codeptr,_ptr__6135_wi32[safe_add( _6128_ptr,_6172_i1 )] )]),safe_mul( (int)2,(_ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6172_i1 ),(int)1 )] - _ptr__6135_wi32[safe_add( _6128_ptr,_6172_i1 )]) ) );
                        }
                      }
                      {}
                      _6170_hasnz = true;
                    }
                  }
                  if (_6170_hasnz)
                  {
                    {
                      ++ _6147_rnelem;
                    }
                  }
                  {}
                }
              }
              _6166_mp = _6167_me;
            }
          }
        }
      }
      else
      {
        {
          _6148_rnnz = safe_mul( (int64_t)_6123_nnz,mdim0 );
          if ((_6125_ncodeatom > (int)0))
          {
            {
              _6146_rncodeatom = (int32_t)safe_add( safe_mul( _6125_ncodeatom,mdim0 ),safe_mul( (int)2,_6148_rnnz ) );
            }
          }
          {}
          _6147_rnelem = safe_mul( mdim0,_6142_edim1 );
        }
      }
    }
  }
  if ((!(_6148_rnnz <= (int)0x7fffffff)))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Maximum number of nonzeros exceeded in multiplication"));
    }
  }
  {}
  _6145_rhassp = (_6147_rnelem < safe_mul( mdim0,_6142_edim1 ));
  int32_t _6173_rnd = (int)2;
  _6119_rs->alloc_expr(_6173_rnd,_6147_rnelem,(int32_t)_6148_rnnz,_6145_rhassp,_6146_rncodeatom);
  int32_t _6174_rptr = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->ptr_base;
  int32_t _6175_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->nidxs_base;
  int32_t _11942_;
  bool _11943_ = _6145_rhassp;
  if (_11943_)
  {
    _11942_ = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->sp_base;
  }
  else
  {
    _11942_ = _6119_rs->alloci64(_6147_rnelem);
  }
  int32_t _6176_rsp = _11942_;
  int32_t _6177_rcof = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->cof_base;
  int32_t _6178_rshape = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->shape_base;
  int32_t _6179_rcode = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->code_base;
  int32_t _6180_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->codeptr_base;
  int32_t _6181_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6182_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__6182_ri64(_6182_ri64 ? _6182_ri64->raw() : nullptr,_6182_ri64 ? _6182_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6183_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->f64;
  _checked_ptr_1<double> _ptr__6183_rf64(_6183_rf64 ? _6183_rf64->raw() : nullptr,_6183_rf64 ? _6183_rf64->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6184_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6119_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__6184_ri32(_6184_ri32 ? _6184_ri32->raw() : nullptr,_6184_ri32 ? _6184_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6185_xi32 = mosek::fusion::p_WorkStack::_get_impl(_6121_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__6185_xi32(_6185_xi32 ? _6185_xi32->raw() : nullptr,_6185_xi32 ? _6185_xi32->size(0) : 0);
  _ptr__6184_ri32[_6178_rshape] = mdim0;
  _ptr__6184_ri32[safe_add( _6178_rshape,(int)1 )] = _6142_edim1;
  _ptr__6184_ri32[_6174_rptr] = (int)0;
  if ((_6146_rncodeatom > (int)0))
  {
    {
      _ptr__6184_ri32[_6180_rcodeptr] = (int)0;
    }
  }
  {}
  if (_6126_hassp)
  {
    {
      if (_6144_missp)
      {
        {
          int32_t _6186_codei = (int)0;
          int32_t _6187_relm = (int)0;
          int32_t _6188_nzi = (int)0;
          int32_t _6189_mp = (int)0;
          while ( (_6189_mp < _6143_mnnz) )
          {
            {
              int32_t _6190_i = ((*msubi)(_6189_mp));
              int32_t _6191_me = safe_add( _6189_mp,(int)1 );
              while ( ((_6191_me < _6143_mnnz) && (((*msubi)(_6191_me)) == ((*msubi)(_6189_mp)))) )
              {
                {
                  ++ _6191_me;
                }
              }
              int32_t _11944_ = (int)0;
              int32_t _11945_ = _6142_edim1;
              for (int32_t _6192_j = _11944_; _6192_j < _11945_; ++_6192_j)
              {
                {
                  bool _6193_hasnz = false;
                  int32_t _6194_e0 = _6191_me;
                  int32_t _6195_i0 = _6189_mp;
                  int32_t _6196_ee1 = _ptr__6185_xi32[safe_add( safe_add( _6140_eptr,_6192_j ),(int)1 )];
                  int32_t _6197_ii1 = _ptr__6185_xi32[safe_add( _6140_eptr,_6192_j )];
                  while ( ((_6195_i0 < _6194_e0) && (_6197_ii1 < _6196_ee1)) )
                  {
                    {
                      int32_t _6198_i1 = _ptr__6185_xi32[safe_add( _6138_eperm,_6197_ii1 )];
                      if ((((*msubj)(_6195_i0)) < (_ptr__6136_wi64[safe_add( _6129_sp,_6198_i1 )] / _6142_edim1)))
                      {
                        {
                          ++ _6195_i0;
                        }
                      }
                      else if((((*msubj)(_6195_i0)) > (_ptr__6136_wi64[safe_add( _6129_sp,_6198_i1 )] / _6142_edim1)))
                      {
                        {
                          ++ _6197_ii1;
                        }
                      }
                      else
                      {
                        {
                          _6193_hasnz = true;
                          int32_t _11946_ = _ptr__6135_wi32[safe_add( _6128_ptr,_6198_i1 )];
                          int32_t _11947_ = _ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6198_i1 ),(int)1 )];
                          for (int32_t _6199_k = _11946_; _6199_k < _11947_; ++_6199_k)
                          {
                            {
                              _ptr__6182_ri64[safe_add( _6175_rnidxs,_6188_nzi )] = _ptr__6136_wi64[safe_add( _6130_nidxs,_6199_k )];
                              _ptr__6183_rf64[safe_add( _6177_rcof,_6188_nzi )] = (_ptr__6137_wf64[safe_add( _6131_cof,_6199_k )] * ((*mval)(_6195_i0)));
                              if ((_6146_rncodeatom > (int)0))
                              {
                                {
                                  int32_t _11948_ = _ptr__6135_wi32[safe_add( _6132_codeptr,_6199_k )];
                                  int32_t _11949_ = _ptr__6135_wi32[safe_add( safe_add( _6132_codeptr,_6199_k ),(int)1 )];
                                  for (int32_t _6200_l = _11948_; _6200_l < _11949_; ++_6200_l)
                                  {
                                    {
                                      _ptr__6184_ri32[safe_add( _6179_rcode,_6186_codei )] = _ptr__6135_wi32[safe_add( _6133_code,_6200_l )];
                                      _ptr__6183_rf64[safe_add( _6181_rcconst,_6186_codei )] = _ptr__6183_rf64[safe_add( _6134_cconst,_6200_l )];
                                      ++ _6186_codei;
                                    }
                                  }
                                  _ptr__6184_ri32[safe_add( _6179_rcode,_6186_codei )] = 2;
                                  _ptr__6183_rf64[safe_add( _6181_rcconst,_6186_codei )] = ((*mval)(_6195_i0));
                                  ++ _6186_codei;
                                  _ptr__6184_ri32[safe_add( _6179_rcode,_6186_codei )] = 5;
                                  _ptr__6184_ri32[safe_add( safe_add( _6180_rcodeptr,_6188_nzi ),(int)1 )] = _6186_codei;
                                }
                              }
                              {}
                              ++ _6188_nzi;
                            }
                          }
                          ++ _6195_i0;
                          ++ _6197_ii1;
                        }
                      }
                    }
                  }
                  if (_6193_hasnz)
                  {
                    {
                      _ptr__6184_ri32[safe_add( safe_add( _6174_rptr,_6187_relm ),(int)1 )] = _6188_nzi;
                      _ptr__6182_ri64[safe_add( _6176_rsp,_6187_relm )] = safe_add( safe_mul( _6190_i,_6142_edim1 ),_6192_j );
                      ++ _6187_relm;
                    }
                  }
                  {}
                }
              }
              _6189_mp = _6191_me;
            }
          }
        }
      }
      else
      {
        {
          int32_t _6201_codei = (int)0;
          int32_t _6202_elmi = (int)0;
          int32_t _6203_nzi = (int)0;
          int32_t _11950_ = (int)0;
          int32_t _11951_ = mdim0;
          for (int32_t _6204_i = _11950_; _6204_i < _11951_; ++_6204_i)
          {
            {
              int32_t _11952_ = (int)0;
              int32_t _11953_ = _6142_edim1;
              for (int32_t _6205_j = _11952_; _6205_j < _11953_; ++_6205_j)
              {
                {
                  int32_t _11954_ = _ptr__6185_xi32[safe_add( _6140_eptr,_6205_j )];
                  int32_t _11955_ = _ptr__6185_xi32[safe_add( safe_add( _6140_eptr,_6205_j ),(int)1 )];
                  for (int32_t _6206_ii1 = _11954_; _6206_ii1 < _11955_; ++_6206_ii1)
                  {
                    {
                      int32_t _6207_i1 = _ptr__6185_xi32[safe_add( _6138_eperm,_6206_ii1 )];
                      int64_t _6208_i0 = safe_add( safe_mul( _6204_i,mdim1 ),(_ptr__6136_wi64[safe_add( _6129_sp,_6207_i1 )] / _6142_edim1) );
                      int32_t _11956_ = _ptr__6135_wi32[safe_add( _6128_ptr,_6207_i1 )];
                      int32_t _11957_ = _ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6207_i1 ),(int)1 )];
                      for (int32_t _6209_k = _11956_; _6209_k < _11957_; ++_6209_k)
                      {
                        {
                          _ptr__6182_ri64[safe_add( _6175_rnidxs,_6203_nzi )] = _ptr__6136_wi64[safe_add( _6130_nidxs,_6209_k )];
                          _ptr__6183_rf64[safe_add( _6177_rcof,_6203_nzi )] = (_ptr__6137_wf64[safe_add( _6131_cof,_6209_k )] * ((*mval)(_6208_i0)));
                          if ((_6146_rncodeatom > (int)0))
                          {
                            {
                              int32_t _11958_ = _ptr__6135_wi32[safe_add( _6132_codeptr,_6209_k )];
                              int32_t _11959_ = _ptr__6135_wi32[safe_add( safe_add( _6132_codeptr,_6209_k ),(int)1 )];
                              for (int32_t _6210_l = _11958_; _6210_l < _11959_; ++_6210_l)
                              {
                                {
                                  _ptr__6184_ri32[safe_add( _6179_rcode,_6201_codei )] = _ptr__6135_wi32[safe_add( _6133_code,_6210_l )];
                                  _ptr__6183_rf64[safe_add( _6181_rcconst,_6201_codei )] = _ptr__6137_wf64[safe_add( _6134_cconst,_6210_l )];
                                  ++ _6201_codei;
                                }
                              }
                              _ptr__6184_ri32[safe_add( _6179_rcode,_6201_codei )] = 2;
                              _ptr__6183_rf64[safe_add( _6181_rcconst,_6201_codei )] = ((*mval)(_6208_i0));
                              ++ _6201_codei;
                              _ptr__6184_ri32[safe_add( _6179_rcode,_6201_codei )] = 5;
                              ++ _6201_codei;
                              _ptr__6184_ri32[safe_add( safe_add( _6180_rcodeptr,_6203_nzi ),(int)1 )] = _6201_codei;
                            }
                          }
                          {}
                          ++ _6203_nzi;
                        }
                      }
                    }
                  }
                  _ptr__6184_ri32[safe_add( safe_add( _6174_rptr,_6202_elmi ),(int)1 )] = _6203_nzi;
                  ++ _6202_elmi;
                }
              }
            }
          }
          if ((_6202_elmi != _6147_rnelem))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of elements"));
            }
          }
          {}
          if ((_6203_nzi != _6148_rnnz))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of non-zeros"));
            }
          }
          {}
          if ((_6201_codei != _6146_rncodeatom))
          {
            {
              throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of code atoms"));
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      int32_t _6211_codei = (int)0;
      int32_t _6212_mp = (int)0;
      int32_t _6213_elmi = (int)0;
      int32_t _6214_nzi = (int)0;
      while ( (_6212_mp < _6143_mnnz) )
      {
        {
          int32_t _6215_me = safe_add( _6212_mp,(int)1 );
          while ( ((_6215_me < _6143_mnnz) && (((*msubi)(_6212_mp)) == ((*msubi)(_6215_me)))) )
          {
            {
              ++ _6215_me;
            }
          }
          int32_t _6216_i = ((*msubi)(_6212_mp));
          int32_t _11960_ = (int)0;
          int32_t _11961_ = _6142_edim1;
          for (int32_t _6217_j = _11960_; _6217_j < _11961_; ++_6217_j)
          {
            {
              bool _6218_hasnz = false;
              int32_t _11962_ = _6212_mp;
              int32_t _11963_ = _6215_me;
              for (int32_t _6219_i0 = _11962_; _6219_i0 < _11963_; ++_6219_i0)
              {
                {
                  int32_t _6220_i1 = safe_add( safe_mul( ((*msubj)(_6219_i0)),_6142_edim1 ),_6217_j );
                  int32_t _11964_ = _ptr__6135_wi32[safe_add( _6128_ptr,_6220_i1 )];
                  int32_t _11965_ = _ptr__6135_wi32[safe_add( safe_add( _6128_ptr,_6220_i1 ),(int)1 )];
                  for (int32_t _6221_j = _11964_; _6221_j < _11965_; ++_6221_j)
                  {
                    {
                      _ptr__6182_ri64[safe_add( _6175_rnidxs,_6214_nzi )] = _ptr__6136_wi64[safe_add( _6130_nidxs,_6221_j )];
                      _ptr__6183_rf64[safe_add( _6177_rcof,_6214_nzi )] = (_ptr__6137_wf64[safe_add( _6131_cof,_6221_j )] * ((*mval)(_6219_i0)));
                      if ((_6146_rncodeatom > (int)0))
                      {
                        {
                          int32_t _11966_ = _ptr__6135_wi32[safe_add( _6132_codeptr,_6221_j )];
                          int32_t _11967_ = _ptr__6135_wi32[safe_add( safe_add( _6132_codeptr,_6221_j ),(int)1 )];
                          for (int32_t _6222_k = _11966_; _6222_k < _11967_; ++_6222_k)
                          {
                            {
                              _ptr__6184_ri32[safe_add( _6179_rcode,_6211_codei )] = _ptr__6135_wi32[safe_add( _6133_code,_6222_k )];
                              _ptr__6183_rf64[safe_add( _6181_rcconst,_6211_codei )] = _ptr__6137_wf64[safe_add( _6134_cconst,_6222_k )];
                              ++ _6211_codei;
                            }
                          }
                          _ptr__6184_ri32[safe_add( _6179_rcode,_6211_codei )] = 2;
                          _ptr__6183_rf64[safe_add( _6181_rcconst,_6211_codei )] = ((*mval)(_6219_i0));
                          ++ _6211_codei;
                          _ptr__6184_ri32[safe_add( _6179_rcode,_6211_codei )] = 5;
                          ++ _6211_codei;
                          _ptr__6184_ri32[safe_add( safe_add( _6180_rcodeptr,_6214_nzi ),(int)1 )] = _6211_codei;
                        }
                      }
                      {}
                      ++ _6214_nzi;
                    }
                  }
                  _6218_hasnz = true;
                }
              }
              if (_6218_hasnz)
              {
                {
                  _ptr__6182_ri64[safe_add( _6176_rsp,_6213_elmi )] = safe_add( safe_mul( _6216_i,_6142_edim1 ),_6217_j );
                  _ptr__6184_ri32[safe_add( safe_add( _6174_rptr,_6213_elmi ),(int)1 )] = _6214_nzi;
                  ++ _6213_elmi;
                }
              }
              {}
            }
          }
          _6212_mp = _6215_me;
        }
      }
      if ((_6213_elmi != _6147_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of elements"));
        }
      }
      {}
      if ((_6214_nzi != _6148_rnnz))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of non-zeros"));
        }
      }
      {}
      if ((_6211_codei != _6146_rncodeatom))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Incorrect number of code atoms"));
        }
      }
      {}
    }
  }
  if ((!_6145_rhassp))
  {
    {
      _6119_rs->popi64(_6147_rnelem);
    }
  }
  {}
  _6121_xs->clear();
}
// End mosek.fusion.ExprMulLeft.eval

// Begin mosek.fusion.ExprMulLeft.computeshape
// Method mosek.fusion.ExprMulLeft.computeshape @ bld/docker-win/final/default/src/fusion/ExprMul.monty:96:6-102:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprMulLeft::computeshape(int32_t _6223_d0,int32_t _6224_d1,std::shared_ptr< monty::ndarray< int32_t,1 > > _6225_ds)
{
  _checked_ptr_1<int32_t> _ptr__6225_ds(_6225_ds ? _6225_ds->raw() : nullptr, _6225_ds ? _6225_ds->size(0) : 0);
  if (((int)((_6225_ds)->size(0)) != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions"));
    }
  }
  else if((_6224_d1 != _ptr__6225_ds[(int)0]))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions"));
    }
  }
  {}
  return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_6223_d0),(int32_t)(_ptr__6225_ds[(int)1])});
}
// End mosek.fusion.ExprMulLeft.computeshape

// Begin mosek.fusion.ExprMulLeft.validate
// Method mosek.fusion.ExprMulLeft.validate @ bld/docker-win/final/default/src/fusion/ExprMul.monty:27:6-68:7
int32_t mosek::fusion::p_ExprMulLeft::validate(int32_t _6226_mdim0,int32_t _6227_mdim1,std::shared_ptr< monty::ndarray< int32_t,1 > > _6228_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _6229_msubj,std::shared_ptr< monty::ndarray< double,1 > > _6230_mval,monty::rc_ptr< ::mosek::fusion::Expression > _6231_expr)
{
  _checked_ptr_1<int32_t> _ptr__6228_msubi(_6228_msubi ? _6228_msubi->raw() : nullptr, _6228_msubi ? _6228_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__6229_msubj(_6229_msubj ? _6229_msubj->raw() : nullptr, _6229_msubj ? _6229_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__6230_mval(_6230_mval ? _6230_mval->raw() : nullptr, _6230_mval ? _6230_mval->size(0) : 0);
  if ((_6231_expr->getND() != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  int32_t _6232_edim0 = _6231_expr->getDim((int)0);
  int32_t _6233_edim1 = _6231_expr->getDim((int)0);
  if (((_6226_mdim0 < (int)0) || (_6227_mdim1 < (int)0)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  {}
  if ((_6227_mdim1 != _6232_edim0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
    }
  }
  {}
  if ((((int)((_6228_msubi)->size(0)) != (int)((_6229_msubj)->size(0))) || ((int)((_6228_msubi)->size(0)) != (int)((_6230_mval)->size(0)))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  int32_t _6234_mnnz = (int)((_6228_msubi)->size(0));
  bool _6235_err_data = false;
  bool _6236_err_unsorted = false;
  {
    int32_t _11968_ = (int)0;
    int32_t _11969_ = _6234_mnnz;
    for (int32_t _6237_i = _11968_; _6237_i < _11969_; ++_6237_i)
    {
      {
        _6235_err_data = (_6235_err_data || ((_ptr__6228_msubi[_6237_i] < (int)0) || ((_ptr__6228_msubi[_6237_i] >= _6226_mdim0) || ((_ptr__6229_msubj[_6237_i] < (int)0) || (_ptr__6229_msubj[_6237_i] >= _6227_mdim1)))));
      }
    }
    if ((!_6235_err_data))
    {
      {
        int32_t _11970_ = (int)0;
        int32_t _11971_ = (_6234_mnnz - (int)1);
        for (int32_t _6238_i = _11970_; _6238_i < _11971_; ++_6238_i)
        {
          {
            _6236_err_unsorted = (_6236_err_unsorted || ((_ptr__6228_msubi[_6238_i] > _ptr__6228_msubi[safe_add( _6238_i,(int)1 )]) || ((_ptr__6228_msubi[_6238_i] == _ptr__6228_msubi[safe_add( _6238_i,(int)1 )]) && (_ptr__6229_msubj[_6238_i] >= _ptr__6229_msubj[safe_add( _6238_i,(int)1 )]))));
          }
        }
      }
    }
    {}
  }
  if (_6235_err_data)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Invalid matrix data"));
    }
  }
  {}
  if (_6236_err_unsorted)
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Unsorted matrix data"));
    }
  }
  {}
  return (int)1;
}
// End mosek.fusion.ExprMulLeft.validate

// Begin mosek.fusion.ExprMulLeft.toString
// Method mosek.fusion.ExprMulLeft.toString @ bld/docker-win/final/default/src/fusion/ExprMul.monty:23:6-25:7
std::string mosek::fusion::ExprMulLeft :: toString() { return mosek::fusion::p_ExprMulLeft::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulLeft::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulLeft(M("))->__mosek_2fusion_2Utils_2StringBuffer__a(mdim0)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(mdim1)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("),"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulLeft.toString

void mosek::fusion::p_ExprMulLeft::destroy()
{
  expr.reset();
  mval.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulLeft::destroy() { mosek::fusion::p_ExprMulLeft::_get_impl(this)->destroy(); }
// } class ExprMulLeft
// class ExprMulVar { // @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:170:4-746:5
mosek::fusion::ExprMulVar::ExprMulVar(mosek::fusion::p_ExprMulVar *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulVar()" << this << std::endl; */ }
mosek::fusion::ExprMulVar::~ExprMulVar() {  /* std::cout << "~ExprMulVar()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulVar::p_ExprMulVar
  (::mosek::fusion::ExprMulVar * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulVar.ctor @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:248:6-276:7
mosek::fusion::ExprMulVar::t mosek::fusion::p_ExprMulVar::_new_ExprMulVar
  (bool _6239_left,
    int32_t _6240_mdimi,
    int32_t _6241_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6242_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6243_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6244_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6245_x)
{ return new mosek::fusion::ExprMulVar(_6239_left,_6240_mdimi,_6241_mdimj,_6242_msubi,_6243_msubj,_6244_mcof,_6245_x); }
mosek::fusion::ExprMulVar::ExprMulVar
  (bool _6239_left,
    int32_t _6240_mdimi,
    int32_t _6241_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6242_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6243_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6244_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6245_x) : 
   ExprMulVar(new mosek::fusion::p_ExprMulVar(this))
{ mosek::fusion::p_ExprMulVar::_get_impl(this)->_initialize(_6239_left,_6240_mdimi,_6241_mdimj,_6242_msubi,_6243_msubj,_6244_mcof,_6245_x); }
void mosek::fusion::p_ExprMulVar::_initialize  (bool _6239_left,
    int32_t _6240_mdimi,
    int32_t _6241_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6242_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6243_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6244_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6245_x)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6242_msubi(_6242_msubi ? _6242_msubi->raw() : nullptr, _6242_msubi ? _6242_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6243_msubj(_6243_msubj ? _6243_msubj->raw() : nullptr, _6243_msubj ? _6243_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6244_mcof(_6244_mcof ? _6244_mcof->raw() : nullptr, _6244_mcof ? _6244_mcof->size(0) : 0);
    mosek::fusion::p_ExprMulVar::_initialize(_6239_left,_6240_mdimi,_6241_mdimj,_6242_msubi,_6243_msubj,_6244_mcof,_6245_x,(int)1);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6246_xshape = _6245_x->getShape();
    _checked_ptr_1<int32_t> _ptr__6246_xshape(_6246_xshape ? _6246_xshape->raw() : nullptr,_6246_xshape ? _6246_xshape->size(0) : 0);
    int32_t _6247_nd = (int)((_6246_xshape)->size(0));
    if ((_6247_nd != (int)2))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    else if((_6239_left && (_ptr__6246_xshape[(int)0] != _6241_mdimj)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    else if(((!_6239_left) && (_ptr__6246_xshape[(int)1] != _6240_mdimi)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
      }
    }
    {}
    if ((((int)((_6242_msubi)->size(0)) != (int)((_6243_msubj)->size(0))) || ((int)((_6242_msubi)->size(0)) != (int)((_6244_mcof)->size(0)))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Mismatching matrix data lengths"));
      }
    }
    {}
    validate(_6240_mdimi,_6241_mdimj,_6242_msubi,_6243_msubj,_6244_mcof);
  }
}
// mosek.fusion.ExprMulVar.ctor

// mosek.fusion.ExprMulVar.ctor @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:196:6-220:7
mosek::fusion::ExprMulVar::t mosek::fusion::p_ExprMulVar::_new_ExprMulVar
  (bool _6248_left,
    int32_t _6249_mdimi,
    int32_t _6250_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6251_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6252_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6253_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6254_x,
    int32_t _6255_unchecked_)
{ return new mosek::fusion::ExprMulVar(_6248_left,_6249_mdimi,_6250_mdimj,_6251_msubi,_6252_msubj,_6253_mcof,_6254_x,_6255_unchecked_); }
mosek::fusion::ExprMulVar::ExprMulVar
  (bool _6248_left,
    int32_t _6249_mdimi,
    int32_t _6250_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6251_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6252_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6253_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6254_x,
    int32_t _6255_unchecked_) : 
   ExprMulVar(new mosek::fusion::p_ExprMulVar(this))
{ mosek::fusion::p_ExprMulVar::_get_impl(this)->_initialize(_6248_left,_6249_mdimi,_6250_mdimj,_6251_msubi,_6252_msubj,_6253_mcof,_6254_x,_6255_unchecked_); }
void mosek::fusion::p_ExprMulVar::_initialize  (bool _6248_left,
    int32_t _6249_mdimi,
    int32_t _6250_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6251_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6252_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6253_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6254_x,
    int32_t _6255_unchecked_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6251_msubi(_6251_msubi ? _6251_msubi->raw() : nullptr, _6251_msubi ? _6251_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6252_msubj(_6252_msubj ? _6252_msubj->raw() : nullptr, _6252_msubj ? _6252_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6253_mcof(_6253_mcof ? _6253_mcof->raw() : nullptr, _6253_mcof ? _6253_mcof->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprMulVar::resshape(_6249_mdimi,_6250_mdimj,_6254_x->getShape(),_6248_left));
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->left = _6248_left;
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->x = _6254_x;
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimi = _6249_mdimi;
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimj = _6250_mdimj;
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubi = ::mosek::fusion::Utils::Tools::arraycopy(_6251_msubi);
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubj = ::mosek::fusion::Utils::Tools::arraycopy(_6252_msubj);
    mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mcof = ::mosek::fusion::Utils::Tools::arraycopy(_6253_mcof);
  }
}
// mosek.fusion.ExprMulVar.ctor

// Begin mosek.fusion.ExprMulVar.eval
// Method mosek.fusion.ExprMulVar.eval @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:740:6-745:7
void mosek::fusion::ExprMulVar :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6256_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6257_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6258_xs) { mosek::fusion::p_ExprMulVar::_get_impl(this)->eval(_6256_rs,_6257_ws,_6258_xs); }
void mosek::fusion::p_ExprMulVar::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6256_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6257_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6258_xs)
{
  if (left)
  {
    {
      _pubthis->eval_left(_6256_rs,_6257_ws,_6258_xs);
    }
  }
  else
  {
    {
      _pubthis->eval_right(_6256_rs,_6257_ws,_6258_xs);
    }
  }
}
// End mosek.fusion.ExprMulVar.eval

// Begin mosek.fusion.ExprMulVar.eval_right
// Method mosek.fusion.ExprMulVar.eval_right @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:460:6-737:7
void mosek::fusion::ExprMulVar :: eval_right(monty::rc_ptr< ::mosek::fusion::WorkStack > _6259_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6260_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6261_xs) { mosek::fusion::p_ExprMulVar::_get_impl(this)->eval_right(_6259_rs,_6260_ws,_6261_xs); }
void mosek::fusion::p_ExprMulVar::eval_right(monty::rc_ptr< ::mosek::fusion::WorkStack > _6259_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6260_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6261_xs)
{
  int32_t _6262_base_pi32 = mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->pi32;
  int32_t _6263_base_pi64 = mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->pi64;
  int32_t _6264_nx = x->numInst();
  int32_t _6265_nidxs = _6260_ws->alloci64(_6264_nx);
  int32_t _6266_sp = _6260_ws->alloci64(_6264_nx);
  int32_t _6267_xsubi = _6260_ws->alloci32(_6264_nx);
  int32_t _6268_xsubj = _6260_ws->alloci32(_6264_nx);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6269_xshape = x->getShape();
  _checked_ptr_1<int32_t> _ptr__6269_xshape(_6269_xshape ? _6269_xshape->raw() : nullptr,_6269_xshape ? _6269_xshape->size(0) : 0);
  int32_t _6270_nd = (int)((_6269_xshape)->size(0));
  int64_t _6271_x_total_size = safe_mul( _ptr__6269_xshape[(int)0],_ptr__6269_xshape[(int)1] );
  int32_t _6272_xdim1 = _ptr__6269_xshape[(int)1];
  int32_t _6273_xdim0 = _ptr__6269_xshape[(int)0];
  int32_t _6274_ptr = _6260_ws->alloci32(safe_add( _6273_xdim0,(int)1 ));
  int32_t _6275_numm = (int)((mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubi)->size(0));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6276_msubi = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubi;
  _checked_ptr_1<int32_t> _ptr__6276_msubi(_6276_msubi ? _6276_msubi->raw() : nullptr,_6276_msubi ? _6276_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6277_msubj = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubj;
  _checked_ptr_1<int32_t> _ptr__6277_msubj(_6277_msubj ? _6277_msubj->raw() : nullptr,_6277_msubj ? _6277_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6278_mcof = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mcof;
  _checked_ptr_1<double> _ptr__6278_mcof(_6278_mcof ? _6278_mcof->raw() : nullptr,_6278_mcof ? _6278_mcof->size(0) : 0);
  int32_t _6279_mdim0 = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimi;
  int32_t _6280_mdim1 = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimj;
  bool _6281_m_is_dense = ((_6275_numm / _6279_mdim0) == _6280_mdim1);
  int32_t _6282_perm = _6260_ws->alloci32(_6275_numm);
  int32_t _6283_mptr = _6260_ws->alloci32(safe_add( mdimj,(int)1 ));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6284_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6284_wi32(_6284_wi32 ? _6284_wi32->raw() : nullptr,_6284_wi32 ? _6284_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6285_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6285_wi64(_6285_wi64 ? _6285_wi64->raw() : nullptr,_6285_wi64 ? _6285_wi64->size(0) : 0);
  int32_t _6286_nnz = (int)0;
  int32_t _6287_nelem = (int)0;
  x->inst(_6266_sp,_6285_wi64,_6265_nidxs,_6285_wi64);
  if (_6281_m_is_dense)
  {
    {
      int32_t _6288_x_num_nonempty_rows = (int)0;
      if ((_6264_nx > (int)0))
      {
        {
          _6288_x_num_nonempty_rows = (int)1;
          if ((_6273_xdim0 > (int)1))
          {
            {
              if ((_6272_xdim1 == (int)1))
              {
                {
                  int32_t _11972_ = (int)1;
                  int32_t _11973_ = _6264_nx;
                  for (int32_t _6289_i = _11972_; _6289_i < _11973_; ++_6289_i)
                  {
                    {
                      if ((_ptr__6285_wi64[safe_add( _6266_sp,_6289_i )] > _ptr__6285_wi64[(safe_add( _6266_sp,_6289_i ) - (int)1)]))
                      {
                        {
                          ++ _6288_x_num_nonempty_rows;
                        }
                      }
                      {}
                    }
                  }
                }
              }
              else
              {
                {
                  int32_t _11974_ = (int)1;
                  int32_t _11975_ = _6264_nx;
                  for (int32_t _6290_i = _11974_; _6290_i < _11975_; ++_6290_i)
                  {
                    {
                      if (((_ptr__6285_wi64[safe_add( _6266_sp,_6290_i )] / _6272_xdim1) > (_ptr__6285_wi64[(safe_add( _6266_sp,_6290_i ) - (int)1)] / _6272_xdim1)))
                      {
                        {
                          ++ _6288_x_num_nonempty_rows;
                        }
                      }
                      {}
                    }
                  }
                }
              }
            }
          }
          {}
        }
      }
      {}
      _6287_nelem = safe_mul( _6288_x_num_nonempty_rows,_6280_mdim1 );
      _6286_nnz = safe_mul( _6264_nx,_6280_mdim1 );
      bool _6291_hassp = (_6288_x_num_nonempty_rows < _6273_xdim0);
      _6259_rs->alloc_expr((int)2,_6287_nelem,_6286_nnz,_6291_hassp);
      int32_t _6292_rptr = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->ptr_base;
      int32_t _6293_rshape = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->shape_base;
      int32_t _6294_rnidx = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->nidxs_base;
      int32_t _11976_;
      bool _11977_ = _6291_hassp;
      if (_11977_)
      {
        _11976_ = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->sp_base;
      }
      else
      {
        _11976_ = _6259_rs->alloci64(_6287_nelem);
      }
      int32_t _6295_rsp = _11976_;
      int32_t _6296_rcof = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->cof_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6297_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6297_ri32(_6297_ri32 ? _6297_ri32->raw() : nullptr,_6297_ri32 ? _6297_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6298_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6298_ri64(_6298_ri64 ? _6298_ri64->raw() : nullptr,_6298_ri64 ? _6298_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6299_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->f64;
      _checked_ptr_1<double> _ptr__6299_rf64(_6299_rf64 ? _6299_rf64->raw() : nullptr,_6299_rf64 ? _6299_rf64->size(0) : 0);
      _ptr__6297_ri32[_6293_rshape] = _6273_xdim0;
      _ptr__6297_ri32[safe_add( _6293_rshape,(int)1 )] = _6280_mdim1;
      {
        int32_t _6300_p = (int)0;
        int32_t _6301_relm = (int)0;
        int32_t _6302_rnz = (int)0;
        _ptr__6297_ri32[_6292_rptr] = (int)0;
        while ( (_6300_p < _6264_nx) )
        {
          {
            int32_t _6303_p0 = _6300_p;
            ++ _6300_p;
            while ( ((_6300_p < _6264_nx) && ((_ptr__6285_wi64[safe_add( _6266_sp,_6300_p )] / _6272_xdim1) == (_ptr__6285_wi64[safe_add( _6266_sp,_6303_p0 )] / _6272_xdim1))) )
            {
              {
                ++ _6300_p;
              }
            }
            int64_t _6304_i = (_ptr__6285_wi64[safe_add( _6266_sp,_6303_p0 )] / _6272_xdim1);
            int32_t _11978_ = (int)0;
            int32_t _11979_ = _6280_mdim1;
            for (int32_t _6305_j = _11978_; _6305_j < _11979_; ++_6305_j)
            {
              {
                int32_t _11980_ = _6303_p0;
                int32_t _11981_ = _6300_p;
                for (int32_t _6306_k = _11980_; _6306_k < _11981_; ++_6306_k)
                {
                  {
                    int64_t _6307_jj = (_ptr__6285_wi64[safe_add( _6266_sp,_6306_k )] % _6272_xdim1);
                    _ptr__6298_ri64[safe_add( _6294_rnidx,_6302_rnz )] = _ptr__6285_wi64[safe_add( _6265_nidxs,_6306_k )];
                    _ptr__6299_rf64[safe_add( _6296_rcof,_6302_rnz )] = _ptr__6278_mcof[safe_add( safe_mul( _6307_jj,_6280_mdim1 ),_6305_j )];
                    ++ _6302_rnz;
                  }
                }
                _ptr__6297_ri32[safe_add( safe_add( _6292_rptr,_6301_relm ),(int)1 )] = _6302_rnz;
                _ptr__6298_ri64[safe_add( _6295_rsp,_6301_relm )] = safe_add( safe_mul( _6304_i,_6280_mdim1 ),_6305_j );
                ++ _6301_relm;
              }
            }
          }
        }
      }
      if ((!_6291_hassp))
      {
        {
          _6259_rs->popi64(_6287_nelem);
        }
      }
      {}
    }
  }
  else
  {
    {
      {
        if ((_6280_mdim1 == (int)1))
        {
          {
            int32_t _11982_ = (int)0;
            int32_t _11983_ = _6275_numm;
            for (int32_t _6308_i = _11982_; _6308_i < _11983_; ++_6308_i)
            {
              {
                _ptr__6284_wi32[safe_add( _6282_perm,_6308_i )] = _6308_i;
              }
            }
            _ptr__6284_wi32[_6283_mptr] = (int)0;
            _ptr__6284_wi32[safe_add( _6283_mptr,(int)1 )] = _6275_numm;
          }
        }
        else
        {
          {
            _ptr__6284_wi32[_6283_mptr] = (int)0;
            int32_t _11984_ = (int)0;
            int32_t _11985_ = safe_add( _6280_mdim1,(int)1 );
            for (int32_t _6309_i = _11984_; _6309_i < _11985_; ++_6309_i)
            {
              {
                _ptr__6284_wi32[safe_add( _6283_mptr,_6309_i )] = (int)0;
              }
            }
            int32_t _11986_ = (int)0;
            int32_t _11987_ = _6275_numm;
            for (int32_t _6310_i = _11986_; _6310_i < _11987_; ++_6310_i)
            {
              {
                ++ _ptr__6284_wi32[safe_add( safe_add( _6283_mptr,_ptr__6277_msubj[_6310_i] ),(int)1 )];
              }
            }
            int32_t _11988_ = (int)0;
            int32_t _11989_ = mdimj;
            for (int32_t _6311_i = _11988_; _6311_i < _11989_; ++_6311_i)
            {
              {
                _ptr__6284_wi32[safe_add( safe_add( _6283_mptr,_6311_i ),(int)1 )] += _ptr__6284_wi32[safe_add( _6283_mptr,_6311_i )];
              }
            }
            int32_t _11990_ = (int)0;
            int32_t _11991_ = _6275_numm;
            for (int32_t _6312_i = _11990_; _6312_i < _11991_; ++_6312_i)
            {
              {
                _ptr__6284_wi32[safe_add( _6282_perm,_ptr__6284_wi32[safe_add( _6283_mptr,_ptr__6277_msubj[_6312_i] )] )] = _6312_i;
                ++ _ptr__6284_wi32[safe_add( _6283_mptr,_ptr__6277_msubj[_6312_i] )];
              }
            }
            int32_t _11992_ = (int)0;
            int32_t _11993_ = _6280_mdim1;
            for (int32_t _6313_i = _11992_; _6313_i < _11993_; ++_6313_i)
            {
              {
                _ptr__6284_wi32[(safe_add( _6283_mptr,_6280_mdim1 ) - _6313_i)] = _ptr__6284_wi32[((safe_add( _6283_mptr,_6280_mdim1 ) - _6313_i) - (int)1)];
              }
            }
            _ptr__6284_wi32[_6283_mptr] = (int)0;
          }
        }
      }
      if (((_6264_nx / _6273_xdim0) == _6272_xdim1))
      {
        {
          int32_t _6314_num_nz_cols = (int)0;
          {
            int32_t _6315_p = (int)0;
            while ( (_6315_p < _6275_numm) )
            {
              {
                ++ _6315_p;
                while ( ((_6315_p < _6275_numm) && (_ptr__6277_msubj[_ptr__6284_wi32[(safe_add( _6282_perm,_6315_p ) - (int)1)]] == _ptr__6277_msubj[_ptr__6284_wi32[safe_add( _6282_perm,_6315_p )]])) )
                {
                  {
                    ++ _6315_p;
                  }
                }
                ++ _6314_num_nz_cols;
              }
            }
          }
          _6287_nelem = safe_mul( _6314_num_nz_cols,_6273_xdim0 );
          _6286_nnz = safe_mul( _6275_numm,_6273_xdim0 );
          bool _6316_rhassp = (_6314_num_nz_cols < _6280_mdim1);
          _6259_rs->alloc_expr((int)2,_6287_nelem,_6286_nnz,_6316_rhassp);
          int32_t _6317_rptr = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->ptr_base;
          int32_t _6318_rshape = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->shape_base;
          int32_t _6319_rnidx = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->nidxs_base;
          int32_t _11994_;
          bool _11995_ = _6316_rhassp;
          if (_11995_)
          {
            _11994_ = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->sp_base;
          }
          else
          {
            _11994_ = _6259_rs->alloci64(_6287_nelem);
          }
          int32_t _6320_rsp = _11994_;
          int32_t _6321_rcof = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->cof_base;
          ((*mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32)(_6318_rshape)) = _6273_xdim0;
          ((*mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32)(safe_add( _6318_rshape,(int)1 ))) = _6280_mdim1;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _6322_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__6322_ri32(_6322_ri32 ? _6322_ri32->raw() : nullptr,_6322_ri32 ? _6322_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6323_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__6323_ri64(_6323_ri64 ? _6323_ri64->raw() : nullptr,_6323_ri64 ? _6323_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _6324_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->f64;
          _checked_ptr_1<double> _ptr__6324_rf64(_6324_rf64 ? _6324_rf64->raw() : nullptr,_6324_rf64 ? _6324_rf64->size(0) : 0);
          _ptr__6322_ri32[_6317_rptr] = (int)0;
          int32_t _6325_kelm = (int)0;
          int32_t _6326_knz = (int)0;
          int32_t _11996_ = (int)0;
          int32_t _11997_ = _6273_xdim0;
          for (int32_t _6327_i = _11996_; _6327_i < _11997_; ++_6327_i)
          {
            {
              int32_t _6328_p = (int)0;
              while ( (_6328_p < _6275_numm) )
              {
                {
                  int32_t _6329_p0 = _6328_p;
                  ++ _6328_p;
                  while ( ((_6328_p < _6275_numm) && (_ptr__6277_msubj[_ptr__6284_wi32[safe_add( _6282_perm,_6329_p0 )]] == _ptr__6277_msubj[_ptr__6284_wi32[safe_add( _6282_perm,_6328_p )]])) )
                  {
                    {
                      ++ _6328_p;
                    }
                  }
                  int32_t _6330_j = _ptr__6277_msubj[_ptr__6284_wi32[safe_add( _6282_perm,_6329_p0 )]];
                  int32_t _11998_ = _6329_p0;
                  int32_t _11999_ = _6328_p;
                  for (int32_t _6331_k = _11998_; _6331_k < _11999_; ++_6331_k)
                  {
                    {
                      int32_t _6332_ii = _ptr__6276_msubi[_ptr__6284_wi32[safe_add( _6282_perm,_6331_k )]];
                      _ptr__6323_ri64[safe_add( _6319_rnidx,_6326_knz )] = _ptr__6285_wi64[safe_add( safe_add( _6265_nidxs,safe_mul( _6327_i,_6272_xdim1 ) ),_6332_ii )];
                      _ptr__6324_rf64[safe_add( _6321_rcof,_6326_knz )] = _ptr__6278_mcof[_ptr__6284_wi32[safe_add( _6282_perm,_6331_k )]];
                      ++ _6326_knz;
                    }
                  }
                  _ptr__6323_ri64[safe_add( _6320_rsp,_6325_kelm )] = safe_add( safe_mul( _6327_i,_6280_mdim1 ),_6330_j );
                  _ptr__6322_ri32[safe_add( safe_add( _6317_rptr,_6325_kelm ),(int)1 )] = _6326_knz;
                  ++ _6325_kelm;
                }
              }
            }
          }
          if ((!_6316_rhassp))
          {
            {
              _6259_rs->popi64(_6287_nelem);
            }
          }
          {}
        }
      }
      else
      {
        {
          int32_t _12000_ = (int)0;
          int32_t _12001_ = safe_add( _6273_xdim0,(int)1 );
          for (int32_t _6333_i = _12000_; _6333_i < _12001_; ++_6333_i)
          {
            {
              _ptr__6284_wi32[safe_add( _6274_ptr,_6333_i )] = (int)0;
            }
          }
          if ((_6270_nd == (int)1))
          {
            {
              int32_t _12002_ = (int)0;
              int32_t _12003_ = _6264_nx;
              for (int32_t _6334_i = _12002_; _6334_i < _12003_; ++_6334_i)
              {
                {
                  _ptr__6284_wi32[safe_add( _6267_xsubi,_6334_i )] = (int)0;
                }
              }
              int32_t _12004_ = (int)0;
              int32_t _12005_ = _6264_nx;
              for (int32_t _6335_i = _12004_; _6335_i < _12005_; ++_6335_i)
              {
                {
                  _ptr__6284_wi32[safe_add( _6268_xsubj,_6335_i )] = (int32_t)_ptr__6285_wi64[safe_add( _6266_sp,_6335_i )];
                }
              }
              _ptr__6284_wi32[_6274_ptr] = (int)0;
              _ptr__6284_wi32[safe_add( _6274_ptr,(int)1 )] = _6264_nx;
            }
          }
          else
          {
            {
              int32_t _12006_ = (int)0;
              int32_t _12007_ = _6264_nx;
              for (int32_t _6336_i = _12006_; _6336_i < _12007_; ++_6336_i)
              {
                {
                  _ptr__6284_wi32[safe_add( _6267_xsubi,_6336_i )] = (int32_t)(_ptr__6285_wi64[safe_add( _6266_sp,_6336_i )] / _ptr__6269_xshape[(int)1]);
                }
              }
              int32_t _12008_ = (int)0;
              int32_t _12009_ = _6264_nx;
              for (int32_t _6337_i = _12008_; _6337_i < _12009_; ++_6337_i)
              {
                {
                  _ptr__6284_wi32[safe_add( _6268_xsubj,_6337_i )] = (int32_t)(_ptr__6285_wi64[safe_add( _6266_sp,_6337_i )] % _ptr__6269_xshape[(int)1]);
                }
              }
              _ptr__6284_wi32[_6274_ptr] = (int)0;
              int32_t _12010_ = (int)0;
              int32_t _12011_ = _6264_nx;
              for (int32_t _6338_i = _12010_; _6338_i < _12011_; ++_6338_i)
              {
                {
                  ++ _ptr__6284_wi32[safe_add( safe_add( _6274_ptr,_ptr__6284_wi32[safe_add( _6267_xsubi,_6338_i )] ),(int)1 )];
                }
              }
              int32_t _12012_ = (int)0;
              int32_t _12013_ = _6273_xdim0;
              for (int32_t _6339_i = _12012_; _6339_i < _12013_; ++_6339_i)
              {
                {
                  _ptr__6284_wi32[safe_add( safe_add( _6274_ptr,_6339_i ),(int)1 )] += _ptr__6284_wi32[safe_add( _6274_ptr,_6339_i )];
                }
              }
            }
          }
          int32_t _12014_ = (int)0;
          int32_t _12015_ = _6273_xdim0;
          for (int32_t _6340_i = _12014_; _6340_i < _12015_; ++_6340_i)
          {
            {
              int32_t _12016_ = (int)0;
              int32_t _12017_ = mdimj;
              for (int32_t _6341_j = _12016_; _6341_j < _12017_; ++_6341_j)
              {
                {
                  int32_t _6342_nz = (int)0;
                  int32_t _6343_e1 = _ptr__6284_wi32[safe_add( safe_add( _6274_ptr,_6340_i ),(int)1 )];
                  int32_t _6344_e0 = _ptr__6284_wi32[safe_add( safe_add( _6283_mptr,_6341_j ),(int)1 )];
                  int32_t _6345_i1 = _ptr__6284_wi32[safe_add( _6274_ptr,_6340_i )];
                  int32_t _6346_i0 = _ptr__6284_wi32[safe_add( _6283_mptr,_6341_j )];
                  while ( ((_6346_i0 < _6344_e0) && (_6345_i1 < _6343_e1)) )
                  {
                    {
                      if ((_ptr__6276_msubi[_ptr__6284_wi32[safe_add( _6282_perm,_6346_i0 )]] < _ptr__6284_wi32[safe_add( _6268_xsubj,_6345_i1 )]))
                      {
                        {
                          ++ _6346_i0;
                        }
                      }
                      else if((_ptr__6276_msubi[_ptr__6284_wi32[safe_add( _6282_perm,_6346_i0 )]] > _ptr__6284_wi32[safe_add( _6268_xsubj,_6345_i1 )]))
                      {
                        {
                          ++ _6345_i1;
                        }
                      }
                      else
                      {
                        {
                          ++ _6342_nz;
                          ++ _6346_i0;
                          ++ _6345_i1;
                        }
                      }
                    }
                  }
                  if ((_6342_nz > (int)0))
                  {
                    {
                      _6286_nnz += _6342_nz;
                      ++ _6287_nelem;
                    }
                  }
                  {}
                }
              }
            }
          }
          bool _6347_rhassp = (_6287_nelem < safe_mul( _6272_xdim1,mdimi ));
          _6259_rs->alloc_expr((int)2,_6287_nelem,_6286_nnz,_6347_rhassp);
          int32_t _6348_rptr = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->ptr_base;
          int32_t _6349_rshape = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->shape_base;
          int32_t _6350_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->nidxs_base;
          int32_t _6351_rsp = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->sp_base;
          int32_t _6352_rcof = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->cof_base;
          ((*mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32)(_6349_rshape)) = _6273_xdim0;
          ((*mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32)(safe_add( _6349_rshape,(int)1 ))) = mdimj;
          std::shared_ptr< monty::ndarray< int32_t,1 > > _6353_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i32;
          _checked_ptr_1<int32_t> _ptr__6353_ri32(_6353_ri32 ? _6353_ri32->raw() : nullptr,_6353_ri32 ? _6353_ri32->size(0) : 0);
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6354_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->i64;
          _checked_ptr_1<int64_t> _ptr__6354_ri64(_6354_ri64 ? _6354_ri64->raw() : nullptr,_6354_ri64 ? _6354_ri64->size(0) : 0);
          std::shared_ptr< monty::ndarray< double,1 > > _6355_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6259_rs)->f64;
          _checked_ptr_1<double> _ptr__6355_rf64(_6355_rf64 ? _6355_rf64->raw() : nullptr,_6355_rf64 ? _6355_rf64->size(0) : 0);
          {
            int32_t _6356_pi = (int)0;
            int32_t _6357_pe = (int)0;
            int32_t _6358_p = (int)0;
            _ptr__6353_ri32[_6348_rptr] = (int)0;
            int32_t _12018_ = (int)0;
            int32_t _12019_ = _6273_xdim0;
            for (int32_t _6359_i = _12018_; _6359_i < _12019_; ++_6359_i)
            {
              {
                int32_t _12020_ = (int)0;
                int32_t _12021_ = mdimj;
                for (int32_t _6360_j = _12020_; _6360_j < _12021_; ++_6360_j)
                {
                  {
                    int32_t _6361_nz = (int)0;
                    int32_t _6362_e1 = _ptr__6284_wi32[safe_add( safe_add( _6274_ptr,_6359_i ),(int)1 )];
                    int32_t _6363_e0 = _ptr__6284_wi32[safe_add( safe_add( _6283_mptr,_6360_j ),(int)1 )];
                    int32_t _6364_i1 = _ptr__6284_wi32[safe_add( _6274_ptr,_6359_i )];
                    int32_t _6365_i0 = _ptr__6284_wi32[safe_add( _6283_mptr,_6360_j )];
                    while ( ((_6365_i0 < _6363_e0) && (_6364_i1 < _6362_e1)) )
                    {
                      {
                        if ((_ptr__6276_msubi[_ptr__6284_wi32[safe_add( _6282_perm,_6365_i0 )]] < _ptr__6284_wi32[safe_add( _6268_xsubj,_6364_i1 )]))
                        {
                          {
                            ++ _6365_i0;
                          }
                        }
                        else if((_ptr__6276_msubi[_ptr__6284_wi32[safe_add( _6282_perm,_6365_i0 )]] > _ptr__6284_wi32[safe_add( _6268_xsubj,_6364_i1 )]))
                        {
                          {
                            ++ _6364_i1;
                          }
                        }
                        else
                        {
                          {
                            _ptr__6354_ri64[safe_add( _6350_rnidxs,_6358_p )] = _ptr__6285_wi64[safe_add( _6265_nidxs,_6364_i1 )];
                            _ptr__6355_rf64[safe_add( _6352_rcof,_6358_p )] = _ptr__6278_mcof[_ptr__6284_wi32[safe_add( _6282_perm,_6365_i0 )]];
                            ++ _6361_nz;
                            ++ _6358_p;
                            ++ _6365_i0;
                            ++ _6364_i1;
                          }
                        }
                      }
                    }
                    if ((_6361_nz > (int)0))
                    {
                      {
                        _ptr__6353_ri32[safe_add( safe_add( _6348_rptr,_6357_pe ),(int)1 )] = _6358_p;
                        _ptr__6354_ri64[safe_add( _6351_rsp,_6357_pe )] = _6356_pi;
                        ++ _6357_pe;
                      }
                    }
                    {}
                    ++ _6356_pi;
                  }
                }
              }
            }
          }
          if ((!_6347_rhassp))
          {
            {
              _6259_rs->popi64(_6287_nelem);
            }
          }
          {}
        }
      }
    }
  }
  mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->pi32 = _6262_base_pi32;
  mosek::fusion::p_WorkStack::_get_impl(_6260_ws)->pi64 = _6263_base_pi64;
}
// End mosek.fusion.ExprMulVar.eval_right

// Begin mosek.fusion.ExprMulVar.eval_left
// Method mosek.fusion.ExprMulVar.eval_left @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:279:6-458:7
void mosek::fusion::ExprMulVar :: eval_left(monty::rc_ptr< ::mosek::fusion::WorkStack > _6366_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6367_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6368_xs) { mosek::fusion::p_ExprMulVar::_get_impl(this)->eval_left(_6366_rs,_6367_ws,_6368_xs); }
void mosek::fusion::p_ExprMulVar::eval_left(monty::rc_ptr< ::mosek::fusion::WorkStack > _6366_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6367_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6368_xs)
{
  int32_t _6369_nx = x->numInst();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6370_xshape = x->getShape();
  _checked_ptr_1<int32_t> _ptr__6370_xshape(_6370_xshape ? _6370_xshape->raw() : nullptr,_6370_xshape ? _6370_xshape->size(0) : 0);
  int32_t _6371_nd = (int)((_6370_xshape)->size(0));
  int32_t _6372_nidxs = _6368_xs->alloci64(_6369_nx);
  int32_t _6373_sp = _6368_xs->alloci64(_6369_nx);
  int32_t _6374_xsubi = _6368_xs->alloci32(_6369_nx);
  int32_t _6375_xsubj = _6368_xs->alloci32(_6369_nx);
  int32_t _6376_perm = _6368_xs->alloci32(_6369_nx);
  int32_t _6377_mptr = _6368_xs->alloci32(safe_add( mdimi,(int)1 ));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6378_xshape = x->getShape();
  _checked_ptr_1<int32_t> _ptr__6378_xshape(_6378_xshape ? _6378_xshape->raw() : nullptr,_6378_xshape ? _6378_xshape->size(0) : 0);
  int32_t _6379_nd = (int)((_6378_xshape)->size(0));
  int32_t _12022_;
  bool _12023_ = (_6379_nd == (int)1);
  if (_12023_)
  {
    _12022_ = (int)1;
  }
  else
  {
    _12022_ = _ptr__6378_xshape[(int)1];
  }
  int32_t _6380_xdim1 = _12022_;
  int32_t _6381_xdim0 = _ptr__6378_xshape[(int)0];
  int32_t _6382_ptr = _6368_xs->alloci32(safe_add( _6380_xdim1,(int)1 ));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6383_msubi = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubi;
  _checked_ptr_1<int32_t> _ptr__6383_msubi(_6383_msubi ? _6383_msubi->raw() : nullptr,_6383_msubi ? _6383_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6384_msubj = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->msubj;
  _checked_ptr_1<int32_t> _ptr__6384_msubj(_6384_msubj ? _6384_msubj->raw() : nullptr,_6384_msubj ? _6384_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6385_mcof = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mcof;
  _checked_ptr_1<double> _ptr__6385_mcof(_6385_mcof ? _6385_mcof->raw() : nullptr,_6385_mcof ? _6385_mcof->size(0) : 0);
  int32_t _6386_mdimi = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimi;
  int32_t _6387_mdimj = mosek::fusion::p_ExprMulVar::_get_impl(::mosek::fusion::ExprMulVar::t(_pubthis))->mdimj;
  int32_t _6388_rnnz = (int)0;
  int32_t _6389_rnelem = (int)0;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6390_xi32 = mosek::fusion::p_WorkStack::_get_impl(_6368_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__6390_xi32(_6390_xi32 ? _6390_xi32->raw() : nullptr,_6390_xi32 ? _6390_xi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6391_xi64 = mosek::fusion::p_WorkStack::_get_impl(_6368_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__6391_xi64(_6391_xi64 ? _6391_xi64->raw() : nullptr,_6391_xi64 ? _6391_xi64->size(0) : 0);
  int32_t _6392_mnnz = (int)((_6385_mcof)->size(0));
  x->inst(_6373_sp,_6391_xi64,_6372_nidxs,_6391_xi64);
  if ((x->numInst() < x->getSize()))
  {
    {
      {
        int32_t _12024_ = (int)0;
        int32_t _12025_ = safe_add( _6386_mdimi,(int)1 );
        for (int32_t _6393_i = _12024_; _6393_i < _12025_; ++_6393_i)
        {
          {
            _ptr__6390_xi32[safe_add( _6377_mptr,_6393_i )] = (int)0;
          }
        }
        int32_t _12026_ = (int)0;
        int32_t _12027_ = (int)((_6383_msubi)->size(0));
        for (int32_t _6394_i = _12026_; _6394_i < _12027_; ++_6394_i)
        {
          {
            ++ _ptr__6390_xi32[safe_add( safe_add( _6377_mptr,_ptr__6383_msubi[_6394_i] ),(int)1 )];
          }
        }
        int32_t _12028_ = (int)0;
        int32_t _12029_ = _6386_mdimi;
        for (int32_t _6395_i = _12028_; _6395_i < _12029_; ++_6395_i)
        {
          {
            _ptr__6390_xi32[safe_add( safe_add( _6377_mptr,_6395_i ),(int)1 )] += _ptr__6390_xi32[safe_add( _6377_mptr,_6395_i )];
          }
        }
        if ((_6379_nd == (int)1))
        {
          {
            int32_t _12030_ = (int)0;
            int32_t _12031_ = _6369_nx;
            for (int32_t _6396_i = _12030_; _6396_i < _12031_; ++_6396_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6374_xsubi,_6396_i )] = (int32_t)_ptr__6391_xi64[safe_add( _6373_sp,_6396_i )];
              }
            }
            int32_t _12032_ = (int)0;
            int32_t _12033_ = _6369_nx;
            for (int32_t _6397_i = _12032_; _6397_i < _12033_; ++_6397_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6375_xsubj,_6397_i )] = (int)0;
              }
            }
          }
        }
        else
        {
          {
            int32_t _12034_ = (int)0;
            int32_t _12035_ = _6369_nx;
            for (int32_t _6398_i = _12034_; _6398_i < _12035_; ++_6398_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6374_xsubi,_6398_i )] = (int32_t)(_ptr__6391_xi64[safe_add( _6373_sp,_6398_i )] / _6380_xdim1);
              }
            }
            int32_t _12036_ = (int)0;
            int32_t _12037_ = _6369_nx;
            for (int32_t _6399_i = _12036_; _6399_i < _12037_; ++_6399_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6375_xsubj,_6399_i )] = (int32_t)(_ptr__6391_xi64[safe_add( _6373_sp,_6399_i )] % _6380_xdim1);
              }
            }
          }
        }
        if ((_6379_nd > (int)1))
        {
          {
            int32_t _12038_ = (int)0;
            int32_t _12039_ = safe_add( _6380_xdim1,(int)1 );
            for (int32_t _6400_i = _12038_; _6400_i < _12039_; ++_6400_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6382_ptr,_6400_i )] = (int)0;
              }
            }
            int32_t _12040_ = (int)0;
            int32_t _12041_ = _6369_nx;
            for (int32_t _6401_i = _12040_; _6401_i < _12041_; ++_6401_i)
            {
              {
                ++ _ptr__6390_xi32[safe_add( safe_add( _6382_ptr,_ptr__6390_xi32[safe_add( _6375_xsubj,_6401_i )] ),(int)1 )];
              }
            }
            int32_t _12042_ = (int)0;
            int32_t _12043_ = _6380_xdim1;
            for (int32_t _6402_i = _12042_; _6402_i < _12043_; ++_6402_i)
            {
              {
                _ptr__6390_xi32[safe_add( safe_add( _6382_ptr,_6402_i ),(int)1 )] += _ptr__6390_xi32[safe_add( _6382_ptr,_6402_i )];
              }
            }
            int32_t _12044_ = (int)0;
            int32_t _12045_ = _6369_nx;
            for (int32_t _6403_i = _12044_; _6403_i < _12045_; ++_6403_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6376_perm,_ptr__6390_xi32[safe_add( _6382_ptr,_ptr__6390_xi32[safe_add( _6375_xsubj,_6403_i )] )] )] = _6403_i;
                ++ _ptr__6390_xi32[safe_add( _6382_ptr,_ptr__6390_xi32[safe_add( _6375_xsubj,_6403_i )] )];
              }
            }
            int32_t _12046_ = (int)0;
            int32_t _12047_ = _6380_xdim1;
            for (int32_t _6404_i = _12046_; _6404_i < _12047_; ++_6404_i)
            {
              {
                _ptr__6390_xi32[(safe_add( _6382_ptr,_6380_xdim1 ) - _6404_i)] = _ptr__6390_xi32[((safe_add( _6382_ptr,_6380_xdim1 ) - _6404_i) - (int)1)];
              }
            }
            _ptr__6390_xi32[_6382_ptr] = (int)0;
          }
        }
        else
        {
          {
            _ptr__6390_xi32[_6382_ptr] = (int)0;
            _ptr__6390_xi32[safe_add( _6382_ptr,(int)1 )] = _6369_nx;
            int32_t _12048_ = (int)0;
            int32_t _12049_ = _6369_nx;
            for (int32_t _6405_i = _12048_; _6405_i < _12049_; ++_6405_i)
            {
              {
                _ptr__6390_xi32[safe_add( _6376_perm,_6405_i )] = _6405_i;
              }
            }
          }
        }
        int32_t _12050_ = (int)0;
        int32_t _12051_ = _6386_mdimi;
        for (int32_t _6406_i = _12050_; _6406_i < _12051_; ++_6406_i)
        {
          {
            int32_t _12052_ = (int)0;
            int32_t _12053_ = _6380_xdim1;
            for (int32_t _6407_j = _12052_; _6407_j < _12053_; ++_6407_j)
            {
              {
                int32_t _6408_nz = (int)0;
                int32_t _6409_e1 = _ptr__6390_xi32[safe_add( safe_add( _6382_ptr,_6407_j ),(int)1 )];
                int32_t _6410_e0 = _ptr__6390_xi32[safe_add( safe_add( _6377_mptr,_6406_i ),(int)1 )];
                int32_t _6411_i1 = _ptr__6390_xi32[safe_add( _6382_ptr,_6407_j )];
                int32_t _6412_i0 = _ptr__6390_xi32[safe_add( _6377_mptr,_6406_i )];
                while ( ((_6412_i0 < _6410_e0) && (_6411_i1 < _6409_e1)) )
                {
                  {
                    if ((_ptr__6384_msubj[_6412_i0] < _ptr__6390_xi32[safe_add( _6374_xsubi,_ptr__6390_xi32[safe_add( _6376_perm,_6411_i1 )] )]))
                    {
                      {
                        ++ _6412_i0;
                      }
                    }
                    else if((_ptr__6384_msubj[_6412_i0] > _ptr__6390_xi32[safe_add( _6374_xsubi,_ptr__6390_xi32[safe_add( _6376_perm,_6411_i1 )] )]))
                    {
                      {
                        ++ _6411_i1;
                      }
                    }
                    else
                    {
                      {
                        ++ _6408_nz;
                        ++ _6412_i0;
                        ++ _6411_i1;
                      }
                    }
                  }
                }
                if ((_6408_nz > (int)0))
                {
                  {
                    _6388_rnnz += _6408_nz;
                    ++ _6389_rnelem;
                  }
                }
                {}
              }
            }
          }
        }
      }
    }
  }
  else
  {
    {
      _6388_rnnz = safe_mul( _6392_mnnz,_6380_xdim1 );
      int32_t _6413_i0 = (int)0;
      while ( (_6413_i0 < _6392_mnnz) )
      {
        {
          int32_t _6414_e0 = safe_add( _6413_i0,(int)1 );
          while ( ((_6414_e0 < _6392_mnnz) && (_ptr__6383_msubi[_6413_i0] == _ptr__6383_msubi[_6414_e0])) )
          {
            {
              ++ _6414_e0;
            }
          }
          ++ _6389_rnelem;
          _6413_i0 = _6414_e0;
        }
      }
      _6389_rnelem *= _6380_xdim1;
    }
  }
  bool _12054_;
  bool _12055_ = (_6389_rnelem < safe_mul( _6380_xdim1,_6386_mdimi ));
  if (_12055_)
  {
    _12054_ = true;
  }
  else
  {
    _12054_ = false;
  }
  bool _6415_rhassp = _12054_;
  int32_t _6416_rnd = _6379_nd;
  _6366_rs->alloc_expr(_6416_rnd,_6389_rnelem,_6388_rnnz,_6415_rhassp);
  int32_t _6417_rptr = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->ptr_base;
  int32_t _6418_rshape = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->shape_base;
  int32_t _6419_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->nidxs_base;
  int32_t _12056_;
  bool _12057_ = _6415_rhassp;
  if (_12057_)
  {
    _12056_ = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->sp_base;
  }
  else
  {
    _12056_ = _6366_rs->alloci64(_6389_rnelem);
  }
  int32_t _6420_rsp = _12056_;
  int32_t _6421_rcof = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->cof_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6422_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__6422_ri32(_6422_ri32 ? _6422_ri32->raw() : nullptr,_6422_ri32 ? _6422_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6423_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__6423_ri64(_6423_ri64 ? _6423_ri64->raw() : nullptr,_6423_ri64 ? _6423_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6424_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6366_rs)->f64;
  _checked_ptr_1<double> _ptr__6424_rf64(_6424_rf64 ? _6424_rf64->raw() : nullptr,_6424_rf64 ? _6424_rf64->size(0) : 0);
  _ptr__6422_ri32[_6418_rshape] = _6386_mdimi;
  if ((_6379_nd > (int)1))
  {
    {
      _ptr__6422_ri32[safe_add( _6418_rshape,(int)1 )] = _6380_xdim1;
    }
  }
  {}
  if ((x->numInst() < x->getSize()))
  {
    {
      int32_t _6425_pi = (int)0;
      int32_t _6426_pe = (int)0;
      int32_t _6427_p = (int)0;
      _ptr__6422_ri32[_6417_rptr] = (int)0;
      int32_t _12058_ = (int)0;
      int32_t _12059_ = _6386_mdimi;
      for (int32_t _6428_i = _12058_; _6428_i < _12059_; ++_6428_i)
      {
        {
          int32_t _12060_ = (int)0;
          int32_t _12061_ = _6380_xdim1;
          for (int32_t _6429_j = _12060_; _6429_j < _12061_; ++_6429_j)
          {
            {
              int32_t _6430_nz = (int)0;
              int32_t _6431_e1 = _ptr__6390_xi32[safe_add( safe_add( _6382_ptr,_6429_j ),(int)1 )];
              int32_t _6432_e0 = _ptr__6390_xi32[safe_add( safe_add( _6377_mptr,_6428_i ),(int)1 )];
              int32_t _6433_i1 = _ptr__6390_xi32[safe_add( _6382_ptr,_6429_j )];
              int32_t _6434_i0 = _ptr__6390_xi32[safe_add( _6377_mptr,_6428_i )];
              while ( ((_6434_i0 < _6432_e0) && (_6433_i1 < _6431_e1)) )
              {
                {
                  if ((_ptr__6384_msubj[_6434_i0] < _ptr__6390_xi32[safe_add( _6374_xsubi,_ptr__6390_xi32[safe_add( _6376_perm,_6433_i1 )] )]))
                  {
                    {
                      ++ _6434_i0;
                    }
                  }
                  else if((_ptr__6384_msubj[_6434_i0] > _ptr__6390_xi32[safe_add( _6374_xsubi,_ptr__6390_xi32[safe_add( _6376_perm,_6433_i1 )] )]))
                  {
                    {
                      ++ _6433_i1;
                    }
                  }
                  else
                  {
                    {
                      _ptr__6423_ri64[safe_add( _6419_rnidxs,_6427_p )] = _ptr__6391_xi64[safe_add( _6372_nidxs,_ptr__6390_xi32[safe_add( _6376_perm,_6433_i1 )] )];
                      _ptr__6424_rf64[safe_add( _6421_rcof,_6427_p )] = _ptr__6385_mcof[_6434_i0];
                      ++ _6430_nz;
                      ++ _6427_p;
                      ++ _6434_i0;
                      ++ _6433_i1;
                    }
                  }
                }
              }
              if ((_6430_nz > (int)0))
              {
                {
                  _ptr__6422_ri32[safe_add( safe_add( _6417_rptr,_6426_pe ),(int)1 )] = _6427_p;
                  _ptr__6423_ri64[safe_add( _6420_rsp,_6426_pe )] = _6425_pi;
                  ++ _6426_pe;
                }
              }
              {}
              ++ _6425_pi;
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _6435_rnzi = (int)0;
      int32_t _6436_relmi = (int)0;
      _ptr__6422_ri32[_6417_rptr] = (int)0;
      int32_t _6437_i0 = (int)0;
      while ( (_6437_i0 < _6392_mnnz) )
      {
        {
          int32_t _6438_e0 = safe_add( _6437_i0,(int)1 );
          while ( ((_6438_e0 < _6392_mnnz) && (_ptr__6383_msubi[_6438_e0] == _ptr__6383_msubi[_6437_i0])) )
          {
            {
              ++ _6438_e0;
            }
          }
          int32_t _12062_ = (int)0;
          int32_t _12063_ = _6380_xdim1;
          for (int32_t _6439_j = _12062_; _6439_j < _12063_; ++_6439_j)
          {
            {
              int32_t _12064_ = _6437_i0;
              int32_t _12065_ = _6438_e0;
              for (int32_t _6440_k = _12064_; _6440_k < _12065_; ++_6440_k)
              {
                {
                  _ptr__6423_ri64[safe_add( _6419_rnidxs,_6435_rnzi )] = _ptr__6391_xi64[safe_add( safe_add( _6372_nidxs,safe_mul( _ptr__6384_msubj[_6440_k],_6380_xdim1 ) ),_6439_j )];
                  _ptr__6424_rf64[safe_add( _6421_rcof,_6435_rnzi )] = _ptr__6385_mcof[_6440_k];
                  ++ _6435_rnzi;
                }
              }
              _ptr__6422_ri32[safe_add( safe_add( _6417_rptr,_6436_relmi ),(int)1 )] = _6435_rnzi;
              _ptr__6423_ri64[safe_add( _6420_rsp,_6436_relmi )] = safe_add( safe_mul( _ptr__6383_msubi[_6437_i0],_6380_xdim1 ),_6439_j );
              ++ _6436_relmi;
            }
          }
          _6437_i0 = _6438_e0;
        }
      }
    }
  }
  if ((!_6415_rhassp))
  {
    {
      _6366_rs->popi64(_6389_rnelem);
    }
  }
  {}
  _6368_xs->clear();
}
// End mosek.fusion.ExprMulVar.eval_left

// Begin mosek.fusion.ExprMulVar.validate
// Method mosek.fusion.ExprMulVar.validate @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:222:6-244:7
void mosek::fusion::p_ExprMulVar::validate(int32_t _6441_mdimi,int32_t _6442_mdimj,std::shared_ptr< monty::ndarray< int32_t,1 > > _6443_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _6444_msubj,std::shared_ptr< monty::ndarray< double,1 > > _6445_mcof)
{
  _checked_ptr_1<int32_t> _ptr__6443_msubi(_6443_msubi ? _6443_msubi->raw() : nullptr, _6443_msubi ? _6443_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__6444_msubj(_6444_msubj ? _6444_msubj->raw() : nullptr, _6444_msubj ? _6444_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__6445_mcof(_6445_mcof ? _6445_mcof->raw() : nullptr, _6445_mcof ? _6445_mcof->size(0) : 0);
  bool _6446_ok = true;
  {
    int32_t _12066_ = (int)0;
    int32_t _12067_ = (int)((_6443_msubi)->size(0));
    for (int32_t _6447_i = _12066_; _6447_i < _12067_; ++_6447_i)
    {
      {
        if (((_ptr__6443_msubi[_6447_i] < (int)0) || ((_ptr__6443_msubi[_6447_i] >= _6441_mdimi) || ((_ptr__6444_msubj[_6447_i] < (int)0) || (_ptr__6444_msubj[_6447_i] >= _6442_mdimj)))))
        {
          {
            _6446_ok = false;
          }
        }
        {}
      }
    }
    int32_t _12068_ = (int)1;
    int32_t _12069_ = (int)((_6443_msubi)->size(0));
    for (int32_t _6448_i = _12068_; _6448_i < _12069_; ++_6448_i)
    {
      {
        if (((_ptr__6443_msubi[(_6448_i - (int)1)] > _ptr__6443_msubi[_6448_i]) || ((_ptr__6443_msubi[(_6448_i - (int)1)] == _ptr__6443_msubi[_6448_i]) && (_ptr__6444_msubj[(_6448_i - (int)1)] >= _ptr__6444_msubj[_6448_i]))))
        {
          {
            _6446_ok = false;
          }
        }
        {}
      }
    }
  }
  if ((!_6446_ok))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Invalid matrix data"));
    }
  }
  {}
}
// End mosek.fusion.ExprMulVar.validate

// Begin mosek.fusion.ExprMulVar.resshape
// Method mosek.fusion.ExprMulVar.resshape @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:189:6-194:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprMulVar::resshape(int32_t _6449_mdimi,int32_t _6450_mdimj,std::shared_ptr< monty::ndarray< int32_t,1 > > _6451_xshape,bool _6452_left)
{
  _checked_ptr_1<int32_t> _ptr__6451_xshape(_6451_xshape ? _6451_xshape->raw() : nullptr, _6451_xshape ? _6451_xshape->size(0) : 0);
  if (_6452_left)
  {
    {
      return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_6449_mdimi),(int32_t)(_ptr__6451_xshape[(int)1])});
    }
  }
  else
  {
    {
      return std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__6451_xshape[(int)0]),(int32_t)(_6450_mdimj)});
    }
  }
}
// End mosek.fusion.ExprMulVar.resshape

// Begin mosek.fusion.ExprMulVar.toString
// Method mosek.fusion.ExprMulVar.toString @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:182:6-187:7
std::string mosek::fusion::ExprMulVar :: toString() { return mosek::fusion::p_ExprMulVar::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulVar::toString()
{
  if (left)
  {
    {
      return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulVar(M,"))->__mosek_2fusion_2Utils_2StringBuffer__a(x->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
    }
  }
  else
  {
    {
      return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulVar("))->__mosek_2fusion_2Utils_2StringBuffer__a(x->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",M)"))->toString();
    }
  }
}
// End mosek.fusion.ExprMulVar.toString

void mosek::fusion::p_ExprMulVar::destroy()
{
  x.reset();
  mcof.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulVar::destroy() { mosek::fusion::p_ExprMulVar::_get_impl(this)->destroy(); }
// } class ExprMulVar
// class ExprMulScalarVar { // @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:53:4-167:5
mosek::fusion::ExprMulScalarVar::ExprMulScalarVar(mosek::fusion::p_ExprMulScalarVar *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulScalarVar()" << this << std::endl; */ }
mosek::fusion::ExprMulScalarVar::~ExprMulScalarVar() {  /* std::cout << "~ExprMulScalarVar()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulScalarVar::p_ExprMulScalarVar
  (::mosek::fusion::ExprMulScalarVar * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulScalarVar.ctor @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:89:6-126:7
mosek::fusion::ExprMulScalarVar::t mosek::fusion::p_ExprMulScalarVar::_new_ExprMulScalarVar
  (int32_t _6453_mdimi,
    int32_t _6454_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6455_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6456_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6457_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6458_x)
{ return new mosek::fusion::ExprMulScalarVar(_6453_mdimi,_6454_mdimj,_6455_msubi,_6456_msubj,_6457_mcof,_6458_x); }
mosek::fusion::ExprMulScalarVar::ExprMulScalarVar
  (int32_t _6453_mdimi,
    int32_t _6454_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6455_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6456_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6457_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6458_x) : 
   ExprMulScalarVar(new mosek::fusion::p_ExprMulScalarVar(this))
{ mosek::fusion::p_ExprMulScalarVar::_get_impl(this)->_initialize(_6453_mdimi,_6454_mdimj,_6455_msubi,_6456_msubj,_6457_mcof,_6458_x); }
void mosek::fusion::p_ExprMulScalarVar::_initialize  (int32_t _6453_mdimi,
    int32_t _6454_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6455_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6456_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6457_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6458_x)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6455_msubi(_6455_msubi ? _6455_msubi->raw() : nullptr, _6455_msubi ? _6455_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6456_msubj(_6456_msubj ? _6456_msubj->raw() : nullptr, _6456_msubj ? _6456_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6457_mcof(_6457_mcof ? _6457_mcof->raw() : nullptr, _6457_mcof ? _6457_mcof->size(0) : 0);
    mosek::fusion::p_ExprMulScalarVar::_initialize(_6453_mdimi,_6454_mdimj,::mosek::fusion::Utils::Tools::arraycopy(_6455_msubi),::mosek::fusion::Utils::Tools::arraycopy(_6456_msubj),::mosek::fusion::Utils::Tools::arraycopy(_6457_mcof),_6458_x,(int)1);
    if ((_6458_x->getND() != (int)0))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid Variable size"));
      }
    }
    {}
    if (((_6453_mdimi < (int)0) || ((_6454_mdimj < (int)0) || (((int)((_6455_msubi)->size(0)) != (int)((_6456_msubj)->size(0))) || ((int)((_6455_msubi)->size(0)) != (int)((_6457_mcof)->size(0)))))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Invalid Matrix data"));
      }
    }
    {}
    bool _6459_err_data = false;
    int32_t _12070_ = (int)0;
    int32_t _12071_ = (int)((_6455_msubi)->size(0));
    for (int32_t _6460_i = _12070_; _6460_i < _12071_; ++_6460_i)
    {
      {
        if (((_ptr__6455_msubi[_6460_i] < (int)0) || ((_ptr__6455_msubi[_6460_i] >= _6453_mdimi) || ((_ptr__6456_msubj[_6460_i] < (int)0) || (_ptr__6456_msubj[_6460_i] >= _6454_mdimj)))))
        {
          {
            _6459_err_data = true;
          }
        }
        {}
      }
    }
    if (_6459_err_data)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Invalid Matrix data"));
      }
    }
    {}
    bool _6461_err_sorted = false;
    int32_t _12072_ = (int)1;
    int32_t _12073_ = (int)((_6455_msubi)->size(0));
    for (int32_t _6462_i = _12072_; _6462_i < _12073_; ++_6462_i)
    {
      {
        if (((_ptr__6455_msubi[_6462_i] < _ptr__6455_msubi[(_6462_i - (int)1)]) || ((_ptr__6455_msubi[_6462_i] == _ptr__6455_msubi[(_6462_i - (int)1)]) && (_ptr__6456_msubj[_6462_i] <= _ptr__6456_msubj[(_6462_i - (int)1)]))))
        {
          {
            _6461_err_sorted = true;
          }
        }
        {}
      }
    }
    if (_6461_err_sorted)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("Matrix data not correctly sorted"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprMulScalarVar.ctor

// mosek.fusion.ExprMulScalarVar.ctor @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:68:6-87:7
mosek::fusion::ExprMulScalarVar::t mosek::fusion::p_ExprMulScalarVar::_new_ExprMulScalarVar
  (int32_t _6463_mdimi,
    int32_t _6464_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6465_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6466_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6467_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6468_x,
    int32_t _6469_unchecked_)
{ return new mosek::fusion::ExprMulScalarVar(_6463_mdimi,_6464_mdimj,_6465_msubi,_6466_msubj,_6467_mcof,_6468_x,_6469_unchecked_); }
mosek::fusion::ExprMulScalarVar::ExprMulScalarVar
  (int32_t _6463_mdimi,
    int32_t _6464_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6465_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6466_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6467_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6468_x,
    int32_t _6469_unchecked_) : 
   ExprMulScalarVar(new mosek::fusion::p_ExprMulScalarVar(this))
{ mosek::fusion::p_ExprMulScalarVar::_get_impl(this)->_initialize(_6463_mdimi,_6464_mdimj,_6465_msubi,_6466_msubj,_6467_mcof,_6468_x,_6469_unchecked_); }
void mosek::fusion::p_ExprMulScalarVar::_initialize  (int32_t _6463_mdimi,
    int32_t _6464_mdimj,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6465_msubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6466_msubj,
    std::shared_ptr< monty::ndarray< double,1 > > _6467_mcof,
    monty::rc_ptr< ::mosek::fusion::Variable > _6468_x,
    int32_t _6469_unchecked_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__6465_msubi(_6465_msubi ? _6465_msubi->raw() : nullptr, _6465_msubi ? _6465_msubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__6466_msubj(_6466_msubj ? _6466_msubj->raw() : nullptr, _6466_msubj ? _6466_msubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__6467_mcof(_6467_mcof ? _6467_mcof->raw() : nullptr, _6467_mcof ? _6467_mcof->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_6463_mdimi),(int32_t)(_6464_mdimj)}));
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->mdimi = _6463_mdimi;
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->mdimj = _6464_mdimj;
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->msubi = _6465_msubi;
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->msubj = _6466_msubj;
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->mcof = _6467_mcof;
    mosek::fusion::p_ExprMulScalarVar::_get_impl(::mosek::fusion::ExprMulScalarVar::t(_pubthis))->x = _6468_x;
  }
}
// mosek.fusion.ExprMulScalarVar.ctor

// Begin mosek.fusion.ExprMulScalarVar.eval
// Method mosek.fusion.ExprMulScalarVar.eval @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:128:6-166:7
void mosek::fusion::ExprMulScalarVar :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6470_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6471_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6472_xs) { mosek::fusion::p_ExprMulScalarVar::_get_impl(this)->eval(_6470_rs,_6471_ws,_6472_xs); }
void mosek::fusion::p_ExprMulScalarVar::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6470_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6471_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6472_xs)
{
  if ((x->numInst() == (int)0))
  {
    {
      _6470_rs->alloc_expr((int)2,(int)0,(int)0,false);
      ((*mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i32)(mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->shape_base)) = mdimi;
      ((*mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i32)(safe_add( mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->shape_base,(int)1 ))) = mdimj;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6473_xidxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)1)));
      _checked_ptr_1<int64_t> _ptr__6473_xidxs(_6473_xidxs ? _6473_xidxs->raw() : nullptr,_6473_xidxs ? _6473_xidxs->size(0) : 0);
      x->inst((int)0,_6473_xidxs);
      int64_t _6474_xi = _ptr__6473_xidxs[(int)0];
      int32_t _6475_nelem = (int)((msubi)->size(0));
      int32_t _6476_nnz = _6475_nelem;
      bool _6477_hassp = (_6475_nelem < safe_mul( mdimi,mdimj ));
      _6470_rs->alloc_expr((int)2,_6475_nelem,_6476_nnz,_6477_hassp);
      int32_t _6478_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->ptr_base;
      ((*mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i32)(mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->shape_base)) = mdimi;
      ((*mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i32)(safe_add( mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->shape_base,(int)1 ))) = mdimj;
      int32_t _6479_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->nidxs_base;
      int32_t _6480_sp_base = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->sp_base;
      int32_t _6481_cof_base = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->cof_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6482_i32 = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6482_i32(_6482_i32 ? _6482_i32->raw() : nullptr,_6482_i32 ? _6482_i32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6483_i64 = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6483_i64(_6483_i64 ? _6483_i64->raw() : nullptr,_6483_i64 ? _6483_i64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6484_f64 = mosek::fusion::p_WorkStack::_get_impl(_6470_rs)->f64;
      _checked_ptr_1<double> _ptr__6484_f64(_6484_f64 ? _6484_f64->raw() : nullptr,_6484_f64 ? _6484_f64->size(0) : 0);
      {
        int32_t _12074_ = (int)0;
        int32_t _12075_ = _6476_nnz;
        for (int32_t _6485_i = _12074_; _6485_i < _12075_; ++_6485_i)
        {
          {
            _ptr__6484_f64[safe_add( _6481_cof_base,_6485_i )] = ((*mcof)(_6485_i));
          }
        }
        int32_t _12076_ = (int)0;
        int32_t _12077_ = _6476_nnz;
        for (int32_t _6486_i = _12076_; _6486_i < _12077_; ++_6486_i)
        {
          {
            _ptr__6483_i64[safe_add( _6479_nidxs_base,_6486_i )] = _6474_xi;
          }
        }
        if (_6477_hassp)
        {
          {
            int32_t _12078_ = (int)0;
            int32_t _12079_ = _6475_nelem;
            for (int32_t _6487_i = _12078_; _6487_i < _12079_; ++_6487_i)
            {
              {
                _ptr__6483_i64[safe_add( _6480_sp_base,_6487_i )] = safe_add( safe_mul( ((*msubi)(_6487_i)),mdimj ),((*msubj)(_6487_i)) );
              }
            }
          }
        }
        {}
        int32_t _12080_ = (int)0;
        int32_t _12081_ = safe_add( _6475_nelem,(int)1 );
        for (int32_t _6488_i = _12080_; _6488_i < _12081_; ++_6488_i)
        {
          {
            _ptr__6482_i32[safe_add( _6478_ptr_base,_6488_i )] = _6488_i;
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprMulScalarVar.eval

// Begin mosek.fusion.ExprMulScalarVar.toString
// Method mosek.fusion.ExprMulScalarVar.toString @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:63:6-66:7
std::string mosek::fusion::ExprMulScalarVar :: toString() { return mosek::fusion::p_ExprMulScalarVar::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulScalarVar::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprMulScalarVar(M("))->__mosek_2fusion_2Utils_2StringBuffer__a(mdimi)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(mdimj)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("), "))->__mosek_2fusion_2Utils_2StringBuffer__a(x->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprMulScalarVar.toString

void mosek::fusion::p_ExprMulScalarVar::destroy()
{
  x.reset();
  mcof.reset();
  msubj.reset();
  msubi.reset();
}
void mosek::fusion::ExprMulScalarVar::destroy() { mosek::fusion::p_ExprMulScalarVar::_get_impl(this)->destroy(); }
// } class ExprMulScalarVar
// class ExprMulVarScalarConst { // @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:4:4-50:5
mosek::fusion::ExprMulVarScalarConst::ExprMulVarScalarConst(mosek::fusion::p_ExprMulVarScalarConst *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprMulVarScalarConst()" << this << std::endl; */ }
mosek::fusion::ExprMulVarScalarConst::~ExprMulVarScalarConst() {  /* std::cout << "~ExprMulVarScalarConst()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprMulVarScalarConst::p_ExprMulVarScalarConst
  (::mosek::fusion::ExprMulVarScalarConst * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprMulVarScalarConst.ctor @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:10:6-14:7
mosek::fusion::ExprMulVarScalarConst::t mosek::fusion::p_ExprMulVarScalarConst::_new_ExprMulVarScalarConst
  (monty::rc_ptr< ::mosek::fusion::Variable > _6489_x,
    double _6490_c)
{ return new mosek::fusion::ExprMulVarScalarConst(_6489_x,_6490_c); }
mosek::fusion::ExprMulVarScalarConst::ExprMulVarScalarConst
  (monty::rc_ptr< ::mosek::fusion::Variable > _6489_x,
    double _6490_c) : 
   ExprMulVarScalarConst(new mosek::fusion::p_ExprMulVarScalarConst(this))
{ mosek::fusion::p_ExprMulVarScalarConst::_get_impl(this)->_initialize(_6489_x,_6490_c); }
void mosek::fusion::p_ExprMulVarScalarConst::_initialize  (monty::rc_ptr< ::mosek::fusion::Variable > _6489_x,
    double _6490_c)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_6489_x->getShape());
    mosek::fusion::p_ExprMulVarScalarConst::_get_impl(::mosek::fusion::ExprMulVarScalarConst::t(_pubthis))->x = _6489_x;
    mosek::fusion::p_ExprMulVarScalarConst::_get_impl(::mosek::fusion::ExprMulVarScalarConst::t(_pubthis))->c = _6490_c;
  }
}
// mosek.fusion.ExprMulVarScalarConst.ctor

// Begin mosek.fusion.ExprMulVarScalarConst.eval
// Method mosek.fusion.ExprMulVarScalarConst.eval @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:16:6-49:7
void mosek::fusion::ExprMulVarScalarConst :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6491_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6492_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6493_xs) { mosek::fusion::p_ExprMulVarScalarConst::_get_impl(this)->eval(_6491_rs,_6492_ws,_6493_xs); }
void mosek::fusion::p_ExprMulVarScalarConst::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6491_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6492_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6493_xs)
{
  int32_t _6494_nnz = x->numInst();
  int32_t _6495_nelem = _6494_nnz;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6496_shape = x->getShape();
  _checked_ptr_1<int32_t> _ptr__6496_shape(_6496_shape ? _6496_shape->raw() : nullptr,_6496_shape ? _6496_shape->size(0) : 0);
  int32_t _6497_nd = (int)((_6496_shape)->size(0));
  bool _6498_hassp = (::mosek::fusion::p_Set::size(_6496_shape) > _6495_nelem);
  _6491_rs->alloc_expr(_6497_nd,_6495_nelem,_6494_nnz,_6498_hassp);
  int32_t _6499_ptrb = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->ptr_base;
  int32_t _6500_nidxs = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->nidxs_base;
  int32_t _6501_sp = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->sp_base;
  int32_t _6502_cof = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->cof_base;
  int32_t _6503_rshape = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->shape_base;
  if (_6498_hassp)
  {
    {
      x->inst(_6501_sp,mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->i64,_6500_nidxs,mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->i64);
    }
  }
  else
  {
    {
      x->inst(_6500_nidxs,mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->i64);
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6504_i32 = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__6504_i32(_6504_i32 ? _6504_i32->raw() : nullptr,_6504_i32 ? _6504_i32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6505_i64 = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__6505_i64(_6505_i64 ? _6505_i64->raw() : nullptr,_6505_i64 ? _6505_i64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6506_f64 = mosek::fusion::p_WorkStack::_get_impl(_6491_rs)->f64;
  _checked_ptr_1<double> _ptr__6506_f64(_6506_f64 ? _6506_f64->raw() : nullptr,_6506_f64 ? _6506_f64->size(0) : 0);
  {
    int32_t _12082_ = (int)0;
    int32_t _12083_ = _6497_nd;
    for (int32_t _6507_i = _12082_; _6507_i < _12083_; ++_6507_i)
    {
      {
        _ptr__6504_i32[safe_add( _6503_rshape,_6507_i )] = _ptr__6496_shape[_6507_i];
      }
    }
    int32_t _12084_ = (int)0;
    int32_t _12085_ = safe_add( _6495_nelem,(int)1 );
    for (int32_t _6508_i = _12084_; _6508_i < _12085_; ++_6508_i)
    {
      {
        _ptr__6504_i32[safe_add( _6499_ptrb,_6508_i )] = _6508_i;
      }
    }
    int32_t _12086_ = (int)0;
    int32_t _12087_ = _6494_nnz;
    for (int32_t _6509_i = _12086_; _6509_i < _12087_; ++_6509_i)
    {
      {
        _ptr__6506_f64[safe_add( _6502_cof,_6509_i )] = 1.0;
      }
    }
  }
}
// End mosek.fusion.ExprMulVarScalarConst.eval

// Begin mosek.fusion.ExprMulVarScalarConst.toString
// Method mosek.fusion.ExprMulVarScalarConst.toString @ bld/docker-win/final/default/src/fusion/ExprMulVar.monty:8:6-75
std::string mosek::fusion::ExprMulVarScalarConst :: toString() { return mosek::fusion::p_ExprMulVarScalarConst::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprMulVarScalarConst::toString()
{
  return std::string ("ExprMulVarScalarConst()");
}
// End mosek.fusion.ExprMulVarScalarConst.toString

void mosek::fusion::p_ExprMulVarScalarConst::destroy()
{
  x.reset();
}
void mosek::fusion::ExprMulVarScalarConst::destroy() { mosek::fusion::p_ExprMulVarScalarConst::_get_impl(this)->destroy(); }
// } class ExprMulVarScalarConst
// class ExprAdd { // @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:596:4-1274:5
mosek::fusion::ExprAdd::ExprAdd(mosek::fusion::p_ExprAdd *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprAdd()" << this << std::endl; */ }
mosek::fusion::ExprAdd::~ExprAdd() {  /* std::cout << "~ExprAdd()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprAdd::p_ExprAdd
  (::mosek::fusion::ExprAdd * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprAdd.ctor @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:606:6-619:7
mosek::fusion::ExprAdd::t mosek::fusion::p_ExprAdd::_new_ExprAdd
  (monty::rc_ptr< ::mosek::fusion::Expression > _6510_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6511_e2,
    double _6512_m1,
    double _6513_m2)
{ return new mosek::fusion::ExprAdd(_6510_e1,_6511_e2,_6512_m1,_6513_m2); }
mosek::fusion::ExprAdd::ExprAdd
  (monty::rc_ptr< ::mosek::fusion::Expression > _6510_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6511_e2,
    double _6512_m1,
    double _6513_m2) : 
   ExprAdd(new mosek::fusion::p_ExprAdd(this))
{ mosek::fusion::p_ExprAdd::_get_impl(this)->_initialize(_6510_e1,_6511_e2,_6512_m1,_6513_m2); }
void mosek::fusion::p_ExprAdd::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _6510_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6511_e2,
    double _6512_m1,
    double _6513_m2)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_6510_e1->getShape());
    mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->e1 = _6510_e1;
    mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->e2 = _6511_e2;
    mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m1 = _6512_m1;
    mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m2 = _6513_m2;
    if ((_6510_e1->getND() != _6511_e2->getND()))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
      }
    }
    {}
    int32_t _12088_ = (int)0;
    int32_t _12089_ = _6510_e1->getND();
    for (int32_t _6514_i = _12088_; _6514_i < _12089_; ++_6514_i)
    {
      {
        if ((_6510_e1->getDim(_6514_i) != _6511_e2->getDim(_6514_i)))
        {
          {
            throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
          }
        }
        {}
      }
    }
  }
}
// mosek.fusion.ExprAdd.ctor

// Begin mosek.fusion.ExprAdd.eval
// Method mosek.fusion.ExprAdd.eval @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:621:6-1273:7
void mosek::fusion::ExprAdd :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6515_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6516_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6517_xs) { mosek::fusion::p_ExprAdd::_get_impl(this)->eval(_6515_rs,_6516_ws,_6517_xs); }
void mosek::fusion::p_ExprAdd::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6515_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6516_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6517_xs)
{
  e1->eval(_6516_ws,_6515_rs,_6517_xs);
  e2->eval(_6516_ws,_6515_rs,_6517_xs);
  _6516_ws->pop_expr();
  int32_t _6518_nd2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nd;
  int32_t _6519_shape2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->shape_base;
  int32_t _6520_nelem2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nelem;
  int32_t _6521_nnz2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nnz;
  int32_t _6522_ncodeatom2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->ncodeatom;
  bool _6523_hassp2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->hassp;
  int32_t _6524_ptr2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->ptr_base;
  int32_t _6525_sp2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->sp_base;
  int32_t _6526_nidxs2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nidxs_base;
  int32_t _6527_cof2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->cof_base;
  int32_t _6528_code2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->code_base;
  int32_t _6529_codeptr2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->codeptr_base;
  int32_t _6530_cconst2 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->cconst_base;
  _6516_ws->pop_expr();
  int32_t _6531_nd1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nd;
  int32_t _6532_shape1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->shape_base;
  int32_t _6533_nelem1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nelem;
  int32_t _6534_nnz1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nnz;
  int32_t _6535_ncodeatom1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->ncodeatom;
  bool _6536_hassp1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->hassp;
  int32_t _6537_ptr1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->ptr_base;
  int32_t _6538_sp1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->sp_base;
  int32_t _6539_nidxs1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->nidxs_base;
  int32_t _6540_cof1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->cof_base;
  int32_t _6541_code1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->code_base;
  int32_t _6542_codeptr1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->codeptr_base;
  int32_t _6543_cconst1 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6544_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6544_wi32(_6544_wi32 ? _6544_wi32->raw() : nullptr,_6544_wi32 ? _6544_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6545_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6545_wi64(_6545_wi64 ? _6545_wi64->raw() : nullptr,_6545_wi64 ? _6545_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6546_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6516_ws)->f64;
  _checked_ptr_1<double> _ptr__6546_wf64(_6546_wf64 ? _6546_wf64->raw() : nullptr,_6546_wf64 ? _6546_wf64->size(0) : 0);
  bool _6547_parameterized = ((_6535_ncodeatom1 > (int)0) || (_6522_ncodeatom2 > (int)0));
  if ((_6531_nd1 != _6518_nd2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
    }
  }
  {}
  int32_t _12090_ = (int)0;
  int32_t _12091_ = _6531_nd1;
  for (int32_t _6548_i = _12090_; _6548_i < _12091_; ++_6548_i)
  {
    {
      if ((_ptr__6544_wi32[safe_add( _6532_shape1,_6548_i )] != _ptr__6544_wi32[safe_add( _6519_shape2,_6548_i )]))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
        }
      }
      {}
    }
  }
  if (((!_6536_hassp1) && (!_6523_hassp2)))
  {
    {
      int32_t _6549_rnelem = _6533_nelem1;
      int32_t _6550_rnnz = safe_add( _6534_nnz1,_6521_nnz2 );
      int32_t _6551_rncodeatom = (int)0;
      if (_6547_parameterized)
      {
        {
          int32_t _12092_;
          bool _12093_ = (_6535_ncodeatom1 > (int)0);
          if (_12093_)
          {
            _12092_ = safe_add( _6535_ncodeatom1,safe_mul( _6534_nnz1,(int)2 ) );
          }
          else
          {
            _12092_ = _6534_nnz1;
          }
          _6551_rncodeatom += _12092_;
          int32_t _12094_;
          bool _12095_ = (_6522_ncodeatom2 > (int)0);
          if (_12095_)
          {
            _12094_ = safe_add( _6522_ncodeatom2,safe_mul( _6521_nnz2,(int)2 ) );
          }
          else
          {
            _12094_ = _6521_nnz2;
          }
          _6551_rncodeatom += _12094_;
        }
      }
      {}
      int32_t _6552_rnd = _6531_nd1;
      _6515_rs->alloc_expr(_6552_rnd,_6549_rnelem,_6550_rnnz,false,_6551_rncodeatom);
      int32_t _6553_rshape = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->shape_base;
      int32_t _6554_rptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->ptr_base;
      int32_t _6555_rsp = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->sp_base;
      int32_t _6556_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->nidxs_base;
      int32_t _6557_rcof = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cof_base;
      int32_t _6558_rcode = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->code_base;
      int32_t _6559_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->codeptr_base;
      int32_t _6560_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6561_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6561_ri32(_6561_ri32 ? _6561_ri32->raw() : nullptr,_6561_ri32 ? _6561_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6562_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6562_ri64(_6562_ri64 ? _6562_ri64->raw() : nullptr,_6562_ri64 ? _6562_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6563_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->f64;
      _checked_ptr_1<double> _ptr__6563_rf64(_6563_rf64 ? _6563_rf64->raw() : nullptr,_6563_rf64 ? _6563_rf64->size(0) : 0);
      int32_t _12096_ = (int)0;
      int32_t _12097_ = _6552_rnd;
      for (int32_t _6564_i = _12096_; _6564_i < _12097_; ++_6564_i)
      {
        {
          _ptr__6561_ri32[safe_add( _6553_rshape,_6564_i )] = _ptr__6544_wi32[safe_add( _6532_shape1,_6564_i )];
        }
      }
      int32_t _6565_codei = (int)0;
      int32_t _6566_knz = (int)0;
      if ((_6551_rncodeatom > (int)0))
      {
        {
          _ptr__6561_ri32[_6559_rcodeptr] = (int)0;
        }
      }
      {}
      _ptr__6561_ri32[_6554_rptr] = (int)0;
      int32_t _12098_ = (int)0;
      int32_t _12099_ = _6549_rnelem;
      for (int32_t _6567_i = _12098_; _6567_i < _12099_; ++_6567_i)
      {
        {
          int32_t _12100_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6567_i )];
          int32_t _12101_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6567_i ),(int)1 )];
          for (int32_t _6568_k = _12100_; _6568_k < _12101_; ++_6568_k)
          {
            {
              _ptr__6562_ri64[safe_add( _6556_rnidxs,_6566_knz )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6568_k )];
              _ptr__6563_rf64[safe_add( _6557_rcof,_6566_knz )] = (_ptr__6546_wf64[safe_add( _6540_cof1,_6568_k )] * m1);
              if ((_6535_ncodeatom1 > (int)0))
              {
                {
                  int32_t _12102_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6568_k )];
                  int32_t _12103_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6568_k ),(int)1 )];
                  for (int32_t _6569_l = _12102_; _6569_l < _12103_; ++_6569_l)
                  {
                    {
                      _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6569_l )];
                      _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6569_l )];
                      ++ _6565_codei;
                    }
                  }
                  _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 2;
                  _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = m1;
                  ++ _6565_codei;
                  _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 5;
                  ++ _6565_codei;
                  _ptr__6561_ri32[safe_add( safe_add( _6559_rcodeptr,_6566_knz ),(int)1 )] = _6565_codei;
                }
              }
              else
              {
                {
                  if ((_6551_rncodeatom > (int)0))
                  {
                    {
                      _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 2;
                      _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = 0.0;
                      ++ _6565_codei;
                      _ptr__6561_ri32[safe_add( safe_add( _6559_rcodeptr,_6566_knz ),(int)1 )] = _6565_codei;
                    }
                  }
                  {}
                }
              }
              ++ _6566_knz;
            }
          }
          int32_t _12104_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6567_i )];
          int32_t _12105_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6567_i ),(int)1 )];
          for (int32_t _6570_k = _12104_; _6570_k < _12105_; ++_6570_k)
          {
            {
              _ptr__6562_ri64[safe_add( _6556_rnidxs,_6566_knz )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6570_k )];
              _ptr__6563_rf64[safe_add( _6557_rcof,_6566_knz )] = (_ptr__6546_wf64[safe_add( _6527_cof2,_6570_k )] * m2);
              if ((_6522_ncodeatom2 > (int)0))
              {
                {
                  int32_t _12106_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6570_k )];
                  int32_t _12107_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6570_k ),(int)1 )];
                  for (int32_t _6571_l = _12106_; _6571_l < _12107_; ++_6571_l)
                  {
                    {
                      _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6571_l )];
                      _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6571_l )];
                      ++ _6565_codei;
                    }
                  }
                  _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 2;
                  _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = m2;
                  ++ _6565_codei;
                  _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 5;
                  ++ _6565_codei;
                  _ptr__6561_ri32[safe_add( safe_add( _6559_rcodeptr,_6566_knz ),(int)1 )] = _6565_codei;
                }
              }
              else
              {
                {
                  if ((_6551_rncodeatom > (int)0))
                  {
                    {
                      _ptr__6561_ri32[safe_add( _6558_rcode,_6565_codei )] = 2;
                      _ptr__6563_rf64[safe_add( _6560_rcconst,_6565_codei )] = 0.0;
                      ++ _6565_codei;
                      _ptr__6561_ri32[safe_add( safe_add( _6559_rcodeptr,_6566_knz ),(int)1 )] = _6565_codei;
                    }
                  }
                  {}
                }
              }
              ++ _6566_knz;
            }
          }
          _ptr__6561_ri32[safe_add( safe_add( _6554_rptr,_6567_i ),(int)1 )] = _6566_knz;
        }
      }
    }
  }
  else if(((!_6536_hassp1) || (!_6523_hassp2)))
  {
    {
      if ((!_6523_hassp2))
      {
        {
          int32_t _6572_tnelem = _6520_nelem2;
          int32_t _6573_tnnz = _6521_nnz2;
          int32_t _6574_tptr = _6524_ptr2;
          int32_t _6575_tsp = _6525_sp2;
          int32_t _6576_tnidxs = _6526_nidxs2;
          int32_t _6577_tncodeatom = _6522_ncodeatom2;
          int32_t _6578_tcodeptr = _6529_codeptr2;
          int32_t _6579_tcode = _6528_code2;
          int32_t _6580_tcconst = _6530_cconst2;
          int32_t _6581_tcof = _6527_cof2;
          _6520_nelem2 = _6533_nelem1;
          _6521_nnz2 = _6534_nnz1;
          _6524_ptr2 = _6537_ptr1;
          _6525_sp2 = _6538_sp1;
          _6526_nidxs2 = _6539_nidxs1;
          _6522_ncodeatom2 = _6535_ncodeatom1;
          _6529_codeptr2 = _6542_codeptr1;
          _6528_code2 = _6541_code1;
          _6530_cconst2 = _6543_cconst1;
          _6527_cof2 = _6540_cof1;
          _6533_nelem1 = _6572_tnelem;
          _6534_nnz1 = _6573_tnnz;
          _6537_ptr1 = _6574_tptr;
          _6538_sp1 = _6575_tsp;
          _6539_nidxs1 = _6576_tnidxs;
          _6535_ncodeatom1 = _6577_tncodeatom;
          _6542_codeptr1 = _6578_tcodeptr;
          _6541_code1 = _6579_tcode;
          _6543_cconst1 = _6580_tcconst;
          _6540_cof1 = _6581_tcof;
        }
      }
      {}
      double _12108_;
      bool _12109_ = (!_6536_hassp1);
      if (_12109_)
      {
        _12108_ = mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m1;
      }
      else
      {
        _12108_ = mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m2;
      }
      double _6582_m1 = _12108_;
      double _12110_;
      bool _12111_ = (!_6536_hassp1);
      if (_12111_)
      {
        _12110_ = mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m2;
      }
      else
      {
        _12110_ = mosek::fusion::p_ExprAdd::_get_impl(::mosek::fusion::ExprAdd::t(_pubthis))->m1;
      }
      double _6583_m2 = _12110_;
      int32_t _6584_rnelem = _6533_nelem1;
      int32_t _6585_rnnz = safe_add( _6534_nnz1,_6521_nnz2 );
      int32_t _6586_rnd = _6531_nd1;
      int32_t _6587_rncodeatom = safe_add( _6535_ncodeatom1,_6522_ncodeatom2 );
      if (_6547_parameterized)
      {
        {
          int32_t _12112_;
          bool _12113_ = (_6535_ncodeatom1 > (int)0);
          if (_12113_)
          {
            _12112_ = safe_mul( (int)2,_6534_nnz1 );
          }
          else
          {
            _12112_ = _6534_nnz1;
          }
          _6587_rncodeatom += _12112_;
          int32_t _12114_;
          bool _12115_ = (_6522_ncodeatom2 > (int)0);
          if (_12115_)
          {
            _12114_ = safe_mul( (int)2,_6521_nnz2 );
          }
          else
          {
            _12114_ = _6521_nnz2;
          }
          _6587_rncodeatom += _12114_;
        }
      }
      {}
      _6515_rs->alloc_expr(_6586_rnd,_6584_rnelem,_6585_rnnz,false,_6587_rncodeatom);
      int32_t _6588_rshape = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->shape_base;
      int32_t _6589_rptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->ptr_base;
      int32_t _6590_rsp = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->sp_base;
      int32_t _6591_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->nidxs_base;
      int32_t _6592_rcof = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cof_base;
      int32_t _6593_rcode = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->code_base;
      int32_t _6594_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->codeptr_base;
      int32_t _6595_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6596_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6596_ri32(_6596_ri32 ? _6596_ri32->raw() : nullptr,_6596_ri32 ? _6596_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6597_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6597_ri64(_6597_ri64 ? _6597_ri64->raw() : nullptr,_6597_ri64 ? _6597_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6598_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->f64;
      _checked_ptr_1<double> _ptr__6598_rf64(_6598_rf64 ? _6598_rf64->raw() : nullptr,_6598_rf64 ? _6598_rf64->size(0) : 0);
      {
        int32_t _6599_codei = (int)0;
        int32_t _6600_elmi = (int)0;
        int32_t _6601_nzi = (int)0;
        int32_t _12116_ = (int)0;
        int32_t _12117_ = _6586_rnd;
        for (int32_t _6602_i = _12116_; _6602_i < _12117_; ++_6602_i)
        {
          {
            _ptr__6596_ri32[safe_add( _6588_rshape,_6602_i )] = _ptr__6544_wi32[safe_add( _6532_shape1,_6602_i )];
          }
        }
        _ptr__6596_ri32[_6589_rptr] = (int)0;
        if ((_6587_rncodeatom > (int)0))
        {
          {
            _ptr__6596_ri32[_6594_rcodeptr] = (int)0;
          }
        }
        {}
        int32_t _6603_ii2 = (int)0;
        int32_t _6604_i1 = (int)0;
        while ( ((_6604_i1 < _6533_nelem1) || (_6603_ii2 < _6520_nelem2)) )
        {
          {
            if (((_6604_i1 < _6533_nelem1) && ((_6603_ii2 >= _6520_nelem2) || (_6604_i1 < _ptr__6545_wi64[safe_add( _6525_sp2,_6603_ii2 )]))))
            {
              {
                int32_t _12118_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6604_i1 )];
                int32_t _12119_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6604_i1 ),(int)1 )];
                for (int32_t _6605_j = _12118_; _6605_j < _12119_; ++_6605_j)
                {
                  {
                    _ptr__6597_ri64[safe_add( _6591_rnidxs,_6601_nzi )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6605_j )];
                    _ptr__6598_rf64[safe_add( _6592_rcof,_6601_nzi )] = (_ptr__6546_wf64[safe_add( _6540_cof1,_6605_j )] * _6582_m1);
                    if ((_6535_ncodeatom1 > (int)0))
                    {
                      {
                        int32_t _12120_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6605_j )];
                        int32_t _12121_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6605_j ),(int)1 )];
                        for (int32_t _6606_k = _12120_; _6606_k < _12121_; ++_6606_k)
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6606_k )];
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6606_k )];
                            ++ _6599_codei;
                          }
                        }
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                        _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _6582_m1;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 5;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6587_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = 0.0;
                            ++ _6599_codei;
                            _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6601_nzi;
                  }
                }
                _ptr__6596_ri32[safe_add( safe_add( _6589_rptr,_6600_elmi ),(int)1 )] = _6601_nzi;
                ++ _6604_i1;
              }
            }
            else if(((_6603_ii2 < _6520_nelem2) && ((_6604_i1 >= _6533_nelem1) || (_6604_i1 > _ptr__6545_wi64[safe_add( _6525_sp2,_6603_ii2 )]))))
            {
              {
                int32_t _12122_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6603_ii2 )];
                int32_t _12123_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6603_ii2 ),(int)1 )];
                for (int32_t _6607_j = _12122_; _6607_j < _12123_; ++_6607_j)
                {
                  {
                    _ptr__6597_ri64[safe_add( _6591_rnidxs,_6601_nzi )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6607_j )];
                    _ptr__6598_rf64[safe_add( _6592_rcof,_6601_nzi )] = (_ptr__6546_wf64[safe_add( _6527_cof2,_6607_j )] * _6583_m2);
                    if ((_6522_ncodeatom2 > (int)0))
                    {
                      {
                        int32_t _12124_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6607_j )];
                        int32_t _12125_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6607_j ),(int)1 )];
                        for (int32_t _6608_k = _12124_; _6608_k < _12125_; ++_6608_k)
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6608_k )];
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6608_k )];
                            ++ _6599_codei;
                          }
                        }
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                        _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _6583_m2;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 5;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6587_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = 0.0;
                            ++ _6599_codei;
                            _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6601_nzi;
                  }
                }
                _ptr__6596_ri32[safe_add( safe_add( _6589_rptr,_6600_elmi ),(int)1 )] = _6601_nzi;
                ++ _6603_ii2;
              }
            }
            else
            {
              {
                int32_t _12126_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6604_i1 )];
                int32_t _12127_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6604_i1 ),(int)1 )];
                for (int32_t _6609_j = _12126_; _6609_j < _12127_; ++_6609_j)
                {
                  {
                    _ptr__6597_ri64[safe_add( _6591_rnidxs,_6601_nzi )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6609_j )];
                    _ptr__6598_rf64[safe_add( _6592_rcof,_6601_nzi )] = (_ptr__6546_wf64[safe_add( _6540_cof1,_6609_j )] * _6582_m1);
                    if ((_6535_ncodeatom1 > (int)0))
                    {
                      {
                        int32_t _12128_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6609_j )];
                        int32_t _12129_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6609_j ),(int)1 )];
                        for (int32_t _6610_k = _12128_; _6610_k < _12129_; ++_6610_k)
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6610_k )];
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6610_k )];
                            ++ _6599_codei;
                          }
                        }
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                        _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _6582_m1;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 5;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6587_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = 0.0;
                            ++ _6599_codei;
                            _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6601_nzi;
                  }
                }
                int32_t _12130_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6603_ii2 )];
                int32_t _12131_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6603_ii2 ),(int)1 )];
                for (int32_t _6611_j = _12130_; _6611_j < _12131_; ++_6611_j)
                {
                  {
                    _ptr__6597_ri64[safe_add( _6591_rnidxs,_6601_nzi )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6611_j )];
                    _ptr__6598_rf64[safe_add( _6592_rcof,_6601_nzi )] = (_ptr__6546_wf64[safe_add( _6527_cof2,_6611_j )] * _6583_m2);
                    if ((_6522_ncodeatom2 > (int)0))
                    {
                      {
                        int32_t _12132_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6611_j )];
                        int32_t _12133_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6611_j ),(int)1 )];
                        for (int32_t _6612_k = _12132_; _6612_k < _12133_; ++_6612_k)
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6612_k )];
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6612_k )];
                            ++ _6599_codei;
                          }
                        }
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                        _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = _6583_m2;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 5;
                        ++ _6599_codei;
                        _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6587_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6596_ri32[safe_add( _6593_rcode,_6599_codei )] = 2;
                            _ptr__6598_rf64[safe_add( _6595_rcconst,_6599_codei )] = 0.0;
                            ++ _6599_codei;
                            _ptr__6596_ri32[safe_add( safe_add( _6594_rcodeptr,_6601_nzi ),(int)1 )] = _6599_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6601_nzi;
                  }
                }
                _ptr__6596_ri32[safe_add( safe_add( _6589_rptr,_6600_elmi ),(int)1 )] = _6601_nzi;
                ++ _6604_i1;
                ++ _6603_ii2;
              }
            }
            ++ _6600_elmi;
          }
        }
        if ((_6601_nzi != _6585_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid nnz"));
          }
        }
        {}
        if ((_6599_codei != _6587_rncodeatom))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: invalid codei"));
          }
        }
        {}
      }
    }
  }
  else
  {
    {
      int32_t _6613_rnnz = safe_add( _6534_nnz1,_6521_nnz2 );
      int32_t _6614_rnelem = (int)0;
      int32_t _6615_rnd = _6531_nd1;
      int32_t _6616_rncodeatom = safe_add( _6535_ncodeatom1,_6522_ncodeatom2 );
      if (_6547_parameterized)
      {
        {
          int32_t _12134_;
          bool _12135_ = (_6535_ncodeatom1 > (int)0);
          if (_12135_)
          {
            _12134_ = safe_mul( (int)2,_6534_nnz1 );
          }
          else
          {
            _12134_ = _6534_nnz1;
          }
          _6616_rncodeatom += _12134_;
          int32_t _12136_;
          bool _12137_ = (_6522_ncodeatom2 > (int)0);
          if (_12137_)
          {
            _12136_ = safe_mul( (int)2,_6521_nnz2 );
          }
          else
          {
            _12136_ = _6521_nnz2;
          }
          _6616_rncodeatom += _12136_;
        }
      }
      {}
      int64_t _6617_size = (int64_t)1;
      int32_t _12138_ = (int)0;
      int32_t _12139_ = _6615_rnd;
      for (int32_t _6618_i = _12138_; _6618_i < _12139_; ++_6618_i)
      {
        {
          _6617_size *= _ptr__6544_wi32[safe_add( _6532_shape1,_6618_i )];
        }
      }
      {
        int32_t _6619_i2 = (int)0;
        int32_t _6620_i1 = (int)0;
        while ( ((_6620_i1 < _6533_nelem1) && (_6619_i2 < _6520_nelem2)) )
        {
          {
            if ((_ptr__6545_wi64[safe_add( _6538_sp1,_6620_i1 )] < _ptr__6545_wi64[safe_add( _6525_sp2,_6619_i2 )]))
            {
              {
                ++ _6614_rnelem;
                ++ _6620_i1;
              }
            }
            else if((_ptr__6545_wi64[safe_add( _6538_sp1,_6620_i1 )] > _ptr__6545_wi64[safe_add( _6525_sp2,_6619_i2 )]))
            {
              {
                ++ _6614_rnelem;
                ++ _6619_i2;
              }
            }
            else
            {
              {
                ++ _6614_rnelem;
                ++ _6620_i1;
                ++ _6619_i2;
              }
            }
          }
        }
        _6614_rnelem += (safe_add( (_6533_nelem1 - _6620_i1),_6520_nelem2 ) - _6619_i2);
      }
      bool _6621_rhassp = (_6614_rnelem < _6617_size);
      _6515_rs->alloc_expr(_6615_rnd,_6614_rnelem,_6613_rnnz,_6621_rhassp,_6616_rncodeatom);
      int32_t _6622_rshape = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->shape_base;
      int32_t _6623_rptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->ptr_base;
      int32_t _12140_;
      bool _12141_ = _6621_rhassp;
      if (_12141_)
      {
        _12140_ = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->sp_base;
      }
      else
      {
        _12140_ = _6515_rs->alloci64(_6614_rnelem);
      }
      int32_t _6624_rsp = _12140_;
      int32_t _6625_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->nidxs_base;
      int32_t _6626_rcof = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cof_base;
      int32_t _6627_rcode = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->code_base;
      int32_t _6628_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->codeptr_base;
      int32_t _6629_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6630_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6630_ri32(_6630_ri32 ? _6630_ri32->raw() : nullptr,_6630_ri32 ? _6630_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6631_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6631_ri64(_6631_ri64 ? _6631_ri64->raw() : nullptr,_6631_ri64 ? _6631_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6632_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6515_rs)->f64;
      _checked_ptr_1<double> _ptr__6632_rf64(_6632_rf64 ? _6632_rf64->raw() : nullptr,_6632_rf64 ? _6632_rf64->size(0) : 0);
      int32_t _12142_ = (int)0;
      int32_t _12143_ = _6615_rnd;
      for (int32_t _6633_i = _12142_; _6633_i < _12143_; ++_6633_i)
      {
        {
          _ptr__6630_ri32[safe_add( _6622_rshape,_6633_i )] = _ptr__6544_wi32[safe_add( _6532_shape1,_6633_i )];
        }
      }
      {
        _ptr__6630_ri32[_6623_rptr] = (int)0;
        if ((_6616_rncodeatom > (int)0))
        {
          {
            _ptr__6630_ri32[_6628_rcodeptr] = (int)0;
          }
        }
        {}
        int32_t _6634_codei = (int)0;
        int32_t _6635_pe = (int)0;
        int32_t _6636_p = (int)0;
        int32_t _6637_i2 = (int)0;
        int32_t _6638_i1 = (int)0;
        while ( ((_6638_i1 < _6533_nelem1) && (_6637_i2 < _6520_nelem2)) )
        {
          {
            if ((_ptr__6545_wi64[safe_add( _6538_sp1,_6638_i1 )] < _ptr__6545_wi64[safe_add( _6525_sp2,_6637_i2 )]))
            {
              {
                int32_t _12144_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6638_i1 )];
                int32_t _12145_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6638_i1 ),(int)1 )];
                for (int32_t _6639_j = _12144_; _6639_j < _12145_; ++_6639_j)
                {
                  {
                    _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6639_j )];
                    _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m1 * _ptr__6546_wf64[safe_add( _6540_cof1,_6639_j )]);
                    if ((_6535_ncodeatom1 > (int)0))
                    {
                      {
                        int32_t _12146_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6639_j )];
                        int32_t _12147_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6639_j ),(int)1 )];
                        for (int32_t _6640_k = _12146_; _6640_k < _12147_; ++_6640_k)
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6640_k )];
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6640_k )];
                            ++ _6634_codei;
                          }
                        }
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m1;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6616_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                            ++ _6634_codei;
                            _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6636_p;
                  }
                }
                _ptr__6631_ri64[safe_add( _6624_rsp,_6635_pe )] = _ptr__6545_wi64[safe_add( _6538_sp1,_6638_i1 )];
                _ptr__6630_ri32[safe_add( safe_add( _6623_rptr,_6635_pe ),(int)1 )] = _6636_p;
                ++ _6635_pe;
                ++ _6638_i1;
              }
            }
            else if((_ptr__6545_wi64[safe_add( _6525_sp2,_6637_i2 )] < _ptr__6545_wi64[safe_add( _6538_sp1,_6638_i1 )]))
            {
              {
                int32_t _12148_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6637_i2 )];
                int32_t _12149_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6637_i2 ),(int)1 )];
                for (int32_t _6641_j = _12148_; _6641_j < _12149_; ++_6641_j)
                {
                  {
                    _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6641_j )];
                    _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m2 * _ptr__6546_wf64[safe_add( _6527_cof2,_6641_j )]);
                    if ((_6522_ncodeatom2 > (int)0))
                    {
                      {
                        int32_t _12150_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6641_j )];
                        int32_t _12151_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6641_j ),(int)1 )];
                        for (int32_t _6642_k = _12150_; _6642_k < _12151_; ++_6642_k)
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6642_k )];
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6642_k )];
                            ++ _6634_codei;
                          }
                        }
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m2;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6616_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                            ++ _6634_codei;
                            _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6636_p;
                  }
                }
                _ptr__6631_ri64[safe_add( _6624_rsp,_6635_pe )] = _ptr__6545_wi64[safe_add( _6525_sp2,_6637_i2 )];
                _ptr__6630_ri32[safe_add( safe_add( _6623_rptr,_6635_pe ),(int)1 )] = _6636_p;
                ++ _6635_pe;
                ++ _6637_i2;
              }
            }
            else
            {
              {
                int32_t _12152_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6638_i1 )];
                int32_t _12153_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6638_i1 ),(int)1 )];
                for (int32_t _6643_j = _12152_; _6643_j < _12153_; ++_6643_j)
                {
                  {
                    _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6643_j )];
                    _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m1 * _ptr__6546_wf64[safe_add( _6540_cof1,_6643_j )]);
                    if ((_6535_ncodeatom1 > (int)0))
                    {
                      {
                        int32_t _12154_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6643_j )];
                        int32_t _12155_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6643_j ),(int)1 )];
                        for (int32_t _6644_k = _12154_; _6644_k < _12155_; ++_6644_k)
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6644_k )];
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6644_k )];
                            ++ _6634_codei;
                          }
                        }
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m1;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6616_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                            ++ _6634_codei;
                            _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6636_p;
                  }
                }
                int32_t _12156_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6637_i2 )];
                int32_t _12157_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6637_i2 ),(int)1 )];
                for (int32_t _6645_j = _12156_; _6645_j < _12157_; ++_6645_j)
                {
                  {
                    _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6645_j )];
                    _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m2 * _ptr__6546_wf64[safe_add( _6527_cof2,_6645_j )]);
                    if ((_6522_ncodeatom2 > (int)0))
                    {
                      {
                        int32_t _12158_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6645_j )];
                        int32_t _12159_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6645_j ),(int)1 )];
                        for (int32_t _6646_k = _12158_; _6646_k < _12159_; ++_6646_k)
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6646_k )];
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6646_k )];
                            ++ _6634_codei;
                          }
                        }
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m2;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    else
                    {
                      {
                        if ((_6616_rncodeatom > (int)0))
                        {
                          {
                            _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                            _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                            ++ _6634_codei;
                            _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                          }
                        }
                        {}
                      }
                    }
                    ++ _6636_p;
                  }
                }
                _ptr__6631_ri64[safe_add( _6624_rsp,_6635_pe )] = _ptr__6545_wi64[safe_add( _6538_sp1,_6638_i1 )];
                _ptr__6630_ri32[safe_add( safe_add( _6623_rptr,_6635_pe ),(int)1 )] = _6636_p;
                ++ _6635_pe;
                ++ _6638_i1;
                ++ _6637_i2;
              }
            }
          }
        }
        while ( (_6638_i1 < _6533_nelem1) )
        {
          {
            int32_t _12160_ = _ptr__6544_wi32[safe_add( _6537_ptr1,_6638_i1 )];
            int32_t _12161_ = _ptr__6544_wi32[safe_add( safe_add( _6537_ptr1,_6638_i1 ),(int)1 )];
            for (int32_t _6647_j = _12160_; _6647_j < _12161_; ++_6647_j)
            {
              {
                _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6539_nidxs1,_6647_j )];
                _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m1 * _ptr__6546_wf64[safe_add( _6540_cof1,_6647_j )]);
                if ((_6535_ncodeatom1 > (int)0))
                {
                  {
                    int32_t _12162_ = _ptr__6544_wi32[safe_add( _6542_codeptr1,_6647_j )];
                    int32_t _12163_ = _ptr__6544_wi32[safe_add( safe_add( _6542_codeptr1,_6647_j ),(int)1 )];
                    for (int32_t _6648_k = _12162_; _6648_k < _12163_; ++_6648_k)
                    {
                      {
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6541_code1,_6648_k )];
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6543_cconst1,_6648_k )];
                        ++ _6634_codei;
                      }
                    }
                    _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                    _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m1;
                    ++ _6634_codei;
                    _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                    ++ _6634_codei;
                    _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                  }
                }
                else
                {
                  {
                    if ((_6616_rncodeatom > (int)0))
                    {
                      {
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    {}
                  }
                }
                ++ _6636_p;
              }
            }
            _ptr__6631_ri64[safe_add( _6624_rsp,_6635_pe )] = _ptr__6545_wi64[safe_add( _6538_sp1,_6638_i1 )];
            _ptr__6630_ri32[safe_add( safe_add( _6623_rptr,_6635_pe ),(int)1 )] = _6636_p;
            ++ _6635_pe;
            ++ _6638_i1;
          }
        }
        while ( (_6637_i2 < _6520_nelem2) )
        {
          {
            int32_t _12164_ = _ptr__6544_wi32[safe_add( _6524_ptr2,_6637_i2 )];
            int32_t _12165_ = _ptr__6544_wi32[safe_add( safe_add( _6524_ptr2,_6637_i2 ),(int)1 )];
            for (int32_t _6649_j = _12164_; _6649_j < _12165_; ++_6649_j)
            {
              {
                _ptr__6631_ri64[safe_add( _6625_rnidxs,_6636_p )] = _ptr__6545_wi64[safe_add( _6526_nidxs2,_6649_j )];
                _ptr__6632_rf64[safe_add( _6626_rcof,_6636_p )] = (m2 * _ptr__6546_wf64[safe_add( _6527_cof2,_6649_j )]);
                if ((_6522_ncodeatom2 > (int)0))
                {
                  {
                    int32_t _12166_ = _ptr__6544_wi32[safe_add( _6529_codeptr2,_6649_j )];
                    int32_t _12167_ = _ptr__6544_wi32[safe_add( safe_add( _6529_codeptr2,_6649_j ),(int)1 )];
                    for (int32_t _6650_k = _12166_; _6650_k < _12167_; ++_6650_k)
                    {
                      {
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = _ptr__6544_wi32[safe_add( _6528_code2,_6650_k )];
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = _ptr__6546_wf64[safe_add( _6530_cconst2,_6650_k )];
                        ++ _6634_codei;
                      }
                    }
                    _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                    _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = m2;
                    ++ _6634_codei;
                    _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 5;
                    ++ _6634_codei;
                    _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                  }
                }
                else
                {
                  {
                    if ((_6616_rncodeatom > (int)0))
                    {
                      {
                        _ptr__6630_ri32[safe_add( _6627_rcode,_6634_codei )] = 2;
                        _ptr__6632_rf64[safe_add( _6629_rcconst,_6634_codei )] = (int)0;
                        ++ _6634_codei;
                        _ptr__6630_ri32[safe_add( safe_add( _6628_rcodeptr,_6636_p ),(int)1 )] = _6634_codei;
                      }
                    }
                    {}
                  }
                }
                ++ _6636_p;
              }
            }
            _ptr__6631_ri64[safe_add( _6624_rsp,_6635_pe )] = _ptr__6545_wi64[safe_add( _6525_sp2,_6637_i2 )];
            _ptr__6630_ri32[safe_add( safe_add( _6623_rptr,_6635_pe ),(int)1 )] = _6636_p;
            ++ _6635_pe;
            ++ _6637_i2;
          }
        }
      }
      if ((!_6621_rhassp))
      {
        {
          _6515_rs->popi64(_6614_rnelem);
        }
      }
      {}
    }
  }
}
// End mosek.fusion.ExprAdd.eval

// Begin mosek.fusion.ExprAdd.toString
// Method mosek.fusion.ExprAdd.toString @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:602:6-604:7
std::string mosek::fusion::ExprAdd :: toString() { return mosek::fusion::p_ExprAdd::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprAdd::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprAdd("))->__mosek_2fusion_2Utils_2StringBuffer__a(e1->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(e2->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("; "))->__mosek_2fusion_2Utils_2StringBuffer__a(m1)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(m2)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprAdd.toString

void mosek::fusion::p_ExprAdd::destroy()
{
  e2.reset();
  e1.reset();
}
void mosek::fusion::ExprAdd::destroy() { mosek::fusion::p_ExprAdd::_get_impl(this)->destroy(); }
// } class ExprAdd
// class ExprWSum { // @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:240:4-593:5
mosek::fusion::ExprWSum::ExprWSum(mosek::fusion::p_ExprWSum *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprWSum()" << this << std::endl; */ }
mosek::fusion::ExprWSum::~ExprWSum() {  /* std::cout << "~ExprWSum()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprWSum::p_ExprWSum
  (::mosek::fusion::ExprWSum * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprWSum.ctor @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:254:6-275:7
mosek::fusion::ExprWSum::t mosek::fusion::p_ExprWSum::_new_ExprWSum
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _6651_es,
    std::shared_ptr< monty::ndarray< double,1 > > _6652_w)
{ return new mosek::fusion::ExprWSum(_6651_es,_6652_w); }
mosek::fusion::ExprWSum::ExprWSum
  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _6651_es,
    std::shared_ptr< monty::ndarray< double,1 > > _6652_w) : 
   ExprWSum(new mosek::fusion::p_ExprWSum(this))
{ mosek::fusion::p_ExprWSum::_get_impl(this)->_initialize(_6651_es,_6652_w); }
void mosek::fusion::p_ExprWSum::_initialize  (std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _6651_es,
    std::shared_ptr< monty::ndarray< double,1 > > _6652_w)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__6652_w(_6652_w ? _6652_w->raw() : nullptr, _6652_w ? _6652_w->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(((*_6651_es)((int)0))->getShape());
    if (((int)((_6652_w)->size(0)) != (int)((_6651_es)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Mismatching weights and expressions array lengths"));
      }
    }
    {}
    mosek::fusion::p_ExprWSum::_get_impl(::mosek::fusion::ExprWSum::t(_pubthis))->w = ::mosek::fusion::Utils::Tools::arraycopy(_6652_w);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6653_shape = ((*_6651_es)((int)0))->getShape();
    _checked_ptr_1<int32_t> _ptr__6653_shape(_6653_shape ? _6653_shape->raw() : nullptr,_6653_shape ? _6653_shape->size(0) : 0);
    int32_t _6654_nd = (int)((_6653_shape)->size(0));
    int32_t _12168_ = (int)1;
    int32_t _12169_ = (int)((_6651_es)->size(0));
    for (int32_t _6655_i = _12168_; _6655_i < _12169_; ++_6655_i)
    {
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _6656_eshape = ((*_6651_es)(_6655_i))->getShape();
        _checked_ptr_1<int32_t> _ptr__6656_eshape(_6656_eshape ? _6656_eshape->raw() : nullptr,_6656_eshape ? _6656_eshape->size(0) : 0);
        if ((_6654_nd != (int)((_6656_eshape)->size(0))))
        {
          {
            throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression shapes"));
          }
        }
        else
        {
          {
            int32_t _12170_ = (int)0;
            int32_t _12171_ = _6654_nd;
            for (int32_t _6657_j = _12170_; _6657_j < _12171_; ++_6657_j)
            {
              {
                if ((_ptr__6653_shape[_6657_j] != _ptr__6656_eshape[_6657_j]))
                {
                  {
                    throw ::mosek::fusion::DimensionError(std::string ("Mismatching expression shapes"));
                  }
                }
                {}
              }
            }
          }
        }
      }
    }
    std::vector<monty::rc_ptr< ::mosek::fusion::Expression >> _12172_;
    for (int32_t _6658_i = (int)0, _12173_ = (int)((_6651_es)->size(0)); _6658_i < _12173_ ; ++_6658_i)
    {
      _12172_.push_back(((*_6651_es)(_6658_i)));
    }
    auto _12174_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_12172_.size()),_12172_.begin(),_12172_.end()));
    mosek::fusion::p_ExprWSum::_get_impl(::mosek::fusion::ExprWSum::t(_pubthis))->es = _12174_;
  }
}
// mosek.fusion.ExprWSum.ctor

// Begin mosek.fusion.ExprWSum.eval
// Method mosek.fusion.ExprWSum.eval @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:277:6-592:7
void mosek::fusion::ExprWSum :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6659_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6660_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6661_xs) { mosek::fusion::p_ExprWSum::_get_impl(this)->eval(_6659_rs,_6660_ws,_6661_xs); }
void mosek::fusion::p_ExprWSum::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6659_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6660_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6661_xs)
{
  int32_t _6662_n = (int)((es)->size(0));
  int32_t _12175_ = (int)0;
  int32_t _12176_ = _6662_n;
  for (int32_t _6663_i = _12175_; _6663_i < _12176_; ++_6663_i)
  {
    {
      ((*es)(_6663_i))->eval(_6660_ws,_6659_rs,_6661_xs);
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6664_nd = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6664_nd(_6664_nd ? _6664_nd->raw() : nullptr,_6664_nd ? _6664_nd->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6665_nelem = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6665_nelem(_6665_nelem ? _6665_nelem->raw() : nullptr,_6665_nelem ? _6665_nelem->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6666_nnz = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6666_nnz(_6666_nnz ? _6666_nnz->raw() : nullptr,_6666_nnz ? _6666_nnz->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6667_ncodeatom = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6667_ncodeatom(_6667_ncodeatom ? _6667_ncodeatom->raw() : nullptr,_6667_ncodeatom ? _6667_ncodeatom->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6668_ptr_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6668_ptr_base(_6668_ptr_base ? _6668_ptr_base->raw() : nullptr,_6668_ptr_base ? _6668_ptr_base->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6669_nidxs_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6669_nidxs_base(_6669_nidxs_base ? _6669_nidxs_base->raw() : nullptr,_6669_nidxs_base ? _6669_nidxs_base->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6670_sp_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6670_sp_base(_6670_sp_base ? _6670_sp_base->raw() : nullptr,_6670_sp_base ? _6670_sp_base->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6671_cof_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6671_cof_base(_6671_cof_base ? _6671_cof_base->raw() : nullptr,_6671_cof_base ? _6671_cof_base->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6672_shape_base = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6672_shape_base(_6672_shape_base ? _6672_shape_base->raw() : nullptr,_6672_shape_base ? _6672_shape_base->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6673_code = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6673_code(_6673_code ? _6673_code->raw() : nullptr,_6673_code ? _6673_code->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6674_codeptr = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6674_codeptr(_6674_codeptr ? _6674_codeptr->raw() : nullptr,_6674_codeptr ? _6674_codeptr->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6675_cconst = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
  _checked_ptr_1<int32_t> _ptr__6675_cconst(_6675_cconst ? _6675_cconst->raw() : nullptr,_6675_cconst ? _6675_cconst->size(0) : 0);
  std::shared_ptr< monty::ndarray< bool,1 > > _6676_hassp = std::shared_ptr< monty::ndarray< bool,1 > >(new monty::ndarray< bool,1 >(monty::shape(_6662_n)));
  int32_t _12177_ = (int)0;
  int32_t _12178_ = _6662_n;
  for (int32_t _6677_i = _12177_; _6677_i < _12178_; ++_6677_i)
  {
    {
      _6660_ws->pop_expr();
      _ptr__6664_nd[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->nd;
      _ptr__6665_nelem[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->nelem;
      _ptr__6666_nnz[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->nnz;
      _ptr__6667_ncodeatom[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->ncodeatom;
      _ptr__6668_ptr_base[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->ptr_base;
      _ptr__6670_sp_base[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->sp_base;
      _ptr__6669_nidxs_base[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->nidxs_base;
      _ptr__6671_cof_base[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->cof_base;
      _ptr__6672_shape_base[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->shape_base;
      _ptr__6673_code[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->code_base;
      _ptr__6674_codeptr[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->codeptr_base;
      _ptr__6675_cconst[((_6662_n - (int)1) - _6677_i)] = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->cconst_base;
      ((*_6676_hassp)(((_6662_n - (int)1) - _6677_i))) = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->hassp;
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6678_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6678_wi32(_6678_wi32 ? _6678_wi32->raw() : nullptr,_6678_wi32 ? _6678_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6679_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6679_wi64(_6679_wi64 ? _6679_wi64->raw() : nullptr,_6679_wi64 ? _6679_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6680_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6660_ws)->f64;
  _checked_ptr_1<double> _ptr__6680_wf64(_6680_wf64 ? _6680_wf64->raw() : nullptr,_6680_wf64 ? _6680_wf64->size(0) : 0);
  {
    bool _6681_ok = true;
    int32_t _12179_ = (int)1;
    int32_t _12180_ = _6662_n;
    for (int32_t _6682_i = _12179_; _6682_i < _12180_; ++_6682_i)
    {
      {
        _6681_ok = (_6681_ok && (_ptr__6664_nd[(int)0] == _ptr__6664_nd[_6682_i]));
        int32_t _12181_ = (int)0;
        int32_t _12182_ = _ptr__6664_nd[(int)0];
        for (int32_t _6683_j = _12181_; _6683_j < _12182_; ++_6683_j)
        {
          {
            _6681_ok = (_6681_ok && (_ptr__6678_wi32[safe_add( _ptr__6672_shape_base[(int)0],_6683_j )] == _ptr__6678_wi32[safe_add( _ptr__6672_shape_base[_6682_i],_6683_j )]));
          }
        }
      }
    }
    if ((!_6681_ok))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
      }
    }
    {}
  }
  std::vector<int32_t> _12183_;
  for (int32_t _6685_j = (int)0, _12184_ = _ptr__6664_nd[(int)0]; _6685_j < _12184_ ; ++_6685_j)
  {
    _12183_.push_back(_ptr__6678_wi32[safe_add( _ptr__6672_shape_base[(int)0],_6685_j )]);
  }
  auto _12185_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12183_.size()),_12183_.begin(),_12183_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6684_wshape = _12185_;
  _checked_ptr_1<int32_t> _ptr__6684_wshape(_6684_wshape ? _6684_wshape->raw() : nullptr,_6684_wshape ? _6684_wshape->size(0) : 0);
  bool _6686_anydense = false;
  int32_t _12186_ = (int)0;
  int32_t _12187_ = _6662_n;
  for (int32_t _6687_i = _12186_; _6687_i < _12187_; ++_6687_i)
  {
    {
      if ((!((*_6676_hassp)(_6687_i))))
      {
        {
          _6686_anydense = true;
        }
      }
      {}
    }
  }
  bool _6688_anycodeatom = false;
  int32_t _12188_ = (int)0;
  int32_t _12189_ = _6662_n;
  for (int32_t _6689_i = _12188_; _6689_i < _12189_; ++_6689_i)
  {
    {
      if ((_ptr__6667_ncodeatom[_6689_i] > (int)0))
      {
        {
          _6688_anycodeatom = true;
        }
      }
      {}
    }
  }
  int32_t _6690_rncodeatom = (int)0;
  int32_t _6691_rnelem = (int)0;
  int32_t _6692_rnnz = (int)0;
  if (_6686_anydense)
  {
    {
      _6691_rnelem = (int32_t)::mosek::fusion::p_Set::size(_6684_wshape);
      int32_t _12190_ = (int)0;
      int32_t _12191_ = _6662_n;
      for (int32_t _6693_i = _12190_; _6693_i < _12191_; ++_6693_i)
      {
        {
          _6692_rnnz += _ptr__6666_nnz[_6693_i];
          if (_6688_anycodeatom)
          {
            {
              int32_t _12192_;
              bool _12193_ = (_ptr__6667_ncodeatom[_6693_i] > (int)0);
              if (_12193_)
              {
                _12192_ = safe_add( _ptr__6667_ncodeatom[_6693_i],safe_mul( (int)2,_ptr__6666_nnz[_6693_i] ) );
              }
              else
              {
                _12192_ = _ptr__6666_nnz[_6693_i];
              }
              _6690_rncodeatom += _12192_;
            }
          }
          {}
        }
      }
    }
  }
  else
  {
    {
      bool _6694_done = false;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6695_ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
      _checked_ptr_1<int32_t> _ptr__6695_ii(_6695_ii ? _6695_ii->raw() : nullptr,_6695_ii ? _6695_ii->size(0) : 0);
      int32_t _12194_ = (int)0;
      int32_t _12195_ = _6662_n;
      for (int32_t _6696_i = _12194_; _6696_i < _12195_; ++_6696_i)
      {
        {
          _6692_rnnz += _ptr__6666_nnz[_6696_i];
          if (_6688_anycodeatom)
          {
            {
              int32_t _12196_;
              bool _12197_ = (_ptr__6667_ncodeatom[_6696_i] > (int)0);
              if (_12197_)
              {
                _12196_ = safe_add( _ptr__6667_ncodeatom[_6696_i],safe_mul( (int)2,_ptr__6666_nnz[_6696_i] ) );
              }
              else
              {
                _12196_ = _ptr__6666_nnz[_6696_i];
              }
              _6690_rncodeatom += _12196_;
            }
          }
          {}
        }
      }
      while ( (!_6694_done) )
      {
        {
          int64_t _6697_min_i = (-(int)1);
          int32_t _12198_ = (int)0;
          int32_t _12199_ = _6662_n;
          for (int32_t _6698_j = _12198_; _6698_j < _12199_; ++_6698_j)
          {
            {
              if (((_ptr__6695_ii[_6698_j] < _ptr__6665_nelem[_6698_j]) && ((_6697_min_i < (int)0) || (_ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6698_j],_ptr__6695_ii[_6698_j] )] < _6697_min_i))))
              {
                {
                  _6697_min_i = _ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6698_j],_ptr__6695_ii[_6698_j] )];
                }
              }
              {}
            }
          }
          if ((_6697_min_i < (int)0))
          {
            {
              _6694_done = true;
            }
          }
          else
          {
            {
              int32_t _12200_ = (int)0;
              int32_t _12201_ = _6662_n;
              for (int32_t _6699_j = _12200_; _6699_j < _12201_; ++_6699_j)
              {
                {
                  if (((_ptr__6695_ii[_6699_j] < _ptr__6665_nelem[_6699_j]) && (_6697_min_i == _ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6699_j],_ptr__6695_ii[_6699_j] )])))
                  {
                    {
                      ++ _ptr__6695_ii[_6699_j];
                    }
                  }
                  {}
                }
              }
              ++ _6691_rnelem;
            }
          }
        }
      }
    }
  }
  _6659_rs->alloc_expr(_ptr__6664_nd[(int)0],_6691_rnelem,_6692_rnnz,(!_6686_anydense),_6690_rncodeatom);
  int32_t _6700_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->ptr_base;
  int32_t _6701_rnidxs_base = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->nidxs_base;
  int32_t _6702_rsp_base = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->sp_base;
  int32_t _6703_rshape = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->shape_base;
  int32_t _6704_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->cof_base;
  int32_t _6705_rcode = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->code_base;
  int32_t _6706_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->codeptr_base;
  int32_t _6707_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6708_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__6708_ri32(_6708_ri32 ? _6708_ri32->raw() : nullptr,_6708_ri32 ? _6708_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6709_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__6709_ri64(_6709_ri64 ? _6709_ri64->raw() : nullptr,_6709_ri64 ? _6709_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6710_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6659_rs)->f64;
  _checked_ptr_1<double> _ptr__6710_rf64(_6710_rf64 ? _6710_rf64->raw() : nullptr,_6710_rf64 ? _6710_rf64->size(0) : 0);
  int32_t _12202_ = (int)0;
  int32_t _12203_ = _ptr__6664_nd[(int)0];
  for (int32_t _6711_i = _12202_; _6711_i < _12203_; ++_6711_i)
  {
    {
      _ptr__6708_ri32[safe_add( _6703_rshape,_6711_i )] = _ptr__6678_wi32[safe_add( _ptr__6672_shape_base[(int)0],_6711_i )];
    }
  }
  if ((_6690_rncodeatom > (int)0))
  {
    {
      _ptr__6708_ri32[_6706_rcodeptr] = (int)0;
    }
  }
  {}
  int32_t _12204_ = (int)0;
  int32_t _12205_ = safe_add( _6691_rnelem,(int)1 );
  for (int32_t _6712_i = _12204_; _6712_i < _12205_; ++_6712_i)
  {
    {
      _ptr__6708_ri32[safe_add( _6700_rptr_base,_6712_i )] = (int)0;
    }
  }
  if (_6686_anydense)
  {
    {
      int32_t _6713_xcodeptr = (-(int)9999);
      if ((_6690_rncodeatom > (int)0))
      {
        {
          _6713_xcodeptr = _6661_xs->alloci32(safe_add( _6691_rnelem,(int)1 ));
        }
      }
      {}
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6714_xi32 = mosek::fusion::p_WorkStack::_get_impl(_6661_xs)->i32;
      _checked_ptr_1<int32_t> _ptr__6714_xi32(_6714_xi32 ? _6714_xi32->raw() : nullptr,_6714_xi32 ? _6714_xi32->size(0) : 0);
      if ((_6690_rncodeatom > (int)0))
      {
        {
          int32_t _12206_ = (int)0;
          int32_t _12207_ = safe_add( _6691_rnelem,(int)1 );
          for (int32_t _6715_i = _12206_; _6715_i < _12207_; ++_6715_i)
          {
            {
              _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6715_i )] = (int)0;
            }
          }
        }
      }
      {}
      int32_t _12208_ = (int)0;
      int32_t _12209_ = _6662_n;
      for (int32_t _6716_i = _12208_; _6716_i < _12209_; ++_6716_i)
      {
        {
          if (((*_6676_hassp)(_6716_i)))
          {
            {
              int32_t _12210_ = (int)0;
              int32_t _12211_ = _ptr__6665_nelem[_6716_i];
              for (int32_t _6717_j = _12210_; _6717_j < _12211_; ++_6717_j)
              {
                {
                  _ptr__6708_ri32[safe_add( safe_add( _6700_rptr_base,_ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6716_i],_6717_j )] ),(int)1 )] += (_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6717_j ),(int)1 )] - _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6717_j )]);
                }
              }
              if ((_ptr__6667_ncodeatom[_6716_i] > (int)0))
              {
                {
                  int32_t _12212_ = (int)0;
                  int32_t _12213_ = _ptr__6665_nelem[_6716_i];
                  for (int32_t _6718_j = _12212_; _6718_j < _12213_; ++_6718_j)
                  {
                    {
                      _ptr__6714_xi32[safe_add( safe_add( _6713_xcodeptr,_ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6716_i],_6718_j )] ),(int)1 )] += safe_add( (_ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6716_i],_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6718_j ),(int)1 )] )] - _ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6716_i],_ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6718_j )] )]),safe_mul( (int)2,(_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6718_j ),(int)1 )] - _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6718_j )]) ) );
                    }
                  }
                }
              }
              else if(_6688_anycodeatom)
              {
                {
                  int32_t _12214_ = (int)0;
                  int32_t _12215_ = _ptr__6665_nelem[_6716_i];
                  for (int32_t _6719_j = _12214_; _6719_j < _12215_; ++_6719_j)
                  {
                    {
                      _ptr__6714_xi32[safe_add( safe_add( _6713_xcodeptr,_ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6716_i],_6719_j )] ),(int)1 )] += (int)1;
                    }
                  }
                }
              }
              {}
            }
          }
          else
          {
            {
              int32_t _12216_ = (int)0;
              int32_t _12217_ = _ptr__6665_nelem[_6716_i];
              for (int32_t _6720_j = _12216_; _6720_j < _12217_; ++_6720_j)
              {
                {
                  _ptr__6708_ri32[safe_add( safe_add( _6700_rptr_base,_6720_j ),(int)1 )] += (_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6720_j ),(int)1 )] - _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6720_j )]);
                }
              }
              if ((_ptr__6667_ncodeatom[_6716_i] > (int)0))
              {
                {
                  int32_t _12218_ = (int)0;
                  int32_t _12219_ = _ptr__6665_nelem[_6716_i];
                  for (int32_t _6721_j = _12218_; _6721_j < _12219_; ++_6721_j)
                  {
                    {
                      _ptr__6714_xi32[safe_add( safe_add( _6713_xcodeptr,_6721_j ),(int)1 )] += safe_add( (_ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6716_i],_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6721_j ),(int)1 )] )] - _ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6716_i],_ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6721_j )] )]),safe_mul( (int)2,(_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6721_j ),(int)1 )] - _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6721_j )]) ) );
                    }
                  }
                }
              }
              else if(_6688_anycodeatom)
              {
                {
                  int32_t _12220_ = (int)0;
                  int32_t _12221_ = _ptr__6665_nelem[_6716_i];
                  for (int32_t _6722_j = _12220_; _6722_j < _12221_; ++_6722_j)
                  {
                    {
                      _ptr__6714_xi32[safe_add( safe_add( _6713_xcodeptr,_6722_j ),(int)1 )] += (_ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6716_i],_6722_j ),(int)1 )] - _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6716_i],_6722_j )]);
                    }
                  }
                }
              }
              {}
            }
          }
        }
      }
      int32_t _12222_ = (int)0;
      int32_t _12223_ = _6691_rnelem;
      for (int32_t _6723_i = _12222_; _6723_i < _12223_; ++_6723_i)
      {
        {
          _ptr__6708_ri32[safe_add( safe_add( _6700_rptr_base,_6723_i ),(int)1 )] += _ptr__6708_ri32[safe_add( _6700_rptr_base,_6723_i )];
        }
      }
      if ((_6690_rncodeatom > (int)0))
      {
        {
          int32_t _12224_ = (int)0;
          int32_t _12225_ = _6691_rnelem;
          for (int32_t _6724_i = _12224_; _6724_i < _12225_; ++_6724_i)
          {
            {
              _ptr__6714_xi32[safe_add( safe_add( _6713_xcodeptr,_6724_i ),(int)1 )] += _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6724_i )];
            }
          }
        }
      }
      {}
      int32_t _12226_ = (int)0;
      int32_t _12227_ = _6662_n;
      for (int32_t _6725_i = _12226_; _6725_i < _12227_; ++_6725_i)
      {
        {
          if (((*_6676_hassp)(_6725_i)))
          {
            {
              int32_t _12228_ = (int)0;
              int32_t _12229_ = _ptr__6665_nelem[_6725_i];
              for (int32_t _6726_j = _12228_; _6726_j < _12229_; ++_6726_j)
              {
                {
                  int32_t _6727_p0 = _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6725_i],_6726_j )];
                  int32_t _6728_p1 = _ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6725_i],_6726_j ),(int)1 )];
                  int64_t _6729_rii = _ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6725_i],_6726_j )];
                  int32_t _6730_b = _ptr__6708_ri32[safe_add( _6700_rptr_base,_6729_rii )];
                  int32_t _12230_;
                  bool _12231_ = _6688_anycodeatom;
                  if (_12231_)
                  {
                    _12230_ = _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6729_rii )];
                  }
                  else
                  {
                    _12230_ = (-(int)10000);
                  }
                  int32_t _6731_codei = _12230_;
                  int32_t _12232_ = _6727_p0;
                  int32_t _12233_ = _6728_p1;
                  for (int32_t _6732_k = _12232_; _6732_k < _12233_; ++_6732_k)
                  {
                    {
                      _ptr__6709_ri64[safe_add( _6701_rnidxs_base,_6730_b )] = _ptr__6679_wi64[safe_add( _ptr__6669_nidxs_base[_6725_i],_6732_k )];
                      _ptr__6710_rf64[safe_add( _6704_rcof_base,_6730_b )] = (((*w)(_6725_i)) * _ptr__6680_wf64[safe_add( _ptr__6671_cof_base[_6725_i],_6732_k )]);
                      if (_6688_anycodeatom)
                      {
                        {
                          if ((_ptr__6667_ncodeatom[_6725_i] > (int)0))
                          {
                            {
                              int32_t _12234_ = _ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6725_i],_6732_k )];
                              int32_t _12235_ = _ptr__6678_wi32[safe_add( safe_add( _ptr__6674_codeptr[_6725_i],_6732_k ),(int)1 )];
                              for (int32_t _6733_l = _12234_; _6733_l < _12235_; ++_6733_l)
                              {
                                {
                                  _ptr__6708_ri32[safe_add( _6705_rcode,_6731_codei )] = _ptr__6678_wi32[safe_add( _ptr__6673_code[_6725_i],_6733_l )];
                                  _ptr__6710_rf64[safe_add( _6707_rcconst,_6731_codei )] = _ptr__6680_wf64[safe_add( _ptr__6675_cconst[_6725_i],_6733_l )];
                                  ++ _6731_codei;
                                }
                              }
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6731_codei )] = 2;
                              _ptr__6710_rf64[safe_add( _6707_rcconst,_6731_codei )] = ((*w)(_6725_i));
                              ++ _6731_codei;
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6731_codei )] = 5;
                              ++ _6731_codei;
                            }
                          }
                          else
                          {
                            {
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6731_codei )] = 2;
                              _ptr__6710_rf64[safe_add( _6707_rcconst,_6731_codei )] = 0.0;
                              ++ _6731_codei;
                            }
                          }
                          _ptr__6708_ri32[safe_add( safe_add( _6706_rcodeptr,_6730_b ),(int)1 )] = _6731_codei;
                        }
                      }
                      {}
                      ++ _6730_b;
                    }
                  }
                  if (_6688_anycodeatom)
                  {
                    {
                      _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6729_rii )] = _6731_codei;
                    }
                  }
                  {}
                  _ptr__6708_ri32[safe_add( _6700_rptr_base,_6729_rii )] += (_6728_p1 - _6727_p0);
                }
              }
            }
          }
          else
          {
            {
              int32_t _12236_ = (int)0;
              int32_t _12237_ = _ptr__6665_nelem[_6725_i];
              for (int32_t _6734_j = _12236_; _6734_j < _12237_; ++_6734_j)
              {
                {
                  int32_t _6735_p0 = _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6725_i],_6734_j )];
                  int32_t _6736_p1 = _ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6725_i],_6734_j ),(int)1 )];
                  int32_t _6737_rii = _6734_j;
                  int32_t _6738_b = _ptr__6708_ri32[safe_add( _6700_rptr_base,_6737_rii )];
                  int32_t _12238_;
                  bool _12239_ = _6688_anycodeatom;
                  if (_12239_)
                  {
                    _12238_ = _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6737_rii )];
                  }
                  else
                  {
                    _12238_ = (-(int)10000);
                  }
                  int32_t _6739_codei = _12238_;
                  int32_t _12240_ = _6735_p0;
                  int32_t _12241_ = _6736_p1;
                  for (int32_t _6740_k = _12240_; _6740_k < _12241_; ++_6740_k)
                  {
                    {
                      _ptr__6709_ri64[safe_add( _6701_rnidxs_base,_6738_b )] = _ptr__6679_wi64[safe_add( _ptr__6669_nidxs_base[_6725_i],_6740_k )];
                      _ptr__6710_rf64[safe_add( _6704_rcof_base,_6738_b )] = (((*w)(_6725_i)) * _ptr__6680_wf64[safe_add( _ptr__6671_cof_base[_6725_i],_6740_k )]);
                      if (_6688_anycodeatom)
                      {
                        {
                          if ((_ptr__6667_ncodeatom[_6725_i] > (int)0))
                          {
                            {
                              int32_t _12242_ = _ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6725_i],_6740_k )];
                              int32_t _12243_ = _ptr__6678_wi32[safe_add( safe_add( _ptr__6674_codeptr[_6725_i],_6740_k ),(int)1 )];
                              for (int32_t _6741_l = _12242_; _6741_l < _12243_; ++_6741_l)
                              {
                                {
                                  _ptr__6708_ri32[safe_add( _6705_rcode,_6739_codei )] = _ptr__6678_wi32[safe_add( _ptr__6673_code[_6725_i],_6741_l )];
                                  _ptr__6710_rf64[safe_add( _6707_rcconst,_6739_codei )] = _ptr__6680_wf64[safe_add( _ptr__6675_cconst[_6725_i],_6741_l )];
                                  ++ _6739_codei;
                                }
                              }
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6739_codei )] = 2;
                              _ptr__6710_rf64[safe_add( _6707_rcconst,_6739_codei )] = ((*w)(_6725_i));
                              ++ _6739_codei;
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6739_codei )] = 5;
                              ++ _6739_codei;
                            }
                          }
                          else
                          {
                            {
                              _ptr__6708_ri32[safe_add( _6705_rcode,_6739_codei )] = 2;
                              _ptr__6710_rf64[safe_add( _6707_rcconst,_6739_codei )] = 0.0;
                              ++ _6739_codei;
                            }
                          }
                          _ptr__6708_ri32[safe_add( safe_add( _6706_rcodeptr,_6738_b ),(int)1 )] = _6739_codei;
                        }
                      }
                      {}
                      ++ _6738_b;
                    }
                  }
                  if (_6688_anycodeatom)
                  {
                    {
                      _ptr__6714_xi32[safe_add( _6713_xcodeptr,_6737_rii )] = _6739_codei;
                    }
                  }
                  {}
                  _ptr__6708_ri32[safe_add( _6700_rptr_base,_6737_rii )] += (_6736_p1 - _6735_p0);
                }
              }
            }
          }
        }
      }
      int32_t _12244_ = (int)0;
      int32_t _12245_ = _6691_rnelem;
      for (int32_t _6742_i = _12244_; _6742_i < _12245_; ++_6742_i)
      {
        {
          _ptr__6708_ri32[(safe_add( _6700_rptr_base,_6691_rnelem ) - _6742_i)] = _ptr__6708_ri32[((safe_add( _6700_rptr_base,_6691_rnelem ) - _6742_i) - (int)1)];
        }
      }
      _ptr__6708_ri32[_6700_rptr_base] = (int)0;
    }
  }
  else
  {
    {
      bool _6743_done = false;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6744_ii = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_6662_n)));
      _checked_ptr_1<int32_t> _ptr__6744_ii(_6744_ii ? _6744_ii->raw() : nullptr,_6744_ii ? _6744_ii->size(0) : 0);
      int32_t _6745_codei = (int)0;
      int32_t _6746_kelm = (int)0;
      int32_t _6747_knz = (int)0;
      while ( (!_6743_done) )
      {
        {
          int64_t _6748_idx = (-(int)1);
          int32_t _12246_ = (int)0;
          int32_t _12247_ = _6662_n;
          for (int32_t _6749_j = _12246_; _6749_j < _12247_; ++_6749_j)
          {
            {
              if (((_ptr__6744_ii[_6749_j] < _ptr__6665_nelem[_6749_j]) && ((_6748_idx < (int)0) || (_ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6749_j],_ptr__6744_ii[_6749_j] )] < _6748_idx))))
              {
                {
                  _6748_idx = _ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6749_j],_ptr__6744_ii[_6749_j] )];
                }
              }
              {}
            }
          }
          if ((_6748_idx < (int)0))
          {
            {
              _6743_done = true;
            }
          }
          else
          {
            {
              int32_t _12248_ = (int)0;
              int32_t _12249_ = _6662_n;
              for (int32_t _6750_j = _12248_; _6750_j < _12249_; ++_6750_j)
              {
                {
                  if (((_ptr__6744_ii[_6750_j] < _ptr__6665_nelem[_6750_j]) && (_6748_idx == _ptr__6679_wi64[safe_add( _ptr__6670_sp_base[_6750_j],_ptr__6744_ii[_6750_j] )])))
                  {
                    {
                      int32_t _12250_ = _ptr__6678_wi32[safe_add( _ptr__6668_ptr_base[_6750_j],_ptr__6744_ii[_6750_j] )];
                      int32_t _12251_ = _ptr__6678_wi32[safe_add( safe_add( _ptr__6668_ptr_base[_6750_j],_ptr__6744_ii[_6750_j] ),(int)1 )];
                      for (int32_t _6751_k = _12250_; _6751_k < _12251_; ++_6751_k)
                      {
                        {
                          _ptr__6709_ri64[safe_add( _6701_rnidxs_base,_6747_knz )] = _ptr__6679_wi64[safe_add( _ptr__6669_nidxs_base[_6750_j],_6751_k )];
                          _ptr__6710_rf64[safe_add( _6704_rcof_base,_6747_knz )] = (((*w)(_6750_j)) * _ptr__6680_wf64[safe_add( _ptr__6671_cof_base[_6750_j],_6751_k )]);
                          if (_6688_anycodeatom)
                          {
                            {
                              if ((_ptr__6667_ncodeatom[_6750_j] > (int)0))
                              {
                                {
                                  int32_t _12252_ = _ptr__6678_wi32[safe_add( _ptr__6674_codeptr[_6750_j],_6751_k )];
                                  int32_t _12253_ = _ptr__6678_wi32[safe_add( safe_add( _ptr__6674_codeptr[_6750_j],_6751_k ),(int)1 )];
                                  for (int32_t _6752_l = _12252_; _6752_l < _12253_; ++_6752_l)
                                  {
                                    {
                                      _ptr__6708_ri32[safe_add( _6705_rcode,_6745_codei )] = _ptr__6678_wi32[safe_add( _ptr__6673_code[_6750_j],_6752_l )];
                                      _ptr__6710_rf64[safe_add( _6707_rcconst,_6745_codei )] = _ptr__6680_wf64[safe_add( _ptr__6675_cconst[_6750_j],_6752_l )];
                                      ++ _6745_codei;
                                    }
                                  }
                                  _ptr__6708_ri32[safe_add( _6705_rcode,_6745_codei )] = 2;
                                  _ptr__6710_rf64[safe_add( _6707_rcconst,_6745_codei )] = ((*w)(_6750_j));
                                  ++ _6745_codei;
                                  _ptr__6708_ri32[safe_add( _6705_rcode,_6745_codei )] = 5;
                                  ++ _6745_codei;
                                }
                              }
                              else
                              {
                                {
                                  _ptr__6708_ri32[safe_add( _6705_rcode,_6745_codei )] = 2;
                                  _ptr__6710_rf64[safe_add( _6707_rcconst,_6745_codei )] = 0.0;
                                  ++ _6745_codei;
                                }
                              }
                              _ptr__6708_ri32[safe_add( safe_add( _6706_rcodeptr,_6747_knz ),(int)1 )] = _6745_codei;
                            }
                          }
                          {}
                          ++ _6747_knz;
                        }
                      }
                      ++ _ptr__6744_ii[_6750_j];
                    }
                  }
                  {}
                }
              }
              _ptr__6708_ri32[safe_add( safe_add( _6700_rptr_base,_6746_kelm ),(int)1 )] = _6747_knz;
              _ptr__6709_ri64[safe_add( _6702_rsp_base,_6746_kelm )] = _6748_idx;
            }
          }
          ++ _6746_kelm;
        }
      }
    }
  }
  _6661_xs->clear();
}
// End mosek.fusion.ExprWSum.eval

// Begin mosek.fusion.ExprWSum.toString
// Method mosek.fusion.ExprWSum.toString @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:244:6-253:7
std::string mosek::fusion::ExprWSum :: toString() { return mosek::fusion::p_ExprWSum::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprWSum::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _6753_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprWSum(["));
  _6753_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*es)((int)0))->toString());
  int32_t _12254_ = (int)1;
  int32_t _12255_ = (int)((es)->size(0));
  for (int32_t _6754_i = _12254_; _6754_i < _12255_; ++_6754_i)
  {
    {
      _6753_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*es)(_6754_i))->toString());
    }
  }
  _6753_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("])"));
  return _6753_sb->toString();
}
// End mosek.fusion.ExprWSum.toString

void mosek::fusion::p_ExprWSum::destroy()
{
  w.reset();
  es.reset();
}
void mosek::fusion::ExprWSum::destroy() { mosek::fusion::p_ExprWSum::_get_impl(this)->destroy(); }
// } class ExprWSum
// class ExprSumReduce { // @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:4:4-233:5
mosek::fusion::ExprSumReduce::ExprSumReduce(mosek::fusion::p_ExprSumReduce *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprSumReduce()" << this << std::endl; */ }
mosek::fusion::ExprSumReduce::~ExprSumReduce() {  /* std::cout << "~ExprSumReduce()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprSumReduce::p_ExprSumReduce
  (::mosek::fusion::ExprSumReduce * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprSumReduce.ctor @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:17:6-25:7
mosek::fusion::ExprSumReduce::t mosek::fusion::p_ExprSumReduce::_new_ExprSumReduce
  (int32_t _6755_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _6756_expr)
{ return new mosek::fusion::ExprSumReduce(_6755_dim,_6756_expr); }
mosek::fusion::ExprSumReduce::ExprSumReduce
  (int32_t _6755_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _6756_expr) : 
   ExprSumReduce(new mosek::fusion::p_ExprSumReduce(this))
{ mosek::fusion::p_ExprSumReduce::_get_impl(this)->_initialize(_6755_dim,_6756_expr); }
void mosek::fusion::p_ExprSumReduce::_initialize  (int32_t _6755_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _6756_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::p_ExprSumReduce::computeShape(_6755_dim,_6756_expr->getShape()));
    mosek::fusion::p_ExprSumReduce::_get_impl(::mosek::fusion::ExprSumReduce::t(_pubthis))->expr = _6756_expr;
    mosek::fusion::p_ExprSumReduce::_get_impl(::mosek::fusion::ExprSumReduce::t(_pubthis))->dim = _6755_dim;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6757_shape = _6756_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__6757_shape(_6757_shape ? _6757_shape->raw() : nullptr,_6757_shape ? _6757_shape->size(0) : 0);
    if (((int)((_6757_shape)->size(0)) <= _6755_dim))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid summing dimension"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprSumReduce.ctor

// Begin mosek.fusion.ExprSumReduce.eval
// Method mosek.fusion.ExprSumReduce.eval @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:27:6-232:7
void mosek::fusion::ExprSumReduce :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6758_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6759_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6760_xs) { mosek::fusion::p_ExprSumReduce::_get_impl(this)->eval(_6758_rs,_6759_ws,_6760_xs); }
void mosek::fusion::p_ExprSumReduce::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6758_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6759_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6760_xs)
{
  expr->eval(_6759_ws,_6758_rs,_6760_xs);
  _6759_ws->pop_expr();
  int32_t _6761_nd = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->nd;
  int32_t _6762_shape_base = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->shape_base;
  int32_t _6763_nelem = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->nelem;
  int32_t _6764_nnz = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->nnz;
  int32_t _6765_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->ncodeatom;
  bool _6766_hassp = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->hassp;
  int32_t _6767_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->ptr_base;
  int32_t _6768_sp_base = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->sp_base;
  int32_t _6769_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->nidxs_base;
  int32_t _6770_cof_base = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->cof_base;
  int32_t _6771_code = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->code_base;
  int32_t _6772_codeptr = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->codeptr_base;
  int32_t _6773_cconst = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6774_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6774_wi32(_6774_wi32 ? _6774_wi32->raw() : nullptr,_6774_wi32 ? _6774_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6775_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6775_wi64(_6775_wi64 ? _6775_wi64->raw() : nullptr,_6775_wi64 ? _6775_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6776_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6759_ws)->f64;
  _checked_ptr_1<double> _ptr__6776_wf64(_6776_wf64 ? _6776_wf64->raw() : nullptr,_6776_wf64 ? _6776_wf64->size(0) : 0);
  int32_t _6777_ptr = (int)99999;
  int32_t _6778_perm1 = (int)99999;
  int32_t _6779_perm2 = (int)99999;
  if (_6766_hassp)
  {
    {
      int32_t _6780_dimmax = (int)0;
      int32_t _12256_ = (int)0;
      int32_t _12257_ = _6761_nd;
      for (int32_t _6781_i = _12256_; _6781_i < _12257_; ++_6781_i)
      {
        {
          if ((_6780_dimmax < _ptr__6774_wi32[safe_add( _6762_shape_base,_6781_i )]))
          {
            {
              _6780_dimmax = _ptr__6774_wi32[safe_add( _6762_shape_base,_6781_i )];
            }
          }
          {}
        }
      }
      _6777_ptr = _6760_xs->alloci32(safe_add( _6780_dimmax,(int)1 ));
      _6778_perm1 = _6760_xs->alloci32(_6763_nelem);
      _6779_perm2 = _6760_xs->alloci32(_6763_nelem);
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6782_xi32 = mosek::fusion::p_WorkStack::_get_impl(_6760_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__6782_xi32(_6782_xi32 ? _6782_xi32->raw() : nullptr,_6782_xi32 ? _6782_xi32->size(0) : 0);
  if (_6766_hassp)
  {
    {
      int32_t _6783_curperm = _6778_perm1;
      int32_t _6784_tgtperm = _6779_perm2;
      int32_t _12258_ = (int)0;
      int32_t _12259_ = _6763_nelem;
      for (int32_t _6785_i = _12258_; _6785_i < _12259_; ++_6785_i)
      {
        {
          _ptr__6782_xi32[safe_add( _6783_curperm,_6785_i )] = _6785_i;
        }
      }
      if ((dim < (_6761_nd - (int)1)))
      {
        {
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6786_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_6761_nd)));
          _checked_ptr_1<int64_t> _ptr__6786_s(_6786_s ? _6786_s->raw() : nullptr,_6786_s ? _6786_s->size(0) : 0);
          _ptr__6786_s[(_6761_nd - (int)1)] = (int)1;
          int32_t _12260_ = (int)1;
          int32_t _12261_ = _6761_nd;
          for (int32_t _6787_i = _12260_; _6787_i < _12261_; ++_6787_i)
          {
            {
              _ptr__6786_s[((_6761_nd - _6787_i) - (int)1)] = safe_mul( _ptr__6786_s[(_6761_nd - _6787_i)],_ptr__6774_wi32[(safe_add( _6762_shape_base,_6761_nd ) - _6787_i)] );
            }
          }
          std::shared_ptr< monty::ndarray< int32_t,1 > > _6788_sortdims = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((_6761_nd - (int)1))));
          _checked_ptr_1<int32_t> _ptr__6788_sortdims(_6788_sortdims ? _6788_sortdims->raw() : nullptr,_6788_sortdims ? _6788_sortdims->size(0) : 0);
          int32_t _12262_ = (int)0;
          int32_t _12263_ = dim;
          for (int32_t _6789_i = _12262_; _6789_i < _12263_; ++_6789_i)
          {
            {
              _ptr__6788_sortdims[((_6761_nd - _6789_i) - (int)2)] = _6789_i;
            }
          }
          int32_t _12264_ = safe_add( dim,(int)1 );
          int32_t _12265_ = _6761_nd;
          for (int32_t _6790_i = _12264_; _6790_i < _12265_; ++_6790_i)
          {
            {
              _ptr__6788_sortdims[((_6761_nd - _6790_i) - (int)1)] = _6790_i;
            }
          }
          int32_t _12266_ = (int)0;
          int32_t _12267_ = (_6761_nd - (int)1);
          for (int32_t _6791_ii = _12266_; _6791_ii < _12267_; ++_6791_ii)
          {
            {
              int32_t _6792_k = _ptr__6788_sortdims[_6791_ii];
              int32_t _6793_dk = _ptr__6774_wi32[safe_add( _6762_shape_base,_6792_k )];
              int32_t _12268_ = (int)0;
              int32_t _12269_ = safe_add( _6793_dk,(int)1 );
              for (int32_t _6794_i = _12268_; _6794_i < _12269_; ++_6794_i)
              {
                {
                  _ptr__6782_xi32[safe_add( _6777_ptr,_6794_i )] = (int)0;
                }
              }
              int32_t _12270_ = (int)0;
              int32_t _12271_ = _6763_nelem;
              for (int32_t _6795_i = _12270_; _6795_i < _12271_; ++_6795_i)
              {
                {
                  ++ _ptr__6782_xi32[safe_add( safe_add( _6777_ptr,(int)1 ),((_ptr__6775_wi64[safe_add( _6768_sp_base,_6795_i )] / _ptr__6786_s[_6792_k]) % _6793_dk) )];
                }
              }
              int32_t _12272_ = (int)0;
              int32_t _12273_ = _6793_dk;
              for (int32_t _6796_i = _12272_; _6796_i < _12273_; ++_6796_i)
              {
                {
                  _ptr__6782_xi32[safe_add( safe_add( _6777_ptr,_6796_i ),(int)1 )] += _ptr__6782_xi32[safe_add( _6777_ptr,_6796_i )];
                }
              }
              int32_t _12274_ = (int)0;
              int32_t _12275_ = _6763_nelem;
              for (int32_t _6797_ii = _12274_; _6797_ii < _12275_; ++_6797_ii)
              {
                {
                  int32_t _6798_i = _ptr__6782_xi32[safe_add( _6783_curperm,_6797_ii )];
                  int64_t _6799_sub = ((_ptr__6775_wi64[safe_add( _6768_sp_base,_6798_i )] / _ptr__6786_s[_6792_k]) % _6793_dk);
                  _ptr__6782_xi32[safe_add( _6784_tgtperm,_ptr__6782_xi32[safe_add( _6777_ptr,_6799_sub )] )] = _6798_i;
                  ++ _ptr__6782_xi32[safe_add( _6777_ptr,_6799_sub )];
                }
              }
              int32_t _6800_tmp = _6784_tgtperm;
              _6784_tgtperm = _6783_curperm;
              _6783_curperm = _6800_tmp;
            }
          }
        }
      }
      {}
      int32_t _6801_d0 = (int)1;
      int32_t _12276_ = (int)0;
      int32_t _12277_ = dim;
      for (int32_t _6802_i = _12276_; _6802_i < _12277_; ++_6802_i)
      {
        {
          _6801_d0 *= _ptr__6774_wi32[safe_add( _6762_shape_base,_6802_i )];
        }
      }
      int32_t _6803_d1 = _ptr__6774_wi32[safe_add( _6762_shape_base,dim )];
      int32_t _6804_d2 = (int)1;
      int32_t _12278_ = safe_add( dim,(int)1 );
      int32_t _12279_ = _6761_nd;
      for (int32_t _6805_i = _12278_; _6805_i < _12279_; ++_6805_i)
      {
        {
          _6804_d2 *= _ptr__6774_wi32[safe_add( _6762_shape_base,_6805_i )];
        }
      }
      int32_t _6806_s0 = safe_mul( _6804_d2,_6803_d1 );
      int32_t _6807_s1 = _6804_d2;
      int32_t _6808_s2 = (int)1;
      int32_t _6809_rnelem = (int)0;
      int64_t _6810_p2 = (-(int)1);
      int64_t _6811_p0 = (-(int)1);
      int32_t _12280_ = (int)0;
      int32_t _12281_ = _6763_nelem;
      for (int32_t _6812_ii = _12280_; _6812_ii < _12281_; ++_6812_ii)
      {
        {
          int32_t _6813_i = _ptr__6782_xi32[safe_add( _6783_curperm,_6812_ii )];
          int64_t _6814_k0 = ((_ptr__6775_wi64[safe_add( _6768_sp_base,_6813_i )] / _6806_s0) % _6801_d0);
          int64_t _6815_k2 = (_ptr__6775_wi64[safe_add( _6768_sp_base,_6813_i )] % _6804_d2);
          if (((_6811_p0 != _6814_k0) || (_6810_p2 != _6815_k2)))
          {
            {
              _6811_p0 = _6814_k0;
              _6810_p2 = _6815_k2;
              ++ _6809_rnelem;
            }
          }
          {}
        }
      }
      int32_t _6816_rnd = (_6761_nd - (int)1);
      bool _6817_rhassp = (_6809_rnelem < safe_mul( _6801_d0,_6804_d2 ));
      int32_t _6818_rnnz = _6764_nnz;
      int32_t _6819_rncodeatom = _6765_ncodeatom;
      _6758_rs->alloc_expr(_6816_rnd,_6809_rnelem,_6818_rnnz,_6817_rhassp,_6819_rncodeatom);
      int32_t _6820_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->ptr_base;
      int32_t _6821_rnidxs_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->nidxs_base;
      int32_t _12282_;
      bool _12283_ = _6817_rhassp;
      if (_12283_)
      {
        _12282_ = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->sp_base;
      }
      else
      {
        _12282_ = _6758_rs->alloci64(_6809_rnelem);
      }
      int32_t _6822_rsp_base = _12282_;
      int32_t _6823_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->cof_base;
      int32_t _6824_rshape_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->shape_base;
      int32_t _6825_rcode = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->code_base;
      int32_t _6826_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->codeptr_base;
      int32_t _6827_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6828_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6828_ri32(_6828_ri32 ? _6828_ri32->raw() : nullptr,_6828_ri32 ? _6828_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6829_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6829_ri64(_6829_ri64 ? _6829_ri64->raw() : nullptr,_6829_ri64 ? _6829_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6830_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->f64;
      _checked_ptr_1<double> _ptr__6830_rf64(_6830_rf64 ? _6830_rf64->raw() : nullptr,_6830_rf64 ? _6830_rf64->size(0) : 0);
      int32_t _12284_ = (int)0;
      int32_t _12285_ = dim;
      for (int32_t _6831_i = _12284_; _6831_i < _12285_; ++_6831_i)
      {
        {
          _ptr__6828_ri32[safe_add( _6824_rshape_base,_6831_i )] = _ptr__6774_wi32[safe_add( _6762_shape_base,_6831_i )];
        }
      }
      int32_t _12286_ = safe_add( dim,(int)1 );
      int32_t _12287_ = _6761_nd;
      for (int32_t _6832_i = _12286_; _6832_i < _12287_; ++_6832_i)
      {
        {
          _ptr__6828_ri32[(safe_add( _6824_rshape_base,_6832_i ) - (int)1)] = _ptr__6774_wi32[safe_add( _6762_shape_base,_6832_i )];
        }
      }
      _ptr__6828_ri32[_6820_rptr_base] = (int)0;
      if ((_6819_rncodeatom > (int)0))
      {
        {
          _ptr__6828_ri32[_6826_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _6833_codei = (int)0;
      int32_t _6834_kelm = (int)0;
      int32_t _6835_knz = (int)0;
      int32_t _6836_ii = (int)0;
      while ( (_6836_ii < _6763_nelem) )
      {
        {
          int32_t _6837_b = _6836_ii;
          int64_t _6838_p0 = ((_ptr__6775_wi64[safe_add( _6768_sp_base,_ptr__6782_xi32[safe_add( _6783_curperm,_6837_b )] )] / _6806_s0) % _6801_d0);
          int64_t _6839_p2 = (_ptr__6775_wi64[safe_add( _6768_sp_base,_ptr__6782_xi32[safe_add( _6783_curperm,_6837_b )] )] % _6804_d2);
          ++ _6836_ii;
          while ( ((_6836_ii < _6763_nelem) && ((_6838_p0 == ((_ptr__6775_wi64[safe_add( _6768_sp_base,_ptr__6782_xi32[safe_add( _6783_curperm,_6836_ii )] )] / _6806_s0) % _6801_d0)) && (_6839_p2 == (_ptr__6775_wi64[safe_add( _6768_sp_base,_ptr__6782_xi32[safe_add( _6783_curperm,_6836_ii )] )] % _6804_d2)))) )
          {
            {
              ++ _6836_ii;
            }
          }
          int32_t _12288_ = _6837_b;
          int32_t _12289_ = _6836_ii;
          for (int32_t _6840_kk = _12288_; _6840_kk < _12289_; ++_6840_kk)
          {
            {
              int32_t _6841_k = _ptr__6782_xi32[safe_add( _6783_curperm,_6840_kk )];
              int32_t _12290_ = _ptr__6774_wi32[safe_add( _6767_ptr_base,_6841_k )];
              int32_t _12291_ = _ptr__6774_wi32[safe_add( safe_add( _6767_ptr_base,_6841_k ),(int)1 )];
              for (int32_t _6842_j = _12290_; _6842_j < _12291_; ++_6842_j)
              {
                {
                  _ptr__6829_ri64[safe_add( _6821_rnidxs_base,_6835_knz )] = _ptr__6775_wi64[safe_add( _6769_nidxs_base,_6842_j )];
                  _ptr__6830_rf64[safe_add( _6823_rcof_base,_6835_knz )] = _ptr__6776_wf64[safe_add( _6770_cof_base,_6842_j )];
                  if ((_6819_rncodeatom > (int)0))
                  {
                    {
                      int32_t _12292_ = _ptr__6774_wi32[safe_add( _6772_codeptr,_6842_j )];
                      int32_t _12293_ = _ptr__6774_wi32[safe_add( safe_add( _6772_codeptr,_6842_j ),(int)1 )];
                      for (int32_t _6843_l = _12292_; _6843_l < _12293_; ++_6843_l)
                      {
                        {
                          _ptr__6828_ri32[safe_add( _6825_rcode,_6833_codei )] = _ptr__6774_wi32[safe_add( _6771_code,_6843_l )];
                          _ptr__6830_rf64[safe_add( _6827_rcconst,_6833_codei )] = _ptr__6776_wf64[safe_add( _6773_cconst,_6843_l )];
                          ++ _6833_codei;
                        }
                      }
                      _ptr__6828_ri32[safe_add( safe_add( _6826_rcodeptr,_6835_knz ),(int)1 )] = _6833_codei;
                    }
                  }
                  {}
                  ++ _6835_knz;
                }
              }
            }
          }
          _ptr__6829_ri64[safe_add( _6822_rsp_base,_6834_kelm )] = safe_add( safe_mul( _6838_p0,_6804_d2 ),_6839_p2 );
          _ptr__6828_ri32[safe_add( safe_add( _6820_rptr_base,_6834_kelm ),(int)1 )] = _6835_knz;
          ++ _6834_kelm;
        }
      }
      if ((!_6817_rhassp))
      {
        {
          _6758_rs->popi64(_6809_rnelem);
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _6844_d0 = (int)1;
      int32_t _12294_ = (int)0;
      int32_t _12295_ = dim;
      for (int32_t _6845_i = _12294_; _6845_i < _12295_; ++_6845_i)
      {
        {
          _6844_d0 *= _ptr__6774_wi32[safe_add( _6762_shape_base,_6845_i )];
        }
      }
      int32_t _6846_d1 = _ptr__6774_wi32[safe_add( _6762_shape_base,dim )];
      int32_t _6847_d2 = (int)1;
      int32_t _12296_ = safe_add( dim,(int)1 );
      int32_t _12297_ = _6761_nd;
      for (int32_t _6848_i = _12296_; _6848_i < _12297_; ++_6848_i)
      {
        {
          _6847_d2 *= _ptr__6774_wi32[safe_add( _6762_shape_base,_6848_i )];
        }
      }
      int32_t _6849_s0 = safe_mul( _6847_d2,_6846_d1 );
      int32_t _6850_s1 = _6847_d2;
      int32_t _6851_s2 = (int)1;
      int32_t _6852_rnelem = safe_mul( _6844_d0,_6847_d2 );
      int32_t _6853_rnnz = _6764_nnz;
      int32_t _6854_rncodeatom = _6765_ncodeatom;
      _6758_rs->alloc_expr((_6761_nd - (int)1),_6852_rnelem,_6853_rnnz,false,_6854_rncodeatom);
      int32_t _6855_rptr_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->ptr_base;
      int32_t _6856_rnidxs_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->nidxs_base;
      int32_t _6857_rcof_base = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->cof_base;
      int32_t _6858_rshape = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->shape_base;
      int32_t _6859_rcode = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->code_base;
      int32_t _6860_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->codeptr_base;
      int32_t _6861_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _6862_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__6862_ri32(_6862_ri32 ? _6862_ri32->raw() : nullptr,_6862_ri32 ? _6862_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6863_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__6863_ri64(_6863_ri64 ? _6863_ri64->raw() : nullptr,_6863_ri64 ? _6863_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _6864_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6758_rs)->f64;
      _checked_ptr_1<double> _ptr__6864_rf64(_6864_rf64 ? _6864_rf64->raw() : nullptr,_6864_rf64 ? _6864_rf64->size(0) : 0);
      int32_t _12298_ = (int)0;
      int32_t _12299_ = dim;
      for (int32_t _6865_i = _12298_; _6865_i < _12299_; ++_6865_i)
      {
        {
          _ptr__6862_ri32[safe_add( _6858_rshape,_6865_i )] = _ptr__6774_wi32[safe_add( _6762_shape_base,_6865_i )];
        }
      }
      int32_t _12300_ = safe_add( dim,(int)1 );
      int32_t _12301_ = _6761_nd;
      for (int32_t _6866_i = _12300_; _6866_i < _12301_; ++_6866_i)
      {
        {
          _ptr__6862_ri32[(safe_add( _6858_rshape,_6866_i ) - (int)1)] = _ptr__6774_wi32[safe_add( _6762_shape_base,_6866_i )];
        }
      }
      int32_t _6867_kelm = (int)0;
      int32_t _6868_knz = (int)0;
      _ptr__6862_ri32[_6855_rptr_base] = (int)0;
      if ((_6854_rncodeatom > (int)0))
      {
        {
          _ptr__6862_ri32[_6860_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _6869_codei = (int)0;
      int32_t _12302_ = (int)0;
      int32_t _12303_ = _6844_d0;
      for (int32_t _6870_i0 = _12302_; _6870_i0 < _12303_; ++_6870_i0)
      {
        {
          int32_t _12304_ = (int)0;
          int32_t _12305_ = _6847_d2;
          for (int32_t _6871_i2 = _12304_; _6871_i2 < _12305_; ++_6871_i2)
          {
            {
              int32_t _12306_ = (int)0;
              int32_t _12307_ = _6846_d1;
              for (int32_t _6872_i1 = _12306_; _6872_i1 < _12307_; ++_6872_i1)
              {
                {
                  int32_t _6873_i = safe_add( safe_add( safe_mul( _6870_i0,_6849_s0 ),safe_mul( _6872_i1,_6850_s1 ) ),_6871_i2 );
                  int32_t _12308_ = _ptr__6774_wi32[safe_add( _6767_ptr_base,_6873_i )];
                  int32_t _12309_ = _ptr__6774_wi32[safe_add( safe_add( _6767_ptr_base,_6873_i ),(int)1 )];
                  for (int32_t _6874_k = _12308_; _6874_k < _12309_; ++_6874_k)
                  {
                    {
                      _ptr__6863_ri64[safe_add( _6856_rnidxs_base,_6868_knz )] = _ptr__6775_wi64[safe_add( _6769_nidxs_base,_6874_k )];
                      _ptr__6864_rf64[safe_add( _6857_rcof_base,_6868_knz )] = _ptr__6776_wf64[safe_add( _6770_cof_base,_6874_k )];
                      if ((_6854_rncodeatom > (int)0))
                      {
                        {
                          int32_t _12310_ = _ptr__6774_wi32[safe_add( _6772_codeptr,_6874_k )];
                          int32_t _12311_ = _ptr__6774_wi32[safe_add( safe_add( _6772_codeptr,_6874_k ),(int)1 )];
                          for (int32_t _6875_l = _12310_; _6875_l < _12311_; ++_6875_l)
                          {
                            {
                              _ptr__6862_ri32[safe_add( _6859_rcode,_6869_codei )] = _ptr__6774_wi32[safe_add( _6771_code,_6875_l )];
                              _ptr__6864_rf64[safe_add( _6861_rcconst,_6869_codei )] = _ptr__6776_wf64[safe_add( _6773_cconst,_6875_l )];
                              ++ _6869_codei;
                            }
                          }
                          _ptr__6862_ri32[safe_add( safe_add( _6860_rcodeptr,_6868_knz ),(int)1 )] = _6869_codei;
                        }
                      }
                      {}
                      ++ _6868_knz;
                    }
                  }
                }
              }
              _ptr__6862_ri32[safe_add( safe_add( _6855_rptr_base,_6867_kelm ),(int)1 )] = _6868_knz;
              ++ _6867_kelm;
            }
          }
        }
      }
    }
  }
  _6760_xs->clear();
}
// End mosek.fusion.ExprSumReduce.eval

// Begin mosek.fusion.ExprSumReduce.computeShape
// Method mosek.fusion.ExprSumReduce.computeShape @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:10:6-15:7
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_ExprSumReduce::computeShape(int32_t _6876_dim,std::shared_ptr< monty::ndarray< int32_t,1 > > _6877_shape)
{
  _checked_ptr_1<int32_t> _ptr__6877_shape(_6877_shape ? _6877_shape->raw() : nullptr, _6877_shape ? _6877_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6878_r = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(((int)((_6877_shape)->size(0)) - (int)1))));
  _checked_ptr_1<int32_t> _ptr__6878_r(_6878_r ? _6878_r->raw() : nullptr,_6878_r ? _6878_r->size(0) : 0);
  int32_t _12312_ = (int)0;
  int32_t _12313_ = _6876_dim;
  for (int32_t _6879_i = _12312_; _6879_i < _12313_; ++_6879_i)
  {
    {
      _ptr__6878_r[_6879_i] = _ptr__6877_shape[_6879_i];
    }
  }
  int32_t _12314_ = safe_add( _6876_dim,(int)1 );
  int32_t _12315_ = (int)((_6877_shape)->size(0));
  for (int32_t _6880_i = _12314_; _6880_i < _12315_; ++_6880_i)
  {
    {
      _ptr__6878_r[(_6880_i - (int)1)] = _ptr__6877_shape[_6880_i];
    }
  }
  return _6878_r;
}
// End mosek.fusion.ExprSumReduce.computeShape

// Begin mosek.fusion.ExprSumReduce.toString
// Method mosek.fusion.ExprSumReduce.toString @ bld/docker-win/final/default/src/fusion/ExprAdd.monty:8:6-146
std::string mosek::fusion::ExprSumReduce :: toString() { return mosek::fusion::p_ExprSumReduce::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprSumReduce::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprSumReduce("))->__mosek_2fusion_2Utils_2StringBuffer__a(dim)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprSumReduce.toString

void mosek::fusion::p_ExprSumReduce::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprSumReduce::destroy() { mosek::fusion::p_ExprSumReduce::_get_impl(this)->destroy(); }
// } class ExprSumReduce
// class ExprScaleVecPSD { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:1043:4-1223:5
mosek::fusion::ExprScaleVecPSD::ExprScaleVecPSD(mosek::fusion::p_ExprScaleVecPSD *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprScaleVecPSD()" << this << std::endl; */ }
mosek::fusion::ExprScaleVecPSD::~ExprScaleVecPSD() {  /* std::cout << "~ExprScaleVecPSD()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprScaleVecPSD::p_ExprScaleVecPSD
  (::mosek::fusion::ExprScaleVecPSD * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprScaleVecPSD.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:1048:6-1055:7
mosek::fusion::ExprScaleVecPSD::t mosek::fusion::p_ExprScaleVecPSD::_new_ExprScaleVecPSD
  (int32_t _6881_dim0,
    int32_t _6882_dim1,
    monty::rc_ptr< ::mosek::fusion::BaseExpression > _6883_expr)
{ return new mosek::fusion::ExprScaleVecPSD(_6881_dim0,_6882_dim1,_6883_expr); }
mosek::fusion::ExprScaleVecPSD::ExprScaleVecPSD
  (int32_t _6881_dim0,
    int32_t _6882_dim1,
    monty::rc_ptr< ::mosek::fusion::BaseExpression > _6883_expr) : 
   ExprScaleVecPSD(new mosek::fusion::p_ExprScaleVecPSD(this))
{ mosek::fusion::p_ExprScaleVecPSD::_get_impl(this)->_initialize(_6881_dim0,_6882_dim1,_6883_expr); }
void mosek::fusion::p_ExprScaleVecPSD::_initialize  (int32_t _6881_dim0,
    int32_t _6882_dim1,
    monty::rc_ptr< ::mosek::fusion::BaseExpression > _6883_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_6883_expr->getShape());
    mosek::fusion::p_ExprScaleVecPSD::_get_impl(::mosek::fusion::ExprScaleVecPSD::t(_pubthis))->expr = (_6883_expr).as<::mosek::fusion::Expression>();
    mosek::fusion::p_ExprScaleVecPSD::_get_impl(::mosek::fusion::ExprScaleVecPSD::t(_pubthis))->dim0 = _6881_dim0;
    mosek::fusion::p_ExprScaleVecPSD::_get_impl(::mosek::fusion::ExprScaleVecPSD::t(_pubthis))->dim1 = _6882_dim1;
    if (((_6881_dim0 < (int)0) || ((_6882_dim1 < (int)0) || (_6881_dim0 == _6882_dim1))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid symmetry dimensions"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprScaleVecPSD.ctor

// Begin mosek.fusion.ExprScaleVecPSD.eval
// Method mosek.fusion.ExprScaleVecPSD.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:1057:6-1222:7
void mosek::fusion::ExprScaleVecPSD :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6884_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6885_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6886_xs) { mosek::fusion::p_ExprScaleVecPSD::_get_impl(this)->eval(_6884_rs,_6885_ws,_6886_xs); }
void mosek::fusion::p_ExprScaleVecPSD::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6884_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6885_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6886_xs)
{
  expr->eval(_6885_ws,_6884_rs,_6886_xs);
  _6885_ws->pop_expr();
  int32_t _6887_nd = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->nd;
  int32_t _6888_nnz = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->nnz;
  int32_t _6889_nelem = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->nelem;
  int32_t _6890_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->ncodeatom;
  bool _6891_hassp = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->hassp;
  int32_t _6892_shape = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->shape_base;
  int32_t _6893_ptr = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->ptr_base;
  int32_t _6894_code = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->code_base;
  int32_t _6895_codeptr = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->codeptr_base;
  int32_t _6896_cconst = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->cconst_base;
  int32_t _6897_nidxs = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->nidxs_base;
  int32_t _6898_sp = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->sp_base;
  int32_t _6899_cof = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->cof_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6900_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6900_wi32(_6900_wi32 ? _6900_wi32->raw() : nullptr,_6900_wi32 ? _6900_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6901_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6901_wi64(_6901_wi64 ? _6901_wi64->raw() : nullptr,_6901_wi64 ? _6901_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6902_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6885_ws)->f64;
  _checked_ptr_1<double> _ptr__6902_wf64(_6902_wf64 ? _6902_wf64->raw() : nullptr,_6902_wf64 ? _6902_wf64->size(0) : 0);
  if (((dim0 >= _6887_nd) || (dim1 >= _6887_nd)))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid symmetry dimensions"));
    }
  }
  else if((_ptr__6900_wi32[safe_add( _6892_shape,dim0 )] != _ptr__6900_wi32[safe_add( _6892_shape,dim1 )]))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Not symmetric in given dimensions"));
    }
  }
  {}
  int64_t _6903_d4 = (int)1;
  int64_t _6904_d3 = (int)1;
  int64_t _6905_d2 = (int)1;
  int64_t _6906_d1 = (int)1;
  int64_t _6907_d0 = (int)1;
  int32_t _12316_;
  bool _12317_ = (dim0 < dim1);
  if (_12317_)
  {
    _12316_ = dim0;
  }
  else
  {
    _12316_ = dim1;
  }
  int32_t _6908_xdim0 = _12316_;
  int32_t _12318_;
  bool _12319_ = (dim0 < dim1);
  if (_12319_)
  {
    _12318_ = dim1;
  }
  else
  {
    _12318_ = dim0;
  }
  int32_t _6909_xdim1 = _12318_;
  int32_t _12320_ = (int)0;
  int32_t _12321_ = _6908_xdim0;
  for (int32_t _6910_i = _12320_; _6910_i < _12321_; ++_6910_i)
  {
    {
      _6907_d0 *= _ptr__6900_wi32[safe_add( _6892_shape,_6910_i )];
    }
  }
  int32_t _12322_ = safe_add( _6908_xdim0,(int)1 );
  int32_t _12323_ = _6909_xdim1;
  for (int32_t _6911_i = _12322_; _6911_i < _12323_; ++_6911_i)
  {
    {
      _6905_d2 *= _ptr__6900_wi32[safe_add( _6892_shape,_6911_i )];
    }
  }
  int32_t _12324_ = safe_add( _6909_xdim1,(int)1 );
  int32_t _12325_ = _6887_nd;
  for (int32_t _6912_i = _12324_; _6912_i < _12325_; ++_6912_i)
  {
    {
      _6903_d4 *= _ptr__6900_wi32[safe_add( _6892_shape,_6912_i )];
    }
  }
  _6906_d1 = _ptr__6900_wi32[safe_add( _6892_shape,dim0 )];
  _6904_d3 = _6906_d1;
  if ((_6890_ncodeatom == (int)0))
  {
    {
      _6884_rs->alloc_expr(_6887_nd,_6889_nelem,_6888_nnz,_6891_hassp,(int)0);
    }
  }
  else
  {
    {
      _6884_rs->alloc_expr(_6887_nd,_6889_nelem,_6888_nnz,_6891_hassp,safe_add( _6890_ncodeatom,safe_mul( _6888_nnz,(int)2 ) ));
    }
  }
  int32_t _6913_rptr = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->ptr_base;
  int32_t _6914_rshape = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->shape_base;
  int32_t _6915_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->nidxs_base;
  int32_t _6916_rsp = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->sp_base;
  int32_t _6917_rcof = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->cof_base;
  int32_t _6918_rcode = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->code_base;
  int32_t _6919_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->codeptr_base;
  int32_t _6920_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6921_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__6921_ri32(_6921_ri32 ? _6921_ri32->raw() : nullptr,_6921_ri32 ? _6921_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6922_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__6922_ri64(_6922_ri64 ? _6922_ri64->raw() : nullptr,_6922_ri64 ? _6922_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6923_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6884_rs)->f64;
  _checked_ptr_1<double> _ptr__6923_rf64(_6923_rf64 ? _6923_rf64->raw() : nullptr,_6923_rf64 ? _6923_rf64->size(0) : 0);
  {
    ::mosek::fusion::Utils::Tools::arraycopy(_6900_wi32,_6893_ptr,_6921_ri32,_6913_rptr,safe_add( _6889_nelem,(int)1 ));
    ::mosek::fusion::Utils::Tools::arraycopy(_6900_wi32,_6892_shape,_6921_ri32,_6914_rshape,_6887_nd);
    ::mosek::fusion::Utils::Tools::arraycopy(_6901_wi64,_6897_nidxs,_6922_ri64,_6915_rnidxs,_6888_nnz);
    ::mosek::fusion::Utils::Tools::arraycopy(_6902_wf64,_6899_cof,_6923_rf64,_6917_rcof,_6888_nnz);
    if (_6891_hassp)
    {
      {
        ::mosek::fusion::Utils::Tools::arraycopy(_6901_wi64,_6898_sp,_6922_ri64,_6916_rsp,_6889_nelem);
      }
    }
    {}
  }
  double _6924_scale = ::mosek::fusion::Utils::Tools::sqrt((double)((int)2));
  if ((!_6891_hassp))
  {
    {
      int32_t _6925_k = (int)0;
      int32_t _12326_ = (int)0;
      int64_t _12327_ = _6907_d0;
      for (int64_t _6926_i0 = _12326_; _6926_i0 < _12327_; ++_6926_i0)
      {
        {
          int32_t _12328_ = (int)0;
          int64_t _12329_ = _6906_d1;
          for (int64_t _6927_i1 = _12328_; _6927_i1 < _12329_; ++_6927_i1)
          {
            {
              int32_t _12330_ = (int)0;
              int64_t _12331_ = _6905_d2;
              for (int64_t _6928_i2 = _12330_; _6928_i2 < _12331_; ++_6928_i2)
              {
                {
                  int32_t _12332_ = (int)0;
                  int64_t _12333_ = _6904_d3;
                  for (int64_t _6929_i3 = _12332_; _6929_i3 < _12333_; ++_6929_i3)
                  {
                    {
                      int32_t _12334_ = (int)0;
                      int64_t _12335_ = _6903_d4;
                      for (int64_t _6930_i4 = _12334_; _6930_i4 < _12335_; ++_6930_i4)
                      {
                        {
                          if ((_6927_i1 != _6929_i3))
                          {
                            {
                              int32_t _12336_ = _ptr__6921_ri32[safe_add( _6913_rptr,_6925_k )];
                              int32_t _12337_ = _ptr__6921_ri32[safe_add( safe_add( _6913_rptr,_6925_k ),(int)1 )];
                              for (int32_t _6931_j = _12336_; _6931_j < _12337_; ++_6931_j)
                              {
                                {
                                  _ptr__6923_rf64[safe_add( _6917_rcof,_6931_j )] *= _6924_scale;
                                }
                              }
                            }
                          }
                          {}
                          ++ _6925_k;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int32_t _6932_k = (int)0;
      std::shared_ptr< monty::ndarray< int64_t,1 > > _6933_d = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)5)));
      _checked_ptr_1<int64_t> _ptr__6933_d(_6933_d ? _6933_d->raw() : nullptr,_6933_d ? _6933_d->size(0) : 0);
      _ptr__6933_d[(int)4] = (int)1;
      _ptr__6933_d[(int)3] = safe_mul( _ptr__6933_d[(int)4],_6903_d4 );
      _ptr__6933_d[(int)2] = safe_mul( _ptr__6933_d[(int)3],_6904_d3 );
      _ptr__6933_d[(int)1] = safe_mul( _ptr__6933_d[(int)2],_6905_d2 );
      _ptr__6933_d[(int)0] = safe_mul( _ptr__6933_d[(int)1],_6906_d1 );
      int32_t _12338_ = (int)0;
      int32_t _12339_ = _6889_nelem;
      for (int32_t _6934_k = _12338_; _6934_k < _12339_; ++_6934_k)
      {
        {
          int64_t _6935_idx = _ptr__6901_wi64[safe_add( _6898_sp,_6934_k )];
          int64_t _6936_d3 = ((_6935_idx / _ptr__6933_d[(int)3]) % _6904_d3);
          int64_t _6937_d1 = ((_6935_idx / _ptr__6933_d[(int)1]) % _6906_d1);
          if ((_6937_d1 != _6936_d3))
          {
            {
              int32_t _12340_ = _ptr__6921_ri32[safe_add( _6913_rptr,_6934_k )];
              int32_t _12341_ = _ptr__6921_ri32[safe_add( safe_add( _6913_rptr,_6934_k ),(int)1 )];
              for (int32_t _6938_j = _12340_; _6938_j < _12341_; ++_6938_j)
              {
                {
                  _ptr__6923_rf64[safe_add( _6917_rcof,_6938_j )] *= _6924_scale;
                }
              }
            }
          }
          {}
        }
      }
    }
  }
  if ((_6890_ncodeatom != (int)0))
  {
    {
      int32_t _6939_nzi = (int)0;
      int32_t _6940_codei = (int)0;
      _ptr__6921_ri32[_6919_rcodeptr] = (int)0;
      if ((!_6891_hassp))
      {
        {
          int32_t _6941_k = (int)0;
          int32_t _12342_ = (int)0;
          int64_t _12343_ = _6907_d0;
          for (int64_t _6942_i0 = _12342_; _6942_i0 < _12343_; ++_6942_i0)
          {
            {
              int32_t _12344_ = (int)0;
              int64_t _12345_ = _6906_d1;
              for (int64_t _6943_i1 = _12344_; _6943_i1 < _12345_; ++_6943_i1)
              {
                {
                  int32_t _12346_ = (int)0;
                  int64_t _12347_ = _6905_d2;
                  for (int64_t _6944_i2 = _12346_; _6944_i2 < _12347_; ++_6944_i2)
                  {
                    {
                      int32_t _12348_ = (int)0;
                      int64_t _12349_ = _6904_d3;
                      for (int64_t _6945_i3 = _12348_; _6945_i3 < _12349_; ++_6945_i3)
                      {
                        {
                          int32_t _12350_ = (int)0;
                          int64_t _12351_ = _6903_d4;
                          for (int64_t _6946_i4 = _12350_; _6946_i4 < _12351_; ++_6946_i4)
                          {
                            {
                              double _12352_;
                              bool _12353_ = (_6943_i1 != _6945_i3);
                              if (_12353_)
                              {
                                _12352_ = _6924_scale;
                              }
                              else
                              {
                                _12352_ = 1.0;
                              }
                              double _6947_s = _12352_;
                              int32_t _12354_ = _ptr__6900_wi32[safe_add( _6893_ptr,_6941_k )];
                              int32_t _12355_ = _ptr__6921_ri32[safe_add( safe_add( _6893_ptr,_6941_k ),(int)1 )];
                              for (int32_t _6948_j = _12354_; _6948_j < _12355_; ++_6948_j)
                              {
                                {
                                  int32_t _12356_ = _ptr__6900_wi32[safe_add( _6895_codeptr,_6948_j )];
                                  int32_t _12357_ = _ptr__6900_wi32[safe_add( safe_add( _6895_codeptr,_6948_j ),(int)1 )];
                                  for (int32_t _6949_l = _12356_; _6949_l < _12357_; ++_6949_l)
                                  {
                                    {
                                      _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = _ptr__6900_wi32[safe_add( _6894_code,_6949_l )];
                                      _ptr__6923_rf64[safe_add( _6920_rcconst,_6940_codei )] = _ptr__6902_wf64[safe_add( _6896_cconst,_6949_l )];
                                      ++ _6940_codei;
                                    }
                                  }
                                  _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = 2;
                                  _ptr__6923_rf64[safe_add( _6920_rcconst,_6940_codei )] = _6947_s;
                                  ++ _6940_codei;
                                  _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = 5;
                                  ++ _6940_codei;
                                  _ptr__6921_ri32[safe_add( safe_add( _6919_rcodeptr,_6939_nzi ),(int)1 )] = _6940_codei;
                                  ++ _6939_nzi;
                                }
                              }
                              ++ _6941_k;
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      else
      {
        {
          int32_t _6950_k = (int)0;
          std::shared_ptr< monty::ndarray< int64_t,1 > > _6951_d = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)5)));
          _checked_ptr_1<int64_t> _ptr__6951_d(_6951_d ? _6951_d->raw() : nullptr,_6951_d ? _6951_d->size(0) : 0);
          _ptr__6951_d[(int)4] = (int)1;
          _ptr__6951_d[(int)3] = safe_mul( _ptr__6951_d[(int)4],_6903_d4 );
          _ptr__6951_d[(int)2] = safe_mul( _ptr__6951_d[(int)3],_6904_d3 );
          _ptr__6951_d[(int)1] = safe_mul( _ptr__6951_d[(int)2],_6905_d2 );
          _ptr__6951_d[(int)0] = safe_mul( _ptr__6951_d[(int)1],_6906_d1 );
          int32_t _12358_ = (int)0;
          int32_t _12359_ = _6889_nelem;
          for (int32_t _6952_k = _12358_; _6952_k < _12359_; ++_6952_k)
          {
            {
              int64_t _6953_idx = _ptr__6901_wi64[safe_add( _6898_sp,_6952_k )];
              int64_t _6954_i3 = ((_6953_idx / _ptr__6951_d[(int)3]) % _6904_d3);
              int64_t _6955_i1 = ((_6953_idx / _ptr__6951_d[(int)1]) % _6906_d1);
              double _12360_;
              bool _12361_ = (_6955_i1 != _6954_i3);
              if (_12361_)
              {
                _12360_ = _6924_scale;
              }
              else
              {
                _12360_ = 1.0;
              }
              double _6956_s = _12360_;
              int32_t _12362_ = _ptr__6900_wi32[safe_add( _6893_ptr,_6952_k )];
              int32_t _12363_ = _ptr__6900_wi32[safe_add( safe_add( _6893_ptr,_6952_k ),(int)1 )];
              for (int32_t _6957_j = _12362_; _6957_j < _12363_; ++_6957_j)
              {
                {
                  int32_t _12364_ = _ptr__6900_wi32[safe_add( _6895_codeptr,_6957_j )];
                  int32_t _12365_ = _ptr__6900_wi32[safe_add( safe_add( _6895_codeptr,_6957_j ),(int)1 )];
                  for (int32_t _6958_l = _12364_; _6958_l < _12365_; ++_6958_l)
                  {
                    {
                      _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = _ptr__6900_wi32[safe_add( _6894_code,_6958_l )];
                      _ptr__6923_rf64[safe_add( _6920_rcconst,_6940_codei )] = _ptr__6902_wf64[safe_add( _6896_cconst,_6958_l )];
                      ++ _6940_codei;
                    }
                  }
                  _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = 2;
                  _ptr__6923_rf64[safe_add( _6920_rcconst,_6940_codei )] = _6956_s;
                  ++ _6940_codei;
                  _ptr__6921_ri32[safe_add( _6918_rcode,_6940_codei )] = 5;
                  ++ _6940_codei;
                  _ptr__6921_ri32[safe_add( safe_add( _6919_rcodeptr,_6939_nzi ),(int)1 )] = _6940_codei;
                  ++ _6939_nzi;
                }
              }
            }
          }
        }
      }
    }
  }
  {}
}
// End mosek.fusion.ExprScaleVecPSD.eval

void mosek::fusion::p_ExprScaleVecPSD::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprScaleVecPSD::destroy() { mosek::fusion::p_ExprScaleVecPSD::_get_impl(this)->destroy(); }
// } class ExprScaleVecPSD
// class ExprDenseTril { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:778:4-1036:5
mosek::fusion::ExprDenseTril::ExprDenseTril(mosek::fusion::p_ExprDenseTril *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprDenseTril()" << this << std::endl; */ }
mosek::fusion::ExprDenseTril::~ExprDenseTril() {  /* std::cout << "~ExprDenseTril()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprDenseTril::p_ExprDenseTril
  (::mosek::fusion::ExprDenseTril * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprDenseTril.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:798:6-805:7
mosek::fusion::ExprDenseTril::t mosek::fusion::p_ExprDenseTril::_new_ExprDenseTril
  (int32_t _6959_dim0,
    int32_t _6960_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6961_expr,
    int32_t _6962_unchecked_)
{ return new mosek::fusion::ExprDenseTril(_6959_dim0,_6960_dim1,_6961_expr,_6962_unchecked_); }
mosek::fusion::ExprDenseTril::ExprDenseTril
  (int32_t _6959_dim0,
    int32_t _6960_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6961_expr,
    int32_t _6962_unchecked_) : 
   ExprDenseTril(new mosek::fusion::p_ExprDenseTril(this))
{ mosek::fusion::p_ExprDenseTril::_get_impl(this)->_initialize(_6959_dim0,_6960_dim1,_6961_expr,_6962_unchecked_); }
void mosek::fusion::p_ExprDenseTril::_initialize  (int32_t _6959_dim0,
    int32_t _6960_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _6961_expr,
    int32_t _6962_unchecked_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_6961_expr->getShape());
    mosek::fusion::p_ExprDenseTril::_get_impl(::mosek::fusion::ExprDenseTril::t(_pubthis))->expr = _6961_expr;
    mosek::fusion::p_ExprDenseTril::_get_impl(::mosek::fusion::ExprDenseTril::t(_pubthis))->dim0 = _6959_dim0;
    mosek::fusion::p_ExprDenseTril::_get_impl(::mosek::fusion::ExprDenseTril::t(_pubthis))->dim1 = _6960_dim1;
  }
}
// mosek.fusion.ExprDenseTril.ctor

// mosek.fusion.ExprDenseTril.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:785:6-796:7
mosek::fusion::ExprDenseTril::t mosek::fusion::p_ExprDenseTril::_new_ExprDenseTril
  (int32_t _6963_dim0_,
    int32_t _6964_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _6965_expr)
{ return new mosek::fusion::ExprDenseTril(_6963_dim0_,_6964_dim1_,_6965_expr); }
mosek::fusion::ExprDenseTril::ExprDenseTril
  (int32_t _6963_dim0_,
    int32_t _6964_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _6965_expr) : 
   ExprDenseTril(new mosek::fusion::p_ExprDenseTril(this))
{ mosek::fusion::p_ExprDenseTril::_get_impl(this)->_initialize(_6963_dim0_,_6964_dim1_,_6965_expr); }
void mosek::fusion::p_ExprDenseTril::_initialize  (int32_t _6963_dim0_,
    int32_t _6964_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _6965_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprDenseTril::_initialize(_6963_dim0_,_6964_dim1_,_6965_expr,(int)1);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _6966_shape = _6965_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__6966_shape(_6966_shape ? _6966_shape->raw() : nullptr,_6966_shape ? _6966_shape->size(0) : 0);
    if (((dim0 == dim1) || ((dim0 < (int)0) || ((dim0 >= (int)((_6966_shape)->size(0))) || ((dim1 < (int)0) || ((dim1 >= (int)((_6966_shape)->size(0))) || (_ptr__6966_shape[dim0] != _ptr__6966_shape[dim1])))))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid dimension definitions"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprDenseTril.ctor

// Begin mosek.fusion.ExprDenseTril.eval
// Method mosek.fusion.ExprDenseTril.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:807:6-1035:7
void mosek::fusion::ExprDenseTril :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6967_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6968_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6969_xs) { mosek::fusion::p_ExprDenseTril::_get_impl(this)->eval(_6967_rs,_6968_ws,_6969_xs); }
void mosek::fusion::p_ExprDenseTril::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _6967_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _6968_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _6969_xs)
{
  expr->eval(_6968_ws,_6967_rs,_6969_xs);
  _6968_ws->pop_expr();
  int32_t _6970_nd = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->nd;
  int32_t _6971_nnz = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->nnz;
  int32_t _6972_nelem = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->nelem;
  int32_t _6973_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->ncodeatom;
  bool _6974_hassp = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->hassp;
  int32_t _6975_shape = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->shape_base;
  int32_t _6976_ptr = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->ptr_base;
  int32_t _6977_code = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->code_base;
  int32_t _6978_codeptr = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->codeptr_base;
  int32_t _6979_cconst = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->cconst_base;
  int32_t _6980_nidxs = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->nidxs_base;
  int32_t _6981_sp = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->sp_base;
  int32_t _6982_cof = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->cof_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6983_wi32 = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__6983_wi32(_6983_wi32 ? _6983_wi32->raw() : nullptr,_6983_wi32 ? _6983_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _6984_wi64 = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__6984_wi64(_6984_wi64 ? _6984_wi64->raw() : nullptr,_6984_wi64 ? _6984_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _6985_wf64 = mosek::fusion::p_WorkStack::_get_impl(_6968_ws)->f64;
  _checked_ptr_1<double> _ptr__6985_wf64(_6985_wf64 ? _6985_wf64->raw() : nullptr,_6985_wf64 ? _6985_wf64->size(0) : 0);
  int32_t _12366_;
  bool _12367_ = (dim0 < dim1);
  if (_12367_)
  {
    _12366_ = dim0;
  }
  else
  {
    _12366_ = dim1;
  }
  int32_t _6986_xdim0 = _12366_;
  int32_t _12368_;
  bool _12369_ = (dim0 > dim1);
  if (_12369_)
  {
    _12368_ = dim0;
  }
  else
  {
    _12368_ = dim1;
  }
  int32_t _6987_xdim1 = _12368_;
  bool _6988_tril = (dim0 < dim1);
  if (((dim0 == dim1) || ((dim0 < (int)0) || ((dim0 >= _6970_nd) || ((dim1 < (int)0) || (dim1 >= _6970_nd))))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid symmetry dimensions"));
    }
  }
  else if((_ptr__6983_wi32[safe_add( _6975_shape,dim0 )] != _ptr__6983_wi32[safe_add( _6975_shape,dim1 )]))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Not symmetric in given dimensions"));
    }
  }
  {}
  std::vector<int32_t> _12370_;
  for (int32_t _6990_i = (int)0, _12371_ = (int)5; _6990_i < _12371_ ; ++_6990_i)
  {
    _12370_.push_back((int)1);
  }
  auto _12372_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12370_.size()),_12370_.begin(),_12370_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6989_dim = _12372_;
  _checked_ptr_1<int32_t> _ptr__6989_dim(_6989_dim ? _6989_dim->raw() : nullptr,_6989_dim ? _6989_dim->size(0) : 0);
  int32_t _12373_ = (int)0;
  int32_t _12374_ = _6986_xdim0;
  for (int32_t _6991_i = _12373_; _6991_i < _12374_; ++_6991_i)
  {
    {
      _ptr__6989_dim[(int)0] *= _ptr__6983_wi32[safe_add( _6975_shape,_6991_i )];
    }
  }
  _ptr__6989_dim[(int)1] = _ptr__6983_wi32[safe_add( _6975_shape,dim0 )];
  int32_t _12375_ = safe_add( _6986_xdim0,(int)1 );
  int32_t _12376_ = _6987_xdim1;
  for (int32_t _6992_i = _12375_; _6992_i < _12376_; ++_6992_i)
  {
    {
      _ptr__6989_dim[(int)2] *= _ptr__6983_wi32[safe_add( _6975_shape,_6992_i )];
    }
  }
  _ptr__6989_dim[(int)3] = _ptr__6983_wi32[safe_add( _6975_shape,dim1 )];
  int32_t _12377_ = safe_add( _6987_xdim1,(int)1 );
  int32_t _12378_ = _6970_nd;
  for (int32_t _6993_i = _12377_; _6993_i < _12378_; ++_6993_i)
  {
    {
      _ptr__6989_dim[(int)4] *= _ptr__6983_wi32[safe_add( _6975_shape,_6993_i )];
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _6994_stride = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)5)));
  _checked_ptr_1<int32_t> _ptr__6994_stride(_6994_stride ? _6994_stride->raw() : nullptr,_6994_stride ? _6994_stride->size(0) : 0);
  _ptr__6994_stride[(int)4] = (int)1;
  int32_t _12379_ = (int)1;
  int32_t _12380_ = (int)5;
  for (int32_t _6995_i = _12379_; _6995_i < _12380_; ++_6995_i)
  {
    {
      _ptr__6994_stride[(((int)5 - _6995_i) - (int)1)] = safe_mul( _ptr__6994_stride[((int)5 - _6995_i)],_ptr__6989_dim[((int)5 - _6995_i)] );
    }
  }
  int32_t _6996_rnnz = (int)0;
  int32_t _6997_rnelem = safe_mul( safe_mul( safe_mul( _ptr__6989_dim[(int)0],_ptr__6989_dim[(int)2] ),_ptr__6989_dim[(int)4] ),(safe_mul( _ptr__6989_dim[(int)1],safe_add( _ptr__6989_dim[(int)1],(int)1 ) ) / (int)2) );
  int32_t _6998_rncodeatom = (int)0;
  {
    if (_6974_hassp)
    {
      {
        int32_t _6999_d = _ptr__6989_dim[(int)1];
        if (_6988_tril)
        {
          {
            int32_t _12381_ = (int)0;
            int32_t _12382_ = _6972_nelem;
            for (int32_t _7000_i = _12381_; _7000_i < _12382_; ++_7000_i)
            {
              {
                int64_t _7001_subi = ((_ptr__6984_wi64[safe_add( _6981_sp,_7000_i )] / _ptr__6994_stride[(int)1]) % _6999_d);
                int64_t _7002_subj = ((_ptr__6984_wi64[safe_add( _6981_sp,_7000_i )] / _ptr__6994_stride[(int)3]) % _6999_d);
                if ((_7001_subi >= _7002_subj))
                {
                  {
                    _6996_rnnz += (_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7000_i ),(int)1 )] - _ptr__6983_wi32[safe_add( _6976_ptr,_7000_i )]);
                    if ((_6973_ncodeatom > (int)0))
                    {
                      {
                        _6998_rncodeatom += (_ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7000_i ),(int)1 )] )] - _ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( _6976_ptr,_7000_i )] )]);
                      }
                    }
                    {}
                  }
                }
                {}
              }
            }
          }
        }
        else
        {
          {
            int32_t _12383_ = (int)0;
            int32_t _12384_ = _6972_nelem;
            for (int32_t _7003_i = _12383_; _7003_i < _12384_; ++_7003_i)
            {
              {
                int64_t _7004_subi = ((_ptr__6984_wi64[safe_add( _6981_sp,_7003_i )] / _ptr__6994_stride[(int)1]) % _ptr__6989_dim[(int)1]);
                int64_t _7005_subj = ((_ptr__6984_wi64[safe_add( _6981_sp,_7003_i )] / _ptr__6994_stride[(int)3]) % _ptr__6989_dim[(int)3]);
                if ((_7004_subi <= _7005_subj))
                {
                  {
                    _6996_rnnz += (_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7003_i ),(int)1 )] - _ptr__6983_wi32[safe_add( _6976_ptr,_7003_i )]);
                    if ((_6973_ncodeatom > (int)0))
                    {
                      {
                        _6998_rncodeatom += (_ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7003_i ),(int)1 )] )] - _ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( _6976_ptr,_7003_i )] )]);
                      }
                    }
                    {}
                  }
                }
                {}
              }
            }
          }
        }
      }
    }
    else
    {
      {
        if (_6988_tril)
        {
          {
            int32_t _12385_ = (int)0;
            int32_t _12386_ = _ptr__6989_dim[(int)0];
            for (int32_t _7006_i0 = _12385_; _7006_i0 < _12386_; ++_7006_i0)
            {
              {
                int32_t _12387_ = (int)0;
                int32_t _12388_ = _ptr__6989_dim[(int)1];
                for (int32_t _7007_i1 = _12387_; _7007_i1 < _12388_; ++_7007_i1)
                {
                  {
                    int32_t _12389_ = (int)0;
                    int32_t _12390_ = _ptr__6989_dim[(int)2];
                    for (int32_t _7008_i2 = _12389_; _7008_i2 < _12390_; ++_7008_i2)
                    {
                      {
                        int32_t _12391_ = (int)0;
                        int32_t _12392_ = safe_add( _7007_i1,(int)1 );
                        for (int32_t _7009_i3 = _12391_; _7009_i3 < _12392_; ++_7009_i3)
                        {
                          {
                            int32_t _12393_ = (int)0;
                            int32_t _12394_ = _ptr__6989_dim[(int)4];
                            for (int32_t _7010_i4 = _12393_; _7010_i4 < _12394_; ++_7010_i4)
                            {
                              {
                                int32_t _7011_p = safe_add( safe_add( safe_add( safe_add( safe_mul( _7006_i0,_ptr__6994_stride[(int)0] ),safe_mul( _7007_i1,_ptr__6994_stride[(int)1] ) ),safe_mul( _7008_i2,_ptr__6994_stride[(int)2] ) ),safe_mul( _7009_i3,_ptr__6994_stride[(int)3] ) ),safe_mul( _7010_i4,_ptr__6994_stride[(int)4] ) );
                                _6996_rnnz += (_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7011_p ),(int)1 )] - _ptr__6983_wi32[safe_add( _6976_ptr,_7011_p )]);
                                if ((_6973_ncodeatom > (int)0))
                                {
                                  {
                                    _6998_rncodeatom += (_ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7011_p ),(int)1 )] )] - _ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( _6976_ptr,_7011_p )] )]);
                                  }
                                }
                                {}
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        else
        {
          {
            int32_t _12395_ = (int)0;
            int32_t _12396_ = _ptr__6989_dim[(int)0];
            for (int32_t _7012_i0 = _12395_; _7012_i0 < _12396_; ++_7012_i0)
            {
              {
                int32_t _12397_ = (int)0;
                int32_t _12398_ = _ptr__6989_dim[(int)1];
                for (int32_t _7013_i1 = _12397_; _7013_i1 < _12398_; ++_7013_i1)
                {
                  {
                    int32_t _12399_ = (int)0;
                    int32_t _12400_ = _ptr__6989_dim[(int)2];
                    for (int32_t _7014_i2 = _12399_; _7014_i2 < _12400_; ++_7014_i2)
                    {
                      {
                        int32_t _12401_ = _7013_i1;
                        int32_t _12402_ = _ptr__6989_dim[(int)3];
                        for (int32_t _7015_i3 = _12401_; _7015_i3 < _12402_; ++_7015_i3)
                        {
                          {
                            int32_t _12403_ = (int)0;
                            int32_t _12404_ = _ptr__6989_dim[(int)4];
                            for (int32_t _7016_i4 = _12403_; _7016_i4 < _12404_; ++_7016_i4)
                            {
                              {
                                int32_t _7017_p = safe_add( safe_add( safe_add( safe_add( safe_mul( _7012_i0,_ptr__6994_stride[(int)0] ),safe_mul( _7013_i1,_ptr__6994_stride[(int)1] ) ),safe_mul( _7014_i2,_ptr__6994_stride[(int)2] ) ),safe_mul( _7015_i3,_ptr__6994_stride[(int)3] ) ),safe_mul( _7016_i4,_ptr__6994_stride[(int)4] ) );
                                _6996_rnnz += (_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7017_p ),(int)1 )] - _ptr__6983_wi32[safe_add( _6976_ptr,_7017_p )]);
                                if ((_6973_ncodeatom > (int)0))
                                {
                                  {
                                    _6998_rncodeatom += (_ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7017_p ),(int)1 )] )] - _ptr__6983_wi32[safe_add( _6978_codeptr,_ptr__6983_wi32[safe_add( _6976_ptr,_7017_p )] )]);
                                  }
                                }
                                {}
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  int32_t _7018_fullnelem = (safe_mul( safe_mul( safe_mul( safe_mul( _ptr__6989_dim[(int)0],_ptr__6989_dim[(int)2] ),_ptr__6989_dim[(int)4] ),_ptr__6989_dim[(int)1] ),safe_add( _ptr__6989_dim[(int)1],(int)1 ) ) / (int)2);
  _6967_rs->alloc_expr(_6970_nd,_6997_rnelem,_6996_rnnz,true,_6998_rncodeatom);
  int32_t _7019_rptr = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->ptr_base;
  int32_t _7020_rshape = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->shape_base;
  int32_t _7021_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->nidxs_base;
  int32_t _7022_rsp = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->sp_base;
  int32_t _7023_rcof = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->cof_base;
  int32_t _7024_rcode = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->code_base;
  int32_t _7025_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->codeptr_base;
  int32_t _7026_rcconst = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7027_ri32 = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__7027_ri32(_7027_ri32 ? _7027_ri32->raw() : nullptr,_7027_ri32 ? _7027_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7028_ri64 = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__7028_ri64(_7028_ri64 ? _7028_ri64->raw() : nullptr,_7028_ri64 ? _7028_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7029_rf64 = mosek::fusion::p_WorkStack::_get_impl(_6967_rs)->f64;
  _checked_ptr_1<double> _ptr__7029_rf64(_7029_rf64 ? _7029_rf64->raw() : nullptr,_7029_rf64 ? _7029_rf64->size(0) : 0);
  _ptr__7027_ri32[_7019_rptr] = (int)0;
  if ((_6998_rncodeatom > (int)0))
  {
    {
      _ptr__7027_ri32[_7025_rcodeptr] = (int)0;
    }
  }
  {}
  int32_t _12405_ = (int)0;
  int32_t _12406_ = _6970_nd;
  for (int32_t _7030_i = _12405_; _7030_i < _12406_; ++_7030_i)
  {
    {
      _ptr__7027_ri32[safe_add( _7020_rshape,_7030_i )] = _ptr__6983_wi32[safe_add( _6975_shape,_7030_i )];
    }
  }
  if (_6988_tril)
  {
    {
      int32_t _7031_k = (int)0;
      int32_t _12407_ = (int)0;
      int32_t _12408_ = _ptr__6989_dim[(int)0];
      for (int32_t _7032_i0 = _12407_; _7032_i0 < _12408_; ++_7032_i0)
      {
        {
          int32_t _12409_ = (int)0;
          int32_t _12410_ = _ptr__6989_dim[(int)1];
          for (int32_t _7033_i1 = _12409_; _7033_i1 < _12410_; ++_7033_i1)
          {
            {
              int32_t _12411_ = (int)0;
              int32_t _12412_ = _ptr__6989_dim[(int)2];
              for (int32_t _7034_i2 = _12411_; _7034_i2 < _12412_; ++_7034_i2)
              {
                {
                  int32_t _12413_ = (int)0;
                  int32_t _12414_ = safe_add( _7033_i1,(int)1 );
                  for (int32_t _7035_i3 = _12413_; _7035_i3 < _12414_; ++_7035_i3)
                  {
                    {
                      int32_t _12415_ = (int)0;
                      int32_t _12416_ = _ptr__6989_dim[(int)4];
                      for (int32_t _7036_i4 = _12415_; _7036_i4 < _12416_; ++_7036_i4)
                      {
                        {
                          _ptr__7028_ri64[safe_add( _7022_rsp,_7031_k )] = safe_add( safe_add( safe_add( safe_add( safe_mul( _7032_i0,_ptr__6994_stride[(int)0] ),safe_mul( _7033_i1,_ptr__6994_stride[(int)1] ) ),safe_mul( _7034_i2,_ptr__6994_stride[(int)2] ) ),safe_mul( _7035_i3,_ptr__6994_stride[(int)3] ) ),safe_mul( _7036_i4,_ptr__6994_stride[(int)4] ) );
                          ++ _7031_k;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if ((_7031_k != _6997_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nelem"));
        }
      }
      {}
    }
  }
  else
  {
    {
      int32_t _7037_k = (int)0;
      int32_t _12417_ = (int)0;
      int32_t _12418_ = _ptr__6989_dim[(int)0];
      for (int32_t _7038_i0 = _12417_; _7038_i0 < _12418_; ++_7038_i0)
      {
        {
          int32_t _12419_ = (int)0;
          int32_t _12420_ = _ptr__6989_dim[(int)1];
          for (int32_t _7039_i1 = _12419_; _7039_i1 < _12420_; ++_7039_i1)
          {
            {
              int32_t _12421_ = (int)0;
              int32_t _12422_ = _ptr__6989_dim[(int)2];
              for (int32_t _7040_i2 = _12421_; _7040_i2 < _12422_; ++_7040_i2)
              {
                {
                  int32_t _12423_ = _7039_i1;
                  int32_t _12424_ = _ptr__6989_dim[(int)3];
                  for (int32_t _7041_i3 = _12423_; _7041_i3 < _12424_; ++_7041_i3)
                  {
                    {
                      int32_t _12425_ = (int)0;
                      int32_t _12426_ = _ptr__6989_dim[(int)4];
                      for (int32_t _7042_i4 = _12425_; _7042_i4 < _12426_; ++_7042_i4)
                      {
                        {
                          _ptr__7028_ri64[safe_add( _7022_rsp,_7037_k )] = safe_add( safe_add( safe_add( safe_add( safe_mul( _7038_i0,_ptr__6994_stride[(int)0] ),safe_mul( _7039_i1,_ptr__6994_stride[(int)1] ) ),safe_mul( _7040_i2,_ptr__6994_stride[(int)2] ) ),safe_mul( _7041_i3,_ptr__6994_stride[(int)3] ) ),safe_mul( _7042_i4,_ptr__6994_stride[(int)4] ) );
                          ++ _7037_k;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if ((_7037_k != _6997_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nelem"));
        }
      }
      {}
    }
  }
  {
    int32_t _7043_nzi = (int)0;
    int32_t _7044_codei = (int)0;
    if (_6974_hassp)
    {
      {
        int32_t _7045_i1 = (int)0;
        int32_t _7046_i0 = (int)0;
        while ( ((_7046_i0 < _6972_nelem) && (_7045_i1 < _7018_fullnelem)) )
        {
          {
            if ((_ptr__6984_wi64[safe_add( _6981_sp,_7046_i0 )] < _ptr__7028_ri64[safe_add( _7022_rsp,_7045_i1 )]))
            {
              {
                ++ _7046_i0;
              }
            }
            else if((_ptr__6984_wi64[safe_add( _6981_sp,_7046_i0 )] > _ptr__7028_ri64[safe_add( _7022_rsp,_7045_i1 )]))
            {
              {
                _ptr__7027_ri32[safe_add( safe_add( _7019_rptr,_7045_i1 ),(int)1 )] = _7043_nzi;
                ++ _7045_i1;
              }
            }
            else
            {
              {
                int32_t _12427_ = _ptr__6983_wi32[safe_add( _6976_ptr,_7046_i0 )];
                int32_t _12428_ = _ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7046_i0 ),(int)1 )];
                for (int32_t _7047_j = _12427_; _7047_j < _12428_; ++_7047_j)
                {
                  {
                    _ptr__7028_ri64[safe_add( _7021_rnidxs,_7043_nzi )] = _ptr__6984_wi64[safe_add( _6980_nidxs,_7047_j )];
                    _ptr__7029_rf64[safe_add( _7023_rcof,_7043_nzi )] = _ptr__6985_wf64[safe_add( _6982_cof,_7047_j )];
                    if ((_6998_rncodeatom > (int)0))
                    {
                      {
                        int32_t _12429_ = _ptr__6983_wi32[safe_add( _6978_codeptr,_7047_j )];
                        int32_t _12430_ = _ptr__6983_wi32[safe_add( safe_add( _6978_codeptr,_7047_j ),(int)1 )];
                        for (int32_t _7048_k = _12429_; _7048_k < _12430_; ++_7048_k)
                        {
                          {
                            _ptr__7027_ri32[safe_add( _7024_rcode,_7044_codei )] = _ptr__6983_wi32[safe_add( _6977_code,_7048_k )];
                            _ptr__7029_rf64[safe_add( _7026_rcconst,_7044_codei )] = _ptr__6985_wf64[safe_add( _6979_cconst,_7048_k )];
                            ++ _7044_codei;
                          }
                        }
                        _ptr__7027_ri32[safe_add( safe_add( _7025_rcodeptr,_7043_nzi ),(int)1 )] = _7044_codei;
                      }
                    }
                    {}
                    ++ _7043_nzi;
                  }
                }
                _ptr__7027_ri32[safe_add( safe_add( _7019_rptr,_7045_i1 ),(int)1 )] = _7043_nzi;
                ++ _7046_i0;
                ++ _7045_i1;
              }
            }
          }
        }
        while ( (_7045_i1 < _7018_fullnelem) )
        {
          {
            _ptr__7027_ri32[safe_add( safe_add( _7019_rptr,_7045_i1 ),(int)1 )] = _7043_nzi;
            ++ _7045_i1;
          }
        }
      }
    }
    else
    {
      {
        int32_t _12431_ = (int)0;
        int32_t _12432_ = _7018_fullnelem;
        for (int32_t _7049_i = _12431_; _7049_i < _12432_; ++_7049_i)
        {
          {
            int64_t _7050_i0 = _ptr__7028_ri64[safe_add( _7022_rsp,_7049_i )];
            int32_t _12433_ = _ptr__6983_wi32[safe_add( _6976_ptr,_7050_i0 )];
            int32_t _12434_ = _ptr__6983_wi32[safe_add( safe_add( _6976_ptr,_7050_i0 ),(int)1 )];
            for (int32_t _7051_j = _12433_; _7051_j < _12434_; ++_7051_j)
            {
              {
                _ptr__7028_ri64[safe_add( _7021_rnidxs,_7043_nzi )] = _ptr__6984_wi64[safe_add( _6980_nidxs,_7051_j )];
                _ptr__7029_rf64[safe_add( _7023_rcof,_7043_nzi )] = _ptr__6985_wf64[safe_add( _6982_cof,_7051_j )];
                if ((_6998_rncodeatom > (int)0))
                {
                  {
                    int32_t _12435_ = _ptr__6983_wi32[safe_add( _6978_codeptr,_7051_j )];
                    int32_t _12436_ = _ptr__6983_wi32[safe_add( safe_add( _6978_codeptr,_7051_j ),(int)1 )];
                    for (int32_t _7052_k = _12435_; _7052_k < _12436_; ++_7052_k)
                    {
                      {
                        _ptr__7027_ri32[safe_add( _7024_rcode,_7044_codei )] = _ptr__6983_wi32[safe_add( _6977_code,_7052_k )];
                        _ptr__7029_rf64[safe_add( _7026_rcconst,_7044_codei )] = _ptr__6985_wf64[safe_add( _6979_cconst,_7052_k )];
                        ++ _7044_codei;
                      }
                    }
                    _ptr__7027_ri32[safe_add( safe_add( _7025_rcodeptr,_7043_nzi ),(int)1 )] = _7044_codei;
                  }
                }
                {}
                ++ _7043_nzi;
              }
            }
            _ptr__7027_ri32[safe_add( safe_add( _7019_rptr,_7049_i ),(int)1 )] = _7043_nzi;
          }
        }
      }
    }
    if ((_7043_nzi != _6996_rnnz))
    {
      {
        throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nnz"));
      }
    }
    {}
  }
}
// End mosek.fusion.ExprDenseTril.eval

// Begin mosek.fusion.ExprDenseTril.toString
// Method mosek.fusion.ExprDenseTril.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:782:6-784:7
std::string mosek::fusion::ExprDenseTril :: toString() { return mosek::fusion::p_ExprDenseTril::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprDenseTril::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprDenseTril(symdim=("))->__mosek_2fusion_2Utils_2StringBuffer__a(dim0)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(dim1)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("),"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprDenseTril.toString

void mosek::fusion::p_ExprDenseTril::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprDenseTril::destroy() { mosek::fusion::p_ExprDenseTril::_get_impl(this)->destroy(); }
// } class ExprDenseTril
// class ExprDense { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:691:4-770:5
mosek::fusion::ExprDense::ExprDense(mosek::fusion::p_ExprDense *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprDense()" << this << std::endl; */ }
mosek::fusion::ExprDense::~ExprDense() {  /* std::cout << "~ExprDense()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprDense::p_ExprDense
  (::mosek::fusion::ExprDense * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprDense.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:694:6-697:7
mosek::fusion::ExprDense::t mosek::fusion::p_ExprDense::_new_ExprDense
  (monty::rc_ptr< ::mosek::fusion::Expression > _7053_expr)
{ return new mosek::fusion::ExprDense(_7053_expr); }
mosek::fusion::ExprDense::ExprDense
  (monty::rc_ptr< ::mosek::fusion::Expression > _7053_expr) : 
   ExprDense(new mosek::fusion::p_ExprDense(this))
{ mosek::fusion::p_ExprDense::_get_impl(this)->_initialize(_7053_expr); }
void mosek::fusion::p_ExprDense::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7053_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_7053_expr->getShape());
    mosek::fusion::p_ExprDense::_get_impl(::mosek::fusion::ExprDense::t(_pubthis))->expr = _7053_expr;
  }
}
// mosek.fusion.ExprDense.ctor

// Begin mosek.fusion.ExprDense.eval
// Method mosek.fusion.ExprDense.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:701:6-769:7
void mosek::fusion::ExprDense :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7054_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7055_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7056_xs) { mosek::fusion::p_ExprDense::_get_impl(this)->eval(_7054_rs,_7055_ws,_7056_xs); }
void mosek::fusion::p_ExprDense::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7054_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7055_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7056_xs)
{
  expr->eval(_7055_ws,_7054_rs,_7056_xs);
  _7055_ws->pop_expr();
  int32_t _7057_nd = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->nd;
  int32_t _7058_nnz = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->nnz;
  int32_t _7059_nelem = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->nelem;
  int32_t _7060_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->ncodeatom;
  bool _7061_hassp = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->hassp;
  int32_t _7062_shape = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->shape_base;
  int32_t _7063_ptr = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->ptr_base;
  int32_t _7064_nidxs = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->nidxs_base;
  int32_t _7065_cof = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->cof_base;
  int32_t _7066_sp = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->sp_base;
  int32_t _7067_codeptr = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->codeptr_base;
  int32_t _7068_code = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->code_base;
  int32_t _7069_cconst = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7070_wi32 = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__7070_wi32(_7070_wi32 ? _7070_wi32->raw() : nullptr,_7070_wi32 ? _7070_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7071_wi64 = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__7071_wi64(_7071_wi64 ? _7071_wi64->raw() : nullptr,_7071_wi64 ? _7071_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7072_wf64 = mosek::fusion::p_WorkStack::_get_impl(_7055_ws)->f64;
  _checked_ptr_1<double> _ptr__7072_wf64(_7072_wf64 ? _7072_wf64->raw() : nullptr,_7072_wf64 ? _7072_wf64->size(0) : 0);
  int32_t _7073_rnelem = (int)1;
  if (_7061_hassp)
  {
    {
      bool _7074_ok = true;
      int32_t _12437_ = (int)0;
      int32_t _12438_ = _7057_nd;
      for (int32_t _7075_i = _12437_; _7075_i < _12438_; ++_7075_i)
      {
        {
          int32_t _7076_szx = safe_mul( _7073_rnelem,_ptr__7070_wi32[safe_add( _7062_shape,_7075_i )] );
          _7074_ok = (_7074_ok && ((_ptr__7070_wi32[safe_add( _7062_shape,_7075_i )] == (int)0) || ((_7076_szx / _ptr__7070_wi32[safe_add( _7062_shape,_7075_i )]) == _7073_rnelem)));
          _7073_rnelem = _7076_szx;
        }
      }
      if ((!_7074_ok))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("The domain is too large"));
        }
      }
      {}
    }
  }
  else
  {
    {
      _7073_rnelem = _7059_nelem;
    }
  }
  _7054_rs->alloc_expr(_7057_nd,_7073_rnelem,_7058_nnz,false,_7060_ncodeatom);
  int32_t _7077_rshape = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->shape_base;
  int32_t _7078_rptr = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->ptr_base;
  int32_t _7079_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->nidxs_base;
  int32_t _7080_rcof = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->cof_base;
  int32_t _7081_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->codeptr_base;
  int32_t _7082_rcode = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->code_base;
  int32_t _7083_rcconst = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->cconst_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7084_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__7084_ri32(_7084_ri32 ? _7084_ri32->raw() : nullptr,_7084_ri32 ? _7084_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7085_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__7085_ri64(_7085_ri64 ? _7085_ri64->raw() : nullptr,_7085_ri64 ? _7085_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7086_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7054_rs)->f64;
  _checked_ptr_1<double> _ptr__7086_rf64(_7086_rf64 ? _7086_rf64->raw() : nullptr,_7086_rf64 ? _7086_rf64->size(0) : 0);
  {
    int32_t _12439_ = (int)0;
    int32_t _12440_ = _7057_nd;
    for (int32_t _7087_i = _12439_; _7087_i < _12440_; ++_7087_i)
    {
      {
        _ptr__7084_ri32[safe_add( _7077_rshape,_7087_i )] = _ptr__7070_wi32[safe_add( _7062_shape,_7087_i )];
      }
    }
    int32_t _12441_ = (int)0;
    int32_t _12442_ = _7058_nnz;
    for (int32_t _7088_i = _12441_; _7088_i < _12442_; ++_7088_i)
    {
      {
        _ptr__7085_ri64[safe_add( _7079_rnidxs,_7088_i )] = _ptr__7071_wi64[safe_add( _7064_nidxs,_7088_i )];
      }
    }
    int32_t _12443_ = (int)0;
    int32_t _12444_ = _7058_nnz;
    for (int32_t _7089_i = _12443_; _7089_i < _12444_; ++_7089_i)
    {
      {
        _ptr__7086_rf64[safe_add( _7080_rcof,_7089_i )] = _ptr__7072_wf64[safe_add( _7065_cof,_7089_i )];
      }
    }
    if ((_7060_ncodeatom > (int)0))
    {
      {
        int32_t _12445_ = (int)0;
        int32_t _12446_ = safe_add( _7058_nnz,(int)1 );
        for (int32_t _7090_i = _12445_; _7090_i < _12446_; ++_7090_i)
        {
          {
            _ptr__7084_ri32[safe_add( _7081_rcodeptr,_7090_i )] = _ptr__7070_wi32[safe_add( _7067_codeptr,_7090_i )];
          }
        }
        int32_t _12447_ = (int)0;
        int32_t _12448_ = _7060_ncodeatom;
        for (int32_t _7091_i = _12447_; _7091_i < _12448_; ++_7091_i)
        {
          {
            _ptr__7084_ri32[safe_add( _7082_rcode,_7091_i )] = _ptr__7070_wi32[safe_add( _7068_code,_7091_i )];
          }
        }
        int32_t _12449_ = (int)0;
        int32_t _12450_ = _7060_ncodeatom;
        for (int32_t _7092_i = _12449_; _7092_i < _12450_; ++_7092_i)
        {
          {
            _ptr__7086_rf64[safe_add( _7083_rcconst,_7092_i )] = _ptr__7072_wf64[safe_add( _7069_cconst,_7092_i )];
          }
        }
      }
    }
    {}
    if ((!_7061_hassp))
    {
      {
        int32_t _12451_ = (int)0;
        int32_t _12452_ = safe_add( _7073_rnelem,(int)1 );
        for (int32_t _7093_i = _12451_; _7093_i < _12452_; ++_7093_i)
        {
          {
            _ptr__7084_ri32[safe_add( _7078_rptr,_7093_i )] = _ptr__7070_wi32[safe_add( _7063_ptr,_7093_i )];
          }
        }
      }
    }
    else
    {
      {
        int32_t _12453_ = (int)0;
        int32_t _12454_ = safe_add( _7073_rnelem,(int)1 );
        for (int32_t _7094_i = _12453_; _7094_i < _12454_; ++_7094_i)
        {
          {
            _ptr__7084_ri32[safe_add( _7078_rptr,_7094_i )] = (int)0;
          }
        }
        int32_t _12455_ = (int)0;
        int32_t _12456_ = _7059_nelem;
        for (int32_t _7095_i = _12455_; _7095_i < _12456_; ++_7095_i)
        {
          {
            _ptr__7084_ri32[safe_add( safe_add( _7078_rptr,_ptr__7071_wi64[safe_add( _7066_sp,_7095_i )] ),(int)1 )] = (_ptr__7070_wi32[safe_add( safe_add( _7063_ptr,_7095_i ),(int)1 )] - _ptr__7070_wi32[safe_add( _7063_ptr,_7095_i )]);
          }
        }
        int32_t _12457_ = (int)0;
        int32_t _12458_ = _7073_rnelem;
        for (int32_t _7096_i = _12457_; _7096_i < _12458_; ++_7096_i)
        {
          {
            _ptr__7084_ri32[safe_add( safe_add( _7078_rptr,_7096_i ),(int)1 )] += _ptr__7084_ri32[safe_add( _7078_rptr,_7096_i )];
          }
        }
      }
    }
  }
}
// End mosek.fusion.ExprDense.eval

// Begin mosek.fusion.ExprDense.toString
// Method mosek.fusion.ExprDense.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:699:6-127
std::string mosek::fusion::ExprDense :: toString() { return mosek::fusion::p_ExprDense::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprDense::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprDense("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprDense.toString

void mosek::fusion::p_ExprDense::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprDense::destroy() { mosek::fusion::p_ExprDense::_get_impl(this)->destroy(); }
// } class ExprDense
// class ExprSymmetrize { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:148:4-684:5
mosek::fusion::ExprSymmetrize::ExprSymmetrize(mosek::fusion::p_ExprSymmetrize *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprSymmetrize()" << this << std::endl; */ }
mosek::fusion::ExprSymmetrize::~ExprSymmetrize() {  /* std::cout << "~ExprSymmetrize()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprSymmetrize::p_ExprSymmetrize
  (::mosek::fusion::ExprSymmetrize * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprSymmetrize.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:165:6-178:7
mosek::fusion::ExprSymmetrize::t mosek::fusion::p_ExprSymmetrize::_new_ExprSymmetrize
  (int32_t _7097_dim0,
    int32_t _7098_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7099_expr,
    int32_t _7100_unchecked_)
{ return new mosek::fusion::ExprSymmetrize(_7097_dim0,_7098_dim1,_7099_expr,_7100_unchecked_); }
mosek::fusion::ExprSymmetrize::ExprSymmetrize
  (int32_t _7097_dim0,
    int32_t _7098_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7099_expr,
    int32_t _7100_unchecked_) : 
   ExprSymmetrize(new mosek::fusion::p_ExprSymmetrize(this))
{ mosek::fusion::p_ExprSymmetrize::_get_impl(this)->_initialize(_7097_dim0,_7098_dim1,_7099_expr,_7100_unchecked_); }
void mosek::fusion::p_ExprSymmetrize::_initialize  (int32_t _7097_dim0,
    int32_t _7098_dim1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7099_expr,
    int32_t _7100_unchecked_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_7099_expr->getShape());
    mosek::fusion::p_ExprSymmetrize::_get_impl(::mosek::fusion::ExprSymmetrize::t(_pubthis))->expr = _7099_expr;
    if ((_7097_dim0 < _7098_dim1))
    {
      {
        mosek::fusion::p_ExprSymmetrize::_get_impl(::mosek::fusion::ExprSymmetrize::t(_pubthis))->dim0 = _7097_dim0;
        mosek::fusion::p_ExprSymmetrize::_get_impl(::mosek::fusion::ExprSymmetrize::t(_pubthis))->dim1 = _7098_dim1;
      }
    }
    else
    {
      {
        mosek::fusion::p_ExprSymmetrize::_get_impl(::mosek::fusion::ExprSymmetrize::t(_pubthis))->dim0 = _7098_dim1;
        mosek::fusion::p_ExprSymmetrize::_get_impl(::mosek::fusion::ExprSymmetrize::t(_pubthis))->dim1 = _7097_dim0;
      }
    }
  }
}
// mosek.fusion.ExprSymmetrize.ctor

// mosek.fusion.ExprSymmetrize.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:157:6-163:7
mosek::fusion::ExprSymmetrize::t mosek::fusion::p_ExprSymmetrize::_new_ExprSymmetrize
  (int32_t _7101_dim0_,
    int32_t _7102_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _7103_expr)
{ return new mosek::fusion::ExprSymmetrize(_7101_dim0_,_7102_dim1_,_7103_expr); }
mosek::fusion::ExprSymmetrize::ExprSymmetrize
  (int32_t _7101_dim0_,
    int32_t _7102_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _7103_expr) : 
   ExprSymmetrize(new mosek::fusion::p_ExprSymmetrize(this))
{ mosek::fusion::p_ExprSymmetrize::_get_impl(this)->_initialize(_7101_dim0_,_7102_dim1_,_7103_expr); }
void mosek::fusion::p_ExprSymmetrize::_initialize  (int32_t _7101_dim0_,
    int32_t _7102_dim1_,
    monty::rc_ptr< ::mosek::fusion::Expression > _7103_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprSymmetrize::_initialize(_7101_dim0_,_7102_dim1_,_7103_expr,(int)1);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7104_shape = _7103_expr->getShape();
    _checked_ptr_1<int32_t> _ptr__7104_shape(_7104_shape ? _7104_shape->raw() : nullptr,_7104_shape ? _7104_shape->size(0) : 0);
    if (((dim0 < (int)0) || ((dim0 == dim1) || ((dim1 >= (int)((_7104_shape)->size(0))) || (_ptr__7104_shape[dim0] != _ptr__7104_shape[dim1])))))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid dimension definitions"));
      }
    }
    {}
  }
}
// mosek.fusion.ExprSymmetrize.ctor

// Begin mosek.fusion.ExprSymmetrize.eval
// Method mosek.fusion.ExprSymmetrize.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:180:6-683:7
void mosek::fusion::ExprSymmetrize :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7105_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7106_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7107_xs) { mosek::fusion::p_ExprSymmetrize::_get_impl(this)->eval(_7105_rs,_7106_ws,_7107_xs); }
void mosek::fusion::p_ExprSymmetrize::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7105_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7106_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7107_xs)
{
  expr->eval(_7106_ws,_7105_rs,_7107_xs);
  _7106_ws->pop_expr();
  int32_t _7108_dimmax = (int)0;
  int32_t _7109_nd = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->nd;
  int32_t _7110_nnz = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->nnz;
  int32_t _7111_nelem = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->nelem;
  int32_t _7112_ncodeatom = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->ncodeatom;
  bool _7113_hassp = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->hassp;
  int32_t _7114_shape = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->shape_base;
  int32_t _7115_ptr = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->ptr_base;
  int32_t _7116_code = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->code_base;
  int32_t _7117_codeptr = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->codeptr_base;
  int32_t _7118_cconst = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->cconst_base;
  int32_t _7119_nidxs = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->nidxs_base;
  int32_t _7120_sp = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->sp_base;
  int32_t _7121_cof = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->cof_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7122_wi32 = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->i32;
  _checked_ptr_1<int32_t> _ptr__7122_wi32(_7122_wi32 ? _7122_wi32->raw() : nullptr,_7122_wi32 ? _7122_wi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7123_wi64 = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->i64;
  _checked_ptr_1<int64_t> _ptr__7123_wi64(_7123_wi64 ? _7123_wi64->raw() : nullptr,_7123_wi64 ? _7123_wi64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7124_wf64 = mosek::fusion::p_WorkStack::_get_impl(_7106_ws)->f64;
  _checked_ptr_1<double> _ptr__7124_wf64(_7124_wf64 ? _7124_wf64->raw() : nullptr,_7124_wf64 ? _7124_wf64->size(0) : 0);
  int32_t _12459_ = (int)0;
  int32_t _12460_ = _7109_nd;
  for (int32_t _7125_i = _12459_; _7125_i < _12460_; ++_7125_i)
  {
    {
      int32_t _7126_d = _ptr__7122_wi32[safe_add( _7114_shape,_7125_i )];
      if ((_7126_d > _7108_dimmax))
      {
        {
          _7108_dimmax = _7126_d;
        }
      }
      {}
    }
  }
  int32_t _7127_xperm1 = _7107_xs->alloci32(_7111_nelem);
  int32_t _7128_xperm2 = _7107_xs->alloci32(_7111_nelem);
  int32_t _7129_xptr = _7107_xs->alloci32(safe_add( _7108_dimmax,(int)1 ));
  int32_t _7130_xsp = _7107_xs->alloci64(_7111_nelem);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7131_xi32 = mosek::fusion::p_WorkStack::_get_impl(_7107_xs)->i32;
  _checked_ptr_1<int32_t> _ptr__7131_xi32(_7131_xi32 ? _7131_xi32->raw() : nullptr,_7131_xi32 ? _7131_xi32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7132_xi64 = mosek::fusion::p_WorkStack::_get_impl(_7107_xs)->i64;
  _checked_ptr_1<int64_t> _ptr__7132_xi64(_7132_xi64 ? _7132_xi64->raw() : nullptr,_7132_xi64 ? _7132_xi64->size(0) : 0);
  int32_t _7133_rnelem = (int)0;
  int32_t _7134_rnnz = (int)0;
  int32_t _7135_rncodeatom = (int)0;
  std::vector<int32_t> _12461_;
  for (int32_t _7137_i = (int)0, _12462_ = (int)5; _7137_i < _12462_ ; ++_7137_i)
  {
    _12461_.push_back((int)1);
  }
  auto _12463_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12461_.size()),_12461_.begin(),_12461_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7136_dim = _12463_;
  _checked_ptr_1<int32_t> _ptr__7136_dim(_7136_dim ? _7136_dim->raw() : nullptr,_7136_dim ? _7136_dim->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7138_stride = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)5)));
  _checked_ptr_1<int64_t> _ptr__7138_stride(_7138_stride ? _7138_stride->raw() : nullptr,_7138_stride ? _7138_stride->size(0) : 0);
  int32_t _12464_ = (int)0;
  int32_t _12465_ = dim0;
  for (int32_t _7139_i = _12464_; _7139_i < _12465_; ++_7139_i)
  {
    {
      _ptr__7136_dim[(int)0] *= _ptr__7122_wi32[safe_add( _7114_shape,_7139_i )];
    }
  }
  _ptr__7136_dim[(int)1] = _ptr__7122_wi32[safe_add( _7114_shape,dim0 )];
  int32_t _12466_ = safe_add( dim0,(int)1 );
  int32_t _12467_ = dim1;
  for (int32_t _7140_i = _12466_; _7140_i < _12467_; ++_7140_i)
  {
    {
      _ptr__7136_dim[(int)2] *= _ptr__7122_wi32[safe_add( _7114_shape,_7140_i )];
    }
  }
  _ptr__7136_dim[(int)3] = _ptr__7122_wi32[safe_add( _7114_shape,dim1 )];
  int32_t _12468_ = safe_add( dim1,(int)1 );
  int32_t _12469_ = _7109_nd;
  for (int32_t _7141_i = _12468_; _7141_i < _12469_; ++_7141_i)
  {
    {
      _ptr__7136_dim[(int)4] *= _ptr__7122_wi32[safe_add( _7114_shape,_7141_i )];
    }
  }
  _ptr__7138_stride[(int)4] = (int)1;
  int32_t _12470_ = (int)1;
  int32_t _12471_ = (int)5;
  for (int32_t _7142_i = _12470_; _7142_i < _12471_; ++_7142_i)
  {
    {
      _ptr__7138_stride[(((int)5 - _7142_i) - (int)1)] = safe_mul( _ptr__7138_stride[((int)5 - _7142_i)],_ptr__7136_dim[((int)5 - _7142_i)] );
    }
  }
  if (_7113_hassp)
  {
    {
      int32_t _7143_curperm = _7127_xperm1;
      int32_t _12472_ = (int)0;
      int32_t _12473_ = _7111_nelem;
      for (int32_t _7144_i = _12472_; _7144_i < _12473_; ++_7144_i)
      {
        {
          _ptr__7131_xi32[safe_add( _7143_curperm,_7144_i )] = _7144_i;
        }
      }
      int32_t _7145_tgtperm = _7128_xperm2;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7146_sortidx = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)((int)2),(int32_t)((int)3),(int32_t)((int)0)});
      _checked_ptr_1<int32_t> _ptr__7146_sortidx(_7146_sortidx ? _7146_sortidx->raw() : nullptr,_7146_sortidx ? _7146_sortidx->size(0) : 0);
      int32_t _12474_ = (int)0;
      int32_t _12475_ = (int)4;
      for (int32_t _7147_k = _12474_; _7147_k < _12475_; ++_7147_k)
      {
        {
          int64_t _7148_s = _ptr__7138_stride[_ptr__7146_sortidx[_7147_k]];
          int32_t _7149_d = _ptr__7136_dim[_ptr__7146_sortidx[_7147_k]];
          if ((_7149_d > (int)1))
          {
            {
              int32_t _12476_ = (int)0;
              int32_t _12477_ = safe_add( _7149_d,(int)1 );
              for (int32_t _7150_i = _12476_; _7150_i < _12477_; ++_7150_i)
              {
                {
                  _ptr__7131_xi32[safe_add( _7129_xptr,_7150_i )] = (int)0;
                }
              }
              int32_t _12478_ = (int)0;
              int32_t _12479_ = _7111_nelem;
              for (int32_t _7151_i = _12478_; _7151_i < _12479_; ++_7151_i)
              {
                {
                  ++ _ptr__7131_xi32[safe_add( safe_add( _7129_xptr,((_ptr__7123_wi64[safe_add( _7120_sp,_ptr__7131_xi32[safe_add( _7143_curperm,_7151_i )] )] / _7148_s) % _7149_d) ),(int)1 )];
                }
              }
              int32_t _12480_ = (int)0;
              int32_t _12481_ = _ptr__7136_dim[(int)3];
              for (int32_t _7152_i = _12480_; _7152_i < _12481_; ++_7152_i)
              {
                {
                  _ptr__7131_xi32[safe_add( safe_add( _7129_xptr,_7152_i ),(int)1 )] += _ptr__7131_xi32[safe_add( _7129_xptr,_7152_i )];
                }
              }
              int32_t _12482_ = (int)0;
              int32_t _12483_ = _7111_nelem;
              for (int32_t _7153_i = _12482_; _7153_i < _12483_; ++_7153_i)
              {
                {
                  int32_t _7154_ii = _ptr__7131_xi32[safe_add( _7143_curperm,_7153_i )];
                  int64_t _7155_idx = ((_ptr__7123_wi64[safe_add( _7120_sp,_7154_ii )] / _7148_s) % _7149_d);
                  _ptr__7131_xi32[safe_add( _7145_tgtperm,_ptr__7131_xi32[safe_add( _7129_xptr,_7155_idx )] )] = _7154_ii;
                  ++ _ptr__7131_xi32[safe_add( _7129_xptr,_7155_idx )];
                }
              }
              int32_t _7156_tmpperm = _7143_curperm;
              _7143_curperm = _7145_tgtperm;
              _7145_tgtperm = _7156_tmpperm;
            }
          }
          {}
        }
      }
      int32_t _12484_ = (int)0;
      int32_t _12485_ = _7111_nelem;
      for (int32_t _7157_i = _12484_; _7157_i < _12485_; ++_7157_i)
      {
        {
          _ptr__7132_xi64[safe_add( _7130_xsp,_7157_i )] = safe_add( safe_add( safe_add( safe_add( safe_mul( ((_ptr__7123_wi64[safe_add( _7120_sp,_7157_i )] / _ptr__7138_stride[(int)0]) % _ptr__7136_dim[(int)0]),_ptr__7138_stride[(int)0] ),safe_mul( ((_ptr__7123_wi64[safe_add( _7120_sp,_7157_i )] / _ptr__7138_stride[(int)1]) % _ptr__7136_dim[(int)1]),_ptr__7138_stride[(int)3] ) ),safe_mul( ((_ptr__7123_wi64[safe_add( _7120_sp,_7157_i )] / _ptr__7138_stride[(int)2]) % _ptr__7136_dim[(int)2]),_ptr__7138_stride[(int)2] ) ),safe_mul( ((_ptr__7123_wi64[safe_add( _7120_sp,_7157_i )] / _ptr__7138_stride[(int)3]) % _ptr__7136_dim[(int)3]),_ptr__7138_stride[(int)1] ) ),safe_mul( ((_ptr__7123_wi64[safe_add( _7120_sp,_7157_i )] / _ptr__7138_stride[(int)4]) % _ptr__7136_dim[(int)4]),_ptr__7138_stride[(int)4] ) );
        }
      }
      {
        int32_t _7158_ii1 = (int)0;
        int32_t _7159_i0 = (int)0;
        while ( ((_7159_i0 < _7111_nelem) || (_7158_ii1 < _7111_nelem)) )
        {
          {
            int32_t _7160_i1 = _ptr__7131_xi32[safe_add( _7143_curperm,_7158_ii1 )];
            if (((_7159_i0 < _7111_nelem) && ((_7158_ii1 == _7111_nelem) || (_ptr__7123_wi64[safe_add( _7120_sp,_7159_i0 )] < _ptr__7132_xi64[safe_add( _7130_xsp,_7160_i1 )]))))
            {
              {
                _7134_rnnz += (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )]);
                if ((_7112_ncodeatom > (int)0))
                {
                  {
                    _7135_rncodeatom += safe_add( (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )] )]),safe_mul( (int)2,(_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )]) ) );
                  }
                }
                {}
                ++ _7133_rnelem;
                ++ _7159_i0;
              }
            }
            else if(((_7158_ii1 < _7111_nelem) && ((_7159_i0 == _7111_nelem) || (_ptr__7123_wi64[safe_add( _7120_sp,_7159_i0 )] > _ptr__7132_xi64[safe_add( _7130_xsp,_7160_i1 )]))))
            {
              {
                _7134_rnnz += (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )]);
                if ((_7112_ncodeatom > (int)0))
                {
                  {
                    _7135_rncodeatom += safe_add( (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )] )]),safe_mul( (int)2,(_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )]) ) );
                  }
                }
                {}
                ++ _7133_rnelem;
                ++ _7158_ii1;
              }
            }
            else if((_ptr__7123_wi64[safe_add( _7120_sp,_7159_i0 )] != _ptr__7132_xi64[safe_add( _7130_xsp,_7160_i1 )]))
            {
              {
                _7134_rnnz += (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )]);
                _7134_rnnz += (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )]);
                if ((_7112_ncodeatom > (int)0))
                {
                  {
                    _7135_rncodeatom += safe_add( (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )] )]),safe_mul( (int)2,(_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )]) ) );
                    _7135_rncodeatom += safe_add( (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )] )]),safe_mul( (int)2,(_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7160_i1 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7160_i1 )]) ) );
                  }
                }
                {}
                ++ _7133_rnelem;
                ++ _7158_ii1;
                ++ _7159_i0;
              }
            }
            else
            {
              {
                _7134_rnnz += (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )]);
                if ((_7112_ncodeatom > (int)0))
                {
                  {
                    _7135_rncodeatom += (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7159_i0 ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7159_i0 )] )]);
                  }
                }
                {}
                ++ _7133_rnelem;
                ++ _7158_ii1;
                ++ _7159_i0;
              }
            }
          }
        }
      }
      _7105_rs->alloc_expr(_7109_nd,_7133_rnelem,_7134_rnnz,true,_7135_rncodeatom);
      int32_t _7161_rnd = _7109_nd;
      int32_t _7162_rptr = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->ptr_base;
      int32_t _7163_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->nidxs_base;
      int32_t _7164_rshape = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->shape_base;
      int32_t _7165_rsp = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->sp_base;
      int32_t _7166_rcof = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->cof_base;
      int32_t _7167_rcode = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->code_base;
      int32_t _7168_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->codeptr_base;
      int32_t _7169_rcconst = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7170_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__7170_ri32(_7170_ri32 ? _7170_ri32->raw() : nullptr,_7170_ri32 ? _7170_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _7171_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__7171_ri64(_7171_ri64 ? _7171_ri64->raw() : nullptr,_7171_ri64 ? _7171_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _7172_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->f64;
      _checked_ptr_1<double> _ptr__7172_rf64(_7172_rf64 ? _7172_rf64->raw() : nullptr,_7172_rf64 ? _7172_rf64->size(0) : 0);
      int32_t _12486_ = (int)0;
      int32_t _12487_ = _7109_nd;
      for (int32_t _7173_i = _12486_; _7173_i < _12487_; ++_7173_i)
      {
        {
          _ptr__7170_ri32[safe_add( _7164_rshape,_7173_i )] = _ptr__7122_wi32[safe_add( _7114_shape,_7173_i )];
        }
      }
      _ptr__7170_ri32[_7162_rptr] = (int)0;
      if ((_7135_rncodeatom > (int)0))
      {
        {
          _ptr__7170_ri32[_7168_rcodeptr] = (int)0;
        }
      }
      {}
      {
        int32_t _7174_nzi = (int)0;
        int32_t _7175_codei = (int)0;
        int32_t _7176_elmi = (int)0;
        int32_t _7177_ii1 = (int)0;
        int32_t _7178_i0 = (int)0;
        _ptr__7170_ri32[_7162_rptr] = (int)0;
        while ( ((_7178_i0 < _7111_nelem) || (_7177_ii1 < _7111_nelem)) )
        {
          {
            int32_t _7179_i1 = _ptr__7131_xi32[safe_add( _7143_curperm,_7177_ii1 )];
            if (((_7178_i0 < _7111_nelem) && ((_7177_ii1 == _7111_nelem) || (_ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )] < _ptr__7132_xi64[safe_add( _7130_xsp,_7179_i1 )]))))
            {
              {
                if ((_7135_rncodeatom == (int)0))
                {
                  {
                    int32_t _12488_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12489_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7180_j = _12488_; _7180_j < _12489_; ++_7180_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7180_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7180_j )] * 0.5);
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                else
                {
                  {
                    int32_t _12490_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12491_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7181_j = _12490_; _7181_j < _12491_; ++_7181_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7181_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7181_j )] * 0.5);
                        int32_t _12492_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7181_j )];
                        int32_t _12493_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7181_j ),(int)1 )];
                        for (int32_t _7182_k = _12492_; _7182_k < _12493_; ++_7182_k)
                        {
                          {
                            _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7182_k )];
                            _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7182_k )];
                            ++ _7175_codei;
                          }
                        }
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 2;
                        _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = 0.5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( safe_add( _7168_rcodeptr,_7174_nzi ),(int)1 )] = _7175_codei;
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                _ptr__7171_ri64[safe_add( _7165_rsp,_7176_elmi )] = _ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )];
                _ptr__7170_ri32[safe_add( safe_add( _7162_rptr,_7176_elmi ),(int)1 )] = _7174_nzi;
                ++ _7176_elmi;
                ++ _7178_i0;
              }
            }
            else if(((_7177_ii1 < _7111_nelem) && ((_7178_i0 == _7111_nelem) || (_ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )] > _ptr__7132_xi64[safe_add( _7130_xsp,_7179_i1 )]))))
            {
              {
                if ((_7135_rncodeatom == (int)0))
                {
                  {
                    int32_t _12494_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7179_i1 )];
                    int32_t _12495_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7179_i1 ),(int)1 )];
                    for (int32_t _7183_j = _12494_; _7183_j < _12495_; ++_7183_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7183_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7183_j )] * 0.5);
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                else
                {
                  {
                    int32_t _12496_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7179_i1 )];
                    int32_t _12497_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7179_i1 ),(int)1 )];
                    for (int32_t _7184_j = _12496_; _7184_j < _12497_; ++_7184_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7184_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7184_j )] * 0.5);
                        int32_t _12498_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7184_j )];
                        int32_t _12499_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7184_j ),(int)1 )];
                        for (int32_t _7185_k = _12498_; _7185_k < _12499_; ++_7185_k)
                        {
                          {
                            _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7185_k )];
                            _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7185_k )];
                            ++ _7175_codei;
                          }
                        }
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 2;
                        _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = 0.5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( safe_add( _7168_rcodeptr,_7174_nzi ),(int)1 )] = _7175_codei;
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                _ptr__7171_ri64[safe_add( _7165_rsp,_7176_elmi )] = _ptr__7123_wi64[safe_add( _7130_xsp,_7179_i1 )];
                _ptr__7170_ri32[safe_add( safe_add( _7162_rptr,_7176_elmi ),(int)1 )] = _7174_nzi;
                ++ _7176_elmi;
                ++ _7177_ii1;
              }
            }
            else if((_ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )] != _ptr__7132_xi64[safe_add( _7130_xsp,_7179_i1 )]))
            {
              {
                if ((_7135_rncodeatom == (int)0))
                {
                  {
                    int32_t _12500_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12501_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7186_j = _12500_; _7186_j < _12501_; ++_7186_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7186_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7186_j )] * 0.5);
                        ++ _7174_nzi;
                      }
                    }
                    int32_t _12502_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7179_i1 )];
                    int32_t _12503_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7179_i1 ),(int)1 )];
                    for (int32_t _7187_j = _12502_; _7187_j < _12503_; ++_7187_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7187_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7187_j )] * 0.5);
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                else
                {
                  {
                    int32_t _12504_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12505_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7188_j = _12504_; _7188_j < _12505_; ++_7188_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7188_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7188_j )] * 0.5);
                        int32_t _12506_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7188_j )];
                        int32_t _12507_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7188_j ),(int)1 )];
                        for (int32_t _7189_k = _12506_; _7189_k < _12507_; ++_7189_k)
                        {
                          {
                            _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7189_k )];
                            _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7189_k )];
                            ++ _7175_codei;
                          }
                        }
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 2;
                        _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = 0.5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( safe_add( _7168_rcodeptr,_7174_nzi ),(int)1 )] = _7175_codei;
                        ++ _7174_nzi;
                      }
                    }
                    int32_t _12508_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7179_i1 )];
                    int32_t _12509_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7179_i1 ),(int)1 )];
                    for (int32_t _7190_j = _12508_; _7190_j < _12509_; ++_7190_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7190_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7190_j )] * 0.5);
                        int32_t _12510_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7190_j )];
                        int32_t _12511_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7190_j ),(int)1 )];
                        for (int32_t _7191_k = _12510_; _7191_k < _12511_; ++_7191_k)
                        {
                          {
                            _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7191_k )];
                            _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7191_k )];
                            ++ _7175_codei;
                          }
                        }
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 2;
                        _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = 0.5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = 5;
                        ++ _7175_codei;
                        _ptr__7170_ri32[safe_add( safe_add( _7168_rcodeptr,_7174_nzi ),(int)1 )] = _7175_codei;
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                _ptr__7171_ri64[safe_add( _7165_rsp,_7176_elmi )] = _ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )];
                _ptr__7170_ri32[safe_add( safe_add( _7162_rptr,_7176_elmi ),(int)1 )] = _7174_nzi;
                ++ _7176_elmi;
                ++ _7177_ii1;
                ++ _7178_i0;
              }
            }
            else
            {
              {
                if ((_7135_rncodeatom == (int)0))
                {
                  {
                    int32_t _12512_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12513_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7192_j = _12512_; _7192_j < _12513_; ++_7192_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7192_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = _ptr__7124_wf64[safe_add( _7121_cof,_7192_j )];
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                else
                {
                  {
                    int32_t _12514_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7178_i0 )];
                    int32_t _12515_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7178_i0 ),(int)1 )];
                    for (int32_t _7193_j = _12514_; _7193_j < _12515_; ++_7193_j)
                    {
                      {
                        _ptr__7171_ri64[safe_add( _7163_rnidxs,_7174_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7193_j )];
                        _ptr__7172_rf64[safe_add( _7166_rcof,_7174_nzi )] = _ptr__7124_wf64[safe_add( _7121_cof,_7193_j )];
                        int32_t _12516_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7193_j )];
                        int32_t _12517_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7193_j ),(int)1 )];
                        for (int32_t _7194_k = _12516_; _7194_k < _12517_; ++_7194_k)
                        {
                          {
                            _ptr__7170_ri32[safe_add( _7167_rcode,_7175_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7194_k )];
                            _ptr__7172_rf64[safe_add( _7169_rcconst,_7175_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7194_k )];
                            ++ _7175_codei;
                          }
                        }
                        _ptr__7170_ri32[safe_add( safe_add( _7168_rcodeptr,_7174_nzi ),(int)1 )] = _7175_codei;
                        ++ _7174_nzi;
                      }
                    }
                  }
                }
                _ptr__7171_ri64[safe_add( _7165_rsp,_7176_elmi )] = _ptr__7123_wi64[safe_add( _7120_sp,_7178_i0 )];
                _ptr__7170_ri32[safe_add( safe_add( _7162_rptr,_7176_elmi ),(int)1 )] = _7174_nzi;
                ++ _7176_elmi;
                ++ _7177_ii1;
                ++ _7178_i0;
              }
            }
          }
        }
        if ((_7174_nzi != _7134_rnnz))
        {
          {
            throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nzi"));
          }
        }
        {}
      }
    }
  }
  else
  {
    {
      _7133_rnelem = _7111_nelem;
      _7134_rnnz = safe_mul( _7110_nnz,(int)2 );
      int32_t _12518_;
      bool _12519_ = (_7112_ncodeatom > (int)0);
      if (_12519_)
      {
        _12518_ = safe_add( safe_mul( (int)2,_7112_ncodeatom ),safe_mul( safe_mul( (int)2,(int)2 ),_7110_nnz ) );
      }
      else
      {
        _12518_ = (int)0;
      }
      _7135_rncodeatom = _12518_;
      int32_t _12520_ = (int)0;
      int32_t _12521_ = _ptr__7136_dim[(int)0];
      for (int32_t _7195_i0 = _12520_; _7195_i0 < _12521_; ++_7195_i0)
      {
        {
          int32_t _12522_ = (int)0;
          int32_t _12523_ = _ptr__7136_dim[(int)2];
          for (int32_t _7196_i2 = _12522_; _7196_i2 < _12523_; ++_7196_i2)
          {
            {
              int32_t _12524_ = (int)0;
              int32_t _12525_ = _ptr__7136_dim[(int)4];
              for (int32_t _7197_i4 = _12524_; _7197_i4 < _12525_; ++_7197_i4)
              {
                {
                  int32_t _12526_ = (int)0;
                  int32_t _12527_ = _ptr__7136_dim[(int)1];
                  for (int32_t _7198_i = _12526_; _7198_i < _12527_; ++_7198_i)
                  {
                    {
                      int64_t _7199_p = safe_add( safe_add( safe_add( safe_add( safe_mul( _ptr__7138_stride[(int)0],_7195_i0 ),safe_mul( _ptr__7138_stride[(int)1],_7198_i ) ),safe_mul( _ptr__7138_stride[(int)2],_7196_i2 ) ),safe_mul( _ptr__7138_stride[(int)3],_7198_i ) ),safe_mul( _ptr__7138_stride[(int)4],_7197_i4 ) );
                      _7134_rnnz -= (_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7199_p ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7199_p )]);
                      if ((_7112_ncodeatom > (int)0))
                      {
                        {
                          _7135_rncodeatom -= safe_add( (_ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7199_p ),(int)1 )] )] - _ptr__7122_wi32[safe_add( _7117_codeptr,_ptr__7122_wi32[safe_add( _7115_ptr,_7199_p )] )]),safe_mul( safe_mul( (int)2,(int)2 ),(_ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7199_p ),(int)1 )] - _ptr__7122_wi32[safe_add( _7115_ptr,_7199_p )]) ) );
                        }
                      }
                      {}
                    }
                  }
                }
              }
            }
          }
        }
      }
      _7105_rs->alloc_expr(_7109_nd,_7133_rnelem,_7134_rnnz,false,_7135_rncodeatom);
      int32_t _7200_rptr = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->ptr_base;
      int32_t _7201_rshape = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->shape_base;
      int32_t _7202_rcode = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->code_base;
      int32_t _7203_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->codeptr_base;
      int32_t _7204_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->nidxs_base;
      int32_t _7205_rsp = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->sp_base;
      int32_t _7206_rcof = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->cof_base;
      int32_t _7207_rcconst = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->cconst_base;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7208_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i32;
      _checked_ptr_1<int32_t> _ptr__7208_ri32(_7208_ri32 ? _7208_ri32->raw() : nullptr,_7208_ri32 ? _7208_ri32->size(0) : 0);
      std::shared_ptr< monty::ndarray< int64_t,1 > > _7209_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i64;
      _checked_ptr_1<int64_t> _ptr__7209_ri64(_7209_ri64 ? _7209_ri64->raw() : nullptr,_7209_ri64 ? _7209_ri64->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _7210_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->f64;
      _checked_ptr_1<double> _ptr__7210_rf64(_7210_rf64 ? _7210_rf64->raw() : nullptr,_7210_rf64 ? _7210_rf64->size(0) : 0);
      int32_t _7211_nzi = (int)0;
      int32_t _7212_relmi = (int)0;
      int32_t _7213_codei = (int)0;
      int32_t _12528_ = (int)0;
      int32_t _12529_ = _7109_nd;
      for (int32_t _7214_i = _12528_; _7214_i < _12529_; ++_7214_i)
      {
        {
          _ptr__7208_ri32[safe_add( _7201_rshape,_7214_i )] = _ptr__7122_wi32[safe_add( _7114_shape,_7214_i )];
        }
      }
      _ptr__7208_ri32[_7200_rptr] = (int)0;
      if ((_7135_rncodeatom > (int)0))
      {
        {
          _ptr__7208_ri32[_7203_rcodeptr] = (int)0;
        }
      }
      {}
      int32_t _7215_k = (int)0;
      int32_t _12530_ = (int)0;
      int32_t _12531_ = _ptr__7136_dim[(int)0];
      for (int32_t _7216_i0 = _12530_; _7216_i0 < _12531_; ++_7216_i0)
      {
        {
          int32_t _12532_ = (int)0;
          int32_t _12533_ = _ptr__7136_dim[(int)1];
          for (int32_t _7217_i1 = _12532_; _7217_i1 < _12533_; ++_7217_i1)
          {
            {
              int32_t _12534_ = (int)0;
              int32_t _12535_ = _ptr__7136_dim[(int)2];
              for (int32_t _7218_i2 = _12534_; _7218_i2 < _12535_; ++_7218_i2)
              {
                {
                  int32_t _12536_ = (int)0;
                  int32_t _12537_ = _ptr__7136_dim[(int)3];
                  for (int32_t _7219_i3 = _12536_; _7219_i3 < _12537_; ++_7219_i3)
                  {
                    {
                      int32_t _12538_ = (int)0;
                      int32_t _12539_ = _ptr__7136_dim[(int)4];
                      for (int32_t _7220_i4 = _12538_; _7220_i4 < _12539_; ++_7220_i4)
                      {
                        {
                          if ((_7217_i1 == _7219_i3))
                          {
                            {
                              if ((_7135_rncodeatom == (int)0))
                              {
                                {
                                  int32_t _12540_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7215_k )];
                                  int32_t _12541_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7215_k ),(int)1 )];
                                  for (int32_t _7221_j = _12540_; _7221_j < _12541_; ++_7221_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7221_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = _ptr__7124_wf64[safe_add( _7121_cof,_7221_j )];
                                      ++ _7211_nzi;
                                    }
                                  }
                                }
                              }
                              else
                              {
                                {
                                  int32_t _12542_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7215_k )];
                                  int32_t _12543_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7215_k ),(int)1 )];
                                  for (int32_t _7222_j = _12542_; _7222_j < _12543_; ++_7222_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7222_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = _ptr__7124_wf64[safe_add( _7121_cof,_7222_j )];
                                      int32_t _12544_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7222_j )];
                                      int32_t _12545_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7222_j ),(int)1 )];
                                      for (int32_t _7223_l = _12544_; _7223_l < _12545_; ++_7223_l)
                                      {
                                        {
                                          _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7223_l )];
                                          _ptr__7210_rf64[safe_add( _7207_rcconst,_7213_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7223_l )];
                                          ++ _7213_codei;
                                        }
                                      }
                                      _ptr__7208_ri32[safe_add( safe_add( _7203_rcodeptr,_7211_nzi ),(int)1 )] = _7213_codei;
                                      ++ _7211_nzi;
                                    }
                                  }
                                }
                              }
                              _ptr__7208_ri32[safe_add( safe_add( _7200_rptr,_7212_relmi ),(int)1 )] = _7211_nzi;
                              ++ _7215_k;
                            }
                          }
                          else
                          {
                            {
                              int64_t _7224_k2 = safe_add( safe_add( safe_add( safe_add( safe_mul( _7216_i0,_ptr__7138_stride[(int)0] ),safe_mul( _7219_i3,_ptr__7138_stride[(int)1] ) ),safe_mul( _7218_i2,_ptr__7138_stride[(int)2] ) ),safe_mul( _7217_i1,_ptr__7138_stride[(int)3] ) ),_7220_i4 );
                              if ((_7135_rncodeatom == (int)0))
                              {
                                {
                                  int32_t _12546_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7215_k )];
                                  int32_t _12547_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7215_k ),(int)1 )];
                                  for (int32_t _7225_j = _12546_; _7225_j < _12547_; ++_7225_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7225_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7225_j )] * 0.5);
                                      ++ _7211_nzi;
                                    }
                                  }
                                  int32_t _12548_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7224_k2 )];
                                  int32_t _12549_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7224_k2 ),(int)1 )];
                                  for (int32_t _7226_j = _12548_; _7226_j < _12549_; ++_7226_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7226_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7226_j )] * 0.5);
                                      ++ _7211_nzi;
                                    }
                                  }
                                }
                              }
                              else
                              {
                                {
                                  int32_t _12550_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7215_k )];
                                  int32_t _12551_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7215_k ),(int)1 )];
                                  for (int32_t _7227_j = _12550_; _7227_j < _12551_; ++_7227_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7227_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7227_j )] * 0.5);
                                      int32_t _12552_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7227_j )];
                                      int32_t _12553_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7227_j ),(int)1 )];
                                      for (int32_t _7228_l = _12552_; _7228_l < _12553_; ++_7228_l)
                                      {
                                        {
                                          _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7228_l )];
                                          _ptr__7210_rf64[safe_add( _7207_rcconst,_7213_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7228_l )];
                                          ++ _7213_codei;
                                        }
                                      }
                                      _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = 2;
                                      _ptr__7210_rf64[safe_add( _7207_rcconst,_7213_codei )] = 0.5;
                                      ++ _7213_codei;
                                      _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = 5;
                                      ++ _7213_codei;
                                      _ptr__7208_ri32[safe_add( safe_add( _7203_rcodeptr,_7211_nzi ),(int)1 )] = _7213_codei;
                                      ++ _7211_nzi;
                                    }
                                  }
                                  int32_t _12554_ = _ptr__7122_wi32[safe_add( _7115_ptr,_7224_k2 )];
                                  int32_t _12555_ = _ptr__7122_wi32[safe_add( safe_add( _7115_ptr,_7224_k2 ),(int)1 )];
                                  for (int32_t _7229_j = _12554_; _7229_j < _12555_; ++_7229_j)
                                  {
                                    {
                                      _ptr__7209_ri64[safe_add( _7204_rnidxs,_7211_nzi )] = _ptr__7123_wi64[safe_add( _7119_nidxs,_7229_j )];
                                      _ptr__7210_rf64[safe_add( _7206_rcof,_7211_nzi )] = (_ptr__7124_wf64[safe_add( _7121_cof,_7229_j )] * 0.5);
                                      int32_t _12556_ = _ptr__7122_wi32[safe_add( _7117_codeptr,_7229_j )];
                                      int32_t _12557_ = _ptr__7122_wi32[safe_add( safe_add( _7117_codeptr,_7229_j ),(int)1 )];
                                      for (int32_t _7230_l = _12556_; _7230_l < _12557_; ++_7230_l)
                                      {
                                        {
                                          _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = _ptr__7122_wi32[safe_add( _7116_code,_7230_l )];
                                          _ptr__7210_rf64[safe_add( _7207_rcconst,_7213_codei )] = _ptr__7124_wf64[safe_add( _7118_cconst,_7230_l )];
                                          ++ _7213_codei;
                                        }
                                      }
                                      _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = 2;
                                      _ptr__7210_rf64[safe_add( _7207_rcconst,_7213_codei )] = 0.5;
                                      ++ _7213_codei;
                                      _ptr__7208_ri32[safe_add( _7202_rcode,_7213_codei )] = 5;
                                      ++ _7213_codei;
                                      _ptr__7208_ri32[safe_add( safe_add( _7203_rcodeptr,_7211_nzi ),(int)1 )] = _7213_codei;
                                      ++ _7211_nzi;
                                    }
                                  }
                                }
                              }
                              _ptr__7208_ri32[safe_add( safe_add( _7200_rptr,_7212_relmi ),(int)1 )] = _7211_nzi;
                              ++ _7215_k;
                            }
                          }
                          ++ _7212_relmi;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if ((_7211_nzi != _7134_rnnz))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nnz"));
        }
      }
      {}
      if ((_7212_relmi != _7133_rnelem))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid nelem"));
        }
      }
      {}
    }
  }
  _7107_xs->clear();
  _7105_rs->peek_expr();
  if ((mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->nnz != ((*mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i32)(safe_add( mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->ptr_base,mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->nelem )))))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid ptr"));
    }
  }
  {}
  if ((((*mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->i32)(mosek::fusion::p_WorkStack::_get_impl(_7105_rs)->ptr_base)) != (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: Invalid ptr"));
    }
  }
  {}
}
// End mosek.fusion.ExprSymmetrize.eval

// Begin mosek.fusion.ExprSymmetrize.toString
// Method mosek.fusion.ExprSymmetrize.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:153:6-155:7
std::string mosek::fusion::ExprSymmetrize :: toString() { return mosek::fusion::p_ExprSymmetrize::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprSymmetrize::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprSymmetrize(symdim=("))->__mosek_2fusion_2Utils_2StringBuffer__a(dim0)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(dim1)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("),"))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprSymmetrize.toString

void mosek::fusion::p_ExprSymmetrize::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprSymmetrize::destroy() { mosek::fusion::p_ExprSymmetrize::_get_impl(this)->destroy(); }
// } class ExprSymmetrize
// class ExprCondense { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:102:4-135:5
mosek::fusion::ExprCondense::ExprCondense(mosek::fusion::p_ExprCondense *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprCondense()" << this << std::endl; */ }
mosek::fusion::ExprCondense::~ExprCondense() {  /* std::cout << "~ExprCondense()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprCondense::p_ExprCondense
  (::mosek::fusion::ExprCondense * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprCondense.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:104:6-107:7
mosek::fusion::ExprCondense::t mosek::fusion::p_ExprCondense::_new_ExprCondense
  (monty::rc_ptr< ::mosek::fusion::Expression > _7231_expr)
{ return new mosek::fusion::ExprCondense(_7231_expr); }
mosek::fusion::ExprCondense::ExprCondense
  (monty::rc_ptr< ::mosek::fusion::Expression > _7231_expr) : 
   ExprCondense(new mosek::fusion::p_ExprCondense(this))
{ mosek::fusion::p_ExprCondense::_get_impl(this)->_initialize(_7231_expr); }
void mosek::fusion::p_ExprCondense::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7231_expr)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_7231_expr->getShape());
    mosek::fusion::p_ExprCondense::_get_impl(::mosek::fusion::ExprCondense::t(_pubthis))->expr = _7231_expr;
  }
}
// mosek.fusion.ExprCondense.ctor

// Begin mosek.fusion.ExprCondense.eval
// Method mosek.fusion.ExprCondense.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:113:6-134:7
void mosek::fusion::ExprCondense :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7232_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7233_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7234_xs) { mosek::fusion::p_ExprCondense::_get_impl(this)->eval(_7232_rs,_7233_ws,_7234_xs); }
void mosek::fusion::p_ExprCondense::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7232_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7233_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7234_xs)
{
  expr->eval(_7232_rs,_7233_ws,_7234_xs);
  _7232_rs->peek_expr();
  if (mosek::fusion::p_WorkStack::_get_impl(_7232_rs)->hassp)
  {
    {
      int32_t _7235_nd = _7232_rs->popi32();
      _7232_rs->popi32(_7235_nd);
      int32_t _7236_nelem = _7232_rs->popi32();
      int32_t _7237_nnz = _7232_rs->popi32();
      _7232_rs->popi32();
      _7232_rs->popi64(_7236_nelem);
      _7232_rs->pushi32((int)0);
      _7232_rs->pushi32(_7237_nnz);
      _7232_rs->pushi32(_7236_nelem);
      _7232_rs->pushi32(_7236_nelem);
      _7232_rs->pushi32((int)1);
      _7232_rs->peek_expr();
    }
  }
  {}
}
// End mosek.fusion.ExprCondense.eval

// Begin mosek.fusion.ExprCondense.toString
// Method mosek.fusion.ExprCondense.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:109:6-111:7
std::string mosek::fusion::ExprCondense :: toString() { return mosek::fusion::p_ExprCondense::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprCondense::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprCondense("))->__mosek_2fusion_2Utils_2StringBuffer__a(expr->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprCondense.toString

void mosek::fusion::p_ExprCondense::destroy()
{
  expr.reset();
}
void mosek::fusion::ExprCondense::destroy() { mosek::fusion::p_ExprCondense::_get_impl(this)->destroy(); }
// } class ExprCondense
// class ExprFromVar { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:51:4-91:5
mosek::fusion::ExprFromVar::ExprFromVar(mosek::fusion::p_ExprFromVar *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprFromVar()" << this << std::endl; */ }
mosek::fusion::ExprFromVar::~ExprFromVar() {  /* std::cout << "~ExprFromVar()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprFromVar::p_ExprFromVar
  (::mosek::fusion::ExprFromVar * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprFromVar.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:53:6-56:7
mosek::fusion::ExprFromVar::t mosek::fusion::p_ExprFromVar::_new_ExprFromVar
  (monty::rc_ptr< ::mosek::fusion::Variable > _7238_x)
{ return new mosek::fusion::ExprFromVar(_7238_x); }
mosek::fusion::ExprFromVar::ExprFromVar
  (monty::rc_ptr< ::mosek::fusion::Variable > _7238_x) : 
   ExprFromVar(new mosek::fusion::p_ExprFromVar(this))
{ mosek::fusion::p_ExprFromVar::_get_impl(this)->_initialize(_7238_x); }
void mosek::fusion::p_ExprFromVar::_initialize  (monty::rc_ptr< ::mosek::fusion::Variable > _7238_x)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_7238_x->getShape());
    mosek::fusion::p_ExprFromVar::_get_impl(::mosek::fusion::ExprFromVar::t(_pubthis))->x = _7238_x;
  }
}
// mosek.fusion.ExprFromVar.ctor

// Begin mosek.fusion.ExprFromVar.eval
// Method mosek.fusion.ExprFromVar.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:62:6-90:7
void mosek::fusion::ExprFromVar :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7239_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7240_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7241_xs) { mosek::fusion::p_ExprFromVar::_get_impl(this)->eval(_7239_rs,_7240_ws,_7241_xs); }
void mosek::fusion::p_ExprFromVar::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7239_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7240_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7241_xs)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7242_shape = _pubthis->getShape();
  _checked_ptr_1<int32_t> _ptr__7242_shape(_7242_shape ? _7242_shape->raw() : nullptr,_7242_shape ? _7242_shape->size(0) : 0);
  int64_t _7243_size = ::mosek::fusion::p_Set::size(_7242_shape);
  int32_t _7244_nelm = x->numInst();
  int32_t _7245_nnz = _7244_nelm;
  bool _7246_hassp = (_7243_size > _7244_nelm);
  _7239_rs->alloc_expr((int)((_7242_shape)->size(0)),_7244_nelm,_7245_nnz,_7246_hassp);
  int32_t _7247_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->ptr_base;
  int32_t _7248_nidx_base = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->nidxs_base;
  int32_t _7249_nsp_base = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->sp_base;
  int32_t _7250_cof_base = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->cof_base;
  int32_t _7251_shape_base = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->shape_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7252_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__7252_ri32(_7252_ri32 ? _7252_ri32->raw() : nullptr,_7252_ri32 ? _7252_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7253_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__7253_ri64(_7253_ri64 ? _7253_ri64->raw() : nullptr,_7253_ri64 ? _7253_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7254_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7239_rs)->f64;
  _checked_ptr_1<double> _ptr__7254_rf64(_7254_rf64 ? _7254_rf64->raw() : nullptr,_7254_rf64 ? _7254_rf64->size(0) : 0);
  int32_t _12558_ = (int)0;
  int32_t _12559_ = (int)((_7242_shape)->size(0));
  for (int32_t _7255_i = _12558_; _7255_i < _12559_; ++_7255_i)
  {
    {
      _ptr__7252_ri32[safe_add( _7251_shape_base,_7255_i )] = _ptr__7242_shape[_7255_i];
    }
  }
  {
    int32_t _12560_ = (int)0;
    int32_t _12561_ = safe_add( _7244_nelm,(int)1 );
    for (int32_t _7256_i = _12560_; _7256_i < _12561_; ++_7256_i)
    {
      {
        _ptr__7252_ri32[safe_add( _7247_ptr_base,_7256_i )] = _7256_i;
      }
    }
    int32_t _12562_ = (int)0;
    int32_t _12563_ = _7245_nnz;
    for (int32_t _7257_i = _12562_; _7257_i < _12563_; ++_7257_i)
    {
      {
        _ptr__7254_rf64[safe_add( _7250_cof_base,_7257_i )] = 1.0;
      }
    }
  }
  if (_7246_hassp)
  {
    {
      x->inst(_7249_nsp_base,_7253_ri64,_7248_nidx_base,_7253_ri64);
    }
  }
  else
  {
    {
      x->inst(_7248_nidx_base,_7253_ri64);
    }
  }
}
// End mosek.fusion.ExprFromVar.eval

// Begin mosek.fusion.ExprFromVar.toString
// Method mosek.fusion.ExprFromVar.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:58:6-60:7
std::string mosek::fusion::ExprFromVar :: toString() { return mosek::fusion::p_ExprFromVar::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprFromVar::toString()
{
  return ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("Expr("))->__mosek_2fusion_2Utils_2StringBuffer__a(x->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"))->toString();
}
// End mosek.fusion.ExprFromVar.toString

void mosek::fusion::p_ExprFromVar::destroy()
{
  x.reset();
}
void mosek::fusion::ExprFromVar::destroy() { mosek::fusion::p_ExprFromVar::_get_impl(this)->destroy(); }
// } class ExprFromVar
// class ExprReshape { // @ bld/docker-win/final/default/src/fusion/ExprShape.monty:5:4-43:5
mosek::fusion::ExprReshape::ExprReshape(mosek::fusion::p_ExprReshape *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "ExprReshape()" << this << std::endl; */ }
mosek::fusion::ExprReshape::~ExprReshape() {  /* std::cout << "~ExprReshape()" << this << std::endl << std::flush; */ }
mosek::fusion::p_ExprReshape::p_ExprReshape
  (::mosek::fusion::ExprReshape * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.ExprReshape.ctor @ bld/docker-win/final/default/src/fusion/ExprShape.monty:7:6-14:7
mosek::fusion::ExprReshape::t mosek::fusion::p_ExprReshape::_new_ExprReshape
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _7258_shape,
    monty::rc_ptr< ::mosek::fusion::Expression > _7259_e)
{ return new mosek::fusion::ExprReshape(_7258_shape,_7259_e); }
mosek::fusion::ExprReshape::ExprReshape
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _7258_shape,
    monty::rc_ptr< ::mosek::fusion::Expression > _7259_e) : 
   ExprReshape(new mosek::fusion::p_ExprReshape(this))
{ mosek::fusion::p_ExprReshape::_get_impl(this)->_initialize(_7258_shape,_7259_e); }
void mosek::fusion::p_ExprReshape::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _7258_shape,
    monty::rc_ptr< ::mosek::fusion::Expression > _7259_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__7258_shape(_7258_shape ? _7258_shape->raw() : nullptr, _7258_shape ? _7258_shape->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(::mosek::fusion::Utils::Tools::arraycopy(_7258_shape));
    int64_t _7260_esize = _7259_e->getSize();
    if ((::mosek::fusion::p_Set::size(_7258_shape) != _7259_e->getSize()))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Cannot reshape to mismatching shape"));
      }
    }
    {}
    mosek::fusion::p_ExprReshape::_get_impl(::mosek::fusion::ExprReshape::t(_pubthis))->e = _7259_e;
  }
}
// mosek.fusion.ExprReshape.ctor

// Begin mosek.fusion.ExprReshape.eval
// Method mosek.fusion.ExprReshape.eval @ bld/docker-win/final/default/src/fusion/ExprShape.monty:27:6-42:7
void mosek::fusion::ExprReshape :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7261_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7262_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7263_xs) { mosek::fusion::p_ExprReshape::_get_impl(this)->eval(_7261_rs,_7262_ws,_7263_xs); }
void mosek::fusion::p_ExprReshape::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _7261_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _7262_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _7263_xs)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7264_eshape = _pubthis->getShape();
  _checked_ptr_1<int32_t> _ptr__7264_eshape(_7264_eshape ? _7264_eshape->raw() : nullptr,_7264_eshape ? _7264_eshape->size(0) : 0);
  e->eval(_7261_rs,_7262_ws,_7263_xs);
  _7261_rs->peek_expr();
  int32_t _7265_nd = _7261_rs->popi32();
  int64_t _7266_sz = (int)1;
  int32_t _12564_ = (int)0;
  int32_t _12565_ = _7265_nd;
  for (int32_t _7267_i = _12564_; _7267_i < _12565_; ++_7267_i)
  {
    {
      _7266_sz *= _7261_rs->popi32();
    }
  }
  if ((_7266_sz != _pubthis->getSize()))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("The two shapes have different sizes"));
    }
  }
  {}
  int32_t _12566_ = (int)0;
  int32_t _12567_ = (int)((_7264_eshape)->size(0));
  for (int32_t _7268_i = _12566_; _7268_i < _12567_; ++_7268_i)
  {
    {
      _7261_rs->pushi32(_ptr__7264_eshape[_7268_i]);
    }
  }
  _7261_rs->pushi32((int)((_7264_eshape)->size(0)));
}
// End mosek.fusion.ExprReshape.eval

// Begin mosek.fusion.ExprReshape.toString
// Method mosek.fusion.ExprReshape.toString @ bld/docker-win/final/default/src/fusion/ExprShape.monty:16:6-25:7
std::string mosek::fusion::ExprReshape :: toString() { return mosek::fusion::p_ExprReshape::_get_impl(this)->toString(); }
std::string mosek::fusion::p_ExprReshape::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _7269_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer()->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("ExprReshape(("));
  if ((_pubthis->getND() > (int)0))
  {
    {
      _7269_sb->__mosek_2fusion_2Utils_2StringBuffer__a(_pubthis->getDim((int)0));
      int32_t _12568_ = (int)1;
      int32_t _12569_ = _pubthis->getND();
      for (int32_t _7270_i = _12568_; _7270_i < _12569_; ++_7270_i)
      {
        {
          _7269_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(_pubthis->getDim(_7270_i));
        }
      }
    }
  }
  {}
  _7269_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("),"))->__mosek_2fusion_2Utils_2StringBuffer__a(e->toString())->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _7269_sb->toString();
}
// End mosek.fusion.ExprReshape.toString

void mosek::fusion::p_ExprReshape::destroy()
{
  e.reset();
}
void mosek::fusion::ExprReshape::destroy() { mosek::fusion::p_ExprReshape::_get_impl(this)->destroy(); }
// } class ExprReshape
// class ExprRangeDomain { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:533:4-538:5
mosek::fusion::ExprRangeDomain::ExprRangeDomain(mosek::fusion::p_ExprRangeDomain *_impl) : _impl(_impl) { /*std::cout << "ExprRangeDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ExprRangeDomain::~ExprRangeDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ExprRangeDomain::p_ExprRangeDomain
  (::mosek::fusion::ExprRangeDomain * _pubthis) :     _pubthis(_pubthis)
{}
monty::rc_ptr< ::mosek::fusion::RangeDomain > mosek::fusion::ExprRangeDomain::get_dom() { return _impl->dom; }
void mosek::fusion::ExprRangeDomain::set_dom(monty::rc_ptr< ::mosek::fusion::RangeDomain > _val) { _impl->dom = _val; }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprRangeDomain::get_expr() { return _impl->expr; }
void mosek::fusion::ExprRangeDomain::set_expr(monty::rc_ptr< ::mosek::fusion::Expression > _val) { _impl->expr = _val; }
// mosek.fusion.ExprRangeDomain.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:536:6-89
mosek::fusion::ExprRangeDomain::t mosek::fusion::p_ExprRangeDomain::_new_ExprRangeDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7271_expr,
    monty::rc_ptr< ::mosek::fusion::RangeDomain > _7272_dom)
{ return new mosek::fusion::ExprRangeDomain(_7271_expr,_7272_dom); }
mosek::fusion::ExprRangeDomain::ExprRangeDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7271_expr,
    monty::rc_ptr< ::mosek::fusion::RangeDomain > _7272_dom) : 
   ExprRangeDomain(new mosek::fusion::p_ExprRangeDomain(this))
{ mosek::fusion::p_ExprRangeDomain::_get_impl(this)->_initialize(_7271_expr,_7272_dom); }
void mosek::fusion::p_ExprRangeDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7271_expr,
    monty::rc_ptr< ::mosek::fusion::RangeDomain > _7272_dom)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprRangeDomain::_get_impl(::mosek::fusion::ExprRangeDomain::t(_pubthis))->expr = _7271_expr;
    mosek::fusion::p_ExprRangeDomain::_get_impl(::mosek::fusion::ExprRangeDomain::t(_pubthis))->dom = _7272_dom;
  }
}
// mosek.fusion.ExprRangeDomain.ctor

// Begin mosek.fusion.ExprRangeDomain.toDJCTerm
// Method mosek.fusion.ExprRangeDomain.toDJCTerm @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:537:6-67
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprRangeDomain :: __mosek_2fusion_2ExprRangeDomain__toDJCTerm() { return mosek::fusion::p_ExprRangeDomain::_get_impl(this)->__mosek_2fusion_2ExprRangeDomain__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprRangeDomain::toDJCTerm() { return __mosek_2fusion_2ExprRangeDomain__toDJCTerm(); }
/* override: mosek.fusion.ExprDomain.toDJCTerm*/
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprRangeDomain::__mosek_2fusion_2ExprDomain__toDJCTerm() { return __mosek_2fusion_2ExprRangeDomain__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_ExprRangeDomain::__mosek_2fusion_2ExprRangeDomain__toDJCTerm()
{
  return (::mosek::fusion::p_DJC::term(expr,dom)).as<::mosek::fusion::Term>();
}
// End mosek.fusion.ExprRangeDomain.toDJCTerm

void mosek::fusion::p_ExprRangeDomain::destroy()
{
  dom.reset();
  expr.reset();
}
void mosek::fusion::ExprRangeDomain::destroy() { mosek::fusion::p_ExprRangeDomain::_get_impl(this)->destroy(); }
// } class ExprRangeDomain
// class ExprPSDDomain { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:523:4-527:5
mosek::fusion::ExprPSDDomain::ExprPSDDomain(mosek::fusion::p_ExprPSDDomain *_impl) : _impl(_impl) { /*std::cout << "ExprPSDDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ExprPSDDomain::~ExprPSDDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ExprPSDDomain::p_ExprPSDDomain
  (::mosek::fusion::ExprPSDDomain * _pubthis) :     _pubthis(_pubthis)
{}
monty::rc_ptr< ::mosek::fusion::PSDDomain > mosek::fusion::ExprPSDDomain::get_dom() { return _impl->dom; }
void mosek::fusion::ExprPSDDomain::set_dom(monty::rc_ptr< ::mosek::fusion::PSDDomain > _val) { _impl->dom = _val; }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprPSDDomain::get_expr() { return _impl->expr; }
void mosek::fusion::ExprPSDDomain::set_expr(monty::rc_ptr< ::mosek::fusion::Expression > _val) { _impl->expr = _val; }
// mosek.fusion.ExprPSDDomain.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:526:6-87
mosek::fusion::ExprPSDDomain::t mosek::fusion::p_ExprPSDDomain::_new_ExprPSDDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7273_expr,
    monty::rc_ptr< ::mosek::fusion::PSDDomain > _7274_dom)
{ return new mosek::fusion::ExprPSDDomain(_7273_expr,_7274_dom); }
mosek::fusion::ExprPSDDomain::ExprPSDDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7273_expr,
    monty::rc_ptr< ::mosek::fusion::PSDDomain > _7274_dom) : 
   ExprPSDDomain(new mosek::fusion::p_ExprPSDDomain(this))
{ mosek::fusion::p_ExprPSDDomain::_get_impl(this)->_initialize(_7273_expr,_7274_dom); }
void mosek::fusion::p_ExprPSDDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7273_expr,
    monty::rc_ptr< ::mosek::fusion::PSDDomain > _7274_dom)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprPSDDomain::_get_impl(::mosek::fusion::ExprPSDDomain::t(_pubthis))->expr = _7273_expr;
    mosek::fusion::p_ExprPSDDomain::_get_impl(::mosek::fusion::ExprPSDDomain::t(_pubthis))->dom = _7274_dom;
  }
}
// mosek.fusion.ExprPSDDomain.ctor

void mosek::fusion::p_ExprPSDDomain::destroy()
{
  dom.reset();
  expr.reset();
}
void mosek::fusion::ExprPSDDomain::destroy() { mosek::fusion::p_ExprPSDDomain::_get_impl(this)->destroy(); }
// } class ExprPSDDomain
// class ExprConicDomain { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:513:4-517:5
mosek::fusion::ExprConicDomain::ExprConicDomain(mosek::fusion::p_ExprConicDomain *_impl) : _impl(_impl) { /*std::cout << "ExprConicDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ExprConicDomain::~ExprConicDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ExprConicDomain::p_ExprConicDomain
  (::mosek::fusion::ExprConicDomain * _pubthis) :     _pubthis(_pubthis)
{}
monty::rc_ptr< ::mosek::fusion::ConeDomain > mosek::fusion::ExprConicDomain::get_dom() { return _impl->dom; }
void mosek::fusion::ExprConicDomain::set_dom(monty::rc_ptr< ::mosek::fusion::ConeDomain > _val) { _impl->dom = _val; }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprConicDomain::get_expr() { return _impl->expr; }
void mosek::fusion::ExprConicDomain::set_expr(monty::rc_ptr< ::mosek::fusion::Expression > _val) { _impl->expr = _val; }
// mosek.fusion.ExprConicDomain.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:516:6-88
mosek::fusion::ExprConicDomain::t mosek::fusion::p_ExprConicDomain::_new_ExprConicDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7275_expr,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _7276_dom)
{ return new mosek::fusion::ExprConicDomain(_7275_expr,_7276_dom); }
mosek::fusion::ExprConicDomain::ExprConicDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7275_expr,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _7276_dom) : 
   ExprConicDomain(new mosek::fusion::p_ExprConicDomain(this))
{ mosek::fusion::p_ExprConicDomain::_get_impl(this)->_initialize(_7275_expr,_7276_dom); }
void mosek::fusion::p_ExprConicDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7275_expr,
    monty::rc_ptr< ::mosek::fusion::ConeDomain > _7276_dom)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprConicDomain::_get_impl(::mosek::fusion::ExprConicDomain::t(_pubthis))->expr = _7275_expr;
    mosek::fusion::p_ExprConicDomain::_get_impl(::mosek::fusion::ExprConicDomain::t(_pubthis))->dom = _7276_dom;
  }
}
// mosek.fusion.ExprConicDomain.ctor

void mosek::fusion::p_ExprConicDomain::destroy()
{
  dom.reset();
  expr.reset();
}
void mosek::fusion::ExprConicDomain::destroy() { mosek::fusion::p_ExprConicDomain::_get_impl(this)->destroy(); }
// } class ExprConicDomain
// class ExprLinearDomain { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:502:4-507:5
mosek::fusion::ExprLinearDomain::ExprLinearDomain(mosek::fusion::p_ExprLinearDomain *_impl) : _impl(_impl) { /*std::cout << "ExprLinearDomain() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::ExprLinearDomain::~ExprLinearDomain() { delete _impl; _impl = nullptr; }
mosek::fusion::p_ExprLinearDomain::p_ExprLinearDomain
  (::mosek::fusion::ExprLinearDomain * _pubthis) :     _pubthis(_pubthis)
{}
monty::rc_ptr< ::mosek::fusion::LinearDomain > mosek::fusion::ExprLinearDomain::get_dom() { return _impl->dom; }
void mosek::fusion::ExprLinearDomain::set_dom(monty::rc_ptr< ::mosek::fusion::LinearDomain > _val) { _impl->dom = _val; }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::ExprLinearDomain::get_expr() { return _impl->expr; }
void mosek::fusion::ExprLinearDomain::set_expr(monty::rc_ptr< ::mosek::fusion::Expression > _val) { _impl->expr = _val; }
// mosek.fusion.ExprLinearDomain.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:505:6-90
mosek::fusion::ExprLinearDomain::t mosek::fusion::p_ExprLinearDomain::_new_ExprLinearDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7277_expr,
    monty::rc_ptr< ::mosek::fusion::LinearDomain > _7278_dom)
{ return new mosek::fusion::ExprLinearDomain(_7277_expr,_7278_dom); }
mosek::fusion::ExprLinearDomain::ExprLinearDomain
  (monty::rc_ptr< ::mosek::fusion::Expression > _7277_expr,
    monty::rc_ptr< ::mosek::fusion::LinearDomain > _7278_dom) : 
   ExprLinearDomain(new mosek::fusion::p_ExprLinearDomain(this))
{ mosek::fusion::p_ExprLinearDomain::_get_impl(this)->_initialize(_7277_expr,_7278_dom); }
void mosek::fusion::p_ExprLinearDomain::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7277_expr,
    monty::rc_ptr< ::mosek::fusion::LinearDomain > _7278_dom)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_ExprLinearDomain::_get_impl(::mosek::fusion::ExprLinearDomain::t(_pubthis))->expr = _7277_expr;
    mosek::fusion::p_ExprLinearDomain::_get_impl(::mosek::fusion::ExprLinearDomain::t(_pubthis))->dom = _7278_dom;
  }
}
// mosek.fusion.ExprLinearDomain.ctor

// Begin mosek.fusion.ExprLinearDomain.toDJCTerm
// Method mosek.fusion.ExprLinearDomain.toDJCTerm @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:506:6-67
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprLinearDomain :: __mosek_2fusion_2ExprLinearDomain__toDJCTerm() { return mosek::fusion::p_ExprLinearDomain::_get_impl(this)->__mosek_2fusion_2ExprLinearDomain__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprLinearDomain::toDJCTerm() { return __mosek_2fusion_2ExprLinearDomain__toDJCTerm(); }
/* override: mosek.fusion.ExprDomain.toDJCTerm*/
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::ExprLinearDomain::__mosek_2fusion_2ExprDomain__toDJCTerm() { return __mosek_2fusion_2ExprLinearDomain__toDJCTerm(); }
monty::rc_ptr< ::mosek::fusion::Term > mosek::fusion::p_ExprLinearDomain::__mosek_2fusion_2ExprLinearDomain__toDJCTerm()
{
  return (::mosek::fusion::p_DJC::term(expr,dom)).as<::mosek::fusion::Term>();
}
// End mosek.fusion.ExprLinearDomain.toDJCTerm

void mosek::fusion::p_ExprLinearDomain::destroy()
{
  dom.reset();
  expr.reset();
}
void mosek::fusion::ExprLinearDomain::destroy() { mosek::fusion::p_ExprLinearDomain::_get_impl(this)->destroy(); }
// } class ExprLinearDomain
// class ExprDomain { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:492:4-495:5
// Begin mosek.fusion.ExprDomain.toDJCTerm
monty::rc_ptr< mosek::fusion::Term > mosek::fusion::ExprDomain::toDJCTerm() { return __mosek_2fusion_2ExprDomain__toDJCTerm(); }
// End mosek.fusion.ExprDomain.toDJCTerm

// } class ExprDomain
// class BaseExpression { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:400:4-485:5
mosek::fusion::BaseExpression::BaseExpression(mosek::fusion::p_BaseExpression *_impl) : _impl(_impl) { /*std::cout << "BaseExpression() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::BaseExpression::~BaseExpression() { delete _impl; _impl = nullptr; }
mosek::fusion::p_BaseExpression::p_BaseExpression
  (::mosek::fusion::BaseExpression * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.BaseExpression.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:403:6-405:7
void mosek::fusion::p_BaseExpression::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _7279_shape)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__7279_shape(_7279_shape ? _7279_shape->raw() : nullptr, _7279_shape ? _7279_shape->size(0) : 0);
    mosek::fusion::p_BaseExpression::_get_impl(::mosek::fusion::BaseExpression::t(_pubthis))->shape = _7279_shape;
  }
}
// mosek.fusion.BaseExpression.ctor

// Begin mosek.fusion.BaseExpression.toString
// Method mosek.fusion.BaseExpression.toString @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:484:6-64
std::string mosek::fusion::BaseExpression :: toString() { return mosek::fusion::p_BaseExpression::_get_impl(this)->toString(); }
std::string mosek::fusion::p_BaseExpression::toString()
{
  return std::string ("Expression()");
}
// End mosek.fusion.BaseExpression.toString

// Begin mosek.fusion.BaseExpression.printStack
// Method mosek.fusion.BaseExpression.printStack @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:437:6-482:7
void mosek::fusion::p_BaseExpression::printStack(monty::rc_ptr< ::mosek::fusion::WorkStack > _7280_rs)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7281_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__7281_ri32(_7281_ri32 ? _7281_ri32->raw() : nullptr,_7281_ri32 ? _7281_ri32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7282_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__7282_ri64(_7282_ri64 ? _7282_ri64->raw() : nullptr,_7282_ri64 ? _7282_ri64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7283_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->f64;
  _checked_ptr_1<double> _ptr__7283_rf64(_7283_rf64 ? _7283_rf64->raw() : nullptr,_7283_rf64 ? _7283_rf64->size(0) : 0);
  int32_t _7284_rptr = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->ptr_base;
  int32_t _7285_rnidxs = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->nidxs_base;
  int32_t _7286_rcof = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->cof_base;
  int32_t _7287_rshape = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->shape_base;
  int32_t _7288_rcodeptr = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->codeptr_base;
  int32_t _7289_rcode = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->code_base;
  int32_t _7290_rcconst = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->cconst_base;
  int32_t _7291_rsp = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->sp_base;
  int32_t _7292_rnelem = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->nelem;
  int32_t _7293_rnnz = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->nnz;
  int32_t _7294_rncodeatom = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->ncodeatom;
  int32_t _7295_rnd = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->nd;
  bool _7296_rhassp = mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->hassp;
  std::vector<int32_t> _12570_;
  for (int32_t _7297_i = (int)0, _12571_ = _7295_rnd; _7297_i < _12571_ ; ++_7297_i)
  {
    _12570_.push_back(_ptr__7281_ri32[safe_add( _7287_rshape,_7297_i )]);
  }
  auto _12572_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12570_.size()),_12570_.begin(),_12570_.end()));
  std::vector<int32_t> _12573_;
  for (int32_t _7298_i = (int)0, _12574_ = safe_add( _7292_rnelem,(int)1 ); _7298_i < _12574_ ; ++_7298_i)
  {
    _12573_.push_back(_ptr__7281_ri32[safe_add( _7284_rptr,_7298_i )]);
  }
  auto _12575_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12573_.size()),_12573_.begin(),_12573_.end()));
  ::mosek::fusion::p_Debug::o()->__mosek_2fusion_2Debug__p(std::string ("### "))->__mosek_2fusion_2Debug__p(_pubthis->toString())->__mosek_2fusion_2Debug__p(std::string (" ###"))->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("  nelem     = "))->__mosek_2fusion_2Debug__p(_7292_rnelem)->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("  nnz       = "))->__mosek_2fusion_2Debug__p(_7293_rnnz)->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("  hassp     = "))->__mosek_2fusion_2Debug__p(_7296_rhassp)->__mosek_2fusion_2Debug__p(std::string (" / "))->__mosek_2fusion_2Debug__p(_ptr__7281_ri32[((mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->pi32 - _7295_rnd) - (int)4)])->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("  shape     = "))->__mosek_2fusion_2Debug__p(_12572_)->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("  ptr       = "))->__mosek_2fusion_2Debug__p(_12575_)->__mosek_2fusion_2Debug__lf();
  if (mosek::fusion::p_WorkStack::_get_impl(_7280_rs)->hassp)
  {
    {
      std::vector<int64_t> _12576_;
      for (int32_t _7299_i = (int)0, _12577_ = _7292_rnelem; _7299_i < _12577_ ; ++_7299_i)
      {
        _12576_.push_back(_ptr__7282_ri64[safe_add( _7291_rsp,_7299_i )]);
      }
      auto _12578_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12576_.size()),_12576_.begin(),_12576_.end()));
      ::mosek::fusion::p_Debug::o()->__mosek_2fusion_2Debug__p(std::string ("  sp       = "))->__mosek_2fusion_2Debug__p(_12578_)->__mosek_2fusion_2Debug__lf();
    }
  }
  {}
  int32_t _12579_ = (int)0;
  int32_t _12580_ = _7292_rnelem;
  for (int32_t _7300_i = _12579_; _7300_i < _12580_; ++_7300_i)
  {
    {
      ::mosek::fusion::p_Debug::o()->__mosek_2fusion_2Debug__p(std::string ("  row["))->__mosek_2fusion_2Debug__p(_7300_i)->__mosek_2fusion_2Debug__p(std::string ("]"))->__mosek_2fusion_2Debug__lf();
      std::vector<int64_t> _12581_;
      for (int32_t _7301_j = _ptr__7281_ri32[safe_add( _7284_rptr,_7300_i )], _12582_ = _ptr__7281_ri32[safe_add( safe_add( _7284_rptr,_7300_i ),(int)1 )]; _7301_j < _12582_ ; ++_7301_j)
      {
        _12581_.push_back(_ptr__7282_ri64[safe_add( _7285_rnidxs,_7301_j )]);
      }
      auto _12583_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12581_.size()),_12581_.begin(),_12581_.end()));
      std::vector<double> _12584_;
      for (int32_t _7302_j = _ptr__7281_ri32[safe_add( _7284_rptr,_7300_i )], _12585_ = _ptr__7281_ri32[safe_add( safe_add( _7284_rptr,_7300_i ),(int)1 )]; _7302_j < _12585_ ; ++_7302_j)
      {
        _12584_.push_back(_ptr__7283_rf64[safe_add( _7286_rcof,_7302_j )]);
      }
      auto _12586_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12584_.size()),_12584_.begin(),_12584_.end()));
      ::mosek::fusion::p_Debug::o()->__mosek_2fusion_2Debug__p(std::string ("    nidx : "))->__mosek_2fusion_2Debug__p(_12583_)->__mosek_2fusion_2Debug__lf()->__mosek_2fusion_2Debug__p(std::string ("    cof  : "))->__mosek_2fusion_2Debug__p(_12586_)->__mosek_2fusion_2Debug__lf();
      if ((_7294_rncodeatom > (int)0))
      {
        {
          int32_t _12587_ = _ptr__7281_ri32[safe_add( _7284_rptr,_7300_i )];
          int32_t _12588_ = _ptr__7281_ri32[safe_add( safe_add( _7284_rptr,_7300_i ),(int)1 )];
          for (int32_t _7303_j = _12587_; _7303_j < _12588_; ++_7303_j)
          {
            {
              std::vector<int32_t> _12589_;
              for (int32_t _7304_k = _ptr__7281_ri32[safe_add( _7288_rcodeptr,_7303_j )], _12590_ = _ptr__7281_ri32[safe_add( safe_add( _7288_rcodeptr,_7303_j ),(int)1 )]; _7304_k < _12590_ ; ++_7304_k)
              {
                _12589_.push_back(_ptr__7281_ri32[safe_add( _7289_rcode,_7304_k )]);
              }
              auto _12591_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12589_.size()),_12589_.begin(),_12589_.end()));
              std::vector<double> _12592_;
              for (int32_t _7305_k = _ptr__7281_ri32[safe_add( _7288_rcodeptr,_7303_j )], _12593_ = _ptr__7281_ri32[safe_add( safe_add( _7288_rcodeptr,_7303_j ),(int)1 )]; _7305_k < _12593_ ; ++_7305_k)
              {
                _12592_.push_back(_ptr__7283_rf64[safe_add( _7290_rcconst,_7305_k )]);
              }
              auto _12594_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12592_.size()),_12592_.begin(),_12592_.end()));
              ::mosek::fusion::p_Debug::o()->__mosek_2fusion_2Debug__p(std::string ("      code["))->__mosek_2fusion_2Debug__p(_ptr__7282_ri64[safe_add( _7285_rnidxs,_7303_j )])->__mosek_2fusion_2Debug__p(std::string ("] "))->__mosek_2fusion_2Debug__p(_12591_)->__mosek_2fusion_2Debug__p(_12594_)->__mosek_2fusion_2Debug__lf();
            }
          }
        }
      }
      {}
    }
  }
}
// End mosek.fusion.BaseExpression.printStack

// Begin mosek.fusion.BaseExpression.eval
// End mosek.fusion.BaseExpression.eval

// Begin mosek.fusion.BaseExpression.pick
// Method mosek.fusion.BaseExpression.pick @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:430:6-432:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _7309_indexrows) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__pick(_7309_indexrows); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _7309_indexrows) { return __mosek_2fusion_2BaseExpression__pick(_7309_indexrows); }
/* override: mosek.fusion.Expression.pick*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _7309_indexrows) { return __mosek_2fusion_2BaseExpression__pick(_7309_indexrows); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _7309_indexrows)
{
  return (::mosek::fusion::p_ExprPick::_new_ExprPick((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),_7309_indexrows)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.pick

// Begin mosek.fusion.BaseExpression.pick
// Method mosek.fusion.BaseExpression.pick @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:426:6-429:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _7310_indexes) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__pick(_7310_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _7310_indexes) { return __mosek_2fusion_2BaseExpression__pick(_7310_indexes); }
/* override: mosek.fusion.Expression.pick*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _7310_indexes) { return __mosek_2fusion_2BaseExpression__pick(_7310_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _7310_indexes)
{
  _checked_ptr_1<int32_t> _ptr__7310_indexes(_7310_indexes ? _7310_indexes->raw() : nullptr, _7310_indexes ? _7310_indexes->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,2 > > _7311_idxs = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_7310_indexes)->size(0)),(int)1)));
  int32_t _12595_ = (int)0;
  int32_t _12596_ = (int)((_7310_indexes)->size(0));
  for (int32_t _7312_i = _12595_; _7312_i < _12596_; ++_7312_i)
  {
    {
      ((*_7311_idxs)(_7312_i,(int)0)) = _ptr__7310_indexes[_7312_i];
    }
  }
  return (::mosek::fusion::p_ExprPick::_new_ExprPick((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),_7311_idxs)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.pick

// Begin mosek.fusion.BaseExpression.index
// Method mosek.fusion.BaseExpression.index @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:422:6-425:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _7313_indexes) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__index(_7313_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _7313_indexes) { return __mosek_2fusion_2BaseExpression__index(_7313_indexes); }
/* override: mosek.fusion.Expression.index*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _7313_indexes) { return __mosek_2fusion_2BaseExpression__index(_7313_indexes); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__index(std::shared_ptr< monty::ndarray< int32_t,1 > > _7313_indexes)
{
  _checked_ptr_1<int32_t> _ptr__7313_indexes(_7313_indexes ? _7313_indexes->raw() : nullptr, _7313_indexes ? _7313_indexes->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,2 > > _7314_idxs = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)1,(int)((_7313_indexes)->size(0)))));
  int32_t _12597_ = (int)0;
  int32_t _12598_ = (int)((_7313_indexes)->size(0));
  for (int32_t _7315_i = _12597_; _7315_i < _12598_; ++_7315_i)
  {
    {
      ((*_7314_idxs)((int)0,_7315_i)) = _ptr__7313_indexes[_7315_i];
    }
  }
  return (::mosek::fusion::p_ExprPick::_new_ExprPick((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),_7314_idxs)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.index

// Begin mosek.fusion.BaseExpression.index
// Method mosek.fusion.BaseExpression.index @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:418:6-421:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__index(int32_t _7316_i) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__index(_7316_i); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::index(int32_t _7316_i) { return __mosek_2fusion_2BaseExpression__index(_7316_i); }
/* override: mosek.fusion.Expression.index*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__index(int32_t _7316_i) { return __mosek_2fusion_2BaseExpression__index(_7316_i); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__index(int32_t _7316_i)
{
  std::shared_ptr< monty::ndarray< int32_t,2 > > _7317_idxs = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)1,(int)1)));
  ((*_7317_idxs)((int)0,(int)0)) = _7316_i;
  return (::mosek::fusion::p_ExprPick::_new_ExprPick((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),_7317_idxs)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.index

// Begin mosek.fusion.BaseExpression.slice
// Method mosek.fusion.BaseExpression.slice @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:415:6-417:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _7318_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _7319_lasta) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__slice(_7318_firsta,_7319_lasta); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _7318_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _7319_lasta) { return __mosek_2fusion_2BaseExpression__slice(_7318_firsta,_7319_lasta); }
/* override: mosek.fusion.Expression.slice*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _7318_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _7319_lasta) { return __mosek_2fusion_2BaseExpression__slice(_7318_firsta,_7319_lasta); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _7318_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _7319_lasta)
{
  _checked_ptr_1<int32_t> _ptr__7318_firsta(_7318_firsta ? _7318_firsta->raw() : nullptr, _7318_firsta ? _7318_firsta->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__7319_lasta(_7319_lasta ? _7319_lasta->raw() : nullptr, _7319_lasta ? _7319_lasta->size(0) : 0);
  return (::mosek::fusion::p_ExprSlice::_new_ExprSlice((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),_7318_firsta,_7319_lasta)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.slice

// Begin mosek.fusion.BaseExpression.slice
// Method mosek.fusion.BaseExpression.slice @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:412:6-414:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression :: __mosek_2fusion_2BaseExpression__slice(int32_t _7320_first,int32_t _7321_last) { return mosek::fusion::p_BaseExpression::_get_impl(this)->__mosek_2fusion_2BaseExpression__slice(_7320_first,_7321_last); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::slice(int32_t _7320_first,int32_t _7321_last) { return __mosek_2fusion_2BaseExpression__slice(_7320_first,_7321_last); }
/* override: mosek.fusion.Expression.slice*/
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::BaseExpression::__mosek_2fusion_2Expression__slice(int32_t _7320_first,int32_t _7321_last) { return __mosek_2fusion_2BaseExpression__slice(_7320_first,_7321_last); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_BaseExpression::__mosek_2fusion_2BaseExpression__slice(int32_t _7320_first,int32_t _7321_last)
{
  return (::mosek::fusion::p_ExprSlice::_new_ExprSlice((::mosek::fusion::BaseExpression::t(_pubthis)).as<::mosek::fusion::Expression>(),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7320_first)}),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7321_last)}))).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.BaseExpression.slice

// Begin mosek.fusion.BaseExpression.getSize
// Method mosek.fusion.BaseExpression.getSize @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:410:6-64
int64_t mosek::fusion::BaseExpression :: getSize() { return mosek::fusion::p_BaseExpression::_get_impl(this)->getSize(); }
int64_t mosek::fusion::p_BaseExpression::getSize()
{
  return ::mosek::fusion::p_Set::size(shape);
}
// End mosek.fusion.BaseExpression.getSize

// Begin mosek.fusion.BaseExpression.getND
// Method mosek.fusion.BaseExpression.getND @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:409:6-59
int32_t mosek::fusion::BaseExpression :: getND() { return mosek::fusion::p_BaseExpression::_get_impl(this)->getND(); }
int32_t mosek::fusion::p_BaseExpression::getND()
{
  return (int)((shape)->size(0));
}
// End mosek.fusion.BaseExpression.getND

// Begin mosek.fusion.BaseExpression.getDim
// Method mosek.fusion.BaseExpression.getDim @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:408:6-64
int32_t mosek::fusion::BaseExpression :: getDim(int32_t _7322_d) { return mosek::fusion::p_BaseExpression::_get_impl(this)->getDim(_7322_d); }
int32_t mosek::fusion::p_BaseExpression::getDim(int32_t _7322_d)
{
  return ((*shape)(_7322_d));
}
// End mosek.fusion.BaseExpression.getDim

// Begin mosek.fusion.BaseExpression.getShape
// Method mosek.fusion.BaseExpression.getShape @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:407:6-79
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::BaseExpression :: getShape() { return mosek::fusion::p_BaseExpression::_get_impl(this)->getShape(); }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::p_BaseExpression::getShape()
{
  return ::mosek::fusion::Utils::Tools::arraycopy(shape);
}
// End mosek.fusion.BaseExpression.getShape

void mosek::fusion::p_BaseExpression::destroy()
{
  shape.reset();
}
void mosek::fusion::BaseExpression::destroy() { mosek::fusion::p_BaseExpression::_get_impl(this)->destroy(); }
// } class BaseExpression
// class WorkStack { // @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:46:4-395:5
mosek::fusion::WorkStack::WorkStack(mosek::fusion::p_WorkStack *_impl) : _impl(_impl) { /*std::cout << "WorkStack() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::WorkStack::~WorkStack() { delete _impl; _impl = nullptr; }
mosek::fusion::p_WorkStack::p_WorkStack
  (::mosek::fusion::WorkStack * _pubthis) :     _pubthis(_pubthis)
{}
int32_t mosek::fusion::WorkStack::get_code_base() { return _impl->code_base; }
void mosek::fusion::WorkStack::set_code_base(int32_t _val) { _impl->code_base = _val; }
int32_t mosek::fusion::WorkStack::get_cconst_base() { return _impl->cconst_base; }
void mosek::fusion::WorkStack::set_cconst_base(int32_t _val) { _impl->cconst_base = _val; }
int32_t mosek::fusion::WorkStack::get_codeptr_base() { return _impl->codeptr_base; }
void mosek::fusion::WorkStack::set_codeptr_base(int32_t _val) { _impl->codeptr_base = _val; }
int32_t mosek::fusion::WorkStack::get_cof_base() { return _impl->cof_base; }
void mosek::fusion::WorkStack::set_cof_base(int32_t _val) { _impl->cof_base = _val; }
int32_t mosek::fusion::WorkStack::get_nidxs_base() { return _impl->nidxs_base; }
void mosek::fusion::WorkStack::set_nidxs_base(int32_t _val) { _impl->nidxs_base = _val; }
int32_t mosek::fusion::WorkStack::get_sp_base() { return _impl->sp_base; }
void mosek::fusion::WorkStack::set_sp_base(int32_t _val) { _impl->sp_base = _val; }
int32_t mosek::fusion::WorkStack::get_shape_base() { return _impl->shape_base; }
void mosek::fusion::WorkStack::set_shape_base(int32_t _val) { _impl->shape_base = _val; }
int32_t mosek::fusion::WorkStack::get_ptr_base() { return _impl->ptr_base; }
void mosek::fusion::WorkStack::set_ptr_base(int32_t _val) { _impl->ptr_base = _val; }
bool mosek::fusion::WorkStack::get_hassp() { return _impl->hassp; }
void mosek::fusion::WorkStack::set_hassp(bool _val) { _impl->hassp = _val; }
int32_t mosek::fusion::WorkStack::get_ncodeatom() { return _impl->ncodeatom; }
void mosek::fusion::WorkStack::set_ncodeatom(int32_t _val) { _impl->ncodeatom = _val; }
int32_t mosek::fusion::WorkStack::get_nelem() { return _impl->nelem; }
void mosek::fusion::WorkStack::set_nelem(int32_t _val) { _impl->nelem = _val; }
int32_t mosek::fusion::WorkStack::get_nnz() { return _impl->nnz; }
void mosek::fusion::WorkStack::set_nnz(int32_t _val) { _impl->nnz = _val; }
int32_t mosek::fusion::WorkStack::get_nd() { return _impl->nd; }
void mosek::fusion::WorkStack::set_nd(int32_t _val) { _impl->nd = _val; }
int32_t mosek::fusion::WorkStack::get_pf64() { return _impl->pf64; }
void mosek::fusion::WorkStack::set_pf64(int32_t _val) { _impl->pf64 = _val; }
int32_t mosek::fusion::WorkStack::get_pi64() { return _impl->pi64; }
void mosek::fusion::WorkStack::set_pi64(int32_t _val) { _impl->pi64 = _val; }
int32_t mosek::fusion::WorkStack::get_pi32() { return _impl->pi32; }
void mosek::fusion::WorkStack::set_pi32(int32_t _val) { _impl->pi32 = _val; }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::WorkStack::get_f64() { return _impl->f64; }
void mosek::fusion::WorkStack::set_f64(std::shared_ptr< monty::ndarray< double,1 > > _val) { _impl->f64 = _val; }
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::WorkStack::get_i64() { return _impl->i64; }
void mosek::fusion::WorkStack::set_i64(std::shared_ptr< monty::ndarray< int64_t,1 > > _val) { _impl->i64 = _val; }
std::shared_ptr< monty::ndarray< int32_t,1 > > mosek::fusion::WorkStack::get_i32() { return _impl->i32; }
void mosek::fusion::WorkStack::set_i32(std::shared_ptr< monty::ndarray< int32_t,1 > > _val) { _impl->i32 = _val; }
// mosek.fusion.WorkStack.ctor @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:212:6-236:7
mosek::fusion::WorkStack::t mosek::fusion::p_WorkStack::_new_WorkStack
  ()
{ return new mosek::fusion::WorkStack(); }
mosek::fusion::WorkStack::WorkStack
  () : 
   WorkStack(new mosek::fusion::p_WorkStack(this))
{ mosek::fusion::p_WorkStack::_get_impl(this)->_initialize(); }
void mosek::fusion::p_WorkStack::_initialize  ()
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    i32 = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)128)));
    i64 = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)128)));
    f64 = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)128)));
    pi32 = (int)0;
    pi64 = (int)0;
    pf64 = (int)0;
    nd = (int)0;
    nnz = (int)0;
    nelem = (int)0;
    hassp = false;
    ncodeatom = (int)0;
    ptr_base = (int)0;
    shape_base = (int)0;
    sp_base = (int)0;
    nidxs_base = (int)0;
    cof_base = (int)0;
    cconst_base = (int)0;
    code_base = (int)0;
    codeptr_base = (int)0;
  }
}
// mosek.fusion.WorkStack.ctor

// Begin mosek.fusion.WorkStack.formatCurrent
// Method mosek.fusion.WorkStack.formatCurrent @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:366:6-394:7
std::string mosek::fusion::WorkStack :: formatCurrent() { return mosek::fusion::p_WorkStack::_get_impl(this)->formatCurrent(); }
std::string mosek::fusion::p_WorkStack::formatCurrent()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _7323_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  std::vector<int32_t> _12599_;
  for (int32_t _7324_i = (int)0, _12600_ = nd; _7324_i < _12600_ ; ++_7324_i)
  {
    _12599_.push_back(((*i32)(safe_add( shape_base,_7324_i ))));
  }
  auto _12601_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12599_.size()),_12599_.begin(),_12599_.end()));
  std::vector<int32_t> _12602_;
  for (int32_t _7325_i = (int)0, _12603_ = safe_add( nelem,(int)1 ); _7325_i < _12603_ ; ++_7325_i)
  {
    _12602_.push_back(((*i32)(safe_add( ptr_base,_7325_i ))));
  }
  auto _12604_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12602_.size()),_12602_.begin(),_12602_.end()));
  _7323_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  nelem     = "))->__mosek_2fusion_2Utils_2StringBuffer__a(nelem)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  nnz       = "))->__mosek_2fusion_2Utils_2StringBuffer__a(nnz)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  hassp     = "))->__mosek_2fusion_2Utils_2StringBuffer__a(hassp)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" / "))->__mosek_2fusion_2Utils_2StringBuffer__a(hassp)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  shape     = "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12601_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  ptr       = "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12604_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"));
  if ((ncodeatom > (int)0))
  {
    {
      std::vector<int32_t> _12605_;
      for (int32_t _7326_i = (int)0, _12606_ = safe_add( nnz,(int)1 ); _7326_i < _12606_ ; ++_7326_i)
      {
        _12605_.push_back(((*i32)(safe_add( codeptr_base,_7326_i ))));
      }
      auto _12607_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12605_.size()),_12605_.begin(),_12605_.end()));
      _7323_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  codeptr   = "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12607_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"));
    }
  }
  {}
  if (hassp)
  {
    {
      std::vector<int64_t> _12608_;
      for (int32_t _7327_i = (int)0, _12609_ = nelem; _7327_i < _12609_ ; ++_7327_i)
      {
        _12608_.push_back(((*i64)(safe_add( sp_base,_7327_i ))));
      }
      auto _12610_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12608_.size()),_12608_.begin(),_12608_.end()));
      _7323_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  sp        = "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12610_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"));
    }
  }
  {}
  int32_t _12611_ = (int)0;
  int32_t _12612_ = nelem;
  for (int32_t _7328_i = _12611_; _7328_i < _12612_; ++_7328_i)
  {
    {
      std::vector<int64_t> _12613_;
      for (int32_t _7329_j = ((*i32)(safe_add( ptr_base,_7328_i ))), _12614_ = ((*i32)(safe_add( safe_add( ptr_base,_7328_i ),(int)1 ))); _7329_j < _12614_ ; ++_7329_j)
      {
        _12613_.push_back(((*i64)(safe_add( nidxs_base,_7329_j ))));
      }
      auto _12615_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12613_.size()),_12613_.begin(),_12613_.end()));
      std::vector<double> _12616_;
      for (int32_t _7330_j = ((*i32)(safe_add( ptr_base,_7328_i ))), _12617_ = ((*i32)(safe_add( safe_add( ptr_base,_7328_i ),(int)1 ))); _7330_j < _12617_ ; ++_7330_j)
      {
        _12616_.push_back(((*f64)(safe_add( cof_base,_7330_j ))));
      }
      auto _12618_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12616_.size()),_12616_.begin(),_12616_.end()));
      _7323_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("  row["))->__mosek_2fusion_2Utils_2StringBuffer__a(_7328_i)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("]"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("    nidx : "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12615_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("    cof  : "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12618_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"));
      if ((ncodeatom > (int)0))
      {
        {
          int32_t _12619_ = ((*i32)(safe_add( ptr_base,_7328_i )));
          int32_t _12620_ = ((*i32)(safe_add( safe_add( ptr_base,_7328_i ),(int)1 )));
          for (int32_t _7331_j = _12619_; _7331_j < _12620_; ++_7331_j)
          {
            {
              std::vector<int32_t> _12621_;
              for (int32_t _7332_k = ((*i32)(safe_add( codeptr_base,_7331_j ))), _12622_ = ((*i32)(safe_add( safe_add( codeptr_base,_7331_j ),(int)1 ))); _7332_k < _12622_ ; ++_7332_k)
              {
                _12621_.push_back(((*i32)(safe_add( code_base,_7332_k ))));
              }
              auto _12623_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12621_.size()),_12621_.begin(),_12621_.end()));
              std::vector<double> _12624_;
              for (int32_t _7333_k = ((*i32)(safe_add( codeptr_base,_7331_j ))), _12625_ = ((*i32)(safe_add( safe_add( codeptr_base,_7331_j ),(int)1 ))); _7333_k < _12625_ ; ++_7333_k)
              {
                _12624_.push_back(((*f64)(safe_add( cconst_base,_7333_k ))));
              }
              auto _12626_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12624_.size()),_12624_.begin(),_12624_.end()));
              _7323_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("      code["))->__mosek_2fusion_2Utils_2StringBuffer__a(((*i64)(safe_add( nidxs_base,_7331_j ))))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("] "))->__mosek_2fusion_2Utils_2StringBuffer__a(_12623_)->__mosek_2fusion_2Utils_2StringBuffer__a(_12626_)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("\n"));
            }
          }
        }
      }
      {}
    }
  }
  return _7323_sb->toString();
}
// End mosek.fusion.WorkStack.formatCurrent

// Begin mosek.fusion.WorkStack.peek_hassp
// Method mosek.fusion.WorkStack.peek_hassp @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:364:6-77
bool mosek::fusion::WorkStack :: peek_hassp() { return mosek::fusion::p_WorkStack::_get_impl(this)->peek_hassp(); }
bool mosek::fusion::p_WorkStack::peek_hassp()
{
  return (_pubthis->peeki32(safe_add( (int)3,_pubthis->peek_nd() )) != (int)0);
}
// End mosek.fusion.WorkStack.peek_hassp

// Begin mosek.fusion.WorkStack.peek_nnz
// Method mosek.fusion.WorkStack.peek_nnz @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:362:6-72
int32_t mosek::fusion::WorkStack :: peek_nnz() { return mosek::fusion::p_WorkStack::_get_impl(this)->peek_nnz(); }
int32_t mosek::fusion::p_WorkStack::peek_nnz()
{
  return _pubthis->peeki32(safe_add( (int)2,_pubthis->peek_nd() ));
}
// End mosek.fusion.WorkStack.peek_nnz

// Begin mosek.fusion.WorkStack.peek_nelem
// Method mosek.fusion.WorkStack.peek_nelem @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:360:6-72
int32_t mosek::fusion::WorkStack :: peek_nelem() { return mosek::fusion::p_WorkStack::_get_impl(this)->peek_nelem(); }
int32_t mosek::fusion::p_WorkStack::peek_nelem()
{
  return _pubthis->peeki32(safe_add( (int)1,_pubthis->peek_nd() ));
}
// End mosek.fusion.WorkStack.peek_nelem

// Begin mosek.fusion.WorkStack.peek_dim
// Method mosek.fusion.WorkStack.peek_dim @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:358:6-71
int32_t mosek::fusion::WorkStack :: peek_dim(int32_t _7334_i) { return mosek::fusion::p_WorkStack::_get_impl(this)->peek_dim(_7334_i); }
int32_t mosek::fusion::p_WorkStack::peek_dim(int32_t _7334_i)
{
  return _pubthis->peeki32(safe_add( _7334_i,(int)1 ));
}
// End mosek.fusion.WorkStack.peek_dim

// Begin mosek.fusion.WorkStack.peek_nd
// Method mosek.fusion.WorkStack.peek_nd @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:356:6-68
int32_t mosek::fusion::WorkStack :: peek_nd() { return mosek::fusion::p_WorkStack::_get_impl(this)->peek_nd(); }
int32_t mosek::fusion::p_WorkStack::peek_nd()
{
  return _pubthis->peeki32();
}
// End mosek.fusion.WorkStack.peek_nd

// Begin mosek.fusion.WorkStack.alloc_expr
// Method mosek.fusion.WorkStack.alloc_expr @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:351:6-353:7
void mosek::fusion::WorkStack :: alloc_expr(int32_t _7335_nd,int32_t _7336_nelem,int32_t _7337_nnz,bool _7338_hassp) { mosek::fusion::p_WorkStack::_get_impl(this)->alloc_expr(_7335_nd,_7336_nelem,_7337_nnz,_7338_hassp); }
void mosek::fusion::p_WorkStack::alloc_expr(int32_t _7335_nd,int32_t _7336_nelem,int32_t _7337_nnz,bool _7338_hassp)
{
  _pubthis->alloc_expr(_7335_nd,_7336_nelem,_7337_nnz,_7338_hassp,(int)0);
}
// End mosek.fusion.WorkStack.alloc_expr

// Begin mosek.fusion.WorkStack.alloc_expr
// Method mosek.fusion.WorkStack.alloc_expr @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:323:6-348:7
void mosek::fusion::WorkStack :: alloc_expr(int32_t _7339_nd,int32_t _7340_nelem,int32_t _7341_nnz,bool _7342_hassp,int32_t _7343_ncodeatom) { mosek::fusion::p_WorkStack::_get_impl(this)->alloc_expr(_7339_nd,_7340_nelem,_7341_nnz,_7342_hassp,_7343_ncodeatom); }
void mosek::fusion::p_WorkStack::alloc_expr(int32_t _7339_nd,int32_t _7340_nelem,int32_t _7341_nnz,bool _7342_hassp,int32_t _7343_ncodeatom)
{
  cof_base = _pubthis->allocf64(_7341_nnz);
  cconst_base = _pubthis->allocf64(_7343_ncodeatom);
  nidxs_base = _pubthis->alloci64(_7341_nnz);
  int32_t _12627_;
  bool _12628_ = _7342_hassp;
  if (_12628_)
  {
    _12627_ = _pubthis->alloci64(_7340_nelem);
  }
  else
  {
    _12627_ = (-(int)9999);
  }
  sp_base = _12627_;
  code_base = _pubthis->alloci32(_7343_ncodeatom);
  int32_t _12629_;
  bool _12630_ = (_7343_ncodeatom > (int)0);
  if (_12630_)
  {
    _12629_ = _pubthis->alloci32(safe_add( _7341_nnz,(int)1 ));
  }
  else
  {
    _12629_ = (-(int)9999);
  }
  codeptr_base = _12629_;
  ptr_base = _pubthis->alloci32(safe_add( _7340_nelem,(int)1 ));
  _pubthis->pushi32(_7343_ncodeatom);
  int32_t _12631_;
  bool _12632_ = _7342_hassp;
  if (_12632_)
  {
    _12631_ = (int)1;
  }
  else
  {
    _12631_ = (int)0;
  }
  _pubthis->pushi32(_12631_);
  _pubthis->pushi32(_7341_nnz);
  _pubthis->pushi32(_7340_nelem);
  shape_base = _pubthis->alloci32(_7339_nd);
  _pubthis->pushi32(_7339_nd);
  mosek::fusion::p_WorkStack::_get_impl(::mosek::fusion::WorkStack::t(_pubthis))->ncodeatom = _7343_ncodeatom;
  mosek::fusion::p_WorkStack::_get_impl(::mosek::fusion::WorkStack::t(_pubthis))->nd = _7339_nd;
  mosek::fusion::p_WorkStack::_get_impl(::mosek::fusion::WorkStack::t(_pubthis))->nelem = _7340_nelem;
  mosek::fusion::p_WorkStack::_get_impl(::mosek::fusion::WorkStack::t(_pubthis))->nnz = _7341_nnz;
  mosek::fusion::p_WorkStack::_get_impl(::mosek::fusion::WorkStack::t(_pubthis))->hassp = _7342_hassp;
}
// End mosek.fusion.WorkStack.alloc_expr

// Begin mosek.fusion.WorkStack.pop_expr
// Method mosek.fusion.WorkStack.pop_expr @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:301:6-320:7
void mosek::fusion::WorkStack :: pop_expr() { mosek::fusion::p_WorkStack::_get_impl(this)->pop_expr(); }
void mosek::fusion::p_WorkStack::pop_expr()
{
  nd = _pubthis->popi32();
  shape_base = _pubthis->popi32(nd);
  nelem = _pubthis->popi32();
  nnz = _pubthis->popi32();
  hassp = (_pubthis->popi32() != (int)0);
  ncodeatom = _pubthis->popi32();
  ptr_base = _pubthis->popi32(safe_add( nelem,(int)1 ));
  int32_t _12633_;
  bool _12634_ = (ncodeatom > (int)0);
  if (_12634_)
  {
    _12633_ = _pubthis->popi32(safe_add( nnz,(int)1 ));
  }
  else
  {
    _12633_ = (-(int)9999);
  }
  codeptr_base = _12633_;
  code_base = _pubthis->popi32(ncodeatom);
  int32_t _12635_;
  bool _12636_ = hassp;
  if (_12636_)
  {
    _12635_ = _pubthis->popi64(nelem);
  }
  else
  {
    _12635_ = (-(int)9999);
  }
  sp_base = _12635_;
  nidxs_base = _pubthis->popi64(nnz);
  cconst_base = _pubthis->popf64(ncodeatom);
  cof_base = _pubthis->popf64(nnz);
}
// End mosek.fusion.WorkStack.pop_expr

// Begin mosek.fusion.WorkStack.move_expr
// Method mosek.fusion.WorkStack.move_expr @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:284:6-298:7
void mosek::fusion::WorkStack :: move_expr(monty::rc_ptr< ::mosek::fusion::WorkStack > _7344_to) { mosek::fusion::p_WorkStack::_get_impl(this)->move_expr(_7344_to); }
void mosek::fusion::p_WorkStack::move_expr(monty::rc_ptr< ::mosek::fusion::WorkStack > _7344_to)
{
  int32_t _7345_tmp_pi32 = pi32;
  int32_t _7346_tmp_pi64 = pi64;
  int32_t _7347_tmp_pf64 = pf64;
  _pubthis->pop_expr();
  int32_t _7348_ti32 = _7344_to->alloci32((_7345_tmp_pi32 - pi32));
  int32_t _7349_ti64 = _7344_to->alloci64((_7346_tmp_pi64 - pi64));
  int32_t _7350_tf64 = _7344_to->allocf64((_7347_tmp_pf64 - pf64));
  ::mosek::fusion::Utils::Tools::arraycopy(i32,pi32,mosek::fusion::p_WorkStack::_get_impl(_7344_to)->i32,_7348_ti32,(_7345_tmp_pi32 - pi32));
  ::mosek::fusion::Utils::Tools::arraycopy(i64,pi64,mosek::fusion::p_WorkStack::_get_impl(_7344_to)->i64,_7349_ti64,(_7346_tmp_pi64 - pi64));
  ::mosek::fusion::Utils::Tools::arraycopy(f64,pf64,mosek::fusion::p_WorkStack::_get_impl(_7344_to)->f64,_7350_tf64,(_7347_tmp_pf64 - pf64));
}
// End mosek.fusion.WorkStack.move_expr

// Begin mosek.fusion.WorkStack.peek_expr
// Method mosek.fusion.WorkStack.peek_expr @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:272:6-281:7
void mosek::fusion::WorkStack :: peek_expr() { mosek::fusion::p_WorkStack::_get_impl(this)->peek_expr(); }
void mosek::fusion::p_WorkStack::peek_expr()
{
  int32_t _7351_tmp_pi32 = pi32;
  int32_t _7352_tmp_pi64 = pi64;
  int32_t _7353_tmp_pf64 = pf64;
  _pubthis->pop_expr();
  pi32 = _7351_tmp_pi32;
  pi64 = _7352_tmp_pi64;
  pf64 = _7353_tmp_pf64;
}
// End mosek.fusion.WorkStack.peek_expr

// Begin mosek.fusion.WorkStack.ensure_sparsity
// Method mosek.fusion.WorkStack.ensure_sparsity @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:258:6-268:7
void mosek::fusion::WorkStack :: ensure_sparsity() { mosek::fusion::p_WorkStack::_get_impl(this)->ensure_sparsity(); }
void mosek::fusion::p_WorkStack::ensure_sparsity()
{
  int32_t _7354_nd = ((*i32)((pi32 - (int)1)));
  bool _7355_hassp = (((*i32)(((pi32 - _7354_nd) - (int)3))) != (int)0);
  int32_t _7356_nelem = ((*i32)(((pi32 - _7354_nd) - (int)1)));
  if ((!_7355_hassp))
  {
    {
      ((*i32)(((pi32 - _7354_nd) - (int)3))) = (int)1;
      int32_t _7357_sp = _pubthis->alloci64(_7356_nelem);
      int32_t _12637_ = (int)0;
      int32_t _12638_ = _7356_nelem;
      for (int32_t _7358_i = _12637_; _7358_i < _12638_; ++_7358_i)
      {
        {
          ((*i64)(_7357_sp)) = _7358_i;
        }
      }
    }
  }
  {}
}
// End mosek.fusion.WorkStack.ensure_sparsity

// Begin mosek.fusion.WorkStack.clear
// Method mosek.fusion.WorkStack.clear @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:210:6-61
void mosek::fusion::WorkStack :: clear() { mosek::fusion::p_WorkStack::_get_impl(this)->clear(); }
void mosek::fusion::p_WorkStack::clear()
{
  pi32 = (int)0;
  pi64 = (int)0;
  pf64 = (int)0;
}
// End mosek.fusion.WorkStack.clear

// Begin mosek.fusion.WorkStack.allocf64
// Method mosek.fusion.WorkStack.allocf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:201:6-207:7
int32_t mosek::fusion::WorkStack :: allocf64(int32_t _7359_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->allocf64(_7359_n); }
int32_t mosek::fusion::p_WorkStack::allocf64(int32_t _7359_n)
{
  _pubthis->ensuref64(_7359_n);
  int32_t _7360_r = pf64;
  int32_t _12639_ = pf64;
  int32_t _12640_ = safe_add( pf64,_7359_n );
  for (int32_t _7361_i = _12639_; _7361_i < _12640_; ++_7361_i)
  {
    {
      ((*f64)(_7361_i)) = (int)99997;
    }
  }
  pf64 += _7359_n;
  return _7360_r;
}
// End mosek.fusion.WorkStack.allocf64

// Begin mosek.fusion.WorkStack.alloci64
// Method mosek.fusion.WorkStack.alloci64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:191:6-197:7
int32_t mosek::fusion::WorkStack :: alloci64(int32_t _7362_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->alloci64(_7362_n); }
int32_t mosek::fusion::p_WorkStack::alloci64(int32_t _7362_n)
{
  _pubthis->ensurei64(_7362_n);
  int32_t _7363_r = pi64;
  int32_t _12641_ = pi64;
  int32_t _12642_ = safe_add( pi64,_7362_n );
  for (int32_t _7364_i = _12641_; _7364_i < _12642_; ++_7364_i)
  {
    {
      ((*i64)(_7364_i)) = (int)99998;
    }
  }
  pi64 += _7362_n;
  return _7363_r;
}
// End mosek.fusion.WorkStack.alloci64

// Begin mosek.fusion.WorkStack.alloci32
// Method mosek.fusion.WorkStack.alloci32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:177:6-187:7
int32_t mosek::fusion::WorkStack :: alloci32(int32_t _7365_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->alloci32(_7365_n); }
int32_t mosek::fusion::p_WorkStack::alloci32(int32_t _7365_n)
{
  if ((_7365_n > (int)0))
  {
    {
      _pubthis->ensurei32(_7365_n);
      int32_t _7366_r = pi32;
      int32_t _12643_ = pi32;
      int32_t _12644_ = safe_add( pi32,_7365_n );
      for (int32_t _7367_i = _12643_; _7367_i < _12644_; ++_7367_i)
      {
        {
          ((*i32)(_7367_i)) = (int)99999;
        }
      }
      pi32 += _7365_n;
      return _7366_r;
    }
  }
  else
  {
    {
      return (int)0;
    }
  }
}
// End mosek.fusion.WorkStack.alloci32

// Begin mosek.fusion.WorkStack.pushf64
// Method mosek.fusion.WorkStack.pushf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:168:6-172:7
void mosek::fusion::WorkStack :: pushf64(double _7368_v) { mosek::fusion::p_WorkStack::_get_impl(this)->pushf64(_7368_v); }
void mosek::fusion::p_WorkStack::pushf64(double _7368_v)
{
  _pubthis->ensuref64((int)1);
  ((*f64)(pf64)) = _7368_v;
  ++ pf64;
}
// End mosek.fusion.WorkStack.pushf64

// Begin mosek.fusion.WorkStack.pushi64
// Method mosek.fusion.WorkStack.pushi64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:160:6-164:7
void mosek::fusion::WorkStack :: pushi64(int64_t _7369_v) { mosek::fusion::p_WorkStack::_get_impl(this)->pushi64(_7369_v); }
void mosek::fusion::p_WorkStack::pushi64(int64_t _7369_v)
{
  _pubthis->ensurei64((int)1);
  ((*i64)(pi64)) = _7369_v;
  ++ pi64;
}
// End mosek.fusion.WorkStack.pushi64

// Begin mosek.fusion.WorkStack.pushi32
// Method mosek.fusion.WorkStack.pushi32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:152:6-156:7
void mosek::fusion::WorkStack :: pushi32(int32_t _7370_v) { mosek::fusion::p_WorkStack::_get_impl(this)->pushi32(_7370_v); }
void mosek::fusion::p_WorkStack::pushi32(int32_t _7370_v)
{
  _pubthis->ensurei32((int)1);
  ((*i32)(pi32)) = _7370_v;
  ++ pi32;
}
// End mosek.fusion.WorkStack.pushi32

// Begin mosek.fusion.WorkStack.ensuref64
// Method mosek.fusion.WorkStack.ensuref64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:141:6-147:7
void mosek::fusion::WorkStack :: ensuref64(int32_t _7371_n) { mosek::fusion::p_WorkStack::_get_impl(this)->ensuref64(_7371_n); }
void mosek::fusion::p_WorkStack::ensuref64(int32_t _7371_n)
{
  if ((safe_add( pf64,_7371_n ) > (int)((f64)->size(0))))
  {
    {
      int32_t _12645_;
      bool _12646_ = ((_7371_n < (int)((f64)->size(0))) && ((int)((f64)->size(0)) < (int)0x3FFFFFFF));
      if (_12646_)
      {
        _12645_ = safe_mul( (int)((f64)->size(0)),(int)2 );
      }
      else
      {
        _12645_ = safe_add( (int)((f64)->size(0)),_7371_n );
      }
      int32_t _7372_newsz = _12645_;
      std::shared_ptr< monty::ndarray< double,1 > > _7373_tmp = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7372_newsz)));
      _checked_ptr_1<double> _ptr__7373_tmp(_7373_tmp ? _7373_tmp->raw() : nullptr,_7373_tmp ? _7373_tmp->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(f64,(int)0,_7373_tmp,(int)0,pf64);
      f64 = _7373_tmp;
    }
  }
  {}
}
// End mosek.fusion.WorkStack.ensuref64

// Begin mosek.fusion.WorkStack.ensurei64
// Method mosek.fusion.WorkStack.ensurei64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:131:6-137:7
void mosek::fusion::WorkStack :: ensurei64(int32_t _7374_n) { mosek::fusion::p_WorkStack::_get_impl(this)->ensurei64(_7374_n); }
void mosek::fusion::p_WorkStack::ensurei64(int32_t _7374_n)
{
  if ((safe_add( pi64,_7374_n ) > (int)((i64)->size(0))))
  {
    {
      int32_t _12647_;
      bool _12648_ = ((_7374_n < (int)((i64)->size(0))) && ((int)((i64)->size(0)) < (int)0x3FFFFFFF));
      if (_12648_)
      {
        _12647_ = (int)((i64)->size(0));
      }
      else
      {
        _12647_ = _7374_n;
      }
      int32_t _7375_newsz = safe_add( (int)((i64)->size(0)),_12647_ );
      std::shared_ptr< monty::ndarray< int64_t,1 > > _7376_tmp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7375_newsz)));
      _checked_ptr_1<int64_t> _ptr__7376_tmp(_7376_tmp ? _7376_tmp->raw() : nullptr,_7376_tmp ? _7376_tmp->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(i64,(int)0,_7376_tmp,(int)0,pi64);
      i64 = _7376_tmp;
    }
  }
  {}
}
// End mosek.fusion.WorkStack.ensurei64

// Begin mosek.fusion.WorkStack.ensurei32
// Method mosek.fusion.WorkStack.ensurei32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:121:6-127:7
void mosek::fusion::WorkStack :: ensurei32(int32_t _7377_n) { mosek::fusion::p_WorkStack::_get_impl(this)->ensurei32(_7377_n); }
void mosek::fusion::p_WorkStack::ensurei32(int32_t _7377_n)
{
  if ((safe_add( pi32,_7377_n ) > (int)((i32)->size(0))))
  {
    {
      int32_t _12649_;
      bool _12650_ = ((_7377_n < (int)((i32)->size(0))) && ((int)((i32)->size(0)) < (int)0x3FFFFFFF));
      if (_12650_)
      {
        _12649_ = safe_mul( (int)((i32)->size(0)),(int)2 );
      }
      else
      {
        _12649_ = safe_add( (int)((i32)->size(0)),_7377_n );
      }
      int32_t _7378_newsz = _12649_;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7379_tmp = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7378_newsz)));
      _checked_ptr_1<int32_t> _ptr__7379_tmp(_7379_tmp ? _7379_tmp->raw() : nullptr,_7379_tmp ? _7379_tmp->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(i32,(int)0,_7379_tmp,(int)0,pi32);
      i32 = _7379_tmp;
    }
  }
  {}
}
// End mosek.fusion.WorkStack.ensurei32

// Begin mosek.fusion.WorkStack.popf64
// Method mosek.fusion.WorkStack.popf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:112:6-116:7
int32_t mosek::fusion::WorkStack :: popf64(int32_t _7380_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->popf64(_7380_n); }
int32_t mosek::fusion::p_WorkStack::popf64(int32_t _7380_n)
{
  pf64 -= _7380_n;
  if ((pf64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  return pf64;
}
// End mosek.fusion.WorkStack.popf64

// Begin mosek.fusion.WorkStack.popi64
// Method mosek.fusion.WorkStack.popi64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:107:6-111:7
int32_t mosek::fusion::WorkStack :: popi64(int32_t _7381_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->popi64(_7381_n); }
int32_t mosek::fusion::p_WorkStack::popi64(int32_t _7381_n)
{
  pi64 -= _7381_n;
  if ((pi64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  return pi64;
}
// End mosek.fusion.WorkStack.popi64

// Begin mosek.fusion.WorkStack.popi32
// Method mosek.fusion.WorkStack.popi32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:102:6-106:7
int32_t mosek::fusion::WorkStack :: popi32(int32_t _7382_n) { return mosek::fusion::p_WorkStack::_get_impl(this)->popi32(_7382_n); }
int32_t mosek::fusion::p_WorkStack::popi32(int32_t _7382_n)
{
  pi32 -= _7382_n;
  if ((pi32 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  return pi32;
}
// End mosek.fusion.WorkStack.popi32

// Begin mosek.fusion.WorkStack.popf64
// Method mosek.fusion.WorkStack.popf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:97:6-101:7
void mosek::fusion::WorkStack :: popf64(int32_t _7383_n,std::shared_ptr< monty::ndarray< double,1 > > _7384_r,int32_t _7385_ofs) { mosek::fusion::p_WorkStack::_get_impl(this)->popf64(_7383_n,_7384_r,_7385_ofs); }
void mosek::fusion::p_WorkStack::popf64(int32_t _7383_n,std::shared_ptr< monty::ndarray< double,1 > > _7384_r,int32_t _7385_ofs)
{
  _checked_ptr_1<double> _ptr__7384_r(_7384_r ? _7384_r->raw() : nullptr, _7384_r ? _7384_r->size(0) : 0);
  pf64 -= _7383_n;
  if ((pf64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  ::mosek::fusion::Utils::Tools::arraycopy(f64,pf64,_7384_r,_7385_ofs,_7383_n);
}
// End mosek.fusion.WorkStack.popf64

// Begin mosek.fusion.WorkStack.popi64
// Method mosek.fusion.WorkStack.popi64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:92:6-96:7
void mosek::fusion::WorkStack :: popi64(int32_t _7386_n,std::shared_ptr< monty::ndarray< int64_t,1 > > _7387_r,int32_t _7388_ofs) { mosek::fusion::p_WorkStack::_get_impl(this)->popi64(_7386_n,_7387_r,_7388_ofs); }
void mosek::fusion::p_WorkStack::popi64(int32_t _7386_n,std::shared_ptr< monty::ndarray< int64_t,1 > > _7387_r,int32_t _7388_ofs)
{
  _checked_ptr_1<int64_t> _ptr__7387_r(_7387_r ? _7387_r->raw() : nullptr, _7387_r ? _7387_r->size(0) : 0);
  pi64 -= _7386_n;
  if ((pi64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  ::mosek::fusion::Utils::Tools::arraycopy(i64,pi64,_7387_r,_7388_ofs,_7386_n);
}
// End mosek.fusion.WorkStack.popi64

// Begin mosek.fusion.WorkStack.popi32
// Method mosek.fusion.WorkStack.popi32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:87:6-91:7
void mosek::fusion::WorkStack :: popi32(int32_t _7389_n,std::shared_ptr< monty::ndarray< int32_t,1 > > _7390_r,int32_t _7391_ofs) { mosek::fusion::p_WorkStack::_get_impl(this)->popi32(_7389_n,_7390_r,_7391_ofs); }
void mosek::fusion::p_WorkStack::popi32(int32_t _7389_n,std::shared_ptr< monty::ndarray< int32_t,1 > > _7390_r,int32_t _7391_ofs)
{
  _checked_ptr_1<int32_t> _ptr__7390_r(_7390_r ? _7390_r->raw() : nullptr, _7390_r ? _7390_r->size(0) : 0);
  pi32 -= _7389_n;
  if ((pi32 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  ::mosek::fusion::Utils::Tools::arraycopy(i32,pi32,_7390_r,_7391_ofs,_7389_n);
}
// End mosek.fusion.WorkStack.popi32

// Begin mosek.fusion.WorkStack.popf64
// Method mosek.fusion.WorkStack.popf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:82:6-86:7
double mosek::fusion::WorkStack :: popf64() { return mosek::fusion::p_WorkStack::_get_impl(this)->popf64(); }
double mosek::fusion::p_WorkStack::popf64()
{
  -- pf64;
  if ((pf64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  return ((*f64)(pf64));
}
// End mosek.fusion.WorkStack.popf64

// Begin mosek.fusion.WorkStack.popi64
// Method mosek.fusion.WorkStack.popi64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:77:6-81:7
int64_t mosek::fusion::WorkStack :: popi64() { return mosek::fusion::p_WorkStack::_get_impl(this)->popi64(); }
int64_t mosek::fusion::p_WorkStack::popi64()
{
  if ((pi64 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  -- pi64;
  return ((*i64)(pi64));
}
// End mosek.fusion.WorkStack.popi64

// Begin mosek.fusion.WorkStack.popi32
// Method mosek.fusion.WorkStack.popi32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:72:6-76:7
int32_t mosek::fusion::WorkStack :: popi32() { return mosek::fusion::p_WorkStack::_get_impl(this)->popi32(); }
int32_t mosek::fusion::p_WorkStack::popi32()
{
  -- pi32;
  if ((pi32 < (int)0))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("Internal: stack underflow"));
    }
  }
  {}
  return ((*i32)(pi32));
}
// End mosek.fusion.WorkStack.popi32

// Begin mosek.fusion.WorkStack.peekf64
// Method mosek.fusion.WorkStack.peekf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:70:6-61
double mosek::fusion::WorkStack :: peekf64() { return mosek::fusion::p_WorkStack::_get_impl(this)->peekf64(); }
double mosek::fusion::p_WorkStack::peekf64()
{
  return ((*f64)((pf64 - (int)1)));
}
// End mosek.fusion.WorkStack.peekf64

// Begin mosek.fusion.WorkStack.peeki64
// Method mosek.fusion.WorkStack.peeki64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:69:6-61
int64_t mosek::fusion::WorkStack :: peeki64() { return mosek::fusion::p_WorkStack::_get_impl(this)->peeki64(); }
int64_t mosek::fusion::p_WorkStack::peeki64()
{
  return ((*i64)((pi64 - (int)1)));
}
// End mosek.fusion.WorkStack.peeki64

// Begin mosek.fusion.WorkStack.peeki32
// Method mosek.fusion.WorkStack.peeki32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:68:6-61
int32_t mosek::fusion::WorkStack :: peeki32() { return mosek::fusion::p_WorkStack::_get_impl(this)->peeki32(); }
int32_t mosek::fusion::p_WorkStack::peeki32()
{
  return ((*i32)((pi32 - (int)1)));
}
// End mosek.fusion.WorkStack.peeki32

// Begin mosek.fusion.WorkStack.peekf64
// Method mosek.fusion.WorkStack.peekf64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:66:6-70
double mosek::fusion::WorkStack :: peekf64(int32_t _7392_i) { return mosek::fusion::p_WorkStack::_get_impl(this)->peekf64(_7392_i); }
double mosek::fusion::p_WorkStack::peekf64(int32_t _7392_i)
{
  return ((*f64)(((pf64 - _7392_i) - (int)1)));
}
// End mosek.fusion.WorkStack.peekf64

// Begin mosek.fusion.WorkStack.peeki64
// Method mosek.fusion.WorkStack.peeki64 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:65:6-70
int64_t mosek::fusion::WorkStack :: peeki64(int32_t _7393_i) { return mosek::fusion::p_WorkStack::_get_impl(this)->peeki64(_7393_i); }
int64_t mosek::fusion::p_WorkStack::peeki64(int32_t _7393_i)
{
  return ((*i64)(((pi64 - _7393_i) - (int)1)));
}
// End mosek.fusion.WorkStack.peeki64

// Begin mosek.fusion.WorkStack.peeki32
// Method mosek.fusion.WorkStack.peeki32 @ bld/docker-win/final/default/src/fusion/BaseExpression.monty:64:6-70
int32_t mosek::fusion::WorkStack :: peeki32(int32_t _7394_i) { return mosek::fusion::p_WorkStack::_get_impl(this)->peeki32(_7394_i); }
int32_t mosek::fusion::p_WorkStack::peeki32(int32_t _7394_i)
{
  return ((*i32)(((pi32 - _7394_i) - (int)1)));
}
// End mosek.fusion.WorkStack.peeki32

void mosek::fusion::p_WorkStack::destroy()
{
  f64.reset();
  i64.reset();
  i32.reset();
}
void mosek::fusion::WorkStack::destroy() { mosek::fusion::p_WorkStack::_get_impl(this)->destroy(); }
// } class WorkStack
// class Expr { // @ bld/docker-win/final/default/src/fusion/Expr.mbi:350:4-1786:5
mosek::fusion::Expr::Expr(mosek::fusion::p_Expr *_impl) : mosek::fusion::BaseExpression(_impl) { /*std::cout << "Expr()" << this << std::endl; */ }
mosek::fusion::Expr::~Expr() {  /* std::cout << "~Expr()" << this << std::endl << std::flush; */ }
mosek::fusion::p_Expr::p_Expr
  (::mosek::fusion::Expr * _pubthis) :     mosek::fusion::p_BaseExpression(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.Expr.ctor @ bld/docker-win/final/default/src/fusion/Expr.mbi:576:6-617:7
mosek::fusion::Expr::t mosek::fusion::p_Expr::_new_Expr
  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7395_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7396_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7397_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7398_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7399_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7400_inst)
{ return new mosek::fusion::Expr(_7395_ptrb,_7396_subj,_7397_cof,_7398_bfix,_7399_shape,_7400_inst); }
mosek::fusion::Expr::Expr
  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7395_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7396_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7397_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7398_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7399_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7400_inst) : 
   Expr(new mosek::fusion::p_Expr(this))
{ mosek::fusion::p_Expr::_get_impl(this)->_initialize(_7395_ptrb,_7396_subj,_7397_cof,_7398_bfix,_7399_shape,_7400_inst); }
void mosek::fusion::p_Expr::_initialize  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7395_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7396_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7397_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7398_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7399_shape,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7400_inst)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int64_t> _ptr__7395_ptrb(_7395_ptrb ? _7395_ptrb->raw() : nullptr, _7395_ptrb ? _7395_ptrb->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__7396_subj(_7396_subj ? _7396_subj->raw() : nullptr, _7396_subj ? _7396_subj->size(0) : 0);
    _checked_ptr_1<double> _ptr__7397_cof(_7397_cof ? _7397_cof->raw() : nullptr, _7397_cof ? _7397_cof->size(0) : 0);
    _checked_ptr_1<double> _ptr__7398_bfix(_7398_bfix ? _7398_bfix->raw() : nullptr, _7398_bfix ? _7398_bfix->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__7399_shape(_7399_shape ? _7399_shape->raw() : nullptr, _7399_shape ? _7399_shape->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__7400_inst(_7400_inst ? _7400_inst->raw() : nullptr, _7400_inst ? _7400_inst->size(0) : 0);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _12651_;
    bool _12652_ = (NULL != _7399_shape.get());
    if (_12652_)
    {
      _12651_ = ::mosek::fusion::Utils::Tools::arraycopy(_7399_shape);
    }
    else
    {
      _12651_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(((int)((_7395_ptrb)->size(0)) - (int)1))});
    }
    std::shared_ptr< monty::ndarray< int64_t,1 > > _12653_;
    bool _12654_ = (NULL != _7400_inst.get());
    if (_12654_)
    {
      _12653_ = ::mosek::fusion::Utils::Tools::arraycopy(_7400_inst);
    }
    else
    {
      _12653_ = nullptr;
    }
    mosek::fusion::p_Expr::_initialize(::mosek::fusion::Utils::Tools::arraycopy(_7395_ptrb),::mosek::fusion::Utils::Tools::arraycopy(_7396_subj),::mosek::fusion::Utils::Tools::arraycopy(_7397_cof),::mosek::fusion::Utils::Tools::arraycopy(_7398_bfix),_12651_,_12653_,(int)1);
    int32_t _7401_nelem = ((int)((_7395_ptrb)->size(0)) - (int)1);
    if ((_7401_nelem < (int)0))
    {
      {
        throw ::mosek::fusion::ExpressionError(std::string ("Invalid ptrb"));
      }
    }
    {}
    int64_t _7402_nnz = _ptr__7395_ptrb[_7401_nelem];
    if (((_7402_nnz < (int)0) || ((_7402_nnz != (int)((_7397_cof)->size(0))) || (_7402_nnz != (int)((_7396_subj)->size(0))))))
    {
      {
        throw ::mosek::fusion::ExpressionError(std::string ("Invalid ptrb construction"));
      }
    }
    {}
    bool _7403_ptrb_ok = true;
    bool _7404_shape_ok = true;
    bool _7405_inst_ok = true;
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7406_thisshape = mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->shape;
    _checked_ptr_1<int32_t> _ptr__7406_thisshape(_7406_thisshape ? _7406_thisshape->raw() : nullptr,_7406_thisshape ? _7406_thisshape->size(0) : 0);
    int64_t _7407_sz = ::mosek::fusion::p_Set::size(_7406_thisshape);
    {
      int32_t _12655_ = (int)0;
      int32_t _12656_ = (int)((_7406_thisshape)->size(0));
      for (int32_t _7408_i = _12655_; _7408_i < _12656_; ++_7408_i)
      {
        {
          _7404_shape_ok = (_7404_shape_ok && (_ptr__7406_thisshape[_7408_i] >= (int)0));
        }
      }
      int32_t _12657_ = (int)0;
      int32_t _12658_ = _7401_nelem;
      for (int32_t _7409_i = _12657_; _7409_i < _12658_; ++_7409_i)
      {
        {
          _7403_ptrb_ok = (_7403_ptrb_ok && (_ptr__7395_ptrb[_7409_i] <= _ptr__7395_ptrb[safe_add( _7409_i,(int)1 )]));
        }
      }
      if (((NULL != _7400_inst.get()) && ((int)((_7400_inst)->size(0)) > (int)0)))
      {
        {
          _7405_inst_ok = ((_ptr__7400_inst[(int)0] >= (int)0) && (_ptr__7400_inst[(_7401_nelem - (int)1)] < _7407_sz));
          int32_t _12659_ = (int)0;
          int32_t _12660_ = (_7401_nelem - (int)1);
          for (int32_t _7410_i = _12659_; _7410_i < _12660_; ++_7410_i)
          {
            {
              _7405_inst_ok = (_7405_inst_ok && (_ptr__7400_inst[_7410_i] < _ptr__7400_inst[safe_add( _7410_i,(int)1 )]));
            }
          }
        }
      }
      {}
    }
    if ((!_7404_shape_ok))
    {
      {
        throw ::mosek::fusion::ExpressionError(std::string ("Invalid shape"));
      }
    }
    {}
    if ((!_7403_ptrb_ok))
    {
      {
        throw ::mosek::fusion::ExpressionError(std::string ("Invalid ptrb"));
      }
    }
    {}
    if ((!_7405_inst_ok))
    {
      {
        throw ::mosek::fusion::ExpressionError(std::string ("Invalid sparsity pattern"));
      }
    }
    {}
  }
}
// mosek.fusion.Expr.ctor

// mosek.fusion.Expr.ctor @ bld/docker-win/final/default/src/fusion/Expr.mbi:512:6-532:7
mosek::fusion::Expr::t mosek::fusion::p_Expr::_new_Expr
  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7411_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7412_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7413_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7414_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7415_shp,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7416_inst,
    int32_t _7417_unchecked_)
{ return new mosek::fusion::Expr(_7411_ptrb,_7412_subj,_7413_cof,_7414_bfix,_7415_shp,_7416_inst,_7417_unchecked_); }
mosek::fusion::Expr::Expr
  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7411_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7412_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7413_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7414_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7415_shp,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7416_inst,
    int32_t _7417_unchecked_) : 
   Expr(new mosek::fusion::p_Expr(this))
{ mosek::fusion::p_Expr::_get_impl(this)->_initialize(_7411_ptrb,_7412_subj,_7413_cof,_7414_bfix,_7415_shp,_7416_inst,_7417_unchecked_); }
void mosek::fusion::p_Expr::_initialize  (std::shared_ptr< monty::ndarray< int64_t,1 > > _7411_ptrb,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7412_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _7413_cof,
    std::shared_ptr< monty::ndarray< double,1 > > _7414_bfix,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7415_shp,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7416_inst,
    int32_t _7417_unchecked_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int64_t> _ptr__7411_ptrb(_7411_ptrb ? _7411_ptrb->raw() : nullptr, _7411_ptrb ? _7411_ptrb->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__7412_subj(_7412_subj ? _7412_subj->raw() : nullptr, _7412_subj ? _7412_subj->size(0) : 0);
    _checked_ptr_1<double> _ptr__7413_cof(_7413_cof ? _7413_cof->raw() : nullptr, _7413_cof ? _7413_cof->size(0) : 0);
    _checked_ptr_1<double> _ptr__7414_bfix(_7414_bfix ? _7414_bfix->raw() : nullptr, _7414_bfix ? _7414_bfix->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__7415_shp(_7415_shp ? _7415_shp->raw() : nullptr, _7415_shp ? _7415_shp->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__7416_inst(_7416_inst ? _7416_inst->raw() : nullptr, _7416_inst ? _7416_inst->size(0) : 0);
    mosek::fusion::p_BaseExpression::_initialize(_7415_shp);
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->shape = _7415_shp;
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->ptrb = _7411_ptrb;
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->subj = _7412_subj;
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->cof_v = _7413_cof;
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->bfix = _7414_bfix;
    mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->inst = _7416_inst;
    if ((NULL == mosek::fusion::p_Expr::_get_impl(::mosek::fusion::Expr::t(_pubthis))->shape.get()))
    {
      {
        throw ::mosek::fusion::UnexpectedError(std::string ("Internal: NULL shape"));
      }
    }
    {}
  }
}
// mosek.fusion.Expr.ctor

// mosek.fusion.Expr.ctor @ bld/docker-win/final/default/src/fusion/Expr.mbi:388:6-434:7
mosek::fusion::Expr::t mosek::fusion::p_Expr::_new_Expr
  (monty::rc_ptr< ::mosek::fusion::Expression > _7418_e)
{ return new mosek::fusion::Expr(_7418_e); }
mosek::fusion::Expr::Expr
  (monty::rc_ptr< ::mosek::fusion::Expression > _7418_e) : 
   Expr(new mosek::fusion::p_Expr(this))
{ mosek::fusion::p_Expr::_get_impl(this)->_initialize(_7418_e); }
void mosek::fusion::p_Expr::_initialize  (monty::rc_ptr< ::mosek::fusion::Expression > _7418_e)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_BaseExpression::_initialize(_7418_e->getShape());
    monty::rc_ptr< ::mosek::fusion::Expression > _12661_ = _7418_e;
    if (false) {}
    else if (nullptr != dynamic_cast<::mosek::fusion::Expr*>(_12661_.get()))
    {
      ::mosek::fusion::Expr::t _7419_ee (dynamic_cast<::mosek::fusion::Expr*>(_12661_.get()));
      {
        shape = mosek::fusion::p_Expr::_get_impl(_7419_ee)->shape;
        ptrb = mosek::fusion::p_Expr::_get_impl(_7419_ee)->ptrb;
        subj = mosek::fusion::p_Expr::_get_impl(_7419_ee)->subj;
        cof_v = mosek::fusion::p_Expr::_get_impl(_7419_ee)->cof_v;
        bfix = mosek::fusion::p_Expr::_get_impl(_7419_ee)->bfix;
        inst = mosek::fusion::p_Expr::_get_impl(_7419_ee)->inst;
      }
    }
    else
    {
      mosek::fusion::Expression::t _7420_ee = _12661_;
      {
        monty::rc_ptr< ::mosek::fusion::WorkStack > _7421_xs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
        monty::rc_ptr< ::mosek::fusion::WorkStack > _7422_ws = ::mosek::fusion::p_WorkStack::_new_WorkStack();
        monty::rc_ptr< ::mosek::fusion::WorkStack > _7423_rs = ::mosek::fusion::p_WorkStack::_new_WorkStack();
        _7420_ee->eval(_7423_rs,_7422_ws,_7421_xs);
        int32_t _7424_nd = _7423_rs->popi32();
        int32_t _7425_shape_base = _7423_rs->popi32(_7424_nd);
        int32_t _7426_nelem = _7423_rs->popi32();
        int32_t _7427_nnz = _7423_rs->popi32();
        bool _7428_hassp = (_7423_rs->popi32() != (int)0);
        int32_t _7429_ptr_base = _7423_rs->popi32(safe_add( _7426_nelem,(int)1 ));
        int32_t _12662_;
        bool _12663_ = _7428_hassp;
        if (_12663_)
        {
          _12662_ = _7423_rs->popi64(_7426_nelem);
        }
        else
        {
          _12662_ = (int)0;
        }
        int32_t _7430_sp_base = _12662_;
        int32_t _7431_nidxs_base = _7423_rs->popi64(_7427_nnz);
        int32_t _7432_bfix_base = _7423_rs->popf64(_7426_nelem);
        int32_t _7433_cof_base = _7423_rs->popf64(_7427_nnz);
        std::shared_ptr< monty::ndarray< int32_t,1 > > _7434_ri32 = mosek::fusion::p_WorkStack::_get_impl(_7423_rs)->i32;
        _checked_ptr_1<int32_t> _ptr__7434_ri32(_7434_ri32 ? _7434_ri32->raw() : nullptr,_7434_ri32 ? _7434_ri32->size(0) : 0);
        std::shared_ptr< monty::ndarray< int64_t,1 > > _7435_ri64 = mosek::fusion::p_WorkStack::_get_impl(_7423_rs)->i64;
        _checked_ptr_1<int64_t> _ptr__7435_ri64(_7435_ri64 ? _7435_ri64->raw() : nullptr,_7435_ri64 ? _7435_ri64->size(0) : 0);
        std::shared_ptr< monty::ndarray< double,1 > > _7436_rf64 = mosek::fusion::p_WorkStack::_get_impl(_7423_rs)->f64;
        _checked_ptr_1<double> _ptr__7436_rf64(_7436_rf64 ? _7436_rf64->raw() : nullptr,_7436_rf64 ? _7436_rf64->size(0) : 0);
        std::vector<int32_t> _12664_;
        for (int32_t _7437_i = (int)0, _12665_ = _7424_nd; _7437_i < _12665_ ; ++_7437_i)
        {
          _12664_.push_back(_ptr__7434_ri32[safe_add( _7425_shape_base,_7437_i )]);
        }
        auto _12666_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12664_.size()),_12664_.begin(),_12664_.end()));
        shape = _12666_;
        std::vector<int64_t> _12667_;
        for (int32_t _7438_i = (int)0, _12668_ = safe_add( _7426_nelem,(int)1 ); _7438_i < _12668_ ; ++_7438_i)
        {
          _12667_.push_back(_ptr__7434_ri32[safe_add( _7429_ptr_base,_7438_i )]);
        }
        auto _12669_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12667_.size()),_12667_.begin(),_12667_.end()));
        ptrb = _12669_;
        std::vector<int64_t> _12670_;
        for (int32_t _7439_i = (int)0, _12671_ = _7427_nnz; _7439_i < _12671_ ; ++_7439_i)
        {
          _12670_.push_back(_ptr__7435_ri64[safe_add( _7431_nidxs_base,_7439_i )]);
        }
        auto _12672_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12670_.size()),_12670_.begin(),_12670_.end()));
        subj = _12672_;
        std::vector<double> _12673_;
        for (int32_t _7440_i = (int)0, _12674_ = _7427_nnz; _7440_i < _12674_ ; ++_7440_i)
        {
          _12673_.push_back(_ptr__7436_rf64[safe_add( _7433_cof_base,_7440_i )]);
        }
        auto _12675_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12673_.size()),_12673_.begin(),_12673_.end()));
        cof_v = _12675_;
        std::vector<double> _12676_;
        for (int32_t _7441_i = (int)0, _12677_ = _7427_nnz; _7441_i < _12677_ ; ++_7441_i)
        {
          _12676_.push_back(_ptr__7436_rf64[safe_add( _7432_bfix_base,_7441_i )]);
        }
        auto _12678_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12676_.size()),_12676_.begin(),_12676_.end()));
        bfix = _12678_;
        std::shared_ptr< monty::ndarray< int64_t,1 > > _12679_;
        bool _12680_ = _7428_hassp;
        if (_12680_)
        {
          std::vector<int64_t> _12681_;
          for (int32_t _7442_i = (int)0, _12682_ = _7427_nnz; _7442_i < _12682_ ; ++_7442_i)
          {
            _12681_.push_back(_ptr__7435_ri64[safe_add( _7430_sp_base,_7442_i )]);
          }
          auto _12683_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12681_.size()),_12681_.begin(),_12681_.end()));
          _12679_ = _12683_;
        }
        else
        {
          _12679_ = nullptr;
        }
        inst = _12679_;
      }
    }
    if ((NULL == shape.get()))
    {
      {
        throw ::mosek::fusion::UnexpectedError(std::string ("Internal: NULL shape"));
      }
    }
    {}
  }
}
// mosek.fusion.Expr.ctor

// Begin mosek.fusion.Expr.prod
// Method mosek.fusion.Expr.prod @ bld/docker-win/final/default/src/fusion/Expr.mbi:1785:6-110
int64_t mosek::fusion::p_Expr::prod(std::shared_ptr< monty::ndarray< int32_t,1 > > _7443_vals)
{
  _checked_ptr_1<int32_t> _ptr__7443_vals(_7443_vals ? _7443_vals->raw() : nullptr, _7443_vals ? _7443_vals->size(0) : 0);
  int32_t _7444_r = (int)1;
  int32_t _12684_ = (int)0;
  int32_t _12685_ = (int)((_7443_vals)->size(0));
  for (int32_t _7445_i = _12684_; _7445_i < _12685_; ++_7445_i)
  {
    {
      _7444_r *= _ptr__7443_vals[_7445_i];
    }
  }
  return _7444_r;
}
// End mosek.fusion.Expr.prod

// Begin mosek.fusion.Expr.varstack
// Method mosek.fusion.Expr.varstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:1780:6-1783:7
std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > mosek::fusion::p_Expr::varstack(std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >,1 > > _7446_vs)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Variable >> _12686_;
  for (int32_t _7447_i = (int)0, _12687_ = (int)((_7446_vs)->size(0)); _7447_i < _12687_ ; ++_7447_i)
  {
    for (int32_t _7448_j = (int)0, _12688_ = (int)((((*_7446_vs)(_7447_i)))->size(0)); _7448_j < _12688_ ; ++_7448_j)
    {
      _12686_.push_back(((*((*_7446_vs)(_7447_i)))(_7448_j)));
    }
  }
  auto _12689_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >(monty::shape(_12686_.size()),_12686_.begin(),_12686_.end()));
  return _12689_;
}
// End mosek.fusion.Expr.varstack

// Begin mosek.fusion.Expr.varstack
// Method mosek.fusion.Expr.varstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:1767:6-1778:7
std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > mosek::fusion::p_Expr::varstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _7449_v1,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _7450_v2)
{
  if ((NULL == _7449_v1.get()))
  {
    {
      return _7450_v2;
    }
  }
  else if((NULL == _7450_v2.get()))
  {
    {
      return _7449_v1;
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _7451_r = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 >(monty::shape(safe_add( (int)((_7449_v1)->size(0)),(int)((_7450_v2)->size(0)) ))));
      int32_t _12690_ = (int)0;
      int32_t _12691_ = (int)((_7449_v1)->size(0));
      for (int32_t _7452_i = _12690_; _7452_i < _12691_; ++_7452_i)
      {
        {
          ((*_7451_r)(_7452_i)) = ((*_7449_v1)(_7452_i));
        }
      }
      int32_t _12692_ = (int)0;
      int32_t _12693_ = (int)((_7450_v2)->size(0));
      for (int32_t _7453_i = _12692_; _7453_i < _12693_; ++_7453_i)
      {
        {
          ((*_7451_r)(safe_add( _7453_i,(int)((_7449_v1)->size(0)) ))) = ((*_7450_v2)(_7453_i));
        }
      }
      return _7451_r;
    }
  }
}
// End mosek.fusion.Expr.varstack

// Begin mosek.fusion.Expr.condense
// Method mosek.fusion.Expr.condense @ bld/docker-win/final/default/src/fusion/Expr.mbi:1764:6-93
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::condense
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7454_e) { return mosek::fusion::p_Expr::condense(_7454_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::condense(monty::rc_ptr< ::mosek::fusion::Expression > _7454_e)
{
  return (::mosek::fusion::p_ExprCondense::_new_ExprCondense(_7454_e)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.condense

// Begin mosek.fusion.Expr.flatten
// Method mosek.fusion.Expr.flatten @ bld/docker-win/final/default/src/fusion/Expr.mbi:1751:6-1759:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::flatten
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7455_e) { return mosek::fusion::p_Expr::flatten(_7455_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::flatten(monty::rc_ptr< ::mosek::fusion::Expression > _7455_e)
{
  if ((NULL == _7455_e.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments for flatten may not be null"));
    }
  }
  {}
  int64_t _7456_sz = _7455_e->getSize();
  if ((!(_7456_sz <= (int)0x7fffffff)))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Maximum dimension size exceeded"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::reshape(_7455_e,(int32_t)_7456_sz);
}
// End mosek.fusion.Expr.flatten

// Begin mosek.fusion.Expr.reshape
// Method mosek.fusion.Expr.reshape @ bld/docker-win/final/default/src/fusion/Expr.mbi:1742:6-1746:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::reshape
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7457_e,
    int32_t _7458_dimi,
    int32_t _7459_dimj) { return mosek::fusion::p_Expr::reshape(_7457_e,_7458_dimi,_7459_dimj); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::reshape(monty::rc_ptr< ::mosek::fusion::Expression > _7457_e,int32_t _7458_dimi,int32_t _7459_dimj)
{
  if ((NULL == _7457_e.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments for reshape may not be null"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::reshape(_7457_e,::mosek::fusion::p_Set::make(_7458_dimi,_7459_dimj));
}
// End mosek.fusion.Expr.reshape

// Begin mosek.fusion.Expr.reshape
// Method mosek.fusion.Expr.reshape @ bld/docker-win/final/default/src/fusion/Expr.mbi:1732:6-1736:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::reshape
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7460_e,
    int32_t _7461_size) { return mosek::fusion::p_Expr::reshape(_7460_e,_7461_size); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::reshape(monty::rc_ptr< ::mosek::fusion::Expression > _7460_e,int32_t _7461_size)
{
  if ((NULL == _7460_e.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments for reshape may not be null"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::reshape(_7460_e,::mosek::fusion::p_Set::make(_7461_size));
}
// End mosek.fusion.Expr.reshape

// Begin mosek.fusion.Expr.reshape
// Method mosek.fusion.Expr.reshape @ bld/docker-win/final/default/src/fusion/Expr.mbi:1731:6-118
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::reshape
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7462_e,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _7463_newshape) { return mosek::fusion::p_Expr::reshape(_7462_e,_7463_newshape); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::reshape(monty::rc_ptr< ::mosek::fusion::Expression > _7462_e,std::shared_ptr< monty::ndarray< int32_t,1 > > _7463_newshape)
{
  _checked_ptr_1<int32_t> _ptr__7463_newshape(_7463_newshape ? _7463_newshape->raw() : nullptr, _7463_newshape ? _7463_newshape->size(0) : 0);
  return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7463_newshape,_7462_e)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.reshape

// Begin mosek.fusion.Expr.zeros
// Method mosek.fusion.Expr.zeros @ bld/docker-win/final/default/src/fusion/Expr.mbi:1717:6-87
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::zeros
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7464_shp) { return mosek::fusion::p_Expr::zeros(_7464_shp); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::zeros(std::shared_ptr< monty::ndarray< int32_t,1 > > _7464_shp)
{
  _checked_ptr_1<int32_t> _ptr__7464_shp(_7464_shp ? _7464_shp->raw() : nullptr, _7464_shp ? _7464_shp->size(0) : 0);
  return ::mosek::fusion::p_Expr::constTerm(_7464_shp,(double)((int)0));
}
// End mosek.fusion.Expr.zeros

// Begin mosek.fusion.Expr.zeros
// Method mosek.fusion.Expr.zeros @ bld/docker-win/final/default/src/fusion/Expr.mbi:1716:6-87
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::zeros
  ( int32_t _7465_size) { return mosek::fusion::p_Expr::zeros(_7465_size); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::zeros(int32_t _7465_size)
{
  return ::mosek::fusion::p_Expr::constTerm(_7465_size,(double)((int)0));
}
// End mosek.fusion.Expr.zeros

// Begin mosek.fusion.Expr.ones
// Method mosek.fusion.Expr.ones @ bld/docker-win/final/default/src/fusion/Expr.mbi:1714:6-70
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::ones
  ( ) { return mosek::fusion::p_Expr::ones(); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::ones()
{
  return ::mosek::fusion::p_Expr::constTerm((double)((int)1));
}
// End mosek.fusion.Expr.ones

// Begin mosek.fusion.Expr.ones
// Method mosek.fusion.Expr.ones @ bld/docker-win/final/default/src/fusion/Expr.mbi:1713:6-113
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::ones
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7466_shp,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _7467_sparsity) { return mosek::fusion::p_Expr::ones(_7466_shp,_7467_sparsity); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::ones(std::shared_ptr< monty::ndarray< int32_t,1 > > _7466_shp,std::shared_ptr< monty::ndarray< int32_t,2 > > _7467_sparsity)
{
  _checked_ptr_1<int32_t> _ptr__7466_shp(_7466_shp ? _7466_shp->raw() : nullptr, _7466_shp ? _7466_shp->size(0) : 0);
  return ::mosek::fusion::p_Expr::constTerm(_7466_shp,_7467_sparsity,(double)((int)1));
}
// End mosek.fusion.Expr.ones

// Begin mosek.fusion.Expr.ones
// Method mosek.fusion.Expr.ones @ bld/docker-win/final/default/src/fusion/Expr.mbi:1712:6-87
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::ones
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7468_shp) { return mosek::fusion::p_Expr::ones(_7468_shp); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::ones(std::shared_ptr< monty::ndarray< int32_t,1 > > _7468_shp)
{
  _checked_ptr_1<int32_t> _ptr__7468_shp(_7468_shp ? _7468_shp->raw() : nullptr, _7468_shp ? _7468_shp->size(0) : 0);
  return ::mosek::fusion::p_Expr::constTerm(_7468_shp,(double)((int)1));
}
// End mosek.fusion.Expr.ones

// Begin mosek.fusion.Expr.ones
// Method mosek.fusion.Expr.ones @ bld/docker-win/final/default/src/fusion/Expr.mbi:1711:6-87
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::ones
  ( int32_t _7469_size) { return mosek::fusion::p_Expr::ones(_7469_size); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::ones(int32_t _7469_size)
{
  return ::mosek::fusion::p_Expr::constTerm(_7469_size,(double)((int)1));
}
// End mosek.fusion.Expr.ones

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1705:6-1708:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7470_nda) { return mosek::fusion::p_Expr::constTerm(_7470_nda); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7470_nda)
{
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(mosek::fusion::p_NDSparseArray::_get_impl(_7470_nda)->dims,mosek::fusion::p_NDSparseArray::_get_impl(_7470_nda)->inst,mosek::fusion::p_NDSparseArray::_get_impl(_7470_nda)->cof)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1684:6-1703:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7471_m) { return mosek::fusion::p_Expr::constTerm(_7471_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(monty::rc_ptr< ::mosek::fusion::Matrix > _7471_m)
{
  int32_t _7472_dim0 = _7471_m->numRows();
  int32_t _7473_dim1 = _7471_m->numColumns();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7474_shape = ::mosek::fusion::p_Set::make(_7472_dim0,_7473_dim1);
  _checked_ptr_1<int32_t> _ptr__7474_shape(_7474_shape ? _7474_shape->raw() : nullptr,_7474_shape ? _7474_shape->size(0) : 0);
  if (_7471_m->isSparse())
  {
    {
      std::shared_ptr< monty::ndarray< double,1 > > _7475_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7471_m->numNonzeros())));
      _checked_ptr_1<double> _ptr__7475_mval(_7475_mval ? _7475_mval->raw() : nullptr,_7475_mval ? _7475_mval->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7476_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7471_m->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__7476_msubj(_7476_msubj ? _7476_msubj->raw() : nullptr,_7476_msubj ? _7476_msubj->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7477_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7471_m->numNonzeros())));
      _checked_ptr_1<int32_t> _ptr__7477_msubi(_7477_msubi ? _7477_msubi->raw() : nullptr,_7477_msubi ? _7477_msubi->size(0) : 0);
      _7471_m->getDataAsTriplets(_7477_msubi,_7476_msubj,_7475_mval);
      std::vector<int64_t> _12694_;
      for (int32_t _7479_i = (int)0, _12695_ = (int)((_7476_msubj)->size(0)); _7479_i < _12695_ ; ++_7479_i)
      {
        _12694_.push_back(safe_add( safe_mul( _ptr__7477_msubi[_7479_i],_7473_dim1 ),_ptr__7476_msubj[_7479_i] ));
      }
      auto _12696_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12694_.size()),_12694_.begin(),_12694_.end()));
      std::shared_ptr< monty::ndarray< int64_t,1 > > _7478_sp = _12696_;
      _checked_ptr_1<int64_t> _ptr__7478_sp(_7478_sp ? _7478_sp->raw() : nullptr,_7478_sp ? _7478_sp->size(0) : 0);
      return (::mosek::fusion::p_ExprConst::_new_ExprConst(_7474_shape,_7478_sp,_7475_mval)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_ExprConst::_new_ExprConst(_7474_shape,nullptr,_7471_m->getDataAsArray())).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1679:6-1682:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( double _7480_val) { return mosek::fusion::p_Expr::constTerm(_7480_val); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(double _7480_val)
{
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),nullptr,_7480_val)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1668:6-1677:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7481_shp,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _7482_sparsity,
    double _7483_val) { return mosek::fusion::p_Expr::constTerm(_7481_shp,_7482_sparsity,_7483_val); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(std::shared_ptr< monty::ndarray< int32_t,1 > > _7481_shp,std::shared_ptr< monty::ndarray< int32_t,2 > > _7482_sparsity,double _7483_val)
{
  _checked_ptr_1<int32_t> _ptr__7481_shp(_7481_shp ? _7481_shp->raw() : nullptr, _7481_shp ? _7481_shp->size(0) : 0);
  int32_t _7484_n = (int)((_7482_sparsity)->size(0));
  int32_t _7485_nd = (int)((_7481_shp)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7486_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7484_n)));
  _checked_ptr_1<int64_t> _ptr__7486_sp(_7486_sp ? _7486_sp->raw() : nullptr,_7486_sp ? _7486_sp->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7487_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7485_nd)));
  _checked_ptr_1<int64_t> _ptr__7487_s(_7487_s ? _7487_s->raw() : nullptr,_7487_s ? _7487_s->size(0) : 0);
  _ptr__7487_s[(_7485_nd - (int)1)] = (int)1;
  int32_t _12697_ = (int)1;
  int32_t _12698_ = _7485_nd;
  for (int32_t _7488_i = _12697_; _7488_i < _12698_; ++_7488_i)
  {
    {
      _ptr__7487_s[((_7485_nd - _7488_i) - (int)1)] = safe_mul( _ptr__7487_s[(_7485_nd - _7488_i)],_ptr__7481_shp[(_7485_nd - _7488_i)] );
    }
  }
  int32_t _12699_ = (int)0;
  int32_t _12700_ = _7484_n;
  for (int32_t _7489_i = _12699_; _7489_i < _12700_; ++_7489_i)
  {
    {
      int32_t _12701_ = (int)0;
      int32_t _12702_ = _7485_nd;
      for (int32_t _7490_j = _12701_; _7490_j < _12702_; ++_7490_j)
      {
        {
          _ptr__7486_sp[_7489_i] += safe_mul( _ptr__7487_s[_7490_j],((*_7482_sparsity)(_7489_i,_7490_j)) );
        }
      }
    }
  }
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(_7481_shp,_7486_sp,_7483_val)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1657:6-1667:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7491_shp,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _7492_sparsity,
    std::shared_ptr< monty::ndarray< double,1 > > _7493_vals1) { return mosek::fusion::p_Expr::constTerm(_7491_shp,_7492_sparsity,_7493_vals1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(std::shared_ptr< monty::ndarray< int32_t,1 > > _7491_shp,std::shared_ptr< monty::ndarray< int32_t,2 > > _7492_sparsity,std::shared_ptr< monty::ndarray< double,1 > > _7493_vals1)
{
  _checked_ptr_1<int32_t> _ptr__7491_shp(_7491_shp ? _7491_shp->raw() : nullptr, _7491_shp ? _7491_shp->size(0) : 0);
  _checked_ptr_1<double> _ptr__7493_vals1(_7493_vals1 ? _7493_vals1->raw() : nullptr, _7493_vals1 ? _7493_vals1->size(0) : 0);
  int32_t _7494_n = (int)((_7492_sparsity)->size(0));
  int32_t _7495_nd = (int)((_7491_shp)->size(0));
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7496_sp = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7494_n)));
  _checked_ptr_1<int64_t> _ptr__7496_sp(_7496_sp ? _7496_sp->raw() : nullptr,_7496_sp ? _7496_sp->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7497_s = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7495_nd)));
  _checked_ptr_1<int64_t> _ptr__7497_s(_7497_s ? _7497_s->raw() : nullptr,_7497_s ? _7497_s->size(0) : 0);
  _ptr__7497_s[(_7495_nd - (int)1)] = (int)1;
  int32_t _12703_ = (int)1;
  int32_t _12704_ = _7495_nd;
  for (int32_t _7498_i = _12703_; _7498_i < _12704_; ++_7498_i)
  {
    {
      _ptr__7497_s[((_7495_nd - _7498_i) - (int)1)] = safe_mul( _ptr__7497_s[(_7495_nd - _7498_i)],_ptr__7491_shp[(_7495_nd - _7498_i)] );
    }
  }
  int32_t _12705_ = (int)0;
  int32_t _12706_ = _7494_n;
  for (int32_t _7499_i = _12705_; _7499_i < _12706_; ++_7499_i)
  {
    {
      int32_t _12707_ = (int)0;
      int32_t _12708_ = _7495_nd;
      for (int32_t _7500_j = _12707_; _7500_j < _12708_; ++_7500_j)
      {
        {
          _ptr__7496_sp[_7499_i] += safe_mul( _ptr__7497_s[_7500_j],((*_7492_sparsity)(_7499_i,_7500_j)) );
        }
      }
    }
  }
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(_7491_shp,_7496_sp,_7493_vals1)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1652:6-1655:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _7501_shp,
    double _7502_val) { return mosek::fusion::p_Expr::constTerm(_7501_shp,_7502_val); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(std::shared_ptr< monty::ndarray< int32_t,1 > > _7501_shp,double _7502_val)
{
  _checked_ptr_1<int32_t> _ptr__7501_shp(_7501_shp ? _7501_shp->raw() : nullptr, _7501_shp ? _7501_shp->size(0) : 0);
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(_7501_shp,nullptr,_7502_val)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1648:6-1650:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( int32_t _7503_size,
    double _7504_val) { return mosek::fusion::p_Expr::constTerm(_7503_size,_7504_val); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(int32_t _7503_size,double _7504_val)
{
  std::vector<double> _12709_;
  for (int32_t _7505_i = (int)0, _12710_ = _7503_size; _7505_i < _12710_ ; ++_7505_i)
  {
    _12709_.push_back(_7504_val);
  }
  auto _12711_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12709_.size()),_12709_.begin(),_12709_.end()));
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7503_size)}),nullptr,_12711_)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1641:6-1643:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( std::shared_ptr< monty::ndarray< double,2 > > _7506_vals2) { return mosek::fusion::p_Expr::constTerm(_7506_vals2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(std::shared_ptr< monty::ndarray< double,2 > > _7506_vals2)
{
  std::vector<double> _12712_;
  for (int32_t _7507_i = (int)0, _12713_ = (int)((_7506_vals2)->size(0)); _7507_i < _12713_ ; ++_7507_i)
  {
    for (int32_t _7508_j = (int)0, _12714_ = (int)((_7506_vals2)->size(1)); _7508_j < _12714_ ; ++_7508_j)
    {
      _12712_.push_back(((*_7506_vals2)(_7507_i,_7508_j)));
    }
  }
  auto _12715_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12712_.size()),_12712_.begin(),_12712_.end()));
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_7506_vals2)->size(0))),(int32_t)((int)((_7506_vals2)->size(1)))}),nullptr,_12715_)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.constTerm
// Method mosek.fusion.Expr.constTerm @ bld/docker-win/final/default/src/fusion/Expr.mbi:1634:6-1636:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::constTerm
  ( std::shared_ptr< monty::ndarray< double,1 > > _7509_vals1) { return mosek::fusion::p_Expr::constTerm(_7509_vals1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::constTerm(std::shared_ptr< monty::ndarray< double,1 > > _7509_vals1)
{
  _checked_ptr_1<double> _ptr__7509_vals1(_7509_vals1 ? _7509_vals1->raw() : nullptr, _7509_vals1 ? _7509_vals1->size(0) : 0);
  return (::mosek::fusion::p_ExprConst::_new_ExprConst(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_7509_vals1)->size(0)))}),nullptr,_7509_vals1)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.constTerm

// Begin mosek.fusion.Expr.sum
// Method mosek.fusion.Expr.sum @ bld/docker-win/final/default/src/fusion/Expr.mbi:1619:6-110
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sum
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7510_expr,
    int32_t _7511_dim) { return mosek::fusion::p_Expr::sum(_7510_expr,_7511_dim); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sum(monty::rc_ptr< ::mosek::fusion::Expression > _7510_expr,int32_t _7511_dim)
{
  return (::mosek::fusion::p_ExprSumReduce::_new_ExprSumReduce(_7511_dim,_7510_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.sum

// Begin mosek.fusion.Expr.sum
// Method mosek.fusion.Expr.sum @ bld/docker-win/final/default/src/fusion/Expr.mbi:1618:6-117
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sum
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7512_expr) { return mosek::fusion::p_Expr::sum(_7512_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sum(monty::rc_ptr< ::mosek::fusion::Expression > _7512_expr)
{
  return (::mosek::fusion::p_ExprSumReduce::_new_ExprSumReduce((int)0,::mosek::fusion::p_Expr::flatten(_7512_expr))).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.sum

// Begin mosek.fusion.Expr.neg
// Method mosek.fusion.Expr.neg @ bld/docker-win/final/default/src/fusion/Expr.mbi:1617:6-98
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::neg
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7513_e) { return mosek::fusion::p_Expr::neg(_7513_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::neg(monty::rc_ptr< ::mosek::fusion::Expression > _7513_e)
{
  return (::mosek::fusion::p_ExprMulScalarConst::_new_ExprMulScalarConst((double)((-(int)1)),_7513_e)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.neg

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1602:6-1615:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(bool _7514_left,monty::rc_ptr< ::mosek::fusion::Matrix > _7515_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7516_expr)
{
  int64_t _7517_nnz = _7515_mx->numNonzeros();
  int32_t _7518_dimi = _7515_mx->numRows();
  int32_t _7519_dimj = _7515_mx->numColumns();
  std::shared_ptr< monty::ndarray< double,1 > > _7520_mcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7517_nnz)));
  _checked_ptr_1<double> _ptr__7520_mcof(_7520_mcof ? _7520_mcof->raw() : nullptr,_7520_mcof ? _7520_mcof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7521_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7517_nnz)));
  _checked_ptr_1<int32_t> _ptr__7521_msubj(_7521_msubj ? _7521_msubj->raw() : nullptr,_7521_msubj ? _7521_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7522_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7517_nnz)));
  _checked_ptr_1<int32_t> _ptr__7522_msubi(_7522_msubi ? _7522_msubi->raw() : nullptr,_7522_msubi ? _7522_msubi->size(0) : 0);
  _7515_mx->getDataAsTriplets(_7522_msubi,_7521_msubj,_7520_mcof);
  if (_7514_left)
  {
    {
      return (::mosek::fusion::p_ExprMulDiagLeft::_new_ExprMulDiagLeft(_7518_dimi,_7519_dimj,_7522_msubi,_7521_msubj,_7520_mcof,_7516_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_ExprMulDiagRight::_new_ExprMulDiagRight(_7518_dimi,_7519_dimj,_7522_msubi,_7521_msubj,_7520_mcof,_7516_expr)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1599:6-140
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7523_v,
    monty::rc_ptr< ::mosek::fusion::Parameter > _7524_p) { return mosek::fusion::p_Expr::mulDiag(_7523_v,_7524_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Variable > _7523_v,monty::rc_ptr< ::mosek::fusion::Parameter > _7524_p)
{
  return (::mosek::fusion::p_ExprMulParamDiagRight::_new_ExprMulParamDiagRight(_7523_v->__mosek_2fusion_2Variable__asExpr(),_7524_p)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1598:6-139
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _7525_p,
    monty::rc_ptr< ::mosek::fusion::Variable > _7526_v) { return mosek::fusion::p_Expr::mulDiag(_7525_p,_7526_v); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Parameter > _7525_p,monty::rc_ptr< ::mosek::fusion::Variable > _7526_v)
{
  return (::mosek::fusion::p_ExprMulParamDiagLeft::_new_ExprMulParamDiagLeft(_7525_p,_7526_v->__mosek_2fusion_2Variable__asExpr())).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1597:6-134
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7527_expr,
    monty::rc_ptr< ::mosek::fusion::Parameter > _7528_p) { return mosek::fusion::p_Expr::mulDiag(_7527_expr,_7528_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Expression > _7527_expr,monty::rc_ptr< ::mosek::fusion::Parameter > _7528_p)
{
  return (::mosek::fusion::p_ExprMulParamDiagRight::_new_ExprMulParamDiagRight(_7527_expr,_7528_p)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1596:6-133
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _7529_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _7530_expr) { return mosek::fusion::p_Expr::mulDiag(_7529_p,_7530_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Parameter > _7529_p,monty::rc_ptr< ::mosek::fusion::Expression > _7530_expr)
{
  return (::mosek::fusion::p_ExprMulParamDiagLeft::_new_ExprMulParamDiagLeft(_7529_p,_7530_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1594:6-129
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7531_v,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7532_mx) { return mosek::fusion::p_Expr::mulDiag(_7531_v,_7532_mx); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Variable > _7531_v,monty::rc_ptr< ::mosek::fusion::Matrix > _7532_mx)
{
  return ::mosek::fusion::p_Expr::mulDiag(false,_7532_mx,_7531_v->__mosek_2fusion_2Variable__asExpr());
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1593:6-128
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7533_mx,
    monty::rc_ptr< ::mosek::fusion::Variable > _7534_v) { return mosek::fusion::p_Expr::mulDiag(_7533_mx,_7534_v); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Matrix > _7533_mx,monty::rc_ptr< ::mosek::fusion::Variable > _7534_v)
{
  return ::mosek::fusion::p_Expr::mulDiag(true,_7533_mx,_7534_v->__mosek_2fusion_2Variable__asExpr());
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1592:6-123
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7535_expr,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7536_mx) { return mosek::fusion::p_Expr::mulDiag(_7535_expr,_7536_mx); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Expression > _7535_expr,monty::rc_ptr< ::mosek::fusion::Matrix > _7536_mx)
{
  return ::mosek::fusion::p_Expr::mulDiag(false,_7536_mx,_7535_expr);
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1591:6-122
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7537_mx,
    monty::rc_ptr< ::mosek::fusion::Expression > _7538_expr) { return mosek::fusion::p_Expr::mulDiag(_7537_mx,_7538_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Matrix > _7537_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7538_expr)
{
  return ::mosek::fusion::p_Expr::mulDiag(true,_7537_mx,_7538_expr);
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1590:6-306
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7539_v,
    std::shared_ptr< monty::ndarray< double,2 > > _7540_a) { return mosek::fusion::p_Expr::mulDiag(_7539_v,_7540_a); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Variable > _7539_v,std::shared_ptr< monty::ndarray< double,2 > > _7540_a)
{
  std::vector<int32_t> _12716_;
  for (int32_t _7541_i = (int)0, _12717_ = (int)((_7540_a)->size(0)); _7541_i < _12717_ ; ++_7541_i)
  {
    for (int32_t _7542_j = (int)0, _12718_ = (int)((_7540_a)->size(1)); _7542_j < _12718_ ; ++_7542_j)
    {
      _12716_.push_back(_7541_i);
    }
  }
  auto _12719_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12716_.size()),_12716_.begin(),_12716_.end()));
  std::vector<int32_t> _12720_;
  for (int32_t _7543_i = (int)0, _12721_ = (int)((_7540_a)->size(0)); _7543_i < _12721_ ; ++_7543_i)
  {
    for (int32_t _7544_j = (int)0, _12722_ = (int)((_7540_a)->size(1)); _7544_j < _12722_ ; ++_7544_j)
    {
      _12720_.push_back(_7544_j);
    }
  }
  auto _12723_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12720_.size()),_12720_.begin(),_12720_.end()));
  std::vector<double> _12724_;
  for (int32_t _7545_i = (int)0, _12725_ = (int)((_7540_a)->size(0)); _7545_i < _12725_ ; ++_7545_i)
  {
    for (int32_t _7546_j = (int)0, _12726_ = (int)((_7540_a)->size(1)); _7546_j < _12726_ ; ++_7546_j)
    {
      _12724_.push_back(((*_7540_a)(_7545_i,_7546_j)));
    }
  }
  auto _12727_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12724_.size()),_12724_.begin(),_12724_.end()));
  return (::mosek::fusion::p_ExprMulDiagRight::_new_ExprMulDiagRight((int)((_7540_a)->size(0)),(int)((_7540_a)->size(1)),_12719_,_12723_,_12727_,_7539_v->__mosek_2fusion_2Variable__asExpr())).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1589:6-300
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7547_expr,
    std::shared_ptr< monty::ndarray< double,2 > > _7548_a) { return mosek::fusion::p_Expr::mulDiag(_7547_expr,_7548_a); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(monty::rc_ptr< ::mosek::fusion::Expression > _7547_expr,std::shared_ptr< monty::ndarray< double,2 > > _7548_a)
{
  std::vector<int32_t> _12728_;
  for (int32_t _7549_i = (int)0, _12729_ = (int)((_7548_a)->size(0)); _7549_i < _12729_ ; ++_7549_i)
  {
    for (int32_t _7550_j = (int)0, _12730_ = (int)((_7548_a)->size(1)); _7550_j < _12730_ ; ++_7550_j)
    {
      _12728_.push_back(_7549_i);
    }
  }
  auto _12731_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12728_.size()),_12728_.begin(),_12728_.end()));
  std::vector<int32_t> _12732_;
  for (int32_t _7551_i = (int)0, _12733_ = (int)((_7548_a)->size(0)); _7551_i < _12733_ ; ++_7551_i)
  {
    for (int32_t _7552_j = (int)0, _12734_ = (int)((_7548_a)->size(1)); _7552_j < _12734_ ; ++_7552_j)
    {
      _12732_.push_back(_7552_j);
    }
  }
  auto _12735_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12732_.size()),_12732_.begin(),_12732_.end()));
  std::vector<double> _12736_;
  for (int32_t _7553_i = (int)0, _12737_ = (int)((_7548_a)->size(0)); _7553_i < _12737_ ; ++_7553_i)
  {
    for (int32_t _7554_j = (int)0, _12738_ = (int)((_7548_a)->size(1)); _7554_j < _12738_ ; ++_7554_j)
    {
      _12736_.push_back(((*_7548_a)(_7553_i,_7554_j)));
    }
  }
  auto _12739_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12736_.size()),_12736_.begin(),_12736_.end()));
  return (::mosek::fusion::p_ExprMulDiagRight::_new_ExprMulDiagRight((int)((_7548_a)->size(0)),(int)((_7548_a)->size(1)),_12731_,_12735_,_12739_,_7547_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1588:6-306
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( std::shared_ptr< monty::ndarray< double,2 > > _7555_a,
    monty::rc_ptr< ::mosek::fusion::Variable > _7556_v) { return mosek::fusion::p_Expr::mulDiag(_7555_a,_7556_v); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(std::shared_ptr< monty::ndarray< double,2 > > _7555_a,monty::rc_ptr< ::mosek::fusion::Variable > _7556_v)
{
  std::vector<int32_t> _12740_;
  for (int32_t _7557_i = (int)0, _12741_ = (int)((_7555_a)->size(0)); _7557_i < _12741_ ; ++_7557_i)
  {
    for (int32_t _7558_j = (int)0, _12742_ = (int)((_7555_a)->size(1)); _7558_j < _12742_ ; ++_7558_j)
    {
      _12740_.push_back(_7557_i);
    }
  }
  auto _12743_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12740_.size()),_12740_.begin(),_12740_.end()));
  std::vector<int32_t> _12744_;
  for (int32_t _7559_i = (int)0, _12745_ = (int)((_7555_a)->size(0)); _7559_i < _12745_ ; ++_7559_i)
  {
    for (int32_t _7560_j = (int)0, _12746_ = (int)((_7555_a)->size(1)); _7560_j < _12746_ ; ++_7560_j)
    {
      _12744_.push_back(_7560_j);
    }
  }
  auto _12747_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12744_.size()),_12744_.begin(),_12744_.end()));
  std::vector<double> _12748_;
  for (int32_t _7561_i = (int)0, _12749_ = (int)((_7555_a)->size(0)); _7561_i < _12749_ ; ++_7561_i)
  {
    for (int32_t _7562_j = (int)0, _12750_ = (int)((_7555_a)->size(1)); _7562_j < _12750_ ; ++_7562_j)
    {
      _12748_.push_back(((*_7555_a)(_7561_i,_7562_j)));
    }
  }
  auto _12751_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12748_.size()),_12748_.begin(),_12748_.end()));
  return (::mosek::fusion::p_ExprMulDiagLeft::_new_ExprMulDiagLeft((int)((_7555_a)->size(0)),(int)((_7555_a)->size(1)),_12743_,_12747_,_12751_,_7556_v->__mosek_2fusion_2Variable__asExpr())).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulDiag
// Method mosek.fusion.Expr.mulDiag @ bld/docker-win/final/default/src/fusion/Expr.mbi:1587:6-300
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulDiag
  ( std::shared_ptr< monty::ndarray< double,2 > > _7563_a,
    monty::rc_ptr< ::mosek::fusion::Expression > _7564_expr) { return mosek::fusion::p_Expr::mulDiag(_7563_a,_7564_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulDiag(std::shared_ptr< monty::ndarray< double,2 > > _7563_a,monty::rc_ptr< ::mosek::fusion::Expression > _7564_expr)
{
  std::vector<int32_t> _12752_;
  for (int32_t _7565_i = (int)0, _12753_ = (int)((_7563_a)->size(0)); _7565_i < _12753_ ; ++_7565_i)
  {
    for (int32_t _7566_j = (int)0, _12754_ = (int)((_7563_a)->size(1)); _7566_j < _12754_ ; ++_7566_j)
    {
      _12752_.push_back(_7565_i);
    }
  }
  auto _12755_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12752_.size()),_12752_.begin(),_12752_.end()));
  std::vector<int32_t> _12756_;
  for (int32_t _7567_i = (int)0, _12757_ = (int)((_7563_a)->size(0)); _7567_i < _12757_ ; ++_7567_i)
  {
    for (int32_t _7568_j = (int)0, _12758_ = (int)((_7563_a)->size(1)); _7568_j < _12758_ ; ++_7568_j)
    {
      _12756_.push_back(_7568_j);
    }
  }
  auto _12759_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12756_.size()),_12756_.begin(),_12756_.end()));
  std::vector<double> _12760_;
  for (int32_t _7569_i = (int)0, _12761_ = (int)((_7563_a)->size(0)); _7569_i < _12761_ ; ++_7569_i)
  {
    for (int32_t _7570_j = (int)0, _12762_ = (int)((_7563_a)->size(1)); _7570_j < _12762_ ; ++_7570_j)
    {
      _12760_.push_back(((*_7563_a)(_7569_i,_7570_j)));
    }
  }
  auto _12763_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12760_.size()),_12760_.begin(),_12760_.end()));
  return (::mosek::fusion::p_ExprMulDiagLeft::_new_ExprMulDiagLeft((int)((_7563_a)->size(0)),(int)((_7563_a)->size(1)),_12755_,_12759_,_12763_,_7564_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulDiag

// Begin mosek.fusion.Expr.mulElm_
// Method mosek.fusion.Expr.mulElm_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:1564:6-1585:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm_(monty::rc_ptr< ::mosek::fusion::Matrix > _7571_m,monty::rc_ptr< ::mosek::fusion::Expression > _7572_e)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7573_eshape = _7572_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7573_eshape(_7573_eshape ? _7573_eshape->raw() : nullptr,_7573_eshape ? _7573_eshape->size(0) : 0);
  monty::rc_ptr< ::mosek::fusion::Expression > _7574_expr = _7572_e;
  if (((int)((_7573_eshape)->size(0)) == (int)1))
  {
    {
      _7573_eshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__7573_eshape[(int)0]),(int32_t)((int)1)});
      _ptr__7573_eshape.update(_7573_eshape ? _7573_eshape->raw() : nullptr, _7573_eshape ? _7573_eshape->size(0) : 0);
      _7574_expr = (::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7573_eshape,_7572_e)).as<::mosek::fusion::Expression>();
    }
  }
  {}
  if ((((int)((_7573_eshape)->size(0)) != (int)2) || ((_7571_m->numRows() != _ptr__7573_eshape[(int)0]) || (_7571_m->numColumns() != _ptr__7573_eshape[(int)1]))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Dimensions of operands do not match"));
    }
  }
  {}
  int32_t _7575_mdim1 = _7571_m->numColumns();
  int64_t _7576_mnnz = _7571_m->numNonzeros();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7577_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7576_mnnz)));
  _checked_ptr_1<int32_t> _ptr__7577_msubi(_7577_msubi ? _7577_msubi->raw() : nullptr,_7577_msubi ? _7577_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7578_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7576_mnnz)));
  _checked_ptr_1<int32_t> _ptr__7578_msubj(_7578_msubj ? _7578_msubj->raw() : nullptr,_7578_msubj ? _7578_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7579_mcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7576_mnnz)));
  _checked_ptr_1<double> _ptr__7579_mcof(_7579_mcof ? _7579_mcof->raw() : nullptr,_7579_mcof ? _7579_mcof->size(0) : 0);
  _7571_m->getDataAsTriplets(_7577_msubi,_7578_msubj,_7579_mcof);
  std::vector<int64_t> _12764_;
  for (int64_t _7580_i = (int)0, _12765_ = _7576_mnnz; _7580_i < _12765_ ; ++_7580_i)
  {
    _12764_.push_back(safe_add( safe_mul( _ptr__7577_msubi[_7580_i],_7575_mdim1 ),_ptr__7578_msubj[_7580_i] ));
  }
  auto _12766_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12764_.size()),_12764_.begin(),_12764_.end()));
  return (::mosek::fusion::p_ExprMulElement::_new_ExprMulElement(_7579_mcof,_12766_,_7574_expr,(int)1)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulElm_

// Begin mosek.fusion.Expr.mulElm_
// Method mosek.fusion.Expr.mulElm_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:1550:6-1561:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm_(std::shared_ptr< monty::ndarray< double,1 > > _7581_a,monty::rc_ptr< ::mosek::fusion::Expression > _7582_expr)
{
  _checked_ptr_1<double> _ptr__7581_a(_7581_a ? _7581_a->raw() : nullptr, _7581_a ? _7581_a->size(0) : 0);
  if (((NULL == _7581_a.get()) || (NULL == _7582_expr.get())))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments for mulElm may not be null"));
    }
  }
  {}
  if (((_7582_expr->getND() == (int)0) && ((int)((_7581_a)->size(0)) == (int)1)))
  {
    {
      return (::mosek::fusion::p_ExprMulScalarConst::_new_ExprMulScalarConst(_ptr__7581_a[(int)0],_7582_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else if(((_7582_expr->getND() != (int)1) || (_7582_expr->getDim((int)0) != (int)((_7581_a)->size(0)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Dimensions of operands do not match"));
    }
  }
  else
  {
    {
      std::vector<int64_t> _12767_;
      for (int32_t _7583_i = (int)0, _12768_ = (int)((_7581_a)->size(0)); _7583_i < _12768_ ; ++_7583_i)
      {
        _12767_.push_back(_7583_i);
      }
      auto _12769_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12767_.size()),_12767_.begin(),_12767_.end()));
      return (::mosek::fusion::p_ExprMulElement::_new_ExprMulElement(_7581_a,_12769_,_7582_expr)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.mulElm_

// Begin mosek.fusion.Expr.mulElm_
// Method mosek.fusion.Expr.mulElm_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:1538:6-1548:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm_(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7584_spm,monty::rc_ptr< ::mosek::fusion::Expression > _7585_expr)
{
  if (((NULL == _7584_spm.get()) || (NULL == _7585_expr.get())))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments for mulElm may not be null"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7586_eshape = _7585_expr->getShape();
  _checked_ptr_1<int32_t> _ptr__7586_eshape(_7586_eshape ? _7586_eshape->raw() : nullptr,_7586_eshape ? _7586_eshape->size(0) : 0);
  if (((int)((_7586_eshape)->size(0)) != (int)((mosek::fusion::p_NDSparseArray::_get_impl(_7584_spm)->dims)->size(0))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Dimension mismatch"));
    }
  }
  {}
  int32_t _12770_ = (int)0;
  int32_t _12771_ = (int)((mosek::fusion::p_NDSparseArray::_get_impl(_7584_spm)->dims)->size(0));
  for (int32_t _7587_i = _12770_; _7587_i < _12771_; ++_7587_i)
  {
    {
      if ((((*mosek::fusion::p_NDSparseArray::_get_impl(_7584_spm)->dims)(_7587_i)) != _ptr__7586_eshape[_7587_i]))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Dimensions of operands do not match"));
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_ExprMulElement::_new_ExprMulElement(mosek::fusion::p_NDSparseArray::_get_impl(_7584_spm)->cof,mosek::fusion::p_NDSparseArray::_get_impl(_7584_spm)->inst,_7585_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulElm_

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1536:6-118
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7588_expr,
    double _7589_c) { return mosek::fusion::p_Expr::mul(_7588_expr,_7589_c); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Expression > _7588_expr,double _7589_c)
{
  return (::mosek::fusion::p_ExprMulScalarConst::_new_ExprMulScalarConst(_7589_c,_7588_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1535:6-121
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( double _7590_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _7591_expr) { return mosek::fusion::p_Expr::mul(_7590_c,_7591_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(double _7590_c,monty::rc_ptr< ::mosek::fusion::Expression > _7591_expr)
{
  return (::mosek::fusion::p_ExprMulScalarConst::_new_ExprMulScalarConst(_7590_c,_7591_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1534:6-105
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7592_expr,
    std::shared_ptr< monty::ndarray< double,1 > > _7593_a) { return mosek::fusion::p_Expr::mul(_7592_expr,_7593_a); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Expression > _7592_expr,std::shared_ptr< monty::ndarray< double,1 > > _7593_a)
{
  _checked_ptr_1<double> _ptr__7593_a(_7593_a ? _7593_a->raw() : nullptr, _7593_a ? _7593_a->size(0) : 0);
  return ::mosek::fusion::p_Expr::mul(false,_7593_a,_7592_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1533:6-107
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( std::shared_ptr< monty::ndarray< double,1 > > _7594_a,
    monty::rc_ptr< ::mosek::fusion::Expression > _7595_expr) { return mosek::fusion::p_Expr::mul(_7594_a,_7595_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(std::shared_ptr< monty::ndarray< double,1 > > _7594_a,monty::rc_ptr< ::mosek::fusion::Expression > _7595_expr)
{
  _checked_ptr_1<double> _ptr__7594_a(_7594_a ? _7594_a->raw() : nullptr, _7594_a ? _7594_a->size(0) : 0);
  return ::mosek::fusion::p_Expr::mul(true,_7594_a,_7595_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1532:6-105
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7596_expr,
    std::shared_ptr< monty::ndarray< double,2 > > _7597_a) { return mosek::fusion::p_Expr::mul(_7596_expr,_7597_a); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Expression > _7596_expr,std::shared_ptr< monty::ndarray< double,2 > > _7597_a)
{
  return ::mosek::fusion::p_Expr::mul(false,_7597_a,_7596_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1531:6-107
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( std::shared_ptr< monty::ndarray< double,2 > > _7598_a,
    monty::rc_ptr< ::mosek::fusion::Expression > _7599_expr) { return mosek::fusion::p_Expr::mul(_7598_a,_7599_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(std::shared_ptr< monty::ndarray< double,2 > > _7598_a,monty::rc_ptr< ::mosek::fusion::Expression > _7599_expr)
{
  return ::mosek::fusion::p_Expr::mul(true,_7598_a,_7599_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1530:6-106
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7600_expr,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7601_mx) { return mosek::fusion::p_Expr::mul(_7600_expr,_7601_mx); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Expression > _7600_expr,monty::rc_ptr< ::mosek::fusion::Matrix > _7601_mx)
{
  return ::mosek::fusion::p_Expr::mul(false,_7601_mx,_7600_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1529:6-108
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7602_mx,
    monty::rc_ptr< ::mosek::fusion::Expression > _7603_expr) { return mosek::fusion::p_Expr::mul(_7602_mx,_7603_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Matrix > _7602_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7603_expr)
{
  return ::mosek::fusion::p_Expr::mul(true,_7602_mx,_7603_expr);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1507:6-1527:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(bool _7604_left,std::shared_ptr< monty::ndarray< double,1 > > _7605_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7606_e)
{
  _checked_ptr_1<double> _ptr__7605_mx(_7605_mx ? _7605_mx->raw() : nullptr, _7605_mx ? _7605_mx->size(0) : 0);
  int32_t _7607_mdim0 = (int)((_7605_mx)->size(0));
  int32_t _7608_nnz = _7607_mdim0;
  std::shared_ptr< monty::ndarray< double,1 > > _7609_mval = ::mosek::fusion::Utils::Tools::arraycopy(_7605_mx);
  _checked_ptr_1<double> _ptr__7609_mval(_7609_mval ? _7609_mval->raw() : nullptr,_7609_mval ? _7609_mval->size(0) : 0);
  int32_t _7610_nd = _7606_e->getND();
  if ((_7610_nd == (int)0))
  {
    {
      std::vector<int32_t> _12772_;
      for (int32_t _7611_i = (int)0, _12773_ = _7607_mdim0; _7611_i < _12773_ ; ++_7611_i)
      {
        _12772_.push_back(_7611_i);
      }
      auto _12774_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12772_.size()),_12772_.begin(),_12772_.end()));
      std::vector<int32_t> _12775_;
      for (int32_t _7612_i = (int)0, _12776_ = _7607_mdim0; _7612_i < _12776_ ; ++_7612_i)
      {
        _12775_.push_back((int)0);
      }
      auto _12777_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12775_.size()),_12775_.begin(),_12775_.end()));
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7607_mdim0)}),(::mosek::fusion::p_ExprScalarMul::_new_ExprScalarMul(_7607_mdim0,(int)1,_12774_,_12777_,_7609_mval,_7606_e,(int)1)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7610_nd != (int)2))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions"));
    }
  }
  else if((_7604_left && (_7606_e->getDim((int)0) == (int)((_7605_mx)->size(0)))))
  {
    {
      std::vector<int32_t> _12778_;
      for (int32_t _7613_i = (int)0, _12779_ = _7607_mdim0; _7613_i < _12779_ ; ++_7613_i)
      {
        _12778_.push_back((int)0);
      }
      auto _12780_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12778_.size()),_12778_.begin(),_12778_.end()));
      std::vector<int32_t> _12781_;
      for (int32_t _7614_i = (int)0, _12782_ = _7607_mdim0; _7614_i < _12782_ ; ++_7614_i)
      {
        _12781_.push_back(_7614_i);
      }
      auto _12783_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12781_.size()),_12781_.begin(),_12781_.end()));
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7606_e->getDim((int)1))}),(::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft((int)1,_7607_mdim0,_12780_,_12783_,_7609_mval,_7606_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7604_left && (_7606_e->getDim((int)0) == (int)1)))
  {
    {
      std::vector<int32_t> _12784_;
      for (int32_t _7615_i = (int)0, _12785_ = _7607_mdim0; _7615_i < _12785_ ; ++_7615_i)
      {
        _12784_.push_back(_7615_i);
      }
      auto _12786_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12784_.size()),_12784_.begin(),_12784_.end()));
      std::vector<int32_t> _12787_;
      for (int32_t _7616_i = (int)0, _12788_ = _7607_mdim0; _7616_i < _12788_ ; ++_7616_i)
      {
        _12787_.push_back((int)0);
      }
      auto _12789_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12787_.size()),_12787_.begin(),_12787_.end()));
      return (::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft(_7607_mdim0,(int)1,_12786_,_12789_,_7609_mval,_7606_e,(int)1)).as<::mosek::fusion::Expression>();
    }
  }
  else if(((!_7604_left) && (_7606_e->getDim((int)1) == _7607_mdim0)))
  {
    {
      std::vector<int32_t> _12790_;
      for (int32_t _7617_i = (int)0, _12791_ = _7607_mdim0; _7617_i < _12791_ ; ++_7617_i)
      {
        _12790_.push_back(_7617_i);
      }
      auto _12792_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12790_.size()),_12790_.begin(),_12790_.end()));
      std::vector<int32_t> _12793_;
      for (int32_t _7618_i = (int)0, _12794_ = _7607_mdim0; _7618_i < _12794_ ; ++_7618_i)
      {
        _12793_.push_back((int)0);
      }
      auto _12795_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12793_.size()),_12793_.begin(),_12793_.end()));
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7606_e->getDim((int)0))}),(::mosek::fusion::p_ExprMulRight::_new_ExprMulRight(_7607_mdim0,(int)1,_12792_,_12795_,_7609_mval,_7606_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if(((!_7604_left) && (_7606_e->getDim((int)1) == (int)1)))
  {
    {
      std::vector<int32_t> _12796_;
      for (int32_t _7619_i = (int)0, _12797_ = _7607_mdim0; _7619_i < _12797_ ; ++_7619_i)
      {
        _12796_.push_back((int)0);
      }
      auto _12798_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12796_.size()),_12796_.begin(),_12796_.end()));
      std::vector<int32_t> _12799_;
      for (int32_t _7620_i = (int)0, _12800_ = _7607_mdim0; _7620_i < _12800_ ; ++_7620_i)
      {
        _12799_.push_back(_7620_i);
      }
      auto _12801_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12799_.size()),_12799_.begin(),_12799_.end()));
      return (::mosek::fusion::p_ExprMulRight::_new_ExprMulRight((int)1,_7607_mdim0,_12798_,_12801_,_7609_mval,_7606_e,(int)1)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1460:6-1505:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(bool _7621_left,std::shared_ptr< monty::ndarray< double,2 > > _7622_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7623_e)
{
  int32_t _7624_mdim0 = (int)((_7622_mx)->size(0));
  int32_t _7625_mdim1 = (int)((_7622_mx)->size(1));
  int32_t _7626_nnz = safe_mul( _7624_mdim0,_7625_mdim1 );
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7627_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7626_nnz)));
  _checked_ptr_1<int32_t> _ptr__7627_msubi(_7627_msubi ? _7627_msubi->raw() : nullptr,_7627_msubi ? _7627_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7628_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7626_nnz)));
  _checked_ptr_1<int32_t> _ptr__7628_msubj(_7628_msubj ? _7628_msubj->raw() : nullptr,_7628_msubj ? _7628_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7629_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7626_nnz)));
  _checked_ptr_1<double> _ptr__7629_mval(_7629_mval ? _7629_mval->raw() : nullptr,_7629_mval ? _7629_mval->size(0) : 0);
  {
    int32_t _7630_k = (int)0;
    int32_t _12802_ = (int)0;
    int32_t _12803_ = _7624_mdim0;
    for (int32_t _7631_i = _12802_; _7631_i < _12803_; ++_7631_i)
    {
      {
        int32_t _12804_ = (int)0;
        int32_t _12805_ = _7625_mdim1;
        for (int32_t _7632_j = _12804_; _7632_j < _12805_; ++_7632_j)
        {
          {
            _ptr__7627_msubi[_7630_k] = _7631_i;
            _ptr__7628_msubj[_7630_k] = _7632_j;
            _ptr__7629_mval[_7630_k] = ((*_7622_mx)(_7631_i,_7632_j));
            _7630_k += (int)1;
          }
        }
      }
    }
  }
  int64_t _7633_esize = _7623_e->getSize();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7634_eshape = _7623_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7634_eshape(_7634_eshape ? _7634_eshape->raw() : nullptr,_7634_eshape ? _7634_eshape->size(0) : 0);
  if (((int)((_7634_eshape)->size(0)) == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprScalarMul::_new_ExprScalarMul(_7624_mdim0,_7625_mdim1,_7627_msubi,_7628_msubj,_7629_mval,_7623_e,(int)1)).as<::mosek::fusion::Expression>();
    }
  }
  else if(_7621_left)
  {
    {
      if (((int)((_7634_eshape)->size(0)) == (int)1))
      {
        {
          return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_7622_mx)->size(0)))}),(::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft(_7624_mdim0,_7625_mdim1,_7627_msubi,_7628_msubj,_7629_mval,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__7634_eshape[(int)0]),(int32_t)((int)1)}),_7623_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
        }
      }
      else if(((int)((_7634_eshape)->size(0)) == (int)2))
      {
        {
          return (::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft(_7624_mdim0,_7625_mdim1,_7627_msubi,_7628_msubj,_7629_mval,_7623_e)).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
        }
      }
    }
  }
  else
  {
    {
      if (((int)((_7634_eshape)->size(0)) == (int)1))
      {
        {
          return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)((_7622_mx)->size(1)))}),(::mosek::fusion::p_ExprMulRight::_new_ExprMulRight(_7624_mdim0,_7625_mdim1,_7627_msubi,_7628_msubj,_7629_mval,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_ptr__7634_eshape[(int)0])}),_7623_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
        }
      }
      else if(((int)((_7634_eshape)->size(0)) == (int)2))
      {
        {
          return (::mosek::fusion::p_ExprMulRight::_new_ExprMulRight(_7624_mdim0,_7625_mdim1,_7627_msubi,_7628_msubj,_7629_mval,_7623_e)).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
        }
      }
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1429:6-1458:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(bool _7635_left,monty::rc_ptr< ::mosek::fusion::Matrix > _7636_mx,monty::rc_ptr< ::mosek::fusion::Expression > _7637_e)
{
  int64_t _7638_nnz = _7636_mx->numNonzeros();
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7639_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7638_nnz)));
  _checked_ptr_1<int32_t> _ptr__7639_msubi(_7639_msubi ? _7639_msubi->raw() : nullptr,_7639_msubi ? _7639_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7640_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7638_nnz)));
  _checked_ptr_1<int32_t> _ptr__7640_msubj(_7640_msubj ? _7640_msubj->raw() : nullptr,_7640_msubj ? _7640_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7641_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7638_nnz)));
  _checked_ptr_1<double> _ptr__7641_mval(_7641_mval ? _7641_mval->raw() : nullptr,_7641_mval ? _7641_mval->size(0) : 0);
  int32_t _7642_mdim0 = _7636_mx->numRows();
  int32_t _7643_mdim1 = _7636_mx->numColumns();
  _7636_mx->getDataAsTriplets(_7639_msubi,_7640_msubj,_7641_mval);
  int32_t _7644_nd = _7637_e->getND();
  if ((_7644_nd == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprScalarMul::_new_ExprScalarMul(_7642_mdim0,_7643_mdim1,_7639_msubi,_7640_msubj,_7641_mval,_7637_e)).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7644_nd == (int)1))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7645_eshape = _7637_e->getShape();
      _checked_ptr_1<int32_t> _ptr__7645_eshape(_7645_eshape ? _7645_eshape->raw() : nullptr,_7645_eshape ? _7645_eshape->size(0) : 0);
      if (_7635_left)
      {
        {
          return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7642_mdim0)}),(::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft(_7642_mdim0,_7643_mdim1,_7639_msubi,_7640_msubj,_7641_mval,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__7645_eshape[(int)0]),(int32_t)((int)1)}),_7637_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7643_mdim1)}),(::mosek::fusion::p_ExprMulRight::_new_ExprMulRight(_7642_mdim0,_7643_mdim1,_7639_msubi,_7640_msubj,_7641_mval,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_ptr__7645_eshape[(int)0])}),_7637_e)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
  else if((_7644_nd == (int)2))
  {
    {
      if (_7635_left)
      {
        {
          return (::mosek::fusion::p_ExprMulLeft::_new_ExprMulLeft(_7642_mdim0,_7643_mdim1,_7639_msubi,_7640_msubj,_7641_mval,_7637_e)).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          return (::mosek::fusion::p_ExprMulRight::_new_ExprMulRight(_7642_mdim0,_7643_mdim1,_7639_msubi,_7640_msubj,_7641_mval,_7637_e)).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions for multiplication"));
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1402:6-1427:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7646_v,
    std::shared_ptr< monty::ndarray< double,2 > > _7647_mx) { return mosek::fusion::p_Expr::mul(_7646_v,_7647_mx); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Variable > _7646_v,std::shared_ptr< monty::ndarray< double,2 > > _7647_mx)
{
  int32_t _7648_mdim0 = (int)((_7647_mx)->size(0));
  int32_t _7649_mdim1 = (int)((_7647_mx)->size(1));
  int32_t _7650_nnz = safe_mul( _7648_mdim0,_7649_mdim1 );
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7651_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7650_nnz)));
  _checked_ptr_1<int32_t> _ptr__7651_msubi(_7651_msubi ? _7651_msubi->raw() : nullptr,_7651_msubi ? _7651_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7652_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7650_nnz)));
  _checked_ptr_1<int32_t> _ptr__7652_msubj(_7652_msubj ? _7652_msubj->raw() : nullptr,_7652_msubj ? _7652_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7653_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7650_nnz)));
  _checked_ptr_1<double> _ptr__7653_mval(_7653_mval ? _7653_mval->raw() : nullptr,_7653_mval ? _7653_mval->size(0) : 0);
  {
    int32_t _7654_k = (int)0;
    int32_t _12806_ = (int)0;
    int32_t _12807_ = _7648_mdim0;
    for (int32_t _7655_i = _12806_; _7655_i < _12807_; ++_7655_i)
    {
      {
        int32_t _12808_ = (int)0;
        int32_t _12809_ = _7649_mdim1;
        for (int32_t _7656_j = _12808_; _7656_j < _12809_; ++_7656_j)
        {
          {
            _ptr__7651_msubi[_7654_k] = _7655_i;
            _ptr__7652_msubj[_7654_k] = _7656_j;
            _ptr__7653_mval[_7654_k] = ((*_7647_mx)(_7655_i,_7656_j));
            _7654_k += (int)1;
          }
        }
      }
    }
  }
  return ::mosek::fusion::p_Expr::mul(false,_7648_mdim0,_7649_mdim1,_7651_msubi,_7652_msubj,_7653_mval,_7646_v);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1375:6-1400:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( std::shared_ptr< monty::ndarray< double,2 > > _7657_mx,
    monty::rc_ptr< ::mosek::fusion::Variable > _7658_v) { return mosek::fusion::p_Expr::mul(_7657_mx,_7658_v); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(std::shared_ptr< monty::ndarray< double,2 > > _7657_mx,monty::rc_ptr< ::mosek::fusion::Variable > _7658_v)
{
  int32_t _7659_mdim0 = (int)((_7657_mx)->size(0));
  int32_t _7660_mdim1 = (int)((_7657_mx)->size(1));
  int32_t _7661_nnz = safe_mul( _7659_mdim0,_7660_mdim1 );
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7662_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7661_nnz)));
  _checked_ptr_1<int32_t> _ptr__7662_msubi(_7662_msubi ? _7662_msubi->raw() : nullptr,_7662_msubi ? _7662_msubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7663_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7661_nnz)));
  _checked_ptr_1<int32_t> _ptr__7663_msubj(_7663_msubj ? _7663_msubj->raw() : nullptr,_7663_msubj ? _7663_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7664_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7661_nnz)));
  _checked_ptr_1<double> _ptr__7664_mval(_7664_mval ? _7664_mval->raw() : nullptr,_7664_mval ? _7664_mval->size(0) : 0);
  {
    int32_t _7665_k = (int)0;
    int32_t _12810_ = (int)0;
    int32_t _12811_ = _7659_mdim0;
    for (int32_t _7666_i = _12810_; _7666_i < _12811_; ++_7666_i)
    {
      {
        int32_t _12812_ = (int)0;
        int32_t _12813_ = _7660_mdim1;
        for (int32_t _7667_j = _12812_; _7667_j < _12813_; ++_7667_j)
        {
          {
            _ptr__7662_msubi[_7665_k] = _7666_i;
            _ptr__7663_msubj[_7665_k] = _7667_j;
            _ptr__7664_mval[_7665_k] = ((*_7657_mx)(_7666_i,_7667_j));
            _7665_k += (int)1;
          }
        }
      }
    }
  }
  return ::mosek::fusion::p_Expr::mul(true,_7659_mdim0,_7660_mdim1,_7662_msubi,_7663_msubj,_7664_mval,_7658_v);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1365:6-1373:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7668_v,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7669_mx) { return mosek::fusion::p_Expr::mul(_7668_v,_7669_mx); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Variable > _7668_v,monty::rc_ptr< ::mosek::fusion::Matrix > _7669_mx)
{
  int32_t _7670_mdimi = _7669_mx->numRows();
  int32_t _7671_mdimj = _7669_mx->numColumns();
  std::shared_ptr< monty::ndarray< double,1 > > _7672_mcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7669_mx->numNonzeros())));
  _checked_ptr_1<double> _ptr__7672_mcof(_7672_mcof ? _7672_mcof->raw() : nullptr,_7672_mcof ? _7672_mcof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7673_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7669_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__7673_msubj(_7673_msubj ? _7673_msubj->raw() : nullptr,_7673_msubj ? _7673_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7674_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7669_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__7674_msubi(_7674_msubi ? _7674_msubi->raw() : nullptr,_7674_msubi ? _7674_msubi->size(0) : 0);
  _7669_mx->getDataAsTriplets(_7674_msubi,_7673_msubj,_7672_mcof);
  return ::mosek::fusion::p_Expr::mul(false,_7670_mdimi,_7671_mdimj,_7674_msubi,_7673_msubj,_7672_mcof,_7668_v);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1355:6-1364:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7675_mx,
    monty::rc_ptr< ::mosek::fusion::Variable > _7676_v) { return mosek::fusion::p_Expr::mul(_7675_mx,_7676_v); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Matrix > _7675_mx,monty::rc_ptr< ::mosek::fusion::Variable > _7676_v)
{
  int32_t _7677_mdimi = _7675_mx->numRows();
  int32_t _7678_mdimj = _7675_mx->numColumns();
  std::shared_ptr< monty::ndarray< double,1 > > _7679_mcof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7675_mx->numNonzeros())));
  _checked_ptr_1<double> _ptr__7679_mcof(_7679_mcof ? _7679_mcof->raw() : nullptr,_7679_mcof ? _7679_mcof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7680_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7675_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__7680_msubj(_7680_msubj ? _7680_msubj->raw() : nullptr,_7680_msubj ? _7680_msubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7681_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7675_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__7681_msubi(_7681_msubi ? _7681_msubi->raw() : nullptr,_7681_msubi ? _7681_msubi->size(0) : 0);
  _7675_mx->getDataAsTriplets(_7681_msubi,_7680_msubj,_7679_mcof);
  return ::mosek::fusion::p_Expr::mul(true,_7677_mdimi,_7678_mdimj,_7681_msubi,_7680_msubj,_7679_mcof,_7676_v);
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1341:6-1352:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(bool _7682_left,int32_t _7683_mdimi,int32_t _7684_mdimj,std::shared_ptr< monty::ndarray< int32_t,1 > > _7685_msubi,std::shared_ptr< monty::ndarray< int32_t,1 > > _7686_msubj,std::shared_ptr< monty::ndarray< double,1 > > _7687_mcof,monty::rc_ptr< ::mosek::fusion::Variable > _7688_v)
{
  _checked_ptr_1<int32_t> _ptr__7685_msubi(_7685_msubi ? _7685_msubi->raw() : nullptr, _7685_msubi ? _7685_msubi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__7686_msubj(_7686_msubj ? _7686_msubj->raw() : nullptr, _7686_msubj ? _7686_msubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__7687_mcof(_7687_mcof ? _7687_mcof->raw() : nullptr, _7687_mcof ? _7687_mcof->size(0) : 0);
  if ((_7688_v->getND() == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprMulScalarVar::_new_ExprMulScalarVar(_7683_mdimi,_7684_mdimj,_7685_msubi,_7686_msubj,_7687_mcof,_7688_v)).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7688_v->getND() == (int)1))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7689_vshape = _7688_v->getShape();
      _checked_ptr_1<int32_t> _ptr__7689_vshape(_7689_vshape ? _7689_vshape->raw() : nullptr,_7689_vshape ? _7689_vshape->size(0) : 0);
      int32_t _12814_;
      bool _12815_ = _7682_left;
      if (_12815_)
      {
        _12814_ = _7683_mdimi;
      }
      else
      {
        _12814_ = _7684_mdimj;
      }
      std::shared_ptr< monty::ndarray< int32_t,1 > > _12816_;
      bool _12817_ = _7682_left;
      if (_12817_)
      {
        _12816_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__7689_vshape[(int)0]),(int32_t)((int)1)});
      }
      else
      {
        _12816_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_ptr__7689_vshape[(int)0])});
      }
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_12814_)}),(::mosek::fusion::p_ExprMulVar::_new_ExprMulVar(_7682_left,_7683_mdimi,_7684_mdimj,_7685_msubi,_7686_msubj,_7687_mcof,::mosek::fusion::p_Var::reshape(_7688_v,_12816_))).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_ExprMulVar::_new_ExprMulVar(_7682_left,_7683_mdimi,_7684_mdimj,_7685_msubi,_7686_msubj,_7687_mcof,_7688_v)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1326:6-1339:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7690_expr,
    monty::rc_ptr< ::mosek::fusion::Parameter > _7691_p) { return mosek::fusion::p_Expr::mul(_7690_expr,_7691_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Expression > _7690_expr,monty::rc_ptr< ::mosek::fusion::Parameter > _7691_p)
{
  if (((_7691_p->getND() == (int)2) && (_7690_expr->getND() == (int)2)))
  {
    {
      return (::mosek::fusion::p_ExprMulParamRight::_new_ExprMulParamRight(_7690_expr,_7691_p)).as<::mosek::fusion::Expression>();
    }
  }
  else if(((_7691_p->getND() == (int)1) && (_7690_expr->getND() == (int)2)))
  {
    {
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7690_expr->getDim((int)0))}),(::mosek::fusion::p_ExprMulParamRight::_new_ExprMulParamRight(_7690_expr,_7691_p->__mosek_2fusion_2Parameter__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7691_p->getDim((int)0)),(int32_t)((int)1)})))).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if(((_7691_p->getND() == (int)2) && (_7690_expr->getND() == (int)1)))
  {
    {
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7691_p->getDim((int)1))}),(::mosek::fusion::p_ExprMulParamRight::_new_ExprMulParamRight((::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_7690_expr->getDim((int)0))}),_7690_expr)).as<::mosek::fusion::Expression>(),_7691_p)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7691_p->getND() == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprMulParamScalar::_new_ExprMulParamScalar(_7691_p,_7690_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7690_expr->getND() == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprMulParamScalarExpr::_new_ExprMulParamScalarExpr(_7691_p,_7690_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.mul
// Method mosek.fusion.Expr.mul @ bld/docker-win/final/default/src/fusion/Expr.mbi:1312:6-1325:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mul
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _7692_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _7693_expr) { return mosek::fusion::p_Expr::mul(_7692_p,_7693_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mul(monty::rc_ptr< ::mosek::fusion::Parameter > _7692_p,monty::rc_ptr< ::mosek::fusion::Expression > _7693_expr)
{
  if (((_7692_p->getND() == (int)2) && (_7693_expr->getND() == (int)2)))
  {
    {
      return (::mosek::fusion::p_ExprMulParamLeft::_new_ExprMulParamLeft(_7692_p,_7693_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else if(((_7692_p->getND() == (int)1) && (_7693_expr->getND() == (int)2)))
  {
    {
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7693_expr->getDim((int)1))}),(::mosek::fusion::p_ExprMulParamLeft::_new_ExprMulParamLeft(_7692_p->__mosek_2fusion_2Parameter__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_7692_p->getDim((int)0))})),_7693_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if(((_7692_p->getND() == (int)2) && (_7693_expr->getND() == (int)1)))
  {
    {
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7692_p->getDim((int)0))}),(::mosek::fusion::p_ExprMulParamLeft::_new_ExprMulParamLeft(_7692_p,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_7693_expr->getDim((int)0)),(int32_t)((int)1)}),_7693_expr)).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>())).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7692_p->getND() == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprMulParamScalar::_new_ExprMulParamScalar(_7692_p,_7693_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7693_expr->getND() == (int)0))
  {
    {
      return (::mosek::fusion::p_ExprMulParamScalarExpr::_new_ExprMulParamScalarExpr(_7692_p,_7693_expr)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid operand dimensions for multiplication"));
    }
  }
}
// End mosek.fusion.Expr.mul

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1297:6-1310:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7694_e,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7695_m) { return mosek::fusion::p_Expr::dot(_7694_e,_7695_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Expression > _7694_e,monty::rc_ptr< ::mosek::fusion::Matrix > _7695_m)
{
  int64_t _7696_nnz = _7695_m->numNonzeros();
  if ((!_7695_m->isSparse()))
  {
    {
      std::vector<int64_t> _12818_;
      for (int64_t _7697_i = (int)0, _12819_ = _7696_nnz; _7697_i < _12819_ ; ++_7697_i)
      {
        _12818_.push_back(_7697_i);
      }
      auto _12820_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12818_.size()),_12818_.begin(),_12818_.end()));
      return (::mosek::fusion::p_ExprInner::_new_ExprInner(_7694_e,_12820_,_7695_m->getDataAsArray())).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7698_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7696_nnz)));
      _checked_ptr_1<int32_t> _ptr__7698_subi(_7698_subi ? _7698_subi->raw() : nullptr,_7698_subi ? _7698_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7699_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7696_nnz)));
      _checked_ptr_1<int32_t> _ptr__7699_subj(_7699_subj ? _7699_subj->raw() : nullptr,_7699_subj ? _7699_subj->size(0) : 0);
      std::shared_ptr< monty::ndarray< double,1 > > _7700_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7696_nnz)));
      _checked_ptr_1<double> _ptr__7700_cof(_7700_cof ? _7700_cof->raw() : nullptr,_7700_cof ? _7700_cof->size(0) : 0);
      int32_t _7701_dimj = _7695_m->numColumns();
      _7695_m->getDataAsTriplets(_7698_subi,_7699_subj,_7700_cof);
      std::vector<int64_t> _12821_;
      for (int32_t _7702_i = (int)0, _12822_ = (int)((_7698_subi)->size(0)); _7702_i < _12822_ ; ++_7702_i)
      {
        _12821_.push_back(safe_add( safe_mul( _ptr__7698_subi[_7702_i],_7701_dimj ),_ptr__7699_subj[_7702_i] ));
      }
      auto _12823_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12821_.size()),_12821_.begin(),_12821_.end()));
      return (::mosek::fusion::p_ExprInner::_new_ExprInner(_7694_e,_12823_,_7700_cof)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1296:6-217
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7703_e,
    std::shared_ptr< monty::ndarray< double,2 > > _7704_c2) { return mosek::fusion::p_Expr::dot(_7703_e,_7704_c2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Expression > _7703_e,std::shared_ptr< monty::ndarray< double,2 > > _7704_c2)
{
  std::vector<int64_t> _12824_;
  for (int32_t _7705_i = (int)0, _12825_ = safe_mul( (int)((_7704_c2)->size(0)),(int)((_7704_c2)->size(1)) ); _7705_i < _12825_ ; ++_7705_i)
  {
    _12824_.push_back(_7705_i);
  }
  auto _12826_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_12824_.size()),_12824_.begin(),_12824_.end()));
  std::vector<double> _12827_;
  for (int32_t _7706_i = (int)0, _12828_ = (int)((_7704_c2)->size(0)); _7706_i < _12828_ ; ++_7706_i)
  {
    for (int32_t _7707_j = (int)0, _12829_ = (int)((_7704_c2)->size(1)); _7707_j < _12829_ ; ++_7707_j)
    {
      _12827_.push_back(((*_7704_c2)(_7706_i,_7707_j)));
    }
  }
  auto _12830_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12827_.size()),_12827_.begin(),_12827_.end()));
  return (::mosek::fusion::p_ExprInner::_new_ExprInner(_7703_e,_12826_,_12830_)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1295:6-126
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7708_e,
    monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7709_nda) { return mosek::fusion::p_Expr::dot(_7708_e,_7709_nda); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Expression > _7708_e,monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7709_nda)
{
  return (::mosek::fusion::p_ExprInner::_new_ExprInner(_7708_e,mosek::fusion::p_NDSparseArray::_get_impl(_7709_nda)->inst,mosek::fusion::p_NDSparseArray::_get_impl(_7709_nda)->cof)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1279:6-1294:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7710_e,
    std::shared_ptr< monty::ndarray< double,1 > > _7711_c1) { return mosek::fusion::p_Expr::dot(_7710_e,_7711_c1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Expression > _7710_e,std::shared_ptr< monty::ndarray< double,1 > > _7711_c1)
{
  _checked_ptr_1<double> _ptr__7711_c1(_7711_c1 ? _7711_c1->raw() : nullptr, _7711_c1 ? _7711_c1->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7712_eshape = _7710_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7712_eshape(_7712_eshape ? _7712_eshape->raw() : nullptr,_7712_eshape ? _7712_eshape->size(0) : 0);
  if (((_7710_e->getSize() == (int)((_7711_c1)->size(0))) && ((int)((_7712_eshape)->size(0)) > (int)1)))
  {
    {
      int32_t _7713_numnotone = (int)0;
      int32_t _12831_ = (int)0;
      int32_t _12832_ = (int)((_7712_eshape)->size(0));
      for (int32_t _7714_i = _12831_; _7714_i < _12832_; ++_7714_i)
      {
        {
          if ((_ptr__7712_eshape[_7714_i] > (int)1))
          {
            {
              ++ _7713_numnotone;
            }
          }
          {}
        }
      }
      if ((_7713_numnotone > (int)1))
      {
        {
          throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand shapes"));
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _7715_newshape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int32_t)_7710_e->getSize())});
          _checked_ptr_1<int32_t> _ptr__7715_newshape(_7715_newshape ? _7715_newshape->raw() : nullptr,_7715_newshape ? _7715_newshape->size(0) : 0);
          return (::mosek::fusion::p_ExprInner::_new_ExprInner((::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7715_newshape,_7710_e)).as<::mosek::fusion::Expression>(),_7711_c1)).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_ExprInner::_new_ExprInner(_7710_e,_7711_c1)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1277:6-99
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7716_m,
    monty::rc_ptr< ::mosek::fusion::Expression > _7717_e) { return mosek::fusion::p_Expr::dot(_7716_m,_7717_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Matrix > _7716_m,monty::rc_ptr< ::mosek::fusion::Expression > _7717_e)
{
  return ::mosek::fusion::p_Expr::dot(_7717_e,_7716_m);
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1276:6-101
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7718_nda,
    monty::rc_ptr< ::mosek::fusion::Expression > _7719_e) { return mosek::fusion::p_Expr::dot(_7718_nda,_7719_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7718_nda,monty::rc_ptr< ::mosek::fusion::Expression > _7719_e)
{
  return ::mosek::fusion::p_Expr::dot(_7719_e,_7718_nda);
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1275:6-100
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( std::shared_ptr< monty::ndarray< double,2 > > _7720_c2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7721_e) { return mosek::fusion::p_Expr::dot(_7720_c2,_7721_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(std::shared_ptr< monty::ndarray< double,2 > > _7720_c2,monty::rc_ptr< ::mosek::fusion::Expression > _7721_e)
{
  return ::mosek::fusion::p_Expr::dot(_7721_e,_7720_c2);
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1274:6-100
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( std::shared_ptr< monty::ndarray< double,1 > > _7722_c1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7723_e) { return mosek::fusion::p_Expr::dot(_7722_c1,_7723_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(std::shared_ptr< monty::ndarray< double,1 > > _7722_c1,monty::rc_ptr< ::mosek::fusion::Expression > _7723_e)
{
  _checked_ptr_1<double> _ptr__7722_c1(_7722_c1 ? _7722_c1->raw() : nullptr, _7722_c1 ? _7722_c1->size(0) : 0);
  return ::mosek::fusion::p_Expr::dot(_7723_e,_7722_c1);
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1272:6-103
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7724_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _7725_p) { return mosek::fusion::p_Expr::dot(_7724_e,_7725_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Expression > _7724_e,monty::rc_ptr< ::mosek::fusion::Parameter > _7725_p)
{
  return (::mosek::fusion::p_ExprDotParam::_new_ExprDotParam(_7725_p,_7724_e)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.dot
// Method mosek.fusion.Expr.dot @ bld/docker-win/final/default/src/fusion/Expr.mbi:1271:6-103
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::dot
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _7726_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _7727_e) { return mosek::fusion::p_Expr::dot(_7726_p,_7727_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::dot(monty::rc_ptr< ::mosek::fusion::Parameter > _7726_p,monty::rc_ptr< ::mosek::fusion::Expression > _7727_e)
{
  return (::mosek::fusion::p_ExprDotParam::_new_ExprDotParam(_7726_p,_7727_e)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.dot

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1257:6-1269:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _7728_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _7729_e) { return mosek::fusion::p_Expr::outer(_7728_p,_7729_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(monty::rc_ptr< ::mosek::fusion::Parameter > _7728_p,monty::rc_ptr< ::mosek::fusion::Expression > _7729_e)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7730_vshape = _7729_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7730_vshape(_7730_vshape ? _7730_vshape->raw() : nullptr,_7730_vshape ? _7730_vshape->size(0) : 0);
  if ((!(((int)((_7730_vshape)->size(0)) == (int)1) || (((int)((_7730_vshape)->size(0)) == (int)2) && (_ptr__7730_vshape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7731_pshape = _7728_p->getShape();
  _checked_ptr_1<int32_t> _ptr__7731_pshape(_7731_pshape ? _7731_pshape->raw() : nullptr,_7731_pshape ? _7731_pshape->size(0) : 0);
  if ((!((_7728_p->getND() == (int)1) || ((_7728_p->getND() == (int)2) && (_ptr__7731_pshape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Parameter argument must be one-dimensional"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(_7728_p->__mosek_2fusion_2Parameter__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_ptr__7731_pshape[(int)0]),(int32_t)((int)1)})),::mosek::fusion::p_Expr::reshape(_7729_e,(int)1,_ptr__7730_vshape[(int)0]));
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1243:6-1255:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7732_e,
    monty::rc_ptr< ::mosek::fusion::Parameter > _7733_p) { return mosek::fusion::p_Expr::outer(_7732_e,_7733_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(monty::rc_ptr< ::mosek::fusion::Expression > _7732_e,monty::rc_ptr< ::mosek::fusion::Parameter > _7733_p)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7734_shape = _7732_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7734_shape(_7734_shape ? _7734_shape->raw() : nullptr,_7734_shape ? _7734_shape->size(0) : 0);
  if ((!((_7732_e->getND() == (int)1) || ((_7732_e->getND() == (int)2) && (_ptr__7734_shape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7735_pshape = _7733_p->getShape();
  _checked_ptr_1<int32_t> _ptr__7735_pshape(_7735_pshape ? _7735_pshape->raw() : nullptr,_7735_pshape ? _7735_pshape->size(0) : 0);
  if ((!((_7733_p->getND() == (int)1) || ((_7733_p->getND() == (int)2) && (_ptr__7735_pshape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Parameter argument must be one-dimensional"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(::mosek::fusion::p_Expr::reshape(_7732_e,_ptr__7734_shape[(int)0],(int)1),_7733_p->__mosek_2fusion_2Parameter__reshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_ptr__7735_pshape[(int)0])})));
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1231:6-1241:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7736_m,
    monty::rc_ptr< ::mosek::fusion::Expression > _7737_e) { return mosek::fusion::p_Expr::outer(_7736_m,_7737_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(monty::rc_ptr< ::mosek::fusion::Matrix > _7736_m,monty::rc_ptr< ::mosek::fusion::Expression > _7737_e)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7738_vshape = _7737_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7738_vshape(_7738_vshape ? _7738_vshape->raw() : nullptr,_7738_vshape ? _7738_vshape->size(0) : 0);
  if ((!(((int)((_7738_vshape)->size(0)) == (int)1) || (((int)((_7738_vshape)->size(0)) == (int)2) && (_ptr__7738_vshape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  if ((mosek::fusion::p_Matrix::_get_impl(_7736_m)->dimj != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Constant matrix must be a column-vector"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(_7736_m,::mosek::fusion::p_Expr::reshape(_7737_e,(int)1,_ptr__7738_vshape[(int)0]));
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1219:6-1229:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7739_e,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7740_m) { return mosek::fusion::p_Expr::outer(_7739_e,_7740_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(monty::rc_ptr< ::mosek::fusion::Expression > _7739_e,monty::rc_ptr< ::mosek::fusion::Matrix > _7740_m)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7741_shape = _7739_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7741_shape(_7741_shape ? _7741_shape->raw() : nullptr,_7741_shape ? _7741_shape->size(0) : 0);
  if ((!((_7739_e->getND() == (int)1) || ((_7739_e->getND() == (int)2) && (_ptr__7741_shape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  if ((mosek::fusion::p_Matrix::_get_impl(_7740_m)->dimj != (int)1))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Constant matrix must be a column-vector"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(::mosek::fusion::p_Expr::reshape(_7739_e,_ptr__7741_shape[(int)0],(int)1),_7740_m->__mosek_2fusion_2Matrix__transpose());
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1209:6-1217:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( std::shared_ptr< monty::ndarray< double,1 > > _7742_a,
    monty::rc_ptr< ::mosek::fusion::Expression > _7743_e) { return mosek::fusion::p_Expr::outer(_7742_a,_7743_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(std::shared_ptr< monty::ndarray< double,1 > > _7742_a,monty::rc_ptr< ::mosek::fusion::Expression > _7743_e)
{
  _checked_ptr_1<double> _ptr__7742_a(_7742_a ? _7742_a->raw() : nullptr, _7742_a ? _7742_a->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7744_shape = _7743_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7744_shape(_7744_shape ? _7744_shape->raw() : nullptr,_7744_shape ? _7744_shape->size(0) : 0);
  if ((!((_7743_e->getND() == (int)1) || ((_7743_e->getND() == (int)2) && (_ptr__7744_shape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(::mosek::fusion::p_Matrix::dense((int)((_7742_a)->size(0)),(int)1,_7742_a),::mosek::fusion::p_Expr::reshape(_7743_e,(int)1,_ptr__7744_shape[(int)0]));
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer
// Method mosek.fusion.Expr.outer @ bld/docker-win/final/default/src/fusion/Expr.mbi:1199:6-1207:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::outer
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7745_e,
    std::shared_ptr< monty::ndarray< double,1 > > _7746_a) { return mosek::fusion::p_Expr::outer(_7745_e,_7746_a); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer(monty::rc_ptr< ::mosek::fusion::Expression > _7745_e,std::shared_ptr< monty::ndarray< double,1 > > _7746_a)
{
  _checked_ptr_1<double> _ptr__7746_a(_7746_a ? _7746_a->raw() : nullptr, _7746_a ? _7746_a->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7747_shape = _7745_e->getShape();
  _checked_ptr_1<int32_t> _ptr__7747_shape(_7747_shape ? _7747_shape->raw() : nullptr,_7747_shape ? _7747_shape->size(0) : 0);
  if ((!((_7745_e->getND() == (int)1) || ((_7745_e->getND() == (int)2) && (_ptr__7747_shape[(int)1] == (int)1)))))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Expression argument must be one-dimensional"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::mul(::mosek::fusion::p_Expr::reshape(_7745_e,_ptr__7747_shape[(int)0],(int)1),::mosek::fusion::p_Matrix::dense((int)1,(int)((_7746_a)->size(0)),_7746_a));
}
// End mosek.fusion.Expr.outer

// Begin mosek.fusion.Expr.outer_
// Method mosek.fusion.Expr.outer_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:1102:6-1197:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer_(int32_t _7748_edim,std::shared_ptr< monty::ndarray< int64_t,1 > > _7749_eptrb,std::shared_ptr< monty::ndarray< int64_t,1 > > _7750_esubj,std::shared_ptr< monty::ndarray< double,1 > > _7751_ecof,std::shared_ptr< monty::ndarray< double,1 > > _7752_ebfix,std::shared_ptr< monty::ndarray< int64_t,1 > > _7753_einst,std::shared_ptr< monty::ndarray< double,1 > > _7754_a,std::shared_ptr< monty::ndarray< int32_t,1 > > _7755_sub,int32_t _7756_dim,bool _7757_transpose)
{
  _checked_ptr_1<int64_t> _ptr__7749_eptrb(_7749_eptrb ? _7749_eptrb->raw() : nullptr, _7749_eptrb ? _7749_eptrb->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__7750_esubj(_7750_esubj ? _7750_esubj->raw() : nullptr, _7750_esubj ? _7750_esubj->size(0) : 0);
  _checked_ptr_1<double> _ptr__7751_ecof(_7751_ecof ? _7751_ecof->raw() : nullptr, _7751_ecof ? _7751_ecof->size(0) : 0);
  _checked_ptr_1<double> _ptr__7752_ebfix(_7752_ebfix ? _7752_ebfix->raw() : nullptr, _7752_ebfix ? _7752_ebfix->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__7753_einst(_7753_einst ? _7753_einst->raw() : nullptr, _7753_einst ? _7753_einst->size(0) : 0);
  _checked_ptr_1<double> _ptr__7754_a(_7754_a ? _7754_a->raw() : nullptr, _7754_a ? _7754_a->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__7755_sub(_7755_sub ? _7755_sub->raw() : nullptr, _7755_sub ? _7755_sub->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _12833_;
  bool _12834_ = (!_7757_transpose);
  if (_12834_)
  {
    _12833_ = ::mosek::fusion::p_Set::make(_7748_edim,_7756_dim);
  }
  else
  {
    _12833_ = ::mosek::fusion::p_Set::make(_7756_dim,_7748_edim);
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7758_shape = _12833_;
  _checked_ptr_1<int32_t> _ptr__7758_shape(_7758_shape ? _7758_shape->raw() : nullptr,_7758_shape ? _7758_shape->size(0) : 0);
  int32_t _7759_nnzelm = safe_mul( (int)((_7754_a)->size(0)),(int)((_7753_einst)->size(0)) );
  int32_t _7760_nnz = safe_mul( (int)((_7754_a)->size(0)),(int)((_7750_esubj)->size(0)) );
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7761_inst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7759_nnzelm)));
  _checked_ptr_1<int64_t> _ptr__7761_inst(_7761_inst ? _7761_inst->raw() : nullptr,_7761_inst ? _7761_inst->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _12835_;
  bool _12836_ = (NULL != _7752_ebfix.get());
  if (_12836_)
  {
    _12835_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7759_nnzelm)));
  }
  else
  {
    _12835_ = nullptr;
  }
  std::shared_ptr< monty::ndarray< double,1 > > _7762_bfix = _12835_;
  _checked_ptr_1<double> _ptr__7762_bfix(_7762_bfix ? _7762_bfix->raw() : nullptr,_7762_bfix ? _7762_bfix->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7763_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_7760_nnz)));
  _checked_ptr_1<double> _ptr__7763_cof(_7763_cof ? _7763_cof->raw() : nullptr,_7763_cof ? _7763_cof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7764_subj = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7760_nnz)));
  _checked_ptr_1<int64_t> _ptr__7764_subj(_7764_subj ? _7764_subj->raw() : nullptr,_7764_subj ? _7764_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7765_ptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _7759_nnzelm,(int)1 ))));
  _checked_ptr_1<int64_t> _ptr__7765_ptrb(_7765_ptrb ? _7765_ptrb->raw() : nullptr,_7765_ptrb ? _7765_ptrb->size(0) : 0);
  int32_t _7766_ennz = (int32_t)_ptr__7765_ptrb[((int)((_7765_ptrb)->size(0)) - (int)1)];
  if ((!_7757_transpose))
  {
    {
      int64_t _7767_k = (int64_t)0;
      int64_t _7768_ptr = (int64_t)0;
      int32_t _12837_ = (int)0;
      int32_t _12838_ = (int)((_7753_einst)->size(0));
      for (int32_t _7769_i = _12837_; _7769_i < _12838_; ++_7769_i)
      {
        {
          int64_t _7770_num = (_ptr__7749_eptrb[safe_add( _7769_i,(int)1 )] - _ptr__7749_eptrb[_7769_i]);
          int32_t _12839_ = (int)0;
          int32_t _12840_ = (int)((_7754_a)->size(0));
          for (int32_t _7771_j = _12839_; _7771_j < _12840_; ++_7771_j)
          {
            {
              _ptr__7753_einst[_7767_k] = safe_add( safe_mul( _ptr__7753_einst[_7769_i],_7756_dim ),_ptr__7755_sub[_7771_j] );
              _ptr__7765_ptrb[safe_add( _7767_k,(int)1 )] = safe_add( _ptr__7765_ptrb[_7767_k],_7770_num );
              ++ _7767_k;
              int64_t _12841_ = _ptr__7749_eptrb[_7769_i];
              int64_t _12842_ = _ptr__7749_eptrb[safe_add( _7769_i,(int)1 )];
              for (int64_t _7772_l = _12841_; _7772_l < _12842_; ++_7772_l)
              {
                {
                  _ptr__7764_subj[_7768_ptr] = _ptr__7750_esubj[_7772_l];
                  _ptr__7763_cof[_7768_ptr] = (_ptr__7751_ecof[_7772_l] * _ptr__7754_a[_7771_j]);
                  ++ _7768_ptr;
                }
              }
            }
          }
        }
      }
      if ((NULL != _7762_bfix.get()))
      {
        {
          int32_t _7773_k = (int)0;
          int32_t _12843_ = (int)0;
          int32_t _12844_ = (int)((_7753_einst)->size(0));
          for (int32_t _7774_i = _12843_; _7774_i < _12844_; ++_7774_i)
          {
            {
              int32_t _12845_ = (int)0;
              int32_t _12846_ = (int)((_7754_a)->size(0));
              for (int32_t _7775_j = _12845_; _7775_j < _12846_; ++_7775_j)
              {
                {
                  _ptr__7762_bfix[_7773_k] = (_ptr__7754_a[_7775_j] * _ptr__7752_ebfix[_7774_i]);
                  ++ _7773_k;
                }
              }
            }
          }
        }
      }
      {}
    }
  }
  else
  {
    {
      int64_t _7776_k = (int64_t)0;
      int64_t _7777_ptr = (int64_t)0;
      int32_t _12847_ = (int)0;
      int32_t _12848_ = (int)((_7754_a)->size(0));
      for (int32_t _7778_j = _12847_; _7778_j < _12848_; ++_7778_j)
      {
        {
          double _7779_c = _ptr__7754_a[_7778_j];
          ::mosek::fusion::Utils::Tools::arraycopy(_7750_esubj,(int64_t)((int)0),_7764_subj,_7777_ptr,(int64_t)(_7766_ennz));
          int32_t _12849_ = (int)0;
          int32_t _12850_ = _7766_ennz;
          for (int32_t _7780_l = _12849_; _7780_l < _12850_; ++_7780_l)
          {
            {
              _ptr__7763_cof[safe_add( _7777_ptr,_7780_l )] = (_ptr__7751_ecof[_7780_l] * _ptr__7754_a[_7778_j]);
            }
          }
          int32_t _12851_ = (int)0;
          int32_t _12852_ = (int)((_7753_einst)->size(0));
          for (int32_t _7781_i = _12851_; _7781_i < _12852_; ++_7781_i)
          {
            {
              int64_t _7782_num = (_ptr__7749_eptrb[safe_add( _7781_i,(int)1 )] - _ptr__7749_eptrb[_7781_i]);
              _ptr__7753_einst[_7776_k] = safe_add( safe_mul( _ptr__7753_einst[_7781_i],_7756_dim ),_ptr__7755_sub[_7778_j] );
              _ptr__7765_ptrb[safe_add( _7776_k,(int)1 )] = safe_add( _ptr__7765_ptrb[_7776_k],_7782_num );
              ++ _7776_k;
            }
          }
          _7777_ptr += _7766_ennz;
        }
      }
      if ((NULL != _7762_bfix.get()))
      {
        {
          int32_t _7783_k = (int)0;
          int32_t _12853_ = (int)0;
          int32_t _12854_ = (int)((_7754_a)->size(0));
          for (int32_t _7784_j = _12853_; _7784_j < _12854_; ++_7784_j)
          {
            {
              double _7785_c = _ptr__7754_a[_7784_j];
              int32_t _12855_ = (int)0;
              int32_t _12856_ = (int)((_7753_einst)->size(0));
              for (int32_t _7786_i = _12855_; _7786_i < _12856_; ++_7786_i)
              {
                {
                  _ptr__7762_bfix[_7783_k] = (_ptr__7752_ebfix[_7786_i] * _7785_c);
                  ++ _7783_k;
                }
              }
            }
          }
        }
      }
      {}
    }
  }
  return (::mosek::fusion::p_Expr::_new_Expr(_7765_ptrb,_7764_subj,_7763_cof,_7762_bfix,_7758_shape,_7761_inst)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.outer_

// Begin mosek.fusion.Expr.outer_
// Method mosek.fusion.Expr.outer_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:1023:6-1089:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::outer_(monty::rc_ptr< ::mosek::fusion::Variable > _7787_v,int32_t _7788_vdim,std::shared_ptr< monty::ndarray< double,1 > > _7789_a,std::shared_ptr< monty::ndarray< int32_t,1 > > _7790_sub,int32_t _7791_dim,bool _7792_transpose)
{
  _checked_ptr_1<double> _ptr__7789_a(_7789_a ? _7789_a->raw() : nullptr, _7789_a ? _7789_a->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__7790_sub(_7790_sub ? _7790_sub->raw() : nullptr, _7790_sub ? _7790_sub->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _12857_;
  bool _12858_ = (!_7792_transpose);
  if (_12858_)
  {
    _12857_ = ::mosek::fusion::p_Set::make(_7788_vdim,_7791_dim);
  }
  else
  {
    _12857_ = ::mosek::fusion::p_Set::make(_7791_dim,_7788_vdim);
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7793_shape = _12857_;
  _checked_ptr_1<int32_t> _ptr__7793_shape(_7793_shape ? _7793_shape->raw() : nullptr,_7793_shape ? _7793_shape->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _12859_;
  bool _12860_ = (_7791_dim == (int)((_7789_a)->size(0)));
  if (_12860_)
  {
    _12859_ = nullptr;
  }
  else
  {
    _12859_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_mul( (int)((_7789_a)->size(0)),_7788_vdim ))));
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7794_inst = _12859_;
  _checked_ptr_1<int64_t> _ptr__7794_inst(_7794_inst ? _7794_inst->raw() : nullptr,_7794_inst ? _7794_inst->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7795_bfix = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( (int)((_7789_a)->size(0)),_7788_vdim ))));
  _checked_ptr_1<double> _ptr__7795_bfix(_7795_bfix ? _7795_bfix->raw() : nullptr,_7795_bfix ? _7795_bfix->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _7796_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( (int)((_7789_a)->size(0)),_7788_vdim ))));
  _checked_ptr_1<double> _ptr__7796_cof(_7796_cof ? _7796_cof->raw() : nullptr,_7796_cof ? _7796_cof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7797_subj = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_mul( (int)((_7789_a)->size(0)),_7788_vdim ))));
  _checked_ptr_1<int64_t> _ptr__7797_subj(_7797_subj ? _7797_subj->raw() : nullptr,_7797_subj ? _7797_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7798_ptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( safe_mul( (int)((_7789_a)->size(0)),_7788_vdim ),(int)1 ))));
  _checked_ptr_1<int64_t> _ptr__7798_ptrb(_7798_ptrb ? _7798_ptrb->raw() : nullptr,_7798_ptrb ? _7798_ptrb->size(0) : 0);
  if ((_7791_dim == (int)((_7789_a)->size(0))))
  {
    {
      int64_t _7799_k = (int64_t)0;
      if ((!_7792_transpose))
      {
        {
          int32_t _12861_ = (int)0;
          int32_t _12862_ = _7788_vdim;
          for (int32_t _7800_j = _12861_; _7800_j < _12862_; ++_7800_j)
          {
            {
              int32_t _12863_ = (int)0;
              int32_t _12864_ = _7791_dim;
              for (int32_t _7801_i = _12863_; _7801_i < _12864_; ++_7801_i)
              {
                {
                  _ptr__7798_ptrb[safe_add( _7799_k,(int)1 )] = safe_add( _7799_k,(int)1 );
                  _ptr__7797_subj[_7799_k] = (int64_t)_7800_j;
                  _ptr__7796_cof[_7799_k] = _ptr__7789_a[_7801_i];
                  ++ _7799_k;
                }
              }
            }
          }
        }
      }
      else
      {
        {
          int32_t _12865_ = (int)0;
          int32_t _12866_ = _7791_dim;
          for (int32_t _7802_i = _12865_; _7802_i < _12866_; ++_7802_i)
          {
            {
              int32_t _12867_ = (int)0;
              int32_t _12868_ = _7788_vdim;
              for (int32_t _7803_j = _12867_; _7803_j < _12868_; ++_7803_j)
              {
                {
                  _ptr__7798_ptrb[safe_add( _7799_k,(int)1 )] = safe_add( _7799_k,(int)1 );
                  _ptr__7797_subj[_7799_k] = (int64_t)_7803_j;
                  _ptr__7796_cof[_7799_k] = _ptr__7789_a[_7802_i];
                  ++ _7799_k;
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    {
      int64_t _7804_k = (int64_t)0;
      if ((!_7792_transpose))
      {
        {
          int32_t _12869_ = (int)0;
          int32_t _12870_ = _7788_vdim;
          for (int32_t _7805_j = _12869_; _7805_j < _12870_; ++_7805_j)
          {
            {
              int32_t _12871_ = (int)0;
              int32_t _12872_ = (int)((_7789_a)->size(0));
              for (int32_t _7806_i = _12871_; _7806_i < _12872_; ++_7806_i)
              {
                {
                  _ptr__7798_ptrb[safe_add( _7804_k,(int)1 )] = safe_add( _7804_k,(int)1 );
                  _ptr__7797_subj[_7804_k] = (int64_t)_7805_j;
                  _ptr__7796_cof[_7804_k] = _ptr__7789_a[_7806_i];
                  _ptr__7794_inst[_7804_k] = safe_add( safe_mul( _7805_j,_7791_dim ),_ptr__7790_sub[_7806_i] );
                  ++ _7804_k;
                }
              }
            }
          }
        }
      }
      else
      {
        {
          int32_t _12873_ = (int)0;
          int32_t _12874_ = (int)((_7789_a)->size(0));
          for (int32_t _7807_i = _12873_; _7807_i < _12874_; ++_7807_i)
          {
            {
              int32_t _12875_ = (int)0;
              int32_t _12876_ = _7788_vdim;
              for (int32_t _7808_j = _12875_; _7808_j < _12876_; ++_7808_j)
              {
                {
                  _ptr__7798_ptrb[safe_add( _7804_k,(int)1 )] = safe_add( _7804_k,(int)1 );
                  _ptr__7797_subj[_7804_k] = (int64_t)_7808_j;
                  _ptr__7796_cof[_7804_k] = _ptr__7789_a[_7807_i];
                  _ptr__7794_inst[_7804_k] = safe_add( safe_mul( _ptr__7790_sub[_7807_i],_7788_vdim ),_7808_j );
                  ++ _7804_k;
                }
              }
            }
          }
        }
      }
    }
  }
  return (::mosek::fusion::p_Expr::_new_Expr(_7798_ptrb,_7797_subj,_7796_cof,_7795_bfix,_7793_shape,_7794_inst)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.outer_

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:1002:6-1016:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >,1 > > _7809_exprs) { return mosek::fusion::p_Expr::stack(_7809_exprs); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >,1 > > _7809_exprs)
{
  if ((NULL == _7809_exprs.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Argument exprs may not be null"));
    }
  }
  {}
  int32_t _12877_ = (int)0;
  int32_t _12878_ = (int)((_7809_exprs)->size(0));
  for (int32_t _7810_i = _12877_; _7810_i < _12878_; ++_7810_i)
  {
    {
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7811_es = ((*_7809_exprs)(_7810_i));
      if ((NULL == _7811_es.get()))
      {
        {
          throw monty::NullPointerException(std::string ("Arguments for stack may not be null"));
        }
      }
      {}
      int32_t _12879_ = (int)0;
      int32_t _12880_ = (int)((_7811_es)->size(0));
      for (int32_t _7812_j = _12879_; _7812_j < _12880_; ++_7812_j)
      {
        {
          if ((NULL == ((*_7811_es)(_7812_j)).get()))
          {
            {
              throw monty::NullPointerException(std::string ("Arguments for stack may not be null"));
            }
          }
          {}
        }
      }
    }
  }
  std::vector<monty::rc_ptr< ::mosek::fusion::Expression >> _12881_;
  for (int32_t _7814_i = (int)0, _12882_ = (int)((_7809_exprs)->size(0)); _7814_i < _12882_ ; ++_7814_i)
  {
    _12881_.push_back(::mosek::fusion::p_Expr::stack_(((*_7809_exprs)(_7814_i)),(int)1));
  }
  auto _12883_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_12881_.size()),_12881_.begin(),_12881_.end()));
  std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7813_tmp = _12883_;
  return ::mosek::fusion::p_Expr::stack_(_7813_tmp,(int)0);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:992:6-160
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( double _7815_a1,
    double _7816_a2,
    double _7817_a3) { return mosek::fusion::p_Expr::vstack(_7815_a1,_7816_a2,_7817_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(double _7815_a1,double _7816_a2,double _7817_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7815_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7816_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7817_a3).get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:991:6-149
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( double _7818_a1,
    double _7819_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7820_e3) { return mosek::fusion::p_Expr::vstack(_7818_a1,_7819_a2,_7820_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(double _7818_a1,double _7819_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7820_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7818_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7819_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7820_e3.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:990:6-149
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( double _7821_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7822_e2,
    double _7823_a3) { return mosek::fusion::p_Expr::vstack(_7821_a1,_7822_e2,_7823_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(double _7821_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7822_e2,double _7823_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7821_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7822_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7823_a3).get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:989:6-138
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( double _7824_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7825_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7826_e3) { return mosek::fusion::p_Expr::vstack(_7824_a1,_7825_e2,_7826_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(double _7824_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7825_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7826_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7824_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7825_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7826_e3.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:987:6-153
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7827_e1,
    double _7828_a2,
    double _7829_a3) { return mosek::fusion::p_Expr::vstack(_7827_e1,_7828_a2,_7829_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7827_e1,double _7828_a2,double _7829_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7827_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7828_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7829_a3).get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:986:6-142
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7830_e1,
    double _7831_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7832_e3) { return mosek::fusion::p_Expr::vstack(_7830_e1,_7831_a2,_7832_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7830_e1,double _7831_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7832_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7830_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7831_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7832_e3.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:985:6-142
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7833_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7834_e2,
    double _7835_a3) { return mosek::fusion::p_Expr::vstack(_7833_e1,_7834_e2,_7835_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7833_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7834_e2,double _7835_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7833_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7834_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7835_a3).get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:984:6-131
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7836_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7837_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7838_e3) { return mosek::fusion::p_Expr::vstack(_7836_e1,_7837_e2,_7838_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7836_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7837_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7838_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7836_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7837_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7838_e3.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:980:6-120
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( double _7839_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7840_e2) { return mosek::fusion::p_Expr::vstack(_7839_a1,_7840_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(double _7839_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7840_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7839_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7840_e2.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:979:6-124
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7841_e1,
    double _7842_a2) { return mosek::fusion::p_Expr::vstack(_7841_e1,_7842_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7841_e1,double _7842_a2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7841_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7842_a2).get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:978:6-113
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7843_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7844_e2) { return mosek::fusion::p_Expr::vstack(_7843_e1,_7844_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(monty::rc_ptr< ::mosek::fusion::Expression > _7843_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7844_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7843_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7844_e2.get())}),(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.vstack
// Method mosek.fusion.Expr.vstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:967:6-974:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::vstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7845_exprs) { return mosek::fusion::p_Expr::vstack(_7845_exprs); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::vstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7845_exprs)
{
  if ((NULL == _7845_exprs.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Argument exprs may not be null"));
    }
  }
  {}
  int32_t _12884_ = (int)0;
  int32_t _12885_ = (int)((_7845_exprs)->size(0));
  for (int32_t _7846_i = _12884_; _7846_i < _12885_; ++_7846_i)
  {
    {
      if ((NULL == ((*_7845_exprs)(_7846_i)).get()))
      {
        {
          throw monty::NullPointerException(std::string ("Arguments for vstack may not be null"));
        }
      }
      {}
    }
  }
  return ::mosek::fusion::p_Expr::stack_(_7845_exprs,(int)0);
}
// End mosek.fusion.Expr.vstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:959:6-250
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7847_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7848_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7849_e3) { return mosek::fusion::p_Expr::hstack(_7847_e1,_7848_e2,_7849_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7847_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7848_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7849_e3)
{
  if (((NULL == _7847_e1.get()) || ((NULL == _7848_e2.get()) || (NULL == _7849_e3.get()))))
  {
    {
      throw monty::NullPointerException(std::string ("Arguments e1, e2 and e3 may not be null"));
    }
  }
  {}
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7847_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7848_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7849_e3.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:928:6-153
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7850_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7851_e2,
    double _7852_a3) { return mosek::fusion::p_Expr::hstack(_7850_e1,_7851_e2,_7852_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7850_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7851_e2,double _7852_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7850_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7851_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7852_a3).get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:927:6-153
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7853_e1,
    double _7854_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7855_e3) { return mosek::fusion::p_Expr::hstack(_7853_e1,_7854_a2,_7855_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7853_e1,double _7854_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7855_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7853_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7854_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7855_e3.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:926:6-153
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7856_e1,
    double _7857_a2,
    double _7858_a3) { return mosek::fusion::p_Expr::hstack(_7856_e1,_7857_a2,_7858_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7856_e1,double _7857_a2,double _7858_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7856_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7857_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7858_a3).get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:924:6-164
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( double _7859_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7860_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7861_e3) { return mosek::fusion::p_Expr::hstack(_7859_a1,_7860_e2,_7861_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(double _7859_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7860_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7861_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7859_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7860_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7861_e3.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:923:6-164
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( double _7862_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7863_e2,
    double _7864_a3) { return mosek::fusion::p_Expr::hstack(_7862_a1,_7863_e2,_7864_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(double _7862_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7863_e2,double _7864_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7862_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7863_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7864_a3).get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:922:6-164
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( double _7865_a1,
    double _7866_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7867_e3) { return mosek::fusion::p_Expr::hstack(_7865_a1,_7866_a2,_7867_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(double _7865_a1,double _7866_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7867_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7865_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7866_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7867_e3.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:920:6-122
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( double _7868_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7869_e2) { return mosek::fusion::p_Expr::hstack(_7868_a1,_7869_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(double _7868_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7869_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7868_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7869_e2.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:919:6-124
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7870_e1,
    double _7871_a2) { return mosek::fusion::p_Expr::hstack(_7870_e1,_7871_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7870_e1,double _7871_a2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7870_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7871_a2).get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:918:6-113
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7872_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7873_e2) { return mosek::fusion::p_Expr::hstack(_7872_e1,_7873_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(monty::rc_ptr< ::mosek::fusion::Expression > _7872_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7873_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7872_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7873_e2.get())}),(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.hstack
// Method mosek.fusion.Expr.hstack @ bld/docker-win/final/default/src/fusion/Expr.mbi:908:6-916:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::hstack
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7874_exprs) { return mosek::fusion::p_Expr::hstack(_7874_exprs); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::hstack(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7874_exprs)
{
  if ((NULL == _7874_exprs.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Argument exprs may not be null"));
    }
  }
  {}
  int32_t _12886_ = (int)0;
  int32_t _12887_ = (int)((_7874_exprs)->size(0));
  for (int32_t _7875_i = _12886_; _7875_i < _12887_; ++_7875_i)
  {
    {
      if ((NULL == ((*_7874_exprs)(_7875_i)).get()))
      {
        {
          throw monty::NullPointerException(std::string ("Arguments for hstack may not be null"));
        }
      }
      {}
    }
  }
  return ::mosek::fusion::p_Expr::stack_(_7874_exprs,(int)1);
}
// End mosek.fusion.Expr.hstack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:905:6-165
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7876_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7877_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7878_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7879_e3) { return mosek::fusion::p_Expr::stack(_7876_dim,_7877_e1,_7878_e2,_7879_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7876_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7877_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7878_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7879_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7877_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7878_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7879_e3.get())}),_7876_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:904:6-165
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7880_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7881_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7882_e2,
    double _7883_a3) { return mosek::fusion::p_Expr::stack(_7880_dim,_7881_e1,_7882_e2,_7883_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7880_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7881_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7882_e2,double _7883_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7881_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7882_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7883_a3).get())}),_7880_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:903:6-165
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7884_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7885_e1,
    double _7886_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7887_e3) { return mosek::fusion::p_Expr::stack(_7884_dim,_7885_e1,_7886_a2,_7887_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7884_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7885_e1,double _7886_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7887_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7885_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7886_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7887_e3.get())}),_7884_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:902:6-165
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7888_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7889_e1,
    double _7890_a2,
    double _7891_a3) { return mosek::fusion::p_Expr::stack(_7888_dim,_7889_e1,_7890_a2,_7891_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7888_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7889_e1,double _7890_a2,double _7891_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7889_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7890_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7891_a3).get())}),_7888_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:900:6-176
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7892_dim,
    double _7893_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7894_e2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7895_e3) { return mosek::fusion::p_Expr::stack(_7892_dim,_7893_a1,_7894_e2,_7895_e3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7892_dim,double _7893_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7894_e2,monty::rc_ptr< ::mosek::fusion::Expression > _7895_e3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7893_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7894_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7895_e3.get())}),_7892_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:899:6-176
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7896_dim,
    double _7897_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7898_e2,
    double _7899_a3) { return mosek::fusion::p_Expr::stack(_7896_dim,_7897_a1,_7898_e2,_7899_a3); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7896_dim,double _7897_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7898_e2,double _7899_a3)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7897_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7898_e2.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7899_a3).get())}),_7896_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:898:6-176
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7900_dim,
    double _7901_a1,
    double _7902_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7903_e1) { return mosek::fusion::p_Expr::stack(_7900_dim,_7901_a1,_7902_a2,_7903_e1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7900_dim,double _7901_a1,double _7902_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7903_e1)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7901_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7902_a2).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7903_e1.get())}),_7900_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:897:6-134
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7904_dim,
    double _7905_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7906_e2) { return mosek::fusion::p_Expr::stack(_7904_dim,_7905_a1,_7906_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7904_dim,double _7905_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7906_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7905_a1).get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7906_e2.get())}),_7904_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:896:6-136
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7907_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7908_e1,
    double _7909_a2) { return mosek::fusion::p_Expr::stack(_7907_dim,_7908_e1,_7909_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7907_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7908_e1,double _7909_a2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7908_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(::mosek::fusion::p_Expr::constTerm(_7909_a2).get())}),_7907_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:895:6-125
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7910_dim,
    monty::rc_ptr< ::mosek::fusion::Expression > _7911_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7912_e2) { return mosek::fusion::p_Expr::stack(_7910_dim,_7911_e1,_7912_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7910_dim,monty::rc_ptr< ::mosek::fusion::Expression > _7911_e1,monty::rc_ptr< ::mosek::fusion::Expression > _7912_e2)
{
  return ::mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >{::monty::rc_ptr<::mosek::fusion::Expression>(_7911_e1.get()),::monty::rc_ptr<::mosek::fusion::Expression>(_7912_e2.get())}),_7910_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack
// Method mosek.fusion.Expr.stack @ bld/docker-win/final/default/src/fusion/Expr.mbi:894:6-105
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::stack
  ( int32_t _7913_dim,
    std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7914_exprs) { return mosek::fusion::p_Expr::stack(_7913_dim,_7914_exprs); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack(int32_t _7913_dim,std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7914_exprs)
{
  return ::mosek::fusion::p_Expr::stack_(_7914_exprs,_7913_dim);
}
// End mosek.fusion.Expr.stack

// Begin mosek.fusion.Expr.stack_
// Method mosek.fusion.Expr.stack_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:883:6-892:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::stack_(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7915_exprs,int32_t _7916_dim)
{
  if (((int)((_7915_exprs)->size(0)) == (int)1))
  {
    {
      return ((*_7915_exprs)((int)0));
    }
  }
  else
  {
    {
      return (::mosek::fusion::p_ExprStack::_new_ExprStack(::mosek::fusion::p_Expr::promote(_7915_exprs,_7916_dim),_7916_dim)).as<::mosek::fusion::Expression>();
    }
  }
}
// End mosek.fusion.Expr.stack_

// Begin mosek.fusion.Expr.promote
// Method mosek.fusion.Expr.promote @ bld/docker-win/final/default/src/fusion/Expr.mbi:852:6-881:7
std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > mosek::fusion::p_Expr::promote(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7917_exprs,int32_t _7918_dim)
{
  int32_t _7919_n = (int)((_7917_exprs)->size(0));
  std::vector<int32_t> _12888_;
  for (int32_t _7921_i = (int)0, _12889_ = _7919_n; _7921_i < _12889_ ; ++_7921_i)
  {
    _12888_.push_back(((*_7917_exprs)(_7921_i))->getND());
  }
  auto _12890_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12888_.size()),_12888_.begin(),_12888_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7920_nds = _12890_;
  _checked_ptr_1<int32_t> _ptr__7920_nds(_7920_nds ? _7920_nds->raw() : nullptr,_7920_nds ? _7920_nds->size(0) : 0);
  int32_t _7922_maxnd = _ptr__7920_nds[(int)0];
  int32_t _7923_minnd = _ptr__7920_nds[(int)0];
  int32_t _12891_ = (int)1;
  int32_t _12892_ = _7919_n;
  for (int32_t _7924_i = _12891_; _7924_i < _12892_; ++_7924_i)
  {
    {
      if ((_ptr__7920_nds[_7924_i] < _7923_minnd))
      {
        {
          _7923_minnd = _ptr__7920_nds[_7924_i];
        }
      }
      {}
      if ((_ptr__7920_nds[_7924_i] > _7922_maxnd))
      {
        {
          _7922_maxnd = _ptr__7920_nds[_7924_i];
        }
      }
      {}
    }
  }
  if ((_7922_maxnd < _7918_dim))
  {
    {
      _7922_maxnd = _7918_dim;
    }
  }
  {}
  if ((_7923_minnd < _7922_maxnd))
  {
    {
      std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7925_rexprs = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 >(monty::shape(_7919_n)));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7926_shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7922_maxnd)));
      _checked_ptr_1<int32_t> _ptr__7926_shape(_7926_shape ? _7926_shape->raw() : nullptr,_7926_shape ? _7926_shape->size(0) : 0);
      int32_t _12893_ = (int)0;
      int32_t _12894_ = _7919_n;
      for (int32_t _7927_i = _12893_; _7927_i < _12894_; ++_7927_i)
      {
        {
          if ((((*_7917_exprs)(_7927_i))->getND() == _7922_maxnd))
          {
            {
              ((*_7925_rexprs)(_7927_i)) = ((*_7917_exprs)(_7927_i));
            }
          }
          else
          {
            {
              std::shared_ptr< monty::ndarray< int32_t,1 > > _7928_s = ((*_7917_exprs)(_7927_i))->getShape();
              _checked_ptr_1<int32_t> _ptr__7928_s(_7928_s ? _7928_s->raw() : nullptr,_7928_s ? _7928_s->size(0) : 0);
              int32_t _12895_ = (int)0;
              int32_t _12896_ = (int)((_7928_s)->size(0));
              for (int32_t _7929_j = _12895_; _7929_j < _12896_; ++_7929_j)
              {
                {
                  _ptr__7926_shape[_7929_j] = _ptr__7928_s[_7929_j];
                }
              }
              int32_t _12897_ = (int)((_7928_s)->size(0));
              int32_t _12898_ = _7922_maxnd;
              for (int32_t _7930_j = _12897_; _7930_j < _12898_; ++_7930_j)
              {
                {
                  _ptr__7926_shape[_7930_j] = (int)1;
                }
              }
              ((*_7925_rexprs)(_7927_i)) = (::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7926_shape,((*_7917_exprs)(_7927_i)))).as<::mosek::fusion::Expression>();
            }
          }
        }
      }
      return _7925_rexprs;
    }
  }
  else
  {
    {
      return _7917_exprs;
    }
  }
}
// End mosek.fusion.Expr.promote

// Begin mosek.fusion.Expr.repeat
// Method mosek.fusion.Expr.repeat @ bld/docker-win/final/default/src/fusion/Expr.mbi:847:6-849:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::repeat
  ( monty::rc_ptr< ::mosek::fusion::Variable > _7931_x,
    int32_t _7932_n,
    int32_t _7933_d) { return mosek::fusion::p_Expr::repeat(_7931_x,_7932_n,_7933_d); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::repeat(monty::rc_ptr< ::mosek::fusion::Variable > _7931_x,int32_t _7932_n,int32_t _7933_d)
{
  return ::mosek::fusion::p_Expr::repeat(_7931_x->__mosek_2fusion_2Variable__asExpr(),_7932_n,_7933_d);
}
// End mosek.fusion.Expr.repeat

// Begin mosek.fusion.Expr.repeat
// Method mosek.fusion.Expr.repeat @ bld/docker-win/final/default/src/fusion/Expr.mbi:830:6-845:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::repeat
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7934_e,
    int32_t _7935_n,
    int32_t _7936_d) { return mosek::fusion::p_Expr::repeat(_7934_e,_7935_n,_7936_d); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::repeat(monty::rc_ptr< ::mosek::fusion::Expression > _7934_e,int32_t _7935_n,int32_t _7936_d)
{
  if ((_7935_n <= (int)0))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Cannot repeat Expression 0 or less times"));
    }
  }
  {}
  if (((_7936_d < (int)0) || (_7936_d > _7934_e->getND())))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Invalid stacking dimension"));
    }
  }
  else
  {
    {
      if ((_7936_d == _7934_e->getND()))
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _7937_s = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(safe_add( _7936_d,(int)1 ))));
          _checked_ptr_1<int32_t> _ptr__7937_s(_7937_s ? _7937_s->raw() : nullptr,_7937_s ? _7937_s->size(0) : 0);
          int32_t _12899_ = (int)0;
          int32_t _12900_ = _7936_d;
          for (int32_t _7938_i = _12899_; _7938_i < _12900_; ++_7938_i)
          {
            {
              _ptr__7937_s[_7938_i] = _7934_e->getDim(_7938_i);
            }
          }
          _ptr__7937_s[_7936_d] = (int)1;
          return (::mosek::fusion::p_ExprRepeat::_new_ExprRepeat(::mosek::fusion::p_Expr::reshape(_7934_e,_7937_s),_7936_d,_7935_n)).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          return (::mosek::fusion::p_ExprRepeat::_new_ExprRepeat(_7934_e,_7936_d,_7935_n)).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
}
// End mosek.fusion.Expr.repeat

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:823:6-828:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7939_exps) { return mosek::fusion::p_Expr::add(_7939_exps); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Expression >,1 > > _7939_exps)
{
  std::vector<double> _12901_;
  for (int32_t _7940_i = (int)0, _12902_ = (int)((_7939_exps)->size(0)); _7940_i < _12902_ ; ++_7940_i)
  {
    _12901_.push_back(1.0);
  }
  auto _12903_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12901_.size()),_12901_.begin(),_12901_.end()));
  return (::mosek::fusion::p_ExprWSum::_new_ExprWSum(_7939_exps,_12903_)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:753:6-809:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _7941_vs) { return mosek::fusion::p_Expr::add(_7941_vs); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _7941_vs)
{
  if ((NULL == _7941_vs.get()))
  {
    {
      throw monty::NullPointerException(std::string ("Argument vs may not be null"));
    }
  }
  {}
  if (((int)((_7941_vs)->size(0)) == (int)0))
  {
    {
      return (::mosek::fusion::p_Expr::_new_Expr(std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >{(int64_t)((int)0)}),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0))),nullptr,::mosek::fusion::p_Set::make((int)0),std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)0))),(int)1)).as<::mosek::fusion::Expression>();
    }
  }
  {}
  if ((((int)((_7941_vs)->size(0)) > (int)0) && (NULL == ((*_7941_vs)((int)0)).get())))
  {
    {
      throw monty::NullPointerException(std::string ("Argument vs may contain null"));
    }
  }
  {}
  int32_t _7942_nd = ((*_7941_vs)((int)0))->getND();
  int32_t _12904_ = (int)1;
  int32_t _12905_ = (int)((_7941_vs)->size(0));
  for (int32_t _7943_i = _12904_; _7943_i < _12905_; ++_7943_i)
  {
    {
      if ((_7942_nd < ((*_7941_vs)(_7943_i))->getND()))
      {
        {
          _7942_nd = ((*_7941_vs)(_7943_i))->getND();
        }
      }
      {}
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,2 > > _7944_shapes = std::shared_ptr< monty::ndarray< int32_t,2 > >(new monty::ndarray< int32_t,2 >(monty::shape((int)((_7941_vs)->size(0)),_7942_nd)));
  int32_t _12906_ = (int)0;
  int32_t _12907_ = (int)((_7941_vs)->size(0));
  for (int32_t _7945_i = _12906_; _7945_i < _12907_; ++_7945_i)
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7946_shp = ((*_7941_vs)(_7945_i))->getShape();
      _checked_ptr_1<int32_t> _ptr__7946_shp(_7946_shp ? _7946_shp->raw() : nullptr,_7946_shp ? _7946_shp->size(0) : 0);
      int32_t _12908_ = (int)0;
      int32_t _12909_ = (int)((_7946_shp)->size(0));
      for (int32_t _7947_j = _12908_; _7947_j < _12909_; ++_7947_j)
      {
        {
          ((*_7944_shapes)(_7945_i,_7947_j)) = _ptr__7946_shp[_7947_j];
        }
      }
      int32_t _12910_ = (int)((_7946_shp)->size(0));
      int32_t _12911_ = _7942_nd;
      for (int32_t _7948_j = _12910_; _7948_j < _12911_; ++_7948_j)
      {
        {
          ((*_7944_shapes)(_7945_i,_7948_j)) = (int)1;
        }
      }
    }
  }
  int32_t _12912_ = (int)1;
  int32_t _12913_ = (int)((_7941_vs)->size(0));
  for (int32_t _7949_i = _12912_; _7949_i < _12913_; ++_7949_i)
  {
    {
      int32_t _12914_ = (int)0;
      int32_t _12915_ = _7942_nd;
      for (int32_t _7950_j = _12914_; _7950_j < _12915_; ++_7950_j)
      {
        {
          if ((((*_7944_shapes)((int)0,_7950_j)) != ((*_7944_shapes)(_7949_i,_7950_j))))
          {
            {
              throw ::mosek::fusion::DimensionError(std::string ("Mismatching operand dimensions"));
            }
          }
          {}
        }
      }
    }
  }
  std::vector<int32_t> _12916_;
  for (int32_t _7952_j = (int)0, _12917_ = _7942_nd; _7952_j < _12917_ ; ++_7952_j)
  {
    _12916_.push_back(((*_7944_shapes)((int)0,_7952_j)));
  }
  auto _12918_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12916_.size()),_12916_.begin(),_12916_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _7951_shape = _12918_;
  _checked_ptr_1<int32_t> _ptr__7951_shape(_7951_shape ? _7951_shape->raw() : nullptr,_7951_shape ? _7951_shape->size(0) : 0);
  int32_t _7953_sz = (int)1;
  int32_t _12919_ = (int)0;
  int32_t _12920_ = _7942_nd;
  for (int32_t _7954_i = _12919_; _7954_i < _12920_; ++_7954_i)
  {
    {
      _7953_sz *= _ptr__7951_shape[_7954_i];
    }
  }
  int32_t _7955_nnz = (int)0;
  int32_t _7956_maxnnz = (int)0;
  int32_t _12921_ = (int)0;
  int32_t _12922_ = (int)((_7941_vs)->size(0));
  for (int32_t _7957_i = _12921_; _7957_i < _12922_; ++_7957_i)
  {
    {
      int32_t _7958_n = ((*_7941_vs)(_7957_i))->numInst();
      _7955_nnz += _7958_n;
      int32_t _12923_;
      bool _12924_ = (_7956_maxnnz > _7958_n);
      if (_12924_)
      {
        _12923_ = _7956_maxnnz;
      }
      else
      {
        _12923_ = _7958_n;
      }
      _7956_maxnnz = _12923_;
    }
  }
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7959_ptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( _7953_sz,(int)1 ))));
  _checked_ptr_1<int64_t> _ptr__7959_ptrb(_7959_ptrb ? _7959_ptrb->raw() : nullptr,_7959_ptrb ? _7959_ptrb->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _7960_subj = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7955_nnz)));
  _checked_ptr_1<int64_t> _ptr__7960_subj(_7960_subj ? _7960_subj->raw() : nullptr,_7960_subj ? _7960_subj->size(0) : 0);
  std::vector<double> _12925_;
  for (int32_t _7962_i = (int)0, _12926_ = _7955_nnz; _7962_i < _12926_ ; ++_7962_i)
  {
    _12925_.push_back(1.0);
  }
  auto _12927_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12925_.size()),_12925_.begin(),_12925_.end()));
  std::shared_ptr< monty::ndarray< double,1 > > _7961_cof = _12927_;
  _checked_ptr_1<double> _ptr__7961_cof(_7961_cof ? _7961_cof->raw() : nullptr,_7961_cof ? _7961_cof->size(0) : 0);
  {
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7963_ii = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7956_maxnnz)));
    _checked_ptr_1<int64_t> _ptr__7963_ii(_7963_ii ? _7963_ii->raw() : nullptr,_7963_ii ? _7963_ii->size(0) : 0);
    std::shared_ptr< monty::ndarray< int64_t,1 > > _7964_idxs = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_7956_maxnnz)));
    _checked_ptr_1<int64_t> _ptr__7964_idxs(_7964_idxs ? _7964_idxs->raw() : nullptr,_7964_idxs ? _7964_idxs->size(0) : 0);
    int32_t _12928_ = (int)0;
    int32_t _12929_ = (int)((_7941_vs)->size(0));
    for (int32_t _7965_i = _12928_; _7965_i < _12929_; ++_7965_i)
    {
      {
        int32_t _7966_n = ((*_7941_vs)(_7965_i))->inst((int)0,_7963_ii,(int)0,_7964_idxs);
        int32_t _12930_ = (int)0;
        int32_t _12931_ = _7966_n;
        for (int32_t _7967_j = _12930_; _7967_j < _12931_; ++_7967_j)
        {
          {
            _ptr__7959_ptrb[safe_add( _ptr__7963_ii[_7967_j],(int)1 )] += (int)1;
          }
        }
      }
    }
    int32_t _12932_ = (int)0;
    int32_t _12933_ = _7953_sz;
    for (int32_t _7968_i = _12932_; _7968_i < _12933_; ++_7968_i)
    {
      {
        _ptr__7959_ptrb[safe_add( _7968_i,(int)1 )] += _ptr__7959_ptrb[_7968_i];
      }
    }
    int32_t _12934_ = (int)0;
    int32_t _12935_ = (int)((_7941_vs)->size(0));
    for (int32_t _7969_i = _12934_; _7969_i < _12935_; ++_7969_i)
    {
      {
        int32_t _7970_n = ((*_7941_vs)(_7969_i))->inst((int)0,_7963_ii,(int)0,_7964_idxs);
        int32_t _12936_ = (int)0;
        int32_t _12937_ = _7970_n;
        for (int32_t _7971_j = _12936_; _7971_j < _12937_; ++_7971_j)
        {
          {
            _ptr__7960_subj[_ptr__7959_ptrb[_ptr__7963_ii[_7971_j]]] = _ptr__7964_idxs[_7971_j];
            ++ _ptr__7959_ptrb[_ptr__7963_ii[_7971_j]];
          }
        }
      }
    }
    int32_t _12938_ = (int)0;
    int32_t _12939_ = _7953_sz;
    for (int32_t _7972_i = _12938_; _7972_i < _12939_; ++_7972_i)
    {
      {
        _ptr__7959_ptrb[(_7953_sz - _7972_i)] = _ptr__7959_ptrb[((_7953_sz - _7972_i) - (int)1)];
      }
    }
    _ptr__7959_ptrb[(int)0] = (int)0;
  }
  std::vector<double> _12940_;
  for (int32_t _7973_i = (int)0, _12941_ = _7953_sz; _7973_i < _12941_ ; ++_7973_i)
  {
    _12940_.push_back(0.0);
  }
  auto _12942_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12940_.size()),_12940_.begin(),_12940_.end()));
  return (::mosek::fusion::p_Expr::_new_Expr(_7959_ptrb,_7960_subj,_7961_cof,_12942_,_7951_shape,nullptr,(int)1)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add_
// Method mosek.fusion.Expr.add_ @ bld/docker-win/final/default/src/fusion/Expr.mbi:710:6-737:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add_(monty::rc_ptr< ::mosek::fusion::Expression > _7974_e1,double _7975_m1,monty::rc_ptr< ::mosek::fusion::Expression > _7976_e2,double _7977_m2)
{
  int32_t _7978_nd1 = _7974_e1->getND();
  int32_t _7979_nd2 = _7976_e2->getND();
  if ((_7978_nd1 == _7979_nd2))
  {
    {
      return (::mosek::fusion::p_ExprAdd::_new_ExprAdd(_7974_e1,_7976_e2,_7975_m1,_7977_m2)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      int32_t _12943_;
      bool _12944_ = (_7978_nd1 > _7979_nd2);
      if (_12944_)
      {
        _12943_ = _7978_nd1;
      }
      else
      {
        _12943_ = _7979_nd2;
      }
      int32_t _7980_nd = _12943_;
      std::shared_ptr< monty::ndarray< int32_t,1 > > _7981_shape = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_7980_nd)));
      _checked_ptr_1<int32_t> _ptr__7981_shape(_7981_shape ? _7981_shape->raw() : nullptr,_7981_shape ? _7981_shape->size(0) : 0);
      if ((_7978_nd1 < _7979_nd2))
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _7982_sh = _7974_e1->getShape();
          _checked_ptr_1<int32_t> _ptr__7982_sh(_7982_sh ? _7982_sh->raw() : nullptr,_7982_sh ? _7982_sh->size(0) : 0);
          int32_t _12945_ = (int)0;
          int32_t _12946_ = _7978_nd1;
          for (int32_t _7983_i = _12945_; _7983_i < _12946_; ++_7983_i)
          {
            {
              _ptr__7981_shape[_7983_i] = _ptr__7982_sh[_7983_i];
            }
          }
          int32_t _12947_ = _7978_nd1;
          int32_t _12948_ = _7980_nd;
          for (int32_t _7984_i = _12947_; _7984_i < _12948_; ++_7984_i)
          {
            {
              _ptr__7981_shape[_7984_i] = (int)1;
            }
          }
          return (::mosek::fusion::p_ExprAdd::_new_ExprAdd((::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7981_shape,_7974_e1)).as<::mosek::fusion::Expression>(),_7976_e2,_7975_m1,_7977_m2)).as<::mosek::fusion::Expression>();
        }
      }
      else
      {
        {
          std::shared_ptr< monty::ndarray< int32_t,1 > > _7985_sh = _7976_e2->getShape();
          _checked_ptr_1<int32_t> _ptr__7985_sh(_7985_sh ? _7985_sh->raw() : nullptr,_7985_sh ? _7985_sh->size(0) : 0);
          int32_t _12949_ = (int)0;
          int32_t _12950_ = _7979_nd2;
          for (int32_t _7986_i = _12949_; _7986_i < _12950_; ++_7986_i)
          {
            {
              _ptr__7981_shape[_7986_i] = _ptr__7985_sh[_7986_i];
            }
          }
          int32_t _12951_ = _7979_nd2;
          int32_t _12952_ = _7980_nd;
          for (int32_t _7987_i = _12951_; _7987_i < _12952_; ++_7987_i)
          {
            {
              _ptr__7981_shape[_7987_i] = (int)1;
            }
          }
          return (::mosek::fusion::p_ExprAdd::_new_ExprAdd(_7974_e1,(::mosek::fusion::p_ExprReshape::_new_ExprReshape(_7981_shape,_7976_e2)).as<::mosek::fusion::Expression>(),_7975_m1,_7977_m2)).as<::mosek::fusion::Expression>();
        }
      }
    }
  }
}
// End mosek.fusion.Expr.add_

// Begin mosek.fusion.Expr.transpose
// Method mosek.fusion.Expr.transpose @ bld/docker-win/final/default/src/fusion/Expr.mbi:699:6-708:7
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::transpose
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7988_e) { return mosek::fusion::p_Expr::transpose(_7988_e); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::transpose(monty::rc_ptr< ::mosek::fusion::Expression > _7988_e)
{
  if ((_7988_e->getND() == (int)0))
  {
    {
      return _7988_e;
    }
  }
  else if((_7988_e->getND() == (int)1))
  {
    {
      return (::mosek::fusion::p_ExprReshape::_new_ExprReshape(std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)((int)1),(int32_t)(_7988_e->getDim((int)0))}),_7988_e)).as<::mosek::fusion::Expression>();
    }
  }
  else if((_7988_e->getND() == (int)2))
  {
    {
      return (::mosek::fusion::p_ExprTranspose::_new_ExprTranspose(_7988_e)).as<::mosek::fusion::Expression>();
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Incorrect number of dimensions for transpose"));
    }
  }
}
// End mosek.fusion.Expr.transpose

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:694:6-114
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _7989_m,
    monty::rc_ptr< ::mosek::fusion::Expression > _7990_expr) { return mosek::fusion::p_Expr::mulElm(_7989_m,_7990_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Matrix > _7989_m,monty::rc_ptr< ::mosek::fusion::Expression > _7990_expr)
{
  return ::mosek::fusion::p_Expr::mulElm_(_7989_m,_7990_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:693:6-116
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7991_spm,
    monty::rc_ptr< ::mosek::fusion::Expression > _7992_expr) { return mosek::fusion::p_Expr::mulElm(_7991_spm,_7992_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _7991_spm,monty::rc_ptr< ::mosek::fusion::Expression > _7992_expr)
{
  return ::mosek::fusion::p_Expr::mulElm_(_7991_spm,_7992_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:692:6-129
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( std::shared_ptr< monty::ndarray< double,2 > > _7993_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _7994_expr) { return mosek::fusion::p_Expr::mulElm(_7993_a2,_7994_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(std::shared_ptr< monty::ndarray< double,2 > > _7993_a2,monty::rc_ptr< ::mosek::fusion::Expression > _7994_expr)
{
  return ::mosek::fusion::p_Expr::mulElm_(::mosek::fusion::p_Matrix::dense(_7993_a2),_7994_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:691:6-115
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( std::shared_ptr< monty::ndarray< double,1 > > _7995_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _7996_expr) { return mosek::fusion::p_Expr::mulElm(_7995_a1,_7996_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(std::shared_ptr< monty::ndarray< double,1 > > _7995_a1,monty::rc_ptr< ::mosek::fusion::Expression > _7996_expr)
{
  _checked_ptr_1<double> _ptr__7995_a1(_7995_a1 ? _7995_a1->raw() : nullptr, _7995_a1 ? _7995_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::mulElm_(_7995_a1,_7996_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:690:6-114
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7997_expr,
    monty::rc_ptr< ::mosek::fusion::Matrix > _7998_m) { return mosek::fusion::p_Expr::mulElm(_7997_expr,_7998_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Expression > _7997_expr,monty::rc_ptr< ::mosek::fusion::Matrix > _7998_m)
{
  return ::mosek::fusion::p_Expr::mulElm_(_7998_m,_7997_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:689:6-129
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Expression > _7999_expr,
    std::shared_ptr< monty::ndarray< double,2 > > _8000_a2) { return mosek::fusion::p_Expr::mulElm(_7999_expr,_8000_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Expression > _7999_expr,std::shared_ptr< monty::ndarray< double,2 > > _8000_a2)
{
  return ::mosek::fusion::p_Expr::mulElm_(::mosek::fusion::p_Matrix::dense(_8000_a2),_7999_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:688:6-115
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8001_expr,
    std::shared_ptr< monty::ndarray< double,1 > > _8002_a1) { return mosek::fusion::p_Expr::mulElm(_8001_expr,_8002_a1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Expression > _8001_expr,std::shared_ptr< monty::ndarray< double,1 > > _8002_a1)
{
  _checked_ptr_1<double> _ptr__8002_a1(_8002_a1 ? _8002_a1->raw() : nullptr, _8002_a1 ? _8002_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::mulElm_(_8002_a1,_8001_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:687:6-116
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8003_expr,
    monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8004_spm) { return mosek::fusion::p_Expr::mulElm(_8003_expr,_8004_spm); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Expression > _8003_expr,monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8004_spm)
{
  return ::mosek::fusion::p_Expr::mulElm_(_8004_spm,_8003_expr);
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:686:6-127
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Parameter > _8005_p,
    monty::rc_ptr< ::mosek::fusion::Expression > _8006_expr) { return mosek::fusion::p_Expr::mulElm(_8005_p,_8006_expr); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Parameter > _8005_p,monty::rc_ptr< ::mosek::fusion::Expression > _8006_expr)
{
  return (::mosek::fusion::p_ExprMulParamElem::_new_ExprMulParamElem(_8005_p,_8006_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.mulElm
// Method mosek.fusion.Expr.mulElm @ bld/docker-win/final/default/src/fusion/Expr.mbi:685:6-127
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::mulElm
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8007_expr,
    monty::rc_ptr< ::mosek::fusion::Parameter > _8008_p) { return mosek::fusion::p_Expr::mulElm(_8007_expr,_8008_p); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::mulElm(monty::rc_ptr< ::mosek::fusion::Expression > _8007_expr,monty::rc_ptr< ::mosek::fusion::Parameter > _8008_p)
{
  return (::mosek::fusion::p_ExprMulParamElem::_new_ExprMulParamElem(_8008_p,_8007_expr)).as<::mosek::fusion::Expression>();
}
// End mosek.fusion.Expr.mulElm

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:683:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8009_n,
    monty::rc_ptr< ::mosek::fusion::Expression > _8010_e2) { return mosek::fusion::p_Expr::sub(_8009_n,_8010_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8009_n,monty::rc_ptr< ::mosek::fusion::Expression > _8010_e2)
{
  return ::mosek::fusion::p_Expr::add_(::mosek::fusion::p_Expr::constTerm(_8009_n),1.0,_8010_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:682:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8011_e1,
    monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8012_n) { return mosek::fusion::p_Expr::sub(_8011_e1,_8012_n); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8011_e1,monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8012_n)
{
  return ::mosek::fusion::p_Expr::add_(_8011_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8012_n),(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:681:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _8013_m,
    monty::rc_ptr< ::mosek::fusion::Expression > _8014_e2) { return mosek::fusion::p_Expr::sub(_8013_m,_8014_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Matrix > _8013_m,monty::rc_ptr< ::mosek::fusion::Expression > _8014_e2)
{
  return ::mosek::fusion::p_Expr::add_(::mosek::fusion::p_Expr::constTerm(_8013_m),1.0,_8014_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:680:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8015_e1,
    monty::rc_ptr< ::mosek::fusion::Matrix > _8016_m) { return mosek::fusion::p_Expr::sub(_8015_e1,_8016_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8015_e1,monty::rc_ptr< ::mosek::fusion::Matrix > _8016_m)
{
  return ::mosek::fusion::p_Expr::add_(_8015_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8016_m),(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:679:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( double _8017_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _8018_e2) { return mosek::fusion::p_Expr::sub(_8017_c,_8018_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(double _8017_c,monty::rc_ptr< ::mosek::fusion::Expression > _8018_e2)
{
  return ::mosek::fusion::p_Expr::add_(::mosek::fusion::p_Expr::constTerm(_8018_e2->getShape(),_8017_c),1.0,_8018_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:678:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8019_e1,
    double _8020_c) { return mosek::fusion::p_Expr::sub(_8019_e1,_8020_c); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8019_e1,double _8020_c)
{
  return ::mosek::fusion::p_Expr::add_(_8019_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8019_e1->getShape(),_8020_c),(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:677:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( std::shared_ptr< monty::ndarray< double,2 > > _8021_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _8022_e2) { return mosek::fusion::p_Expr::sub(_8021_a2,_8022_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(std::shared_ptr< monty::ndarray< double,2 > > _8021_a2,monty::rc_ptr< ::mosek::fusion::Expression > _8022_e2)
{
  return ::mosek::fusion::p_Expr::add_(::mosek::fusion::p_Expr::constTerm(_8021_a2),1.0,_8022_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:676:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( std::shared_ptr< monty::ndarray< double,1 > > _8023_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _8024_e2) { return mosek::fusion::p_Expr::sub(_8023_a1,_8024_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(std::shared_ptr< monty::ndarray< double,1 > > _8023_a1,monty::rc_ptr< ::mosek::fusion::Expression > _8024_e2)
{
  _checked_ptr_1<double> _ptr__8023_a1(_8023_a1 ? _8023_a1->raw() : nullptr, _8023_a1 ? _8023_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::add_(::mosek::fusion::p_Expr::constTerm(_8023_a1),1.0,_8024_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:675:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8025_e1,
    std::shared_ptr< monty::ndarray< double,2 > > _8026_a2) { return mosek::fusion::p_Expr::sub(_8025_e1,_8026_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8025_e1,std::shared_ptr< monty::ndarray< double,2 > > _8026_a2)
{
  return ::mosek::fusion::p_Expr::add_(_8025_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8026_a2),(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:674:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8027_e1,
    std::shared_ptr< monty::ndarray< double,1 > > _8028_a1) { return mosek::fusion::p_Expr::sub(_8027_e1,_8028_a1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8027_e1,std::shared_ptr< monty::ndarray< double,1 > > _8028_a1)
{
  _checked_ptr_1<double> _ptr__8028_a1(_8028_a1 ? _8028_a1->raw() : nullptr, _8028_a1 ? _8028_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::add_(_8027_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8028_a1),(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.sub
// Method mosek.fusion.Expr.sub @ bld/docker-win/final/default/src/fusion/Expr.mbi:673:6-167
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::sub
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8029_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _8030_e2) { return mosek::fusion::p_Expr::sub(_8029_e1,_8030_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::sub(monty::rc_ptr< ::mosek::fusion::Expression > _8029_e1,monty::rc_ptr< ::mosek::fusion::Expression > _8030_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8029_e1,1.0,_8030_e2,(-1.0));
}
// End mosek.fusion.Expr.sub

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:669:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8031_n,
    monty::rc_ptr< ::mosek::fusion::Expression > _8032_e2) { return mosek::fusion::p_Expr::add(_8031_n,_8032_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8031_n,monty::rc_ptr< ::mosek::fusion::Expression > _8032_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8032_e2,1.0,::mosek::fusion::p_Expr::constTerm(_8031_n),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:668:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8033_e1,
    monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8034_n) { return mosek::fusion::p_Expr::add(_8033_e1,_8034_n); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8033_e1,monty::rc_ptr< ::mosek::fusion::NDSparseArray > _8034_n)
{
  return ::mosek::fusion::p_Expr::add_(_8033_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8034_n),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:667:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _8035_m,
    monty::rc_ptr< ::mosek::fusion::Expression > _8036_e2) { return mosek::fusion::p_Expr::add(_8035_m,_8036_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Matrix > _8035_m,monty::rc_ptr< ::mosek::fusion::Expression > _8036_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8036_e2,1.0,::mosek::fusion::p_Expr::constTerm(_8035_m),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:666:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8037_e1,
    monty::rc_ptr< ::mosek::fusion::Matrix > _8038_m) { return mosek::fusion::p_Expr::add(_8037_e1,_8038_m); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8037_e1,monty::rc_ptr< ::mosek::fusion::Matrix > _8038_m)
{
  return ::mosek::fusion::p_Expr::add_(_8037_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8038_m),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:665:6-169
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( double _8039_c,
    monty::rc_ptr< ::mosek::fusion::Expression > _8040_e2) { return mosek::fusion::p_Expr::add(_8039_c,_8040_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(double _8039_c,monty::rc_ptr< ::mosek::fusion::Expression > _8040_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8040_e2,1.0,::mosek::fusion::p_Expr::constTerm(_8040_e2->getShape(),_8039_c),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:664:6-169
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8041_e1,
    double _8042_c) { return mosek::fusion::p_Expr::add(_8041_e1,_8042_c); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8041_e1,double _8042_c)
{
  return ::mosek::fusion::p_Expr::add_(_8041_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8041_e1->getShape(),_8042_c),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:663:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( std::shared_ptr< monty::ndarray< double,2 > > _8043_a2,
    monty::rc_ptr< ::mosek::fusion::Expression > _8044_e2) { return mosek::fusion::p_Expr::add(_8043_a2,_8044_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(std::shared_ptr< monty::ndarray< double,2 > > _8043_a2,monty::rc_ptr< ::mosek::fusion::Expression > _8044_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8044_e2,1.0,::mosek::fusion::p_Expr::constTerm(_8043_a2),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:662:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( std::shared_ptr< monty::ndarray< double,1 > > _8045_a1,
    monty::rc_ptr< ::mosek::fusion::Expression > _8046_e2) { return mosek::fusion::p_Expr::add(_8045_a1,_8046_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(std::shared_ptr< monty::ndarray< double,1 > > _8045_a1,monty::rc_ptr< ::mosek::fusion::Expression > _8046_e2)
{
  _checked_ptr_1<double> _ptr__8045_a1(_8045_a1 ? _8045_a1->raw() : nullptr, _8045_a1 ? _8045_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::add_(_8046_e2,1.0,::mosek::fusion::p_Expr::constTerm(_8045_a1),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:661:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8047_e1,
    std::shared_ptr< monty::ndarray< double,2 > > _8048_a2) { return mosek::fusion::p_Expr::add(_8047_e1,_8048_a2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8047_e1,std::shared_ptr< monty::ndarray< double,2 > > _8048_a2)
{
  return ::mosek::fusion::p_Expr::add_(_8047_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8048_a2),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:660:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8049_e1,
    std::shared_ptr< monty::ndarray< double,1 > > _8050_a1) { return mosek::fusion::p_Expr::add(_8049_e1,_8050_a1); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8049_e1,std::shared_ptr< monty::ndarray< double,1 > > _8050_a1)
{
  _checked_ptr_1<double> _ptr__8050_a1(_8050_a1 ? _8050_a1->raw() : nullptr, _8050_a1 ? _8050_a1->size(0) : 0);
  return ::mosek::fusion::p_Expr::add_(_8049_e1,1.0,::mosek::fusion::p_Expr::constTerm(_8050_a1),1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.add
// Method mosek.fusion.Expr.add @ bld/docker-win/final/default/src/fusion/Expr.mbi:659:6-166
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::Expr::add
  ( monty::rc_ptr< ::mosek::fusion::Expression > _8051_e1,
    monty::rc_ptr< ::mosek::fusion::Expression > _8052_e2) { return mosek::fusion::p_Expr::add(_8051_e1,_8052_e2); }
monty::rc_ptr< ::mosek::fusion::Expression > mosek::fusion::p_Expr::add(monty::rc_ptr< ::mosek::fusion::Expression > _8051_e1,monty::rc_ptr< ::mosek::fusion::Expression > _8052_e2)
{
  return ::mosek::fusion::p_Expr::add_(_8051_e1,1.0,_8052_e2,1.0);
}
// End mosek.fusion.Expr.add

// Begin mosek.fusion.Expr.eval
// Method mosek.fusion.Expr.eval @ bld/docker-win/final/default/src/fusion/Expr.mbi:619:6-652:7
void mosek::fusion::Expr :: eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _8053_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _8054_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _8055_xs) { mosek::fusion::p_Expr::_get_impl(this)->eval(_8053_rs,_8054_ws,_8055_xs); }
void mosek::fusion::p_Expr::eval(monty::rc_ptr< ::mosek::fusion::WorkStack > _8053_rs,monty::rc_ptr< ::mosek::fusion::WorkStack > _8054_ws,monty::rc_ptr< ::mosek::fusion::WorkStack > _8055_xs)
{
  int32_t _8056_nelem = ((int)((ptrb)->size(0)) - (int)1);
  int32_t _8057_nnz = safe_add( (int32_t)((*ptrb)(_8056_nelem)),_8056_nelem );
  int32_t _8058_nd = (int)((shape)->size(0));
  _8053_rs->alloc_expr(_8058_nd,_8056_nelem,_8057_nnz,(NULL != inst.get()));
  int32_t _8059_ptr_base = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->ptr_base;
  int32_t _8060_nidxs_base = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->nidxs_base;
  int32_t _8061_sp_base = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->sp_base;
  int32_t _8062_cof_base = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->cof_base;
  int32_t _8063_shape_base = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->shape_base;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8064_i32 = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->i32;
  _checked_ptr_1<int32_t> _ptr__8064_i32(_8064_i32 ? _8064_i32->raw() : nullptr,_8064_i32 ? _8064_i32->size(0) : 0);
  std::shared_ptr< monty::ndarray< int64_t,1 > > _8065_i64 = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->i64;
  _checked_ptr_1<int64_t> _ptr__8065_i64(_8065_i64 ? _8065_i64->raw() : nullptr,_8065_i64 ? _8065_i64->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _8066_f64 = mosek::fusion::p_WorkStack::_get_impl(_8053_rs)->f64;
  _checked_ptr_1<double> _ptr__8066_f64(_8066_f64 ? _8066_f64->raw() : nullptr,_8066_f64 ? _8066_f64->size(0) : 0);
  {
    int32_t _12953_ = (int)0;
    int32_t _12954_ = _8058_nd;
    for (int32_t _8067_i = _12953_; _8067_i < _12954_; ++_8067_i)
    {
      {
        _ptr__8064_i32[safe_add( _8063_shape_base,_8067_i )] = ((*shape)(_8067_i));
      }
    }
    _ptr__8064_i32[_8059_ptr_base] = (int)0;
    int32_t _8068_p = (int)0;
    int32_t _12955_ = (int)0;
    int32_t _12956_ = _8056_nelem;
    for (int32_t _8069_i = _12955_; _8069_i < _12956_; ++_8069_i)
    {
      {
        int64_t _12957_ = ((*ptrb)(_8069_i));
        int64_t _12958_ = ((*ptrb)(safe_add( _8069_i,(int)1 )));
        for (int64_t _8070_j = _12957_; _8070_j < _12958_; ++_8070_j)
        {
          {
            _ptr__8065_i64[safe_add( _8060_nidxs_base,_8068_p )] = ((*subj)(_8070_j));
            _ptr__8066_f64[safe_add( _8062_cof_base,_8068_p )] = ((*cof_v)(_8070_j));
            ++ _8068_p;
          }
        }
        _ptr__8065_i64[safe_add( _8060_nidxs_base,_8068_p )] = (int)0;
        _ptr__8066_f64[safe_add( _8062_cof_base,_8068_p )] = ((*bfix)(_8069_i));
        ++ _8068_p;
        _ptr__8064_i32[safe_add( safe_add( _8059_ptr_base,_8069_i ),(int)1 )] = _8068_p;
      }
    }
  }
}
// End mosek.fusion.Expr.eval

// Begin mosek.fusion.Expr.validateData
// Method mosek.fusion.Expr.validateData @ bld/docker-win/final/default/src/fusion/Expr.mbi:443:6-505:7
void mosek::fusion::p_Expr::validateData(std::shared_ptr< monty::ndarray< int64_t,1 > > _8071_ptrb,std::shared_ptr< monty::ndarray< int64_t,1 > > _8072_subj,std::shared_ptr< monty::ndarray< double,1 > > _8073_cof,std::shared_ptr< monty::ndarray< double,1 > > _8074_bfix,std::shared_ptr< monty::ndarray< int32_t,1 > > _8075_shape,std::shared_ptr< monty::ndarray< int64_t,1 > > _8076_inst)
{
  _checked_ptr_1<int64_t> _ptr__8071_ptrb(_8071_ptrb ? _8071_ptrb->raw() : nullptr, _8071_ptrb ? _8071_ptrb->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__8072_subj(_8072_subj ? _8072_subj->raw() : nullptr, _8072_subj ? _8072_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__8073_cof(_8073_cof ? _8073_cof->raw() : nullptr, _8073_cof ? _8073_cof->size(0) : 0);
  _checked_ptr_1<double> _ptr__8074_bfix(_8074_bfix ? _8074_bfix->raw() : nullptr, _8074_bfix ? _8074_bfix->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8075_shape(_8075_shape ? _8075_shape->raw() : nullptr, _8075_shape ? _8075_shape->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__8076_inst(_8076_inst ? _8076_inst->raw() : nullptr, _8076_inst ? _8076_inst->size(0) : 0);
  if ((NULL == _8075_shape.get()))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Array 'shape' in expression is null"));
    }
  }
  {}
  int32_t _8077_exprnume = ((int)((_8071_ptrb)->size(0)) - (int)1);
  int64_t _8078_numelm = _ptr__8071_ptrb[((int)((_8071_ptrb)->size(0)) - (int)1)];
  int32_t _8079_nd = (int)((_8075_shape)->size(0));
  int64_t _8080_size = (int64_t)1;
  int32_t _12959_ = (int)0;
  int32_t _12960_ = _8079_nd;
  for (int32_t _8081_i = _12959_; _8081_i < _12960_; ++_8081_i)
  {
    {
      _8080_size *= _ptr__8075_shape[_8081_i];
    }
  }
  if (((int)((_8071_ptrb)->size(0)) < (int)1))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Array 'ptrb' in expression has wrong size"));
    }
  }
  {}
  if ((_8078_numelm != (int)((_8072_subj)->size(0))))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Array 'subj' in expression has wrong size"));
    }
  }
  {}
  if ((_8078_numelm != (int)((_8073_cof)->size(0))))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Array 'cof' in expression has wrong size"));
    }
  }
  {}
  if (((NULL == _8074_bfix.get()) || (_8077_exprnume != (int)((_8074_bfix)->size(0)))))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Array 'bfix' in expression has wrong length"));
    }
  }
  {}
  if (((NULL != _8076_inst.get()) && ((int)((_8076_inst)->size(0)) < _8080_size)))
  {
    {
      if (((int)((_8076_inst)->size(0)) != ((int)((_8071_ptrb)->size(0)) - (int)1)))
      {
        {
          throw ::mosek::fusion::ExpressionError(std::string ("Array 'inst' in expression has wrong length"));
        }
      }
      {}
      if (((int)((_8076_inst)->size(0)) > (int)0))
      {
        {
          if (((_ptr__8076_inst[(int)0] < (int)0) || (_ptr__8076_inst[(int)0] >= _8080_size)))
          {
            {
              throw ::mosek::fusion::ExpressionError(std::string ("Array 'inst' contains an invalid index"));
            }
          }
          {}
          bool _8082_sorted_in_range = true;
          int64_t _8083_tot_size = _8080_size;
          int32_t _12961_ = (int)1;
          int32_t _12962_ = (int)((_8076_inst)->size(0));
          for (int32_t _8084_i = _12961_; _8084_i < _12962_; ++_8084_i)
          {
            {
              _8082_sorted_in_range = (_8082_sorted_in_range && ((_ptr__8076_inst[_8084_i] >= (int)0) && ((_ptr__8076_inst[_8084_i] < _8083_tot_size) && (_ptr__8076_inst[_8084_i] > _ptr__8076_inst[(_8084_i - (int)1)]))));
            }
          }
          if ((!_8082_sorted_in_range))
          {
            {
              throw ::mosek::fusion::ExpressionError(std::string ("Invalid array 'inst'"));
            }
          }
          {}
        }
      }
      {}
    }
  }
  else
  {
    {
      if ((_8080_size != ((int64_t)((_8071_ptrb)->size(0)) - (int)1)))
      {
        {
          throw ::mosek::fusion::ExpressionError(std::string ("Array 'ptrb' in expression has wrong length"));
        }
      }
      {}
    }
  }
  bool _8085_invalid_ptrb = false;
  bool _8086_invalid_subj = false;
  if ((_ptr__8071_ptrb[(int)0] != (int64_t)0))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Invalid 'ptrb' argument in expression"));
    }
  }
  {}
  bool _8087_ptrb_sorted = true;
  int32_t _12963_ = (int)0;
  int32_t _12964_ = _8077_exprnume;
  for (int32_t _8088_i = _12963_; _8088_i < _12964_; ++_8088_i)
  {
    {
      _8087_ptrb_sorted = (_8087_ptrb_sorted && (_ptr__8071_ptrb[_8088_i] <= _ptr__8071_ptrb[safe_add( _8088_i,(int)1 )]));
    }
  }
  if ((!_8087_ptrb_sorted))
  {
    {
      throw ::mosek::fusion::ExpressionError(std::string ("Invalid 'ptrb' argument in expression"));
    }
  }
  {}
}
// End mosek.fusion.Expr.validateData

// Begin mosek.fusion.Expr.extractModel
// Method mosek.fusion.Expr.extractModel @ bld/docker-win/final/default/src/fusion/Expr.mbi:442:6-128
monty::rc_ptr< ::mosek::fusion::Model > mosek::fusion::p_Expr::extractModel(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Variable >,1 > > _8089_v)
{
  monty::rc_ptr< ::mosek::fusion::Model > _12965_;
  bool _12966_ = ((NULL == _8089_v.get()) || ((int)((_8089_v)->size(0)) == (int)0));
  if (_12966_)
  {
    _12965_ = nullptr;
  }
  else
  {
    _12965_ = ((*_8089_v)((int)0))->__mosek_2fusion_2Variable__getModel();
  }
  return _12965_;
}
// End mosek.fusion.Expr.extractModel

void mosek::fusion::p_Expr::destroy()
{
  inst.reset();
  cof_v.reset();
  subj.reset();
  ptrb.reset();
  bfix.reset();
  shape.reset();
}
void mosek::fusion::Expr::destroy() { mosek::fusion::p_Expr::_get_impl(this)->destroy(); }
// } class Expr
// class Expression { // @ bld/docker-win/final/default/src/fusion/Expression.mbi:38:4-101:5
// Begin mosek.fusion.Expression.toString
// End mosek.fusion.Expression.toString

// Begin mosek.fusion.Expression.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::pick(std::shared_ptr< monty::ndarray< int32_t,2 > > _8090_indexrows) { return __mosek_2fusion_2Expression__pick(_8090_indexrows); }
// End mosek.fusion.Expression.pick

// Begin mosek.fusion.Expression.pick
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::pick(std::shared_ptr< monty::ndarray< int32_t,1 > > _8091_indexes) { return __mosek_2fusion_2Expression__pick(_8091_indexes); }
// End mosek.fusion.Expression.pick

// Begin mosek.fusion.Expression.index
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::index(std::shared_ptr< monty::ndarray< int32_t,1 > > _8092_indexes) { return __mosek_2fusion_2Expression__index(_8092_indexes); }
// End mosek.fusion.Expression.index

// Begin mosek.fusion.Expression.index
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::index(int32_t _8093_i) { return __mosek_2fusion_2Expression__index(_8093_i); }
// End mosek.fusion.Expression.index

// Begin mosek.fusion.Expression.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::slice(std::shared_ptr< monty::ndarray< int32_t,1 > > _8094_firsta,std::shared_ptr< monty::ndarray< int32_t,1 > > _8095_lasta) { return __mosek_2fusion_2Expression__slice(_8094_firsta,_8095_lasta); }
// End mosek.fusion.Expression.slice

// Begin mosek.fusion.Expression.slice
monty::rc_ptr< mosek::fusion::Expression > mosek::fusion::Expression::slice(int32_t _8096_first,int32_t _8097_last) { return __mosek_2fusion_2Expression__slice(_8096_first,_8097_last); }
// End mosek.fusion.Expression.slice

// Begin mosek.fusion.Expression.eval
// End mosek.fusion.Expression.eval

// Begin mosek.fusion.Expression.getND
// End mosek.fusion.Expression.getND

// Begin mosek.fusion.Expression.getDim
// End mosek.fusion.Expression.getDim

// Begin mosek.fusion.Expression.getSize
// End mosek.fusion.Expression.getSize

// Begin mosek.fusion.Expression.getShape
// End mosek.fusion.Expression.getShape

// } class Expression
// class SymmetricMatrix { // @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:16:4-180:5
mosek::fusion::SymmetricMatrix::SymmetricMatrix(mosek::fusion::p_SymmetricMatrix *_impl) : _impl(_impl) { /*std::cout << "SymmetricMatrix() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::SymmetricMatrix::~SymmetricMatrix() { delete _impl; _impl = nullptr; }
mosek::fusion::p_SymmetricMatrix::p_SymmetricMatrix
  (::mosek::fusion::SymmetricMatrix * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.SymmetricMatrix.ctor @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:39:6-60:7
mosek::fusion::SymmetricMatrix::t mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix
  (int32_t _8102_dim0,
    int32_t _8103_dim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8104_usubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8105_usubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8106_uval,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8107_vsubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8108_vsubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8109_vval,
    double _8110_scale)
{ return new mosek::fusion::SymmetricMatrix(_8102_dim0,_8103_dim1,_8104_usubi,_8105_usubj,_8106_uval,_8107_vsubi,_8108_vsubj,_8109_vval,_8110_scale); }
mosek::fusion::SymmetricMatrix::SymmetricMatrix
  (int32_t _8102_dim0,
    int32_t _8103_dim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8104_usubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8105_usubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8106_uval,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8107_vsubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8108_vsubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8109_vval,
    double _8110_scale) : 
   SymmetricMatrix(new mosek::fusion::p_SymmetricMatrix(this))
{ mosek::fusion::p_SymmetricMatrix::_get_impl(this)->_initialize(_8102_dim0,_8103_dim1,_8104_usubi,_8105_usubj,_8106_uval,_8107_vsubi,_8108_vsubj,_8109_vval,_8110_scale); }
void mosek::fusion::p_SymmetricMatrix::_initialize  (int32_t _8102_dim0,
    int32_t _8103_dim1,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8104_usubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8105_usubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8106_uval,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8107_vsubi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8108_vsubj,
    std::shared_ptr< monty::ndarray< double,1 > > _8109_vval,
    double _8110_scale)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__8104_usubi(_8104_usubi ? _8104_usubi->raw() : nullptr, _8104_usubi ? _8104_usubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__8105_usubj(_8105_usubj ? _8105_usubj->raw() : nullptr, _8105_usubj ? _8105_usubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__8106_uval(_8106_uval ? _8106_uval->raw() : nullptr, _8106_uval ? _8106_uval->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__8107_vsubi(_8107_vsubi ? _8107_vsubi->raw() : nullptr, _8107_vsubi ? _8107_vsubi->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__8108_vsubj(_8108_vsubj ? _8108_vsubj->raw() : nullptr, _8108_vsubj ? _8108_vsubj->size(0) : 0);
    _checked_ptr_1<double> _ptr__8109_vval(_8109_vval ? _8109_vval->raw() : nullptr, _8109_vval ? _8109_vval->size(0) : 0);
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->d0 = _8102_dim0;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->d1 = _8103_dim1;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->usubi = _8104_usubi;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->usubj = _8105_usubj;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->uval = _8106_uval;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->vsubi = _8107_vsubi;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->vsubj = _8108_vsubj;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->vval = _8109_vval;
    mosek::fusion::p_SymmetricMatrix::_get_impl(::mosek::fusion::SymmetricMatrix::t(_pubthis))->scale = _8110_scale;
    nnz = (-(int)1);
  }
}
// mosek.fusion.SymmetricMatrix.ctor

// Begin mosek.fusion.SymmetricMatrix.rankOne
// Method mosek.fusion.SymmetricMatrix.rankOne @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:166:6-179:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::rankOne
  ( int32_t _8111_n,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8112_sub,
    std::shared_ptr< monty::ndarray< double,1 > > _8113_v) { return mosek::fusion::p_SymmetricMatrix::rankOne(_8111_n,_8112_sub,_8113_v); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::rankOne(int32_t _8111_n,std::shared_ptr< monty::ndarray< int32_t,1 > > _8112_sub,std::shared_ptr< monty::ndarray< double,1 > > _8113_v)
{
  _checked_ptr_1<int32_t> _ptr__8112_sub(_8112_sub ? _8112_sub->raw() : nullptr, _8112_sub ? _8112_sub->size(0) : 0);
  _checked_ptr_1<double> _ptr__8113_v(_8113_v ? _8113_v->raw() : nullptr, _8113_v ? _8113_v->size(0) : 0);
  if (((int)((_8112_sub)->size(0)) != (int)((_8113_v)->size(0))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Mismatching array lengths"));
    }
  }
  {}
  int32_t _12967_ = (int)0;
  int32_t _12968_ = (int)((_8112_sub)->size(0));
  for (int32_t _8114_i = _12967_; _8114_i < _12968_; ++_8114_i)
  {
    {
      if (((_ptr__8112_sub[_8114_i] < (int)0) || (_ptr__8112_sub[_8114_i] >= _8111_n)))
      {
        {
          throw ::mosek::fusion::LengthError(std::string ("Invalid index in argument 'sub'"));
        }
      }
      {}
    }
  }
  std::vector<int32_t> _12969_;
  for (int32_t _8116_i = (int)0, _12970_ = (int)((_8112_sub)->size(0)); _8116_i < _12970_ ; ++_8116_i)
  {
    _12969_.push_back(_ptr__8112_sub[_8116_i]);
  }
  auto _12971_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12969_.size()),_12969_.begin(),_12969_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8115_subi = _12971_;
  _checked_ptr_1<int32_t> _ptr__8115_subi(_8115_subi ? _8115_subi->raw() : nullptr,_8115_subi ? _8115_subi->size(0) : 0);
  std::vector<int32_t> _12972_;
  for (int32_t _8118_i = (int)0, _12973_ = (int)((_8112_sub)->size(0)); _8118_i < _12973_ ; ++_8118_i)
  {
    _12972_.push_back((int)1);
  }
  auto _12974_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12972_.size()),_12972_.begin(),_12972_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8117_subj = _12974_;
  _checked_ptr_1<int32_t> _ptr__8117_subj(_8117_subj ? _8117_subj->raw() : nullptr,_8117_subj ? _8117_subj->size(0) : 0);
  std::vector<double> _12975_;
  for (int32_t _8120_i = (int)0, _12976_ = (int)((_8113_v)->size(0)); _8120_i < _12976_ ; ++_8120_i)
  {
    _12975_.push_back(_ptr__8113_v[_8120_i]);
  }
  auto _12977_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12975_.size()),_12975_.begin(),_12975_.end()));
  std::shared_ptr< monty::ndarray< double,1 > > _8119_val = _12977_;
  _checked_ptr_1<double> _ptr__8119_val(_8119_val ? _8119_val->raw() : nullptr,_8119_val ? _8119_val->size(0) : 0);
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(_8111_n,(int)1,_8115_subi,_8117_subj,_8119_val,_8115_subi,_8117_subj,_8119_val,1.0);
}
// End mosek.fusion.SymmetricMatrix.rankOne

// Begin mosek.fusion.SymmetricMatrix.rankOne
// Method mosek.fusion.SymmetricMatrix.rankOne @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:157:6-164:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::rankOne
  ( std::shared_ptr< monty::ndarray< double,1 > > _8121_v) { return mosek::fusion::p_SymmetricMatrix::rankOne(_8121_v); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::rankOne(std::shared_ptr< monty::ndarray< double,1 > > _8121_v)
{
  _checked_ptr_1<double> _ptr__8121_v(_8121_v ? _8121_v->raw() : nullptr, _8121_v ? _8121_v->size(0) : 0);
  int32_t _8122_n = (int)((_8121_v)->size(0));
  std::vector<int32_t> _12978_;
  for (int32_t _8124_i = (int)0, _12979_ = _8122_n; _8124_i < _12979_ ; ++_8124_i)
  {
    _12978_.push_back(_8124_i);
  }
  auto _12980_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12978_.size()),_12978_.begin(),_12978_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8123_subi = _12980_;
  _checked_ptr_1<int32_t> _ptr__8123_subi(_8123_subi ? _8123_subi->raw() : nullptr,_8123_subi ? _8123_subi->size(0) : 0);
  std::vector<int32_t> _12981_;
  for (int32_t _8126_i = (int)0, _12982_ = _8122_n; _8126_i < _12982_ ; ++_8126_i)
  {
    _12981_.push_back((int)1);
  }
  auto _12983_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12981_.size()),_12981_.begin(),_12981_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8125_subj = _12983_;
  _checked_ptr_1<int32_t> _ptr__8125_subj(_8125_subj ? _8125_subj->raw() : nullptr,_8125_subj ? _8125_subj->size(0) : 0);
  std::vector<double> _12984_;
  for (int32_t _8128_i = (int)0, _12985_ = _8122_n; _8128_i < _12985_ ; ++_8128_i)
  {
    _12984_.push_back(_ptr__8121_v[_8128_i]);
  }
  auto _12986_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12984_.size()),_12984_.begin(),_12984_.end()));
  std::shared_ptr< monty::ndarray< double,1 > > _8127_val = _12986_;
  _checked_ptr_1<double> _ptr__8127_val(_8127_val ? _8127_val->raw() : nullptr,_8127_val ? _8127_val->size(0) : 0);
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(_8122_n,(int)1,_8123_subi,_8125_subj,_8127_val,_8123_subi,_8125_subj,_8127_val,1.0);
}
// End mosek.fusion.SymmetricMatrix.rankOne

// Begin mosek.fusion.SymmetricMatrix.antiDiag
// Method mosek.fusion.SymmetricMatrix.antiDiag @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:147:6-155:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::antiDiag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8129_vals) { return mosek::fusion::p_SymmetricMatrix::antiDiag(_8129_vals); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::antiDiag(std::shared_ptr< monty::ndarray< double,1 > > _8129_vals)
{
  _checked_ptr_1<double> _ptr__8129_vals(_8129_vals ? _8129_vals->raw() : nullptr, _8129_vals ? _8129_vals->size(0) : 0);
  int32_t _8130_n = (int)((_8129_vals)->size(0));
  std::vector<int32_t> _12987_;
  for (int32_t _8132_i = (int)0, _12988_ = _8130_n; _8132_i < _12988_ ; ++_8132_i)
  {
    _12987_.push_back(_8132_i);
  }
  auto _12989_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12987_.size()),_12987_.begin(),_12987_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8131_subarr = _12989_;
  _checked_ptr_1<int32_t> _ptr__8131_subarr(_8131_subarr ? _8131_subarr->raw() : nullptr,_8131_subarr ? _8131_subarr->size(0) : 0);
  std::vector<int32_t> _12990_;
  for (int32_t _8133_i = (int)0, _12991_ = _8130_n; _8133_i < _12991_ ; ++_8133_i)
  {
    _12990_.push_back((_8130_n - _8133_i));
  }
  auto _12992_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12990_.size()),_12990_.begin(),_12990_.end()));
  std::vector<double> _12993_;
  for (int32_t _8134_i = (int)0, _12994_ = _8130_n; _8134_i < _12994_ ; ++_8134_i)
  {
    _12993_.push_back(_ptr__8129_vals[_8134_i]);
  }
  auto _12995_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12993_.size()),_12993_.begin(),_12993_.end()));
  std::vector<double> _12996_;
  for (int32_t _8135_i = (int)0, _12997_ = _8130_n; _8135_i < _12997_ ; ++_8135_i)
  {
    _12996_.push_back(1.0);
  }
  auto _12998_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_12996_.size()),_12996_.begin(),_12996_.end()));
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(_8130_n,_8130_n,_8131_subarr,_12992_,_12995_,_8131_subarr,_8131_subarr,_12998_,1.0);
}
// End mosek.fusion.SymmetricMatrix.antiDiag

// Begin mosek.fusion.SymmetricMatrix.diag
// Method mosek.fusion.SymmetricMatrix.diag @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:137:6-145:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::diag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8136_vals) { return mosek::fusion::p_SymmetricMatrix::diag(_8136_vals); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::diag(std::shared_ptr< monty::ndarray< double,1 > > _8136_vals)
{
  _checked_ptr_1<double> _ptr__8136_vals(_8136_vals ? _8136_vals->raw() : nullptr, _8136_vals ? _8136_vals->size(0) : 0);
  int32_t _8137_n = (int)((_8136_vals)->size(0));
  std::vector<int32_t> _12999_;
  for (int32_t _8139_i = (int)0, _13000_ = _8137_n; _8139_i < _13000_ ; ++_8139_i)
  {
    _12999_.push_back(_8139_i);
  }
  auto _13001_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_12999_.size()),_12999_.begin(),_12999_.end()));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8138_subarr = _13001_;
  _checked_ptr_1<int32_t> _ptr__8138_subarr(_8138_subarr ? _8138_subarr->raw() : nullptr,_8138_subarr ? _8138_subarr->size(0) : 0);
  std::vector<double> _13002_;
  for (int32_t _8140_i = (int)0, _13003_ = _8137_n; _8140_i < _13003_ ; ++_8140_i)
  {
    _13002_.push_back(_ptr__8136_vals[_8140_i]);
  }
  auto _13004_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_13002_.size()),_13002_.begin(),_13002_.end()));
  std::vector<double> _13005_;
  for (int32_t _8141_i = (int)0, _13006_ = _8137_n; _8141_i < _13006_ ; ++_8141_i)
  {
    _13005_.push_back(1.0);
  }
  auto _13007_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_13005_.size()),_13005_.begin(),_13005_.end()));
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(_8137_n,_8137_n,_8138_subarr,_8138_subarr,_13004_,_8138_subarr,_8138_subarr,_13007_,1.0);
}
// End mosek.fusion.SymmetricMatrix.diag

// Begin mosek.fusion.SymmetricMatrix.add
// Method mosek.fusion.SymmetricMatrix.add @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:75:6-133:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix :: __mosek_2fusion_2SymmetricMatrix__add(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8142_m) { return mosek::fusion::p_SymmetricMatrix::_get_impl(this)->__mosek_2fusion_2SymmetricMatrix__add(_8142_m); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::add(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8142_m) { return __mosek_2fusion_2SymmetricMatrix__add(_8142_m); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::__mosek_2fusion_2SymmetricMatrix__add(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8142_m)
{
  int32_t _8143_n = _pubthis->getdim();
  if ((_8142_m->getdim() != _8143_n))
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Mismatching dimensions"));
    }
  }
  {}
  int32_t _8144_unnz = (int)((usubi)->size(0));
  int32_t _8145_munnz = (int)((mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->usubi)->size(0));
  int32_t _8146_newunnz = safe_add( _8144_unnz,_8145_munnz );
  int32_t _8147_vnnz = (int)((vsubi)->size(0));
  int32_t _8148_mvnnz = (int)((mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->vsubi)->size(0));
  int32_t _8149_newvnnz = safe_add( _8147_vnnz,_8148_mvnnz );
  std::shared_ptr< monty::ndarray< double,1 > > _8150_new_vval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8149_newvnnz)));
  _checked_ptr_1<double> _ptr__8150_new_vval(_8150_new_vval ? _8150_new_vval->raw() : nullptr,_8150_new_vval ? _8150_new_vval->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8151_new_vsubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8149_newvnnz)));
  _checked_ptr_1<int32_t> _ptr__8151_new_vsubj(_8151_new_vsubj ? _8151_new_vsubj->raw() : nullptr,_8151_new_vsubj ? _8151_new_vsubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8152_new_vsubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8149_newvnnz)));
  _checked_ptr_1<int32_t> _ptr__8152_new_vsubi(_8152_new_vsubi ? _8152_new_vsubi->raw() : nullptr,_8152_new_vsubi ? _8152_new_vsubi->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _8153_new_uval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8146_newunnz)));
  _checked_ptr_1<double> _ptr__8153_new_uval(_8153_new_uval ? _8153_new_uval->raw() : nullptr,_8153_new_uval ? _8153_new_uval->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8154_new_usubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8146_newunnz)));
  _checked_ptr_1<int32_t> _ptr__8154_new_usubj(_8154_new_usubj ? _8154_new_usubj->raw() : nullptr,_8154_new_usubj ? _8154_new_usubj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8155_new_usubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8146_newunnz)));
  _checked_ptr_1<int32_t> _ptr__8155_new_usubi(_8155_new_usubi ? _8155_new_usubi->raw() : nullptr,_8155_new_usubi ? _8155_new_usubi->size(0) : 0);
  ::mosek::fusion::Utils::Tools::arraycopy(usubi,(int)0,_8155_new_usubi,(int)0,_8144_unnz);
  ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->usubi,(int)0,_8155_new_usubi,_8144_unnz,_8145_munnz);
  ::mosek::fusion::Utils::Tools::arraycopy(usubj,(int)0,_8154_new_usubj,(int)0,_8144_unnz);
  int32_t _13008_ = (int)0;
  int32_t _13009_ = _8145_munnz;
  for (int32_t _8156_i = _13008_; _8156_i < _13009_; ++_8156_i)
  {
    {
      _ptr__8154_new_usubj[safe_add( _8156_i,_8144_unnz )] = safe_add( ((*mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->usubj)(_8156_i)),d1 );
    }
  }
  if (((scale > 1.0) || (scale < 1.0)))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(uval,(int)0,_8153_new_uval,(int)0,_8144_unnz);
    }
  }
  else
  {
    {
      int32_t _13010_ = (int)0;
      int32_t _13011_ = _8144_unnz;
      for (int32_t _8157_i = _13010_; _8157_i < _13011_; ++_8157_i)
      {
        {
          _ptr__8153_new_uval[_8157_i] = (scale * ((*uval)(_8157_i)));
        }
      }
    }
  }
  if (((mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale > 1.0) || (mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale < 1.0)))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->uval,(int)0,_8153_new_uval,_8144_unnz,_8145_munnz);
    }
  }
  else
  {
    {
      int32_t _13012_ = (int)0;
      int32_t _13013_ = _8145_munnz;
      for (int32_t _8158_i = _13012_; _8158_i < _13013_; ++_8158_i)
      {
        {
          _ptr__8153_new_uval[safe_add( _8158_i,_8144_unnz )] = (mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale * ((*mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->uval)(_8158_i)));
        }
      }
    }
  }
  ::mosek::fusion::Utils::Tools::arraycopy(usubi,(int)0,_8155_new_usubi,(int)0,_8144_unnz);
  int32_t _13014_ = (int)0;
  int32_t _13015_ = _8148_mvnnz;
  for (int32_t _8159_i = _13014_; _8159_i < _13015_; ++_8159_i)
  {
    {
      _ptr__8152_new_vsubi[safe_add( _8159_i,_8147_vnnz )] = safe_add( ((*mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->vsubi)(_8159_i)),mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->d1 );
    }
  }
  ::mosek::fusion::Utils::Tools::arraycopy(vsubj,(int)0,_8151_new_vsubj,(int)0,_8147_vnnz);
  ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->vsubj,_8147_vnnz,_8151_new_vsubj,_8147_vnnz,_8148_mvnnz);
  if (((scale > 1.0) || (scale < 1.0)))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(vval,(int)0,_8150_new_vval,(int)0,_8147_vnnz);
    }
  }
  else
  {
    {
      int32_t _13016_ = (int)0;
      int32_t _13017_ = _8147_vnnz;
      for (int32_t _8160_i = _13016_; _8160_i < _13017_; ++_8160_i)
      {
        {
          _ptr__8150_new_vval[_8160_i] = (scale * ((*vval)(_8160_i)));
        }
      }
    }
  }
  if (((mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale > 1.0) || (mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale < 1.0)))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->vval,(int)0,_8150_new_vval,_8147_vnnz,_8148_mvnnz);
    }
  }
  else
  {
    {
      int32_t _13018_ = (int)0;
      int32_t _13019_ = _8148_mvnnz;
      for (int32_t _8161_i = _13018_; _8161_i < _13019_; ++_8161_i)
      {
        {
          _ptr__8150_new_vval[safe_add( _8161_i,_8147_vnnz )] = (mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->scale * ((*mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->vval)(_8161_i)));
        }
      }
    }
  }
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(d0,safe_add( d1,mosek::fusion::p_SymmetricMatrix::_get_impl(_8142_m)->d1 ),_8155_new_usubi,_8154_new_usubj,_8153_new_uval,_8152_new_vsubi,_8151_new_vsubj,_8150_new_vval,1.0);
}
// End mosek.fusion.SymmetricMatrix.add

// Begin mosek.fusion.SymmetricMatrix.sub
// Method mosek.fusion.SymmetricMatrix.sub @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:70:6-73:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix :: __mosek_2fusion_2SymmetricMatrix__sub(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8162_m) { return mosek::fusion::p_SymmetricMatrix::_get_impl(this)->__mosek_2fusion_2SymmetricMatrix__sub(_8162_m); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::sub(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8162_m) { return __mosek_2fusion_2SymmetricMatrix__sub(_8162_m); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::__mosek_2fusion_2SymmetricMatrix__sub(monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > _8162_m)
{
  return _pubthis->__mosek_2fusion_2SymmetricMatrix__add(_8162_m->__mosek_2fusion_2SymmetricMatrix__mul((-1.0)));
}
// End mosek.fusion.SymmetricMatrix.sub

// Begin mosek.fusion.SymmetricMatrix.mul
// Method mosek.fusion.SymmetricMatrix.mul @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:65:6-68:7
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix :: __mosek_2fusion_2SymmetricMatrix__mul(double _8163_v) { return mosek::fusion::p_SymmetricMatrix::_get_impl(this)->__mosek_2fusion_2SymmetricMatrix__mul(_8163_v); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::SymmetricMatrix::mul(double _8163_v) { return __mosek_2fusion_2SymmetricMatrix__mul(_8163_v); }
monty::rc_ptr< ::mosek::fusion::SymmetricMatrix > mosek::fusion::p_SymmetricMatrix::__mosek_2fusion_2SymmetricMatrix__mul(double _8163_v)
{
  return ::mosek::fusion::p_SymmetricMatrix::_new_SymmetricMatrix(d0,d1,usubi,usubj,uval,vsubi,vsubj,vval,(scale * _8163_v));
}
// End mosek.fusion.SymmetricMatrix.mul

// Begin mosek.fusion.SymmetricMatrix.getdim
// Method mosek.fusion.SymmetricMatrix.getdim @ bld/docker-win/final/default/src/fusion/SymmetricMatrix.monty:63:6-51
int32_t mosek::fusion::SymmetricMatrix :: getdim() { return mosek::fusion::p_SymmetricMatrix::_get_impl(this)->getdim(); }
int32_t mosek::fusion::p_SymmetricMatrix::getdim()
{
  return d0;
}
// End mosek.fusion.SymmetricMatrix.getdim

void mosek::fusion::p_SymmetricMatrix::destroy()
{
  vval.reset();
  vsubj.reset();
  vsubi.reset();
  uval.reset();
  usubj.reset();
  usubi.reset();
}
void mosek::fusion::SymmetricMatrix::destroy() { mosek::fusion::p_SymmetricMatrix::_get_impl(this)->destroy(); }
// } class SymmetricMatrix
// class NDSparseArray { // @ bld/docker-win/final/default/src/fusion/Matrix.mbi:976:4-1151:5
mosek::fusion::NDSparseArray::NDSparseArray(mosek::fusion::p_NDSparseArray *_impl) : _impl(_impl) { /*std::cout << "NDSparseArray() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::NDSparseArray::~NDSparseArray() { delete _impl; _impl = nullptr; }
mosek::fusion::p_NDSparseArray::p_NDSparseArray
  (::mosek::fusion::NDSparseArray * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.NDSparseArray.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:1072:6-1150:7
mosek::fusion::NDSparseArray::t mosek::fusion::p_NDSparseArray::_new_NDSparseArray
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8164_dims_,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _8165_sub,
    std::shared_ptr< monty::ndarray< double,1 > > _8166_cof_)
{ return new mosek::fusion::NDSparseArray(_8164_dims_,_8165_sub,_8166_cof_); }
mosek::fusion::NDSparseArray::NDSparseArray
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8164_dims_,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _8165_sub,
    std::shared_ptr< monty::ndarray< double,1 > > _8166_cof_) : 
   NDSparseArray(new mosek::fusion::p_NDSparseArray(this))
{ mosek::fusion::p_NDSparseArray::_get_impl(this)->_initialize(_8164_dims_,_8165_sub,_8166_cof_); }
void mosek::fusion::p_NDSparseArray::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8164_dims_,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _8165_sub,
    std::shared_ptr< monty::ndarray< double,1 > > _8166_cof_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__8164_dims_(_8164_dims_ ? _8164_dims_->raw() : nullptr, _8164_dims_ ? _8164_dims_->size(0) : 0);
    _checked_ptr_1<double> _ptr__8166_cof_(_8166_cof_ ? _8166_cof_->raw() : nullptr, _8166_cof_ ? _8166_cof_->size(0) : 0);
    std::shared_ptr< monty::ndarray< int64_t,1 > > _8167_inst_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape((int)((_8165_sub)->size(0)))));
    _checked_ptr_1<int64_t> _ptr__8167_inst_(_8167_inst_ ? _8167_inst_->raw() : nullptr,_8167_inst_ ? _8167_inst_->size(0) : 0);
    size = (int64_t)1;
    int32_t _13020_ = (int)0;
    int32_t _13021_ = (int)((_8164_dims_)->size(0));
    for (int32_t _8168_i = _13020_; _8168_i < _13021_; ++_8168_i)
    {
      {
        size = safe_mul( size,_ptr__8164_dims_[_8168_i] );
      }
    }
    int32_t _8169_nd = (int)((_8164_dims_)->size(0));
    if (((int)((_8165_sub)->size(0)) != (int)((_8166_cof_)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Mismatching data array length"));
      }
    }
    {}
    if (((int)((_8165_sub)->size(1)) != _8169_nd))
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("An index key in sub has wrong length"));
      }
    }
    {}
    bool _8170_outofbounds = false;
    int32_t _13022_ = (int)0;
    int32_t _13023_ = (int)((_8165_sub)->size(0));
    for (int32_t _8171_i = _13022_; _8171_i < _13023_; ++_8171_i)
    {
      {
        int32_t _13024_ = (int)0;
        int32_t _13025_ = (int)((_8165_sub)->size(1));
        for (int32_t _8172_j = _13024_; _8172_j < _13025_; ++_8172_j)
        {
          {
            if (((((*_8165_sub)(_8171_i,_8172_j)) < (int)0) || (((*_8165_sub)(_8171_i,_8172_j)) >= _ptr__8164_dims_[_8172_j])))
            {
              {
                _8170_outofbounds = true;
              }
            }
            {}
          }
        }
      }
    }
    if (_8170_outofbounds)
    {
      {
        throw ::mosek::fusion::IndexError(std::string ("An index in sub is out of bounds"));
      }
    }
    {}
    int32_t _13026_ = (int)0;
    int32_t _13027_ = (int)((_8165_sub)->size(0));
    for (int32_t _8173_i = _13026_; _8173_i < _13027_; ++_8173_i)
    {
      {
        int64_t _8174_k = (int64_t)0;
        int32_t _13028_ = (int)0;
        int32_t _13029_ = (int)((_8165_sub)->size(1));
        for (int32_t _8175_j = _13028_; _8175_j < _13029_; ++_8175_j)
        {
          {
            _8174_k = safe_add( safe_mul( _8174_k,_ptr__8164_dims_[_8175_j] ),((*_8165_sub)(_8173_i,_8175_j)) );
          }
        }
        _ptr__8167_inst_[_8173_i] = _8174_k;
      }
    }
    dims = ::mosek::fusion::Utils::Tools::arraycopy(_8164_dims_);
    bool _8176_issorted = true;
    int32_t _13030_ = (int)1;
    int32_t _13031_ = (int)((_8167_inst_)->size(0));
    for (int32_t _8177_i = _13030_; _8177_i < _13031_; ++_8177_i)
    {
      {
        _8176_issorted = (_8176_issorted && (_ptr__8167_inst_[_8177_i] >= _ptr__8167_inst_[(_8177_i - (int)1)]));
      }
    }
    if (_8176_issorted)
    {
      {
        int32_t _8178_nunique = (int)1;
        int32_t _13032_ = (int)1;
        int32_t _13033_ = (int)((_8167_inst_)->size(0));
        for (int32_t _8179_i = _13032_; _8179_i < _13033_; ++_8179_i)
        {
          {
            if ((_ptr__8167_inst_[(_8179_i - (int)1)] < _ptr__8167_inst_[_8179_i]))
            {
              {
                ++ _8178_nunique;
              }
            }
            {}
          }
        }
        if ((_8178_nunique == (int)((_8167_inst_)->size(0))))
        {
          {
            inst = ::mosek::fusion::Utils::Tools::arraycopy(_8167_inst_);
            cof = ::mosek::fusion::Utils::Tools::arraycopy(_8166_cof_);
          }
        }
        else
        {
          {
            inst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_8178_nunique)));
            ((*inst)((int)0)) = _ptr__8167_inst_[(int)0];
            cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8178_nunique)));
            ((*cof)((int)0)) = _ptr__8166_cof_[(int)0];
            int32_t _8180_j = (int)0;
            int32_t _13034_ = (int)1;
            int32_t _13035_ = (int)((_8167_inst_)->size(0));
            for (int32_t _8181_i = _13034_; _8181_i < _13035_; ++_8181_i)
            {
              {
                if ((_ptr__8167_inst_[_8181_i] > _ptr__8167_inst_[(_8181_i - (int)1)]))
                {
                  {
                    ++ _8180_j;
                    ((*inst)(_8180_j)) = _ptr__8167_inst_[_8181_i];
                    ((*cof)(_8180_j)) = _ptr__8166_cof_[_8181_i];
                  }
                }
                else
                {
                  {
                    ((*cof)(_8180_j)) = (((*cof)(_8180_j)) + _ptr__8166_cof_[_8181_i]);
                  }
                }
              }
            }
          }
        }
      }
    }
    else
    {
      {
        std::shared_ptr< monty::ndarray< int64_t,1 > > _8182_perm = ::mosek::fusion::Utils::Tools::range((int64_t)((_8167_inst_)->size(0)));
        _checked_ptr_1<int64_t> _ptr__8182_perm(_8182_perm ? _8182_perm->raw() : nullptr,_8182_perm ? _8182_perm->size(0) : 0);
        ::mosek::fusion::p_CommonTools::argQsort(_8182_perm,_8167_inst_,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)0,(int64_t)((_8167_inst_)->size(0)));
        int32_t _8183_nunique = (int)1;
        int32_t _13036_ = (int)1;
        int32_t _13037_ = (int)((_8167_inst_)->size(0));
        for (int32_t _8184_i = _13036_; _8184_i < _13037_; ++_8184_i)
        {
          {
            if ((_ptr__8167_inst_[_ptr__8182_perm[(_8184_i - (int)1)]] < _ptr__8167_inst_[_ptr__8182_perm[_8184_i]]))
            {
              {
                ++ _8183_nunique;
              }
            }
            {}
          }
        }
        inst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_8183_nunique)));
        ((*inst)((int)0)) = _ptr__8167_inst_[_ptr__8182_perm[(int)0]];
        cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8183_nunique)));
        ((*cof)((int)0)) = _ptr__8166_cof_[_ptr__8182_perm[(int)0]];
        int32_t _8185_j = (int)0;
        int32_t _13038_ = (int)1;
        int32_t _13039_ = (int)((_8167_inst_)->size(0));
        for (int32_t _8186_i = _13038_; _8186_i < _13039_; ++_8186_i)
        {
          {
            if ((_ptr__8167_inst_[_ptr__8182_perm[_8186_i]] > _ptr__8167_inst_[_ptr__8182_perm[(_8186_i - (int)1)]]))
            {
              {
                ++ _8185_j;
                ((*inst)(_8185_j)) = _ptr__8167_inst_[_ptr__8182_perm[_8186_i]];
                ((*cof)(_8185_j)) = _ptr__8166_cof_[_ptr__8182_perm[_8186_i]];
              }
            }
            else
            {
              {
                ((*cof)(_8185_j)) = (((*cof)(_8185_j)) + _ptr__8166_cof_[_ptr__8182_perm[_8186_i]]);
              }
            }
          }
        }
      }
    }
  }
}
// mosek.fusion.NDSparseArray.ctor

// mosek.fusion.NDSparseArray.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:1004:6-1070:7
mosek::fusion::NDSparseArray::t mosek::fusion::p_NDSparseArray::_new_NDSparseArray
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8187_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _8188_inst_,
    std::shared_ptr< monty::ndarray< double,1 > > _8189_cof_)
{ return new mosek::fusion::NDSparseArray(_8187_dims_,_8188_inst_,_8189_cof_); }
mosek::fusion::NDSparseArray::NDSparseArray
  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8187_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _8188_inst_,
    std::shared_ptr< monty::ndarray< double,1 > > _8189_cof_) : 
   NDSparseArray(new mosek::fusion::p_NDSparseArray(this))
{ mosek::fusion::p_NDSparseArray::_get_impl(this)->_initialize(_8187_dims_,_8188_inst_,_8189_cof_); }
void mosek::fusion::p_NDSparseArray::_initialize  (std::shared_ptr< monty::ndarray< int32_t,1 > > _8187_dims_,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _8188_inst_,
    std::shared_ptr< monty::ndarray< double,1 > > _8189_cof_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__8187_dims_(_8187_dims_ ? _8187_dims_->raw() : nullptr, _8187_dims_ ? _8187_dims_->size(0) : 0);
    _checked_ptr_1<int64_t> _ptr__8188_inst_(_8188_inst_ ? _8188_inst_->raw() : nullptr, _8188_inst_ ? _8188_inst_->size(0) : 0);
    _checked_ptr_1<double> _ptr__8189_cof_(_8189_cof_ ? _8189_cof_->raw() : nullptr, _8189_cof_ ? _8189_cof_->size(0) : 0);
    size = (int64_t)1;
    int32_t _13040_ = (int)0;
    int32_t _13041_ = (int)((_8187_dims_)->size(0));
    for (int32_t _8190_i = _13040_; _8190_i < _13041_; ++_8190_i)
    {
      {
        size = safe_mul( size,_ptr__8187_dims_[_8190_i] );
      }
    }
    int32_t _8191_n = (int)((_8188_inst_)->size(0));
    if ((_8191_n != (int)((_8189_cof_)->size(0))))
    {
      {
        throw ::mosek::fusion::LengthError(std::string ("Mismatching data array length"));
      }
    }
    {}
    {
      bool _8192_err = false;
      int32_t _13042_ = (int)0;
      int32_t _13043_ = _8191_n;
      for (int32_t _8193_i = _13042_; _8193_i < _13043_; ++_8193_i)
      {
        {
          _8192_err = (_8192_err || ((_ptr__8188_inst_[_8193_i] < (int)0) || (_ptr__8188_inst_[_8193_i] >= size)));
        }
      }
      if (_8192_err)
      {
        {
          throw ::mosek::fusion::IndexError(std::string ("An index in inst is out of bounds"));
        }
      }
      {}
    }
    dims = ::mosek::fusion::Utils::Tools::arraycopy(_8187_dims_);
    bool _8194_issorted = true;
    int32_t _13044_ = (int)1;
    int32_t _13045_ = (int)((_8188_inst_)->size(0));
    for (int32_t _8195_i = _13044_; _8195_i < _13045_; ++_8195_i)
    {
      {
        _8194_issorted = (_8194_issorted && (_ptr__8188_inst_[_8195_i] >= _ptr__8188_inst_[(_8195_i - (int)1)]));
      }
    }
    if (_8194_issorted)
    {
      {
        int32_t _8196_nunique = (int)1;
        int32_t _13046_ = (int)1;
        int32_t _13047_ = (int)((_8188_inst_)->size(0));
        for (int32_t _8197_i = _13046_; _8197_i < _13047_; ++_8197_i)
        {
          {
            if ((_ptr__8188_inst_[(_8197_i - (int)1)] < _ptr__8188_inst_[_8197_i]))
            {
              {
                ++ _8196_nunique;
              }
            }
            {}
          }
        }
        if ((_8196_nunique == (int)((_8188_inst_)->size(0))))
        {
          {
            inst = ::mosek::fusion::Utils::Tools::arraycopy(_8188_inst_);
            cof = ::mosek::fusion::Utils::Tools::arraycopy(_8189_cof_);
          }
        }
        else
        {
          {
            inst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_8196_nunique)));
            ((*inst)((int)0)) = _ptr__8188_inst_[(int)0];
            cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8196_nunique)));
            ((*cof)((int)0)) = _ptr__8189_cof_[(int)0];
            int32_t _8198_j = (int)0;
            int32_t _13048_ = (int)1;
            int32_t _13049_ = (int)((_8188_inst_)->size(0));
            for (int32_t _8199_i = _13048_; _8199_i < _13049_; ++_8199_i)
            {
              {
                if ((_ptr__8188_inst_[_8199_i] > _ptr__8188_inst_[(_8199_i - (int)1)]))
                {
                  {
                    ++ _8198_j;
                    ((*inst)(_8198_j)) = _ptr__8188_inst_[_8199_i];
                    ((*cof)(_8198_j)) = _ptr__8189_cof_[_8199_i];
                  }
                }
                else
                {
                  {
                    ((*cof)(_8198_j)) = (((*cof)(_8198_j)) + _ptr__8189_cof_[_8199_i]);
                  }
                }
              }
            }
          }
        }
      }
    }
    else
    {
      {
        std::shared_ptr< monty::ndarray< int64_t,1 > > _8200_perm = ::mosek::fusion::Utils::Tools::range((int64_t)((_8188_inst_)->size(0)));
        _checked_ptr_1<int64_t> _ptr__8200_perm(_8200_perm ? _8200_perm->raw() : nullptr,_8200_perm ? _8200_perm->size(0) : 0);
        ::mosek::fusion::p_CommonTools::argQsort(_8200_perm,_8188_inst_,std::shared_ptr< monty::ndarray< int64_t,1 > >(nullptr),(int64_t)0,(int64_t)((_8188_inst_)->size(0)));
        int32_t _8201_nunique = (int)1;
        int32_t _13050_ = (int)1;
        int32_t _13051_ = (int)((_8188_inst_)->size(0));
        for (int32_t _8202_i = _13050_; _8202_i < _13051_; ++_8202_i)
        {
          {
            if ((_ptr__8188_inst_[_ptr__8200_perm[(_8202_i - (int)1)]] < _ptr__8188_inst_[_ptr__8200_perm[_8202_i]]))
            {
              {
                ++ _8201_nunique;
              }
            }
            {}
          }
        }
        inst = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_8201_nunique)));
        ((*inst)((int)0)) = _ptr__8188_inst_[_ptr__8200_perm[(int)0]];
        cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8201_nunique)));
        ((*cof)((int)0)) = _ptr__8189_cof_[_ptr__8200_perm[(int)0]];
        int32_t _8203_j = (int)0;
        int32_t _13052_ = (int)1;
        int32_t _13053_ = (int)((_8188_inst_)->size(0));
        for (int32_t _8204_i = _13052_; _8204_i < _13053_; ++_8204_i)
        {
          {
            if ((_ptr__8188_inst_[_ptr__8200_perm[_8204_i]] > ((*inst)(_ptr__8200_perm[(_8204_i - (int)1)]))))
            {
              {
                ++ _8203_j;
                ((*inst)(_8203_j)) = _ptr__8188_inst_[_ptr__8200_perm[_8204_i]];
                ((*cof)(_8203_j)) = _ptr__8189_cof_[_ptr__8200_perm[_8204_i]];
              }
            }
            else
            {
              {
                ((*cof)(_8203_j)) = (((*cof)(_8203_j)) + _ptr__8189_cof_[_ptr__8200_perm[_8204_i]]);
              }
            }
          }
        }
      }
    }
  }
}
// mosek.fusion.NDSparseArray.ctor

// mosek.fusion.NDSparseArray.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:987:6-1001:7
mosek::fusion::NDSparseArray::t mosek::fusion::p_NDSparseArray::_new_NDSparseArray
  (monty::rc_ptr< ::mosek::fusion::Matrix > _8205_m)
{ return new mosek::fusion::NDSparseArray(_8205_m); }
mosek::fusion::NDSparseArray::NDSparseArray
  (monty::rc_ptr< ::mosek::fusion::Matrix > _8205_m) : 
   NDSparseArray(new mosek::fusion::p_NDSparseArray(this))
{ mosek::fusion::p_NDSparseArray::_get_impl(this)->_initialize(_8205_m); }
void mosek::fusion::p_NDSparseArray::_initialize  (monty::rc_ptr< ::mosek::fusion::Matrix > _8205_m)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    int64_t _8206_nnz = _8205_m->numNonzeros();
    int32_t _8207_dim1 = _8205_m->numColumns();
    int32_t _8208_dim0 = _8205_m->numRows();
    std::shared_ptr< monty::ndarray< double,1 > > _8209_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8206_nnz)));
    _checked_ptr_1<double> _ptr__8209_val(_8209_val ? _8209_val->raw() : nullptr,_8209_val ? _8209_val->size(0) : 0);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8210_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8206_nnz)));
    _checked_ptr_1<int32_t> _ptr__8210_subj(_8210_subj ? _8210_subj->raw() : nullptr,_8210_subj ? _8210_subj->size(0) : 0);
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8211_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8206_nnz)));
    _checked_ptr_1<int32_t> _ptr__8211_subi(_8211_subi ? _8211_subi->raw() : nullptr,_8211_subi ? _8211_subi->size(0) : 0);
    _8205_m->getDataAsTriplets(_8211_subi,_8210_subj,_8209_val);
    size = safe_mul( (int64_t)_8205_m->numRows(),(int64_t)_8205_m->numColumns() );
    dims = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >{(int32_t)(_8208_dim0),(int32_t)(_8207_dim1)});
    std::vector<int64_t> _13054_;
    for (int64_t _8212_i = (int64_t)0, _13055_ = _8206_nnz; _8212_i < _13055_ ; ++_8212_i)
    {
      _13054_.push_back(safe_add( safe_mul( (int64_t)_ptr__8211_subi[_8212_i],_8207_dim1 ),(int64_t)_ptr__8210_subj[_8212_i] ));
    }
    auto _13056_ = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(_13054_.size()),_13054_.begin(),_13054_.end()));
    inst = _13056_;
    cof = _8209_val;
  }
}
// mosek.fusion.NDSparseArray.ctor

// Begin mosek.fusion.NDSparseArray.make
// Method mosek.fusion.NDSparseArray.make @ bld/docker-win/final/default/src/fusion/Matrix.mbi:985:6-88
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::NDSparseArray::make
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _8213_m) { return mosek::fusion::p_NDSparseArray::make(_8213_m); }
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::p_NDSparseArray::make(monty::rc_ptr< ::mosek::fusion::Matrix > _8213_m)
{
  return ::mosek::fusion::p_NDSparseArray::_new_NDSparseArray(_8213_m);
}
// End mosek.fusion.NDSparseArray.make

// Begin mosek.fusion.NDSparseArray.make
// Method mosek.fusion.NDSparseArray.make @ bld/docker-win/final/default/src/fusion/Matrix.mbi:984:6-133
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::NDSparseArray::make
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _8214_dims,
    std::shared_ptr< monty::ndarray< int64_t,1 > > _8215_inst,
    std::shared_ptr< monty::ndarray< double,1 > > _8216_cof) { return mosek::fusion::p_NDSparseArray::make(_8214_dims,_8215_inst,_8216_cof); }
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::p_NDSparseArray::make(std::shared_ptr< monty::ndarray< int32_t,1 > > _8214_dims,std::shared_ptr< monty::ndarray< int64_t,1 > > _8215_inst,std::shared_ptr< monty::ndarray< double,1 > > _8216_cof)
{
  _checked_ptr_1<int32_t> _ptr__8214_dims(_8214_dims ? _8214_dims->raw() : nullptr, _8214_dims ? _8214_dims->size(0) : 0);
  _checked_ptr_1<int64_t> _ptr__8215_inst(_8215_inst ? _8215_inst->raw() : nullptr, _8215_inst ? _8215_inst->size(0) : 0);
  _checked_ptr_1<double> _ptr__8216_cof(_8216_cof ? _8216_cof->raw() : nullptr, _8216_cof ? _8216_cof->size(0) : 0);
  return ::mosek::fusion::p_NDSparseArray::_new_NDSparseArray(_8214_dims,_8215_inst,_8216_cof);
}
// End mosek.fusion.NDSparseArray.make

// Begin mosek.fusion.NDSparseArray.make
// Method mosek.fusion.NDSparseArray.make @ bld/docker-win/final/default/src/fusion/Matrix.mbi:983:6-131
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::NDSparseArray::make
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _8217_dims,
    std::shared_ptr< monty::ndarray< int32_t,2 > > _8218_sub,
    std::shared_ptr< monty::ndarray< double,1 > > _8219_cof) { return mosek::fusion::p_NDSparseArray::make(_8217_dims,_8218_sub,_8219_cof); }
monty::rc_ptr< ::mosek::fusion::NDSparseArray > mosek::fusion::p_NDSparseArray::make(std::shared_ptr< monty::ndarray< int32_t,1 > > _8217_dims,std::shared_ptr< monty::ndarray< int32_t,2 > > _8218_sub,std::shared_ptr< monty::ndarray< double,1 > > _8219_cof)
{
  _checked_ptr_1<int32_t> _ptr__8217_dims(_8217_dims ? _8217_dims->raw() : nullptr, _8217_dims ? _8217_dims->size(0) : 0);
  _checked_ptr_1<double> _ptr__8219_cof(_8219_cof ? _8219_cof->raw() : nullptr, _8219_cof ? _8219_cof->size(0) : 0);
  return ::mosek::fusion::p_NDSparseArray::_new_NDSparseArray(_8217_dims,_8218_sub,_8219_cof);
}
// End mosek.fusion.NDSparseArray.make

void mosek::fusion::p_NDSparseArray::destroy()
{
  cof.reset();
  inst.reset();
  dims.reset();
}
void mosek::fusion::NDSparseArray::destroy() { mosek::fusion::p_NDSparseArray::_get_impl(this)->destroy(); }
// } class NDSparseArray
// class DenseMatrix { // @ bld/docker-win/final/default/src/fusion/Matrix.mbi:796:4-959:5
mosek::fusion::DenseMatrix::DenseMatrix(mosek::fusion::p_DenseMatrix *_impl) : mosek::fusion::Matrix(_impl) { /*std::cout << "DenseMatrix()" << this << std::endl; */ }
mosek::fusion::DenseMatrix::~DenseMatrix() {  /* std::cout << "~DenseMatrix()" << this << std::endl << std::flush; */ }
mosek::fusion::p_DenseMatrix::p_DenseMatrix
  (::mosek::fusion::DenseMatrix * _pubthis) :     mosek::fusion::p_Matrix(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.DenseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:907:6-916:7
mosek::fusion::DenseMatrix::t mosek::fusion::p_DenseMatrix::_new_DenseMatrix
  (int32_t _8220_dimi_,
    int32_t _8221_dimj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8222_cof)
{ return new mosek::fusion::DenseMatrix(_8220_dimi_,_8221_dimj_,_8222_cof); }
mosek::fusion::DenseMatrix::DenseMatrix
  (int32_t _8220_dimi_,
    int32_t _8221_dimj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8222_cof) : 
   DenseMatrix(new mosek::fusion::p_DenseMatrix(this))
{ mosek::fusion::p_DenseMatrix::_get_impl(this)->_initialize(_8220_dimi_,_8221_dimj_,_8222_cof); }
void mosek::fusion::p_DenseMatrix::_initialize  (int32_t _8220_dimi_,
    int32_t _8221_dimj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8222_cof)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<double> _ptr__8222_cof(_8222_cof ? _8222_cof->raw() : nullptr, _8222_cof ? _8222_cof->size(0) : 0);
    mosek::fusion::p_Matrix::_initialize(_8220_dimi_,_8221_dimj_);
    nnz = (int64_t)safe_mul( _8220_dimi_,_8221_dimj_ );
    data = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( _8220_dimi_,_8221_dimj_ ))));
    ::mosek::fusion::Utils::Tools::arraycopy(_8222_cof,(int)0,data,(int)0,safe_mul( _8220_dimi_,_8221_dimj_ ));
  }
}
// mosek.fusion.DenseMatrix.ctor

// mosek.fusion.DenseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:873:6-895:7
mosek::fusion::DenseMatrix::t mosek::fusion::p_DenseMatrix::_new_DenseMatrix
  (monty::rc_ptr< ::mosek::fusion::Matrix > _8223_m_)
{ return new mosek::fusion::DenseMatrix(_8223_m_); }
mosek::fusion::DenseMatrix::DenseMatrix
  (monty::rc_ptr< ::mosek::fusion::Matrix > _8223_m_) : 
   DenseMatrix(new mosek::fusion::p_DenseMatrix(this))
{ mosek::fusion::p_DenseMatrix::_get_impl(this)->_initialize(_8223_m_); }
void mosek::fusion::p_DenseMatrix::_initialize  (monty::rc_ptr< ::mosek::fusion::Matrix > _8223_m_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Matrix::_initialize(mosek::fusion::p_Matrix::_get_impl(_8223_m_)->dimi,mosek::fusion::p_Matrix::_get_impl(_8223_m_)->dimj);
    monty::rc_ptr< ::mosek::fusion::Matrix > _13057_ = _8223_m_;
    if (false) {}
    else if (nullptr != dynamic_cast<::mosek::fusion::DenseMatrix*>(_13057_.get()))
    {
      ::mosek::fusion::DenseMatrix::t _8224_m (dynamic_cast<::mosek::fusion::DenseMatrix*>(_13057_.get()));
      {
        data = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_DenseMatrix::_get_impl(_8224_m)->data);
      }
    }
    else if (nullptr != dynamic_cast<::mosek::fusion::SparseMatrix*>(_13057_.get()))
    {
      ::mosek::fusion::SparseMatrix::t _8225_m (dynamic_cast<::mosek::fusion::SparseMatrix*>(_13057_.get()));
      {
        data = ::mosek::fusion::Utils::Tools::zeros(safe_mul( mosek::fusion::p_Matrix::_get_impl(_8225_m)->dimi,mosek::fusion::p_Matrix::_get_impl(_8225_m)->dimj ));
        int64_t _13058_ = (int64_t)0;
        int64_t _13059_ = mosek::fusion::p_SparseMatrix::_get_impl(_8225_m)->nnz;
        for (int64_t _8227_i = _13058_; _8227_i < _13059_; ++_8227_i)
        {
          {
            ((*data)(safe_add( safe_mul( ((*mosek::fusion::p_SparseMatrix::_get_impl(_8225_m)->subi)(_8227_i)),dimj ),((*mosek::fusion::p_SparseMatrix::_get_impl(_8225_m)->subj)(_8227_i)) ))) = ((*mosek::fusion::p_SparseMatrix::_get_impl(_8225_m)->val)(_8227_i));
          }
        }
      }
    }
    else
    {
      mosek::fusion::Matrix::t _8226_m = _13057_;
      {
        throw ::mosek::fusion::MatrixError(std::string ("Unknown matrix type."));
      }
    }
    nnz = (int64_t)safe_mul( dimi,dimj );
  }
}
// mosek.fusion.DenseMatrix.ctor

// mosek.fusion.DenseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:862:6-867:7
mosek::fusion::DenseMatrix::t mosek::fusion::p_DenseMatrix::_new_DenseMatrix
  (std::shared_ptr< monty::ndarray< double,2 > > _8228_d)
{ return new mosek::fusion::DenseMatrix(_8228_d); }
mosek::fusion::DenseMatrix::DenseMatrix
  (std::shared_ptr< monty::ndarray< double,2 > > _8228_d) : 
   DenseMatrix(new mosek::fusion::p_DenseMatrix(this))
{ mosek::fusion::p_DenseMatrix::_get_impl(this)->_initialize(_8228_d); }
void mosek::fusion::p_DenseMatrix::_initialize  (std::shared_ptr< monty::ndarray< double,2 > > _8228_d)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Matrix::_initialize((int)((_8228_d)->size(0)),(int)((_8228_d)->size(1)));
    std::vector<double> _13060_;
    for (int32_t _8229_i = (int)0, _13061_ = dimi; _8229_i < _13061_ ; ++_8229_i)
    {
      for (int32_t _8230_j = (int)0, _13062_ = dimj; _8230_j < _13062_ ; ++_8230_j)
      {
        _13060_.push_back(((*_8228_d)(_8229_i,_8230_j)));
      }
    }
    auto _13063_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_13060_.size()),_13060_.begin(),_13060_.end()));
    data = _13063_;
    nnz = (int64_t)safe_mul( dimi,dimj );
  }
}
// mosek.fusion.DenseMatrix.ctor

// mosek.fusion.DenseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:851:6-856:7
mosek::fusion::DenseMatrix::t mosek::fusion::p_DenseMatrix::_new_DenseMatrix
  (int32_t _8231_dimi_,
    int32_t _8232_dimj_,
    double _8233_value_)
{ return new mosek::fusion::DenseMatrix(_8231_dimi_,_8232_dimj_,_8233_value_); }
mosek::fusion::DenseMatrix::DenseMatrix
  (int32_t _8231_dimi_,
    int32_t _8232_dimj_,
    double _8233_value_) : 
   DenseMatrix(new mosek::fusion::p_DenseMatrix(this))
{ mosek::fusion::p_DenseMatrix::_get_impl(this)->_initialize(_8231_dimi_,_8232_dimj_,_8233_value_); }
void mosek::fusion::p_DenseMatrix::_initialize  (int32_t _8231_dimi_,
    int32_t _8232_dimj_,
    double _8233_value_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_Matrix::_initialize(_8231_dimi_,_8232_dimj_);
    std::vector<double> _13064_;
    for (int32_t _8234_i = (int)0, _13065_ = _8231_dimi_; _8234_i < _13065_ ; ++_8234_i)
    {
      for (int32_t _8235_j = (int)0, _13066_ = _8232_dimj_; _8235_j < _13066_ ; ++_8235_j)
      {
        _13064_.push_back(_8233_value_);
      }
    }
    auto _13067_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_13064_.size()),_13064_.begin(),_13064_.end()));
    data = _13067_;
    nnz = (int64_t)safe_mul( _8231_dimi_,_8232_dimj_ );
  }
}
// mosek.fusion.DenseMatrix.ctor

// Begin mosek.fusion.DenseMatrix.toString
// Method mosek.fusion.DenseMatrix.toString @ bld/docker-win/final/default/src/fusion/Matrix.mbi:940:6-958:7
std::string mosek::fusion::DenseMatrix :: toString() { return mosek::fusion::p_DenseMatrix::_get_impl(this)->toString(); }
std::string mosek::fusion::p_DenseMatrix::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _8236_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("DenseMatrix("));
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(dimi);
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","));
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(dimj);
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (": "));
  int32_t _8237_k = (int)0;
  {
    int32_t _8238_i = (int)0;
    for(;(_8238_i < dimi);++ _8238_i)
    {
      {
        if ((_8238_i > (int)0))
        {
          {
            _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","));
          }
        }
        {}
        _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("[ "));
        _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*data)(_8237_k)));
        ++ _8237_k;
        {
          int32_t _8239_j = (int)1;
          for(;(_8239_j < dimj);++ _8239_j)
          {
            {
              _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","));
              _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(((*data)(_8237_k)));
              ++ _8237_k;
            }
          }
        }
        _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" ]"));
      }
    }
  }
  _8236_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
  return _8236_sb->toString();
}
// End mosek.fusion.DenseMatrix.toString

// Begin mosek.fusion.DenseMatrix.transpose
// Method mosek.fusion.DenseMatrix.transpose @ bld/docker-win/final/default/src/fusion/Matrix.mbi:919:6-938:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::DenseMatrix :: __mosek_2fusion_2DenseMatrix__transpose() { return mosek::fusion::p_DenseMatrix::_get_impl(this)->__mosek_2fusion_2DenseMatrix__transpose(); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::DenseMatrix::transpose() { return __mosek_2fusion_2DenseMatrix__transpose(); }
/* override: mosek.fusion.Matrix.transpose*/
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::DenseMatrix::__mosek_2fusion_2Matrix__transpose() { return __mosek_2fusion_2DenseMatrix__transpose(); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_DenseMatrix::__mosek_2fusion_2DenseMatrix__transpose()
{
  std::shared_ptr< monty::ndarray< double,1 > > _8240_newdata = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( dimi,dimj ))));
  _checked_ptr_1<double> _ptr__8240_newdata(_8240_newdata ? _8240_newdata->raw() : nullptr,_8240_newdata ? _8240_newdata->size(0) : 0);
  int32_t _8241_srci = (int)0;
  int32_t _8242_step = dimi;
  int32_t _13068_ = (int)0;
  int32_t _13069_ = dimi;
  for (int32_t _8243_i = _13068_; _8243_i < _13069_; ++_8243_i)
  {
    {
      int32_t _8244_dsti = _8243_i;
      int32_t _13070_ = (int)0;
      int32_t _13071_ = dimj;
      for (int32_t _8245_j = _13070_; _8245_j < _13071_; ++_8245_j)
      {
        {
          _ptr__8240_newdata[_8244_dsti] = ((*data)(_8241_srci));
          _8244_dsti = safe_add( _8244_dsti,_8242_step );
          ++ _8241_srci;
        }
      }
    }
  }
  return (::mosek::fusion::p_DenseMatrix::_new_DenseMatrix(dimj,dimi,_8240_newdata)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.DenseMatrix.transpose

// Begin mosek.fusion.DenseMatrix.isSparse
// Method mosek.fusion.DenseMatrix.isSparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:842:6-54
bool mosek::fusion::DenseMatrix :: isSparse() { return mosek::fusion::p_DenseMatrix::_get_impl(this)->isSparse(); }
bool mosek::fusion::p_DenseMatrix::isSparse()
{
  return false;
}
// End mosek.fusion.DenseMatrix.isSparse

// Begin mosek.fusion.DenseMatrix.getDataAsArray
// Method mosek.fusion.DenseMatrix.getDataAsArray @ bld/docker-win/final/default/src/fusion/Matrix.mbi:837:6-840:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::DenseMatrix :: getDataAsArray() { return mosek::fusion::p_DenseMatrix::_get_impl(this)->getDataAsArray(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_DenseMatrix::getDataAsArray()
{
  return ::mosek::fusion::Utils::Tools::arraycopy(data);
}
// End mosek.fusion.DenseMatrix.getDataAsArray

// Begin mosek.fusion.DenseMatrix.getDataAsTriplets
// Method mosek.fusion.DenseMatrix.getDataAsTriplets @ bld/docker-win/final/default/src/fusion/Matrix.mbi:812:6-835:7
void mosek::fusion::DenseMatrix :: getDataAsTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _8246_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8247_subj,std::shared_ptr< monty::ndarray< double,1 > > _8248_cof) { mosek::fusion::p_DenseMatrix::_get_impl(this)->getDataAsTriplets(_8246_subi,_8247_subj,_8248_cof); }
void mosek::fusion::p_DenseMatrix::getDataAsTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _8246_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8247_subj,std::shared_ptr< monty::ndarray< double,1 > > _8248_cof)
{
  _checked_ptr_1<int32_t> _ptr__8246_subi(_8246_subi ? _8246_subi->raw() : nullptr, _8246_subi ? _8246_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8247_subj(_8247_subj ? _8247_subj->raw() : nullptr, _8247_subj ? _8247_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__8248_cof(_8248_cof ? _8248_cof->raw() : nullptr, _8248_cof ? _8248_cof->size(0) : 0);
  if ((((int)((_8246_subi)->size(0)) < nnz) || (((int)((_8247_subj)->size(0)) < nnz) || ((int)((_8248_cof)->size(0)) < nnz))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Output arrays are not long enough."));
    }
  }
  {}
  ::mosek::fusion::Utils::Tools::arraycopy(data,(int)0,_8248_cof,(int)0,(int)((data)->size(0)));
  int32_t _8249_k = (int)0;
  int32_t _13072_ = (int)0;
  int32_t _13073_ = dimi;
  for (int32_t _8250_i = _13072_; _8250_i < _13073_; ++_8250_i)
  {
    {
      int32_t _13074_ = (int)0;
      int32_t _13075_ = dimj;
      for (int32_t _8251_j = _13074_; _8251_j < _13075_; ++_8251_j)
      {
        {
          _ptr__8246_subi[_8249_k] = _8250_i;
          _ptr__8247_subj[_8249_k] = _8251_j;
          ++ _8249_k;
        }
      }
    }
  }
}
// End mosek.fusion.DenseMatrix.getDataAsTriplets

// Begin mosek.fusion.DenseMatrix.get
// Method mosek.fusion.DenseMatrix.get @ bld/docker-win/final/default/src/fusion/Matrix.mbi:810:6-82
double mosek::fusion::DenseMatrix :: get(int32_t _8252_i,int32_t _8253_j) { return mosek::fusion::p_DenseMatrix::_get_impl(this)->get(_8252_i,_8253_j); }
double mosek::fusion::p_DenseMatrix::get(int32_t _8252_i,int32_t _8253_j)
{
  return ((*data)(safe_add( safe_mul( _8252_i,dimj ),_8253_j )));
}
// End mosek.fusion.DenseMatrix.get

// Begin mosek.fusion.DenseMatrix.numNonzeros
// Method mosek.fusion.DenseMatrix.numNonzeros @ bld/docker-win/final/default/src/fusion/Matrix.mbi:805:6-808:7
int64_t mosek::fusion::DenseMatrix :: numNonzeros() { return mosek::fusion::p_DenseMatrix::_get_impl(this)->numNonzeros(); }
int64_t mosek::fusion::p_DenseMatrix::numNonzeros()
{
  return (int64_t)safe_mul( dimi,dimj );
}
// End mosek.fusion.DenseMatrix.numNonzeros

void mosek::fusion::p_DenseMatrix::destroy()
{
  data.reset();
}
void mosek::fusion::DenseMatrix::destroy() { mosek::fusion::p_DenseMatrix::_get_impl(this)->destroy(); }
// } class DenseMatrix
// class SparseMatrix { // @ bld/docker-win/final/default/src/fusion/Matrix.mbi:575:4-790:5
mosek::fusion::SparseMatrix::SparseMatrix(mosek::fusion::p_SparseMatrix *_impl) : mosek::fusion::Matrix(_impl) { /*std::cout << "SparseMatrix()" << this << std::endl; */ }
mosek::fusion::SparseMatrix::~SparseMatrix() {  /* std::cout << "~SparseMatrix()" << this << std::endl << std::flush; */ }
mosek::fusion::p_SparseMatrix::p_SparseMatrix
  (::mosek::fusion::SparseMatrix * _pubthis) :     mosek::fusion::p_Matrix(_pubthis),
    _pubthis(_pubthis)
{}
// mosek.fusion.SparseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:668:6-713:7
mosek::fusion::SparseMatrix::t mosek::fusion::p_SparseMatrix::_new_SparseMatrix
  (int32_t _8254_dimi_,
    int32_t _8255_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8256_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8257_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8258_val_,
    int64_t _8259_nelm)
{ return new mosek::fusion::SparseMatrix(_8254_dimi_,_8255_dimj_,_8256_subi_,_8257_subj_,_8258_val_,_8259_nelm); }
mosek::fusion::SparseMatrix::SparseMatrix
  (int32_t _8254_dimi_,
    int32_t _8255_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8256_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8257_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8258_val_,
    int64_t _8259_nelm) : 
   SparseMatrix(new mosek::fusion::p_SparseMatrix(this))
{ mosek::fusion::p_SparseMatrix::_get_impl(this)->_initialize(_8254_dimi_,_8255_dimj_,_8256_subi_,_8257_subj_,_8258_val_,_8259_nelm); }
void mosek::fusion::p_SparseMatrix::_initialize  (int32_t _8254_dimi_,
    int32_t _8255_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8256_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8257_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8258_val_,
    int64_t _8259_nelm)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__8256_subi_(_8256_subi_ ? _8256_subi_->raw() : nullptr, _8256_subi_ ? _8256_subi_->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__8257_subj_(_8257_subj_ ? _8257_subj_->raw() : nullptr, _8257_subj_ ? _8257_subj_->size(0) : 0);
    _checked_ptr_1<double> _ptr__8258_val_(_8258_val_ ? _8258_val_->raw() : nullptr, _8258_val_ ? _8258_val_->size(0) : 0);
    mosek::fusion::p_Matrix::_initialize(_8254_dimi_,_8255_dimj_);
    if ((_8259_nelm > (int)0))
    {
      {
        if ((((int)((_8256_subi_)->size(0)) < _8259_nelm) || (((int)((_8257_subj_)->size(0)) < _8259_nelm) || ((int)((_8258_val_)->size(0)) < _8259_nelm))))
        {
          {
            throw ::mosek::fusion::SparseFormatError(std::string ("Mismatching arrays in sparse data."));
          }
        }
        {}
        bool _8260_outofbounds = false;
        int64_t _13076_ = (int64_t)0;
        int64_t _13077_ = _8259_nelm;
        for (int64_t _8261_i = _13076_; _8261_i < _13077_; ++_8261_i)
        {
          {
            if (((_ptr__8256_subi_[_8261_i] < (int)0) || ((_ptr__8256_subi_[_8261_i] >= dimi) || ((_ptr__8257_subj_[_8261_i] < (int)0) || (_ptr__8257_subj_[_8261_i] >= dimj)))))
            {
              {
                _8260_outofbounds = true;
              }
            }
            {}
          }
        }
        if (_8260_outofbounds)
        {
          {
            throw ::mosek::fusion::SparseFormatError(std::string ("Subscript out of bounds."));
          }
        }
        {}
        std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _8262_ressubi = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 >(monty::shape((int)1)));
        std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > > _8263_ressubj = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< int32_t,1 > >,1 >(monty::shape((int)1)));
        std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > > _8264_resval = std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 > >(new monty::ndarray< std::shared_ptr< monty::ndarray< double,1 > >,1 >(monty::shape((int)1)));
        ::mosek::fusion::p_CommonTools::tripletSort(_8256_subi_,_8257_subj_,_8258_val_,_8262_ressubi,_8263_ressubj,_8264_resval,_8259_nelm,dimi,dimj);
        subi = ((*_8262_ressubi)((int)0));
        subj = ((*_8263_ressubj)((int)0));
        val = ((*_8264_resval)((int)0));
        nnz = (int64_t)((val)->size(0));
      }
    }
    else
    {
      {
        subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
        subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
        val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0)));
        nnz = (int64_t)0;
      }
    }
  }
}
// mosek.fusion.SparseMatrix.ctor

// mosek.fusion.SparseMatrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:617:6-653:7
mosek::fusion::SparseMatrix::t mosek::fusion::p_SparseMatrix::_new_SparseMatrix
  (int32_t _8265_dimi_,
    int32_t _8266_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8267_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8268_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8269_val_)
{ return new mosek::fusion::SparseMatrix(_8265_dimi_,_8266_dimj_,_8267_subi_,_8268_subj_,_8269_val_); }
mosek::fusion::SparseMatrix::SparseMatrix
  (int32_t _8265_dimi_,
    int32_t _8266_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8267_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8268_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8269_val_) : 
   SparseMatrix(new mosek::fusion::p_SparseMatrix(this))
{ mosek::fusion::p_SparseMatrix::_get_impl(this)->_initialize(_8265_dimi_,_8266_dimj_,_8267_subi_,_8268_subj_,_8269_val_); }
void mosek::fusion::p_SparseMatrix::_initialize  (int32_t _8265_dimi_,
    int32_t _8266_dimj_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8267_subi_,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8268_subj_,
    std::shared_ptr< monty::ndarray< double,1 > > _8269_val_)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    _checked_ptr_1<int32_t> _ptr__8267_subi_(_8267_subi_ ? _8267_subi_->raw() : nullptr, _8267_subi_ ? _8267_subi_->size(0) : 0);
    _checked_ptr_1<int32_t> _ptr__8268_subj_(_8268_subj_ ? _8268_subj_->raw() : nullptr, _8268_subj_ ? _8268_subj_->size(0) : 0);
    _checked_ptr_1<double> _ptr__8269_val_(_8269_val_ ? _8269_val_->raw() : nullptr, _8269_val_ ? _8269_val_->size(0) : 0);
    mosek::fusion::p_Matrix::_initialize(_8265_dimi_,_8266_dimj_);
    int32_t _8270_n = (int)0;
    int32_t _13078_ = (int)0;
    int32_t _13079_ = (int)((_8269_val_)->size(0));
    for (int32_t _8271_i = _13078_; _8271_i < _13079_; ++_8271_i)
    {
      {
        if (((_ptr__8269_val_[_8271_i] > (int)0) || (_ptr__8269_val_[_8271_i] < (int)0)))
        {
          {
            ++ _8270_n;
          }
        }
        {}
      }
    }
    if (((_8270_n > (int)0) && (_8270_n < (int)((_8267_subi_)->size(0)))))
    {
      {
        subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8270_n)));
        subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8270_n)));
        val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8270_n)));
        nnz = _8270_n;
        int32_t _8272_j = (int)0;
        int32_t _13080_ = (int)0;
        int32_t _13081_ = (int)((_8269_val_)->size(0));
        for (int32_t _8273_i = _13080_; _8273_i < _13081_; ++_8273_i)
        {
          {
            if (((_ptr__8269_val_[_8273_i] < (int)0) || (_ptr__8269_val_[_8273_i] > (int)0)))
            {
              {
                ((*val)(_8272_j)) = _ptr__8269_val_[_8273_i];
                ((*subj)(_8272_j)) = _ptr__8268_subj_[_8273_i];
                ((*subi)(_8272_j)) = _ptr__8267_subi_[_8273_i];
                ++ _8272_j;
              }
            }
            {}
          }
        }
      }
    }
    else
    {
      {
        subi = _8267_subi_;
        subj = _8268_subj_;
        val = _8269_val_;
        if ((NULL == _8267_subi_.get()))
        {
          {
            nnz = (int64_t)0;
          }
        }
        else
        {
          {
            nnz = (int64_t)((subi)->size(0));
          }
        }
      }
    }
  }
}
// mosek.fusion.SparseMatrix.ctor

// Begin mosek.fusion.SparseMatrix.formPtrb
// Method mosek.fusion.SparseMatrix.formPtrb @ bld/docker-win/final/default/src/fusion/Matrix.mbi:775:6-789:7
std::shared_ptr< monty::ndarray< int64_t,1 > > mosek::fusion::p_SparseMatrix::formPtrb()
{
  std::shared_ptr< monty::ndarray< int64_t,1 > > _8274_ptrb = std::shared_ptr< monty::ndarray< int64_t,1 > >(new monty::ndarray< int64_t,1 >(monty::shape(safe_add( dimi,(int)1 ))));
  _checked_ptr_1<int64_t> _ptr__8274_ptrb(_8274_ptrb ? _8274_ptrb->raw() : nullptr,_8274_ptrb ? _8274_ptrb->size(0) : 0);
  int64_t _8275_pos = (int64_t)0;
  int32_t _13082_ = (int)0;
  int32_t _13083_ = dimi;
  for (int32_t _8276_row = _13082_; _8276_row < _13083_; ++_8276_row)
  {
    {
      _ptr__8274_ptrb[_8276_row] = _8275_pos;
      {
        for(;((_8275_pos < nnz) && (((*subi)(_8275_pos)) == _8276_row));++ _8275_pos)
        {
          {
          }
        }
      }
    }
  }
  _ptr__8274_ptrb[dimi] = _8275_pos;
  return _8274_ptrb;
}
// End mosek.fusion.SparseMatrix.formPtrb

// Begin mosek.fusion.SparseMatrix.toString
// Method mosek.fusion.SparseMatrix.toString @ bld/docker-win/final/default/src/fusion/Matrix.mbi:760:6-772:7
std::string mosek::fusion::SparseMatrix :: toString() { return mosek::fusion::p_SparseMatrix::_get_impl(this)->toString(); }
std::string mosek::fusion::p_SparseMatrix::toString()
{
  monty::rc_ptr< ::mosek::fusion::Utils::StringBuffer > _8277_sb = ::mosek::fusion::Utils::p_StringBuffer::_new_StringBuffer();
  _8277_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("SparseMatrix("))->__mosek_2fusion_2Utils_2StringBuffer__a(dimi)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(dimj)->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (", ["));
  if (((NULL != subi.get()) && ((int)((subi)->size(0)) > (int)0)))
  {
    {
      _8277_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string ("("))->__mosek_2fusion_2Utils_2StringBuffer__a(((*subi)((int)0)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*subj)((int)0)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*val)((int)0)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
      int32_t _13084_ = (int)1;
      int32_t _13085_ = (int)((subi)->size(0));
      for (int32_t _8278_i = _13084_; _8278_i < _13085_; ++_8278_i)
      {
        {
          _8277_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (",("))->__mosek_2fusion_2Utils_2StringBuffer__a(((*subi)(_8278_i)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*subj)(_8278_i)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (","))->__mosek_2fusion_2Utils_2StringBuffer__a(((*val)(_8278_i)))->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (")"));
        }
      }
    }
  }
  {}
  _8277_sb->__mosek_2fusion_2Utils_2StringBuffer__a(std::string (" ])"));
  return _8277_sb->toString();
}
// End mosek.fusion.SparseMatrix.toString

// Begin mosek.fusion.SparseMatrix.numNonzeros
// Method mosek.fusion.SparseMatrix.numNonzeros @ bld/docker-win/final/default/src/fusion/Matrix.mbi:755:6-758:7
int64_t mosek::fusion::SparseMatrix :: numNonzeros() { return mosek::fusion::p_SparseMatrix::_get_impl(this)->numNonzeros(); }
int64_t mosek::fusion::p_SparseMatrix::numNonzeros()
{
  return nnz;
}
// End mosek.fusion.SparseMatrix.numNonzeros

// Begin mosek.fusion.SparseMatrix.transpose
// Method mosek.fusion.SparseMatrix.transpose @ bld/docker-win/final/default/src/fusion/Matrix.mbi:748:6-752:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::SparseMatrix :: __mosek_2fusion_2SparseMatrix__transpose() { return mosek::fusion::p_SparseMatrix::_get_impl(this)->__mosek_2fusion_2SparseMatrix__transpose(); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::SparseMatrix::transpose() { return __mosek_2fusion_2SparseMatrix__transpose(); }
/* override: mosek.fusion.Matrix.transpose*/
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::SparseMatrix::__mosek_2fusion_2Matrix__transpose() { return __mosek_2fusion_2SparseMatrix__transpose(); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_SparseMatrix::__mosek_2fusion_2SparseMatrix__transpose()
{
  return ::mosek::fusion::p_Matrix::sparse(dimj,dimi,subj,subi,val);
}
// End mosek.fusion.SparseMatrix.transpose

// Begin mosek.fusion.SparseMatrix.isSparse
// Method mosek.fusion.SparseMatrix.isSparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:745:6-53
bool mosek::fusion::SparseMatrix :: isSparse() { return mosek::fusion::p_SparseMatrix::_get_impl(this)->isSparse(); }
bool mosek::fusion::p_SparseMatrix::isSparse()
{
  return true;
}
// End mosek.fusion.SparseMatrix.isSparse

// Begin mosek.fusion.SparseMatrix.getDataAsArray
// Method mosek.fusion.SparseMatrix.getDataAsArray @ bld/docker-win/final/default/src/fusion/Matrix.mbi:737:6-743:7
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::SparseMatrix :: getDataAsArray() { return mosek::fusion::p_SparseMatrix::_get_impl(this)->getDataAsArray(); }
std::shared_ptr< monty::ndarray< double,1 > > mosek::fusion::p_SparseMatrix::getDataAsArray()
{
  std::shared_ptr< monty::ndarray< double,1 > > _8279_r = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(safe_mul( dimi,dimj ))));
  _checked_ptr_1<double> _ptr__8279_r(_8279_r ? _8279_r->raw() : nullptr,_8279_r ? _8279_r->size(0) : 0);
  int32_t _13086_ = (int)0;
  int32_t _13087_ = (int)((subi)->size(0));
  for (int32_t _8280_i = _13086_; _8280_i < _13087_; ++_8280_i)
  {
    {
      _ptr__8279_r[safe_add( safe_mul( ((*subi)(_8280_i)),dimj ),((*subj)(_8280_i)) )] = ((*val)(_8280_i));
    }
  }
  return _8279_r;
}
// End mosek.fusion.SparseMatrix.getDataAsArray

// Begin mosek.fusion.SparseMatrix.getDataAsTriplets
// Method mosek.fusion.SparseMatrix.getDataAsTriplets @ bld/docker-win/final/default/src/fusion/Matrix.mbi:717:6-735:7
void mosek::fusion::SparseMatrix :: getDataAsTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _8281_subi_,std::shared_ptr< monty::ndarray< int32_t,1 > > _8282_subj_,std::shared_ptr< monty::ndarray< double,1 > > _8283_cof_) { mosek::fusion::p_SparseMatrix::_get_impl(this)->getDataAsTriplets(_8281_subi_,_8282_subj_,_8283_cof_); }
void mosek::fusion::p_SparseMatrix::getDataAsTriplets(std::shared_ptr< monty::ndarray< int32_t,1 > > _8281_subi_,std::shared_ptr< monty::ndarray< int32_t,1 > > _8282_subj_,std::shared_ptr< monty::ndarray< double,1 > > _8283_cof_)
{
  _checked_ptr_1<int32_t> _ptr__8281_subi_(_8281_subi_ ? _8281_subi_->raw() : nullptr, _8281_subi_ ? _8281_subi_->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8282_subj_(_8282_subj_ ? _8282_subj_->raw() : nullptr, _8282_subj_ ? _8282_subj_->size(0) : 0);
  _checked_ptr_1<double> _ptr__8283_cof_(_8283_cof_ ? _8283_cof_->raw() : nullptr, _8283_cof_ ? _8283_cof_->size(0) : 0);
  if ((((int64_t)((_8281_subi_)->size(0)) < nnz) || (((int64_t)((_8282_subj_)->size(0)) < nnz) || ((int64_t)((_8283_cof_)->size(0)) < nnz))))
  {
    {
      throw ::mosek::fusion::LengthError(std::string ("Output arrays are not long enough."));
    }
  }
  {}
  if (((NULL != subi.get()) && ((int)((subi)->size(0)) > (int)0)))
  {
    {
      ::mosek::fusion::Utils::Tools::arraycopy(subi,(int64_t)0,_8281_subi_,(int64_t)0,nnz);
      ::mosek::fusion::Utils::Tools::arraycopy(subj,(int64_t)0,_8282_subj_,(int64_t)0,nnz);
      ::mosek::fusion::Utils::Tools::arraycopy(val,(int64_t)0,_8283_cof_,(int64_t)0,nnz);
    }
  }
  {}
}
// End mosek.fusion.SparseMatrix.getDataAsTriplets

// Begin mosek.fusion.SparseMatrix.get
// Method mosek.fusion.SparseMatrix.get @ bld/docker-win/final/default/src/fusion/Matrix.mbi:588:6-606:7
double mosek::fusion::SparseMatrix :: get(int32_t _8284_i,int32_t _8285_j) { return mosek::fusion::p_SparseMatrix::_get_impl(this)->get(_8284_i,_8285_j); }
double mosek::fusion::p_SparseMatrix::get(int32_t _8284_i,int32_t _8285_j)
{
  if (((_8284_i < (int)0) || ((_8284_i >= dimi) || ((_8285_j < (int)0) || (_8285_j >= dimj)))))
  {
    {
      throw ::mosek::fusion::IndexError(std::string ("Index out if bounds"));
    }
  }
  {}
  int32_t _8286_e = (int)((subi)->size(0));
  int32_t _8287_b = (int)0;
  while ( ((_8286_e - _8287_b) > (int)1) )
  {
    {
      int32_t _8288_p = (safe_add( _8287_b,_8286_e ) / (int)2);
      if (((((*subi)(_8288_p)) < _8284_i) || ((((*subi)(_8288_p)) == _8284_i) && (((*subj)(_8288_p)) < _8285_j))))
      {
        {
          _8287_b = _8288_p;
        }
      }
      else if(((((*subi)(_8288_p)) > _8284_i) || ((((*subi)(_8288_p)) == _8284_i) && (((*subj)(_8288_p)) > _8285_j))))
      {
        {
          _8286_e = _8288_p;
        }
      }
      else
      {
        {
          return ((*val)(_8288_p));
        }
      }
    }
  }
  if (((((*subi)(_8287_b)) == _8284_i) && (((*subj)(_8287_b)) == _8285_j)))
  {
    {
      return ((*val)(_8287_b));
    }
  }
  else
  {
    {
      return 0.0;
    }
  }
}
// End mosek.fusion.SparseMatrix.get

void mosek::fusion::p_SparseMatrix::destroy()
{
  val.reset();
  subj.reset();
  subi.reset();
}
void mosek::fusion::SparseMatrix::destroy() { mosek::fusion::p_SparseMatrix::_get_impl(this)->destroy(); }
// } class SparseMatrix
// class Matrix { // @ bld/docker-win/final/default/src/fusion/Matrix.mbi:58:4-569:5
mosek::fusion::Matrix::Matrix(mosek::fusion::p_Matrix *_impl) : _impl(_impl) { /*std::cout << "Matrix() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Matrix::~Matrix() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Matrix::p_Matrix
  (::mosek::fusion::Matrix * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.Matrix.ctor @ bld/docker-win/final/default/src/fusion/Matrix.mbi:65:6-71:7
void mosek::fusion::p_Matrix::_initialize  (int32_t _8289_di,
    int32_t _8290_dj)
{
  monty::rc_reserve __reserve_this(_pubthis); 
  {
    if (((_8289_di < (int)0) || (_8290_dj < (int)0)))
    {
      {
        throw ::mosek::fusion::DimensionError(std::string ("Invalid dimensions"));
      }
    }
    {}
    dimi = _8289_di;
    dimj = _8290_dj;
  }
}
// mosek.fusion.Matrix.ctor

// Begin mosek.fusion.Matrix.toString
// Method mosek.fusion.Matrix.toString @ bld/docker-win/final/default/src/fusion/Matrix.mbi:568:6-52
std::string mosek::fusion::Matrix :: toString() { return mosek::fusion::p_Matrix::_get_impl(this)->toString(); }
std::string mosek::fusion::p_Matrix::toString()
{
  return std::string ("");
}
// End mosek.fusion.Matrix.toString

// Begin mosek.fusion.Matrix.switchDims
// Method mosek.fusion.Matrix.switchDims @ bld/docker-win/final/default/src/fusion/Matrix.mbi:560:6-564:7
void mosek::fusion::p_Matrix::switchDims()
{
  int32_t _8291_tmp = dimi;
  dimi = dimj;
  dimj = _8291_tmp;
}
// End mosek.fusion.Matrix.switchDims

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:556:6-107
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( int32_t _8292_num,
    monty::rc_ptr< ::mosek::fusion::Matrix > _8293_mv) { return mosek::fusion::p_Matrix::diag(_8292_num,_8293_mv); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(int32_t _8292_num,monty::rc_ptr< ::mosek::fusion::Matrix > _8293_mv)
{
  std::vector<monty::rc_ptr< ::mosek::fusion::Matrix >> _13088_;
  for (int32_t _8294_i = (int)0, _13089_ = _8292_num; _8294_i < _13089_ ; ++_8294_i)
  {
    _13088_.push_back(_8293_mv);
  }
  auto _13090_ = std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > >(new monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 >(monty::shape(_13088_.size()),_13088_.begin(),_13088_.end()));
  return ::mosek::fusion::p_Matrix::diag(_13090_);
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:505:6-548:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > > _8295_md) { return mosek::fusion::p_Matrix::diag(_8295_md); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > > _8295_md)
{
  std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > > _8296_d = _8295_md;
  int64_t _8297_numelm = (int64_t)0;
  int32_t _8298_dimj = (int)0;
  int32_t _8299_dimi = (int)0;
  int32_t _13091_ = (int)0;
  int32_t _13092_ = (int)((_8295_md)->size(0));
  for (int32_t _8300_i = _13091_; _8300_i < _13092_; ++_8300_i)
  {
    {
      _8299_dimi = safe_add( _8299_dimi,mosek::fusion::p_Matrix::_get_impl(((*_8295_md)(_8300_i)))->dimi );
      _8298_dimj = safe_add( _8298_dimj,mosek::fusion::p_Matrix::_get_impl(((*_8295_md)(_8300_i)))->dimj );
      _8297_numelm = safe_add( _8297_numelm,((*_8295_md)(_8300_i))->numNonzeros() );
    }
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8301_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8297_numelm)));
  _checked_ptr_1<int32_t> _ptr__8301_subi(_8301_subi ? _8301_subi->raw() : nullptr,_8301_subi ? _8301_subi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8302_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8297_numelm)));
  _checked_ptr_1<int32_t> _ptr__8302_subj(_8302_subj ? _8302_subj->raw() : nullptr,_8302_subj ? _8302_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _8303_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8297_numelm)));
  _checked_ptr_1<double> _ptr__8303_val(_8303_val ? _8303_val->raw() : nullptr,_8303_val ? _8303_val->size(0) : 0);
  {
    int32_t _8304_offsetj = (int)0;
    int32_t _8305_offseti = (int)0;
    int64_t _8306_k = (int64_t)0;
    int32_t _13093_ = (int)0;
    int32_t _13094_ = (int)((_8295_md)->size(0));
    for (int32_t _8307_i = _13093_; _8307_i < _13094_; ++_8307_i)
    {
      {
        int64_t _8308_N = ((*_8295_md)(_8307_i))->numNonzeros();
        std::shared_ptr< monty::ndarray< double,1 > > _8309_mval = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8308_N)));
        _checked_ptr_1<double> _ptr__8309_mval(_8309_mval ? _8309_mval->raw() : nullptr,_8309_mval ? _8309_mval->size(0) : 0);
        std::shared_ptr< monty::ndarray< int32_t,1 > > _8310_msubj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8308_N)));
        _checked_ptr_1<int32_t> _ptr__8310_msubj(_8310_msubj ? _8310_msubj->raw() : nullptr,_8310_msubj ? _8310_msubj->size(0) : 0);
        std::shared_ptr< monty::ndarray< int32_t,1 > > _8311_msubi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8308_N)));
        _checked_ptr_1<int32_t> _ptr__8311_msubi(_8311_msubi ? _8311_msubi->raw() : nullptr,_8311_msubi ? _8311_msubi->size(0) : 0);
        ((*_8295_md)(_8307_i))->getDataAsTriplets(_8311_msubi,_8310_msubj,_8309_mval);
        ::mosek::fusion::Utils::Tools::arraycopy(_8309_mval,(int64_t)0,_8303_val,_8306_k,_8308_N);
        int64_t _13095_ = (int64_t)0;
        int64_t _13096_ = _8308_N;
        for (int64_t _8312_j = _13095_; _8312_j < _13096_; ++_8312_j)
        {
          {
            _ptr__8301_subi[safe_add( _8306_k,_8312_j )] = safe_add( _ptr__8311_msubi[_8312_j],_8305_offseti );
            _ptr__8302_subj[safe_add( _8306_k,_8312_j )] = safe_add( _ptr__8311_msubi[_8312_j],_8304_offsetj );
          }
        }
        _8306_k = safe_add( _8306_k,_8308_N );
        _8305_offseti = safe_add( _8305_offseti,mosek::fusion::p_Matrix::_get_impl(((*_8295_md)(_8307_i)))->dimi );
        _8304_offsetj = safe_add( _8304_offsetj,mosek::fusion::p_Matrix::_get_impl(((*_8295_md)(_8307_i)))->dimj );
      }
    }
  }
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8299_dimi,_8298_dimj,_8301_subi,_8302_subj,_8303_val)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.antidiag
// Method mosek.fusion.Matrix.antidiag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:485:6-494:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::antidiag
  ( int32_t _8313_n,
    double _8314_val,
    int32_t _8315_k) { return mosek::fusion::p_Matrix::antidiag(_8313_n,_8314_val,_8315_k); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::antidiag(int32_t _8313_n,double _8314_val,int32_t _8315_k)
{
  if (((_8315_k < _8313_n) && (_8315_k >= (int)0)))
  {
    {
      return ::mosek::fusion::p_Matrix::antidiag(::mosek::fusion::Utils::Tools::makevector(_8314_val,(_8313_n - _8315_k)),_8315_k);
    }
  }
  else if(((_8315_k > (-_8313_n)) && (_8315_k < (int)0)))
  {
    {
      return ::mosek::fusion::p_Matrix::antidiag(::mosek::fusion::Utils::Tools::makevector(_8314_val,safe_add( _8313_n,_8315_k )),_8315_k);
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Diagonal index out of bounds"));
    }
  }
}
// End mosek.fusion.Matrix.antidiag

// Begin mosek.fusion.Matrix.antidiag
// Method mosek.fusion.Matrix.antidiag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:480:6-483:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::antidiag
  ( int32_t _8316_n,
    double _8317_val) { return mosek::fusion::p_Matrix::antidiag(_8316_n,_8317_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::antidiag(int32_t _8316_n,double _8317_val)
{
  return ::mosek::fusion::p_Matrix::antidiag(::mosek::fusion::Utils::Tools::makevector(_8317_val,_8316_n),(int)0);
}
// End mosek.fusion.Matrix.antidiag

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:469:6-478:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( int32_t _8318_n,
    double _8319_val,
    int32_t _8320_k) { return mosek::fusion::p_Matrix::diag(_8318_n,_8319_val,_8320_k); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(int32_t _8318_n,double _8319_val,int32_t _8320_k)
{
  if (((_8320_k < _8318_n) && (_8320_k >= (int)0)))
  {
    {
      return ::mosek::fusion::p_Matrix::diag(::mosek::fusion::Utils::Tools::makevector(_8319_val,(_8318_n - _8320_k)),_8320_k);
    }
  }
  else if(((_8320_k > (-_8318_n)) && (_8320_k < (int)0)))
  {
    {
      return ::mosek::fusion::p_Matrix::diag(::mosek::fusion::Utils::Tools::makevector(_8319_val,safe_add( _8318_n,_8320_k )),_8320_k);
    }
  }
  else
  {
    {
      throw ::mosek::fusion::DimensionError(std::string ("Diagonal index out of bounds"));
    }
  }
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:464:6-467:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( int32_t _8321_n,
    double _8322_val) { return mosek::fusion::p_Matrix::diag(_8321_n,_8322_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(int32_t _8321_n,double _8322_val)
{
  return ::mosek::fusion::p_Matrix::diag(::mosek::fusion::Utils::Tools::makevector(_8322_val,_8321_n),(int)0);
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.antidiag
// Method mosek.fusion.Matrix.antidiag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:442:6-461:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::antidiag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8323_d,
    int32_t _8324_k) { return mosek::fusion::p_Matrix::antidiag(_8323_d,_8324_k); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::antidiag(std::shared_ptr< monty::ndarray< double,1 > > _8323_d,int32_t _8324_k)
{
  _checked_ptr_1<double> _ptr__8323_d(_8323_d ? _8323_d->raw() : nullptr, _8323_d ? _8323_d->size(0) : 0);
  int32_t _13097_;
  bool _13098_ = (_8324_k > (int)0);
  if (_13098_)
  {
    _13097_ = _8324_k;
  }
  else
  {
    _13097_ = (-_8324_k);
  }
  int32_t _8325_absk = _13097_;
  int32_t _8326_dimi = safe_add( (int)((_8323_d)->size(0)),_8325_absk );
  int32_t _8327_n = (int)((_8323_d)->size(0));
  if ((_8324_k >= (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8328_subi = ::mosek::fusion::Utils::Tools::range(_8324_k,safe_add( _8327_n,_8324_k ));
      _checked_ptr_1<int32_t> _ptr__8328_subi(_8328_subi ? _8328_subi->raw() : nullptr,_8328_subi ? _8328_subi->size(0) : 0);
      std::vector<int32_t> _13099_;
      for (int32_t _8330_i = (int)1, _13100_ = safe_add( _8327_n,(int)1 ); _8330_i < _13100_ ; ++_8330_i)
      {
        _13099_.push_back((safe_add( _8327_n,_8324_k ) - _8330_i));
      }
      auto _13101_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_13099_.size()),_13099_.begin(),_13099_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8329_subj = _13101_;
      _checked_ptr_1<int32_t> _ptr__8329_subj(_8329_subj ? _8329_subj->raw() : nullptr,_8329_subj ? _8329_subj->size(0) : 0);
      return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8326_dimi,_8326_dimi,_8328_subi,_8329_subj,_8323_d)).as<::mosek::fusion::Matrix>();
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8331_subi = ::mosek::fusion::Utils::Tools::range((int)0,_8327_n);
      _checked_ptr_1<int32_t> _ptr__8331_subi(_8331_subi ? _8331_subi->raw() : nullptr,_8331_subi ? _8331_subi->size(0) : 0);
      std::vector<int32_t> _13102_;
      for (int32_t _8333_i = (int)1, _13103_ = safe_add( _8327_n,(int)1 ); _8333_i < _13103_ ; ++_8333_i)
      {
        _13102_.push_back((_8327_n - _8333_i));
      }
      auto _13104_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_13102_.size()),_13102_.begin(),_13102_.end()));
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8332_subj = _13104_;
      _checked_ptr_1<int32_t> _ptr__8332_subj(_8332_subj ? _8332_subj->raw() : nullptr,_8332_subj ? _8332_subj->size(0) : 0);
      return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8326_dimi,_8326_dimi,_8331_subi,_8332_subj,_8323_d)).as<::mosek::fusion::Matrix>();
    }
  }
}
// End mosek.fusion.Matrix.antidiag

// Begin mosek.fusion.Matrix.antidiag
// Method mosek.fusion.Matrix.antidiag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:437:6-440:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::antidiag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8334_d) { return mosek::fusion::p_Matrix::antidiag(_8334_d); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::antidiag(std::shared_ptr< monty::ndarray< double,1 > > _8334_d)
{
  _checked_ptr_1<double> _ptr__8334_d(_8334_d ? _8334_d->raw() : nullptr, _8334_d ? _8334_d->size(0) : 0);
  return ::mosek::fusion::p_Matrix::antidiag(_8334_d,(int)0);
}
// End mosek.fusion.Matrix.antidiag

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:416:6-435:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8335_d,
    int32_t _8336_k) { return mosek::fusion::p_Matrix::diag(_8335_d,_8336_k); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(std::shared_ptr< monty::ndarray< double,1 > > _8335_d,int32_t _8336_k)
{
  _checked_ptr_1<double> _ptr__8335_d(_8335_d ? _8335_d->raw() : nullptr, _8335_d ? _8335_d->size(0) : 0);
  int32_t _13105_;
  bool _13106_ = (_8336_k > (int)0);
  if (_13106_)
  {
    _13105_ = _8336_k;
  }
  else
  {
    _13105_ = (-_8336_k);
  }
  int32_t _8337_absk = _13105_;
  int32_t _8338_dimi = safe_add( (int)((_8335_d)->size(0)),_8337_absk );
  int32_t _8339_n = (int)((_8335_d)->size(0));
  if ((_8336_k >= (int)0))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8340_subi = ::mosek::fusion::Utils::Tools::range((int)0,_8339_n);
      _checked_ptr_1<int32_t> _ptr__8340_subi(_8340_subi ? _8340_subi->raw() : nullptr,_8340_subi ? _8340_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8341_subj = ::mosek::fusion::Utils::Tools::range(_8337_absk,safe_add( _8339_n,_8337_absk ));
      _checked_ptr_1<int32_t> _ptr__8341_subj(_8341_subj ? _8341_subj->raw() : nullptr,_8341_subj ? _8341_subj->size(0) : 0);
      return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8338_dimi,_8338_dimi,_8340_subi,_8341_subj,_8335_d)).as<::mosek::fusion::Matrix>();
    }
  }
  else
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8342_subi = ::mosek::fusion::Utils::Tools::range(_8337_absk,safe_add( _8339_n,_8337_absk ));
      _checked_ptr_1<int32_t> _ptr__8342_subi(_8342_subi ? _8342_subi->raw() : nullptr,_8342_subi ? _8342_subi->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8343_subj = ::mosek::fusion::Utils::Tools::range((int)0,_8339_n);
      _checked_ptr_1<int32_t> _ptr__8343_subj(_8343_subj ? _8343_subj->raw() : nullptr,_8343_subj ? _8343_subj->size(0) : 0);
      return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8338_dimi,_8338_dimi,_8342_subi,_8343_subj,_8335_d)).as<::mosek::fusion::Matrix>();
    }
  }
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.diag
// Method mosek.fusion.Matrix.diag @ bld/docker-win/final/default/src/fusion/Matrix.mbi:411:6-414:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::diag
  ( std::shared_ptr< monty::ndarray< double,1 > > _8344_d) { return mosek::fusion::p_Matrix::diag(_8344_d); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::diag(std::shared_ptr< monty::ndarray< double,1 > > _8344_d)
{
  _checked_ptr_1<double> _ptr__8344_d(_8344_d ? _8344_d->raw() : nullptr, _8344_d ? _8344_d->size(0) : 0);
  return ::mosek::fusion::p_Matrix::diag(_8344_d,(int)0);
}
// End mosek.fusion.Matrix.diag

// Begin mosek.fusion.Matrix.ones
// Method mosek.fusion.Matrix.ones @ bld/docker-win/final/default/src/fusion/Matrix.mbi:408:6-83
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::ones
  ( int32_t _8345_n,
    int32_t _8346_m) { return mosek::fusion::p_Matrix::ones(_8345_n,_8346_m); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::ones(int32_t _8345_n,int32_t _8346_m)
{
  return ::mosek::fusion::p_Matrix::dense(_8345_n,_8346_m,1.0);
}
// End mosek.fusion.Matrix.ones

// Begin mosek.fusion.Matrix.eye
// Method mosek.fusion.Matrix.eye @ bld/docker-win/final/default/src/fusion/Matrix.mbi:398:6-90
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::eye
  ( int32_t _8347_n) { return mosek::fusion::p_Matrix::eye(_8347_n); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::eye(int32_t _8347_n)
{
  std::vector<double> _13107_;
  for (int32_t _8348_i = (int)0, _13108_ = _8347_n; _8348_i < _13108_ ; ++_8348_i)
  {
    _13107_.push_back(1.0);
  }
  auto _13109_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_13107_.size()),_13107_.begin(),_13107_.end()));
  return ::mosek::fusion::p_Matrix::diag(_13109_);
}
// End mosek.fusion.Matrix.eye

// Begin mosek.fusion.Matrix.dense
// Method mosek.fusion.Matrix.dense @ bld/docker-win/final/default/src/fusion/Matrix.mbi:388:6-114
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::dense
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _8349_other) { return mosek::fusion::p_Matrix::dense(_8349_other); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::dense(monty::rc_ptr< ::mosek::fusion::Matrix > _8349_other)
{
  return (::mosek::fusion::p_DenseMatrix::_new_DenseMatrix(_8349_other)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.dense

// Begin mosek.fusion.Matrix.dense
// Method mosek.fusion.Matrix.dense @ bld/docker-win/final/default/src/fusion/Matrix.mbi:387:6-126
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::dense
  ( int32_t _8350_dimi,
    int32_t _8351_dimj,
    double _8352_value) { return mosek::fusion::p_Matrix::dense(_8350_dimi,_8351_dimj,_8352_value); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::dense(int32_t _8350_dimi,int32_t _8351_dimj,double _8352_value)
{
  return (::mosek::fusion::p_DenseMatrix::_new_DenseMatrix(_8350_dimi,_8351_dimj,_8352_value)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.dense

// Begin mosek.fusion.Matrix.dense
// Method mosek.fusion.Matrix.dense @ bld/docker-win/final/default/src/fusion/Matrix.mbi:386:6-125
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::dense
  ( int32_t _8353_dimi,
    int32_t _8354_dimj,
    std::shared_ptr< monty::ndarray< double,1 > > _8355_data) { return mosek::fusion::p_Matrix::dense(_8353_dimi,_8354_dimj,_8355_data); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::dense(int32_t _8353_dimi,int32_t _8354_dimj,std::shared_ptr< monty::ndarray< double,1 > > _8355_data)
{
  _checked_ptr_1<double> _ptr__8355_data(_8355_data ? _8355_data->raw() : nullptr, _8355_data ? _8355_data->size(0) : 0);
  return (::mosek::fusion::p_DenseMatrix::_new_DenseMatrix(_8353_dimi,_8354_dimj,_8355_data)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.dense

// Begin mosek.fusion.Matrix.dense
// Method mosek.fusion.Matrix.dense @ bld/docker-win/final/default/src/fusion/Matrix.mbi:385:6-113
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::dense
  ( std::shared_ptr< monty::ndarray< double,2 > > _8356_data) { return mosek::fusion::p_Matrix::dense(_8356_data); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::dense(std::shared_ptr< monty::ndarray< double,2 > > _8356_data)
{
  return (::mosek::fusion::p_DenseMatrix::_new_DenseMatrix(_8356_data)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.dense

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:374:6-382:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( monty::rc_ptr< ::mosek::fusion::Matrix > _8357_mx) { return mosek::fusion::p_Matrix::sparse(_8357_mx); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(monty::rc_ptr< ::mosek::fusion::Matrix > _8357_mx)
{
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8358_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8357_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__8358_subi(_8358_subi ? _8358_subi->raw() : nullptr,_8358_subi ? _8358_subi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8359_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8357_mx->numNonzeros())));
  _checked_ptr_1<int32_t> _ptr__8359_subj(_8359_subj ? _8359_subj->raw() : nullptr,_8359_subj ? _8359_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _8360_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8357_mx->numNonzeros())));
  _checked_ptr_1<double> _ptr__8360_val(_8360_val ? _8360_val->raw() : nullptr,_8360_val ? _8360_val->size(0) : 0);
  _8357_mx->getDataAsTriplets(_8358_subi,_8359_subj,_8360_val);
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8357_mx->numRows(),_8357_mx->numColumns(),_8358_subi,_8359_subj,_8360_val)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:231:6-371:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > >,1 > > _8361_blocks) { return mosek::fusion::p_Matrix::sparse(_8361_blocks); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(std::shared_ptr< monty::ndarray< std::shared_ptr< monty::ndarray< monty::rc_ptr< ::mosek::fusion::Matrix >,1 > >,1 > > _8361_blocks)
{
  int32_t _8362_maxi = (int)((_8361_blocks)->size(0));
  int32_t _8363_maxj = (int)((((*_8361_blocks)((int)0)))->size(0));
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8364_idims = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8362_maxi)));
  _checked_ptr_1<int32_t> _ptr__8364_idims(_8364_idims ? _8364_idims->raw() : nullptr,_8364_idims ? _8364_idims->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8365_jdims = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8363_maxj)));
  _checked_ptr_1<int32_t> _ptr__8365_jdims(_8365_jdims ? _8365_jdims->raw() : nullptr,_8365_jdims ? _8365_jdims->size(0) : 0);
  int64_t _8366_nelm = (int64_t)0;
  int32_t _8367_k = (int)0;
  {
    int32_t _8368_i = (int)0;
    for(;(_8368_i < _8362_maxi);++ _8368_i)
    {
      {
        {
          int32_t _8369_j = (int)0;
          for(;(_8369_j < _8363_maxj);++ _8369_j)
          {
            {
              monty::rc_ptr< ::mosek::fusion::Matrix > _8370_m = ((*((*_8361_blocks)(_8368_i)))(_8369_j));
              if ((NULL != _8370_m.get()))
              {
                {
                  if ((_ptr__8365_jdims[_8369_j] == (int)0))
                  {
                    {
                      _ptr__8365_jdims[_8369_j] = mosek::fusion::p_Matrix::_get_impl(_8370_m)->dimj;
                    }
                  }
                  else if((_ptr__8365_jdims[_8369_j] != mosek::fusion::p_Matrix::_get_impl(_8370_m)->dimj))
                  {
                    {
                      throw ::mosek::fusion::SparseFormatError(std::string ("Sparse matrix construction blocks are not aligned"));
                    }
                  }
                  {}
                  if ((_ptr__8364_idims[_8368_i] == (int)0))
                  {
                    {
                      _ptr__8364_idims[_8368_i] = mosek::fusion::p_Matrix::_get_impl(_8370_m)->dimi;
                    }
                  }
                  else if((_ptr__8364_idims[_8368_i] != mosek::fusion::p_Matrix::_get_impl(_8370_m)->dimi))
                  {
                    {
                      throw ::mosek::fusion::SparseFormatError(std::string ("Sparse matrix construction blocks are not aligned"));
                    }
                  }
                  {}
                  _8366_nelm = safe_add( _8366_nelm,_8370_m->numNonzeros() );
                }
              }
              {}
              ++ _8367_k;
            }
          }
        }
      }
    }
  }
  std::shared_ptr< monty::ndarray< double,1 > > _8371_cof = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8366_nelm)));
  _checked_ptr_1<double> _ptr__8371_cof(_8371_cof ? _8371_cof->raw() : nullptr,_8371_cof ? _8371_cof->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8372_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8366_nelm)));
  _checked_ptr_1<int32_t> _ptr__8372_subi(_8372_subi ? _8372_subi->raw() : nullptr,_8372_subi ? _8372_subi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8373_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8366_nelm)));
  _checked_ptr_1<int32_t> _ptr__8373_subj(_8373_subj ? _8373_subj->raw() : nullptr,_8373_subj ? _8373_subj->size(0) : 0);
  int32_t _8374_dstp = (int)0;
  int32_t _8375_offseti = (int)0;
  {
    int32_t _8376_i = (int)0;
    for(;(_8376_i < _8362_maxi);++ _8376_i)
    {
      {
        std::shared_ptr< monty::ndarray< int32_t,1 > > _8377_lidxs = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8363_maxj)));
        _checked_ptr_1<int32_t> _ptr__8377_lidxs(_8377_lidxs ? _8377_lidxs->raw() : nullptr,_8377_lidxs ? _8377_lidxs->size(0) : 0);
        {
          int32_t _8378_ii = (int)0;
          for(;(_8378_ii < _ptr__8364_idims[_8376_i]);++ _8378_ii)
          {
            {
              int32_t _8379_offsetj = (int)0;
              {
                int32_t _8380_j = (int)0;
                for(;(_8380_j < _8363_maxj);++ _8380_j)
                {
                  {
                    monty::rc_ptr< ::mosek::fusion::Matrix > _8381_m_ = ((*((*_8361_blocks)(_8376_i)))(_8380_j));
                    if ((NULL != _8381_m_.get()))
                    {
                      {
                        monty::rc_ptr< ::mosek::fusion::Matrix > _13110_ = _8381_m_;
                        if (false) {}
                        else if (nullptr != dynamic_cast<::mosek::fusion::DenseMatrix*>(_13110_.get()))
                        {
                          ::mosek::fusion::DenseMatrix::t _8382_m (dynamic_cast<::mosek::fusion::DenseMatrix*>(_13110_.get()));
                          {
                            int32_t _8385_kk = _ptr__8377_lidxs[_8380_j];
                            {
                              int32_t _8386_jj = (int)0;
                              for(;(_8386_jj < mosek::fusion::p_Matrix::_get_impl(_8382_m)->dimj);++ _8386_jj)
                              {
                                {
                                  _ptr__8371_cof[_8374_dstp] = ((*mosek::fusion::p_DenseMatrix::_get_impl(_8382_m)->data)(_8385_kk));
                                  _ptr__8372_subi[_8374_dstp] = safe_add( _8375_offseti,_8378_ii );
                                  _ptr__8373_subj[_8374_dstp] = safe_add( _8379_offsetj,_8386_jj );
                                  ++ _8385_kk;
                                  ++ _8374_dstp;
                                }
                              }
                            }
                            _ptr__8377_lidxs[_8380_j] = _8385_kk;
                          }
                        }
                        else if (nullptr != dynamic_cast<::mosek::fusion::SparseMatrix*>(_13110_.get()))
                        {
                          ::mosek::fusion::SparseMatrix::t _8383_m (dynamic_cast<::mosek::fusion::SparseMatrix*>(_13110_.get()));
                          {
                            int32_t _8387_kk;
                            {
                              _8387_kk = _ptr__8377_lidxs[_8380_j];
                              for(;((_8387_kk < mosek::fusion::p_SparseMatrix::_get_impl(_8383_m)->nnz) && (((*mosek::fusion::p_SparseMatrix::_get_impl(_8383_m)->subi)(_8387_kk)) == _8378_ii));++ _8387_kk)
                              {
                                {
                                  _ptr__8371_cof[_8374_dstp] = ((*mosek::fusion::p_SparseMatrix::_get_impl(_8383_m)->val)(_8387_kk));
                                  _ptr__8373_subj[_8374_dstp] = safe_add( ((*mosek::fusion::p_SparseMatrix::_get_impl(_8383_m)->subj)(_8387_kk)),_8379_offsetj );
                                  _ptr__8372_subi[_8374_dstp] = safe_add( _8375_offseti,_8378_ii );
                                  ++ _8374_dstp;
                                }
                              }
                            }
                            _ptr__8377_lidxs[_8380_j] = _8387_kk;
                          }
                        }
                        else
                        {
                          mosek::fusion::Matrix::t _8384_m = _13110_;
                          {
                            throw ::mosek::fusion::MatrixError(std::string ("Unknown matrix type."));
                          }
                        }
                      }
                    }
                    {}
                    _8379_offsetj = safe_add( _8379_offsetj,_ptr__8365_jdims[_8380_j] );
                  }
                }
              }
            }
          }
        }
        _8375_offseti = safe_add( _8375_offseti,_ptr__8364_idims[_8376_i] );
      }
    }
  }
  int32_t _8388_dimi = (int)0;
  int32_t _8389_dimj = (int)0;
  {
    int32_t _8390_i = (int)0;
    for(;(_8390_i < _8362_maxi);++ _8390_i)
    {
      {
        _8388_dimi = safe_add( _8388_dimi,_ptr__8364_idims[_8390_i] );
      }
    }
  }
  {
    int32_t _8391_j = (int)0;
    for(;(_8391_j < _8363_maxj);++ _8391_j)
    {
      {
        _8389_dimj = safe_add( _8389_dimj,_ptr__8365_jdims[_8391_j] );
      }
    }
  }
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8388_dimi,_8389_dimj,_8372_subi,_8373_subj,_8371_cof)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:208:6-228:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( std::shared_ptr< monty::ndarray< double,2 > > _8392_data) { return mosek::fusion::p_Matrix::sparse(_8392_data); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(std::shared_ptr< monty::ndarray< double,2 > > _8392_data)
{
  int32_t _8393_dimi = (int)((_8392_data)->size(0));
  int32_t _8394_dimj = (int)((_8392_data)->size(1));
  int64_t _8395_nelem = (int64_t)safe_mul( _8393_dimi,_8394_dimj );
  int32_t _8396_k = (int)0;
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8397_subi = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8395_nelem)));
  _checked_ptr_1<int32_t> _ptr__8397_subi(_8397_subi ? _8397_subi->raw() : nullptr,_8397_subi ? _8397_subi->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8398_subj = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8395_nelem)));
  _checked_ptr_1<int32_t> _ptr__8398_subj(_8398_subj ? _8398_subj->raw() : nullptr,_8398_subj ? _8398_subj->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _8399_val = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape(_8395_nelem)));
  _checked_ptr_1<double> _ptr__8399_val(_8399_val ? _8399_val->raw() : nullptr,_8399_val ? _8399_val->size(0) : 0);
  {
    int32_t _8400_i = (int)0;
    for(;(_8400_i < _8393_dimi);++ _8400_i)
    {
      {
        {
          int32_t _8401_j = (int)0;
          for(;(_8401_j < _8394_dimj);++ _8401_j)
          {
            {
              _ptr__8397_subi[_8396_k] = _8400_i;
              _ptr__8398_subj[_8396_k] = _8401_j;
              _ptr__8399_val[_8396_k] = ((*_8392_data)(_8400_i,_8401_j));
              ++ _8396_k;
            }
          }
        }
      }
    }
  }
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8393_dimi,_8394_dimj,_8397_subi,_8398_subj,_8399_val)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:202:6-205:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( int32_t _8402_nrow,
    int32_t _8403_ncol) { return mosek::fusion::p_Matrix::sparse(_8402_nrow,_8403_ncol); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(int32_t _8402_nrow,int32_t _8403_ncol)
{
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8402_nrow,_8403_ncol,std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0))),std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0))),(int64_t)0)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:188:6-199:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( int32_t _8404_nrow,
    int32_t _8405_ncol,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8406_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8407_subj,
    double _8408_val) { return mosek::fusion::p_Matrix::sparse(_8404_nrow,_8405_ncol,_8406_subi,_8407_subj,_8408_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(int32_t _8404_nrow,int32_t _8405_ncol,std::shared_ptr< monty::ndarray< int32_t,1 > > _8406_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8407_subj,double _8408_val)
{
  _checked_ptr_1<int32_t> _ptr__8406_subi(_8406_subi ? _8406_subi->raw() : nullptr, _8406_subi ? _8406_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8407_subj(_8407_subj ? _8407_subj->raw() : nullptr, _8407_subj ? _8407_subj->size(0) : 0);
  int32_t _8409_sz = (int)0;
  if ((NULL != _8406_subi.get()))
  {
    {
      _8409_sz = (int)((_8406_subi)->size(0));
    }
  }
  else if((NULL != _8407_subj.get()))
  {
    {
      _8409_sz = (int)((_8407_subj)->size(0));
    }
  }
  {}
  return ::mosek::fusion::p_Matrix::sparse(_8404_nrow,_8405_ncol,_8406_subi,_8407_subj,::mosek::fusion::Utils::Tools::makevector(_8408_val,_8409_sz));
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:170:6-185:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _8410_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8411_subj,
    double _8412_val) { return mosek::fusion::p_Matrix::sparse(_8410_subi,_8411_subj,_8412_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _8410_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8411_subj,double _8412_val)
{
  _checked_ptr_1<int32_t> _ptr__8410_subi(_8410_subi ? _8410_subi->raw() : nullptr, _8410_subi ? _8410_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8411_subj(_8411_subj ? _8411_subj->raw() : nullptr, _8411_subj ? _8411_subj->size(0) : 0);
  int32_t _8413_maxj = (int)0;
  int32_t _8414_maxi = (int)0;
  int32_t _8415_num = (int)((_8410_subi)->size(0));
  if ((_8415_num > (int)((_8411_subj)->size(0))))
  {
    {
      _8415_num = (int)((_8411_subj)->size(0));
    }
  }
  {}
  int32_t _13111_ = (int)0;
  int32_t _13112_ = _8415_num;
  for (int32_t _8416_i = _13111_; _8416_i < _13112_; ++_8416_i)
  {
    {
      if ((_8414_maxi < _ptr__8410_subi[_8416_i]))
      {
        {
          _8414_maxi = _ptr__8410_subi[_8416_i];
        }
      }
      {}
      if ((_8413_maxj < _ptr__8411_subj[_8416_i]))
      {
        {
          _8413_maxj = _ptr__8411_subj[_8416_i];
        }
      }
      {}
    }
  }
  return ::mosek::fusion::p_Matrix::sparse(safe_add( _8414_maxi,(int)1 ),safe_add( _8413_maxj,(int)1 ),_8410_subi,_8411_subj,_8412_val);
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:151:6-167:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( std::shared_ptr< monty::ndarray< int32_t,1 > > _8417_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8418_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _8419_val) { return mosek::fusion::p_Matrix::sparse(_8417_subi,_8418_subj,_8419_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(std::shared_ptr< monty::ndarray< int32_t,1 > > _8417_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8418_subj,std::shared_ptr< monty::ndarray< double,1 > > _8419_val)
{
  _checked_ptr_1<int32_t> _ptr__8417_subi(_8417_subi ? _8417_subi->raw() : nullptr, _8417_subi ? _8417_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8418_subj(_8418_subj ? _8418_subj->raw() : nullptr, _8418_subj ? _8418_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__8419_val(_8419_val ? _8419_val->raw() : nullptr, _8419_val ? _8419_val->size(0) : 0);
  int32_t _8420_maxj = (int)0;
  int32_t _8421_maxi = (int)0;
  int32_t _8422_num = (int)((_8417_subi)->size(0));
  if ((_8422_num > (int)((_8418_subj)->size(0))))
  {
    {
      _8422_num = (int)((_8418_subj)->size(0));
    }
  }
  {}
  if ((_8422_num > (int)((_8419_val)->size(0))))
  {
    {
      _8422_num = (int)((_8419_val)->size(0));
    }
  }
  {}
  int32_t _13113_ = (int)0;
  int32_t _13114_ = _8422_num;
  for (int32_t _8423_i = _13113_; _8423_i < _13114_; ++_8423_i)
  {
    {
      if ((_8421_maxi < _ptr__8417_subi[_8423_i]))
      {
        {
          _8421_maxi = _ptr__8417_subi[_8423_i];
        }
      }
      {}
      if ((_8420_maxj < _ptr__8418_subj[_8423_i]))
      {
        {
          _8420_maxj = _ptr__8418_subj[_8423_i];
        }
      }
      {}
    }
  }
  return ::mosek::fusion::p_Matrix::sparse(safe_add( _8421_maxi,(int)1 ),safe_add( _8420_maxj,(int)1 ),_8417_subi,_8418_subj,_8419_val);
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.sparse
// Method mosek.fusion.Matrix.sparse @ bld/docker-win/final/default/src/fusion/Matrix.mbi:128:6-148:7
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix::sparse
  ( int32_t _8424_nrow,
    int32_t _8425_ncol,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8426_subi,
    std::shared_ptr< monty::ndarray< int32_t,1 > > _8427_subj,
    std::shared_ptr< monty::ndarray< double,1 > > _8428_val) { return mosek::fusion::p_Matrix::sparse(_8424_nrow,_8425_ncol,_8426_subi,_8427_subj,_8428_val); }
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::p_Matrix::sparse(int32_t _8424_nrow,int32_t _8425_ncol,std::shared_ptr< monty::ndarray< int32_t,1 > > _8426_subi,std::shared_ptr< monty::ndarray< int32_t,1 > > _8427_subj,std::shared_ptr< monty::ndarray< double,1 > > _8428_val)
{
  _checked_ptr_1<int32_t> _ptr__8426_subi(_8426_subi ? _8426_subi->raw() : nullptr, _8426_subi ? _8426_subi->size(0) : 0);
  _checked_ptr_1<int32_t> _ptr__8427_subj(_8427_subj ? _8427_subj->raw() : nullptr, _8427_subj ? _8427_subj->size(0) : 0);
  _checked_ptr_1<double> _ptr__8428_val(_8428_val ? _8428_val->raw() : nullptr, _8428_val ? _8428_val->size(0) : 0);
  std::shared_ptr< monty::ndarray< double,1 > > _13115_;
  bool _13116_ = (NULL != _8428_val.get());
  if (_13116_)
  {
    _13115_ = _8428_val;
  }
  else
  {
    _13115_ = std::shared_ptr< monty::ndarray< double,1 > >(new monty::ndarray< double,1 >(monty::shape((int)0)));
  }
  std::shared_ptr< monty::ndarray< double,1 > > _8429_vl = _13115_;
  _checked_ptr_1<double> _ptr__8429_vl(_8429_vl ? _8429_vl->raw() : nullptr,_8429_vl ? _8429_vl->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _13117_;
  bool _13118_ = (NULL != _8427_subj.get());
  if (_13118_)
  {
    _13117_ = _8427_subj;
  }
  else
  {
    _13117_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8430_sj = _13117_;
  _checked_ptr_1<int32_t> _ptr__8430_sj(_8430_sj ? _8430_sj->raw() : nullptr,_8430_sj ? _8430_sj->size(0) : 0);
  std::shared_ptr< monty::ndarray< int32_t,1 > > _13119_;
  bool _13120_ = (NULL != _8426_subi.get());
  if (_13120_)
  {
    _13119_ = _8426_subi;
  }
  else
  {
    _13119_ = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape((int)0)));
  }
  std::shared_ptr< monty::ndarray< int32_t,1 > > _8431_si = _13119_;
  _checked_ptr_1<int32_t> _ptr__8431_si(_8431_si ? _8431_si->raw() : nullptr,_8431_si ? _8431_si->size(0) : 0);
  int64_t _8432_nnz = (int64_t)((_8431_si)->size(0));
  if ((((int64_t)((_8430_sj)->size(0)) != _8432_nnz) || ((int64_t)((_8429_vl)->size(0)) != _8432_nnz)))
  {
    {
      throw ::mosek::fusion::SparseFormatError(std::string ("Arrays defining sparse data have different lengths"));
    }
  }
  {}
  return (::mosek::fusion::p_SparseMatrix::_new_SparseMatrix(_8424_nrow,_8425_ncol,_8431_si,_8430_sj,_8429_vl,_8432_nnz)).as<::mosek::fusion::Matrix>();
}
// End mosek.fusion.Matrix.sparse

// Begin mosek.fusion.Matrix.get
// End mosek.fusion.Matrix.get

// Begin mosek.fusion.Matrix.isSparse
// End mosek.fusion.Matrix.isSparse

// Begin mosek.fusion.Matrix.getDataAsArray
// End mosek.fusion.Matrix.getDataAsArray

// Begin mosek.fusion.Matrix.getDataAsTriplets
// End mosek.fusion.Matrix.getDataAsTriplets

// Begin mosek.fusion.Matrix.transpose
monty::rc_ptr< ::mosek::fusion::Matrix > mosek::fusion::Matrix :: transpose() { return __mosek_2fusion_2Matrix__transpose(); }
// End mosek.fusion.Matrix.transpose

// Begin mosek.fusion.Matrix.numNonzeros
// End mosek.fusion.Matrix.numNonzeros

// Begin mosek.fusion.Matrix.numColumns
// Method mosek.fusion.Matrix.numColumns @ bld/docker-win/final/default/src/fusion/Matrix.mbi:79:6-54
int32_t mosek::fusion::Matrix :: numColumns() { return mosek::fusion::p_Matrix::_get_impl(this)->numColumns(); }
int32_t mosek::fusion::p_Matrix::numColumns()
{
  return dimj;
}
// End mosek.fusion.Matrix.numColumns

// Begin mosek.fusion.Matrix.numRows
// Method mosek.fusion.Matrix.numRows @ bld/docker-win/final/default/src/fusion/Matrix.mbi:75:6-51
int32_t mosek::fusion::Matrix :: numRows() { return mosek::fusion::p_Matrix::_get_impl(this)->numRows(); }
int32_t mosek::fusion::p_Matrix::numRows()
{
  return dimi;
}
// End mosek.fusion.Matrix.numRows

void mosek::fusion::p_Matrix::destroy()
{
}
void mosek::fusion::Matrix::destroy() { mosek::fusion::p_Matrix::_get_impl(this)->destroy(); }
// } class Matrix
// class UnimplementedError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:284:4-292:5
// mosek.fusion.UnimplementedError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:288:8-291:9
mosek::fusion::UnimplementedError::UnimplementedError
  ( const std::string &  _8438_msg)
 : RuntimeException(_8438_msg)
  {
  }
// mosek.fusion.UnimplementedError.ctor

// } class UnimplementedError
// class FatalError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:273:4-281:5
// mosek.fusion.FatalError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:277:8-280:9
mosek::fusion::FatalError::FatalError
  ( const std::string &  _8439_msg)
 : RuntimeException(_8439_msg)
  {
  }
// mosek.fusion.FatalError.ctor

// } class FatalError
// class UnexpectedError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:257:4-270:5
// mosek.fusion.UnexpectedError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:266:8-269:9
mosek::fusion::UnexpectedError::UnexpectedError
  ( ::mosek::fusion::FusionException _8440_e)
 : RuntimeException(_8440_e.toString())
  {
  }
// mosek.fusion.UnexpectedError.ctor

// mosek.fusion.UnexpectedError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:261:8-264:9
mosek::fusion::UnexpectedError::UnexpectedError
  ( const std::string &  _8441_msg)
 : RuntimeException(_8441_msg)
  {
  }
// mosek.fusion.UnexpectedError.ctor

// } class UnexpectedError
// class SparseFormatError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:245:4-253:5
// mosek.fusion.SparseFormatError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:249:8-252:9
mosek::fusion::SparseFormatError::SparseFormatError
  ( const std::string &  _8442_msg)
 : mosek::fusion::FusionRuntimeException(_8442_msg)
  {
  }
// mosek.fusion.SparseFormatError.ctor

// } class SparseFormatError
// class SolutionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:229:4-242:5
// mosek.fusion.SolutionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:238:8-241:9
mosek::fusion::SolutionError::SolutionError
  ( )
 : mosek::fusion::FusionException(std::string ("Solution is invalid or undefined"))
  {
  }
// mosek.fusion.SolutionError.ctor

// mosek.fusion.SolutionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:233:8-236:9
mosek::fusion::SolutionError::SolutionError
  ( const std::string &  _8443_msg)
 : mosek::fusion::FusionException(_8443_msg)
  {
  }
// mosek.fusion.SolutionError.ctor

// } class SolutionError
// class SliceError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:213:4-226:5
// mosek.fusion.SliceError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:222:8-225:9
mosek::fusion::SliceError::SliceError
  ( )
 : mosek::fusion::FusionRuntimeException(std::string ("Invalid slice range"))
  {
  }
// mosek.fusion.SliceError.ctor

// mosek.fusion.SliceError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:217:8-220:9
mosek::fusion::SliceError::SliceError
  ( const std::string &  _8444_msg)
 : mosek::fusion::FusionRuntimeException(_8444_msg)
  {
  }
// mosek.fusion.SliceError.ctor

// } class SliceError
// class UpdateError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:196:4-209:5
// mosek.fusion.UpdateError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:205:8-208:9
mosek::fusion::UpdateError::UpdateError
  ( )
 : mosek::fusion::FusionRuntimeException(std::string ("Cannot update parameterized item"))
  {
  }
// mosek.fusion.UpdateError.ctor

// mosek.fusion.UpdateError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:200:8-203:9
mosek::fusion::UpdateError::UpdateError
  ( const std::string &  _8445_msg)
 : mosek::fusion::FusionRuntimeException(_8445_msg)
  {
  }
// mosek.fusion.UpdateError.ctor

// } class UpdateError
// class SetDefinitionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:185:4-193:5
// mosek.fusion.SetDefinitionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:189:8-192:9
mosek::fusion::SetDefinitionError::SetDefinitionError
  ( const std::string &  _8446_msg)
 : mosek::fusion::FusionRuntimeException(_8446_msg)
  {
  }
// mosek.fusion.SetDefinitionError.ctor

// } class SetDefinitionError
// class OptimizeError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:173:4-181:5
// mosek.fusion.OptimizeError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:177:8-180:9
mosek::fusion::OptimizeError::OptimizeError
  ( const std::string &  _8447_msg)
 : mosek::fusion::FusionRuntimeException(_8447_msg)
  {
  }
// mosek.fusion.OptimizeError.ctor

// } class OptimizeError
// class NameError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:162:4-170:5
// mosek.fusion.NameError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:166:8-169:9
mosek::fusion::NameError::NameError
  ( const std::string &  _8448_msg)
 : mosek::fusion::FusionRuntimeException(_8448_msg)
  {
  }
// mosek.fusion.NameError.ctor

// } class NameError
// class DeletionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:151:4-159:5
// mosek.fusion.DeletionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:155:8-158:9
mosek::fusion::DeletionError::DeletionError
  ( const std::string &  _8449_msg)
 : mosek::fusion::FusionRuntimeException(_8449_msg)
  {
  }
// mosek.fusion.DeletionError.ctor

// } class DeletionError
// class ModelError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:138:4-147:5
// mosek.fusion.ModelError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:143:8-146:9
mosek::fusion::ModelError::ModelError
  ( const std::string &  _8450_msg)
 : mosek::fusion::FusionRuntimeException(_8450_msg)
  {
  }
// mosek.fusion.ModelError.ctor

// } class ModelError
// class MatrixError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:128:4-133:5
// mosek.fusion.MatrixError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:132:8-55
mosek::fusion::MatrixError::MatrixError
  ( const std::string &  _8451_msg)
 : mosek::fusion::FusionRuntimeException(_8451_msg)
  {
  }
// mosek.fusion.MatrixError.ctor

// } class MatrixError
// class DimensionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:117:4-122:5
// mosek.fusion.DimensionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:121:8-56
mosek::fusion::DimensionError::DimensionError
  ( const std::string &  _8452_msg)
 : mosek::fusion::FusionRuntimeException(_8452_msg)
  {
  }
// mosek.fusion.DimensionError.ctor

// } class DimensionError
// class LengthError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:105:4-110:5
// mosek.fusion.LengthError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:109:8-56
mosek::fusion::LengthError::LengthError
  ( const std::string &  _8453_msg)
 : mosek::fusion::FusionRuntimeException(_8453_msg)
  {
  }
// mosek.fusion.LengthError.ctor

// } class LengthError
// class RangeError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:96:4-100:5
// mosek.fusion.RangeError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:99:8-56
mosek::fusion::RangeError::RangeError
  ( const std::string &  _8454_msg)
 : mosek::fusion::FusionRuntimeException(_8454_msg)
  {
  }
// mosek.fusion.RangeError.ctor

// } class RangeError
// class IndexError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:88:4-93:5
// mosek.fusion.IndexError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:92:8-56
mosek::fusion::IndexError::IndexError
  ( const std::string &  _8455_msg)
 : mosek::fusion::FusionRuntimeException(_8455_msg)
  {
  }
// mosek.fusion.IndexError.ctor

// } class IndexError
// class DomainError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:80:4-85:5
// mosek.fusion.DomainError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:84:6-54
mosek::fusion::DomainError::DomainError
  ( const std::string &  _8456_msg)
 : mosek::fusion::FusionRuntimeException(_8456_msg)
  {
  }
// mosek.fusion.DomainError.ctor

// } class DomainError
// class ValueConversionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:68:4-76:5
// mosek.fusion.ValueConversionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:72:6-75:7
mosek::fusion::ValueConversionError::ValueConversionError
  ( const std::string &  _8457_msg)
 : mosek::fusion::FusionRuntimeException(_8457_msg)
  {
  }
// mosek.fusion.ValueConversionError.ctor

// } class ValueConversionError
// class ParameterError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:57:4-65:5
// mosek.fusion.ParameterError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:61:6-64:7
mosek::fusion::ParameterError::ParameterError
  ( const std::string &  _8458_msg)
 : mosek::fusion::FusionRuntimeException(_8458_msg)
  {
  }
// mosek.fusion.ParameterError.ctor

// } class ParameterError
// class ExpressionError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:46:4-54:5
// mosek.fusion.ExpressionError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:50:6-53:7
mosek::fusion::ExpressionError::ExpressionError
  ( const std::string &  _8459_msg)
 : mosek::fusion::FusionRuntimeException(_8459_msg)
  {
  }
// mosek.fusion.ExpressionError.ctor

// } class ExpressionError
// class IOError { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:38:4-43:5
// mosek.fusion.IOError.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:42:8-56
mosek::fusion::IOError::IOError
  ( const std::string &  _8460_msg)
 : mosek::fusion::FusionRuntimeException(_8460_msg)
  {
  }
// mosek.fusion.IOError.ctor

// } class IOError
// class FusionRuntimeException { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:24:4-34:5
// mosek.fusion.FusionRuntimeException.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:28:6-68
mosek::fusion::FusionRuntimeException::FusionRuntimeException
  ( const std::string &  _8461_msg_)
 : RuntimeException(_8461_msg_)
  {
    msg = _8461_msg_;
  }
// mosek.fusion.FusionRuntimeException.ctor

// Begin mosek.fusion.FusionRuntimeException.toString
// Method mosek.fusion.FusionRuntimeException.toString @ bld/docker-win/final/default/src/fusion/Errors.mbi:33:6-53
std::string mosek::fusion::FusionRuntimeException::toString()
{
  return msg;
}
// End mosek.fusion.FusionRuntimeException.toString

// } class FusionRuntimeException
// class FusionException { // @ bld/docker-win/final/default/src/fusion/Errors.mbi:9:4-18:5
// mosek.fusion.FusionException.ctor @ bld/docker-win/final/default/src/fusion/Errors.mbi:13:6-67
mosek::fusion::FusionException::FusionException
  ( const std::string &  _8462_msg_)
 : Exception(_8462_msg_)
  {
    msg = _8462_msg_;
  }
// mosek.fusion.FusionException.ctor

// Begin mosek.fusion.FusionException.toString
// Method mosek.fusion.FusionException.toString @ bld/docker-win/final/default/src/fusion/Errors.mbi:17:6-53
std::string mosek::fusion::FusionException::toString()
{
  return msg;
}
// End mosek.fusion.FusionException.toString

// } class FusionException
// class LinkedBlocks { // @ bld/docker-win/final/default/src/fusion/LinkedList.monty:204:4-271:5
mosek::fusion::LinkedBlocks::LinkedBlocks(mosek::fusion::p_LinkedBlocks *_impl) : _impl(_impl) { /*std::cout << "LinkedBlocks() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::LinkedBlocks::~LinkedBlocks() { delete _impl; _impl = nullptr; }
mosek::fusion::p_LinkedBlocks::p_LinkedBlocks
  (::mosek::fusion::LinkedBlocks * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.LinkedBlocks.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:225:6-32
mosek::fusion::LinkedBlocks::t mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks
  ()
{ return new mosek::fusion::LinkedBlocks(); }
mosek::fusion::LinkedBlocks::LinkedBlocks
  () : 
   LinkedBlocks(new mosek::fusion::p_LinkedBlocks(this))
{ mosek::fusion::p_LinkedBlocks::_get_impl(this)->_initialize(); }
void mosek::fusion::p_LinkedBlocks::_initialize  ()
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_LinkedBlocks::_initialize((int)0);
  }
}
// mosek.fusion.LinkedBlocks.ctor

// mosek.fusion.LinkedBlocks.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:217:6-223:7
mosek::fusion::LinkedBlocks::t mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks
  (int32_t _8463_n)
{ return new mosek::fusion::LinkedBlocks(_8463_n); }
mosek::fusion::LinkedBlocks::LinkedBlocks
  (int32_t _8463_n) : 
   LinkedBlocks(new mosek::fusion::p_LinkedBlocks(this))
{ mosek::fusion::p_LinkedBlocks::_get_impl(this)->_initialize(_8463_n); }
void mosek::fusion::p_LinkedBlocks::_initialize  (int32_t _8463_n)
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    int32_t _8464_basesize = (int)128;
    ints = ::mosek::fusion::p_LinkedInts::_new_LinkedInts(_8463_n);
    blocks = ::mosek::fusion::p_LinkedInts::_new_LinkedInts(_8464_basesize);
    bsize = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8464_basesize)));
    bfirst = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8464_basesize)));
  }
}
// mosek.fusion.LinkedBlocks.ctor

// mosek.fusion.LinkedBlocks.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:210:6-215:7
mosek::fusion::LinkedBlocks::t mosek::fusion::p_LinkedBlocks::_new_LinkedBlocks
  (monty::rc_ptr< ::mosek::fusion::LinkedBlocks > _8465_other)
{ return new mosek::fusion::LinkedBlocks(_8465_other); }
mosek::fusion::LinkedBlocks::LinkedBlocks
  (monty::rc_ptr< ::mosek::fusion::LinkedBlocks > _8465_other) : 
   LinkedBlocks(new mosek::fusion::p_LinkedBlocks(this))
{ mosek::fusion::p_LinkedBlocks::_get_impl(this)->_initialize(_8465_other); }
void mosek::fusion::p_LinkedBlocks::_initialize  (monty::rc_ptr< ::mosek::fusion::LinkedBlocks > _8465_other)
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    ints = ::mosek::fusion::p_LinkedInts::_new_LinkedInts(mosek::fusion::p_LinkedBlocks::_get_impl(_8465_other)->ints);
    blocks = ::mosek::fusion::p_LinkedInts::_new_LinkedInts(mosek::fusion::p_LinkedBlocks::_get_impl(_8465_other)->blocks);
    bsize = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinkedBlocks::_get_impl(_8465_other)->bsize);
    bfirst = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinkedBlocks::_get_impl(_8465_other)->bfirst);
  }
}
// mosek.fusion.LinkedBlocks.ctor

// Begin mosek.fusion.LinkedBlocks.free
// Method mosek.fusion.LinkedBlocks.free @ bld/docker-win/final/default/src/fusion/LinkedList.monty:264:6-270:7
void mosek::fusion::LinkedBlocks :: free(int32_t _8466_bkey) { mosek::fusion::p_LinkedBlocks::_get_impl(this)->free(_8466_bkey); }
void mosek::fusion::p_LinkedBlocks::free(int32_t _8466_bkey)
{
  int32_t _8467_key = ((*bfirst)(_8466_bkey));
  ints->free(_8467_key,((*bsize)(_8466_bkey)));
  ((*bsize)(_8466_bkey)) = (-(int)1);
  ((*bfirst)(_8466_bkey)) = (-(int)1);
  blocks->free(_8466_bkey,(int)1);
}
// End mosek.fusion.LinkedBlocks.free

// Begin mosek.fusion.LinkedBlocks.alloc
// Method mosek.fusion.LinkedBlocks.alloc @ bld/docker-win/final/default/src/fusion/LinkedList.monty:246:6-262:7
int32_t mosek::fusion::LinkedBlocks :: alloc(int32_t _8468_size) { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->alloc(_8468_size); }
int32_t mosek::fusion::p_LinkedBlocks::alloc(int32_t _8468_size)
{
  int32_t _13121_;
  bool _13122_ = (_8468_size > (int)0);
  if (_13122_)
  {
    _13121_ = ints->alloc(_8468_size);
  }
  else
  {
    _13121_ = (-(int)1);
  }
  int32_t _8469_key = _13121_;
  int32_t _8470_bkey = blocks->alloc();
  if ((blocks->capacity() > (int)((bsize)->size(0))))
  {
    {
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8471_nbsize = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      _checked_ptr_1<int32_t> _ptr__8471_nbsize(_8471_nbsize ? _8471_nbsize->raw() : nullptr,_8471_nbsize ? _8471_nbsize->size(0) : 0);
      std::shared_ptr< monty::ndarray< int32_t,1 > > _8472_nbfirst = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(blocks->capacity())));
      _checked_ptr_1<int32_t> _ptr__8472_nbfirst(_8472_nbfirst ? _8472_nbfirst->raw() : nullptr,_8472_nbfirst ? _8472_nbfirst->size(0) : 0);
      ::mosek::fusion::Utils::Tools::arraycopy(bsize,(int)0,_8471_nbsize,(int)0,(int)((bsize)->size(0)));
      ::mosek::fusion::Utils::Tools::arraycopy(bfirst,(int)0,_8472_nbfirst,(int)0,(int)((bfirst)->size(0)));
      bsize = _8471_nbsize;
      bfirst = _8472_nbfirst;
    }
  }
  {}
  ((*bfirst)(_8470_bkey)) = _8469_key;
  ((*bsize)(_8470_bkey)) = _8468_size;
  return _8470_bkey;
}
// End mosek.fusion.LinkedBlocks.alloc

// Begin mosek.fusion.LinkedBlocks.maxidx
// Method mosek.fusion.LinkedBlocks.maxidx @ bld/docker-win/final/default/src/fusion/LinkedList.monty:242:6-244:7
int32_t mosek::fusion::LinkedBlocks :: maxidx(int32_t _8473_bkey) { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->maxidx(_8473_bkey); }
int32_t mosek::fusion::p_LinkedBlocks::maxidx(int32_t _8473_bkey)
{
  return ints->maxidx(((*bfirst)(_8473_bkey)),((*bsize)(_8473_bkey)));
}
// End mosek.fusion.LinkedBlocks.maxidx

// Begin mosek.fusion.LinkedBlocks.numallocated
// Method mosek.fusion.LinkedBlocks.numallocated @ bld/docker-win/final/default/src/fusion/LinkedList.monty:240:6-72
int32_t mosek::fusion::LinkedBlocks :: numallocated() { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->numallocated(); }
int32_t mosek::fusion::p_LinkedBlocks::numallocated()
{
  return ints->numallocated();
}
// End mosek.fusion.LinkedBlocks.numallocated

// Begin mosek.fusion.LinkedBlocks.get
// Method mosek.fusion.LinkedBlocks.get @ bld/docker-win/final/default/src/fusion/LinkedList.monty:234:6-238:7
void mosek::fusion::LinkedBlocks :: get(int32_t _8474_bkey,std::shared_ptr< monty::ndarray< int32_t,1 > > _8475_target,int32_t _8476_offset) { mosek::fusion::p_LinkedBlocks::_get_impl(this)->get(_8474_bkey,_8475_target,_8476_offset); }
void mosek::fusion::p_LinkedBlocks::get(int32_t _8474_bkey,std::shared_ptr< monty::ndarray< int32_t,1 > > _8475_target,int32_t _8476_offset)
{
  _checked_ptr_1<int32_t> _ptr__8475_target(_8475_target ? _8475_target->raw() : nullptr, _8475_target ? _8475_target->size(0) : 0);
  ints->get(((*bfirst)(_8474_bkey)),((*bsize)(_8474_bkey)),_8475_target,_8476_offset);
}
// End mosek.fusion.LinkedBlocks.get

// Begin mosek.fusion.LinkedBlocks.numblocks
// Method mosek.fusion.LinkedBlocks.numblocks @ bld/docker-win/final/default/src/fusion/LinkedList.monty:232:6-60
int32_t mosek::fusion::LinkedBlocks :: numblocks() { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->numblocks(); }
int32_t mosek::fusion::p_LinkedBlocks::numblocks()
{
  return (int)((bsize)->size(0));
}
// End mosek.fusion.LinkedBlocks.numblocks

// Begin mosek.fusion.LinkedBlocks.blocksize
// Method mosek.fusion.LinkedBlocks.blocksize @ bld/docker-win/final/default/src/fusion/LinkedList.monty:231:6-71
int32_t mosek::fusion::LinkedBlocks :: blocksize(int32_t _8477_bkey) { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->blocksize(_8477_bkey); }
int32_t mosek::fusion::p_LinkedBlocks::blocksize(int32_t _8477_bkey)
{
  return ((*bsize)(_8477_bkey));
}
// End mosek.fusion.LinkedBlocks.blocksize

// Begin mosek.fusion.LinkedBlocks.block_capacity
// Method mosek.fusion.LinkedBlocks.block_capacity @ bld/docker-win/final/default/src/fusion/LinkedList.monty:230:6-73
int32_t mosek::fusion::LinkedBlocks :: block_capacity() { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->block_capacity(); }
int32_t mosek::fusion::p_LinkedBlocks::block_capacity()
{
  return blocks->capacity();
}
// End mosek.fusion.LinkedBlocks.block_capacity

// Begin mosek.fusion.LinkedBlocks.capacity
// Method mosek.fusion.LinkedBlocks.capacity @ bld/docker-win/final/default/src/fusion/LinkedList.monty:229:6-65
int32_t mosek::fusion::LinkedBlocks :: capacity() { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->capacity(); }
int32_t mosek::fusion::p_LinkedBlocks::capacity()
{
  return ints->capacity();
}
// End mosek.fusion.LinkedBlocks.capacity

// Begin mosek.fusion.LinkedBlocks.validate
// Method mosek.fusion.LinkedBlocks.validate @ bld/docker-win/final/default/src/fusion/LinkedList.monty:227:6-86
bool mosek::fusion::LinkedBlocks :: validate() { return mosek::fusion::p_LinkedBlocks::_get_impl(this)->validate(); }
bool mosek::fusion::p_LinkedBlocks::validate()
{
  return (ints->validate() && blocks->validate());
}
// End mosek.fusion.LinkedBlocks.validate

void mosek::fusion::p_LinkedBlocks::destroy()
{
bfirst.reset();
bsize.reset();
blocks.reset();
ints.reset();
}
void mosek::fusion::LinkedBlocks::destroy() { mosek::fusion::p_LinkedBlocks::_get_impl(this)->destroy(); }
// } class LinkedBlocks
// class LinkedInts { // @ bld/docker-win/final/default/src/fusion/LinkedList.monty:4:4-201:5
mosek::fusion::LinkedInts::LinkedInts(mosek::fusion::p_LinkedInts *_impl) : _impl(_impl) { /*std::cout << "LinkedInts() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::LinkedInts::~LinkedInts() { delete _impl; _impl = nullptr; }
mosek::fusion::p_LinkedInts::p_LinkedInts
  (::mosek::fusion::LinkedInts * _pubthis) :     _pubthis(_pubthis)
{}
// mosek.fusion.LinkedInts.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:73:6-85:7
mosek::fusion::LinkedInts::t mosek::fusion::p_LinkedInts::_new_LinkedInts
  (int32_t _8478_cap_)
{ return new mosek::fusion::LinkedInts(_8478_cap_); }
mosek::fusion::LinkedInts::LinkedInts
  (int32_t _8478_cap_) : 
   LinkedInts(new mosek::fusion::p_LinkedInts(this))
{ mosek::fusion::p_LinkedInts::_get_impl(this)->_initialize(_8478_cap_); }
void mosek::fusion::p_LinkedInts::_initialize  (int32_t _8478_cap_)
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    int32_t _13123_;
    bool _13124_ = (_8478_cap_ > (int)0);
    if (_13124_)
    {
      _13123_ = _8478_cap_;
    }
    else
    {
      _13123_ = (int)128;
    }
    int32_t _8479_cap = _13123_;
    next = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8479_cap)));
    prev = std::shared_ptr< monty::ndarray< int32_t,1 > >(new monty::ndarray< int32_t,1 >(monty::shape(_8479_cap)));
    first_used = (-(int)1);
    first_free = (int)0;
    last_free = (_8479_cap - (int)1);
    int32_t _13125_ = (int)1;
    int32_t _13126_ = _8479_cap;
    for (int32_t _8480_i = _13125_; _8480_i < _13126_; ++_8480_i)
    {
      {
        ((*prev)(_8480_i)) = (_8480_i - (int)1);
        ((*next)((_8480_i - (int)1))) = _8480_i;
      }
    }
    ((*prev)((int)0)) = (-(int)1);
    ((*next)((_8479_cap - (int)1))) = (-(int)1);
    nfree = _8479_cap;
  }
}
// mosek.fusion.LinkedInts.ctor

// mosek.fusion.LinkedInts.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:71:6-34
mosek::fusion::LinkedInts::t mosek::fusion::p_LinkedInts::_new_LinkedInts
  ()
{ return new mosek::fusion::LinkedInts(); }
mosek::fusion::LinkedInts::LinkedInts
  () : 
   LinkedInts(new mosek::fusion::p_LinkedInts(this))
{ mosek::fusion::p_LinkedInts::_get_impl(this)->_initialize(); }
void mosek::fusion::p_LinkedInts::_initialize  ()
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    mosek::fusion::p_LinkedInts::_initialize((int)128);
  }
}
// mosek.fusion.LinkedInts.ctor

// mosek.fusion.LinkedInts.ctor @ bld/docker-win/final/default/src/fusion/LinkedList.monty:62:6-69:7
mosek::fusion::LinkedInts::t mosek::fusion::p_LinkedInts::_new_LinkedInts
  (monty::rc_ptr< ::mosek::fusion::LinkedInts > _8481_other)
{ return new mosek::fusion::LinkedInts(_8481_other); }
mosek::fusion::LinkedInts::LinkedInts
  (monty::rc_ptr< ::mosek::fusion::LinkedInts > _8481_other) : 
   LinkedInts(new mosek::fusion::p_LinkedInts(this))
{ mosek::fusion::p_LinkedInts::_get_impl(this)->_initialize(_8481_other); }
void mosek::fusion::p_LinkedInts::_initialize  (monty::rc_ptr< ::mosek::fusion::LinkedInts > _8481_other)
{
monty::rc_reserve __reserve_this(_pubthis); 
  {
    next = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->next);
    prev = ::mosek::fusion::Utils::Tools::arraycopy(mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->prev);
    first_used = mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->first_used;
    first_free = mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->first_free;
    last_free = mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->last_free;
    nfree = mosek::fusion::p_LinkedInts::_get_impl(_8481_other)->nfree;
  }
}
// mosek.fusion.LinkedInts.ctor

// Begin mosek.fusion.LinkedInts.free
// Method mosek.fusion.LinkedInts.free @ bld/docker-win/final/default/src/fusion/LinkedList.monty:181:6-200:7
void mosek::fusion::LinkedInts :: free(int32_t _8482_i,int32_t _8483_num) { mosek::fusion::p_LinkedInts::_get_impl(this)->free(_8482_i,_8483_num); }
void mosek::fusion::p_LinkedInts::free(int32_t _8482_i,int32_t _8483_num)
{
  int32_t _8484_i0 = _8482_i;
  int32_t _8485_i1 = _8484_i0;
  int32_t _13127_ = (int)0;
  int32_t _13128_ = (_8483_num - (int)1);
  for (int32_t _8486_k = _13127_; _8486_k < _13128_; ++_8486_k)
  {
    {
      _8485_i1 = ((*next)(_8485_i1));
    }
  }
  int32_t _8487_p0 = ((*prev)(_8484_i0));
  int32_t _8488_n1 = ((*next)(_8485_i1));
  if ((_8487_p0 >= (int)0))
  {
    {
      ((*next)(_8487_p0)) = _8488_n1;
    }
  }
  else
  {
    {
      first_used = _8488_n1;
    }
  }
  if ((_8488_n1 >= (int)0))
  {
    {
      ((*prev)(_8488_n1)) = _8487_p0;
    }
  }
  {}
  ((*prev)(_8484_i0)) = (-(int)1);
  ((*next)(_8485_i1)) = first_free;
  if ((first_free >= (int)0))
  {
    {
      ((*prev)(first_free)) = _8485_i1;
    }
  }
  {}
  first_free = _8484_i0;
  if ((last_free < (int)0))
  {
    {
      last_free = _8485_i1;
    }
  }
  {}
  nfree += _8483_num;
}
// End mosek.fusion.LinkedInts.free

// Begin mosek.fusion.LinkedInts.alloc
// Method mosek.fusion.LinkedInts.alloc @ bld/docker-win/final/default/src/fusion/LinkedList.monty:177:6-179:7
int32_t mosek::fusion::LinkedInts :: alloc() { return mosek::fusion::p_LinkedInts::_get_impl(this)->alloc(); }
int32_t mosek::fusion::p_LinkedInts::alloc()
{
  return allocblock((int)1);
}
// End mosek.fusion.LinkedInts.alloc

// Begin mosek.fusion.LinkedInts.alloc
// Method mosek.fusion.LinkedInts.alloc @ bld/docker-win/final/default/src/fusion/LinkedList.monty:173:6-175:7
int32_t mosek::fusion::LinkedInts :: alloc(int32_t _8489_n) { return mosek::fusion::p_LinkedInts::_get_impl(this)->alloc(_8489_n); }
int32_t mosek::fusion::p_LinkedInts::alloc(int32_t _8489_n)
{
  return allocblock(_8489_n);
}
// End mosek.fusion.LinkedInts.alloc

// Begin mosek.fusion.LinkedInts.alloc
// Method mosek.fusion.LinkedInts.alloc @ bld/docker-win/final/default/src/fusion/LinkedList.monty:165:6-171:7
void mosek::fusion::LinkedInts :: alloc(int32_t _8490_num,std::shared_ptr< monty::ndarray< int32_t,1 > > _8491_target,int32_t _8492_offset) { mosek::fusion::p_LinkedInts::_get_impl(this)->alloc(_8490_num,_8491_target,_8492_offset); }
void mosek::fusion::p_LinkedInts::alloc(int32_t _8490_num,std::shared_ptr< monty::ndarray< int32_t,1 > > _8491_target,int32_t _8492_offset)
{
  _checked_ptr_1<int32_t> _ptr__8491_target(_8491_target ? _8491_target->raw() : nullptr, _8491_target ? _8491_target->size(0) : 0);
  int32_t _8493_i = allocblock(_8490_num);
  int32_t _13129_ = (int)0;
  int32_t _13130_ = _8490_num;
  for (int32_t _8494_j = _13129_; _8494_j < _13130_; ++_8494_j)
  {
    {
      _ptr__8491_target[safe_add( _8494_j,_8492_offset )] = _8493_i;
      _8493_i = ((*next)(_8493_i));
    }
  }
}
// End mosek.fusion.LinkedInts.alloc

// Begin mosek.fusion.LinkedInts.get
// Method mosek.fusion.LinkedInts.get @ bld/docker-win/final/default/src/fusion/LinkedList.monty:157:6-163:7
void mosek::fusion::LinkedInts :: get(int32_t _8495_i,int32_t _8496_num,std::shared_ptr< monty::ndarray< int32_t,1 > > _8497_target,int32_t _8498_offset) { mosek::fusion::p_LinkedInts::_get_impl(this)->get(_8495_i,_8496_num,_8497_target,_8498_offset); }
void mosek::fusion::p_LinkedInts::get(int32_t _8495_i,int32_t _8496_num,std::shared_ptr< monty::ndarray< int32_t,1 > > _8497_target,int32_t _8498_offset)
{
  _checked_ptr_1<int32_t> _ptr__8497_target(_8497_target ? _8497_target->raw() : nullptr, _8497_target ? _8497_target->size(0) : 0);
  int32_t _8499_ii = _8495_i;
  int32_t _13131_ = (int)0;
  int32_t _13132_ = _8496_num;
  for (int32_t _8500_j = _13131_; _8500_j < _13132_; ++_8500_j)
  {
    {
      _ptr__8497_target[safe_add( _8500_j,_8498_offset )] = _8499_ii;
      _8499_ii = ((*next)(_8499_ii));
    }
  }
}
// End mosek.fusion.LinkedInts.get

// Begin mosek.fusion.LinkedInts.numallocated
// Method mosek.fusion.LinkedInts.numallocated @ bld/docker-win/final/default/src/fusion/LinkedList.monty:155:6-68
int32_t mosek::fusion::LinkedInts :: numallocated() { return mosek::fusion::p_LinkedInts::_get_impl(this)->numallocated(); }
int32_t mosek::fusion::p_LinkedInts::numallocated()
{
  return ((int)((next)->size(0)) - nfree);
}
// End mosek.fusion.LinkedInts.numallocated

// Begin mosek.fusion.LinkedInts.maxidx
// Method mosek.fusion.LinkedInts.maxidx @ bld/docker-win/final/default/src/fusion/LinkedList.monty:144:6-152:7
int32_t mosek::fusion::LinkedInts :: maxidx(int32_t _8501_i,int32_t _8502_num) { return mosek::fusion::p_LinkedInts::_get_impl(this)->maxidx(_8501_i,_8502_num); }
int32_t mosek::fusion::p_LinkedInts::maxidx(int32_t _8501_i,int32_t _8502_num)
{
  int32_t _8503_maxi = _8501_i;
  int32_t _8504_ii = _8501_i;
  int32_t _13133_ = (int)1;
  int32_t _13134_ = _8502_num;
  for (int32_t _8505_j = _13133_; _8505_j < _13134_; ++_8505_j)
  {
    {
      _8504_ii = ((*next)(_8504_ii));
      if ((_8503_maxi < _8504_ii))
      {
        {
          _8503_maxi = _8504_ii;
        }
      }
      {}
    }
  }
  return _8503_maxi;
}
// End mosek.fusion.LinkedInts.maxidx

// Begin mosek.fusion.LinkedInts.allocblock
// Method mosek.fusion.LinkedInts.allocblock @ bld/docker-win/final/default/src/fusion/LinkedList.monty:116:6-141:7
int32_t mosek::fusion::p_LinkedInts::allocblock(int32_t _8506_num)
{
  int32_t _8507_cap = (int)((next)->size(0));
  if ((nfree < _8506_num))
  {
    {
      int32_t _8508_nalloc = (_8506_num - nfree);
      if ((_8508_nalloc < _8507_cap))
      {
        {
          _8508_nalloc = _8507_cap;
        }
      }
      {}
      recap(safe_add( _8508_nalloc,_8507_cap ));
    }
  }
  {}
  int32_t _8509_i0 = first_free;
  int32_t _8510_i1 = _8509_i0;
  int32_t _13135_ = (int)0;
  int32_t _13136_ = (_8506_num - (int)1);
  for (int32_t _8511_i = _13135_; _8511_i < _13136_; ++_8511_i)
  {
    {
      _8510_i1 = ((*next)(_8510_i1));
    }
  }
  first_free = ((*next)(_8510_i1));
  if ((first_free < (int)0))
  {
    {
      last_free = (-(int)1);
    }
  }
  else
  {
    {
      ((*prev)(first_free)) = (-(int)1);
    }
  }
  ((*next)(_8510_i1)) = first_used;
  if ((first_used >= (int)0))
  {
    {
      ((*prev)(first_used)) = _8510_i1;
    }
  }
  {}
  first_used = _8509_i0;
  nfree -= _8506_num;
  return _8509_i0;
}
// End mosek.fusion.LinkedInts.allocblock

// Begin mosek.fusion.LinkedInts.recap
// Method mosek.fusion.LinkedInts.recap @ bld/docker-win/final/default/src/fusion/LinkedList.monty:89:6-113:7
void mosek::fusion::p_LinkedInts::recap(int32_t _8512_ncap)
{
  int32_t _8513_cap = (int)((next)->size(0));
  if ((_8512_ncap > _8513_cap))
  {
    {
      next = ::mosek::fusion::p_CommonTools::resize(next,_8512_ncap);
      prev = ::mosek::fusion::p_CommonTools::resize(prev,_8512_ncap);
      int32_t _13137_ = _8513_cap;
      int32_t _13138_ = (_8512_ncap - (int)1);
      for (int32_t _8514_i = _13137_; _8514_i < _13138_; ++_8514_i)
      {
        {
          ((*next)(_8514_i)) = safe_add( _8514_i,(int)1 );
          ((*prev)(safe_add( _8514_i,(int)1 ))) = _8514_i;
        }
      }
      ((*next)((_8512_ncap - (int)1))) = (-(int)1);
      ((*prev)(_8513_cap)) = last_free;
      if ((last_free < (int)0))
      {
        {
          first_free = _8513_cap;
        }
      }
      else
      {
        {
          ((*next)(last_free)) = _8513_cap;
        }
      }
      last_free = (_8512_ncap - (int)1);
      nfree += (_8512_ncap - _8513_cap);
    }
  }
  {}
}
// End mosek.fusion.LinkedInts.recap

// Begin mosek.fusion.LinkedInts.capacity
// Method mosek.fusion.LinkedInts.capacity @ bld/docker-win/final/default/src/fusion/LinkedList.monty:87:6-58
int32_t mosek::fusion::LinkedInts :: capacity() { return mosek::fusion::p_LinkedInts::_get_impl(this)->capacity(); }
int32_t mosek::fusion::p_LinkedInts::capacity()
{
  return (int)((next)->size(0));
}
// End mosek.fusion.LinkedInts.capacity

// Begin mosek.fusion.LinkedInts.validate
// Method mosek.fusion.LinkedInts.validate @ bld/docker-win/final/default/src/fusion/LinkedList.monty:16:6-60:7
bool mosek::fusion::LinkedInts :: validate() { return mosek::fusion::p_LinkedInts::_get_impl(this)->validate(); }
bool mosek::fusion::p_LinkedInts::validate()
{
  std::shared_ptr< monty::ndarray< bool,1 > > _8515_flags = std::shared_ptr< monty::ndarray< bool,1 > >(new monty::ndarray< bool,1 >(monty::shape((int)((next)->size(0)))));
  int32_t _8516_p = first_used;
  while ( (_8516_p >= (int)0) )
  {
    {
      ((*_8515_flags)(_8516_p)) = true;
      _8516_p = ((*next)(_8516_p));
      if (((_8516_p >= (int)0) && ((*_8515_flags)(_8516_p))))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("used list/next is inconsistent"));
        }
      }
      {}
    }
  }
  _8516_p = first_free;
  int32_t _8517_n = (int)0;
  while ( (_8516_p >= (int)0) )
  {
    {
      ++ _8517_n;
      ((*_8515_flags)(_8516_p)) = true;
      _8516_p = ((*next)(_8516_p));
      if (((_8516_p >= (int)0) && ((*_8515_flags)(_8516_p))))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("free list/next is inconsistent"));
        }
      }
      {}
    }
  }
  if ((_8517_n != nfree))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("free next list did not contain nfree elements"));
    }
  }
  {}
  int32_t _13139_ = (int)0;
  int32_t _13140_ = (int)((_8515_flags)->size(0));
  for (int32_t _8518_i = _13139_; _8518_i < _13140_; ++_8518_i)
  {
    {
      if ((!((*_8515_flags)(_8516_p))))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("elements missing from used+free list"));
        }
      }
      {}
    }
  }
  int32_t _13141_ = (int)0;
  int32_t _13142_ = (int)((_8515_flags)->size(0));
  for (int32_t _8519_i = _13141_; _8519_i < _13142_; ++_8519_i)
  {
    {
      ((*_8515_flags)(_8519_i)) = false;
    }
  }
  _8516_p = last_free;
  int32_t _8520_n = (int)0;
  while ( (_8516_p >= (int)0) )
  {
    {
      ++ _8520_n;
      ((*_8515_flags)(_8516_p)) = true;
      _8516_p = ((*prev)(_8516_p));
      if (((_8516_p >= (int)0) && ((*_8515_flags)(_8516_p))))
      {
        {
          throw ::mosek::fusion::UnexpectedError(std::string ("prev list is inconsistent"));
        }
      }
      {}
    }
  }
  if ((_8520_n != nfree))
  {
    {
      throw ::mosek::fusion::UnexpectedError(std::string ("free prev list did not contain nfree elements"));
    }
  }
  {}
  return true;
}
// End mosek.fusion.LinkedInts.validate

void mosek::fusion::p_LinkedInts::destroy()
{
prev.reset();
next.reset();
}
void mosek::fusion::LinkedInts::destroy() { mosek::fusion::p_LinkedInts::_get_impl(this)->destroy(); }
// } class LinkedInts
// class Parameters { // @ bld/docker-win/final/default/src/fusion/Parameters.mbi:4:4-6314:4
mosek::fusion::Parameters::Parameters(mosek::fusion::p_Parameters *_impl) : _impl(_impl) { /*std::cout << "Parameters() " << this << std::endl;*/ _impl->_pubthis = this; }
mosek::fusion::Parameters::~Parameters() { delete _impl; _impl = nullptr; }
mosek::fusion::p_Parameters::p_Parameters
  (::mosek::fusion::Parameters * _pubthis) :     _pubthis(_pubthis)
{}
// Begin mosek.fusion.Parameters.setParameter
// Method mosek.fusion.Parameters.setParameter @ bld/docker-win/final/default/src/fusion/Parameters.mbi:4863:0-6311:1
void mosek::fusion::Parameters::setParameter
  ( monty::rc_ptr< ::mosek::fusion::Model > _8521_M,
    const std::string & _8522_name,
    double _8523_value) { mosek::fusion::p_Parameters::setParameter(_8521_M,_8522_name,_8523_value); }
void mosek::fusion::p_Parameters::setParameter(monty::rc_ptr< ::mosek::fusion::Model > _8521_M,const std::string & _8522_name,double _8523_value)
{
  if (false)
  {
    {
    }
  }
  else if((_8522_name == std::string ("autoUpdateSolInfo")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (autoUpdateSolInfo)"));
    }
  }
  else if((_8522_name == std::string ("removeUnusedSolutions")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (removeUnusedSolutions)"));
    }
  }
  {}
  if ((_8522_name == std::string ("numThreads")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8524_v = _8523_value;
          if (((int)0 <= _8524_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_NUM_THREADS"),_8524_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (numThreads)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (numThreads)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mtSpincount")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8525_v = _8523_value;
          if ((((int)0 <= _8525_v) && (_8525_v <= (int)1000000000)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MT_SPINCOUNT"),_8525_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mtSpincount)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mtSpincount)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("optimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizer)"));
    }
  }
  {}
  if ((_8522_name == std::string ("biMaxIterations")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8526_v = _8523_value;
          if (((int)0 <= _8526_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_BI_MAX_ITERATIONS"),_8526_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biMaxIterations)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("licenseTrhExpiryWrn")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8527_v = _8523_value;
          if (((int)0 <= _8527_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_TRH_EXPIRY_WRN"),_8527_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseTrhExpiryWrn)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseTrhExpiryWrn)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logCutSecondOpt")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8528_v = _8523_value;
          if (((int)0 <= _8528_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_CUT_SECOND_OPT"),_8528_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logCutSecondOpt)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logCutSecondOpt)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logResponse")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8529_v = _8523_value;
          if (((int)0 <= _8529_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_RESPONSE"),_8529_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logResponse)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logResponse)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("logLocalInfo")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logLocalInfo)"));
    }
  }
  {}
  if ((_8522_name == std::string ("logBi")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8530_v = _8523_value;
          if (((int)0 <= _8530_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI"),_8530_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBi)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBi)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logBiFreq")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8531_v = _8523_value;
          if (((int)0 <= _8531_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI_FREQ"),_8531_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBiFreq)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBiFreq)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("biCleanOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biCleanOptimizer)"));
    }
  }
  else if((_8522_name == std::string ("intpntStartingPoint")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntStartingPoint)"));
    }
  }
  else if((_8522_name == std::string ("intpntDiffStep")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntDiffStep)"));
    }
  }
  else if((_8522_name == std::string ("intpntScaling")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntScaling)"));
    }
  }
  else if((_8522_name == std::string ("intpntSolveForm")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntSolveForm)"));
    }
  }
  {}
  if ((_8522_name == std::string ("logIntpnt")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8532_v = _8523_value;
          if (((int)0 <= _8532_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INTPNT"),_8532_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logIntpnt)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logIntpnt)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntMaxIterations")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8533_v = _8523_value;
          if (((int)0 <= _8533_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_ITERATIONS"),_8533_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxIterations)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntOffColTrh")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8534_v = _8523_value;
          if (((int)0 <= _8534_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_OFF_COL_TRH"),_8534_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOffColTrh)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOffColTrh)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("intpntOrderMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderMethod)"));
    }
  }
  {}
  if ((_8522_name == std::string ("intpntOrderGpNumSeeds")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8535_v = _8523_value;
          if (((int)0 <= _8535_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_ORDER_GP_NUM_SEEDS"),_8535_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderGpNumSeeds)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderGpNumSeeds)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("intpntBasis")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntBasis)"));
    }
  }
  else if((_8522_name == std::string ("biIgnoreMaxIter")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreMaxIter)"));
    }
  }
  else if((_8522_name == std::string ("biIgnoreNumError")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreNumError)"));
    }
  }
  {}
  if ((_8522_name == std::string ("intpntMaxNumCor")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8536_v = _8523_value;
          if (((-(int)1) <= _8536_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_NUM_COR"),_8536_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxNumCor)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxNumCor)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("presolveUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveUse)"));
    }
  }
  {}
  if ((_8522_name == std::string ("presolveLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8537_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LEVEL"),_8537_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logPresolve")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8538_v = _8523_value;
          if (((int)0 <= _8538_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_PRESOLVE"),_8538_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logPresolve)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logPresolve)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("presolveLindepUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepUse)"));
    }
  }
  else if((_8522_name == std::string ("presolveLindepNew")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepNew)"));
    }
  }
  {}
  if ((_8522_name == std::string ("presolveMaxNumPass")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8539_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_MAX_NUM_PASS"),_8539_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveMaxNumPass)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveMaxNumPass)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveEliminatorMaxNumTries")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8540_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_NUM_TRIES"),_8540_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxNumTries)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxNumTries)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveEliminatorMaxFill")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8541_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_FILL"),_8541_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxFill)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxFill)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simPrimalCrash")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8542_v = _8523_value;
          if (((int)0 <= _8542_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_CRASH"),_8542_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalCrash)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalCrash)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logSim")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8543_v = _8523_value;
          if (((int)0 <= _8543_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM"),_8543_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSim)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSim)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logSimMinor")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8544_v = _8523_value;
          if (((int)0 <= _8544_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_MINOR"),_8544_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimMinor)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimMinor)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logSimFreq")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8545_v = _8523_value;
          if (((int)0 <= _8545_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_FREQ"),_8545_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimFreq)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimFreq)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simPrimalRestrictSelection")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8546_v = _8523_value;
          if ((((int)0 <= _8546_v) && (_8546_v <= (int)100)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION"),_8546_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalRestrictSelection)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalRestrictSelection)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("simPrimalSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalSelection)"));
    }
  }
  {}
  if ((_8522_name == std::string ("simDualRestrictSelection")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8547_v = _8523_value;
          if ((((int)0 <= _8547_v) && (_8547_v <= (int)100)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION"),_8547_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualRestrictSelection)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualRestrictSelection)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("simDualSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualSelection)"));
    }
  }
  {}
  if ((_8522_name == std::string ("simMaxIterations")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8548_v = _8523_value;
          if (((int)0 <= _8548_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_ITERATIONS"),_8548_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxIterations)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxIterations)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("simHotstartLu")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstartLu)"));
    }
  }
  {}
  if ((_8522_name == std::string ("simRefactorFreq")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8549_v = _8523_value;
          if (((int)0 <= _8549_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_REFACTOR_FREQ"),_8549_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simRefactorFreq)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simRefactorFreq)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simSeed")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8550_v = _8523_value;
          if ((((int)0 <= _8550_v) && (_8550_v <= (int)32749)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SEED"),_8550_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSeed)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSeed)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioMode")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMode)"));
    }
  }
  {}
  if ((_8522_name == std::string ("logMio")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8551_v = _8523_value;
          if (((int)0 <= _8551_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO"),_8551_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMio)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMio)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logMioFreq")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8552_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO_FREQ"),_8552_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMioFreq)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMioFreq)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxNumRelaxs")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8553_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RELAXS"),_8553_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRelaxs)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRelaxs)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxNumBranches")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8554_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_BRANCHES"),_8554_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumBranches)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumBranches)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxNumRestarts")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8555_v = _8523_value;
          if (((int)0 <= _8555_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RESTARTS"),_8555_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRestarts)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRestarts)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxNumRootCutRounds")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8556_v = _8523_value;
          if (((int)0 <= _8556_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_ROOT_CUT_ROUNDS"),_8556_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRootCutRounds)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRootCutRounds)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxNumSolutions")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8557_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_SOLUTIONS"),_8557_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumSolutions)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumSolutions)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioNodeSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeSelection)"));
    }
  }
  else if((_8522_name == std::string ("mioVarSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVarSelection)"));
    }
  }
  {}
  if ((_8522_name == std::string ("mioMinRel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8558_v = _8523_value;
          if (((int)0 <= _8558_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MIN_REL"),_8558_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMinRel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMinRel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioHeuristicLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8559_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_HEURISTIC_LEVEL"),_8559_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioHeuristicLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioHeuristicLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioProbingLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8560_v = _8523_value;
          if ((((-(int)1) <= _8560_v) && (_8560_v <= (int)3)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PROBING_LEVEL"),_8560_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioProbingLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioProbingLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioSymmetryLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8561_v = _8523_value;
          if ((((-(int)1) <= _8561_v) && (_8561_v <= (int)4)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SYMMETRY_LEVEL"),_8561_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSymmetryLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSymmetryLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioDualRayAnalysisLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8562_v = _8523_value;
          if ((((-(int)1) <= _8562_v) && (_8562_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_DUAL_RAY_ANALYSIS_LEVEL"),_8562_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDualRayAnalysisLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDualRayAnalysisLevel)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioPresolveAggregatorUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPresolveAggregatorUse)"));
    }
  }
  {}
  if ((_8522_name == std::string ("mioNumericalEmphasisLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8563_v = _8523_value;
          if ((((int)0 <= _8563_v) && (_8563_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_NUMERICAL_EMPHASIS_LEVEL"),_8563_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNumericalEmphasisLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNumericalEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMemoryEmphasisLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8564_v = _8523_value;
          if ((((int)0 <= _8564_v) && (_8564_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MEMORY_EMPHASIS_LEVEL"),_8564_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMemoryEmphasisLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMemoryEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioCutSelectionLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8565_v = _8523_value;
          if ((((-(int)1) <= _8565_v) && (_8565_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_SELECTION_LEVEL"),_8565_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutSelectionLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutSelectionLevel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioVbDetectionLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8566_v = _8523_value;
          if ((((-(int)1) <= _8566_v) && (_8566_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_VB_DETECTION_LEVEL"),_8566_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVbDetectionLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVbDetectionLevel)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioBranchDir")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioBranchDir)"));
    }
  }
  else if((_8522_name == std::string ("mioRootOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootOptimizer)"));
    }
  }
  else if((_8522_name == std::string ("mioNodeOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeOptimizer)"));
    }
  }
  else if((_8522_name == std::string ("mioPerspectiveReformulate")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPerspectiveReformulate)"));
    }
  }
  else if((_8522_name == std::string ("mioPropagateObjectiveConstraint")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPropagateObjectiveConstraint)"));
    }
  }
  {}
  if ((_8522_name == std::string ("mioSeed")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8567_v = _8523_value;
          if (((int)0 <= _8567_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SEED"),_8567_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSeed)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSeed)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioConicOuterApproximation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConicOuterApproximation)"));
    }
  }
  else if((_8522_name == std::string ("mioQcqoReformulationMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioQcqoReformulationMethod)"));
    }
  }
  else if((_8522_name == std::string ("mioDataPermutationMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDataPermutationMethod)"));
    }
  }
  {}
  if ((_8522_name == std::string ("writeLpLineWidth")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8568_v = _8523_value;
          if (((int)40 <= _8568_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_WRITE_LP_LINE_WIDTH"),_8568_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpLineWidth)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpLineWidth)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("writeLpFullObj")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpFullObj)"));
    }
  }
  else if((_8522_name == std::string ("writeJsonIndentation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeJsonIndentation)"));
    }
  }
  else if((_8522_name == std::string ("infeasReportAuto")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasReportAuto)"));
    }
  }
  {}
  if ((_8522_name == std::string ("logInfeasAna")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8569_v = _8523_value;
          if (((int)0 <= _8569_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INFEAS_ANA"),_8569_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logInfeasAna)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logInfeasAna)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("licenseWait")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseWait)"));
    }
  }
  else if((_8522_name == std::string ("licenseSuppressExpireWrns")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseSuppressExpireWrns)"));
    }
  }
  {}
  if ((_8522_name == std::string ("licensePauseTime")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8570_v = _8523_value;
          if ((((int)0 <= _8570_v) && (_8570_v <= (int)1000000)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_PAUSE_TIME"),_8570_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licensePauseTime)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licensePauseTime)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("licenseDebug")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseDebug)"));
    }
  }
  {}
  if ((_8522_name == std::string ("log")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8571_v = _8523_value;
          if (((int)0 <= _8571_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG"),_8571_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (log)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (log)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logExpand")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8572_v = _8523_value;
          if (((int)0 <= _8572_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_EXPAND"),_8572_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logExpand)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logExpand)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logFile")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8573_v = _8523_value;
          if (((int)0 <= _8573_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_FILE"),_8573_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logFile)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logFile)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("logOrder")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8574_v = _8523_value;
          if (((int)0 <= _8574_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_ORDER"),_8574_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logOrder)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logOrder)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("simScaling")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScaling)"));
    }
  }
  else if((_8522_name == std::string ("simScalingMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScalingMethod)"));
    }
  }
  {}
  if ((_8522_name == std::string ("simPrimalPhaseoneMethod")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8575_v = _8523_value;
          if ((((int)0 <= _8575_v) && (_8575_v <= (int)10)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_PHASEONE_METHOD"),_8575_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalPhaseoneMethod)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simDualPhaseoneMethod")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8576_v = _8523_value;
          if ((((int)0 <= _8576_v) && (_8576_v <= (int)10)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_PHASEONE_METHOD"),_8576_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualPhaseoneMethod)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simMaxNumSetbacks")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8577_v = _8523_value;
          if (((int)0 <= _8577_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_NUM_SETBACKS"),_8577_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxNumSetbacks)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxNumSetbacks)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("simHotstart")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstart)"));
    }
  }
  else if((_8522_name == std::string ("simBasisFactorUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simBasisFactorUse)"));
    }
  }
  else if((_8522_name == std::string ("simDegen")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDegen)"));
    }
  }
  else if((_8522_name == std::string ("simReformulation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simReformulation)"));
    }
  }
  else if((_8522_name == std::string ("simExploitDupvec")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simExploitDupvec)"));
    }
  }
  else if((_8522_name == std::string ("simSaveLu")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSaveLu)"));
    }
  }
  else if((_8522_name == std::string ("simNonSingular")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simNonSingular)"));
    }
  }
  {}
  if ((_8522_name == std::string ("simDualCrash")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8578_v = _8523_value;
          if (((int)0 <= _8578_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_CRASH"),_8578_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualCrash)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualCrash)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("infeasPreferPrimal")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasPreferPrimal)"));
    }
  }
  {}
  if ((_8522_name == std::string ("mioRootRepeatPresolveLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8579_v = _8523_value;
          if ((((-(int)1) <= _8579_v) && (_8579_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_ROOT_REPEAT_PRESOLVE_LEVEL"),_8579_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootRepeatPresolveLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootRepeatPresolveLevel)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("mioCutCmir")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutCmir)"));
    }
  }
  else if((_8522_name == std::string ("mioCutClique")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutClique)"));
    }
  }
  else if((_8522_name == std::string ("mioCutImpliedBound")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutImpliedBound)"));
    }
  }
  else if((_8522_name == std::string ("mioCutKnapsackCover")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutKnapsackCover)"));
    }
  }
  else if((_8522_name == std::string ("mioCutGmi")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutGmi)"));
    }
  }
  else if((_8522_name == std::string ("mioCutLipro")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutLipro)"));
    }
  }
  else if((_8522_name == std::string ("mioConstructSol")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConstructSol)"));
    }
  }
  {}
  if ((_8522_name == std::string ("presolveLindepRelWorkTrh")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8580_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_REL_WORK_TRH"),_8580_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepRelWorkTrh)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepRelWorkTrh)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveLindepAbsWorkTrh")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8581_v = _8523_value;
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_ABS_WORK_TRH"),_8581_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepAbsWorkTrh)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepAbsWorkTrh)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("cacheLicense")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (cacheLicense)"));
    }
  }
  else if((_8522_name == std::string ("intpntRegularizationUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntRegularizationUse)"));
    }
  }
  else if((_8522_name == std::string ("simSolveForm")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSolveForm)"));
    }
  }
  else if((_8522_name == std::string ("simSwitchOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSwitchOptimizer)"));
    }
  }
  {}
  if ((_8522_name == std::string ("mioRinsMaxNodes")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8582_v = _8523_value;
          if (((-(int)1) <= _8582_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_RINS_MAX_NODES"),_8582_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRinsMaxNodes)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRinsMaxNodes)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioFeaspumpLevel")))
  {
    {
      if (((_8523_value - (int32_t)_8523_value) == 0.0))
      {
        {
          double _8583_v = _8523_value;
          if ((((-(int)1) <= _8583_v) && (_8583_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_FEASPUMP_LEVEL"),_8583_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioFeaspumpLevel)"));
            }
          }
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioFeaspumpLevel)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("remoteUseCompression")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteUseCompression)"));
    }
  }
  {}
  if ((_8522_name == std::string ("optimizerMaxTime")))
  {
    {
      double _8584_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TIME"),_8584_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("optimizerMaxTicks")))
  {
    {
      double _8585_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TICKS"),_8585_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTicks)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("lowerObjCut")))
  {
    {
      double _8586_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT"),_8586_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("upperObjCut")))
  {
    {
      double _8587_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT"),_8587_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("upperObjCutFiniteTrh")))
  {
    {
      double _8588_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT_FINITE_TRH"),_8588_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("lowerObjCutFiniteTrh")))
  {
    {
      double _8589_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT_FINITE_TRH"),_8589_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolRelGap")))
  {
    {
      double _8590_v = _8523_value;
      if ((1.000000e-14 <= _8590_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_GAP"),_8590_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolStepSize")))
  {
    {
      double _8591_v = _8523_value;
      if (((0.000000e+00 <= _8591_v) && (_8591_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_STEP_SIZE"),_8591_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolStepSize)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simLuTolRelPiv")))
  {
    {
      double _8592_v = _8523_value;
      if (((1.000000e-06 <= _8592_v) && (_8592_v <= 9.999990e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_SIM_LU_TOL_REL_PIV"),_8592_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simLuTolRelPiv)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolRelStep")))
  {
    {
      double _8593_v = _8523_value;
      if (((1.000000e-04 <= _8593_v) && (_8593_v <= 9.999990e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_STEP"),_8593_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelStep)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolPath")))
  {
    {
      double _8594_v = _8523_value;
      if (((0.000000e+00 <= _8594_v) && (_8594_v <= 9.999000e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PATH"),_8594_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPath)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolPfeas")))
  {
    {
      double _8595_v = _8523_value;
      if (((0.000000e+00 <= _8595_v) && (_8595_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PFEAS"),_8595_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolDfeas")))
  {
    {
      double _8596_v = _8523_value;
      if (((0.000000e+00 <= _8596_v) && (_8596_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DFEAS"),_8596_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolMuRed")))
  {
    {
      double _8597_v = _8523_value;
      if (((0.000000e+00 <= _8597_v) && (_8597_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_MU_RED"),_8597_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolInfeas")))
  {
    {
      double _8598_v = _8523_value;
      if (((0.000000e+00 <= _8598_v) && (_8598_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_INFEAS"),_8598_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolRelGap")))
  {
    {
      double _8599_v = _8523_value;
      if (((0.000000e+00 <= _8599_v) && (_8599_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_REL_GAP"),_8599_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolPfeas")))
  {
    {
      double _8600_v = _8523_value;
      if (((0.000000e+00 <= _8600_v) && (_8600_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_PFEAS"),_8600_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolDfeas")))
  {
    {
      double _8601_v = _8523_value;
      if (((0.000000e+00 <= _8601_v) && (_8601_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_DFEAS"),_8601_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolMuRed")))
  {
    {
      double _8602_v = _8523_value;
      if (((0.000000e+00 <= _8602_v) && (_8602_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_MU_RED"),_8602_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolNearRel")))
  {
    {
      double _8603_v = _8523_value;
      if ((1.000000e+00 <= _8603_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_NEAR_REL"),_8603_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolNearRel)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntCoTolInfeas")))
  {
    {
      double _8604_v = _8523_value;
      if (((0.000000e+00 <= _8604_v) && (_8604_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_INFEAS"),_8604_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolPsafe")))
  {
    {
      double _8605_v = _8523_value;
      if ((1.000000e-04 <= _8605_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PSAFE"),_8605_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPsafe)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("intpntTolDsafe")))
  {
    {
      double _8606_v = _8523_value;
      if ((1.000000e-04 <= _8606_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DSAFE"),_8606_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDsafe)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioMaxTime")))
  {
    {
      double _8607_v = _8523_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_MAX_TIME"),_8607_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioRelGapConst")))
  {
    {
      double _8608_v = _8523_value;
      if ((1.000000e-15 <= _8608_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_REL_GAP_CONST"),_8608_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRelGapConst)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioTolRelGap")))
  {
    {
      double _8609_v = _8523_value;
      if ((0.000000e+00 <= _8609_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_GAP"),_8609_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioTolAbsGap")))
  {
    {
      double _8610_v = _8523_value;
      if ((0.000000e+00 <= _8610_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_GAP"),_8610_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsGap)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioTolAbsRelaxInt")))
  {
    {
      double _8611_v = _8523_value;
      if ((1.000000e-09 <= _8611_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_RELAX_INT"),_8611_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsRelaxInt)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioDjcMaxBigm")))
  {
    {
      double _8612_v = _8523_value;
      if ((0.000000e+00 <= _8612_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_DJC_MAX_BIGM"),_8612_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDjcMaxBigm)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("basisTolX")))
  {
    {
      double _8613_v = _8523_value;
      if ((1.000000e-09 <= _8613_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_X"),_8613_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolX)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("basisTolS")))
  {
    {
      double _8614_v = _8523_value;
      if ((1.000000e-09 <= _8614_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_S"),_8614_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolS)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("basisRelTolS")))
  {
    {
      double _8615_v = _8523_value;
      if ((0.000000e+00 <= _8615_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_REL_TOL_S"),_8615_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisRelTolS)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolX")))
  {
    {
      double _8616_v = _8523_value;
      if ((0.000000e+00 <= _8616_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_X"),_8616_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolX)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolPrimalInfeasPerturbation")))
  {
    {
      double _8617_v = _8523_value;
      if ((0.000000e+00 <= _8617_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_PRIMAL_INFEAS_PERTURBATION"),_8617_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolPrimalInfeasPerturbation)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolS")))
  {
    {
      double _8618_v = _8523_value;
      if ((0.000000e+00 <= _8618_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_S"),_8618_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolS)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolAij")))
  {
    {
      double _8619_v = _8523_value;
      if ((1.000000e-15 <= _8619_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_AIJ"),_8619_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAij)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolAbsLindep")))
  {
    {
      double _8620_v = _8523_value;
      if ((0.000000e+00 <= _8620_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_ABS_LINDEP"),_8620_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAbsLindep)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("presolveTolRelLindep")))
  {
    {
      double _8621_v = _8523_value;
      if ((0.000000e+00 <= _8621_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_REL_LINDEP"),_8621_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolRelLindep)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("simplexAbsTolPiv")))
  {
    {
      double _8622_v = _8523_value;
      if ((1.000000e-12 <= _8622_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_SIMPLEX_ABS_TOL_PIV"),_8622_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simplexAbsTolPiv)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioTolFeas")))
  {
    {
      double _8623_v = _8523_value;
      if (((1.000000e-09 <= _8623_v) && (_8623_v <= 1.000000e-03)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_FEAS"),_8623_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolFeas)"));
        }
      }
    }
  }
  {}
  if ((_8522_name == std::string ("mioTolRelDualBoundImprovement")))
  {
    {
      double _8624_v = _8523_value;
      if (((0.000000e+00 <= _8624_v) && (_8624_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8521_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_DUAL_BOUND_IMPROVEMENT"),_8624_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelDualBoundImprovement)"));
        }
      }
    }
  }
  else if((_8522_name == std::string ("dataFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (dataFileName)"));
    }
  }
  else if((_8522_name == std::string ("basSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basSolFileName)"));
    }
  }
  else if((_8522_name == std::string ("itrSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (itrSolFileName)"));
    }
  }
  else if((_8522_name == std::string ("intSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intSolFileName)"));
    }
  }
  else if((_8522_name == std::string ("writeLpGenVarName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpGenVarName)"));
    }
  }
  else if((_8522_name == std::string ("remoteOptserverHost")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteOptserverHost)"));
    }
  }
  else if((_8522_name == std::string ("remoteTlsCertPath")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteTlsCertPath)"));
    }
  }
  else if((_8522_name == std::string ("remoteTlsCert")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteTlsCert)"));
    }
  }
  {}
  throw ::mosek::fusion::ParameterError(std::string ("Unknown parameter"));
}
// End mosek.fusion.Parameters.setParameter

// Begin mosek.fusion.Parameters.setParameter
// Method mosek.fusion.Parameters.setParameter @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3713:0-4861:1
void mosek::fusion::Parameters::setParameter
  ( monty::rc_ptr< ::mosek::fusion::Model > _8625_M,
    const std::string & _8626_name,
    int32_t _8627_value) { mosek::fusion::p_Parameters::setParameter(_8625_M,_8626_name,_8627_value); }
void mosek::fusion::p_Parameters::setParameter(monty::rc_ptr< ::mosek::fusion::Model > _8625_M,const std::string & _8626_name,int32_t _8627_value)
{
  if (false)
  {
    {
    }
  }
  else if((_8626_name == std::string ("autoUpdateSolInfo")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (autoUpdateSolInfo)"));
    }
  }
  else if((_8626_name == std::string ("removeUnusedSolutions")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (removeUnusedSolutions)"));
    }
  }
  {}
  if ((_8626_name == std::string ("numThreads")))
  {
    {
      int32_t _8628_v = _8627_value;
      if (((int)0 <= _8628_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_NUM_THREADS"),_8628_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (numThreads)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mtSpincount")))
  {
    {
      int32_t _8629_v = _8627_value;
      if ((((int)0 <= _8629_v) && (_8629_v <= (int)1000000000)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MT_SPINCOUNT"),_8629_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mtSpincount)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("optimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizer)"));
    }
  }
  {}
  if ((_8626_name == std::string ("biMaxIterations")))
  {
    {
      int32_t _8630_v = _8627_value;
      if (((int)0 <= _8630_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_BI_MAX_ITERATIONS"),_8630_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("licenseTrhExpiryWrn")))
  {
    {
      int32_t _8631_v = _8627_value;
      if (((int)0 <= _8631_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_TRH_EXPIRY_WRN"),_8631_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseTrhExpiryWrn)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logCutSecondOpt")))
  {
    {
      int32_t _8632_v = _8627_value;
      if (((int)0 <= _8632_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_CUT_SECOND_OPT"),_8632_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logCutSecondOpt)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logResponse")))
  {
    {
      int32_t _8633_v = _8627_value;
      if (((int)0 <= _8633_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_RESPONSE"),_8633_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logResponse)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("logLocalInfo")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logLocalInfo)"));
    }
  }
  {}
  if ((_8626_name == std::string ("logBi")))
  {
    {
      int32_t _8634_v = _8627_value;
      if (((int)0 <= _8634_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI"),_8634_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBi)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logBiFreq")))
  {
    {
      int32_t _8635_v = _8627_value;
      if (((int)0 <= _8635_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI_FREQ"),_8635_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBiFreq)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("biCleanOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biCleanOptimizer)"));
    }
  }
  else if((_8626_name == std::string ("intpntStartingPoint")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntStartingPoint)"));
    }
  }
  else if((_8626_name == std::string ("intpntDiffStep")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntDiffStep)"));
    }
  }
  else if((_8626_name == std::string ("intpntScaling")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntScaling)"));
    }
  }
  else if((_8626_name == std::string ("intpntSolveForm")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntSolveForm)"));
    }
  }
  {}
  if ((_8626_name == std::string ("logIntpnt")))
  {
    {
      int32_t _8636_v = _8627_value;
      if (((int)0 <= _8636_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INTPNT"),_8636_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logIntpnt)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntMaxIterations")))
  {
    {
      int32_t _8637_v = _8627_value;
      if (((int)0 <= _8637_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_ITERATIONS"),_8637_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntOffColTrh")))
  {
    {
      int32_t _8638_v = _8627_value;
      if (((int)0 <= _8638_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_OFF_COL_TRH"),_8638_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOffColTrh)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("intpntOrderMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderMethod)"));
    }
  }
  {}
  if ((_8626_name == std::string ("intpntOrderGpNumSeeds")))
  {
    {
      int32_t _8639_v = _8627_value;
      if (((int)0 <= _8639_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_ORDER_GP_NUM_SEEDS"),_8639_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderGpNumSeeds)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("intpntBasis")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntBasis)"));
    }
  }
  else if((_8626_name == std::string ("biIgnoreMaxIter")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreMaxIter)"));
    }
  }
  else if((_8626_name == std::string ("biIgnoreNumError")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreNumError)"));
    }
  }
  {}
  if ((_8626_name == std::string ("intpntMaxNumCor")))
  {
    {
      int32_t _8640_v = _8627_value;
      if (((-(int)1) <= _8640_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_NUM_COR"),_8640_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxNumCor)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("presolveUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveUse)"));
    }
  }
  {}
  if ((_8626_name == std::string ("presolveLevel")))
  {
    {
      int32_t _8641_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LEVEL"),_8641_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logPresolve")))
  {
    {
      int32_t _8642_v = _8627_value;
      if (((int)0 <= _8642_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_PRESOLVE"),_8642_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logPresolve)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("presolveLindepUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepUse)"));
    }
  }
  else if((_8626_name == std::string ("presolveLindepNew")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepNew)"));
    }
  }
  {}
  if ((_8626_name == std::string ("presolveMaxNumPass")))
  {
    {
      int32_t _8643_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_MAX_NUM_PASS"),_8643_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveMaxNumPass)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveEliminatorMaxNumTries")))
  {
    {
      int32_t _8644_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_NUM_TRIES"),_8644_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxNumTries)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveEliminatorMaxFill")))
  {
    {
      int32_t _8645_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_FILL"),_8645_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxFill)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simPrimalCrash")))
  {
    {
      int32_t _8646_v = _8627_value;
      if (((int)0 <= _8646_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_CRASH"),_8646_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalCrash)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logSim")))
  {
    {
      int32_t _8647_v = _8627_value;
      if (((int)0 <= _8647_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM"),_8647_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSim)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logSimMinor")))
  {
    {
      int32_t _8648_v = _8627_value;
      if (((int)0 <= _8648_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_MINOR"),_8648_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimMinor)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logSimFreq")))
  {
    {
      int32_t _8649_v = _8627_value;
      if (((int)0 <= _8649_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_FREQ"),_8649_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimFreq)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simPrimalRestrictSelection")))
  {
    {
      int32_t _8650_v = _8627_value;
      if ((((int)0 <= _8650_v) && (_8650_v <= (int)100)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION"),_8650_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalRestrictSelection)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("simPrimalSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalSelection)"));
    }
  }
  {}
  if ((_8626_name == std::string ("simDualRestrictSelection")))
  {
    {
      int32_t _8651_v = _8627_value;
      if ((((int)0 <= _8651_v) && (_8651_v <= (int)100)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION"),_8651_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualRestrictSelection)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("simDualSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualSelection)"));
    }
  }
  {}
  if ((_8626_name == std::string ("simMaxIterations")))
  {
    {
      int32_t _8652_v = _8627_value;
      if (((int)0 <= _8652_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_ITERATIONS"),_8652_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxIterations)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("simHotstartLu")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstartLu)"));
    }
  }
  {}
  if ((_8626_name == std::string ("simRefactorFreq")))
  {
    {
      int32_t _8653_v = _8627_value;
      if (((int)0 <= _8653_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_REFACTOR_FREQ"),_8653_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simRefactorFreq)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simSeed")))
  {
    {
      int32_t _8654_v = _8627_value;
      if ((((int)0 <= _8654_v) && (_8654_v <= (int)32749)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SEED"),_8654_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSeed)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioMode")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMode)"));
    }
  }
  {}
  if ((_8626_name == std::string ("logMio")))
  {
    {
      int32_t _8655_v = _8627_value;
      if (((int)0 <= _8655_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO"),_8655_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMio)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logMioFreq")))
  {
    {
      int32_t _8656_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO_FREQ"),_8656_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMioFreq)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxNumRelaxs")))
  {
    {
      int32_t _8657_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RELAXS"),_8657_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRelaxs)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxNumBranches")))
  {
    {
      int32_t _8658_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_BRANCHES"),_8658_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumBranches)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxNumRestarts")))
  {
    {
      int32_t _8659_v = _8627_value;
      if (((int)0 <= _8659_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RESTARTS"),_8659_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRestarts)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxNumRootCutRounds")))
  {
    {
      int32_t _8660_v = _8627_value;
      if (((int)0 <= _8660_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_ROOT_CUT_ROUNDS"),_8660_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRootCutRounds)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxNumSolutions")))
  {
    {
      int32_t _8661_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_SOLUTIONS"),_8661_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumSolutions)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioNodeSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeSelection)"));
    }
  }
  else if((_8626_name == std::string ("mioVarSelection")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVarSelection)"));
    }
  }
  {}
  if ((_8626_name == std::string ("mioMinRel")))
  {
    {
      int32_t _8662_v = _8627_value;
      if (((int)0 <= _8662_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MIN_REL"),_8662_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMinRel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioHeuristicLevel")))
  {
    {
      int32_t _8663_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_HEURISTIC_LEVEL"),_8663_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioHeuristicLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioProbingLevel")))
  {
    {
      int32_t _8664_v = _8627_value;
      if ((((-(int)1) <= _8664_v) && (_8664_v <= (int)3)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PROBING_LEVEL"),_8664_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioProbingLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioSymmetryLevel")))
  {
    {
      int32_t _8665_v = _8627_value;
      if ((((-(int)1) <= _8665_v) && (_8665_v <= (int)4)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SYMMETRY_LEVEL"),_8665_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSymmetryLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioDualRayAnalysisLevel")))
  {
    {
      int32_t _8666_v = _8627_value;
      if ((((-(int)1) <= _8666_v) && (_8666_v <= (int)2)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_DUAL_RAY_ANALYSIS_LEVEL"),_8666_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDualRayAnalysisLevel)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioPresolveAggregatorUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPresolveAggregatorUse)"));
    }
  }
  {}
  if ((_8626_name == std::string ("mioNumericalEmphasisLevel")))
  {
    {
      int32_t _8667_v = _8627_value;
      if ((((int)0 <= _8667_v) && (_8667_v <= (int)2)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_NUMERICAL_EMPHASIS_LEVEL"),_8667_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNumericalEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMemoryEmphasisLevel")))
  {
    {
      int32_t _8668_v = _8627_value;
      if ((((int)0 <= _8668_v) && (_8668_v <= (int)1)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MEMORY_EMPHASIS_LEVEL"),_8668_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMemoryEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioCutSelectionLevel")))
  {
    {
      int32_t _8669_v = _8627_value;
      if ((((-(int)1) <= _8669_v) && (_8669_v <= (int)1)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_SELECTION_LEVEL"),_8669_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutSelectionLevel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioVbDetectionLevel")))
  {
    {
      int32_t _8670_v = _8627_value;
      if ((((-(int)1) <= _8670_v) && (_8670_v <= (int)2)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_VB_DETECTION_LEVEL"),_8670_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVbDetectionLevel)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioBranchDir")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioBranchDir)"));
    }
  }
  else if((_8626_name == std::string ("mioRootOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootOptimizer)"));
    }
  }
  else if((_8626_name == std::string ("mioNodeOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeOptimizer)"));
    }
  }
  else if((_8626_name == std::string ("mioPerspectiveReformulate")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPerspectiveReformulate)"));
    }
  }
  else if((_8626_name == std::string ("mioPropagateObjectiveConstraint")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPropagateObjectiveConstraint)"));
    }
  }
  {}
  if ((_8626_name == std::string ("mioSeed")))
  {
    {
      int32_t _8671_v = _8627_value;
      if (((int)0 <= _8671_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SEED"),_8671_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSeed)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioConicOuterApproximation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConicOuterApproximation)"));
    }
  }
  else if((_8626_name == std::string ("mioQcqoReformulationMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioQcqoReformulationMethod)"));
    }
  }
  else if((_8626_name == std::string ("mioDataPermutationMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDataPermutationMethod)"));
    }
  }
  {}
  if ((_8626_name == std::string ("writeLpLineWidth")))
  {
    {
      int32_t _8672_v = _8627_value;
      if (((int)40 <= _8672_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_WRITE_LP_LINE_WIDTH"),_8672_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpLineWidth)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("writeLpFullObj")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpFullObj)"));
    }
  }
  else if((_8626_name == std::string ("writeJsonIndentation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeJsonIndentation)"));
    }
  }
  else if((_8626_name == std::string ("infeasReportAuto")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasReportAuto)"));
    }
  }
  {}
  if ((_8626_name == std::string ("logInfeasAna")))
  {
    {
      int32_t _8673_v = _8627_value;
      if (((int)0 <= _8673_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INFEAS_ANA"),_8673_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logInfeasAna)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("licenseWait")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseWait)"));
    }
  }
  else if((_8626_name == std::string ("licenseSuppressExpireWrns")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseSuppressExpireWrns)"));
    }
  }
  {}
  if ((_8626_name == std::string ("licensePauseTime")))
  {
    {
      int32_t _8674_v = _8627_value;
      if ((((int)0 <= _8674_v) && (_8674_v <= (int)1000000)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_PAUSE_TIME"),_8674_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licensePauseTime)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("licenseDebug")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseDebug)"));
    }
  }
  {}
  if ((_8626_name == std::string ("log")))
  {
    {
      int32_t _8675_v = _8627_value;
      if (((int)0 <= _8675_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG"),_8675_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (log)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logExpand")))
  {
    {
      int32_t _8676_v = _8627_value;
      if (((int)0 <= _8676_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_EXPAND"),_8676_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logExpand)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logFile")))
  {
    {
      int32_t _8677_v = _8627_value;
      if (((int)0 <= _8677_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_FILE"),_8677_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logFile)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("logOrder")))
  {
    {
      int32_t _8678_v = _8627_value;
      if (((int)0 <= _8678_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_ORDER"),_8678_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logOrder)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("simScaling")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScaling)"));
    }
  }
  else if((_8626_name == std::string ("simScalingMethod")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScalingMethod)"));
    }
  }
  {}
  if ((_8626_name == std::string ("simPrimalPhaseoneMethod")))
  {
    {
      int32_t _8679_v = _8627_value;
      if ((((int)0 <= _8679_v) && (_8679_v <= (int)10)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_PHASEONE_METHOD"),_8679_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simDualPhaseoneMethod")))
  {
    {
      int32_t _8680_v = _8627_value;
      if ((((int)0 <= _8680_v) && (_8680_v <= (int)10)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_PHASEONE_METHOD"),_8680_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simMaxNumSetbacks")))
  {
    {
      int32_t _8681_v = _8627_value;
      if (((int)0 <= _8681_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_NUM_SETBACKS"),_8681_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxNumSetbacks)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("simHotstart")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstart)"));
    }
  }
  else if((_8626_name == std::string ("simBasisFactorUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simBasisFactorUse)"));
    }
  }
  else if((_8626_name == std::string ("simDegen")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDegen)"));
    }
  }
  else if((_8626_name == std::string ("simReformulation")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simReformulation)"));
    }
  }
  else if((_8626_name == std::string ("simExploitDupvec")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simExploitDupvec)"));
    }
  }
  else if((_8626_name == std::string ("simSaveLu")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSaveLu)"));
    }
  }
  else if((_8626_name == std::string ("simNonSingular")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simNonSingular)"));
    }
  }
  {}
  if ((_8626_name == std::string ("simDualCrash")))
  {
    {
      int32_t _8682_v = _8627_value;
      if (((int)0 <= _8682_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_CRASH"),_8682_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualCrash)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("infeasPreferPrimal")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasPreferPrimal)"));
    }
  }
  {}
  if ((_8626_name == std::string ("mioRootRepeatPresolveLevel")))
  {
    {
      int32_t _8683_v = _8627_value;
      if ((((-(int)1) <= _8683_v) && (_8683_v <= (int)1)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_ROOT_REPEAT_PRESOLVE_LEVEL"),_8683_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootRepeatPresolveLevel)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("mioCutCmir")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutCmir)"));
    }
  }
  else if((_8626_name == std::string ("mioCutClique")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutClique)"));
    }
  }
  else if((_8626_name == std::string ("mioCutImpliedBound")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutImpliedBound)"));
    }
  }
  else if((_8626_name == std::string ("mioCutKnapsackCover")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutKnapsackCover)"));
    }
  }
  else if((_8626_name == std::string ("mioCutGmi")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutGmi)"));
    }
  }
  else if((_8626_name == std::string ("mioCutLipro")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutLipro)"));
    }
  }
  else if((_8626_name == std::string ("mioConstructSol")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConstructSol)"));
    }
  }
  {}
  if ((_8626_name == std::string ("presolveLindepRelWorkTrh")))
  {
    {
      int32_t _8684_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_REL_WORK_TRH"),_8684_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepRelWorkTrh)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveLindepAbsWorkTrh")))
  {
    {
      int32_t _8685_v = _8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_ABS_WORK_TRH"),_8685_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepAbsWorkTrh)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("cacheLicense")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (cacheLicense)"));
    }
  }
  else if((_8626_name == std::string ("intpntRegularizationUse")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntRegularizationUse)"));
    }
  }
  else if((_8626_name == std::string ("simSolveForm")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSolveForm)"));
    }
  }
  else if((_8626_name == std::string ("simSwitchOptimizer")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSwitchOptimizer)"));
    }
  }
  {}
  if ((_8626_name == std::string ("mioRinsMaxNodes")))
  {
    {
      int32_t _8686_v = _8627_value;
      if (((-(int)1) <= _8686_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_RINS_MAX_NODES"),_8686_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRinsMaxNodes)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioFeaspumpLevel")))
  {
    {
      int32_t _8687_v = _8627_value;
      if ((((-(int)1) <= _8687_v) && (_8687_v <= (int)2)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_FEASPUMP_LEVEL"),_8687_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioFeaspumpLevel)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("remoteUseCompression")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteUseCompression)"));
    }
  }
  {}
  if ((_8626_name == std::string ("optimizerMaxTime")))
  {
    {
      double _8688_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TIME"),_8688_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("optimizerMaxTicks")))
  {
    {
      double _8689_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TICKS"),_8689_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTicks)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("lowerObjCut")))
  {
    {
      double _8690_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT"),_8690_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("upperObjCut")))
  {
    {
      double _8691_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT"),_8691_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("upperObjCutFiniteTrh")))
  {
    {
      double _8692_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT_FINITE_TRH"),_8692_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("lowerObjCutFiniteTrh")))
  {
    {
      double _8693_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT_FINITE_TRH"),_8693_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolRelGap")))
  {
    {
      double _8694_v = (double)_8627_value;
      if ((1.000000e-14 <= _8694_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_GAP"),_8694_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolStepSize")))
  {
    {
      double _8695_v = (double)_8627_value;
      if (((0.000000e+00 <= _8695_v) && (_8695_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_STEP_SIZE"),_8695_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolStepSize)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simLuTolRelPiv")))
  {
    {
      double _8696_v = (double)_8627_value;
      if (((1.000000e-06 <= _8696_v) && (_8696_v <= 9.999990e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_SIM_LU_TOL_REL_PIV"),_8696_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simLuTolRelPiv)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolRelStep")))
  {
    {
      double _8697_v = (double)_8627_value;
      if (((1.000000e-04 <= _8697_v) && (_8697_v <= 9.999990e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_STEP"),_8697_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelStep)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolPath")))
  {
    {
      double _8698_v = (double)_8627_value;
      if (((0.000000e+00 <= _8698_v) && (_8698_v <= 9.999000e-01)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PATH"),_8698_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPath)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolPfeas")))
  {
    {
      double _8699_v = (double)_8627_value;
      if (((0.000000e+00 <= _8699_v) && (_8699_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PFEAS"),_8699_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolDfeas")))
  {
    {
      double _8700_v = (double)_8627_value;
      if (((0.000000e+00 <= _8700_v) && (_8700_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DFEAS"),_8700_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolMuRed")))
  {
    {
      double _8701_v = (double)_8627_value;
      if (((0.000000e+00 <= _8701_v) && (_8701_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_MU_RED"),_8701_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolInfeas")))
  {
    {
      double _8702_v = (double)_8627_value;
      if (((0.000000e+00 <= _8702_v) && (_8702_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_INFEAS"),_8702_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolRelGap")))
  {
    {
      double _8703_v = (double)_8627_value;
      if (((0.000000e+00 <= _8703_v) && (_8703_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_REL_GAP"),_8703_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolPfeas")))
  {
    {
      double _8704_v = (double)_8627_value;
      if (((0.000000e+00 <= _8704_v) && (_8704_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_PFEAS"),_8704_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolDfeas")))
  {
    {
      double _8705_v = (double)_8627_value;
      if (((0.000000e+00 <= _8705_v) && (_8705_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_DFEAS"),_8705_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolMuRed")))
  {
    {
      double _8706_v = (double)_8627_value;
      if (((0.000000e+00 <= _8706_v) && (_8706_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_MU_RED"),_8706_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolNearRel")))
  {
    {
      double _8707_v = (double)_8627_value;
      if ((1.000000e+00 <= _8707_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_NEAR_REL"),_8707_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolNearRel)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntCoTolInfeas")))
  {
    {
      double _8708_v = (double)_8627_value;
      if (((0.000000e+00 <= _8708_v) && (_8708_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_INFEAS"),_8708_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolPsafe")))
  {
    {
      double _8709_v = (double)_8627_value;
      if ((1.000000e-04 <= _8709_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PSAFE"),_8709_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPsafe)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("intpntTolDsafe")))
  {
    {
      double _8710_v = (double)_8627_value;
      if ((1.000000e-04 <= _8710_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DSAFE"),_8710_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDsafe)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioMaxTime")))
  {
    {
      double _8711_v = (double)_8627_value;
      if (true)
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_MAX_TIME"),_8711_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioRelGapConst")))
  {
    {
      double _8712_v = (double)_8627_value;
      if ((1.000000e-15 <= _8712_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_REL_GAP_CONST"),_8712_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRelGapConst)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioTolRelGap")))
  {
    {
      double _8713_v = (double)_8627_value;
      if ((0.000000e+00 <= _8713_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_GAP"),_8713_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioTolAbsGap")))
  {
    {
      double _8714_v = (double)_8627_value;
      if ((0.000000e+00 <= _8714_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_GAP"),_8714_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsGap)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioTolAbsRelaxInt")))
  {
    {
      double _8715_v = (double)_8627_value;
      if ((1.000000e-09 <= _8715_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_RELAX_INT"),_8715_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsRelaxInt)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioDjcMaxBigm")))
  {
    {
      double _8716_v = (double)_8627_value;
      if ((0.000000e+00 <= _8716_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_DJC_MAX_BIGM"),_8716_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDjcMaxBigm)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("basisTolX")))
  {
    {
      double _8717_v = (double)_8627_value;
      if ((1.000000e-09 <= _8717_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_X"),_8717_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolX)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("basisTolS")))
  {
    {
      double _8718_v = (double)_8627_value;
      if ((1.000000e-09 <= _8718_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_S"),_8718_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolS)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("basisRelTolS")))
  {
    {
      double _8719_v = (double)_8627_value;
      if ((0.000000e+00 <= _8719_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_REL_TOL_S"),_8719_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisRelTolS)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolX")))
  {
    {
      double _8720_v = (double)_8627_value;
      if ((0.000000e+00 <= _8720_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_X"),_8720_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolX)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolPrimalInfeasPerturbation")))
  {
    {
      double _8721_v = (double)_8627_value;
      if ((0.000000e+00 <= _8721_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_PRIMAL_INFEAS_PERTURBATION"),_8721_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolPrimalInfeasPerturbation)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolS")))
  {
    {
      double _8722_v = (double)_8627_value;
      if ((0.000000e+00 <= _8722_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_S"),_8722_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolS)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolAij")))
  {
    {
      double _8723_v = (double)_8627_value;
      if ((1.000000e-15 <= _8723_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_AIJ"),_8723_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAij)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolAbsLindep")))
  {
    {
      double _8724_v = (double)_8627_value;
      if ((0.000000e+00 <= _8724_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_ABS_LINDEP"),_8724_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAbsLindep)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("presolveTolRelLindep")))
  {
    {
      double _8725_v = (double)_8627_value;
      if ((0.000000e+00 <= _8725_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_REL_LINDEP"),_8725_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolRelLindep)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("simplexAbsTolPiv")))
  {
    {
      double _8726_v = (double)_8627_value;
      if ((1.000000e-12 <= _8726_v))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_SIMPLEX_ABS_TOL_PIV"),_8726_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simplexAbsTolPiv)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioTolFeas")))
  {
    {
      double _8727_v = (double)_8627_value;
      if (((1.000000e-09 <= _8727_v) && (_8727_v <= 1.000000e-03)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_FEAS"),_8727_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolFeas)"));
        }
      }
    }
  }
  {}
  if ((_8626_name == std::string ("mioTolRelDualBoundImprovement")))
  {
    {
      double _8728_v = (double)_8627_value;
      if (((0.000000e+00 <= _8728_v) && (_8728_v <= 1.000000e+00)))
      {
        {
          mosek::fusion::p_Model::_get_impl(_8625_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_DUAL_BOUND_IMPROVEMENT"),_8728_v);
          return;
        }
      }
      else
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelDualBoundImprovement)"));
        }
      }
    }
  }
  else if((_8626_name == std::string ("dataFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (dataFileName)"));
    }
  }
  else if((_8626_name == std::string ("basSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basSolFileName)"));
    }
  }
  else if((_8626_name == std::string ("itrSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (itrSolFileName)"));
    }
  }
  else if((_8626_name == std::string ("intSolFileName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intSolFileName)"));
    }
  }
  else if((_8626_name == std::string ("writeLpGenVarName")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpGenVarName)"));
    }
  }
  else if((_8626_name == std::string ("remoteOptserverHost")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteOptserverHost)"));
    }
  }
  else if((_8626_name == std::string ("remoteTlsCertPath")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteTlsCertPath)"));
    }
  }
  else if((_8626_name == std::string ("remoteTlsCert")))
  {
    {
      throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteTlsCert)"));
    }
  }
  {}
  throw ::mosek::fusion::ParameterError(std::string ("Unknown parameter"));
}
// End mosek.fusion.Parameters.setParameter

// Begin mosek.fusion.Parameters.setParameter
// Method mosek.fusion.Parameters.setParameter @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1901:0-3711:1
void mosek::fusion::Parameters::setParameter
  ( monty::rc_ptr< ::mosek::fusion::Model > _8729_M,
    const std::string & _8730_name,
    const std::string & _8731_value) { mosek::fusion::p_Parameters::setParameter(_8729_M,_8730_name,_8731_value); }
void mosek::fusion::p_Parameters::setParameter(monty::rc_ptr< ::mosek::fusion::Model > _8729_M,const std::string & _8730_name,const std::string & _8731_value)
{
  if (false)
  {
    {
    }
  }
  {}
  if ((_8730_name == std::string ("autoUpdateSolInfo")))
  {
    {
      int32_t _8732_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8732_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (autoUpdateSolInfo)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_AUTO_UPDATE_SOL_INFO"),_8732_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("removeUnusedSolutions")))
  {
    {
      int32_t _8733_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8733_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (removeUnusedSolutions)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_REMOVE_UNUSED_SOLUTIONS"),_8733_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("numThreads")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1922:4-1930:108 */
      try
      {
        {
          int32_t _8735_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8735_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_NUM_THREADS"),_8735_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (numThreads)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8734_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (numThreads)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mtSpincount")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1934:4-1942:109 */
      try
      {
        {
          int32_t _8737_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8737_v) && (_8737_v <= (int)1000000000)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MT_SPINCOUNT"),_8737_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mtSpincount)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8736_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mtSpincount)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("optimizer")))
  {
    {
      int32_t _8738_v = ::mosek::fusion::p_Parameters::string_to_optimizertype_value(_8731_value);
      if ((_8738_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizer)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_OPTIMIZER"),_8738_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("biMaxIterations")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1954:4-1962:113 */
      try
      {
        {
          int32_t _8740_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8740_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_BI_MAX_ITERATIONS"),_8740_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biMaxIterations)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8739_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("licenseTrhExpiryWrn")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1966:4-1974:117 */
      try
      {
        {
          int32_t _8742_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8742_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_TRH_EXPIRY_WRN"),_8742_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseTrhExpiryWrn)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8741_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseTrhExpiryWrn)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logCutSecondOpt")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1978:4-1986:113 */
      try
      {
        {
          int32_t _8744_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8744_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_CUT_SECOND_OPT"),_8744_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logCutSecondOpt)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8743_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logCutSecondOpt)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logResponse")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1990:4-1998:109 */
      try
      {
        {
          int32_t _8746_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8746_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_RESPONSE"),_8746_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logResponse)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8745_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logResponse)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logLocalInfo")))
  {
    {
      int32_t _8747_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8747_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logLocalInfo)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_LOCAL_INFO"),_8747_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("logBi")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2010:4-2018:103 */
      try
      {
        {
          int32_t _8749_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8749_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI"),_8749_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBi)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8748_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBi)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logBiFreq")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2022:4-2030:107 */
      try
      {
        {
          int32_t _8751_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8751_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_BI_FREQ"),_8751_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBiFreq)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8750_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logBiFreq)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("biCleanOptimizer")))
  {
    {
      int32_t _8752_v = ::mosek::fusion::p_Parameters::string_to_optimizertype_value(_8731_value);
      if ((_8752_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biCleanOptimizer)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_BI_CLEAN_OPTIMIZER"),_8752_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntStartingPoint")))
  {
    {
      int32_t _8753_v = ::mosek::fusion::p_Parameters::string_to_startpointtype_value(_8731_value);
      if ((_8753_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntStartingPoint)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_STARTING_POINT"),_8753_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntDiffStep")))
  {
    {
      int32_t _8754_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8754_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntDiffStep)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_DIFF_STEP"),_8754_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntScaling")))
  {
    {
      int32_t _8755_v = ::mosek::fusion::p_Parameters::string_to_scalingtype_value(_8731_value);
      if ((_8755_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntScaling)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_SCALING"),_8755_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntSolveForm")))
  {
    {
      int32_t _8756_v = ::mosek::fusion::p_Parameters::string_to_solveform_value(_8731_value);
      if ((_8756_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntSolveForm)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_SOLVE_FORM"),_8756_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("logIntpnt")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2074:4-2082:107 */
      try
      {
        {
          int32_t _8758_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8758_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INTPNT"),_8758_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logIntpnt)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8757_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logIntpnt)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntMaxIterations")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2086:4-2094:117 */
      try
      {
        {
          int32_t _8760_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8760_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_ITERATIONS"),_8760_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxIterations)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8759_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntOffColTrh")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2098:4-2106:113 */
      try
      {
        {
          int32_t _8762_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8762_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_OFF_COL_TRH"),_8762_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOffColTrh)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8761_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOffColTrh)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntOrderMethod")))
  {
    {
      int32_t _8763_v = ::mosek::fusion::p_Parameters::string_to_orderingtype_value(_8731_value);
      if ((_8763_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderMethod)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_ORDER_METHOD"),_8763_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntOrderGpNumSeeds")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2118:4-2126:119 */
      try
      {
        {
          int32_t _8765_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8765_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_ORDER_GP_NUM_SEEDS"),_8765_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderGpNumSeeds)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8764_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntOrderGpNumSeeds)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntBasis")))
  {
    {
      int32_t _8766_v = ::mosek::fusion::p_Parameters::string_to_basindtype_value(_8731_value);
      if ((_8766_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntBasis)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_BASIS"),_8766_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("biIgnoreMaxIter")))
  {
    {
      int32_t _8767_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8767_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreMaxIter)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_BI_IGNORE_MAX_ITER"),_8767_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("biIgnoreNumError")))
  {
    {
      int32_t _8768_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8768_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (biIgnoreNumError)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_BI_IGNORE_NUM_ERROR"),_8768_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntMaxNumCor")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2154:4-2162:113 */
      try
      {
        {
          int32_t _8770_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((-(int)1) <= _8770_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_MAX_NUM_COR"),_8770_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxNumCor)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8769_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntMaxNumCor)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveUse")))
  {
    {
      int32_t _8771_v = ::mosek::fusion::p_Parameters::string_to_presolvemode_value(_8731_value);
      if ((_8771_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveUse)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_USE"),_8771_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("presolveLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2174:4-2182:111 */
      try
      {
        {
          int32_t _8773_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LEVEL"),_8773_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8772_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logPresolve")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2186:4-2194:109 */
      try
      {
        {
          int32_t _8775_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8775_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_PRESOLVE"),_8775_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logPresolve)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8774_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logPresolve)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveLindepUse")))
  {
    {
      int32_t _8776_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8776_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepUse)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_USE"),_8776_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("presolveLindepNew")))
  {
    {
      int32_t _8777_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8777_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepNew)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_NEW"),_8777_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("presolveMaxNumPass")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2214:4-2222:116 */
      try
      {
        {
          int32_t _8779_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_MAX_NUM_PASS"),_8779_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveMaxNumPass)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8778_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveMaxNumPass)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveEliminatorMaxNumTries")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2226:4-2234:127 */
      try
      {
        {
          int32_t _8781_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_NUM_TRIES"),_8781_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxNumTries)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8780_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxNumTries)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveEliminatorMaxFill")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2238:4-2246:123 */
      try
      {
        {
          int32_t _8783_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_ELIMINATOR_MAX_FILL"),_8783_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxFill)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8782_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveEliminatorMaxFill)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simPrimalCrash")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2250:4-2258:112 */
      try
      {
        {
          int32_t _8785_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8785_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_CRASH"),_8785_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalCrash)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8784_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalCrash)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logSim")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2262:4-2270:104 */
      try
      {
        {
          int32_t _8787_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8787_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM"),_8787_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSim)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8786_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSim)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logSimMinor")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2274:4-2282:109 */
      try
      {
        {
          int32_t _8789_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8789_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_MINOR"),_8789_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimMinor)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8788_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimMinor)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logSimFreq")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2286:4-2294:108 */
      try
      {
        {
          int32_t _8791_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8791_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_SIM_FREQ"),_8791_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimFreq)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8790_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logSimFreq)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simPrimalRestrictSelection")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2298:4-2306:124 */
      try
      {
        {
          int32_t _8793_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8793_v) && (_8793_v <= (int)100)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION"),_8793_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalRestrictSelection)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8792_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalRestrictSelection)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simPrimalSelection")))
  {
    {
      int32_t _8794_v = ::mosek::fusion::p_Parameters::string_to_simseltype_value(_8731_value);
      if ((_8794_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalSelection)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_SELECTION"),_8794_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simDualRestrictSelection")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2318:4-2326:122 */
      try
      {
        {
          int32_t _8796_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8796_v) && (_8796_v <= (int)100)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION"),_8796_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualRestrictSelection)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8795_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualRestrictSelection)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simDualSelection")))
  {
    {
      int32_t _8797_v = ::mosek::fusion::p_Parameters::string_to_simseltype_value(_8731_value);
      if ((_8797_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualSelection)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_SELECTION"),_8797_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simMaxIterations")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2338:4-2346:114 */
      try
      {
        {
          int32_t _8799_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8799_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_ITERATIONS"),_8799_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxIterations)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8798_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxIterations)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simHotstartLu")))
  {
    {
      int32_t _8800_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8800_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstartLu)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_HOTSTART_LU"),_8800_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simRefactorFreq")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2358:4-2366:113 */
      try
      {
        {
          int32_t _8802_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8802_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_REFACTOR_FREQ"),_8802_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simRefactorFreq)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8801_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simRefactorFreq)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simSeed")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2370:4-2378:105 */
      try
      {
        {
          int32_t _8804_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8804_v) && (_8804_v <= (int)32749)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SEED"),_8804_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSeed)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8803_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSeed)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMode")))
  {
    {
      int32_t _8805_v = ::mosek::fusion::p_Parameters::string_to_miomode_value(_8731_value);
      if ((_8805_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMode)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MODE"),_8805_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("logMio")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2390:4-2398:104 */
      try
      {
        {
          int32_t _8807_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8807_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO"),_8807_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMio)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8806_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMio)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logMioFreq")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2402:4-2410:108 */
      try
      {
        {
          int32_t _8809_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_MIO_FREQ"),_8809_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMioFreq)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8808_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logMioFreq)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxNumRelaxs")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2414:4-2422:113 */
      try
      {
        {
          int32_t _8811_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RELAXS"),_8811_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRelaxs)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8810_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRelaxs)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxNumBranches")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2426:4-2434:115 */
      try
      {
        {
          int32_t _8813_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_BRANCHES"),_8813_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumBranches)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8812_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumBranches)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxNumRestarts")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2438:4-2446:115 */
      try
      {
        {
          int32_t _8815_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8815_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_RESTARTS"),_8815_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRestarts)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8814_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRestarts)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxNumRootCutRounds")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2450:4-2458:120 */
      try
      {
        {
          int32_t _8817_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8817_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_ROOT_CUT_ROUNDS"),_8817_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRootCutRounds)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8816_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumRootCutRounds)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxNumSolutions")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2462:4-2470:116 */
      try
      {
        {
          int32_t _8819_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MAX_NUM_SOLUTIONS"),_8819_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumSolutions)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8818_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxNumSolutions)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioNodeSelection")))
  {
    {
      int32_t _8820_v = ::mosek::fusion::p_Parameters::string_to_mionodeseltype_value(_8731_value);
      if ((_8820_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeSelection)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_NODE_SELECTION"),_8820_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioVarSelection")))
  {
    {
      int32_t _8821_v = ::mosek::fusion::p_Parameters::string_to_miovarseltype_value(_8731_value);
      if ((_8821_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVarSelection)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_VAR_SELECTION"),_8821_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioMinRel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2490:4-2498:107 */
      try
      {
        {
          int32_t _8823_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8823_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MIN_REL"),_8823_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMinRel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8822_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMinRel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioHeuristicLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2502:4-2510:115 */
      try
      {
        {
          int32_t _8825_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_HEURISTIC_LEVEL"),_8825_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioHeuristicLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8824_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioHeuristicLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioProbingLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2514:4-2522:113 */
      try
      {
        {
          int32_t _8827_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8827_v) && (_8827_v <= (int)3)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PROBING_LEVEL"),_8827_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioProbingLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8826_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioProbingLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioSymmetryLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2526:4-2534:114 */
      try
      {
        {
          int32_t _8829_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8829_v) && (_8829_v <= (int)4)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SYMMETRY_LEVEL"),_8829_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSymmetryLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8828_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSymmetryLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioDualRayAnalysisLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2538:4-2546:121 */
      try
      {
        {
          int32_t _8831_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8831_v) && (_8831_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_DUAL_RAY_ANALYSIS_LEVEL"),_8831_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDualRayAnalysisLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8830_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDualRayAnalysisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioPresolveAggregatorUse")))
  {
    {
      int32_t _8832_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8832_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPresolveAggregatorUse)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PRESOLVE_AGGREGATOR_USE"),_8832_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioNumericalEmphasisLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2558:4-2566:123 */
      try
      {
        {
          int32_t _8834_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8834_v) && (_8834_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_NUMERICAL_EMPHASIS_LEVEL"),_8834_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNumericalEmphasisLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8833_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNumericalEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMemoryEmphasisLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2570:4-2578:120 */
      try
      {
        {
          int32_t _8836_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8836_v) && (_8836_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_MEMORY_EMPHASIS_LEVEL"),_8836_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMemoryEmphasisLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8835_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMemoryEmphasisLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutSelectionLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2582:4-2590:118 */
      try
      {
        {
          int32_t _8838_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8838_v) && (_8838_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_SELECTION_LEVEL"),_8838_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutSelectionLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8837_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutSelectionLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioVbDetectionLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2594:4-2602:117 */
      try
      {
        {
          int32_t _8840_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8840_v) && (_8840_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_VB_DETECTION_LEVEL"),_8840_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVbDetectionLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8839_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioVbDetectionLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioBranchDir")))
  {
    {
      int32_t _8841_v = ::mosek::fusion::p_Parameters::string_to_branchdir_value(_8731_value);
      if ((_8841_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioBranchDir)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_BRANCH_DIR"),_8841_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioRootOptimizer")))
  {
    {
      int32_t _8842_v = ::mosek::fusion::p_Parameters::string_to_optimizertype_value(_8731_value);
      if ((_8842_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootOptimizer)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_ROOT_OPTIMIZER"),_8842_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioNodeOptimizer")))
  {
    {
      int32_t _8843_v = ::mosek::fusion::p_Parameters::string_to_optimizertype_value(_8731_value);
      if ((_8843_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioNodeOptimizer)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_NODE_OPTIMIZER"),_8843_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioPerspectiveReformulate")))
  {
    {
      int32_t _8844_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8844_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPerspectiveReformulate)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PERSPECTIVE_REFORMULATE"),_8844_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioPropagateObjectiveConstraint")))
  {
    {
      int32_t _8845_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8845_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioPropagateObjectiveConstraint)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_PROPAGATE_OBJECTIVE_CONSTRAINT"),_8845_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioSeed")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2646:4-2654:105 */
      try
      {
        {
          int32_t _8847_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8847_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_SEED"),_8847_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSeed)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8846_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioSeed)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioConicOuterApproximation")))
  {
    {
      int32_t _8848_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8848_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConicOuterApproximation)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CONIC_OUTER_APPROXIMATION"),_8848_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioQcqoReformulationMethod")))
  {
    {
      int32_t _8849_v = ::mosek::fusion::p_Parameters::string_to_miqcqoreformmethod_value(_8731_value);
      if ((_8849_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioQcqoReformulationMethod)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_QCQO_REFORMULATION_METHOD"),_8849_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioDataPermutationMethod")))
  {
    {
      int32_t _8850_v = ::mosek::fusion::p_Parameters::string_to_miodatapermmethod_value(_8731_value);
      if ((_8850_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDataPermutationMethod)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_DATA_PERMUTATION_METHOD"),_8850_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("writeLpLineWidth")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2682:4-2690:114 */
      try
      {
        {
          int32_t _8852_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)40 <= _8852_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_WRITE_LP_LINE_WIDTH"),_8852_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpLineWidth)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8851_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpLineWidth)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("writeLpFullObj")))
  {
    {
      int32_t _8853_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8853_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeLpFullObj)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_WRITE_LP_FULL_OBJ"),_8853_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("writeJsonIndentation")))
  {
    {
      int32_t _8854_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8854_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (writeJsonIndentation)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_WRITE_JSON_INDENTATION"),_8854_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("infeasReportAuto")))
  {
    {
      int32_t _8855_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8855_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasReportAuto)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INFEAS_REPORT_AUTO"),_8855_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("logInfeasAna")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2718:4-2726:110 */
      try
      {
        {
          int32_t _8857_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8857_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_INFEAS_ANA"),_8857_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logInfeasAna)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8856_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logInfeasAna)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("licenseWait")))
  {
    {
      int32_t _8858_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8858_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseWait)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_WAIT"),_8858_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("licenseSuppressExpireWrns")))
  {
    {
      int32_t _8859_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8859_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseSuppressExpireWrns)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_SUPPRESS_EXPIRE_WRNS"),_8859_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("licensePauseTime")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2746:4-2754:114 */
      try
      {
        {
          int32_t _8861_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8861_v) && (_8861_v <= (int)1000000)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_PAUSE_TIME"),_8861_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licensePauseTime)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8860_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licensePauseTime)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("licenseDebug")))
  {
    {
      int32_t _8862_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8862_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (licenseDebug)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LICENSE_DEBUG"),_8862_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("log")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2766:4-2774:101 */
      try
      {
        {
          int32_t _8864_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8864_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG"),_8864_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (log)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8863_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (log)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logExpand")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2778:4-2786:107 */
      try
      {
        {
          int32_t _8866_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8866_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_EXPAND"),_8866_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logExpand)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8865_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logExpand)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logFile")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2790:4-2798:105 */
      try
      {
        {
          int32_t _8868_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8868_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_FILE"),_8868_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logFile)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8867_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logFile)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("logOrder")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2802:4-2810:106 */
      try
      {
        {
          int32_t _8870_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8870_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_LOG_ORDER"),_8870_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logOrder)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8869_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (logOrder)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simScaling")))
  {
    {
      int32_t _8871_v = ::mosek::fusion::p_Parameters::string_to_scalingtype_value(_8731_value);
      if ((_8871_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScaling)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SCALING"),_8871_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simScalingMethod")))
  {
    {
      int32_t _8872_v = ::mosek::fusion::p_Parameters::string_to_scalingmethod_value(_8731_value);
      if ((_8872_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simScalingMethod)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SCALING_METHOD"),_8872_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simPrimalPhaseoneMethod")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2830:4-2838:121 */
      try
      {
        {
          int32_t _8874_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8874_v) && (_8874_v <= (int)10)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_PRIMAL_PHASEONE_METHOD"),_8874_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalPhaseoneMethod)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8873_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simPrimalPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simDualPhaseoneMethod")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2842:4-2850:119 */
      try
      {
        {
          int32_t _8876_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((int)0 <= _8876_v) && (_8876_v <= (int)10)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_PHASEONE_METHOD"),_8876_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualPhaseoneMethod)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8875_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualPhaseoneMethod)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simMaxNumSetbacks")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2854:4-2862:115 */
      try
      {
        {
          int32_t _8878_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8878_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_MAX_NUM_SETBACKS"),_8878_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxNumSetbacks)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8877_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simMaxNumSetbacks)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simHotstart")))
  {
    {
      int32_t _8879_v = ::mosek::fusion::p_Parameters::string_to_simhotstart_value(_8731_value);
      if ((_8879_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simHotstart)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_HOTSTART"),_8879_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simBasisFactorUse")))
  {
    {
      int32_t _8880_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8880_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simBasisFactorUse)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_BASIS_FACTOR_USE"),_8880_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simDegen")))
  {
    {
      int32_t _8881_v = ::mosek::fusion::p_Parameters::string_to_simdegen_value(_8731_value);
      if ((_8881_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDegen)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DEGEN"),_8881_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simReformulation")))
  {
    {
      int32_t _8882_v = ::mosek::fusion::p_Parameters::string_to_simreform_value(_8731_value);
      if ((_8882_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simReformulation)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_REFORMULATION"),_8882_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simExploitDupvec")))
  {
    {
      int32_t _8883_v = ::mosek::fusion::p_Parameters::string_to_simdupvec_value(_8731_value);
      if ((_8883_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simExploitDupvec)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_EXPLOIT_DUPVEC"),_8883_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simSaveLu")))
  {
    {
      int32_t _8884_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8884_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSaveLu)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SAVE_LU"),_8884_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simNonSingular")))
  {
    {
      int32_t _8885_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8885_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simNonSingular)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_NON_SINGULAR"),_8885_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simDualCrash")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2922:4-2930:110 */
      try
      {
        {
          int32_t _8887_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((int)0 <= _8887_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_DUAL_CRASH"),_8887_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualCrash)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8886_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simDualCrash)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("infeasPreferPrimal")))
  {
    {
      int32_t _8888_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8888_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (infeasPreferPrimal)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INFEAS_PREFER_PRIMAL"),_8888_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioRootRepeatPresolveLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:2942:4-2950:124 */
      try
      {
        {
          int32_t _8890_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8890_v) && (_8890_v <= (int)1)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_ROOT_REPEAT_PRESOLVE_LEVEL"),_8890_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootRepeatPresolveLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8889_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRootRepeatPresolveLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutCmir")))
  {
    {
      int32_t _8891_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8891_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutCmir)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_CMIR"),_8891_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutClique")))
  {
    {
      int32_t _8892_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8892_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutClique)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_CLIQUE"),_8892_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutImpliedBound")))
  {
    {
      int32_t _8893_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8893_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutImpliedBound)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_IMPLIED_BOUND"),_8893_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutKnapsackCover")))
  {
    {
      int32_t _8894_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8894_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutKnapsackCover)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_KNAPSACK_COVER"),_8894_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutGmi")))
  {
    {
      int32_t _8895_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8895_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutGmi)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_GMI"),_8895_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioCutLipro")))
  {
    {
      int32_t _8896_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8896_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioCutLipro)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CUT_LIPRO"),_8896_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioConstructSol")))
  {
    {
      int32_t _8897_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8897_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioConstructSol)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_CONSTRUCT_SOL"),_8897_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("presolveLindepRelWorkTrh")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3010:4-3018:122 */
      try
      {
        {
          int32_t _8899_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_REL_WORK_TRH"),_8899_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepRelWorkTrh)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8898_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepRelWorkTrh)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveLindepAbsWorkTrh")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3022:4-3030:122 */
      try
      {
        {
          int32_t _8901_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_PRESOLVE_LINDEP_ABS_WORK_TRH"),_8901_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepAbsWorkTrh)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8900_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveLindepAbsWorkTrh)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("cacheLicense")))
  {
    {
      int32_t _8902_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8902_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (cacheLicense)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_CACHE_LICENSE"),_8902_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intpntRegularizationUse")))
  {
    {
      int32_t _8903_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8903_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntRegularizationUse)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_INTPNT_REGULARIZATION_USE"),_8903_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simSolveForm")))
  {
    {
      int32_t _8904_v = ::mosek::fusion::p_Parameters::string_to_solveform_value(_8731_value);
      if ((_8904_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSolveForm)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SOLVE_FORM"),_8904_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("simSwitchOptimizer")))
  {
    {
      int32_t _8905_v = ::mosek::fusion::p_Parameters::string_to_onoffkey_value(_8731_value);
      if ((_8905_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simSwitchOptimizer)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_SIM_SWITCH_OPTIMIZER"),_8905_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("mioRinsMaxNodes")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3066:4-3074:113 */
      try
      {
        {
          int32_t _8907_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if (((-(int)1) <= _8907_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_RINS_MAX_NODES"),_8907_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRinsMaxNodes)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8906_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRinsMaxNodes)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioFeaspumpLevel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3078:4-3086:114 */
      try
      {
        {
          int32_t _8909_v = ::mosek::fusion::Utils::Tools::toInt(_8731_value);
          if ((((-(int)1) <= _8909_v) && (_8909_v <= (int)2)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_MIO_FEASPUMP_LEVEL"),_8909_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioFeaspumpLevel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8908_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioFeaspumpLevel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("remoteUseCompression")))
  {
    {
      int32_t _8910_v = ::mosek::fusion::p_Parameters::string_to_compresstype_value(_8731_value);
      if ((_8910_v < (int)0))
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (remoteUseCompression)"));
        }
      }
      {}
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_IPAR_REMOTE_USE_COMPRESSION"),_8910_v);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("optimizerMaxTime")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3098:4-3108:114 */
      try
      {
        {
          double _8912_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TIME"),_8912_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTime)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8911_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("optimizerMaxTicks")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3112:4-3122:115 */
      try
      {
        {
          double _8914_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_OPTIMIZER_MAX_TICKS"),_8914_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTicks)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8913_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (optimizerMaxTicks)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("lowerObjCut")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3126:4-3136:109 */
      try
      {
        {
          double _8916_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT"),_8916_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCut)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8915_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("upperObjCut")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3140:4-3150:109 */
      try
      {
        {
          double _8918_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT"),_8918_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCut)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8917_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCut)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("upperObjCutFiniteTrh")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3154:4-3164:118 */
      try
      {
        {
          double _8920_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_UPPER_OBJ_CUT_FINITE_TRH"),_8920_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCutFiniteTrh)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8919_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (upperObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("lowerObjCutFiniteTrh")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3168:4-3178:118 */
      try
      {
        {
          double _8922_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_LOWER_OBJ_CUT_FINITE_TRH"),_8922_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCutFiniteTrh)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8921_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (lowerObjCutFiniteTrh)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolRelGap")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3182:4-3192:113 */
      try
      {
        {
          double _8924_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-14 <= _8924_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_GAP"),_8924_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelGap)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8923_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolStepSize")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3196:4-3206:115 */
      try
      {
        {
          double _8926_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8926_v) && (_8926_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_STEP_SIZE"),_8926_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolStepSize)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8925_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolStepSize)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simLuTolRelPiv")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3210:4-3220:112 */
      try
      {
        {
          double _8928_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((1.000000e-06 <= _8928_v) && (_8928_v <= 9.999990e-01)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_SIM_LU_TOL_REL_PIV"),_8928_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simLuTolRelPiv)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8927_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simLuTolRelPiv)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolRelStep")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3224:4-3234:114 */
      try
      {
        {
          double _8930_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((1.000000e-04 <= _8930_v) && (_8930_v <= 9.999990e-01)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_REL_STEP"),_8930_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelStep)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8929_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolRelStep)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolPath")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3238:4-3248:111 */
      try
      {
        {
          double _8932_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8932_v) && (_8932_v <= 9.999000e-01)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PATH"),_8932_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPath)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8931_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPath)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolPfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3252:4-3262:112 */
      try
      {
        {
          double _8934_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8934_v) && (_8934_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PFEAS"),_8934_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8933_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolDfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3266:4-3276:112 */
      try
      {
        {
          double _8936_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8936_v) && (_8936_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DFEAS"),_8936_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8935_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolMuRed")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3280:4-3290:112 */
      try
      {
        {
          double _8938_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8938_v) && (_8938_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_MU_RED"),_8938_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolMuRed)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8937_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolInfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3294:4-3304:113 */
      try
      {
        {
          double _8940_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8940_v) && (_8940_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_INFEAS"),_8940_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolInfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8939_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolRelGap")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3308:4-3318:115 */
      try
      {
        {
          double _8942_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8942_v) && (_8942_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_REL_GAP"),_8942_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolRelGap)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8941_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolPfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3322:4-3332:114 */
      try
      {
        {
          double _8944_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8944_v) && (_8944_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_PFEAS"),_8944_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolPfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8943_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolPfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolDfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3336:4-3346:114 */
      try
      {
        {
          double _8946_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8946_v) && (_8946_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_DFEAS"),_8946_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolDfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8945_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolDfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolMuRed")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3350:4-3360:114 */
      try
      {
        {
          double _8948_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8948_v) && (_8948_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_MU_RED"),_8948_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolMuRed)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8947_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolMuRed)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolNearRel")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3364:4-3374:116 */
      try
      {
        {
          double _8950_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e+00 <= _8950_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_NEAR_REL"),_8950_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolNearRel)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8949_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolNearRel)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntCoTolInfeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3378:4-3388:115 */
      try
      {
        {
          double _8952_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8952_v) && (_8952_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_CO_TOL_INFEAS"),_8952_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolInfeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8951_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntCoTolInfeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolPsafe")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3392:4-3402:112 */
      try
      {
        {
          double _8954_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-04 <= _8954_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_PSAFE"),_8954_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPsafe)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8953_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolPsafe)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("intpntTolDsafe")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3406:4-3416:112 */
      try
      {
        {
          double _8956_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-04 <= _8956_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_INTPNT_TOL_DSAFE"),_8956_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDsafe)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8955_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (intpntTolDsafe)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioMaxTime")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3420:4-3430:108 */
      try
      {
        {
          double _8958_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (true)
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_MAX_TIME"),_8958_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxTime)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8957_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioMaxTime)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioRelGapConst")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3434:4-3444:112 */
      try
      {
        {
          double _8960_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-15 <= _8960_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_REL_GAP_CONST"),_8960_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRelGapConst)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8959_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioRelGapConst)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioTolRelGap")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3448:4-3458:110 */
      try
      {
        {
          double _8962_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8962_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_GAP"),_8962_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelGap)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8961_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelGap)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioTolAbsGap")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3462:4-3472:110 */
      try
      {
        {
          double _8964_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8964_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_GAP"),_8964_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsGap)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8963_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsGap)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioTolAbsRelaxInt")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3476:4-3486:115 */
      try
      {
        {
          double _8966_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-09 <= _8966_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_ABS_RELAX_INT"),_8966_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsRelaxInt)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8965_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolAbsRelaxInt)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioDjcMaxBigm")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3490:4-3500:111 */
      try
      {
        {
          double _8968_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8968_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_DJC_MAX_BIGM"),_8968_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDjcMaxBigm)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8967_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioDjcMaxBigm)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("basisTolX")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3504:4-3514:107 */
      try
      {
        {
          double _8970_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-09 <= _8970_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_X"),_8970_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolX)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8969_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolX)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("basisTolS")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3518:4-3528:107 */
      try
      {
        {
          double _8972_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-09 <= _8972_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_TOL_S"),_8972_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolS)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8971_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisTolS)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("basisRelTolS")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3532:4-3542:110 */
      try
      {
        {
          double _8974_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8974_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_BASIS_REL_TOL_S"),_8974_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisRelTolS)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8973_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (basisRelTolS)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolX")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3546:4-3556:110 */
      try
      {
        {
          double _8976_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8976_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_X"),_8976_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolX)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8975_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolX)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolPrimalInfeasPerturbation")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3560:4-3570:133 */
      try
      {
        {
          double _8978_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8978_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_PRIMAL_INFEAS_PERTURBATION"),_8978_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolPrimalInfeasPerturbation)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8977_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolPrimalInfeasPerturbation)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolS")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3574:4-3584:110 */
      try
      {
        {
          double _8980_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8980_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_S"),_8980_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolS)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8979_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolS)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolAij")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3588:4-3598:112 */
      try
      {
        {
          double _8982_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-15 <= _8982_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_AIJ"),_8982_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAij)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8981_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAij)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolAbsLindep")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3602:4-3612:118 */
      try
      {
        {
          double _8984_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8984_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_ABS_LINDEP"),_8984_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAbsLindep)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8983_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolAbsLindep)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("presolveTolRelLindep")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3616:4-3626:118 */
      try
      {
        {
          double _8986_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((0.000000e+00 <= _8986_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_PRESOLVE_TOL_REL_LINDEP"),_8986_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolRelLindep)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8985_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (presolveTolRelLindep)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("simplexAbsTolPiv")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3630:4-3640:114 */
      try
      {
        {
          double _8988_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if ((1.000000e-12 <= _8988_v))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_SIMPLEX_ABS_TOL_PIV"),_8988_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simplexAbsTolPiv)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8987_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (simplexAbsTolPiv)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioTolFeas")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3644:4-3654:108 */
      try
      {
        {
          double _8990_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((1.000000e-09 <= _8990_v) && (_8990_v <= 1.000000e-03)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_FEAS"),_8990_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolFeas)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8989_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolFeas)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("mioTolRelDualBoundImprovement")))
  {
    {
      /* Try @ bld/docker-win/final/default/src/fusion/Parameters.mbi:3658:4-3668:127 */
      try
      {
        {
          double _8992_v = ::mosek::fusion::Utils::Tools::toDouble(_8731_value);
          if (((0.000000e+00 <= _8992_v) && (_8992_v <= 1.000000e+00)))
          {
            {
              mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_DPAR_MIO_TOL_REL_DUAL_BOUND_IMPROVEMENT"),_8992_v);
              return;
            }
          }
          else
          {
            {
              throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelDualBoundImprovement)"));
            }
          }
        }
      }
      catch (mosek::fusion::ValueConversionError _8991_e)
      {
        {
          throw ::mosek::fusion::ParameterError(std::string ("Invalid value for parameter (mioTolRelDualBoundImprovement)"));
        }
      }
    }
  }
  {}
  if ((_8730_name == std::string ("dataFileName")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_DATA_FILE_NAME"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("basSolFileName")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_BAS_SOL_FILE_NAME"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("itrSolFileName")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_ITR_SOL_FILE_NAME"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("intSolFileName")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_INT_SOL_FILE_NAME"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("writeLpGenVarName")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_WRITE_LP_GEN_VAR_NAME"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("remoteOptserverHost")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_REMOTE_OPTSERVER_HOST"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("remoteTlsCertPath")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_REMOTE_TLS_CERT_PATH"),_8731_value);
      return;
    }
  }
  {}
  if ((_8730_name == std::string ("remoteTlsCert")))
  {
    {
      mosek::fusion::p_Model::_get_impl(_8729_M.get())->task_put_param(std::string ("MSK_SPAR_REMOTE_TLS_CERT"),_8731_value);
      return;
    }
  }
  {}
  throw ::mosek::fusion::ParameterError(std::string ("Unknown parameter"));
}
// End mosek.fusion.Parameters.setParameter

// Begin mosek.fusion.Parameters.string_to_variabletype_value
// Method mosek.fusion.Parameters.string_to_variabletype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1894:0-1899:1
int32_t mosek::fusion::p_Parameters::string_to_variabletype_value(const std::string & _8993_v)
{
  if ((_8993_v == std::string ("typeCont")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8993_v == std::string ("typeInt")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_variabletype_value

// Begin mosek.fusion.Parameters.string_to_value_value
// Method mosek.fusion.Parameters.string_to_value_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1888:0-1893:1
int32_t mosek::fusion::p_Parameters::string_to_value_value(const std::string & _8994_v)
{
  if ((_8994_v == std::string ("maxStrLen")))
  {
    {
      return (int)1024;
    }
  }
  {}
  if ((_8994_v == std::string ("licenseBufferLength")))
  {
    {
      return (int)21;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_value_value

// Begin mosek.fusion.Parameters.string_to_streamtype_value
// Method mosek.fusion.Parameters.string_to_streamtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1880:0-1887:1
int32_t mosek::fusion::p_Parameters::string_to_streamtype_value(const std::string & _8995_v)
{
  if ((_8995_v == std::string ("log")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8995_v == std::string ("msg")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_8995_v == std::string ("err")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_8995_v == std::string ("wrn")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_streamtype_value

// Begin mosek.fusion.Parameters.string_to_startpointtype_value
// Method mosek.fusion.Parameters.string_to_startpointtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1873:0-1879:1
int32_t mosek::fusion::p_Parameters::string_to_startpointtype_value(const std::string & _8996_v)
{
  if ((_8996_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8996_v == std::string ("guess")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_8996_v == std::string ("constant")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_startpointtype_value

// Begin mosek.fusion.Parameters.string_to_stakey_value
// Method mosek.fusion.Parameters.string_to_stakey_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1862:0-1872:1
int32_t mosek::fusion::p_Parameters::string_to_stakey_value(const std::string & _8997_v)
{
  if ((_8997_v == std::string ("unk")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8997_v == std::string ("bas")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_8997_v == std::string ("supbas")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_8997_v == std::string ("low")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_8997_v == std::string ("upr")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_8997_v == std::string ("fix")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_8997_v == std::string ("inf")))
  {
    {
      return (int)6;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_stakey_value

// Begin mosek.fusion.Parameters.string_to_sparam_value
// Method mosek.fusion.Parameters.string_to_sparam_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1833:0-1861:1
int32_t mosek::fusion::p_Parameters::string_to_sparam_value(const std::string & _8998_v)
{
  if ((_8998_v == std::string ("dataFileName")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_8998_v == std::string ("paramReadFileName")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_8998_v == std::string ("paramWriteFileName")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_8998_v == std::string ("paramCommentSign")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_8998_v == std::string ("debugFileName")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_8998_v == std::string ("basSolFileName")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8998_v == std::string ("itrSolFileName")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_8998_v == std::string ("intSolFileName")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_8998_v == std::string ("solFilterXcLow")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_8998_v == std::string ("solFilterXcUpr")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_8998_v == std::string ("solFilterXxLow")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_8998_v == std::string ("solFilterXxUpr")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_8998_v == std::string ("readMpsObjName")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_8998_v == std::string ("readMpsRanName")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_8998_v == std::string ("readMpsRhsName")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_8998_v == std::string ("readMpsBouName")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_8998_v == std::string ("statName")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_8998_v == std::string ("statKey")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_8998_v == std::string ("writeLpGenVarName")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_8998_v == std::string ("sensitivityResFileName")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_8998_v == std::string ("sensitivityFileName")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_8998_v == std::string ("mioDebugString")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_8998_v == std::string ("remoteOptserverHost")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_8998_v == std::string ("remoteTlsCertPath")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_8998_v == std::string ("remoteTlsCert")))
  {
    {
      return (int)14;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_sparam_value

// Begin mosek.fusion.Parameters.string_to_solveform_value
// Method mosek.fusion.Parameters.string_to_solveform_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1826:0-1832:1
int32_t mosek::fusion::p_Parameters::string_to_solveform_value(const std::string & _8999_v)
{
  if ((_8999_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_8999_v == std::string ("primal")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_8999_v == std::string ("dual")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_solveform_value

// Begin mosek.fusion.Parameters.string_to_soltype_value
// Method mosek.fusion.Parameters.string_to_soltype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1819:0-1825:1
int32_t mosek::fusion::p_Parameters::string_to_soltype_value(const std::string & _9000_v)
{
  if ((_9000_v == std::string ("bas")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9000_v == std::string ("itr")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9000_v == std::string ("itg")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_soltype_value

// Begin mosek.fusion.Parameters.string_to_solsta_value
// Method mosek.fusion.Parameters.string_to_solsta_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1805:0-1818:1
int32_t mosek::fusion::p_Parameters::string_to_solsta_value(const std::string & _9001_v)
{
  if ((_9001_v == std::string ("unknown")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9001_v == std::string ("optimal")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9001_v == std::string ("primFeas")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9001_v == std::string ("dualFeas")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9001_v == std::string ("primAndDualFeas")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9001_v == std::string ("primInfeasCer")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9001_v == std::string ("dualInfeasCer")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9001_v == std::string ("primIllposedCer")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9001_v == std::string ("dualIllposedCer")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9001_v == std::string ("integerOptimal")))
  {
    {
      return (int)9;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_solsta_value

// Begin mosek.fusion.Parameters.string_to_solitem_value
// Method mosek.fusion.Parameters.string_to_solitem_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1793:0-1804:1
int32_t mosek::fusion::p_Parameters::string_to_solitem_value(const std::string & _9002_v)
{
  if ((_9002_v == std::string ("xc")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9002_v == std::string ("xx")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9002_v == std::string ("y")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9002_v == std::string ("slc")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9002_v == std::string ("suc")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9002_v == std::string ("slx")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9002_v == std::string ("sux")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9002_v == std::string ("snx")))
  {
    {
      return (int)7;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_solitem_value

// Begin mosek.fusion.Parameters.string_to_simseltype_value
// Method mosek.fusion.Parameters.string_to_simseltype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1783:0-1792:1
int32_t mosek::fusion::p_Parameters::string_to_simseltype_value(const std::string & _9003_v)
{
  if ((_9003_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9003_v == std::string ("full")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9003_v == std::string ("ase")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9003_v == std::string ("devex")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9003_v == std::string ("se")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9003_v == std::string ("partial")))
  {
    {
      return (int)5;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_simseltype_value

// Begin mosek.fusion.Parameters.string_to_sensitivitytype_value
// Method mosek.fusion.Parameters.string_to_sensitivitytype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1778:0-1782:1
int32_t mosek::fusion::p_Parameters::string_to_sensitivitytype_value(const std::string & _9004_v)
{
  if ((_9004_v == std::string ("basis")))
  {
    {
      return (int)0;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_sensitivitytype_value

// Begin mosek.fusion.Parameters.string_to_scalingmethod_value
// Method mosek.fusion.Parameters.string_to_scalingmethod_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1772:0-1777:1
int32_t mosek::fusion::p_Parameters::string_to_scalingmethod_value(const std::string & _9005_v)
{
  if ((_9005_v == std::string ("pow2")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9005_v == std::string ("free")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_scalingmethod_value

// Begin mosek.fusion.Parameters.string_to_scalingtype_value
// Method mosek.fusion.Parameters.string_to_scalingtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1766:0-1771:1
int32_t mosek::fusion::p_Parameters::string_to_scalingtype_value(const std::string & _9006_v)
{
  if ((_9006_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9006_v == std::string ("none")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_scalingtype_value

// Begin mosek.fusion.Parameters.string_to_rescodetype_value
// Method mosek.fusion.Parameters.string_to_rescodetype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1757:0-1765:1
int32_t mosek::fusion::p_Parameters::string_to_rescodetype_value(const std::string & _9007_v)
{
  if ((_9007_v == std::string ("ok")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9007_v == std::string ("wrn")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9007_v == std::string ("trm")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9007_v == std::string ("err")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9007_v == std::string ("unk")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_rescodetype_value

// Begin mosek.fusion.Parameters.string_to_rescode_value
// Method mosek.fusion.Parameters.string_to_rescode_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1208:0-1756:1
int32_t mosek::fusion::p_Parameters::string_to_rescode_value(const std::string & _9008_v)
{
  if ((_9008_v == std::string ("ok")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnOpenParamFile")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeBound")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeLoBound")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeUpBound")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeConFx")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeCj")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeAij")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnZeroAij")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnNameMaxLen")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnSparMaxLen")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnMpsSplitRhsVector")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnMpsSplitRanVector")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnMpsSplitBouVector")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLpOldQuadFormat")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLpDropVariable")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnNzInUprTri")))
  {
    {
      return (int)200;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnDroppedNzQobj")))
  {
    {
      return (int)201;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnIgnoreInteger")))
  {
    {
      return (int)250;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnNoGlobalOptimizer")))
  {
    {
      return (int)251;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnMioInfeasibleFinal")))
  {
    {
      return (int)270;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnSolFilter")))
  {
    {
      return (int)300;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnUndefSolFileName")))
  {
    {
      return (int)350;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnSolFileIgnoredCon")))
  {
    {
      return (int)351;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnSolFileIgnoredVar")))
  {
    {
      return (int)352;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnTooFewBasisVars")))
  {
    {
      return (int)400;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnTooManyBasisVars")))
  {
    {
      return (int)405;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLicenseExpire")))
  {
    {
      return (int)500;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLicenseServer")))
  {
    {
      return (int)501;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnEmptyName")))
  {
    {
      return (int)502;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnUsingGenericNames")))
  {
    {
      return (int)503;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnInvalidMpsName")))
  {
    {
      return (int)504;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnInvalidMpsObjName")))
  {
    {
      return (int)505;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLicenseFeatureExpire")))
  {
    {
      return (int)509;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnParamNameDou")))
  {
    {
      return (int)510;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnParamNameInt")))
  {
    {
      return (int)511;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnParamNameStr")))
  {
    {
      return (int)512;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnParamStrValue")))
  {
    {
      return (int)515;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnParamIgnoredCmio")))
  {
    {
      return (int)516;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnZerosInSparseRow")))
  {
    {
      return (int)705;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnZerosInSparseCol")))
  {
    {
      return (int)710;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnIncompleteLinearDependencyCheck")))
  {
    {
      return (int)800;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnEliminatorSpace")))
  {
    {
      return (int)801;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnPresolveOutofspace")))
  {
    {
      return (int)802;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnPresolvePrimalPertubations")))
  {
    {
      return (int)803;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteChangedNames")))
  {
    {
      return (int)830;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteDiscardedCfix")))
  {
    {
      return (int)831;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnDuplicateConstraintNames")))
  {
    {
      return (int)850;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnDuplicateVariableNames")))
  {
    {
      return (int)851;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnDuplicateBarvariableNames")))
  {
    {
      return (int)852;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnDuplicateConeNames")))
  {
    {
      return (int)853;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteLpInvalidVarNames")))
  {
    {
      return (int)854;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteLpDuplicateVarNames")))
  {
    {
      return (int)855;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteLpInvalidConNames")))
  {
    {
      return (int)856;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnWriteLpDuplicateConNames")))
  {
    {
      return (int)857;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnAnaLargeBounds")))
  {
    {
      return (int)900;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnAnaCZero")))
  {
    {
      return (int)901;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnAnaEmptyCols")))
  {
    {
      return (int)902;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnAnaCloseBounds")))
  {
    {
      return (int)903;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnAnaAlmostIntBounds")))
  {
    {
      return (int)904;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnNoInfeasibilityReportWhenMatrixVariables")))
  {
    {
      return (int)930;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnNoDualizer")))
  {
    {
      return (int)950;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnSymMatLarge")))
  {
    {
      return (int)960;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnModifiedDoubleParameter")))
  {
    {
      return (int)970;
    }
  }
  {}
  if ((_9008_v == std::string ("wrnLargeFij")))
  {
    {
      return (int)980;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicense")))
  {
    {
      return (int)1000;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseExpired")))
  {
    {
      return (int)1001;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseVersion")))
  {
    {
      return (int)1002;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseOldServerVersion")))
  {
    {
      return (int)1003;
    }
  }
  {}
  if ((_9008_v == std::string ("errSizeLicense")))
  {
    {
      return (int)1005;
    }
  }
  {}
  if ((_9008_v == std::string ("errProbLicense")))
  {
    {
      return (int)1006;
    }
  }
  {}
  if ((_9008_v == std::string ("errFileLicense")))
  {
    {
      return (int)1007;
    }
  }
  {}
  if ((_9008_v == std::string ("errMissingLicenseFile")))
  {
    {
      return (int)1008;
    }
  }
  {}
  if ((_9008_v == std::string ("errSizeLicenseCon")))
  {
    {
      return (int)1010;
    }
  }
  {}
  if ((_9008_v == std::string ("errSizeLicenseVar")))
  {
    {
      return (int)1011;
    }
  }
  {}
  if ((_9008_v == std::string ("errSizeLicenseIntvar")))
  {
    {
      return (int)1012;
    }
  }
  {}
  if ((_9008_v == std::string ("errOptimizerLicense")))
  {
    {
      return (int)1013;
    }
  }
  {}
  if ((_9008_v == std::string ("errFlexlm")))
  {
    {
      return (int)1014;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseServer")))
  {
    {
      return (int)1015;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseMax")))
  {
    {
      return (int)1016;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseMoseklmDaemon")))
  {
    {
      return (int)1017;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseFeature")))
  {
    {
      return (int)1018;
    }
  }
  {}
  if ((_9008_v == std::string ("errPlatformNotLicensed")))
  {
    {
      return (int)1019;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseCannotAllocate")))
  {
    {
      return (int)1020;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseCannotConnect")))
  {
    {
      return (int)1021;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseInvalidHostid")))
  {
    {
      return (int)1025;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseServerVersion")))
  {
    {
      return (int)1026;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseNoServerSupport")))
  {
    {
      return (int)1027;
    }
  }
  {}
  if ((_9008_v == std::string ("errLicenseNoServerLine")))
  {
    {
      return (int)1028;
    }
  }
  {}
  if ((_9008_v == std::string ("errOlderDll")))
  {
    {
      return (int)1035;
    }
  }
  {}
  if ((_9008_v == std::string ("errNewerDll")))
  {
    {
      return (int)1036;
    }
  }
  {}
  if ((_9008_v == std::string ("errLinkFileDll")))
  {
    {
      return (int)1040;
    }
  }
  {}
  if ((_9008_v == std::string ("errThreadMutexInit")))
  {
    {
      return (int)1045;
    }
  }
  {}
  if ((_9008_v == std::string ("errThreadMutexLock")))
  {
    {
      return (int)1046;
    }
  }
  {}
  if ((_9008_v == std::string ("errThreadMutexUnlock")))
  {
    {
      return (int)1047;
    }
  }
  {}
  if ((_9008_v == std::string ("errThreadCreate")))
  {
    {
      return (int)1048;
    }
  }
  {}
  if ((_9008_v == std::string ("errThreadCondInit")))
  {
    {
      return (int)1049;
    }
  }
  {}
  if ((_9008_v == std::string ("errUnknown")))
  {
    {
      return (int)1050;
    }
  }
  {}
  if ((_9008_v == std::string ("errSpace")))
  {
    {
      return (int)1051;
    }
  }
  {}
  if ((_9008_v == std::string ("errFileOpen")))
  {
    {
      return (int)1052;
    }
  }
  {}
  if ((_9008_v == std::string ("errFileRead")))
  {
    {
      return (int)1053;
    }
  }
  {}
  if ((_9008_v == std::string ("errFileWrite")))
  {
    {
      return (int)1054;
    }
  }
  {}
  if ((_9008_v == std::string ("errDataFileExt")))
  {
    {
      return (int)1055;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileName")))
  {
    {
      return (int)1056;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidSolFileName")))
  {
    {
      return (int)1057;
    }
  }
  {}
  if ((_9008_v == std::string ("errEndOfFile")))
  {
    {
      return (int)1059;
    }
  }
  {}
  if ((_9008_v == std::string ("errNullEnv")))
  {
    {
      return (int)1060;
    }
  }
  {}
  if ((_9008_v == std::string ("errNullTask")))
  {
    {
      return (int)1061;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidStream")))
  {
    {
      return (int)1062;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoInitEnv")))
  {
    {
      return (int)1063;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidTask")))
  {
    {
      return (int)1064;
    }
  }
  {}
  if ((_9008_v == std::string ("errNullPointer")))
  {
    {
      return (int)1065;
    }
  }
  {}
  if ((_9008_v == std::string ("errLivingTasks")))
  {
    {
      return (int)1066;
    }
  }
  {}
  if ((_9008_v == std::string ("errReadGzip")))
  {
    {
      return (int)1067;
    }
  }
  {}
  if ((_9008_v == std::string ("errReadZstd")))
  {
    {
      return (int)1068;
    }
  }
  {}
  if ((_9008_v == std::string ("errBlankName")))
  {
    {
      return (int)1070;
    }
  }
  {}
  if ((_9008_v == std::string ("errDupName")))
  {
    {
      return (int)1071;
    }
  }
  {}
  if ((_9008_v == std::string ("errFormatString")))
  {
    {
      return (int)1072;
    }
  }
  {}
  if ((_9008_v == std::string ("errSparsitySpecification")))
  {
    {
      return (int)1073;
    }
  }
  {}
  if ((_9008_v == std::string ("errMismatchingDimension")))
  {
    {
      return (int)1074;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidObjName")))
  {
    {
      return (int)1075;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidConName")))
  {
    {
      return (int)1076;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidVarName")))
  {
    {
      return (int)1077;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidConeName")))
  {
    {
      return (int)1078;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidBarvarName")))
  {
    {
      return (int)1079;
    }
  }
  {}
  if ((_9008_v == std::string ("errSpaceLeaking")))
  {
    {
      return (int)1080;
    }
  }
  {}
  if ((_9008_v == std::string ("errSpaceNoInfo")))
  {
    {
      return (int)1081;
    }
  }
  {}
  if ((_9008_v == std::string ("errDimensionSpecification")))
  {
    {
      return (int)1082;
    }
  }
  {}
  if ((_9008_v == std::string ("errAxisNameSpecification")))
  {
    {
      return (int)1083;
    }
  }
  {}
  if ((_9008_v == std::string ("errReadFormat")))
  {
    {
      return (int)1090;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsFile")))
  {
    {
      return (int)1100;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvField")))
  {
    {
      return (int)1101;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvMarker")))
  {
    {
      return (int)1102;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsNullConName")))
  {
    {
      return (int)1103;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsNullVarName")))
  {
    {
      return (int)1104;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsUndefConName")))
  {
    {
      return (int)1105;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsUndefVarName")))
  {
    {
      return (int)1106;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidConKey")))
  {
    {
      return (int)1107;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidBoundKey")))
  {
    {
      return (int)1108;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidSecName")))
  {
    {
      return (int)1109;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsNoObjective")))
  {
    {
      return (int)1110;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsSplittedVar")))
  {
    {
      return (int)1111;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsMulConName")))
  {
    {
      return (int)1112;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsMulQsec")))
  {
    {
      return (int)1113;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsMulQobj")))
  {
    {
      return (int)1114;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvSecOrder")))
  {
    {
      return (int)1115;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsMulCsec")))
  {
    {
      return (int)1116;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsConeType")))
  {
    {
      return (int)1117;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsConeOverlap")))
  {
    {
      return (int)1118;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsConeRepeat")))
  {
    {
      return (int)1119;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsNonSymmetricQ")))
  {
    {
      return (int)1120;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsDuplicateQElement")))
  {
    {
      return (int)1121;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidObjsense")))
  {
    {
      return (int)1122;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsTabInField2")))
  {
    {
      return (int)1125;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsTabInField3")))
  {
    {
      return (int)1126;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsTabInField5")))
  {
    {
      return (int)1127;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidObjName")))
  {
    {
      return (int)1128;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidKey")))
  {
    {
      return (int)1129;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidIndicatorConstraint")))
  {
    {
      return (int)1130;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidIndicatorVariable")))
  {
    {
      return (int)1131;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidIndicatorValue")))
  {
    {
      return (int)1132;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsInvalidIndicatorQuadraticConstraint")))
  {
    {
      return (int)1133;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfSyntax")))
  {
    {
      return (int)1134;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfPrematureEof")))
  {
    {
      return (int)1136;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfMismatchedTag")))
  {
    {
      return (int)1137;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfDuplicateBound")))
  {
    {
      return (int)1138;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfDuplicateConstraintName")))
  {
    {
      return (int)1139;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfInvalidConeType")))
  {
    {
      return (int)1140;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfIncorrectTagParam")))
  {
    {
      return (int)1141;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfInvalidTag")))
  {
    {
      return (int)1142;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfDuplicateConeEntry")))
  {
    {
      return (int)1143;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfTooLarge")))
  {
    {
      return (int)1144;
    }
  }
  {}
  if ((_9008_v == std::string ("errOpfDualIntegerSolution")))
  {
    {
      return (int)1146;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpEmpty")))
  {
    {
      return (int)1151;
    }
  }
  {}
  if ((_9008_v == std::string ("errWriteMpsInvalidName")))
  {
    {
      return (int)1153;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpInvalidVarName")))
  {
    {
      return (int)1154;
    }
  }
  {}
  if ((_9008_v == std::string ("errWriteOpfInvalidVarName")))
  {
    {
      return (int)1156;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpFileFormat")))
  {
    {
      return (int)1157;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpExpectedNumber")))
  {
    {
      return (int)1158;
    }
  }
  {}
  if ((_9008_v == std::string ("errReadLpMissingEndTag")))
  {
    {
      return (int)1159;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpIndicatorVar")))
  {
    {
      return (int)1160;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpExpectedObjective")))
  {
    {
      return (int)1161;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpExpectedConstraintRelation")))
  {
    {
      return (int)1162;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpAmbiguousConstraintBound")))
  {
    {
      return (int)1163;
    }
  }
  {}
  if ((_9008_v == std::string ("errLpDuplicateSection")))
  {
    {
      return (int)1164;
    }
  }
  {}
  if ((_9008_v == std::string ("errReadLpDelayedRowsNotSupported")))
  {
    {
      return (int)1165;
    }
  }
  {}
  if ((_9008_v == std::string ("errWritingFile")))
  {
    {
      return (int)1166;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidNameInSolFile")))
  {
    {
      return (int)1170;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonSyntax")))
  {
    {
      return (int)1175;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonString")))
  {
    {
      return (int)1176;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonNumberOverflow")))
  {
    {
      return (int)1177;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonFormat")))
  {
    {
      return (int)1178;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonData")))
  {
    {
      return (int)1179;
    }
  }
  {}
  if ((_9008_v == std::string ("errJsonMissingData")))
  {
    {
      return (int)1180;
    }
  }
  {}
  if ((_9008_v == std::string ("errPtfIncompatibility")))
  {
    {
      return (int)1181;
    }
  }
  {}
  if ((_9008_v == std::string ("errPtfUndefinedItem")))
  {
    {
      return (int)1182;
    }
  }
  {}
  if ((_9008_v == std::string ("errPtfInconsistency")))
  {
    {
      return (int)1183;
    }
  }
  {}
  if ((_9008_v == std::string ("errPtfFormat")))
  {
    {
      return (int)1184;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentLenneq")))
  {
    {
      return (int)1197;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentType")))
  {
    {
      return (int)1198;
    }
  }
  {}
  if ((_9008_v == std::string ("errNumArguments")))
  {
    {
      return (int)1199;
    }
  }
  {}
  if ((_9008_v == std::string ("errInArgument")))
  {
    {
      return (int)1200;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentDimension")))
  {
    {
      return (int)1201;
    }
  }
  {}
  if ((_9008_v == std::string ("errShapeIsTooLarge")))
  {
    {
      return (int)1202;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndexIsTooSmall")))
  {
    {
      return (int)1203;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndexIsTooLarge")))
  {
    {
      return (int)1204;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndexIsNotUnique")))
  {
    {
      return (int)1205;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamName")))
  {
    {
      return (int)1206;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamNameDou")))
  {
    {
      return (int)1207;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamNameInt")))
  {
    {
      return (int)1208;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamNameStr")))
  {
    {
      return (int)1209;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamIndex")))
  {
    {
      return (int)1210;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamIsTooLarge")))
  {
    {
      return (int)1215;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamIsTooSmall")))
  {
    {
      return (int)1216;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamValueStr")))
  {
    {
      return (int)1217;
    }
  }
  {}
  if ((_9008_v == std::string ("errParamType")))
  {
    {
      return (int)1218;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfDouIndex")))
  {
    {
      return (int)1219;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfIntIndex")))
  {
    {
      return (int)1220;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndexArrIsTooSmall")))
  {
    {
      return (int)1221;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndexArrIsTooLarge")))
  {
    {
      return (int)1222;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfLintIndex")))
  {
    {
      return (int)1225;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgIsTooSmall")))
  {
    {
      return (int)1226;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgIsTooLarge")))
  {
    {
      return (int)1227;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidWhichsol")))
  {
    {
      return (int)1228;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfDouName")))
  {
    {
      return (int)1230;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfIntName")))
  {
    {
      return (int)1231;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfType")))
  {
    {
      return (int)1232;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfLintName")))
  {
    {
      return (int)1234;
    }
  }
  {}
  if ((_9008_v == std::string ("errIndex")))
  {
    {
      return (int)1235;
    }
  }
  {}
  if ((_9008_v == std::string ("errWhichsol")))
  {
    {
      return (int)1236;
    }
  }
  {}
  if ((_9008_v == std::string ("errSolitem")))
  {
    {
      return (int)1237;
    }
  }
  {}
  if ((_9008_v == std::string ("errWhichitemNotAllowed")))
  {
    {
      return (int)1238;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxnumcon")))
  {
    {
      return (int)1240;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxnumvar")))
  {
    {
      return (int)1241;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxnumbarvar")))
  {
    {
      return (int)1242;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxnumqnz")))
  {
    {
      return (int)1243;
    }
  }
  {}
  if ((_9008_v == std::string ("errTooSmallMaxNumNz")))
  {
    {
      return (int)1245;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidIdx")))
  {
    {
      return (int)1246;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidMaxNum")))
  {
    {
      return (int)1247;
    }
  }
  {}
  if ((_9008_v == std::string ("errUnallowedWhichsol")))
  {
    {
      return (int)1248;
    }
  }
  {}
  if ((_9008_v == std::string ("errNumconlim")))
  {
    {
      return (int)1250;
    }
  }
  {}
  if ((_9008_v == std::string ("errNumvarlim")))
  {
    {
      return (int)1251;
    }
  }
  {}
  if ((_9008_v == std::string ("errTooSmallMaxnumanz")))
  {
    {
      return (int)1252;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvAptre")))
  {
    {
      return (int)1253;
    }
  }
  {}
  if ((_9008_v == std::string ("errMulAElement")))
  {
    {
      return (int)1254;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvBk")))
  {
    {
      return (int)1255;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvBkc")))
  {
    {
      return (int)1256;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvBkx")))
  {
    {
      return (int)1257;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvVarType")))
  {
    {
      return (int)1258;
    }
  }
  {}
  if ((_9008_v == std::string ("errSolverProbtype")))
  {
    {
      return (int)1259;
    }
  }
  {}
  if ((_9008_v == std::string ("errObjectiveRange")))
  {
    {
      return (int)1260;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvRescode")))
  {
    {
      return (int)1261;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvIinf")))
  {
    {
      return (int)1262;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvLiinf")))
  {
    {
      return (int)1263;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvDinf")))
  {
    {
      return (int)1264;
    }
  }
  {}
  if ((_9008_v == std::string ("errBasis")))
  {
    {
      return (int)1266;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvSkc")))
  {
    {
      return (int)1267;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvSkx")))
  {
    {
      return (int)1268;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvSkn")))
  {
    {
      return (int)1274;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvSkStr")))
  {
    {
      return (int)1269;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvSk")))
  {
    {
      return (int)1270;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvConeTypeStr")))
  {
    {
      return (int)1271;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvConeType")))
  {
    {
      return (int)1272;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidSurplus")))
  {
    {
      return (int)1275;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvNameItem")))
  {
    {
      return (int)1280;
    }
  }
  {}
  if ((_9008_v == std::string ("errProItem")))
  {
    {
      return (int)1281;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFormatType")))
  {
    {
      return (int)1283;
    }
  }
  {}
  if ((_9008_v == std::string ("errFirsti")))
  {
    {
      return (int)1285;
    }
  }
  {}
  if ((_9008_v == std::string ("errLasti")))
  {
    {
      return (int)1286;
    }
  }
  {}
  if ((_9008_v == std::string ("errFirstj")))
  {
    {
      return (int)1287;
    }
  }
  {}
  if ((_9008_v == std::string ("errLastj")))
  {
    {
      return (int)1288;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxLenIsTooSmall")))
  {
    {
      return (int)1289;
    }
  }
  {}
  if ((_9008_v == std::string ("errNonlinearEquality")))
  {
    {
      return (int)1290;
    }
  }
  {}
  if ((_9008_v == std::string ("errNonconvex")))
  {
    {
      return (int)1291;
    }
  }
  {}
  if ((_9008_v == std::string ("errNonlinearRanged")))
  {
    {
      return (int)1292;
    }
  }
  {}
  if ((_9008_v == std::string ("errConQNotPsd")))
  {
    {
      return (int)1293;
    }
  }
  {}
  if ((_9008_v == std::string ("errConQNotNsd")))
  {
    {
      return (int)1294;
    }
  }
  {}
  if ((_9008_v == std::string ("errObjQNotPsd")))
  {
    {
      return (int)1295;
    }
  }
  {}
  if ((_9008_v == std::string ("errObjQNotNsd")))
  {
    {
      return (int)1296;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentPermArray")))
  {
    {
      return (int)1299;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeIndex")))
  {
    {
      return (int)1300;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeSize")))
  {
    {
      return (int)1301;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeOverlap")))
  {
    {
      return (int)1302;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeRepVar")))
  {
    {
      return (int)1303;
    }
  }
  {}
  if ((_9008_v == std::string ("errMaxnumcone")))
  {
    {
      return (int)1304;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeType")))
  {
    {
      return (int)1305;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeTypeStr")))
  {
    {
      return (int)1306;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeOverlapAppend")))
  {
    {
      return (int)1307;
    }
  }
  {}
  if ((_9008_v == std::string ("errRemoveConeVariable")))
  {
    {
      return (int)1310;
    }
  }
  {}
  if ((_9008_v == std::string ("errAppendingTooBigCone")))
  {
    {
      return (int)1311;
    }
  }
  {}
  if ((_9008_v == std::string ("errConeParameter")))
  {
    {
      return (int)1320;
    }
  }
  {}
  if ((_9008_v == std::string ("errSolFileInvalidNumber")))
  {
    {
      return (int)1350;
    }
  }
  {}
  if ((_9008_v == std::string ("errHugeC")))
  {
    {
      return (int)1375;
    }
  }
  {}
  if ((_9008_v == std::string ("errHugeAij")))
  {
    {
      return (int)1380;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateAij")))
  {
    {
      return (int)1385;
    }
  }
  {}
  if ((_9008_v == std::string ("errLowerBoundIsANan")))
  {
    {
      return (int)1390;
    }
  }
  {}
  if ((_9008_v == std::string ("errUpperBoundIsANan")))
  {
    {
      return (int)1391;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfiniteBound")))
  {
    {
      return (int)1400;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQobjSubi")))
  {
    {
      return (int)1401;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQobjSubj")))
  {
    {
      return (int)1402;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQobjVal")))
  {
    {
      return (int)1403;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQconSubk")))
  {
    {
      return (int)1404;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQconSubi")))
  {
    {
      return (int)1405;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQconSubj")))
  {
    {
      return (int)1406;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvQconVal")))
  {
    {
      return (int)1407;
    }
  }
  {}
  if ((_9008_v == std::string ("errQconSubiTooSmall")))
  {
    {
      return (int)1408;
    }
  }
  {}
  if ((_9008_v == std::string ("errQconSubiTooLarge")))
  {
    {
      return (int)1409;
    }
  }
  {}
  if ((_9008_v == std::string ("errQobjUpperTriangle")))
  {
    {
      return (int)1415;
    }
  }
  {}
  if ((_9008_v == std::string ("errQconUpperTriangle")))
  {
    {
      return (int)1417;
    }
  }
  {}
  if ((_9008_v == std::string ("errFixedBoundValues")))
  {
    {
      return (int)1420;
    }
  }
  {}
  if ((_9008_v == std::string ("errTooSmallATruncationValue")))
  {
    {
      return (int)1421;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidObjectiveSense")))
  {
    {
      return (int)1445;
    }
  }
  {}
  if ((_9008_v == std::string ("errUndefinedObjectiveSense")))
  {
    {
      return (int)1446;
    }
  }
  {}
  if ((_9008_v == std::string ("errYIsUndefined")))
  {
    {
      return (int)1449;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInDoubleData")))
  {
    {
      return (int)1450;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfInDoubleData")))
  {
    {
      return (int)1451;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInBlc")))
  {
    {
      return (int)1461;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInBuc")))
  {
    {
      return (int)1462;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidCfix")))
  {
    {
      return (int)1469;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInC")))
  {
    {
      return (int)1470;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInBlx")))
  {
    {
      return (int)1471;
    }
  }
  {}
  if ((_9008_v == std::string ("errNanInBux")))
  {
    {
      return (int)1472;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidAij")))
  {
    {
      return (int)1473;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidCj")))
  {
    {
      return (int)1474;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatInvalid")))
  {
    {
      return (int)1480;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatHuge")))
  {
    {
      return (int)1482;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvProblem")))
  {
    {
      return (int)1500;
    }
  }
  {}
  if ((_9008_v == std::string ("errMixedConicAndNl")))
  {
    {
      return (int)1501;
    }
  }
  {}
  if ((_9008_v == std::string ("errGlobalInvConicProblem")))
  {
    {
      return (int)1503;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvOptimizer")))
  {
    {
      return (int)1550;
    }
  }
  {}
  if ((_9008_v == std::string ("errMioNoOptimizer")))
  {
    {
      return (int)1551;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoOptimizerVarType")))
  {
    {
      return (int)1552;
    }
  }
  {}
  if ((_9008_v == std::string ("errFinalSolution")))
  {
    {
      return (int)1560;
    }
  }
  {}
  if ((_9008_v == std::string ("errFirst")))
  {
    {
      return (int)1570;
    }
  }
  {}
  if ((_9008_v == std::string ("errLast")))
  {
    {
      return (int)1571;
    }
  }
  {}
  if ((_9008_v == std::string ("errSliceSize")))
  {
    {
      return (int)1572;
    }
  }
  {}
  if ((_9008_v == std::string ("errNegativeSurplus")))
  {
    {
      return (int)1573;
    }
  }
  {}
  if ((_9008_v == std::string ("errNegativeAppend")))
  {
    {
      return (int)1578;
    }
  }
  {}
  if ((_9008_v == std::string ("errPostsolve")))
  {
    {
      return (int)1580;
    }
  }
  {}
  if ((_9008_v == std::string ("errOverflow")))
  {
    {
      return (int)1590;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoBasisSol")))
  {
    {
      return (int)1600;
    }
  }
  {}
  if ((_9008_v == std::string ("errBasisFactor")))
  {
    {
      return (int)1610;
    }
  }
  {}
  if ((_9008_v == std::string ("errBasisSingular")))
  {
    {
      return (int)1615;
    }
  }
  {}
  if ((_9008_v == std::string ("errFactor")))
  {
    {
      return (int)1650;
    }
  }
  {}
  if ((_9008_v == std::string ("errFeasrepairCannotRelax")))
  {
    {
      return (int)1700;
    }
  }
  {}
  if ((_9008_v == std::string ("errFeasrepairSolvingRelaxed")))
  {
    {
      return (int)1701;
    }
  }
  {}
  if ((_9008_v == std::string ("errFeasrepairInconsistentBound")))
  {
    {
      return (int)1702;
    }
  }
  {}
  if ((_9008_v == std::string ("errRepairInvalidProblem")))
  {
    {
      return (int)1710;
    }
  }
  {}
  if ((_9008_v == std::string ("errRepairOptimizationFailed")))
  {
    {
      return (int)1711;
    }
  }
  {}
  if ((_9008_v == std::string ("errNameMaxLen")))
  {
    {
      return (int)1750;
    }
  }
  {}
  if ((_9008_v == std::string ("errNameIsNull")))
  {
    {
      return (int)1760;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidCompression")))
  {
    {
      return (int)1800;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidIomode")))
  {
    {
      return (int)1801;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoPrimalInfeasCer")))
  {
    {
      return (int)2000;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoDualInfeasCer")))
  {
    {
      return (int)2001;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoSolutionInCallback")))
  {
    {
      return (int)2500;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvMarki")))
  {
    {
      return (int)2501;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvMarkj")))
  {
    {
      return (int)2502;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvNumi")))
  {
    {
      return (int)2503;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvNumj")))
  {
    {
      return (int)2504;
    }
  }
  {}
  if ((_9008_v == std::string ("errTaskIncompatible")))
  {
    {
      return (int)2560;
    }
  }
  {}
  if ((_9008_v == std::string ("errTaskInvalid")))
  {
    {
      return (int)2561;
    }
  }
  {}
  if ((_9008_v == std::string ("errTaskWrite")))
  {
    {
      return (int)2562;
    }
  }
  {}
  if ((_9008_v == std::string ("errLuMaxNumTries")))
  {
    {
      return (int)2800;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidUtf8")))
  {
    {
      return (int)2900;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidWchar")))
  {
    {
      return (int)2901;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoDualForItgSol")))
  {
    {
      return (int)2950;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoSnxForBasSol")))
  {
    {
      return (int)2953;
    }
  }
  {}
  if ((_9008_v == std::string ("errInternal")))
  {
    {
      return (int)3000;
    }
  }
  {}
  if ((_9008_v == std::string ("errApiArrayTooSmall")))
  {
    {
      return (int)3001;
    }
  }
  {}
  if ((_9008_v == std::string ("errApiCbConnect")))
  {
    {
      return (int)3002;
    }
  }
  {}
  if ((_9008_v == std::string ("errApiFatalError")))
  {
    {
      return (int)3005;
    }
  }
  {}
  if ((_9008_v == std::string ("errApiInternal")))
  {
    {
      return (int)3999;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenFormat")))
  {
    {
      return (int)3050;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenUndefName")))
  {
    {
      return (int)3051;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenIndexRange")))
  {
    {
      return (int)3052;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenBoundInvalidUp")))
  {
    {
      return (int)3053;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenBoundInvalidLo")))
  {
    {
      return (int)3054;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenIndexInvalid")))
  {
    {
      return (int)3055;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenInvalidRegexp")))
  {
    {
      return (int)3056;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenSolutionStatus")))
  {
    {
      return (int)3057;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenNumerical")))
  {
    {
      return (int)3058;
    }
  }
  {}
  if ((_9008_v == std::string ("errSenUnhandledProblemType")))
  {
    {
      return (int)3080;
    }
  }
  {}
  if ((_9008_v == std::string ("errUnbStepSize")))
  {
    {
      return (int)3100;
    }
  }
  {}
  if ((_9008_v == std::string ("errIdenticalTasks")))
  {
    {
      return (int)3101;
    }
  }
  {}
  if ((_9008_v == std::string ("errAdInvalidCodelist")))
  {
    {
      return (int)3102;
    }
  }
  {}
  if ((_9008_v == std::string ("errInternalTestFailed")))
  {
    {
      return (int)3500;
    }
  }
  {}
  if ((_9008_v == std::string ("errXmlInvalidProblemType")))
  {
    {
      return (int)3600;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidAmplStub")))
  {
    {
      return (int)3700;
    }
  }
  {}
  if ((_9008_v == std::string ("errInt64ToInt32Cast")))
  {
    {
      return (int)3800;
    }
  }
  {}
  if ((_9008_v == std::string ("errSizeLicenseNumcores")))
  {
    {
      return (int)3900;
    }
  }
  {}
  if ((_9008_v == std::string ("errInfeasUndefined")))
  {
    {
      return (int)3910;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoBarxForSolution")))
  {
    {
      return (int)3915;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoBarsForSolution")))
  {
    {
      return (int)3916;
    }
  }
  {}
  if ((_9008_v == std::string ("errBarVarDim")))
  {
    {
      return (int)3920;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatInvalidRowIndex")))
  {
    {
      return (int)3940;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatInvalidColIndex")))
  {
    {
      return (int)3941;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatNotLowerTringular")))
  {
    {
      return (int)3942;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatInvalidValue")))
  {
    {
      return (int)3943;
    }
  }
  {}
  if ((_9008_v == std::string ("errSymMatDuplicate")))
  {
    {
      return (int)3944;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidSymMatDim")))
  {
    {
      return (int)3950;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForSymMat")))
  {
    {
      return (int)4000;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForCfix")))
  {
    {
      return (int)4001;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForRangedConstraints")))
  {
    {
      return (int)4002;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForFreeConstraints")))
  {
    {
      return (int)4003;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForCones")))
  {
    {
      return (int)4005;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForQuadraticTerms")))
  {
    {
      return (int)4006;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForNonlinear")))
  {
    {
      return (int)4010;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForDisjunctiveConstraints")))
  {
    {
      return (int)4011;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFileFormatForAffineConicConstraints")))
  {
    {
      return (int)4012;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateConstraintNames")))
  {
    {
      return (int)4500;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateVariableNames")))
  {
    {
      return (int)4501;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateBarvariableNames")))
  {
    {
      return (int)4502;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateConeNames")))
  {
    {
      return (int)4503;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateDomainNames")))
  {
    {
      return (int)4504;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateDjcNames")))
  {
    {
      return (int)4505;
    }
  }
  {}
  if ((_9008_v == std::string ("errNonUniqueArray")))
  {
    {
      return (int)5000;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentIsTooSmall")))
  {
    {
      return (int)5004;
    }
  }
  {}
  if ((_9008_v == std::string ("errArgumentIsTooLarge")))
  {
    {
      return (int)5005;
    }
  }
  {}
  if ((_9008_v == std::string ("errMioInternal")))
  {
    {
      return (int)5010;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidProblemType")))
  {
    {
      return (int)6000;
    }
  }
  {}
  if ((_9008_v == std::string ("errUnhandledSolutionStatus")))
  {
    {
      return (int)6010;
    }
  }
  {}
  if ((_9008_v == std::string ("errUpperTriangle")))
  {
    {
      return (int)6020;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauSingularMatrix")))
  {
    {
      return (int)7000;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauNotPositiveDefinite")))
  {
    {
      return (int)7001;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauInvalidLowerTriangularMatrix")))
  {
    {
      return (int)7002;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauUnknown")))
  {
    {
      return (int)7005;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgM")))
  {
    {
      return (int)7010;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgN")))
  {
    {
      return (int)7011;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgK")))
  {
    {
      return (int)7012;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgTransa")))
  {
    {
      return (int)7015;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgTransb")))
  {
    {
      return (int)7016;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgUplo")))
  {
    {
      return (int)7017;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauArgTrans")))
  {
    {
      return (int)7018;
    }
  }
  {}
  if ((_9008_v == std::string ("errLauInvalidSparseSymmetricMatrix")))
  {
    {
      return (int)7019;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfParse")))
  {
    {
      return (int)7100;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfObjSense")))
  {
    {
      return (int)7101;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfNoVariables")))
  {
    {
      return (int)7102;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooManyConstraints")))
  {
    {
      return (int)7103;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooManyVariables")))
  {
    {
      return (int)7104;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfNoVersionSpecified")))
  {
    {
      return (int)7105;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfSyntax")))
  {
    {
      return (int)7106;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateObj")))
  {
    {
      return (int)7107;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateCon")))
  {
    {
      return (int)7108;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateVar")))
  {
    {
      return (int)7110;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateInt")))
  {
    {
      return (int)7111;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidVarType")))
  {
    {
      return (int)7112;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidConType")))
  {
    {
      return (int)7113;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidDomainDimension")))
  {
    {
      return (int)7114;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateObjacoord")))
  {
    {
      return (int)7115;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateBcoord")))
  {
    {
      return (int)7116;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicateAcoord")))
  {
    {
      return (int)7117;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooFewVariables")))
  {
    {
      return (int)7118;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooFewConstraints")))
  {
    {
      return (int)7119;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooFewInts")))
  {
    {
      return (int)7120;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooManyInts")))
  {
    {
      return (int)7121;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidIntIndex")))
  {
    {
      return (int)7122;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfUnsupported")))
  {
    {
      return (int)7123;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicatePsdvar")))
  {
    {
      return (int)7124;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPsdvarDimension")))
  {
    {
      return (int)7125;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfTooFewPsdvar")))
  {
    {
      return (int)7126;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidExpDimension")))
  {
    {
      return (int)7127;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicatePowCones")))
  {
    {
      return (int)7130;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicatePowStarCones")))
  {
    {
      return (int)7131;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPower")))
  {
    {
      return (int)7132;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfPowerConeIsTooLong")))
  {
    {
      return (int)7133;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPowerConeIndex")))
  {
    {
      return (int)7134;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPowerStarConeIndex")))
  {
    {
      return (int)7135;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfUnhandledPowerConeType")))
  {
    {
      return (int)7136;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfUnhandledPowerStarConeType")))
  {
    {
      return (int)7137;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfPowerConeMismatch")))
  {
    {
      return (int)7138;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfPowerStarConeMismatch")))
  {
    {
      return (int)7139;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumberOfCones")))
  {
    {
      return (int)7140;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidDimensionOfCones")))
  {
    {
      return (int)7141;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumObjacoord")))
  {
    {
      return (int)7150;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumObjfcoord")))
  {
    {
      return (int)7151;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumAcoord")))
  {
    {
      return (int)7152;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumBcoord")))
  {
    {
      return (int)7153;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumFcoord")))
  {
    {
      return (int)7155;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumHcoord")))
  {
    {
      return (int)7156;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumDcoord")))
  {
    {
      return (int)7157;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfExpectedAKeyword")))
  {
    {
      return (int)7158;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidNumPsdcon")))
  {
    {
      return (int)7200;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfDuplicatePsdcon")))
  {
    {
      return (int)7201;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidDimensionOfPsdcon")))
  {
    {
      return (int)7202;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPsdconIndex")))
  {
    {
      return (int)7203;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPsdconVariableIndex")))
  {
    {
      return (int)7204;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfInvalidPsdconBlockIndex")))
  {
    {
      return (int)7205;
    }
  }
  {}
  if ((_9008_v == std::string ("errCbfUnsupportedChange")))
  {
    {
      return (int)7210;
    }
  }
  {}
  if ((_9008_v == std::string ("errMioInvalidRootOptimizer")))
  {
    {
      return (int)7700;
    }
  }
  {}
  if ((_9008_v == std::string ("errMioInvalidNodeOptimizer")))
  {
    {
      return (int)7701;
    }
  }
  {}
  if ((_9008_v == std::string ("errMpsWriteCplexInvalidConeType")))
  {
    {
      return (int)7750;
    }
  }
  {}
  if ((_9008_v == std::string ("errToconicConstrQNotPsd")))
  {
    {
      return (int)7800;
    }
  }
  {}
  if ((_9008_v == std::string ("errToconicConstraintFx")))
  {
    {
      return (int)7801;
    }
  }
  {}
  if ((_9008_v == std::string ("errToconicConstraintRa")))
  {
    {
      return (int)7802;
    }
  }
  {}
  if ((_9008_v == std::string ("errToconicConstrNotConic")))
  {
    {
      return (int)7803;
    }
  }
  {}
  if ((_9008_v == std::string ("errToconicObjectiveNotPsd")))
  {
    {
      return (int)7804;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerConnect")))
  {
    {
      return (int)8000;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerProtocol")))
  {
    {
      return (int)8001;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerStatus")))
  {
    {
      return (int)8002;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerToken")))
  {
    {
      return (int)8003;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerAddress")))
  {
    {
      return (int)8004;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerCertificate")))
  {
    {
      return (int)8005;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerTlsClient")))
  {
    {
      return (int)8006;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerAccessToken")))
  {
    {
      return (int)8007;
    }
  }
  {}
  if ((_9008_v == std::string ("errServerProblemSize")))
  {
    {
      return (int)8008;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateIndexInASparseMatrix")))
  {
    {
      return (int)20050;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateIndexInAfeidxList")))
  {
    {
      return (int)20060;
    }
  }
  {}
  if ((_9008_v == std::string ("errDuplicateFij")))
  {
    {
      return (int)20100;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidFij")))
  {
    {
      return (int)20101;
    }
  }
  {}
  if ((_9008_v == std::string ("errHugeFij")))
  {
    {
      return (int)20102;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidG")))
  {
    {
      return (int)20103;
    }
  }
  {}
  if ((_9008_v == std::string ("errInvalidB")))
  {
    {
      return (int)20150;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainInvalidIndex")))
  {
    {
      return (int)20400;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainDimension")))
  {
    {
      return (int)20401;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainDimensionPsd")))
  {
    {
      return (int)20402;
    }
  }
  {}
  if ((_9008_v == std::string ("errNotPowerDomain")))
  {
    {
      return (int)20403;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainPowerInvalidAlpha")))
  {
    {
      return (int)20404;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainPowerNegativeAlpha")))
  {
    {
      return (int)20405;
    }
  }
  {}
  if ((_9008_v == std::string ("errDomainPowerNleft")))
  {
    {
      return (int)20406;
    }
  }
  {}
  if ((_9008_v == std::string ("errAfeInvalidIndex")))
  {
    {
      return (int)20500;
    }
  }
  {}
  if ((_9008_v == std::string ("errAccInvalidIndex")))
  {
    {
      return (int)20600;
    }
  }
  {}
  if ((_9008_v == std::string ("errAccInvalidEntryIndex")))
  {
    {
      return (int)20601;
    }
  }
  {}
  if ((_9008_v == std::string ("errAccAfeDomainMismatch")))
  {
    {
      return (int)20602;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcInvalidIndex")))
  {
    {
      return (int)20700;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcUnsupportedDomainType")))
  {
    {
      return (int)20701;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcAfeDomainMismatch")))
  {
    {
      return (int)20702;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcInvalidTermSize")))
  {
    {
      return (int)20703;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcDomainTermsizeMismatch")))
  {
    {
      return (int)20704;
    }
  }
  {}
  if ((_9008_v == std::string ("errDjcTotalNumTermsMismatch")))
  {
    {
      return (int)20705;
    }
  }
  {}
  if ((_9008_v == std::string ("errUndefSolution")))
  {
    {
      return (int)22000;
    }
  }
  {}
  if ((_9008_v == std::string ("errNoDoty")))
  {
    {
      return (int)22010;
    }
  }
  {}
  if ((_9008_v == std::string ("trmMaxIterations")))
  {
    {
      return (int)100000;
    }
  }
  {}
  if ((_9008_v == std::string ("trmMaxTime")))
  {
    {
      return (int)100001;
    }
  }
  {}
  if ((_9008_v == std::string ("trmObjectiveRange")))
  {
    {
      return (int)100002;
    }
  }
  {}
  if ((_9008_v == std::string ("trmMioNumRelaxs")))
  {
    {
      return (int)100008;
    }
  }
  {}
  if ((_9008_v == std::string ("trmMioNumBranches")))
  {
    {
      return (int)100009;
    }
  }
  {}
  if ((_9008_v == std::string ("trmNumMaxNumIntSolutions")))
  {
    {
      return (int)100015;
    }
  }
  {}
  if ((_9008_v == std::string ("trmStall")))
  {
    {
      return (int)100006;
    }
  }
  {}
  if ((_9008_v == std::string ("trmUserCallback")))
  {
    {
      return (int)100007;
    }
  }
  {}
  if ((_9008_v == std::string ("trmMaxNumSetbacks")))
  {
    {
      return (int)100020;
    }
  }
  {}
  if ((_9008_v == std::string ("trmNumericalProblem")))
  {
    {
      return (int)100025;
    }
  }
  {}
  if ((_9008_v == std::string ("trmLostRace")))
  {
    {
      return (int)100027;
    }
  }
  {}
  if ((_9008_v == std::string ("trmInternal")))
  {
    {
      return (int)100030;
    }
  }
  {}
  if ((_9008_v == std::string ("trmInternalStop")))
  {
    {
      return (int)100031;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_rescode_value

// Begin mosek.fusion.Parameters.string_to_xmlwriteroutputtype_value
// Method mosek.fusion.Parameters.string_to_xmlwriteroutputtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1202:0-1207:1
int32_t mosek::fusion::p_Parameters::string_to_xmlwriteroutputtype_value(const std::string & _9009_v)
{
  if ((_9009_v == std::string ("row")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9009_v == std::string ("col")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_xmlwriteroutputtype_value

// Begin mosek.fusion.Parameters.string_to_prosta_value
// Method mosek.fusion.Parameters.string_to_prosta_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1189:0-1201:1
int32_t mosek::fusion::p_Parameters::string_to_prosta_value(const std::string & _9010_v)
{
  if ((_9010_v == std::string ("unknown")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9010_v == std::string ("primAndDualFeas")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9010_v == std::string ("primFeas")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9010_v == std::string ("dualFeas")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9010_v == std::string ("primInfeas")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9010_v == std::string ("dualInfeas")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9010_v == std::string ("primAndDualInfeas")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9010_v == std::string ("illPosed")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9010_v == std::string ("primInfeasOrUnbounded")))
  {
    {
      return (int)8;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_prosta_value

// Begin mosek.fusion.Parameters.string_to_problemtype_value
// Method mosek.fusion.Parameters.string_to_problemtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1180:0-1188:1
int32_t mosek::fusion::p_Parameters::string_to_problemtype_value(const std::string & _9011_v)
{
  if ((_9011_v == std::string ("lo")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9011_v == std::string ("qo")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9011_v == std::string ("qcqo")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9011_v == std::string ("conic")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9011_v == std::string ("mixed")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_problemtype_value

// Begin mosek.fusion.Parameters.string_to_problemitem_value
// Method mosek.fusion.Parameters.string_to_problemitem_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1173:0-1179:1
int32_t mosek::fusion::p_Parameters::string_to_problemitem_value(const std::string & _9012_v)
{
  if ((_9012_v == std::string ("var")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9012_v == std::string ("con")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9012_v == std::string ("cone")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_problemitem_value

// Begin mosek.fusion.Parameters.string_to_parametertype_value
// Method mosek.fusion.Parameters.string_to_parametertype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1165:0-1172:1
int32_t mosek::fusion::p_Parameters::string_to_parametertype_value(const std::string & _9013_v)
{
  if ((_9013_v == std::string ("invalidType")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9013_v == std::string ("douType")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9013_v == std::string ("intType")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9013_v == std::string ("strType")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_parametertype_value

// Begin mosek.fusion.Parameters.string_to_presolvemode_value
// Method mosek.fusion.Parameters.string_to_presolvemode_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1158:0-1164:1
int32_t mosek::fusion::p_Parameters::string_to_presolvemode_value(const std::string & _9014_v)
{
  if ((_9014_v == std::string ("off")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9014_v == std::string ("on")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9014_v == std::string ("free")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_presolvemode_value

// Begin mosek.fusion.Parameters.string_to_orderingtype_value
// Method mosek.fusion.Parameters.string_to_orderingtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1148:0-1157:1
int32_t mosek::fusion::p_Parameters::string_to_orderingtype_value(const std::string & _9015_v)
{
  if ((_9015_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9015_v == std::string ("appminloc")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9015_v == std::string ("experimental")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9015_v == std::string ("tryGraphpar")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9015_v == std::string ("forceGraphpar")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9015_v == std::string ("none")))
  {
    {
      return (int)5;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_orderingtype_value

// Begin mosek.fusion.Parameters.string_to_optimizertype_value
// Method mosek.fusion.Parameters.string_to_optimizertype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1137:0-1147:1
int32_t mosek::fusion::p_Parameters::string_to_optimizertype_value(const std::string & _9016_v)
{
  if ((_9016_v == std::string ("free")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9016_v == std::string ("intpnt")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9016_v == std::string ("conic")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9016_v == std::string ("primalSimplex")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9016_v == std::string ("dualSimplex")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9016_v == std::string ("freeSimplex")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9016_v == std::string ("mixedInt")))
  {
    {
      return (int)5;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_optimizertype_value

// Begin mosek.fusion.Parameters.string_to_onoffkey_value
// Method mosek.fusion.Parameters.string_to_onoffkey_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1131:0-1136:1
int32_t mosek::fusion::p_Parameters::string_to_onoffkey_value(const std::string & _9017_v)
{
  if ((_9017_v == std::string ("on")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9017_v == std::string ("off")))
  {
    {
      return (int)0;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_onoffkey_value

// Begin mosek.fusion.Parameters.string_to_objsense_value
// Method mosek.fusion.Parameters.string_to_objsense_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1125:0-1130:1
int32_t mosek::fusion::p_Parameters::string_to_objsense_value(const std::string & _9018_v)
{
  if ((_9018_v == std::string ("minimize")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9018_v == std::string ("maximize")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_objsense_value

// Begin mosek.fusion.Parameters.string_to_mpsformat_value
// Method mosek.fusion.Parameters.string_to_mpsformat_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1117:0-1124:1
int32_t mosek::fusion::p_Parameters::string_to_mpsformat_value(const std::string & _9019_v)
{
  if ((_9019_v == std::string ("strict")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9019_v == std::string ("relaxed")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9019_v == std::string ("free")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9019_v == std::string ("cplex")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_mpsformat_value

// Begin mosek.fusion.Parameters.string_to_miovarseltype_value
// Method mosek.fusion.Parameters.string_to_miovarseltype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1110:0-1116:1
int32_t mosek::fusion::p_Parameters::string_to_miovarseltype_value(const std::string & _9020_v)
{
  if ((_9020_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9020_v == std::string ("pseudocost")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9020_v == std::string ("strong")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_miovarseltype_value

// Begin mosek.fusion.Parameters.string_to_mionodeseltype_value
// Method mosek.fusion.Parameters.string_to_mionodeseltype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1102:0-1109:1
int32_t mosek::fusion::p_Parameters::string_to_mionodeseltype_value(const std::string & _9021_v)
{
  if ((_9021_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9021_v == std::string ("first")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9021_v == std::string ("best")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9021_v == std::string ("pseudo")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_mionodeseltype_value

// Begin mosek.fusion.Parameters.string_to_miomode_value
// Method mosek.fusion.Parameters.string_to_miomode_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1096:0-1101:1
int32_t mosek::fusion::p_Parameters::string_to_miomode_value(const std::string & _9022_v)
{
  if ((_9022_v == std::string ("ignored")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9022_v == std::string ("satisfied")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_miomode_value

// Begin mosek.fusion.Parameters.string_to_miocontsoltype_value
// Method mosek.fusion.Parameters.string_to_miocontsoltype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1088:0-1095:1
int32_t mosek::fusion::p_Parameters::string_to_miocontsoltype_value(const std::string & _9023_v)
{
  if ((_9023_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9023_v == std::string ("root")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9023_v == std::string ("itg")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9023_v == std::string ("itgRel")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_miocontsoltype_value

// Begin mosek.fusion.Parameters.string_to_miodatapermmethod_value
// Method mosek.fusion.Parameters.string_to_miodatapermmethod_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1081:0-1087:1
int32_t mosek::fusion::p_Parameters::string_to_miodatapermmethod_value(const std::string & _9024_v)
{
  if ((_9024_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9024_v == std::string ("cyclicShift")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9024_v == std::string ("random")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_miodatapermmethod_value

// Begin mosek.fusion.Parameters.string_to_miqcqoreformmethod_value
// Method mosek.fusion.Parameters.string_to_miqcqoreformmethod_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1071:0-1080:1
int32_t mosek::fusion::p_Parameters::string_to_miqcqoreformmethod_value(const std::string & _9025_v)
{
  if ((_9025_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9025_v == std::string ("none")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9025_v == std::string ("linearization")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9025_v == std::string ("eigenValMethod")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9025_v == std::string ("diagSdp")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9025_v == std::string ("relaxSdp")))
  {
    {
      return (int)5;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_miqcqoreformmethod_value

// Begin mosek.fusion.Parameters.string_to_branchdir_value
// Method mosek.fusion.Parameters.string_to_branchdir_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:1059:0-1070:1
int32_t mosek::fusion::p_Parameters::string_to_branchdir_value(const std::string & _9026_v)
{
  if ((_9026_v == std::string ("free")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9026_v == std::string ("up")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9026_v == std::string ("down")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9026_v == std::string ("near")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9026_v == std::string ("far")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9026_v == std::string ("rootLp")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9026_v == std::string ("guided")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9026_v == std::string ("pseudocost")))
  {
    {
      return (int)7;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_branchdir_value

// Begin mosek.fusion.Parameters.string_to_iparam_value
// Method mosek.fusion.Parameters.string_to_iparam_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:865:0-1058:1
int32_t mosek::fusion::p_Parameters::string_to_iparam_value(const std::string & _9027_v)
{
  if ((_9027_v == std::string ("autoUpdateSolInfo")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9027_v == std::string ("removeUnusedSolutions")))
  {
    {
      return (int)130;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntHotstart")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntPurify")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9027_v == std::string ("numThreads")))
  {
    {
      return (int)97;
    }
  }
  {}
  if ((_9027_v == std::string ("timingLevel")))
  {
    {
      return (int)165;
    }
  }
  {}
  if ((_9027_v == std::string ("mtSpincount")))
  {
    {
      return (int)95;
    }
  }
  {}
  if ((_9027_v == std::string ("maxNumWarnings")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9027_v == std::string ("optimizer")))
  {
    {
      return (int)107;
    }
  }
  {}
  if ((_9027_v == std::string ("biMaxIterations")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9027_v == std::string ("licenseTrhExpiryWrn")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9027_v == std::string ("logIncludeSummary")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9027_v == std::string ("logCutSecondOpt")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9027_v == std::string ("logAnaPro")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9027_v == std::string ("logResponse")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9027_v == std::string ("logLocalInfo")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9027_v == std::string ("logBi")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9027_v == std::string ("logBiFreq")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9027_v == std::string ("biCleanOptimizer")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntMaxNumRefinementSteps")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntStartingPoint")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntDiffStep")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntScaling")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntSolveForm")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9027_v == std::string ("logIntpnt")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntMaxIterations")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntOffColTrh")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntOrderMethod")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntOrderGpNumSeeds")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntBasis")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9027_v == std::string ("biIgnoreMaxIter")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9027_v == std::string ("biIgnoreNumError")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntMaxNumCor")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveUse")))
  {
    {
      return (int)119;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveLevel")))
  {
    {
      return (int)112;
    }
  }
  {}
  if ((_9027_v == std::string ("logPresolve")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveLindepUse")))
  {
    {
      return (int)116;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveLindepNew")))
  {
    {
      return (int)114;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveMaxNumPass")))
  {
    {
      return (int)117;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveEliminatorMaxNumTries")))
  {
    {
      return (int)111;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveEliminatorMaxFill")))
  {
    {
      return (int)110;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveMaxNumReductions")))
  {
    {
      return (int)118;
    }
  }
  {}
  if ((_9027_v == std::string ("simDetectPwl")))
  {
    {
      return (int)136;
    }
  }
  {}
  if ((_9027_v == std::string ("simStabilityPriority")))
  {
    {
      return (int)158;
    }
  }
  {}
  if ((_9027_v == std::string ("simPrimalCrash")))
  {
    {
      return (int)147;
    }
  }
  {}
  if ((_9027_v == std::string ("logSim")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9027_v == std::string ("logSimMinor")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9027_v == std::string ("logSimFreq")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9027_v == std::string ("simPrimalRestrictSelection")))
  {
    {
      return (int)149;
    }
  }
  {}
  if ((_9027_v == std::string ("simPrimalSelection")))
  {
    {
      return (int)150;
    }
  }
  {}
  if ((_9027_v == std::string ("simDualRestrictSelection")))
  {
    {
      return (int)139;
    }
  }
  {}
  if ((_9027_v == std::string ("simDualSelection")))
  {
    {
      return (int)140;
    }
  }
  {}
  if ((_9027_v == std::string ("simMaxIterations")))
  {
    {
      return (int)144;
    }
  }
  {}
  if ((_9027_v == std::string ("simHotstartLu")))
  {
    {
      return (int)143;
    }
  }
  {}
  if ((_9027_v == std::string ("simRefactorFreq")))
  {
    {
      return (int)151;
    }
  }
  {}
  if ((_9027_v == std::string ("simSeed")))
  {
    {
      return (int)156;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMode")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9027_v == std::string ("logMio")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9027_v == std::string ("logMioFreq")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMaxNumRelaxs")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMaxNumBranches")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMaxNumRestarts")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMaxNumRootCutRounds")))
  {
    {
      return (int)75;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMaxNumSolutions")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9027_v == std::string ("mioNodeSelection")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9027_v == std::string ("mioVarSelection")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMinRel")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9027_v == std::string ("mioHeuristicLevel")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9027_v == std::string ("mioProbingLevel")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9027_v == std::string ("mioSymmetryLevel")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9027_v == std::string ("mioDualRayAnalysisLevel")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9027_v == std::string ("mioPresolveAggregatorUse")))
  {
    {
      return (int)84;
    }
  }
  {}
  if ((_9027_v == std::string ("mioNumericalEmphasisLevel")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9027_v == std::string ("mioMemoryEmphasisLevel")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutSelectionLevel")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9027_v == std::string ("mioVbDetectionLevel")))
  {
    {
      return (int)94;
    }
  }
  {}
  if ((_9027_v == std::string ("mioBranchDir")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9027_v == std::string ("mioRootOptimizer")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9027_v == std::string ("mioNodeOptimizer")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9027_v == std::string ("mioPerspectiveReformulate")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9027_v == std::string ("mioPropagateObjectiveConstraint")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9027_v == std::string ("mioSeed")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9027_v == std::string ("mioConicOuterApproximation")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9027_v == std::string ("mioQcqoReformulationMethod")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9027_v == std::string ("mioDataPermutationMethod")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9027_v == std::string ("readKeepFreeCon")))
  {
    {
      return (int)125;
    }
  }
  {}
  if ((_9027_v == std::string ("readMpsFormat")))
  {
    {
      return (int)126;
    }
  }
  {}
  if ((_9027_v == std::string ("writeMpsFormat")))
  {
    {
      return (int)181;
    }
  }
  {}
  if ((_9027_v == std::string ("readMpsWidth")))
  {
    {
      return (int)127;
    }
  }
  {}
  if ((_9027_v == std::string ("readDebug")))
  {
    {
      return (int)124;
    }
  }
  {}
  if ((_9027_v == std::string ("writeDataParam")))
  {
    {
      return (int)170;
    }
  }
  {}
  if ((_9027_v == std::string ("writeFreeCon")))
  {
    {
      return (int)171;
    }
  }
  {}
  if ((_9027_v == std::string ("writeGenericNames")))
  {
    {
      return (int)172;
    }
  }
  {}
  if ((_9027_v == std::string ("writeGenericNamesIo")))
  {
    {
      return (int)173;
    }
  }
  {}
  if ((_9027_v == std::string ("writeCompression")))
  {
    {
      return (int)169;
    }
  }
  {}
  if ((_9027_v == std::string ("writeMpsInt")))
  {
    {
      return (int)182;
    }
  }
  {}
  if ((_9027_v == std::string ("writeLpLineWidth")))
  {
    {
      return (int)180;
    }
  }
  {}
  if ((_9027_v == std::string ("writeLpFullObj")))
  {
    {
      return (int)179;
    }
  }
  {}
  if ((_9027_v == std::string ("writeJsonIndentation")))
  {
    {
      return (int)178;
    }
  }
  {}
  if ((_9027_v == std::string ("writeSolIgnoreInvalidNames")))
  {
    {
      return (int)186;
    }
  }
  {}
  if ((_9027_v == std::string ("writeSolHead")))
  {
    {
      return (int)185;
    }
  }
  {}
  if ((_9027_v == std::string ("writeSolConstraints")))
  {
    {
      return (int)184;
    }
  }
  {}
  if ((_9027_v == std::string ("writeSolVariables")))
  {
    {
      return (int)187;
    }
  }
  {}
  if ((_9027_v == std::string ("writeSolBarvariables")))
  {
    {
      return (int)183;
    }
  }
  {}
  if ((_9027_v == std::string ("writeBasHead")))
  {
    {
      return (int)167;
    }
  }
  {}
  if ((_9027_v == std::string ("writeBasConstraints")))
  {
    {
      return (int)166;
    }
  }
  {}
  if ((_9027_v == std::string ("writeBasVariables")))
  {
    {
      return (int)168;
    }
  }
  {}
  if ((_9027_v == std::string ("writeIntHead")))
  {
    {
      return (int)176;
    }
  }
  {}
  if ((_9027_v == std::string ("writeIntConstraints")))
  {
    {
      return (int)175;
    }
  }
  {}
  if ((_9027_v == std::string ("writeIntVariables")))
  {
    {
      return (int)177;
    }
  }
  {}
  if ((_9027_v == std::string ("solReadNameWidth")))
  {
    {
      return (int)162;
    }
  }
  {}
  if ((_9027_v == std::string ("solReadWidth")))
  {
    {
      return (int)163;
    }
  }
  {}
  if ((_9027_v == std::string ("infeasReportAuto")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9027_v == std::string ("infeasReportLevel")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9027_v == std::string ("infeasGenericNames")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9027_v == std::string ("logInfeasAna")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9027_v == std::string ("licenseWait")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9027_v == std::string ("licenseSuppressExpireWrns")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9027_v == std::string ("licensePauseTime")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9027_v == std::string ("licenseDebug")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9027_v == std::string ("solFilterKeepBasic")))
  {
    {
      return (int)160;
    }
  }
  {}
  if ((_9027_v == std::string ("solFilterKeepRanged")))
  {
    {
      return (int)161;
    }
  }
  {}
  if ((_9027_v == std::string ("log")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9027_v == std::string ("logExpand")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9027_v == std::string ("logFile")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9027_v == std::string ("logOrder")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9027_v == std::string ("logSensitivity")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9027_v == std::string ("logSensitivityOpt")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9027_v == std::string ("readTaskIgnoreParam")))
  {
    {
      return (int)128;
    }
  }
  {}
  if ((_9027_v == std::string ("writeTaskIncSol")))
  {
    {
      return (int)188;
    }
  }
  {}
  if ((_9027_v == std::string ("paramReadCaseName")))
  {
    {
      return (int)108;
    }
  }
  {}
  if ((_9027_v == std::string ("paramReadIgnError")))
  {
    {
      return (int)109;
    }
  }
  {}
  if ((_9027_v == std::string ("solutionCallback")))
  {
    {
      return (int)164;
    }
  }
  {}
  if ((_9027_v == std::string ("simScaling")))
  {
    {
      return (int)154;
    }
  }
  {}
  if ((_9027_v == std::string ("simScalingMethod")))
  {
    {
      return (int)155;
    }
  }
  {}
  if ((_9027_v == std::string ("simPrimalPhaseoneMethod")))
  {
    {
      return (int)148;
    }
  }
  {}
  if ((_9027_v == std::string ("simDualPhaseoneMethod")))
  {
    {
      return (int)138;
    }
  }
  {}
  if ((_9027_v == std::string ("simMaxNumSetbacks")))
  {
    {
      return (int)145;
    }
  }
  {}
  if ((_9027_v == std::string ("simHotstart")))
  {
    {
      return (int)142;
    }
  }
  {}
  if ((_9027_v == std::string ("simBasisFactorUse")))
  {
    {
      return (int)134;
    }
  }
  {}
  if ((_9027_v == std::string ("simDegen")))
  {
    {
      return (int)135;
    }
  }
  {}
  if ((_9027_v == std::string ("simReformulation")))
  {
    {
      return (int)152;
    }
  }
  {}
  if ((_9027_v == std::string ("simExploitDupvec")))
  {
    {
      return (int)141;
    }
  }
  {}
  if ((_9027_v == std::string ("simSaveLu")))
  {
    {
      return (int)153;
    }
  }
  {}
  if ((_9027_v == std::string ("simNonSingular")))
  {
    {
      return (int)146;
    }
  }
  {}
  if ((_9027_v == std::string ("simDualCrash")))
  {
    {
      return (int)137;
    }
  }
  {}
  if ((_9027_v == std::string ("logStorage")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9027_v == std::string ("infeasPreferPrimal")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteLineLength")))
  {
    {
      return (int)100;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteHints")))
  {
    {
      return (int)99;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteParameters")))
  {
    {
      return (int)101;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteProblem")))
  {
    {
      return (int)102;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteHeader")))
  {
    {
      return (int)98;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteSolutions")))
  {
    {
      return (int)106;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteSolBas")))
  {
    {
      return (int)103;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteSolItg")))
  {
    {
      return (int)104;
    }
  }
  {}
  if ((_9027_v == std::string ("opfWriteSolItr")))
  {
    {
      return (int)105;
    }
  }
  {}
  if ((_9027_v == std::string ("ptfWriteTransform")))
  {
    {
      return (int)123;
    }
  }
  {}
  if ((_9027_v == std::string ("ptfWriteSolutions")))
  {
    {
      return (int)122;
    }
  }
  {}
  if ((_9027_v == std::string ("ptfWriteParameters")))
  {
    {
      return (int)121;
    }
  }
  {}
  if ((_9027_v == std::string ("primalRepairOptimizer")))
  {
    {
      return (int)120;
    }
  }
  {}
  if ((_9027_v == std::string ("mioRootRepeatPresolveLevel")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutCmir")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutClique")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutImpliedBound")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutKnapsackCover")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutGmi")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9027_v == std::string ("mioCutLipro")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9027_v == std::string ("sensitivityType")))
  {
    {
      return (int)133;
    }
  }
  {}
  if ((_9027_v == std::string ("mioConstructSol")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveLindepRelWorkTrh")))
  {
    {
      return (int)115;
    }
  }
  {}
  if ((_9027_v == std::string ("presolveLindepAbsWorkTrh")))
  {
    {
      return (int)113;
    }
  }
  {}
  if ((_9027_v == std::string ("sensitivityAll")))
  {
    {
      return (int)131;
    }
  }
  {}
  if ((_9027_v == std::string ("logFeasRepair")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9027_v == std::string ("cacheLicense")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9027_v == std::string ("intpntRegularizationUse")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9027_v == std::string ("simSolveForm")))
  {
    {
      return (int)157;
    }
  }
  {}
  if ((_9027_v == std::string ("simSwitchOptimizer")))
  {
    {
      return (int)159;
    }
  }
  {}
  if ((_9027_v == std::string ("writeIgnoreIncompatibleItems")))
  {
    {
      return (int)174;
    }
  }
  {}
  if ((_9027_v == std::string ("autoSortABeforeOpt")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9027_v == std::string ("sensitivityOptimizer")))
  {
    {
      return (int)132;
    }
  }
  {}
  if ((_9027_v == std::string ("writeXmlMode")))
  {
    {
      return (int)189;
    }
  }
  {}
  if ((_9027_v == std::string ("anaSolBasis")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9027_v == std::string ("anaSolPrintViolated")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9027_v == std::string ("basisSolveUsePlusOne")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9027_v == std::string ("compressStatfile")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9027_v == std::string ("mioRinsMaxNodes")))
  {
    {
      return (int)88;
    }
  }
  {}
  if ((_9027_v == std::string ("mioFeaspumpLevel")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9027_v == std::string ("ng")))
  {
    {
      return (int)96;
    }
  }
  {}
  if ((_9027_v == std::string ("remoteUseCompression")))
  {
    {
      return (int)129;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_iparam_value

// Begin mosek.fusion.Parameters.string_to_iomode_value
// Method mosek.fusion.Parameters.string_to_iomode_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:858:0-864:1
int32_t mosek::fusion::p_Parameters::string_to_iomode_value(const std::string & _9028_v)
{
  if ((_9028_v == std::string ("read")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9028_v == std::string ("write")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9028_v == std::string ("readwrite")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_iomode_value

// Begin mosek.fusion.Parameters.string_to_internal_iinf_value
// Method mosek.fusion.Parameters.string_to_internal_iinf_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:727:0-857:1
int32_t mosek::fusion::p_Parameters::string_to_internal_iinf_value(const std::string & _9029_v)
{
  if ((_9029_v == std::string ("versionMajor")))
  {
    {
      return (int)124;
    }
  }
  {}
  if ((_9029_v == std::string ("versionMinor")))
  {
    {
      return (int)125;
    }
  }
  {}
  if ((_9029_v == std::string ("versionRevision")))
  {
    {
      return (int)126;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveLindepWork")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveLindepPivots")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveLindepSkipped")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumPrimalLinDepAttempts")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumPrimalLinDepSuccessAttempts")))
  {
    {
      return (int)75;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumDualLinDepAttempts")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumDualLinDepSuccessAttempts")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveOutofspace")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9029_v == std::string ("optObjectiveSense")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9029_v == std::string ("optimizer")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFirRefIter")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumRefSteps")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorSchurNumDup")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorSchurNumBlk")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorSchurMinBlkDim")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorSchurMaxBlkDim")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorSchurNumSingular")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorDim")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorLDim")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorOrderMlLNumDense")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorOrderMlLMaxHeight")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorOrderGpLMaxHeight")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorNumDenseA")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorNumDenseADup")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorNumDenseW")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumcon")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumvar")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumbarvar")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumblo")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumbup")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumbfr")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumbfx")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumcone")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumconevar")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumbndcone")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumrqcones")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumqcones")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumpexpcones")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntNumppowcones")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntMinconedim")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntMaxconedim")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntMaxbarvardim")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcon")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcfr")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcfx")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumclo")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcup")))
  {
    {
      return (int)84;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcra")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumcnl")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvar")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvfr")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvfx")))
  {
    {
      return (int)88;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvlo")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvup")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvra")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumvnl")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumnza")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcon")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcfr")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcfx")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumclo")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcup")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcra")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumcnl")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvar")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvfr")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvfx")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvlo")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvup")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvra")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumvnl")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveFnumnza")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumElimns")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveEliNumTries")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveEliNumFreedCon")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveEliNumFreedConTotal")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveLindepNumTries")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumPrimalLinDeps")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumDualLinDeps")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveForceConNum")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveForceConNumVar")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveForceVarNum")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveForceVarNumCon")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9029_v == std::string ("presolvePivOnConNum")))
  {
    {
      return (int)94;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumDouBlocks")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveNumSimplifiedDouBlocks")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveSizeSimplifiedDouBlocks")))
  {
    {
      return (int)95;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveAccNumDupVarInNrmtwo")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveAccNumDoubletonChainInNrmtwo")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorNum")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntFactorNumSolve")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPrimalHotstartNumBasics")))
  {
    {
      return (int)114;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPrimalHotstartBasisRank")))
  {
    {
      return (int)113;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexDualHotstartNumBasics")))
  {
    {
      return (int)109;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexDualHotstartBasisRank")))
  {
    {
      return (int)108;
    }
  }
  {}
  if ((_9029_v == std::string ("intpntGpOrderEmployed")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9029_v == std::string ("numLuFactorizations")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlNumPotential")))
  {
    {
      return (int)120;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlNumUsed")))
  {
    {
      return (int)121;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlNumVariables")))
  {
    {
      return (int)122;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlMinNumBreakpoints")))
  {
    {
      return (int)119;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlMaxNumBreakpoints")))
  {
    {
      return (int)117;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlMaxNz")))
  {
    {
      return (int)118;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPwlNzReduction")))
  {
    {
      return (int)123;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPrimalNumSetbacks")))
  {
    {
      return (int)115;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexDualNumSetbacks")))
  {
    {
      return (int)110;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPrimalFeasNa")))
  {
    {
      return (int)112;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexDualFeasNa")))
  {
    {
      return (int)107;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexPrimalObjNa")))
  {
    {
      return (int)116;
    }
  }
  {}
  if ((_9029_v == std::string ("simplexDualObjNa")))
  {
    {
      return (int)111;
    }
  }
  {}
  if ((_9029_v == std::string ("simNumPrimalBoundswaps")))
  {
    {
      return (int)106;
    }
  }
  {}
  if ((_9029_v == std::string ("simNumDualBoundswaps")))
  {
    {
      return (int)104;
    }
  }
  {}
  if ((_9029_v == std::string ("simNumDualIntegerPivots")))
  {
    {
      return (int)105;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyNumRow")))
  {
    {
      return (int)101;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyPNumNullRow")))
  {
    {
      return (int)102;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyPNumSingletonCol")))
  {
    {
      return (int)103;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyCrashL11NumRow")))
  {
    {
      return (int)96;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyCrashL22NumRow")))
  {
    {
      return (int)97;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyCrashL33NumRow")))
  {
    {
      return (int)99;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyCrashL33NumCol")))
  {
    {
      return (int)98;
    }
  }
  {}
  if ((_9029_v == std::string ("purifyCrashSingularity")))
  {
    {
      return (int)100;
    }
  }
  {}
  if ((_9029_v == std::string ("biPrimalInfo")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9029_v == std::string ("biDualInfo")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9029_v == std::string ("presolveLindepNumTruncTries")))
  {
    {
      return (int)65;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_internal_iinf_value

// Begin mosek.fusion.Parameters.string_to_internal_dinf_value
// Method mosek.fusion.Parameters.string_to_internal_dinf_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:625:0-726:1
int32_t mosek::fusion::p_Parameters::string_to_internal_dinf_value(const std::string & _9030_v)
{
  if ((_9030_v == std::string ("sensitivityPrimalTime")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9030_v == std::string ("sensitivityDualTime")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntGfeas")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntMu")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntInitIterTime")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorTime")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntInitSearchTime")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFormSearchTime")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntCorrectorTime")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntUpdateTime")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupTime")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSchurTime")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurTime")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurPushTime")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurPullTime")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurTime")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurDeTabTime")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurSpTabTime")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLTime")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLUpdateLastTime")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLFactorLastTime")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseLTime")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseTime")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotaTime")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotaSolveTime")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotatdotaTime")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotlInitTime")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotlFactorTime")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateTime")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateCompressedETime")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateSparseTime")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateSparseSyr2kTime")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateSparseDotTime")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateDenseTime")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateDenseSyr2kTime")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurUpdateDenseDotTime")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurPushTime")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntIterNonCorrectorFlops")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntIterOneCorrectorFlops")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntSolveTime")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntIterRefTime")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntSolveSparseLTime")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntSolveDenseLTime")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupFlops")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupHatSchurFlops")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSchurFlops")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurFlops")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurPushFlops")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorHatSchurPullFlops")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorBarSchurFlops")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLFlops")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorMlOrderSparseLFlops")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorGpOrderSparseLFlops")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLUpdateLastFlops")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSparseLFactorLastFlops")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseLFlops")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseFlops")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotaFlops")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotatdotaFlops")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotlFactor_initFlops")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotlFactorFlops")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotl11FactorFlops")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotl21FactorFlops")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorDenseDotl22FactorFlops")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9030_v == std::string ("presolvePrimalLinDepTime")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveDualLinDepTime")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveAcoltTime")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveSetupTime")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveCheckproTime")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveDupconTime")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveDupvarTime")))
  {
    {
      return (int)84;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveFinalTime")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveSubDomvarTime")))
  {
    {
      return (int)88;
    }
  }
  {}
  if ((_9030_v == std::string ("presolveSubRelaxTime")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9030_v == std::string ("primalSimplexInftime")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9030_v == std::string ("dualSimplexInftime")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntGpOrderSavedFlops")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupDetectDenseTime")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupMlOrderTime")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupGpOrderTime")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntFactorSetupGpOrderPostTime")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9030_v == std::string ("biCrashTime")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9030_v == std::string ("biCrashLuTime")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9030_v == std::string ("biFactorTime")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9030_v == std::string ("biFactorWork")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9030_v == std::string ("biPrimalDone")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9030_v == std::string ("biDualDone")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9030_v == std::string ("simplexBasiscondition")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9030_v == std::string ("simplexPrimalObj")))
  {
    {
      return (int)97;
    }
  }
  {}
  if ((_9030_v == std::string ("simplexPrimalFeas")))
  {
    {
      return (int)96;
    }
  }
  {}
  if ((_9030_v == std::string ("simplexDualObj")))
  {
    {
      return (int)95;
    }
  }
  {}
  if ((_9030_v == std::string ("simplexDualFeas")))
  {
    {
      return (int)94;
    }
  }
  {}
  if ((_9030_v == std::string ("biInitialBasisCond")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9030_v == std::string ("biPrimalObj")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9030_v == std::string ("biDualObj")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9030_v == std::string ("biPrimalFeas")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9030_v == std::string ("biDualFeas")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9030_v == std::string ("intpntPurifyTime")))
  {
    {
      return (int)75;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_internal_dinf_value

// Begin mosek.fusion.Parameters.string_to_inftype_value
// Method mosek.fusion.Parameters.string_to_inftype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:618:0-624:1
int32_t mosek::fusion::p_Parameters::string_to_inftype_value(const std::string & _9031_v)
{
  if ((_9031_v == std::string ("douType")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9031_v == std::string ("intType")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9031_v == std::string ("lintType")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_inftype_value

// Begin mosek.fusion.Parameters.string_to_iinfitem_value
// Method mosek.fusion.Parameters.string_to_iinfitem_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:497:0-617:1
int32_t mosek::fusion::p_Parameters::string_to_iinfitem_value(const std::string & _9032_v)
{
  if ((_9032_v == std::string ("anaProNumCon")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumConLo")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumConUp")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumConRa")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumConEq")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumConFr")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVar")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarLo")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarUp")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarRa")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarEq")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarFr")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarCont")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarBin")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9032_v == std::string ("anaProNumVarInt")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9032_v == std::string ("optimizeResponse")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9032_v == std::string ("presolveNumPrimalPerturbations")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9032_v == std::string ("intpntIter")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9032_v == std::string ("intpntFactorDimDense")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9032_v == std::string ("intpntSolveDual")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNodeDepth")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumvar")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumbin")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumint")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumcont")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumcon")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumcone")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumqcones")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumrqcones")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumpexpcones")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumdexpcones")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumppowcones")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumdpowcones")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumconevar")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumbinconevar")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumintconevar")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumcontconevar")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumdjc")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumvar")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumbin")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumint")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumcont")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumcon")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumcone")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumqcones")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumrqcones")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumpexpcones")))
  {
    {
      return (int)75;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumdexpcones")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumppowcones")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumdpowcones")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumconevar")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumbinconevar")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumintconevar")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumcontconevar")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9032_v == std::string ("mioPresolvedNumdjc")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9032_v == std::string ("mioCliqueTableSize")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9032_v == std::string ("mioConstructSolution")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9032_v == std::string ("mioInitialFeasibleSolution")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumIntSolutions")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9032_v == std::string ("mioObjBoundDefined")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumActiveNodes")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumRelax")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSolvedNodes")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumBranch")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumRestarts")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumRootCutRounds")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumActiveRootCuts")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9032_v == std::string ("mioTotalNumSelectedCuts")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedCmirCuts")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedCliqueCuts")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedImpliedBoundCuts")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedKnapsackCoverCuts")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedGomoryCuts")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSelectedLiproCuts")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9032_v == std::string ("mioTotalNumSeparatedCuts")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedCmirCuts")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedCliqueCuts")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedImpliedBoundCuts")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedKnapsackCoverCuts")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedGomoryCuts")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumSeparatedLiproCuts")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9032_v == std::string ("mioNumRepeatedPresolve")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9032_v == std::string ("mioUserObjCut")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9032_v == std::string ("mioRelgapSatisfied")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9032_v == std::string ("mioAbsgapSatisfied")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9032_v == std::string ("rdProtype")))
  {
    {
      return (int)96;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumcon")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumvar")))
  {
    {
      return (int)95;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumbarvar")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumintvar")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumq")))
  {
    {
      return (int)94;
    }
  }
  {}
  if ((_9032_v == std::string ("simDualDegIter")))
  {
    {
      return (int)97;
    }
  }
  {}
  if ((_9032_v == std::string ("simDualInfIter")))
  {
    {
      return (int)100;
    }
  }
  {}
  if ((_9032_v == std::string ("simDualHotstartLu")))
  {
    {
      return (int)99;
    }
  }
  {}
  if ((_9032_v == std::string ("simPrimalIter")))
  {
    {
      return (int)108;
    }
  }
  {}
  if ((_9032_v == std::string ("simDualIter")))
  {
    {
      return (int)101;
    }
  }
  {}
  if ((_9032_v == std::string ("intpntNumThreads")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9032_v == std::string ("simPrimalInfIter")))
  {
    {
      return (int)107;
    }
  }
  {}
  if ((_9032_v == std::string ("simPrimalDegIter")))
  {
    {
      return (int)104;
    }
  }
  {}
  if ((_9032_v == std::string ("simPrimalHotstart")))
  {
    {
      return (int)105;
    }
  }
  {}
  if ((_9032_v == std::string ("simPrimalHotstartLu")))
  {
    {
      return (int)106;
    }
  }
  {}
  if ((_9032_v == std::string ("simDualHotstart")))
  {
    {
      return (int)98;
    }
  }
  {}
  if ((_9032_v == std::string ("solItrProsta")))
  {
    {
      return (int)114;
    }
  }
  {}
  if ((_9032_v == std::string ("solItrSolsta")))
  {
    {
      return (int)115;
    }
  }
  {}
  if ((_9032_v == std::string ("solBasProsta")))
  {
    {
      return (int)110;
    }
  }
  {}
  if ((_9032_v == std::string ("solBasSolsta")))
  {
    {
      return (int)111;
    }
  }
  {}
  if ((_9032_v == std::string ("solItgProsta")))
  {
    {
      return (int)112;
    }
  }
  {}
  if ((_9032_v == std::string ("solItgSolsta")))
  {
    {
      return (int)113;
    }
  }
  {}
  if ((_9032_v == std::string ("simNumcon")))
  {
    {
      return (int)102;
    }
  }
  {}
  if ((_9032_v == std::string ("simNumvar")))
  {
    {
      return (int)103;
    }
  }
  {}
  if ((_9032_v == std::string ("optNumcon")))
  {
    {
      return (int)84;
    }
  }
  {}
  if ((_9032_v == std::string ("optNumvar")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9032_v == std::string ("stoNumARealloc")))
  {
    {
      return (int)116;
    }
  }
  {}
  if ((_9032_v == std::string ("rdNumcone")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9032_v == std::string ("simSolveDual")))
  {
    {
      return (int)109;
    }
  }
  {}
  if ((_9032_v == std::string ("purifyPrimalSuccess")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9032_v == std::string ("purifyDualSuccess")))
  {
    {
      return (int)88;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_iinfitem_value

// Begin mosek.fusion.Parameters.string_to_internal_liinf_value
// Method mosek.fusion.Parameters.string_to_internal_liinf_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:476:0-496:1
int32_t mosek::fusion::p_Parameters::string_to_internal_liinf_value(const std::string & _9033_v)
{
  if ((_9033_v == std::string ("intpntLenbarvar")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9033_v == std::string ("presolveStackSize")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9033_v == std::string ("intpntFactorNumNzBefore")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9033_v == std::string ("intpntFactorNumNzAfter")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9033_v == std::string ("intpntFactorGpOrderSavedNzs")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexPrimalIter")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexDualIter")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexPrimalNumTicks")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexDualNumTicks")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumDualIllposedCer")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumCand")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumProgressStall")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumSingularBases")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumFatalFeasibilityLoss")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexNumFatalGradientStall")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexLuFactorNumTicks")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9033_v == std::string ("simplexLuSolveNumTicks")))
  {
    {
      return (int)8;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_internal_liinf_value

// Begin mosek.fusion.Parameters.string_to_liinfitem_value
// Method mosek.fusion.Parameters.string_to_liinfitem_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:451:0-475:1
int32_t mosek::fusion::p_Parameters::string_to_liinfitem_value(const std::string & _9034_v)
{
  if ((_9034_v == std::string ("anaProScalarizedConstraintMatrixNumRows")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9034_v == std::string ("anaProScalarizedConstraintMatrixNumColumns")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9034_v == std::string ("anaProScalarizedConstraintMatrixNumNz")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9034_v == std::string ("mioAnz")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9034_v == std::string ("mioPresolvedAnz")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9034_v == std::string ("mioSimplexIter")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9034_v == std::string ("mioIntpntIter")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9034_v == std::string ("mioNumPrimIllposedCer")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9034_v == std::string ("mioNumDualIllposedCer")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9034_v == std::string ("biPrimalIter")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9034_v == std::string ("biDualIter")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9034_v == std::string ("biCleanPrimalIter")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9034_v == std::string ("biCleanDualIter")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9034_v == std::string ("biCleanPrimalDegIter")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9034_v == std::string ("biCleanDualDegIter")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9034_v == std::string ("intpntFactorNumNz")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9034_v == std::string ("rdNumacc")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9034_v == std::string ("rdNumdjc")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9034_v == std::string ("rdNumanz")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9034_v == std::string ("rdNumqnz")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9034_v == std::string ("simplexIter")))
  {
    {
      return (int)20;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_liinfitem_value

// Begin mosek.fusion.Parameters.string_to_dparam_value
// Method mosek.fusion.Parameters.string_to_dparam_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:385:0-450:1
int32_t mosek::fusion::p_Parameters::string_to_dparam_value(const std::string & _9035_v)
{
  if ((_9035_v == std::string ("dataTolCjLarge")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolCHuge")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolAijLarge")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolAijHuge")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9035_v == std::string ("dataSymMatTol")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9035_v == std::string ("dataSymMatTolLarge")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9035_v == std::string ("dataSymMatTolHuge")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolBoundInf")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolBoundWrn")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolQij")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9035_v == std::string ("dataTolX")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9035_v == std::string ("semidefiniteTolApprox")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9035_v == std::string ("optimizerMaxTime")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9035_v == std::string ("optimizerMaxTicks")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9035_v == std::string ("lowerObjCut")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9035_v == std::string ("upperObjCut")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9035_v == std::string ("upperObjCutFiniteTrh")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9035_v == std::string ("lowerObjCutFiniteTrh")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolRelGap")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolStepSize")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9035_v == std::string ("simLuTolRelPiv")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolRelStep")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolPath")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolPfeas")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolDfeas")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolMuRed")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolInfeas")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolRelGap")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolPfeas")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolDfeas")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolMuRed")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolNearRel")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntCoTolInfeas")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolRelGap")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolPfeas")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolDfeas")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolMuRed")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolNearRel")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntQoTolInfeas")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolPsafe")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9035_v == std::string ("intpntTolDsafe")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9035_v == std::string ("mioMaxTime")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9035_v == std::string ("mioRelGapConst")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9035_v == std::string ("mioTolRelGap")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9035_v == std::string ("mioTolAbsGap")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9035_v == std::string ("mioTolAbsRelaxInt")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9035_v == std::string ("mioDjcMaxBigm")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9035_v == std::string ("basisTolX")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9035_v == std::string ("basisTolS")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9035_v == std::string ("basisRelTolS")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolX")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolPrimalInfeasPerturbation")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolS")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolAij")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolAbsLindep")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9035_v == std::string ("presolveTolRelLindep")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9035_v == std::string ("simplexAbsTolPiv")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9035_v == std::string ("mioTolFeas")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9035_v == std::string ("anaSolInfeasTol")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9035_v == std::string ("checkConvexityRelTol")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9035_v == std::string ("qcqoReformulateRelDropTol")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9035_v == std::string ("mioTolRelDualBoundImprovement")))
  {
    {
      return (int)46;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_dparam_value

// Begin mosek.fusion.Parameters.string_to_feature_value
// Method mosek.fusion.Parameters.string_to_feature_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:379:0-384:1
int32_t mosek::fusion::p_Parameters::string_to_feature_value(const std::string & _9036_v)
{
  if ((_9036_v == std::string ("pts")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9036_v == std::string ("pton")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_feature_value

// Begin mosek.fusion.Parameters.string_to_dinfitem_value
// Method mosek.fusion.Parameters.string_to_dinfitem_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:264:0-378:1
int32_t mosek::fusion::p_Parameters::string_to_dinfitem_value(const std::string & _9037_v)
{
  if ((_9037_v == std::string ("anaProScalarizedConstraintMatrixDensity")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9037_v == std::string ("biTime")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9037_v == std::string ("biPrimalTime")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9037_v == std::string ("biDualTime")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9037_v == std::string ("biCleanTime")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9037_v == std::string ("biCleanPrimalTime")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9037_v == std::string ("biCleanDualTime")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntTime")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntOrderTime")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntPrimalObj")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntDualObj")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntPrimalFeas")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntDualFeas")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntOptStatus")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9037_v == std::string ("simTime")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9037_v == std::string ("simPrimalTime")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9037_v == std::string ("simDualTime")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9037_v == std::string ("simObj")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9037_v == std::string ("simFeas")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9037_v == std::string ("mioTime")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9037_v == std::string ("mioRootPresolveTime")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9037_v == std::string ("mioRootOptimizerTime")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9037_v == std::string ("mioRootTime")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9037_v == std::string ("toConicTime")))
  {
    {
      return (int)109;
    }
  }
  {}
  if ((_9037_v == std::string ("mioConstructSolutionObj")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9037_v == std::string ("mioInitialFeasibleSolutionObj")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9037_v == std::string ("mioObjInt")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9037_v == std::string ("mioObjBound")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9037_v == std::string ("mioObjRelGap")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9037_v == std::string ("mioObjAbsGap")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9037_v == std::string ("mioUserObjCut")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9037_v == std::string ("mioCmirSeparationTime")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9037_v == std::string ("mioCliqueSeparationTime")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9037_v == std::string ("mioKnapsackCoverSeparationTime")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9037_v == std::string ("mioGmiSeparationTime")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9037_v == std::string ("mioImpliedBoundSeparationTime")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9037_v == std::string ("mioLiproSeparationTime")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9037_v == std::string ("mioRootCutSeparationTime")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9037_v == std::string ("mioCmirSelectionTime")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9037_v == std::string ("mioCliqueSelectionTime")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9037_v == std::string ("mioKnapsackCoverSelectionTime")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9037_v == std::string ("mioGmiSelectionTime")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9037_v == std::string ("mioImpliedBoundSelectionTime")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9037_v == std::string ("mioLiproSelectionTime")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9037_v == std::string ("mioRootCutSelectionTime")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9037_v == std::string ("mioProbingTime")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9037_v == std::string ("mioSymmetryDetectionTime")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9037_v == std::string ("optimizerTime")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9037_v == std::string ("optimizerTicks")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9037_v == std::string ("presolveTime")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9037_v == std::string ("mioSymmetryFactor")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9037_v == std::string ("mioDualBoundAfterPresolve")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9037_v == std::string ("presolveEliTime")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9037_v == std::string ("presolveLindepTime")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9037_v == std::string ("readDataTime")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9037_v == std::string ("writeDataTime")))
  {
    {
      return (int)110;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPrimalObj")))
  {
    {
      return (int)103;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPviolcon")))
  {
    {
      return (int)106;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPviolvar")))
  {
    {
      return (int)108;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPviolbarvar")))
  {
    {
      return (int)105;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPviolcones")))
  {
    {
      return (int)107;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrPviolacc")))
  {
    {
      return (int)104;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDualObj")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDviolcon")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDviolvar")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDviolbarvar")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDviolcones")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrDviolacc")))
  {
    {
      return (int)88;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmXc")))
  {
    {
      return (int)100;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmXx")))
  {
    {
      return (int)101;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmBarx")))
  {
    {
      return (int)94;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmY")))
  {
    {
      return (int)102;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmSlc")))
  {
    {
      return (int)95;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmSuc")))
  {
    {
      return (int)98;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmSlx")))
  {
    {
      return (int)96;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmSux")))
  {
    {
      return (int)99;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmSnx")))
  {
    {
      return (int)97;
    }
  }
  {}
  if ((_9037_v == std::string ("solItrNrmBars")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasPrimalObj")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasPviolcon")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasPviolvar")))
  {
    {
      return (int)75;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasDualObj")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasDviolcon")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasDviolvar")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmXc")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmXx")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmBarx")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmY")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmSlc")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmSuc")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmSlx")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9037_v == std::string ("solBasNrmSux")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPrimalObj")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolcon")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolvar")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolbarvar")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolcones")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolacc")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPviolitg")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgPvioldjc")))
  {
    {
      return (int)84;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgNrmXc")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgNrmXx")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9037_v == std::string ("solItgNrmBarx")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9037_v == std::string ("presolveTotalPrimalPerturbation")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9037_v == std::string ("intpntFactorNumFlops")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9037_v == std::string ("qcqoReformulateTime")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9037_v == std::string ("qcqoReformulateMaxPerturbation")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9037_v == std::string ("qcqoReformulateWorstCholeskyDiagScaling")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9037_v == std::string ("qcqoReformulateWorstCholeskyColumnScaling")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9037_v == std::string ("primalRepairPenaltyObj")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9037_v == std::string ("remoteTime")))
  {
    {
      return (int)56;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_dinfitem_value

// Begin mosek.fusion.Parameters.string_to_solformat_value
// Method mosek.fusion.Parameters.string_to_solformat_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:256:0-263:1
int32_t mosek::fusion::p_Parameters::string_to_solformat_value(const std::string & _9038_v)
{
  if ((_9038_v == std::string ("extension")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9038_v == std::string ("b")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9038_v == std::string ("task")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9038_v == std::string ("jsonTask")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_solformat_value

// Begin mosek.fusion.Parameters.string_to_dataformat_value
// Method mosek.fusion.Parameters.string_to_dataformat_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:243:0-255:1
int32_t mosek::fusion::p_Parameters::string_to_dataformat_value(const std::string & _9039_v)
{
  if ((_9039_v == std::string ("extension")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9039_v == std::string ("mps")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9039_v == std::string ("lp")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9039_v == std::string ("op")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9039_v == std::string ("freeMps")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9039_v == std::string ("task")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9039_v == std::string ("ptf")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9039_v == std::string ("cb")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9039_v == std::string ("jsonTask")))
  {
    {
      return (int)8;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_dataformat_value

// Begin mosek.fusion.Parameters.string_to_symmattype_value
// Method mosek.fusion.Parameters.string_to_symmattype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:238:0-242:1
int32_t mosek::fusion::p_Parameters::string_to_symmattype_value(const std::string & _9040_v)
{
  if ((_9040_v == std::string ("sparse")))
  {
    {
      return (int)0;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_symmattype_value

// Begin mosek.fusion.Parameters.string_to_nametype_value
// Method mosek.fusion.Parameters.string_to_nametype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:231:0-237:1
int32_t mosek::fusion::p_Parameters::string_to_nametype_value(const std::string & _9041_v)
{
  if ((_9041_v == std::string ("gen")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9041_v == std::string ("mps")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9041_v == std::string ("lp")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_nametype_value

// Begin mosek.fusion.Parameters.string_to_domaintype_value
// Method mosek.fusion.Parameters.string_to_domaintype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:214:0-230:1
int32_t mosek::fusion::p_Parameters::string_to_domaintype_value(const std::string & _9042_v)
{
  if ((_9042_v == std::string ("r")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9042_v == std::string ("rzero")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9042_v == std::string ("rplus")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9042_v == std::string ("rminus")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9042_v == std::string ("quadraticCone")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9042_v == std::string ("rquadraticCone")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9042_v == std::string ("primalExpCone")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9042_v == std::string ("dualExpCone")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9042_v == std::string ("primalPowerCone")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9042_v == std::string ("dualPowerCone")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9042_v == std::string ("primalGeoMeanCone")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9042_v == std::string ("dualGeoMeanCone")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9042_v == std::string ("svecPsdCone")))
  {
    {
      return (int)12;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_domaintype_value

// Begin mosek.fusion.Parameters.string_to_conetype_value
// Method mosek.fusion.Parameters.string_to_conetype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:203:0-213:1
int32_t mosek::fusion::p_Parameters::string_to_conetype_value(const std::string & _9043_v)
{
  if ((_9043_v == std::string ("quad")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9043_v == std::string ("rquad")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9043_v == std::string ("pexp")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9043_v == std::string ("dexp")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9043_v == std::string ("ppow")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9043_v == std::string ("dpow")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9043_v == std::string ("zero")))
  {
    {
      return (int)6;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_conetype_value

// Begin mosek.fusion.Parameters.string_to_compresstype_value
// Method mosek.fusion.Parameters.string_to_compresstype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:195:0-202:1
int32_t mosek::fusion::p_Parameters::string_to_compresstype_value(const std::string & _9044_v)
{
  if ((_9044_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9044_v == std::string ("free")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9044_v == std::string ("gzip")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9044_v == std::string ("zstd")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_compresstype_value

// Begin mosek.fusion.Parameters.string_to_callbackcode_value
// Method mosek.fusion.Parameters.string_to_callbackcode_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:97:0-194:1
int32_t mosek::fusion::p_Parameters::string_to_callbackcode_value(const std::string & _9045_v)
{
  if ((_9045_v == std::string ("beginRootCutgen")))
  {
    {
      return (int)21;
    }
  }
  {}
  if ((_9045_v == std::string ("imRootCutgen")))
  {
    {
      return (int)75;
    }
  }
  {}
  if ((_9045_v == std::string ("endRootCutgen")))
  {
    {
      return (int)50;
    }
  }
  {}
  if ((_9045_v == std::string ("beginSolveRootRelax")))
  {
    {
      return (int)24;
    }
  }
  {}
  if ((_9045_v == std::string ("endSolveRootRelax")))
  {
    {
      return (int)53;
    }
  }
  {}
  if ((_9045_v == std::string ("beginOptimizer")))
  {
    {
      return (int)11;
    }
  }
  {}
  if ((_9045_v == std::string ("endOptimizer")))
  {
    {
      return (int)40;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPresolve")))
  {
    {
      return (int)12;
    }
  }
  {}
  if ((_9045_v == std::string ("updatePresolve")))
  {
    {
      return (int)88;
    }
  }
  {}
  if ((_9045_v == std::string ("imPresolve")))
  {
    {
      return (int)69;
    }
  }
  {}
  if ((_9045_v == std::string ("endPresolve")))
  {
    {
      return (int)41;
    }
  }
  {}
  if ((_9045_v == std::string ("beginIntpnt")))
  {
    {
      return (int)8;
    }
  }
  {}
  if ((_9045_v == std::string ("intpnt")))
  {
    {
      return (int)78;
    }
  }
  {}
  if ((_9045_v == std::string ("imIntpnt")))
  {
    {
      return (int)61;
    }
  }
  {}
  if ((_9045_v == std::string ("endIntpnt")))
  {
    {
      return (int)37;
    }
  }
  {}
  if ((_9045_v == std::string ("beginConic")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9045_v == std::string ("conic")))
  {
    {
      return (int)27;
    }
  }
  {}
  if ((_9045_v == std::string ("imConic")))
  {
    {
      return (int)57;
    }
  }
  {}
  if ((_9045_v == std::string ("endConic")))
  {
    {
      return (int)30;
    }
  }
  {}
  if ((_9045_v == std::string ("primalSimplex")))
  {
    {
      return (int)80;
    }
  }
  {}
  if ((_9045_v == std::string ("dualSimplex")))
  {
    {
      return (int)28;
    }
  }
  {}
  if ((_9045_v == std::string ("beginBi")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9045_v == std::string ("imBi")))
  {
    {
      return (int)56;
    }
  }
  {}
  if ((_9045_v == std::string ("endBi")))
  {
    {
      return (int)29;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalBi")))
  {
    {
      return (int)13;
    }
  }
  {}
  if ((_9045_v == std::string ("imPrimalBi")))
  {
    {
      return (int)70;
    }
  }
  {}
  if ((_9045_v == std::string ("updatePrimalBi")))
  {
    {
      return (int)89;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalBi")))
  {
    {
      return (int)42;
    }
  }
  {}
  if ((_9045_v == std::string ("beginDualBi")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9045_v == std::string ("imDualBi")))
  {
    {
      return (int)58;
    }
  }
  {}
  if ((_9045_v == std::string ("updateDualBi")))
  {
    {
      return (int)85;
    }
  }
  {}
  if ((_9045_v == std::string ("endDualBi")))
  {
    {
      return (int)31;
    }
  }
  {}
  if ((_9045_v == std::string ("beginSimplexBi")))
  {
    {
      return (int)23;
    }
  }
  {}
  if ((_9045_v == std::string ("imSimplexBi")))
  {
    {
      return (int)77;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalSimplexBi")))
  {
    {
      return (int)18;
    }
  }
  {}
  if ((_9045_v == std::string ("updatePrimalSimplexBi")))
  {
    {
      return (int)91;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalSimplexBi")))
  {
    {
      return (int)47;
    }
  }
  {}
  if ((_9045_v == std::string ("beginDualSimplexBi")))
  {
    {
      return (int)6;
    }
  }
  {}
  if ((_9045_v == std::string ("updateDualSimplexBi")))
  {
    {
      return (int)87;
    }
  }
  {}
  if ((_9045_v == std::string ("endDualSimplexBi")))
  {
    {
      return (int)35;
    }
  }
  {}
  if ((_9045_v == std::string ("endSimplexBi")))
  {
    {
      return (int)52;
    }
  }
  {}
  if ((_9045_v == std::string ("beginMio")))
  {
    {
      return (int)10;
    }
  }
  {}
  if ((_9045_v == std::string ("imMio")))
  {
    {
      return (int)64;
    }
  }
  {}
  if ((_9045_v == std::string ("newIntMio")))
  {
    {
      return (int)79;
    }
  }
  {}
  if ((_9045_v == std::string ("endMio")))
  {
    {
      return (int)39;
    }
  }
  {}
  if ((_9045_v == std::string ("restartMio")))
  {
    {
      return (int)83;
    }
  }
  {}
  if ((_9045_v == std::string ("beginSimplex")))
  {
    {
      return (int)22;
    }
  }
  {}
  if ((_9045_v == std::string ("imSimplex")))
  {
    {
      return (int)76;
    }
  }
  {}
  if ((_9045_v == std::string ("updateSimplex")))
  {
    {
      return (int)92;
    }
  }
  {}
  if ((_9045_v == std::string ("beginDualSimplex")))
  {
    {
      return (int)5;
    }
  }
  {}
  if ((_9045_v == std::string ("imDualSimplex")))
  {
    {
      return (int)60;
    }
  }
  {}
  if ((_9045_v == std::string ("updateDualSimplex")))
  {
    {
      return (int)86;
    }
  }
  {}
  if ((_9045_v == std::string ("endDualSimplex")))
  {
    {
      return (int)34;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalSimplex")))
  {
    {
      return (int)17;
    }
  }
  {}
  if ((_9045_v == std::string ("imPrimalSimplex")))
  {
    {
      return (int)72;
    }
  }
  {}
  if ((_9045_v == std::string ("updatePrimalSimplex")))
  {
    {
      return (int)90;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalSimplex")))
  {
    {
      return (int)46;
    }
  }
  {}
  if ((_9045_v == std::string ("endSimplex")))
  {
    {
      return (int)51;
    }
  }
  {}
  if ((_9045_v == std::string ("beginInfeasAna")))
  {
    {
      return (int)7;
    }
  }
  {}
  if ((_9045_v == std::string ("endInfeasAna")))
  {
    {
      return (int)36;
    }
  }
  {}
  if ((_9045_v == std::string ("imPrimalSensivity")))
  {
    {
      return (int)71;
    }
  }
  {}
  if ((_9045_v == std::string ("imDualSensivity")))
  {
    {
      return (int)59;
    }
  }
  {}
  if ((_9045_v == std::string ("imMioIntpnt")))
  {
    {
      return (int)66;
    }
  }
  {}
  if ((_9045_v == std::string ("imMioPrimalSimplex")))
  {
    {
      return (int)67;
    }
  }
  {}
  if ((_9045_v == std::string ("imMioDualSimplex")))
  {
    {
      return (int)65;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalSetupBi")))
  {
    {
      return (int)16;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalSetupBi")))
  {
    {
      return (int)45;
    }
  }
  {}
  if ((_9045_v == std::string ("beginDualSetupBi")))
  {
    {
      return (int)4;
    }
  }
  {}
  if ((_9045_v == std::string ("endDualSetupBi")))
  {
    {
      return (int)33;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalSensitivity")))
  {
    {
      return (int)15;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalSensitivity")))
  {
    {
      return (int)44;
    }
  }
  {}
  if ((_9045_v == std::string ("beginDualSensitivity")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9045_v == std::string ("endDualSensitivity")))
  {
    {
      return (int)32;
    }
  }
  {}
  if ((_9045_v == std::string ("beginLicenseWait")))
  {
    {
      return (int)9;
    }
  }
  {}
  if ((_9045_v == std::string ("endLicenseWait")))
  {
    {
      return (int)38;
    }
  }
  {}
  if ((_9045_v == std::string ("imLicenseWait")))
  {
    {
      return (int)62;
    }
  }
  {}
  if ((_9045_v == std::string ("beginQcqoReformulate")))
  {
    {
      return (int)19;
    }
  }
  {}
  if ((_9045_v == std::string ("endQcqoReformulate")))
  {
    {
      return (int)48;
    }
  }
  {}
  if ((_9045_v == std::string ("imQoReformulate")))
  {
    {
      return (int)73;
    }
  }
  {}
  if ((_9045_v == std::string ("beginToConic")))
  {
    {
      return (int)25;
    }
  }
  {}
  if ((_9045_v == std::string ("endToConic")))
  {
    {
      return (int)54;
    }
  }
  {}
  if ((_9045_v == std::string ("beginPrimalRepair")))
  {
    {
      return (int)14;
    }
  }
  {}
  if ((_9045_v == std::string ("endPrimalRepair")))
  {
    {
      return (int)43;
    }
  }
  {}
  if ((_9045_v == std::string ("beginRead")))
  {
    {
      return (int)20;
    }
  }
  {}
  if ((_9045_v == std::string ("imRead")))
  {
    {
      return (int)74;
    }
  }
  {}
  if ((_9045_v == std::string ("endRead")))
  {
    {
      return (int)49;
    }
  }
  {}
  if ((_9045_v == std::string ("beginWrite")))
  {
    {
      return (int)26;
    }
  }
  {}
  if ((_9045_v == std::string ("endWrite")))
  {
    {
      return (int)55;
    }
  }
  {}
  if ((_9045_v == std::string ("readOpfSection")))
  {
    {
      return (int)82;
    }
  }
  {}
  if ((_9045_v == std::string ("imLu")))
  {
    {
      return (int)63;
    }
  }
  {}
  if ((_9045_v == std::string ("imOrder")))
  {
    {
      return (int)68;
    }
  }
  {}
  if ((_9045_v == std::string ("readOpf")))
  {
    {
      return (int)81;
    }
  }
  {}
  if ((_9045_v == std::string ("writeOpf")))
  {
    {
      return (int)93;
    }
  }
  {}
  if ((_9045_v == std::string ("solvingRemote")))
  {
    {
      return (int)84;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_callbackcode_value

// Begin mosek.fusion.Parameters.string_to_purify_value
// Method mosek.fusion.Parameters.string_to_purify_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:88:0-96:1
int32_t mosek::fusion::p_Parameters::string_to_purify_value(const std::string & _9046_v)
{
  if ((_9046_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9046_v == std::string ("primal")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9046_v == std::string ("dual")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9046_v == std::string ("primalDual")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9046_v == std::string ("auto")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_purify_value

// Begin mosek.fusion.Parameters.string_to_intpnthotstart_value
// Method mosek.fusion.Parameters.string_to_intpnthotstart_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:80:0-87:1
int32_t mosek::fusion::p_Parameters::string_to_intpnthotstart_value(const std::string & _9047_v)
{
  if ((_9047_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9047_v == std::string ("primal")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9047_v == std::string ("dual")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9047_v == std::string ("primalDual")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_intpnthotstart_value

// Begin mosek.fusion.Parameters.string_to_simhotstart_value
// Method mosek.fusion.Parameters.string_to_simhotstart_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:73:0-79:1
int32_t mosek::fusion::p_Parameters::string_to_simhotstart_value(const std::string & _9048_v)
{
  if ((_9048_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9048_v == std::string ("free")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9048_v == std::string ("statusKeys")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_simhotstart_value

// Begin mosek.fusion.Parameters.string_to_simdupvec_value
// Method mosek.fusion.Parameters.string_to_simdupvec_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:66:0-72:1
int32_t mosek::fusion::p_Parameters::string_to_simdupvec_value(const std::string & _9049_v)
{
  if ((_9049_v == std::string ("on")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9049_v == std::string ("off")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9049_v == std::string ("free")))
  {
    {
      return (int)2;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_simdupvec_value

// Begin mosek.fusion.Parameters.string_to_simreform_value
// Method mosek.fusion.Parameters.string_to_simreform_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:58:0-65:1
int32_t mosek::fusion::p_Parameters::string_to_simreform_value(const std::string & _9050_v)
{
  if ((_9050_v == std::string ("on")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9050_v == std::string ("off")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9050_v == std::string ("free")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9050_v == std::string ("aggressive")))
  {
    {
      return (int)3;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_simreform_value

// Begin mosek.fusion.Parameters.string_to_uplo_value
// Method mosek.fusion.Parameters.string_to_uplo_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:52:0-57:1
int32_t mosek::fusion::p_Parameters::string_to_uplo_value(const std::string & _9051_v)
{
  if ((_9051_v == std::string ("lo")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9051_v == std::string ("up")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_uplo_value

// Begin mosek.fusion.Parameters.string_to_transpose_value
// Method mosek.fusion.Parameters.string_to_transpose_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:46:0-51:1
int32_t mosek::fusion::p_Parameters::string_to_transpose_value(const std::string & _9052_v)
{
  if ((_9052_v == std::string ("no")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9052_v == std::string ("yes")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_transpose_value

// Begin mosek.fusion.Parameters.string_to_simdegen_value
// Method mosek.fusion.Parameters.string_to_simdegen_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:37:0-45:1
int32_t mosek::fusion::p_Parameters::string_to_simdegen_value(const std::string & _9053_v)
{
  if ((_9053_v == std::string ("none")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9053_v == std::string ("free")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9053_v == std::string ("aggressive")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9053_v == std::string ("moderate")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9053_v == std::string ("minimum")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_simdegen_value

// Begin mosek.fusion.Parameters.string_to_mark_value
// Method mosek.fusion.Parameters.string_to_mark_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:31:0-36:1
int32_t mosek::fusion::p_Parameters::string_to_mark_value(const std::string & _9054_v)
{
  if ((_9054_v == std::string ("lo")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9054_v == std::string ("up")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_mark_value

// Begin mosek.fusion.Parameters.string_to_boundkey_value
// Method mosek.fusion.Parameters.string_to_boundkey_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:22:0-30:1
int32_t mosek::fusion::p_Parameters::string_to_boundkey_value(const std::string & _9055_v)
{
  if ((_9055_v == std::string ("lo")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9055_v == std::string ("up")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9055_v == std::string ("fx")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9055_v == std::string ("fr")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9055_v == std::string ("ra")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_boundkey_value

// Begin mosek.fusion.Parameters.string_to_basindtype_value
// Method mosek.fusion.Parameters.string_to_basindtype_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:13:0-21:1
int32_t mosek::fusion::p_Parameters::string_to_basindtype_value(const std::string & _9056_v)
{
  if ((_9056_v == std::string ("never")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9056_v == std::string ("always")))
  {
    {
      return (int)1;
    }
  }
  {}
  if ((_9056_v == std::string ("noError")))
  {
    {
      return (int)2;
    }
  }
  {}
  if ((_9056_v == std::string ("ifFeasible")))
  {
    {
      return (int)3;
    }
  }
  {}
  if ((_9056_v == std::string ("reservered")))
  {
    {
      return (int)4;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_basindtype_value

// Begin mosek.fusion.Parameters.string_to_language_value
// Method mosek.fusion.Parameters.string_to_language_value @ bld/docker-win/final/default/src/fusion/Parameters.mbi:7:0-12:1
int32_t mosek::fusion::p_Parameters::string_to_language_value(const std::string & _9057_v)
{
  if ((_9057_v == std::string ("eng")))
  {
    {
      return (int)0;
    }
  }
  {}
  if ((_9057_v == std::string ("dan")))
  {
    {
      return (int)1;
    }
  }
  {}
  return (-(int)1);
}
// End mosek.fusion.Parameters.string_to_language_value

void mosek::fusion::p_Parameters::destroy()
{
}
void mosek::fusion::Parameters::destroy() { mosek::fusion::p_Parameters::_get_impl(this)->destroy(); }
// } class Parameters
