Example #1
0
/**
 * Description not yet available.
 * \param
 */
void dmatrix::colfill_randu_ni(const int &j,long int &n)
  {
    long int nn;
    nn=n;
    for (int i=rowmin(); i<=rowmax(); i++)
    {
      elem(i,j)=auto_rand(nn,1);
    }
  }
Example #2
0
/**
 * Description not yet available.
 * \param
 */
  void dmatrix::fill_randn_ni(long int& n)
  {
    long int nn=n;
    for (int i=rowmin(); i<=rowmax(); i++)
    {
      elem(i).fill_randn_ni(nn);
      nn+=2;
    }
  }
Example #3
0
/**
 * Description not yet available.
 * \param
 */
  void dvector::fill_randu_ni(long int& n)
  {
    long int nn;
    nn=n;
    for (int i=indexmin(); i<=indexmax(); i++)
    {
      elem(i)=auto_rand(nn,1);
    }
  }
Example #4
0
File: type.c Project: tungvx/FSE
int get_sizeoftype(AST ty) {
    switch (nodetype(ty)) {
	case tFUNC: return 0;
	case tARRAY: 
		    return get_ival(ty) * get_sizeoftype(elem(ty));
	default:
		    return 1;
    }
}
Example #5
0
/**
 * Description not yet available.
 * \param
 */
  void dvector::fill_randn_ni(long int& n)
  {
    long int nn;
    nn=n;
    for (int i=indexmin(); i<=indexmax(); i++)
    {
      elem(i)=randn(nn);
    }
  }
Example #6
0
/**
 * Description not yet available.
 * \param
 */
const dmatrix& d5_array::operator()(int i, int j, int k) const
    {
        if (i<indexmin()||i>indexmax())
        { cerr << "Error index out of bounds in\n"
            "d3_array& d5_array::operator ( )" << endl;
          ad_exit(1);
        }
      return elem(i)(j,k);
    }
Example #7
0
/**
 * Description not yet available.
 * \param
 */
const double& d5_array::operator()(int i, int j, int k, int l, int m) const
    {
        if (i<indexmin()||i>indexmax())
        { cerr << "Error hslice index out of bounds in\n"
            "dvector& d5_array::operator ( )"  << endl;
          ad_exit(1);
        }
      return elem(i)(j,k,l,m);
    }
 FgMatrixC<T,ncols,nrows>
 transpose() const
 {
     FgMatrixC<T,ncols,nrows> tMat;
     for (uint ii=0; ii<nrows; ii++)
         for (uint jj=0; jj<ncols; jj++)
             tMat.elem(jj,ii) = elem(ii,jj);
     return tMat;
 }
Example #9
0
/**
 * Description not yet available.
 * \param
 */
const dvar_matrix& dvar6_array::operator()(int i, int j, int k, int l) const
    {
        if (i<indexmin()||i>indexmax())
        { cerr << "Error hslice index out of bounds in\n"
            "dvar-vector& dvar4_array::operator ( )"  << endl;
          ad_exit(1);
        }
      return elem(i)(j,k,l);
    }
Example #10
0
/**
 * Helper function to fill a matrix with arbitrary data.
 */
void fill_matrix_data(matrix_t *M, precision_t data[][M->cols])
{
	int i, j;
	for ( i = 0; i < M->rows; i++ ) {
		for ( j = 0; j < M->cols; j++ ) {
			elem(M, i, j) = data[i][j];
		}
	}
}
Example #11
0
void search(Trav *t) {
    ElemList *idx;
    int i;
    ElemId id;

    unmatch(&elem(t->match));
    t->match = 0;
    for (i=t->cur; i<=t->last; i++) {
        idx = index(gsp, searchSpaces[i]);
        id = traverse(idx, t, t->p);
        if (success) {
            match( &elem(id) );
            t->match = id;
            t->cur = i;
            return;
        }
    }
}
Example #12
0
/**
 * Description not yet available.
 * \param
 */
const dvar3_array& dvar5_array::operator()(int i, int j) const
    {
        if (i<indexmin()||i>indexmax())
        { cerr << "Error index out of bounds in\n"
            "dvar3_array& dvar5_array::operator ( )" << endl;
          ad_exit(1);
        }
      return elem(i)(j);
    }
Example #13
0
static void print(Rcpp::NumericMatrix A)
{
  for (int i = 0; i < A.nrow(); i++) {
    for (int j = 0; j < A.ncol(); j++) {
      printf("%9f ", elem(A, i, j));
    }
    putchar('\n');
  }
}
Example #14
0
/**
 * Description not yet available.
 * \param
 */
void dmatrix::rowfill_randu_ni(const int& i,long int& n)
  {
    long int nn;
    nn=n;
    for (int j=colmin(); j<=colmax(); j++)
    {
      elem(i,j)=auto_rand(nn,1);
    }
  }
Example #15
0
namespace boost { namespace hana {
    struct Function {
        struct hana {
            struct operators
                : boost::hana::operators::of<Comparable>
            { };
        };
    };

    template <typename Domain, typename Codomain, typename F, typename = operators::adl>
    struct function_type {
        struct hana { using datatype = Function; };

        Domain dom;
        Codomain cod;
        F def;

        friend constexpr auto domain(function_type f)
        { return f.dom; }

        friend constexpr auto codomain(function_type f)
        { return f.cod; }

        template <typename X>
        constexpr auto operator()(X x) const {
            if (!elem(domain(*this), x))
                throw std::domain_error{"use of a hana::function with an argument out of the domain"};
            return def(x);
        }
    };

    BOOST_HANA_CONSTEXPR_LAMBDA auto function = [](auto domain, auto codomain) {
        return [=](auto definition) {
            return function_type<decltype(domain), decltype(codomain), decltype(definition)>{
                domain, codomain, definition
            };
        };
    };

    BOOST_HANA_CONSTEXPR_LAMBDA auto frange = [](auto f) {
        // Note: that would be better handled by a set data structure, but
        // whatever for now.
        return foldl(transform(domain(f), f), make<Tuple>(), [](auto xs, auto x) {
            return if_(elem(xs, x), xs, prepend(x, xs));
        });
    };


    template <>
    struct equal_impl<Function, Function> {
        template <typename F, typename G>
        static constexpr auto apply(F f, G g) {
            return domain(f) == domain(g) && all_of(domain(f), demux(equal)(f, g));
        }
    };
}} // end namespace boost::hana
int fijaElemento(matriz * mtz, int fila, int columna, long double _Complex valor)
{
    if (!mtz) return -1;
    assert(mtz->datos);
    if (fila<=0 || fila > mtz->filas || columna<=0 || columna > mtz->columnas)
        return -2;

    elem(mtz,fila,columna)=valor;
    return 0;
}
Example #17
0
void updatefunct_t::execute( const size_t& myidx, global_store& globals )
  {
    for(size_t c=0; c<lines.size(); ++c)
      {
	vector<elemptr> trace;
	elemptr elem( model, myidx );
	trace.push_back( elem );
	DOCMD( lines[c], trace, *cmds, globals );
      }
  }
Example #18
0
/*
  Properties and methods
*/
HRESULT STDMETHODCALLTYPE QWindowsAccessible::accDoDefaultAction(VARIANT varID)
{
    showDebug(__FUNCTION__, accessible);
    if (!accessible->isValid())
        return E_FAIL;

    AccessibleElement elem(varID.lVal, accessible);
    const bool res = elem.iface ? elem.iface->doAction(DefaultAction, elem.entry, QVariantList()) : false;
    return res ? S_OK : S_FALSE;
}
Example #19
0
/**
 * Description not yet available.
 * \param
 */
    d4_array& d5_array::operator ( ) (int i)
    {
      if (i < indexmin() || i > indexmax())
      {
        ADMB_ARRAY_BOUNDS_ERROR("index out of bounds",
        "d4_array& d5_array::operator()(int i)", indexmin(), indexmax(), i);
      }
      //return t[i];
      return elem(i);
    }
Example #20
0
/**
 * Description not yet available.
 * \param
 */
    d3_array& d5_array::operator ( ) (int i, int j)
    {
      if (i < indexmin() || i > indexmax())
      {
        ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds",
        "d3_array& d5_array::operator[](int i, int j)",
        indexmin(), indexmax(), i);
      }
      return elem(i)(j);
    }
Example #21
0
/**
 * Description not yet available.
 * \param
 */
const prevariable dvar6_array::operator()(int i, int j, int k, int l, int m,
  int n) const
    {
        if (i<indexmin()||i>indexmax())
        { cerr << "Error hslice index out of bounds in\n"
            "prevariable& dvar4_array::operator ( )"  << endl;
          ad_exit(1);
        }
      return elem(i)(j,k,l,m,n);
    }
Example #22
0
/**
 * Description not yet available.
 * \param
 */
    dvar3_array& dvar6_array::operator ( ) (int i,int j,int k)
    {
      if (i < indexmin() || i > indexmax())
      {
        ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds",
        "dvar5_array& dvar6_array::operator()(int i, int j, int k)",
        indexmin(), indexmax(), i);
      }
      return elem(i)(j,k);
    }
Example #23
0
/**
 * Description not yet available.
 * \param
 */
    dvar_vector& dvar6_array::operator ( ) (int i,int j,int k,int l,int m)
    {
      if (i < indexmin() || i > indexmax())
      {
        ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds",
      "dvar_vector& dvar6_array::operator()(int i, int j, int k, int l, int m)",
        indexmin(), indexmax(), i);
      }
      return elem(i)(j,k,l,m);
    }
Example #24
0
void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint& paint,
                           const SkMatrix* prePathMatrix, bool pathIsMutable) {
    AutoElement elem("path", fWriter, fResourceBucket, draw, paint);
    elem.addPathAttributes(path);

    // TODO: inverse fill types?
    if (path.getFillType() == SkPath::kEvenOdd_FillType) {
        elem.addAttribute("fill-rule", "evenodd");
    }
}
Example #25
0
void paradiseo::smp::Island<EOAlgo,EOT,bEOT>::check()
{
    // Sending
    for(PolicyElement<EOT>& elem : migPolicy)
        if(!elem(pop))
            send(elem.getSelect());
    
    // Receiving
    receive();    
}
Example #26
0
	T pop()
	{
		if (c.empty())
		{
			throw ReadEmptyQueue();
		}
		T elem(c.front());
		c.pop_front();
		return elem;
	}
Example #27
0
void SkSVGDevice::drawText(const SkDraw& draw, const void* text, size_t len,
                           SkScalar x, SkScalar y, const SkPaint& paint) {
    AutoElement elem("text", fWriter, fResourceBucket, draw, paint);
    elem.addTextAttributes(paint);

    SVGTextBuilder builder(text, len, paint, SkPoint::Make(x, y), 0);
    elem.addAttribute("x", builder.posX());
    elem.addAttribute("y", builder.posY());
    elem.addText(builder.text());
}
Example #28
0
/**
 * Description not yet available.
 * \param
 */
 void dvar3_array::initialize()
 {
   if (!(!(*this)))  // only initialize allocated objects
   {
     for (int i=slicemin();i<=slicemax();i++)
     {
       elem(i).initialize();
     }
   }
 }
Example #29
0
/**
 * Description not yet available.
 * \param
 */
  void dvar3_array::fill_randu_ni(long int& n)
  {
    long int nn;
    nn=n;
    for (int i=slicemin(); i<=slicemax(); i++)
    {
      elem(i).fill_randu_ni(nn);
      nn+=2;
    }
  }
Example #30
0
	void CEntity::setAttribute(CEntity *info)
	{
		TAttrList::const_iterator it = info->_attributes.begin();
		for(;it!=info->_attributes.end();++it){
			//buscamos por si ya existia el atributo y hay que modificarlo
			TAttrList::const_iterator it2 = _attributes.find((*it).first);
			if(it2!=_attributes.end()){//si lo ha encontrado ...
				//lo eliminamos de la tabla (para no dejar rastro)
				_attributes.erase(it2);
				//metemos los valores nuevos en la tabla
				TSSPar elem((*it).first, (*it).second);
				_attributes.insert(elem);
			}else{// si no lo ha encotnrado
				TSSPar elem((*it).first, (*it).second);
				_attributes.insert(elem);
			}
		}

	} // setAttribute