Exemplo n.º 1
0
/* ChapelArray.chpl:252 */
void setIndices(_domain_1_SingleLocaleArithmeticDomain_1_int32_t_0* const _this_249241, _tuple_1_range_int32_t_bounded_0* const x) {
  range_int32_t_bounded_0 T1;
  range_int32_t_bounded_0 T2;
  range_int32_t_bounded_0 T3;
  _tuple_1_range_int32_t_bounded_0 T4;
  SingleLocaleArithmeticDomain_1_int32_t_0 T5 = NULL;
  T1 = ((*x).x1);
  T2 = _copy(&(T1));
  T3 = _copy(&(T2));
  T4.x1 = T3;
  T5 = ((*_this_249241)._value);
  _setIndices_249464(T5, &(T4));
  return;
}
Exemplo n.º 2
0
/**
 * vsg_matrix3@t@_matmult:
 * @mat: a #VsgMatrix3@t@
 * @other: a #VsgMatrix3@t@
 * @result: a #VsgMatrix3@t@
 *
 * Performs matrix product of @mat by @other and stores the result in
 * @result. Argument aliasing is allowed.
 */
void vsg_matrix3@t@_matmult (const VsgMatrix3@t@ *mat,
                             const VsgMatrix3@t@ *other,
                             VsgMatrix3@t@ *result)
{
  VsgMatrix3@t@ tmp = VSG_M3@T@_ZERO;
  guint i, j, k;

#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (mat != NULL);
  g_return_if_fail (other != NULL);
  g_return_if_fail (result != NULL);
#endif

  for (i = 0; i < 3; i++)
    {
      for (j = 0; j < 3; j++)
        {
          @type@ rtmp = 0.;

          for (k = 0; k < 3; k++)
            {
              rtmp += VSG_MATRIX3@T@_COMP (mat, i, k) *
                VSG_MATRIX3@T@_COMP (other, k, j);
            }

          VSG_MATRIX3@T@_COMP (&tmp, i, j) = rtmp;
        }
    }

  vsg_matrix3@t@_copy (&tmp, result);

}
Exemplo n.º 3
0
_CListOfCHXString_::_CListOfCHXString_(const _CListOfCHXString_& rlocOther)
{
    m_locnREnd.next(&m_locnEnd);
    m_locnEnd.prev(&m_locnREnd);

    _copy(rlocOther);
}
Exemplo n.º 4
0
/* ChapelBase.chpl:565 */
void _init_elts_462899(_ddata__complex128 x, int32_t s) {
  _ddata__complex128 T1 = NULL;
  range_int32_t_bounded_0 T2;
  range_int32_t_bounded_0 T3;
  int32_t T4;
  int32_t T6;
  int32_t T5;
  int32_t T8;
  int32_t T7;
  _ref_int32_t T9 = NULL;
  _complex128 T10;
  int32_t T11;
  T1 = x;
  T2 = _build_range(1, s);
  T3 = _copy(&(T2));
  T4 = 0;
  T5 = (T3._low);
  T6 = T5;
  T7 = (T3._high);
  T8 = T7;
  for (T4 = T6; T4 <= T8; T4 += 1) {
    T9 = &(T4);
    T10.re = 0.0;
    T10.im = 0.0;
    T11 = (T4-1);
    _ARRAY_SET(T1, T11, T10);
  }
  return;
}
Exemplo n.º 5
0
/* ChapelBase.chpl:565 */
void init_elts(_ddata_locale x, int32_t s, int32_t _ln, _string _fn) {
  _ddata_locale T1 = NULL;
  range_int32_t_bounded_0 T2;
  range_int32_t_bounded_0 T3;
  int32_t T4;
  int32_t T6;
  int32_t T5;
  int32_t T8;
  int32_t T7;
  _ref_int32_t T9 = NULL;
  locale T10 = NULL;
  int32_t T11;
  T1 = x;
  T2 = _build_range(1, s);
  T3 = _copy(&(T2));
  T4 = 0;
  T5 = (T3._low);
  T6 = T5;
  T7 = (T3._high);
  T8 = T7;
  for (T4 = T6; T4 <= T8; T4 += 1) {
    T9 = &(T4);
    T10 = ((locale)(nil));
    T11 = (T4-1);
    _ARRAY_SET(T1, T11, T10);
  }
  return;
}
Exemplo n.º 6
0
/* ChapelBase.chpl:565 */
void _init_elts_333870(_ddata_int32_t x, int32_t s) {
  _ddata_int32_t T1 = NULL;
  range_int32_t_bounded_0 T2;
  range_int32_t_bounded_0 T3;
  int32_t T4;
  int32_t T6;
  int32_t T5;
  int32_t T8;
  int32_t T7;
  _ref_int32_t T9 = NULL;
  int32_t T10;
  T1 = x;
  T2 = _build_range(1, s);
  T3 = _copy(&(T2));
  T4 = 0;
  T5 = (T3._low);
  T6 = T5;
  T7 = (T3._high);
  T8 = T7;
  for (T4 = T6; T4 <= T8; T4 += 1) {
    T9 = &(T4);
    T10 = (T4-1);
    _ARRAY_SET(T1, T10, 0);
  }
  return;
}
Exemplo n.º 7
0
void _split(T A[], T temp[], int begin, int end)
{
	if ((end - begin) < 2)
		return;
	
	
	// recursively split into halves until size is 1,
	// then merge and go back up.
	int mid = (end + begin) / 2;

	// I chose 16 because it's a power of 2 and precedence.
	if ((end - mid) <= 16)
	{
		insertion_sort(A, end, mid);	// mid included.
		insertion_sort(A, mid, begin);	// mid excluded.
	}
	// Split if large enough.
	else
	{
		_split(A, temp, begin, mid);	// mid will be excluded.
		_split(A, temp, mid, end);		// mid will be included.
	}
	_merge(A, temp, begin, mid, end);	// merge them back again.
	_copy (A, temp, begin, end);		// Copy sorted array to original array.
}
bool SplayPlayObject_impl::streamMedia(Arts::InputStream instream) {
  arts_debug("streamMedia");
  lStreaming=true;
  currentStream = instream;
  Arts::StreamPlayObject self = Arts::StreamPlayObject::_from_base(_copy());
  connect(currentStream, "outdata", self);
  return true;
}
Exemplo n.º 9
0
/**
 * vsg_matrix3@t@_identity:
 * @mat: a #VsgMatrix3@t@
 *
 * Sets components of @mat to values of Identity.
 */
void vsg_matrix3@t@_identity (VsgMatrix3@t@ *mat)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (mat != NULL);
#endif

  vsg_matrix3@t@_copy (&VSG_M3@T@_ID, mat);
}
Exemplo n.º 10
0
CommonBytesMessageBody& CommonBytesMessageBody::operator = (const CommonBytesMessageBody& body)
{
	if (this != &body)
	{
		_copy(body.m_data, body.m_len);
	}
	return *this;
}
Exemplo n.º 11
0
_CListOfCHXString_&
_CListOfCHXString_::operator=(const _CListOfCHXString_& rlocOther)
{
    empty();
    _copy(rlocOther);

    return *this;
}
Exemplo n.º 12
0
/* ChapelArray.chpl:148 */
_domain_1_SingleLocaleArithmeticDomain_1_int32_t_0 _this_663900(_domain_1_SingleLocaleArithmeticDomain_1_int32_t_0* const _this_663906, range_int32_t_bounded_0* const _e0_ranges, int32_t _ln, _string _fn) {
  range_int32_t_bounded_0 T1;
  _domain_1_SingleLocaleArithmeticDomain_1_int32_t_0 T7;
  range_int32_t_bounded_0 T2;
  _tuple_1_range_int32_t_bounded_0 T3;
  SingleLocaleArithmeticDomain_1_int32_t_0 T5 = NULL;
  SingleLocaleArithmeticDomain_1_int32_t_0 T4 = NULL;
  _domain_1_SingleLocaleArithmeticDomain_1_int32_t_0 T6;
  T1 = _copy(&((*_e0_ranges)));
  T2 = _copy(&(T1));
  T3.x1 = T2;
  T4 = ((*_this_663906)._value);
  T5 = _slice_664786(T4, false, &(T3), _ln, _fn);
  T6 = _construct__domain(1, T5, _ln, _fn);
  T7 = T6;
  return T7;
}
Exemplo n.º 13
0
/* ChapelReduce.chpl:2 */
int64_t _reduce(_sum_int64_t r, _ic_physicalMemory__ref__array_int32_t_locale_1_SingleLocaleArithmeticArray_locale_int32_t_0_1_0 s, int32_t _ln, _string _fn) {
  _sum_int64_t T1 = NULL;
  int64_t T26;
  _array_int32_t_locale_1_SingleLocaleArithmeticArray_locale_int32_t_0_1_0 T2;
  MemUnits T3;
  MemUnits T4;
  SingleLocaleArithmeticArray_locale_int32_t_0_1_0 T5 = NULL;
  SingleLocaleArithmeticArray_locale_int32_t_0_1_0 T6 = NULL;
  SingleLocaleArithmeticDomain_1_int32_t_0 T7 = NULL;
  range_int32_t_bounded_0 T9;
  _tuple_1_range_int32_t_bounded_0 T8;
  range_int32_t_bounded_0 T10;
  int32_t T11;
  int32_t T13;
  int32_t T12;
  int32_t T15;
  int32_t T14;
  _ref_int32_t T16 = NULL;
  int32_t T17;
  int32_t T18;
  int32_t T19;
  int32_t T20;
  _ddata_locale T21 = NULL;
  _ref_locale T22 = NULL;
  locale T23 = NULL;
  int64_t T24;
  int64_t T25;
  T1 = r;
  T2 = (s->_0_this);
  T3 = (s->_1_unit);
  T4 = T3;
  T5 = (T2._value);
  T6 = T5;
  T7 = (T5->dom);
  T8 = (T7->ranges);
  T9 = (T8.x1);
  T10 = _copy(&(T9));
  T11 = 0;
  T12 = (T10._low);
  T13 = T12;
  T14 = (T10._high);
  T15 = T14;
  for (T11 = T13; T11 <= T15; T11 += 1) {
    T16 = &(T11);
    T17 = (T6->origin);
    T18 = (T17+T11);
    T19 = (T6->factoredOffs);
    T20 = (T18-T19);
    T21 = (T6->data);
    T22 = _ARRAY_GET(T21, T20);
    T23 = *(T22);
    T24 = physicalMemory(T23, T4, _ln, _fn);
    accumulate(T1, T24);
  }
  T25 = generate(T1);
  T26 = T25;
  return T26;
}
Exemplo n.º 14
0
QJSValue THREEMatrix4::copy(QJSValue threeMatrix4) {
    THREEMatrix4 *m = getAsTHREEMatrix4(threeMatrix4);
    if (!m) {
        qDebug().nospace() << "THREEMatrix4::" << __FUNCTION__ << " parameter was not THREEMatrix4 was " << threeMatrix4.toQObject();
        return m_engine->newQObject(this);
    }

    return m_engine->newQObject(_copy(m));
}
Exemplo n.º 15
0
//--
Personne& Personne::operator=(const Personne& aP)
{
 if (this != &aP)
 {
  _destroy();
  _copy(aP);
 }
 return *this;
}
Exemplo n.º 16
0
QJSValue THREEVector3::copy(QJSValue threeVector3) {
    THREEVector3 *vec = getAsTHREEVector3(threeVector3);
    if (!vec) {
        qDebug() << "THREEVector3::" << __FUNCTION__ << " parameter was not THREEVector3 was " << threeVector3.toQObject();
        return m_engine->newQObject(this);
    }

    return m_engine->newQObject(_copy(vec));
}
Exemplo n.º 17
0
PNG const & PNG::operator=(PNG const & other)
{
	if (this != &other)
	{
		_clear();
		_copy(other);
	}
	return *this;
}
Exemplo n.º 18
0
//! Assignment operator
QgsDistanceArea & QgsDistanceArea::operator=( const QgsDistanceArea & origDA )
{
  if ( this == & origDA )
  {
    // Do not copy unto self
    return *this;
  }
  _copy( origDA );
  return *this;
}
Exemplo n.º 19
0
void DwString::ConvertToUpperCase()
{
    if (mRep->mRefCount > 1) {
        _copy();
    }
    char* buf = mRep->mBuffer + mStart;
    for (size_t i=0; i < mLength; ++i) {
        buf[i] = (char) dw_asciitoupper(buf[i]);
    }
}
Exemplo n.º 20
0
//--
Etudiant& Etudiant::operator=(const Etudiant& anE)
{
 if (this != &anE)
 {
  Personne::operator=(anE);
  _destroy();
  _copy(anE);
 }
 return *this;
}
Exemplo n.º 21
0
static inline void inv_mix_columns(uint8_t *s)
{
	uint8_t t[Nb*Nk];

	mult_row_column(t, s);
	mult_row_column(&t[Nb], s+Nb);
	mult_row_column(&t[2*Nb], s+(2*Nb));
	mult_row_column(&t[3*Nb], s+(3*Nb));
	(void)_copy(s, sizeof(t), t, sizeof(t));
}
Exemplo n.º 22
0
//
// copy all files in fromdir to todir
//
static int copyfiles(char *fromdir, char *todir)
{
	int ret, r1, len_from, len_to, fret;
	char from[80], to[80];
	struct f_info fi;
	
	fret = 0;
	
	strcpy(from, fromdir);
	len_from = strlen(from);
	
	if(from[len_from-1] != '/') {
		strcat(from, "/");
		len_from++;
	}
	strcat(from, "*.*");
	
	strcpy(to, todir);
	len_to = strlen(to);
//	mkdir(to);	// just to be safe
	if(to[len_to-1] != '/') {
		strcat(to, "/");
		len_to++;
	}
			
	ret =_findfirst((LPSTR)from, &fi, D_FILE);
	while(ret >= 0) {
		if(fi.f_name[0] != '.') {
			from[len_from] = 0;
			to[len_to]= 0;
			strcat(from, fi.f_name);
			strcat(to, fi.f_name);
			if((lower(from[0]) == 'a') && (lower(to[0]) == 'a')) {
				unlink((LPSTR)to);
				r1 = rename((LPSTR)from, (LPSTR)to);
			} else {
				setLED(LED_GREEN,FALSE);
				setLED(LED_RED,TRUE);
				r1 = _copy((LPSTR)from, (LPSTR)to);
// speed up 				wait (500);
				setLED(LED_RED,FALSE);
				if (r1 != -1) {
					setLED(LED_GREEN,TRUE);
// speed up					wait(500);
				}
			}
//			logString((char *)"FROM/TO:",BUFFER);
//			logString(from,BUFFER);
//			logString(to,ASAP);
		}
		ret = _findnext(&fi);
		fret++;
	}
	return(fret);
}
Exemplo n.º 23
0
void _mergesort(std::vector<T>& arr, int64_t begin, int64_t end,
                std::vector<T>& scratch) {
  // trivially sorted since it is 1
  if (end - begin <= 1)
    return;
  int64_t mid = (begin + end) / 2;
  _mergesort(arr, begin, mid, scratch);
  _mergesort(arr, mid, end, scratch);
  _merge(arr, begin, mid, end, scratch);
  _copy(scratch, begin, end, arr);
}
Exemplo n.º 24
0
void MemoryDebugger::_resize(unsigned int new_size)
{
 VtIterator new_first = (VtIterator) NxOgreMalloc(new_size * sizeof(Vt));
 _copy(_First, _Last, new_first);
 _range_destruct(_First, _Last);
 if (_First)
  NxOgreFree(_First);
 _End = new_first + new_size;
 _Last = new_first + _size();
 _First = new_first;
}
Exemplo n.º 25
0
CMyProblem::CMyProblem(const CMyProblem &src)
{
	if (src.IsInvalid())
	{
		n=0;
		return;
	}

	_alloc(src.n);
	_copy(src);
}
Exemplo n.º 26
0
void _vsg_prtree2@t@node_get_info (VsgPRTree2@t@Node *node,
                                   VsgPRTree2@t@NodeInfo *node_info,
                                   VsgPRTree2@t@NodeInfo *father_info,
                                   guint8 child_number)
{
  VsgPRTreeKey2@t@ *father_id;

  vsg_vector2@t@_copy (&node->lbound, &node_info->lbound);
  vsg_vector2@t@_copy (&node->ubound, &node_info->ubound);
  vsg_vector2@t@_copy (&node->center, &node_info->center);

  node_info->isleaf = PRTREE2@T@NODE_ISLEAF(node);

  node_info->father_info = father_info;

  if (node_info->isleaf)
    {
      node_info->point_list = PRTREE2@T@NODE_LEAF(node).point;
    }
  else
    {
      node_info->point_list = NULL;
    }

  node_info->region_list = node->region_list;

  node_info->point_count = node->point_count;
  node_info->region_count = node->region_count;

  if (father_info == NULL) node_info->depth = 0;
  else node_info->depth = father_info->depth + 1;

  node_info->user_data = node->user_data;

  if (father_info == NULL) father_id = NULL;
  else father_id = &father_info->id;

  vsg_prtree_key2@t@_build_child (father_id, child_number, &node_info->id);

  node_info->parallel_status = node->parallel_status;
}
Exemplo n.º 27
0
int tc_cbc_mode_encrypt(uint8_t *out, unsigned int outlen, const uint8_t *in,
			    unsigned int inlen, const uint8_t *iv,
			    const TCAesKeySched_t sched)
{

	uint8_t buffer[TC_AES_BLOCK_SIZE];
	unsigned int n, m;

	/* input sanity check: */
	if (out == (uint8_t *) 0 ||
	    in == (const uint8_t *) 0 ||
	    sched == (TCAesKeySched_t) 0 ||
	    inlen == 0 ||
	    outlen == 0 ||
	    (inlen % TC_AES_BLOCK_SIZE) != 0 ||
	    (outlen % TC_AES_BLOCK_SIZE) != 0 ||
	    outlen != inlen + TC_AES_BLOCK_SIZE) {
		return TC_CRYPTO_FAIL;
	}

	/* copy iv to the buffer */
	(void)_copy(buffer, TC_AES_BLOCK_SIZE, iv, TC_AES_BLOCK_SIZE);
	/* copy iv to the output buffer */
	(void)_copy(out, TC_AES_BLOCK_SIZE, iv, TC_AES_BLOCK_SIZE);
	out += TC_AES_BLOCK_SIZE;

	for (n = m = 0; n < inlen; ++n) {
		buffer[m++] ^= *in++;
		if (m == TC_AES_BLOCK_SIZE) {
			(void)tc_aes_encrypt(buffer, buffer, sched);
			(void)_copy(out, TC_AES_BLOCK_SIZE,
				    buffer, TC_AES_BLOCK_SIZE);
			out += TC_AES_BLOCK_SIZE;
			m = 0;
		}
	}

	return TC_CRYPTO_SUCCESS;
}
Exemplo n.º 28
0
io_ptr_interface::io_ptr_interface(const io_ptr_interface& src, dword offset, uint32_t size) :
	_io_mngr(0),
	_io_ptr(0),
	_io_offset(0),
	_io_size(0)
{
	dword src_offset = src.offset();
	uint32_t src_size = src.size();

	if (size == 0 || src_offset > offset || src_offset + src_size < offset + size)
		return;

	_copy(src);
}
Exemplo n.º 29
0
/**
 * vsg_matrix3@t@_clone:
 * @src: a #VsgMatrix3@t@.
 *
 * Duplicates @src.
 *
 * Returns: a copy of @src.
 */
VsgMatrix3@t@ *vsg_matrix3@t@_clone (const VsgMatrix3@t@ *src)
{
  VsgMatrix3@t@ *dst;

#ifdef VSG_CHECK_PARAMS
  g_return_val_if_fail (src != NULL, NULL);
#endif

  dst = _matrix3@t@_alloc ();

  vsg_matrix3@t@_copy (src, dst);

  return dst;
}
Exemplo n.º 30
0
void
ParticleSwarmOptimization::_update_gbest()
{
	int i;

	for (i = 0; i < _num_particles; i++)
	{
		if (_fitness[i] > _gbest_fitness)
		{
			_gbest_fitness = _fitness[i];
			_copy(_particles[i], _gbest);			
		}
	}
}