public GaNumMapBilinearCombined AddMap(double coef, IGaNumMapBilinear linearMap) { if ( linearMap.DomainVSpaceDimension != DomainVSpaceDimension || linearMap.TargetVSpaceDimension != TargetVSpaceDimension ) { throw new InvalidOperationException("Linear map dimensions mismatch"); } _termsList.Add(new GaNumMapBilinearCombinedTerm(coef, linearMap)); return(this); }
internal GaNumFrameEuclidean(int vSpaceDim) { EuclideanMetric = GaNumMetricEuclidean.Create(vSpaceDim); Op = ComputedOp = new GaNumOp(VSpaceDimension); Gp = ComputedGp = new GaNumEuclideanGp(VSpaceDimension); Sp = ComputedSp = new GaNumEuclideanSp(VSpaceDimension); Lcp = ComputedLcp = new GaNumEuclideanLcp(VSpaceDimension); Rcp = ComputedRcp = new GaNumEuclideanRcp(VSpaceDimension); Fdp = ComputedFdp = new GaNumEuclideanFdp(VSpaceDimension); Hip = ComputedHip = new GaNumEuclideanHip(VSpaceDimension); Acp = ComputedAcp = new GaNumEuclideanAcp(VSpaceDimension); Cp = ComputedCp = new GaNumEuclideanCp(VSpaceDimension); UnitPseudoScalarCoef = 1.0d; }
public static GaNumMapBilinearTree ToTreeMap(this IGaNumMapBilinear bilinearMap) { var resultMap = GaNumMapBilinearTree.Create( bilinearMap.DomainVSpaceDimension, bilinearMap.TargetVSpaceDimension ); foreach (var basisBladeMapping in bilinearMap.BasisBladesMaps()) { var id1 = basisBladeMapping.Item1; var id2 = basisBladeMapping.Item2; var mv = basisBladeMapping.Item3; resultMap.SetBasisBladesMap(id1, id2, mv); } return(resultMap); }
internal GaNumFrameOrthogonal(IEnumerable <double> basisVectorsSignaturesList) { BasisVectorsSignatures = basisVectorsSignaturesList.ToArray(); OrthogonalMetric = GaNumMetricOrthogonal.Create(BasisVectorsSignatures); Op = ComputedOp = new GaNumOp(VSpaceDimension); Gp = ComputedGp = new GaNumOrthogonalGp(OrthogonalMetric); Sp = ComputedSp = new GaNumOrthogonalSp(OrthogonalMetric); Lcp = ComputedLcp = new GaNumOrthogonalLcp(OrthogonalMetric); Rcp = ComputedRcp = new GaNumOrthogonalRcp(OrthogonalMetric); Fdp = ComputedFdp = new GaNumOrthogonalFdp(OrthogonalMetric); Hip = ComputedHip = new GaNumOrthogonalHip(OrthogonalMetric); Acp = ComputedAcp = new GaNumOrthogonalAcp(OrthogonalMetric); Cp = ComputedCp = new GaNumOrthogonalCp(OrthogonalMetric); UnitPseudoScalarCoef = (MaxBasisBladeId.BasisBladeIdHasNegativeReverse() ? -1.0d : 1.0d) / OrthogonalMetric[MaxBasisBladeId]; }
public static GaNumMapBilinearCoefSums ToCoefSumsMap(this IGaNumMapBilinear bilinearMap) { var resultMap = GaNumMapBilinearCoefSums.Create( bilinearMap.DomainVSpaceDimension, bilinearMap.TargetVSpaceDimension ); foreach (var basisBladeMapping in bilinearMap.BasisBladesMaps()) { var id1 = basisBladeMapping.Item1; var id2 = basisBladeMapping.Item2; var mv = basisBladeMapping.Item3; foreach (var term in mv.NonZeroTerms) { resultMap.SetFactor(term.Key, id1, id2, term.Value); } } return(resultMap); }
internal GaNumFrameNonOrthogonal(GaNumFrame baseOrthoFrame, Matrix ipm, GaNumOutermorphism derivedToBaseOm, GaNumOutermorphism baseToDerivedOm) { if (baseOrthoFrame.IsOrthogonal == false) { throw new GMacNumericException("Base frame must be orthogonal"); } if (ipm.IsDiagonal()) { throw new GMacNumericException("Inner product matrix must be non-diagonal"); } InnerProductMatrix = ipm; NonOrthogonalMetric = new GaNumMetricNonOrthogonal( baseOrthoFrame, this, derivedToBaseOm, baseToDerivedOm ); Op = ComputedOp = new GaNumOp(VSpaceDimension); Gp = ComputedGp = GaNumBilinearProductCba.CreateGp(NonOrthogonalMetric); Sp = ComputedSp = GaNumBilinearProductCba.CreateSp(NonOrthogonalMetric); Lcp = ComputedLcp = GaNumBilinearProductCba.CreateLcp(NonOrthogonalMetric); Rcp = ComputedRcp = GaNumBilinearProductCba.CreateRcp(NonOrthogonalMetric); Fdp = ComputedFdp = GaNumBilinearProductCba.CreateFdp(NonOrthogonalMetric); Hip = ComputedHip = GaNumBilinearProductCba.CreateHip(NonOrthogonalMetric); Acp = ComputedAcp = GaNumBilinearProductCba.CreateAcp(NonOrthogonalMetric); Cp = ComputedCp = GaNumBilinearProductCba.CreateCp(NonOrthogonalMetric); UnitPseudoScalarCoef = (MaxBasisBladeId.BasisBladeIdHasNegativeReverse() ? -1.0d : 1.0d) / BasisBladeSignature(MaxBasisBladeId)[0]; }
private GaNumBilinearProductCba(GaNumMetricNonOrthogonal metric, IGaNumMapBilinear baseProductMap) { NonOrthogonalMetric = metric; BaseProductMap = baseProductMap; }
internal GaNumMapBilinearCombinedTerm(double coef, IGaNumMapBilinear linearMap) { Coef = coef; LinearMap = linearMap; }