Пример #1
0
string SpikingGroup::get_output_line(NeuronID i)
{
	stringstream oss;

	for ( map<string,gsl_vector_float *>::const_iterator iter = state_vector.begin() ; 
			iter != state_vector.end() ;
			++iter ) {
		oss << scientific << gsl_vector_float_get( iter->second, i ) << " ";
	}

	for ( NeuronID k = 0 ; k < pretraces.size() ; k++ ) { 
		// TODO this is actually a bug and only a part of the pretrace gets saved this way
		for ( NeuronID l = 0 ; l < get_locked_range() ; ++l ) {
			NeuronID t = get_locked_range()*(i)+l;
			if ( t < get_size() ) 
				oss << pretraces[k]->get(t) << " ";
			else
				oss << 0.0 << " ";
		}
	}

	for ( NeuronID k = 0 ; k < posttraces.size() ; k++ ) {
		oss << posttraces[k]->get(i) << " ";
	}

	oss << "\n";

	return oss.str();
}
Пример #2
0
Файл: bidiag.c Проект: axt/isvd
int
gsl_linalg_bidiag_unpack2_float (gsl_matrix_float * A, 
                           gsl_vector_float * tau_U, 
                           gsl_vector_float * tau_V,
                           gsl_matrix_float * V)
{
  const size_t M = A->size1;
  const size_t N = A->size2;

  const size_t K = GSL_MIN(M, N);

  if (M < N)
    {
      GSL_ERROR ("matrix A must have M >= N", GSL_EBADLEN);
    }
  else if (tau_U->size != K)
    {
      GSL_ERROR ("size of tau must be MIN(M,N)", GSL_EBADLEN);
    }
  else if (tau_V->size + 1 != K)
    {
      GSL_ERROR ("size of tau must be MIN(M,N) - 1", GSL_EBADLEN);
    }
  else if (V->size1 != N || V->size2 != N)
    {
      GSL_ERROR ("size of V must be N x N", GSL_EBADLEN);
    }
  else
    {
      size_t i, j;

      /* Initialize V to the identity */

      gsl_matrix_float_set_identity (V);

      for (i = N - 1; i > 0 && i--;)
        {
          /* Householder row transformation to accumulate V */
          gsl_vector_float_const_view r = gsl_matrix_float_const_row (A, i);
          gsl_vector_float_const_view h = 
            gsl_vector_float_const_subvector (&r.vector, i + 1, N - (i+1));
          
          float ti = gsl_vector_float_get (tau_V, i);
          
          gsl_matrix_float_view m = 
            gsl_matrix_float_submatrix (V, i + 1, i + 1, N-(i+1), N-(i+1));
          
          gsl_linalg_householder_hm_float (ti, &h.vector, &m.matrix);
        }

      /* Copy superdiagonal into tau_v */

      for (i = 0; i < N - 1; i++)
        {
          float Aij = gsl_matrix_float_get (A, i, i+1);
          gsl_vector_float_set (tau_V, i, Aij);
        }

      /* Allow U to be unpacked into the same memory as A, copy
         diagonal into tau_U */

      for (j = N; j > 0 && j--;)
        {
          /* Householder column transformation to accumulate U */
          float tj = gsl_vector_float_get (tau_U, j);
          float Ajj = gsl_matrix_float_get (A, j, j);
          gsl_matrix_float_view m = gsl_matrix_float_submatrix (A, j, j, M-j, N-j);

          gsl_vector_float_set (tau_U, j, Ajj);
          gsl_linalg_householder_hm1_float (tj, &m.matrix);
        }

      return GSL_SUCCESS;
    }
}
Пример #3
0
AurynFloat TIFGroup::get_bg_current(NeuronID i) {
	if ( localrank(i) )
		return gsl_vector_float_get ( bg_current , global2rank(i) ) ;
	else 
		return 0;
}