/// <returns>the RefGA.Multivector which represents the origin ("no" by default, but can be set by <c>optionOrigin="..."</c>).</returns> public RefGA.Multivector GetOrigin(Specification S, G25.fgs F) { String originName = "no"; if (F.GetOption("origin") != null) { originName = F.GetOption("origin"); } int bvIdx = S.GetBasisVectorIndex(originName); if (bvIdx < 0) { throw new G25.UserException("Unknown basis vector specified for origin: " + originName, XML.FunctionToXmlString(S, F)); } else { return(new RefGA.Multivector(new RefGA.BasisBlade((uint)(1 << bvIdx)))); } }
/// <summary> /// Checks if this FunctionGenerator can implement a certain function. /// </summary> /// <param name="S">The specification of the algebra.</param> /// <param name="F">The function to be implemented.</param> /// <returns>true if 'F' can be implemented</returns> public override bool CanImplement(Specification S, G25.fgs F) { if (!((F.Name == "log") && (F.MatchNbArguments(1)))) { return(false); } string type = F.GetOption("type"); if (type == null) { return(false); } return(type.ToLower().Equals("euclidean")); }