//=========================================================================================
/*virtual*/ bool GAVisToolReduceBivectorFunctionEvaluator::EvaluateResult( CalcLib::Number& result, CalcLib::Environment& environment )
{
	bool success = false;
	
	do
	{
		if( GetArgumentCount() != 1 )
		{
			environment.AddError( "The reduce-bivector function expects one and only one argument." );
			break;
		}

		CalcLib::FunctionArgumentEvaluator* argument = GetArgument(0);
		if( !argument->EvaluateResult( result, environment ) )
			break;
		
		CalcLib::GeometricAlgebraEnvironment gaEnv;
		if( !gaEnv.StoreVariable( "bivector", result ) )
			break;

		if( !reductionEvaluator->EvaluateResult( result, gaEnv ) )
			break;

		success = true;
	}
	while( false );

	return success;
}
Пример #2
0
  int cConsoleApplication::Run()
  {
    bool bIsSuccessfulRun = true;
    bool bIsHandledAlready = false;

    const size_t n = GetArgumentCount();
    if (n == 1) {
      const string_t sArgument0 = GetArgument(0);
      if ((sArgument0 == TEXT("-help")) || (sArgument0 == TEXT("--help"))) {
        bIsHandledAlready = true;
        _PrintHelp();
      } else if ((sArgument0 == TEXT("-version")) || (sArgument0 == TEXT("--version"))) {
        bIsHandledAlready = true;
        PrintVersion();
      }
    }

    if (!bIsHandledAlready) bIsSuccessfulRun = _Run();

    return (bIsSuccessfulRun) ? EXIT_SUCCESS : EXIT_FAILURE;
  }