Exemple #1
0
/*!
  \brief Processes a server OK reply.

  We recieve the reply data in \p data, parse it as a JSON string, take the data
  we need and send a certain signal.

  \param data The data to be parsed.
*/
void
Steam::processReplyServerOK( const QByteArray &data )
{
  bool ok = false;
  if( ! data.isEmpty() )
  {
    JSONStreamReader jsonReader;
    JSONObject *json = jsonReader.read( data );
    if( ! json || jsonReader.hasError() )
      SteamPrivate::jsonError( jsonReader );
    else
    {
      JSONObject *result = json->valueObject( QL( "result" ) );
      JSONObject *services = NULL;

      if( result )
        services = result->valueObject( QL( "services" ) );

      if( services )
      {
        QString sessionsLogon = services->valueScalar( QL( "SessionsLogon" ) )->sValue();
        ok = ( sessionsLogon == QL( "normal" ) );
      }
    }

    delete json;
    json = NULL;
  }

  emit( serverOK( ok ) );
}
Exemple #2
0
/*!
  \brief Processes the player count reply.

  The player count comes with a json answer. We parse it and extract the player
  count.

  \param data The data to be parsed.
*/
void
Steam::processReplyPlayerCount( const QByteArray &data )
{
  WAITCURSOR;
  int count = -1;

  if( ! data.isEmpty() )
  {
    JSONStreamReader jsonReader;
    JSONObject *json = jsonReader.read( data );
    if( ! json || jsonReader.hasError() )
    {
      SteamPrivate::jsonError( jsonReader );
      return;
    }

    JSONObject *response = json->valueObject( QL( "response" ) );
    if( response )
    {
      JSONScalar *result = response->valueScalar( QL( "result" ) );
      if( result && result->iValue() == 1 )
      {
        JSONScalar *player_count = response->valueScalar( QL( "player_count" ) );
        if( player_count )
          count = player_count->iValue();
      }
    }

    delete json;
    json = NULL;
  }

  emit( playerCount( count ) );
}
Exemple #3
0
/*!
  \brief Initializes the application itself.

  We provide additional information to the settings system etc.
*/
/* static */ void
init()
{
  QApplication::setApplicationName( QL( APP_NAME ) );
  QApplication::setApplicationVersion( QL( APP_VERSION ) );
  QApplication::setOrganizationDomain( QL( ORG_DOMAIN ) );
  QApplication::setOrganizationName( QL( ORG_NAME ) );
}
Exemple #4
0
/*!
  \brief Checks the Steam server status.

  This method requests a Steam server status check. We send the GET request and
  wait for the reply.
*/
void
Steam::requestServerOK()
{
  QUrl url( QL( "http://api.steampowered.com/ICSGOServers_730/GetGameServersStatus/v1/" ) );
  url.addQueryItem( QL( "key" ), Settings::Instance()->apiKey() );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  connectReply( reply );
}
Exemple #5
0
/*!
  \brief Requests the player count for a steam app.

  This sends out an API request to steam to ask for the player count for the
  given \p appID.

  \param appID The app ID we wish the player count for.
*/
void
Steam::requestPlayerCount( int appID )
{
  if( appID <= 0 )
    return;

  QUrl url( QL( "http://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v0001/" ) );
  url.addQueryItem( QL( "appid" ), QString::number( appID ) );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  connectReply( reply );
}
Exemple #6
0
/*!
  \brief Requests a list of achievements for a steam app.

  \param appID The app ID we wish to get the achievement list for.
*/
void
Steam::requestAchievementsForGame( int appID )
{
  if( appID <= 0 )
    return;

  QUrl url( QL( "http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/" ) );
  url.addQueryItem( QL( "key" ), Settings::Instance()->apiKey() );
  url.addQueryItem( QL( "appid" ), QString::number( appID ) );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  connectReply( reply );
}
Exemple #7
0
bool HRC::screenApplicantsCheap(s_p_Job jobPtr, vector<s_p_Worker> applicants,
		s_p_Worker *choosenOne) {
	bool found = false;
	float minQL = ((companies.find(jobPtr->CompanySN))->second)->QL_Min;
	//	s_p_Worker choosenOne;// = *applicants.begin();
	int curMin = std::numeric_limits<int>::max();
	for (vector<s_p_Worker>::iterator it = applicants.begin(); it
			!= applicants.end(); ++it) {
		ostringstream msg;
		msg << "Candidate " << (*it)->getID()
				<< " was notified about job opening " << jobPtr->SN << ".";
		logger->Log(msg.str(), Poco::Message::PRIO_NOTICE);
		int tmp = (*it)->getExpectedSalary();
		float tmpQL = QL(*it, jobPtr);
		if (tmp < curMin && tmpQL >= minQL) {
			curMin = tmp;
			*choosenOne = *it;
			found = true;
		} else if (tmpQL >= minQL && tmp == curMin && ((*it)->getID()
				< (*choosenOne)->getID())) {
			curMin = tmp;
			*choosenOne = *it;
			found = true;
		}
	}
	return found;
}
Exemple #8
0
bool HRC::screenApplicantsCostEffective(s_p_Job jobPtr,
		vector<s_p_Worker> applicants, s_p_Worker *choosenOne) {
	//	s_p_Worker choosenOne = *applicants.begin();
	bool found = false;
	float minQL = ((companies.find(jobPtr->CompanySN))->second)->QL_Min;
	float curBest = 0;//(QL(choosenOne, *jobPtr))
	//			/ choosenOne->getExpectedSalary();
	for (vector<s_p_Worker>::iterator it = applicants.begin(); it
			!= applicants.end(); ++it) {
		ostringstream msg;
		msg << "Candidate " << (*it)->getID()
				<< " was notified about job opening " << jobPtr->SN << ".";
		logger->Log(msg.str(), Poco::Message::PRIO_NOTICE);
		float tmpQL = (QL(*it, jobPtr));
		float tmp = tmpQL / (*it)->getExpectedSalary();
		if (tmp > curBest && tmpQL >= minQL) {
			curBest = tmp;
			*choosenOne = *it;
			found = true;
		} else if (tmpQL >= minQL && tmp == curBest && ((*it)->getID()
				< (*choosenOne)->getID())) {
			curBest = tmp;
			*choosenOne = *it;
			found = true;
		}
	}
	return found;
}
Exemple #9
0
/*!
  \brief Requests Steam App ID list.

  This downloads all steam apps (games) and their coresponding appid's. This
  process takes some time and shouldn't be done all the time, it's wise to cache
  the results.
*/
void
Steam::requestAppIDs()
{
  QUrl url( QL( "http://api.steampowered.com/ISteamApps/GetAppList/v1/" ) );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  connectReply( reply );
}
Exemple #10
0
/*!
  \brief Create command line argument list.

  Transforms the WinCRT style command line arguments in a string list. We omit
  the first argument, since it's the application path.

  \param argc Element count in \p argv.
  \param argv Command line arguments.
  \return Command line arguments as a QStringList list.
*/
/* static */ QStringList
getArgs( int argc, char **argv )
{
  QStringList args;
  for( int i = 1; i < argc; i++ )
    args << QL( argv[ i ] );

  return args;
}
Exemple #11
0
/*!
  \brief Processes a app ID list reply.

  The data is rather big and in JSON format. We parse it, read it and return it
  to the main window as a signal.

  \param data The data to be parsed.
*/
void
Steam::processReplyAppIDs( const QByteArray &data )
{
  WAITCURSOR;
  QHash< QString, int > map;
  if( data.isEmpty() )
    return;

  JSONStreamReader jsonReader;
  JSONObject *json = jsonReader.read( data );
  if( ! json || jsonReader.hasError() )
  {
    SteamPrivate::jsonError( jsonReader );
    return;
  }

  JSONList *app = NULL;
  JSONObject *apps = NULL;
  JSONObject *applist = json->valueObject( QL( "applist" ) );

  if( applist )
    apps = applist->valueObject( QL( "apps" ) );

  if( apps )
    app = apps->valueList( QL( "app" ) );

  for( int i = 0; app && i < app->count(); i++ )
  {
    JSONValue *aApp = NULL;
    aApp = app->at( i );

    if( aApp->type() == JSONValue::T_Object )
    {
      JSONObject *obj = dynamic_cast< JSONObject * >( aApp );
      map.insert( obj->valueScalar( QL( "name" ) )->sValue(),
        obj->valueScalar( QL( "appid" ) )->iValue() );
    }
  }

  delete json;
  json = NULL;

  emit( appIDs( map ) );
}
Exemple #12
0
/*!
  \brief Processes the game's achievements list.

  It arrives as a JSON object. We parse it and send it to the mainwindow.

  \param data The data to be parsed.
*/
void
Steam::processReplyAchievements( const QByteArray &data )
{
  AchievementList achievementList;

  if( ! data.isEmpty() )
  {
    JSONStreamReader jsonReader;
    JSONObject *json = jsonReader.read( data );
    if( jsonReader.hasError() )
      SteamPrivate::jsonError( jsonReader );
    else
    {
      JSONObject *availableGameStats = NULL;
      JSONList *achievements = NULL;

      JSONObject *game = json->valueObject( QL( "game" ) );

      if( game )
        availableGameStats = game->valueObject( QL( "availableGameStats" ) );

      if( availableGameStats )
        achievements = availableGameStats->valueList( QL( "achievements" ) );
      
      for( int i = 0; achievements && i < achievements->count(); i++ )
      {
        JSONValue *val = achievements->at( i );
        if( ! val || ! val->type() == JSONValue::T_Object )
          continue;

        JSONObject *achievementJson = dynamic_cast< JSONObject * >( val );
        achievementList << Achievement( achievementJson );
      }
    }

    delete json;
    json = NULL;
  }

  emit( achievements( achievementList ) );
}
Exemple #13
0
/*!
  \brief Returns the \p widget object name.

  Either the object name that has been set explicitely, or the class name as a
  fallback.

  \param widget The widget.
  \return The object or class name as a \c QString.
*/
QString
Storage::objectName( const QWidget *widget )
{
  if( ! widget )
    return( QString() );

  QString objName = widget->objectName();
  if( objName.isEmpty() )
    objName = QL( widget->metaObject()->className() );

  return objName;
}
Exemple #14
0
/*!
  \brief Determines if something has changed.

  We do that by comparing every value against what is stored in the storage.

  \return \arg \c true  Yes, something has changed.
          \arg \c false No, nothing changed.
*/
bool
Settings::changed() const
{
  if( apiKey() != Storage::loadString( QL( "apiKey" ) ) )
    return true;

  if( useSystemProxy() != Storage::loadBool( QL( "useSystemProxy" ) ) )
    return true;

  if( useSystemProxy() )
    return false;

  if( proxyHost() != Storage::loadString( QL( "proxyHost" ) ) )
    return true;

  if( proxyPort() != Storage::loadUShort( QL( "proxyPort" ) ) )
    return true;

  if( proxyLogin() != Storage::loadString( QL( "proxyLogin" ) ) )
    return true;

  if( proxyPassword() != Storage::loadString( QL( "proxyPassword" ) ) )
    return true;

  return false;
}
Exemple #15
0
void test_svd(const std::string & fn, ScalarType EPS)
{
  std::size_t sz1, sz2;

  //read matrix

  // sz1 = 2048, sz2 = 2048;
  // std::vector<ScalarType> in(sz1 * sz2);
  // random_fill(in);

  // read file
  std::fstream f(fn.c_str(), std::fstream::in);
  //read size of input matrix
  read_matrix_size(f, sz1, sz2);

  std::size_t to = std::min(sz1, sz2);

  viennacl::matrix<ScalarType> Ai(sz1, sz2), Aref(sz1, sz2), QL(sz1, sz1), QR(sz2, sz2);
  read_matrix_body(f, Ai);

  std::vector<ScalarType> sigma_ref(to);
  read_vector_body(f, sigma_ref);

  f.close();

  // viennacl::fast_copy(&in[0], &in[0] + in.size(), Ai);

  Aref = Ai;

  viennacl::tools::timer timer;
  timer.start();

  viennacl::linalg::svd(Ai, QL, QR);

  viennacl::backend::finish();

  double time_spend = timer.get();

  viennacl::matrix<ScalarType> result1(sz1, sz2), result2(sz1, sz2);
  result1 = viennacl::linalg::prod(QL, Ai);
  result2 = viennacl::linalg::prod(result1, trans(QR));

  ScalarType sigma_diff = sigmas_compare(Ai, sigma_ref);
  ScalarType prods_diff  = matrix_compare(result2, Aref);

  bool sigma_ok = (fabs(sigma_diff) < EPS)
                   && (fabs(prods_diff) < std::sqrt(EPS));  //note: computing the product is not accurate down to 10^{-16}, so we allow for a higher tolerance here

  printf("%6s [%dx%d] %40s sigma_diff = %.6f; prod_diff = %.6f; time = %.6f\n", sigma_ok?"[[OK]]":"[FAIL]", (int)Aref.size1(), (int)Aref.size2(), fn.c_str(), sigma_diff, prods_diff, time_spend);
  if (!sigma_ok)
    exit(EXIT_FAILURE);
}
Exemple #16
0
/*!
  \brief Processes a network reply.

  The \p url tells us what kind of reply it is. The \p data contains the
  actual reply. This might not be the cleanest way, but we decide based on the
  request what kind of reply it is (JSON, XML) etc.

  \param url  The request URL.
  \param data The data we recieved.
*/
void
Steam::processReply( const QString &url, const QByteArray &data )
{
  if( url.isEmpty() )
    return;

  if( url.contains( QL( "ICSGOServers_730/GetGameServersStatus" ) ) )
  {
    processReplyServerOK( data );
    return;
  }

  if( url.contains( QL( "ISteamApps/GetAppList" ) ) )
  {
    processReplyAppIDs( data );
    return;
  }

  if( url.contains( QL( "cdn.akamai.steamstatic.com/steam/apps" ) ) )
  {
    processReplyImage( data );
    return;
  }

  if( url.contains( QL( "ISteamUserStats/GetNumberOfCurrentPlayers" ) ) )
  {
    processReplyPlayerCount( data );
    return;
  }

  if( url.contains( QL( "ISteamUserStats/GetSchemaForGame" ) ) )
  {
    processReplyAchievements( data );
    return;
  }

  Msg::warn( tr( "I just recieved a reply to a request I don't seem to "
    "remember sending!\nRequest URL: %1" ), url );
}
Exemple #17
0
/*!
  \brief Fetches game achievement completion values.

  This method fetches the game completion values for the game app ID \p appID.

  \param appID The app ID we want the achievement completion values for.
  \return A \c QHash map with achievements and completion values.
*/
QHash< QString, float >
Steam::fetchAchievementCompletion( int appID )
{
  if( appID <= 0 )
    return( QHash< QString, float >() );

  QUrl url( QL( "http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v2/" ) );
  url.addQueryItem( QL( "gameid" ), QString::number( appID ) );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  while( ! reply->isFinished() )
    qApp->processEvents();

  QByteArray data = reply->readAll();
  reply->deleteLater();
  reply = NULL;

  if( data.isEmpty() )
    return( QHash< QString, float >() );

  JSONStreamReader json;
  JSONObject *root = json.read( data );
  if( ! root || json.hasError() )
  {
    delete root;
    root = NULL;

    SteamPrivate::jsonError( json );
    return( QHash< QString, float >() );
  }

  JSONList *achievements = NULL;
  JSONObject *achievementpercentages = root->valueObject( QL( "achievementpercentages" ) );
  if( achievementpercentages )
    achievements = achievementpercentages->valueList( QL( "achievements" ) );

  QHash< QString, float > completion;
  for( int i = 0; achievements && i < achievements->count(); i++ )
  {
    JSONValue *val = achievements->at( i );
    JSONObject *achievement = NULL;
    if( val->type() == JSONValue::T_Object )
      achievement = dynamic_cast< JSONObject * >( val );

    if( achievement )
    {
      QString name  = achievement->valueScalar( QL( "name" ) )->sValue();
      float percent = achievement->valueScalar( QL( "percent" ) )->dValue();

      completion.insert( name, percent );
    }
  }

  delete root;
  root = NULL;

  return completion;
}
Exemple #18
0
/*!
  \brief Loads data from storage.
*/
void
SettingsPrivate::fromStorage()
{
  apiKey         = Storage::loadString( QL( "apiKey" ) );
  useSystemProxy = Storage::loadBool( QL( "useSystemProxy" ) );
  proxyHost      = Storage::loadString( QL( "proxyHost" ) );
  proxyPort      = Storage::loadUShort( QL( "proxyPort" ) );
  proxyLogin     = Storage::loadString( QL( "proxyLogin" ) );
  proxyPassword  = Storage::loadString( QL( "proxyPassword" ) );

  if( apiKey.isEmpty() )
    apiKey = QL( API_KEY );
}
Exemple #19
0
/*!
  \brief Request Steam App image.

  This downloads a graphic resource from a steam URI. Upon success we create a
  \c QPixmap out of it and send it out to the main window via signal.

  \param appID The app ID we wish the game image for.
*/
void
Steam::requestAppImage( int appID )
{
  if( appID <= 0 )
    return;

  QString urlStr( QL( "http://cdn.akamai.steamstatic.com/steam/apps/%1/"
    "header.jpg" ) );

  QUrl url( urlStr.arg( appID ) );
  QNetworkRequest request( url );

  QNetworkReply *reply = d->network->get( request );
  connectReply( reply );
}
Exemple #20
0
/*!
  \brief Saves data to storage.
*/
void
SettingsPrivate::toStorage()
{
  Storage::save( QL( "apiKey" ), apiKey );
  Storage::save( QL( "useSystemProxy" ), useSystemProxy );
  Storage::save( QL( "proxyHost" ), proxyHost );
  Storage::save( QL( "proxyPort" ), proxyPort );
  Storage::save( QL( "proxyLogin" ), proxyLogin );
  Storage::save( QL( "proxyPassword" ), proxyPassword );

  QNetworkProxyFactory::setUseSystemConfiguration( useSystemProxy );
}
Exemple #21
0
void time_svd(std::size_t sz1, std::size_t sz2)
{

  std::vector<ScalarType> in(sz1 * sz2);
  random_fill(in);

  viennacl::matrix<ScalarType> Ai(sz1, sz2), QL(sz1, sz1), QR(sz2, sz2);
  viennacl::fast_copy(&in[0], &in[0] + in.size(), Ai);


  Timer timer;
  timer.start();

  viennacl::linalg::svd(Ai, QL, QR);
  viennacl::backend::finish();
  double time_spend = timer.get();

  printf("[%dx%d] time = %.6f\n", static_cast<int>(sz1), static_cast<int>(sz2), time_spend);
}
Vector SchemeRoe(const Cell& Cell1,const Cell& Cell2,const Cell& Cell3,const Cell& Cell4, int AxisNo)
{

		// Local variables

		Vector  V1, V2, V3, V4;                 // Velocities
		real 		rho1, rho2, rho3, rho4;					// Densities
		real		p1, p2, p3, p4;									// Pressures
		real		rhoE1, rhoE2, rhoE3, rhoE4;	    // Energies
		Vector  Result(QuantityNb);

		Vector	F1(QuantityNb);                 // Fluxes
		Vector  F2(QuantityNb);
		Vector  F3(QuantityNb);
		Vector  F4(QuantityNb);

		Vector Q1, Q2, Q3, Q4;									// Conservative quantities

		Vector  FL(QuantityNb),FR(QuantityNb);  // Left and right fluxex
		Vector  QL(QuantityNb),QR(QuantityNb);  // Left and right conservative quantities
		real    rhoL, rhoR;              				// Left and right densities
		real		pL, pR;                         // Left and right pressures
		real		rhoEL, rhoER;                   // Left and right energies
 		Vector	VL(Dimension), VR(Dimension);   // Left and right velocities

		Vector  One(QuantityNb);

		real		rho;														 // central density with Roe's average
		Vector  V(Dimension);										 // central velocity with Roe's average
    		real    H;                               // central enthalpy with Roe's average
    		real    c;                               // central speed of sound with Roe's average
		real		Roe;														 // Coefficient for Roe's average

		Matrix L, R;                              // left and right eigenmatrix
		Matrix Lambda(QuantityNb);								// diagonal matrix containing the eigenvalues
		Matrix A;																	// absolute value of the jacobian matrix

		Vector	 Lim;															// limiter (Van Leer)

	  int i;        														// coutner


		// vector one.

		for(i=1; i<=QuantityNb; i++ )
			One.setValue(i,1.);

 		// --- Get conservative quantities ---

		Q1 = Cell1.average();
		Q2 = Cell2.average();
		Q3 = Cell3.average();
		Q4 = Cell4.average();

		// --- Get primitive variables ---

		// density

    		rho1   = Cell1.density();
    		rho2   = Cell2.density();
    		rho3   = Cell3.density();
    		rho4   = Cell4.density();

		// velocity

 		V1 = Cell1.velocity();
 		V2 = Cell2.velocity();
 		V3 = Cell3.velocity();
 		V4 = Cell4.velocity();

		// energy

		rhoE1 = Cell1.energy();
		rhoE2 = Cell2.energy();
		rhoE3 = Cell3.energy();
		rhoE4 = Cell4.energy();

		// pressure

		p1 = Cell1.pressure();
		p2 = Cell2.pressure();
		p3 = Cell3.pressure();
		p4 = Cell4.pressure();

    // --- Compute Euler fluxes ---

		F1.setValue(1,rho1*V1.value(AxisNo));
		F2.setValue(1,rho2*V2.value(AxisNo));
 		F3.setValue(1,rho3*V3.value(AxisNo));
		F4.setValue(1,rho4*V4.value(AxisNo));

		for(i=1; i<=Dimension; i++)
		{
			F1.setValue(i+1, rho1*V1.value(AxisNo)*V1.value(i) + ((AxisNo == i)? p1 : 0.));
			F2.setValue(i+1, rho2*V2.value(AxisNo)*V2.value(i) + ((AxisNo == i)? p2 : 0.));
 			F3.setValue(i+1, rho3*V3.value(AxisNo)*V3.value(i) + ((AxisNo == i)? p3 : 0.));
			F4.setValue(i+1, rho4*V4.value(AxisNo)*V4.value(i) + ((AxisNo == i)? p4 : 0.));
		}

		F1.setValue(QuantityNb,(rhoE1+p1)*V1.value(AxisNo));
		F2.setValue(QuantityNb,(rhoE2+p2)*V2.value(AxisNo));
 		F3.setValue(QuantityNb,(rhoE3+p3)*V3.value(AxisNo));
		F4.setValue(QuantityNb,(rhoE4+p4)*V4.value(AxisNo));

		// --- Van Leer limiter ---

	 	// Left

	 	Lim = Limiter(Q3-Q2, Q2-Q1);
		FL  = F2 + 0.5*(Lim|(F2-F1)) + 0.5*((One-Lim)|(F3-F2));
		QL  = Q2 + 0.5*(Lim|(Q2-Q1)) + 0.5*((One-Lim)|(Q3-Q2));

		// Right

		Lim = Limiter(Q3-Q2, Q4-Q3);
		FR  = F3 - 0.5*(Lim|(F4-F3)) - 0.5*((One-Lim)|(F3-F2));
		QR  = Q3 - 0.5*(Lim|(Q4-Q3)) - 0.5*((One-Lim)|(Q3-Q2));

/*
		FL = F2;
		FR = F3;
		QL = Q2;
		QR = Q3;
*/

		// --- Extract left and right primitive variables ---

		rhoL = QL.value(1);
		rhoR = QR.value(1);

		for (i=1; i<= Dimension; i++)
		{
			 VL.setValue(i,QL.value(i+1)/rhoL);
			 VR.setValue(i,QR.value(i+1)/rhoR);
		}

		rhoEL=QL.value(QuantityNb);
		rhoER=QR.value(QuantityNb);

		pL = (Gamma-1)*(rhoEL - .5*rhoL*(VL*VL));
		pR = (Gamma-1)*(rhoER - .5*rhoR*(VR*VR));

    		// --- Compute Roe's averages ---

		Roe = sqrt(rhoR/rhoL);

		rho = Roe*rhoL;
		V   = 1./(1.+Roe)*( Roe*VR + VL );
		H   = 1./(1.+Roe)*( Roe*(rhoER+pR)/rhoR + (rhoEL+pL)/rhoL );

		c   = sqrt ( (Gamma-1)*( H - 0.5*(V*V) ) );

    		// --- Compute diagonal matrix containing the absolute value of the eigenvalues ---

		for (i=1;i<=Dimension;i++)
			Lambda.setValue(i,i, fabs(V.value(AxisNo)));

		Lambda.setValue(Dimension+1, Dimension+1, fabs(V.value(AxisNo)+c));
		Lambda.setValue(Dimension+2, Dimension+2, fabs(V.value(AxisNo)-c));

		// --- Set left and right eigenmatrices ---

		L.setEigenMatrix(true, AxisNo, V, c);
		R.setEigenMatrix(false, AxisNo, V, c, H);

		// --- Compute absolute Jacobian matrix ---

  		A = R*Lambda*L;
	
    		// --- Compute Euler Flux ---

		Result = 0.5*(FL+FR) - 0.5*(A*(QR-QL));

		return Result;
}