Ejemplo n.º 1
0
 public void SetReleases(string name,
                         DegreesOfFreedomLocal iEndRelease,
                         DegreesOfFreedomLocal jEndRelease,
                         Fixity iEndFixity,
                         Fixity jEndFixity)
 {
 }
Ejemplo n.º 2
0
        // === Get/Set

        /// <summary>
        /// This function retrieves the release assignments for a frame end release.
        /// </summary>
        /// <param name="name">The name of an existing frame end release.</param>
        /// <param name="iEndRelease">Booleans indicating the I-End releases.</param>
        /// <param name="jEndRelease">Booleans indicating the J-End releases.</param>
        /// <param name="iEndFixity">Values indicating the I-End partial fixity springs.</param>
        /// <param name="jEndFixity">Values indicating the J-End partial fixity springs.</param>
        /// <exception cref="CSiException">API_DEFAULT_ERROR_CODE</exception>
        public void GetReleases(string name,
                                out DegreesOfFreedomLocal iEndRelease,
                                out DegreesOfFreedomLocal jEndRelease,
                                out Fixity iEndFixity,
                                out Fixity jEndFixity)
        {
            bool[]   csiiEndRelease = new bool[0];
            bool[]   csijEndRelease = new bool[0];
            double[] csiiEndFixity  = new double[0];
            double[] csijEndFixity  = new double[0];

            _callCode = _sapModel.NamedAssign.ReleaseFrame.GetReleases(name, ref csiiEndRelease, ref csijEndRelease, ref csiiEndFixity, ref csijEndFixity);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException(API_DEFAULT_ERROR_CODE);
            }

            iEndRelease = new DegreesOfFreedomLocal();
            iEndRelease.FromArray(csiiEndRelease);

            jEndRelease = new DegreesOfFreedomLocal();
            jEndRelease.FromArray(csijEndRelease);

            iEndFixity = new Fixity();
            iEndFixity.FromArray(csiiEndFixity);

            jEndFixity = new Fixity();
            jEndFixity.FromArray(csijEndFixity);
        }
Ejemplo n.º 3
0
 public Function(Fixity fixity)
     : base(ValueType.Function)
 {
     if (fixity == 0) throw new Exception("This constructor can only be used for infix functions");
     Signature = new FunctionType(fixity);
     Kind = ValueKind.Function;
 }
Ejemplo n.º 4
0
        public bool IsUniqueByFixity(string denotation, Fixity fixity)
        {
            if (string.IsNullOrWhiteSpace(denotation))
            {
                throw new ArgumentNullException();
            }

            return(Operators.Count(x => x.Denotations.Contains(denotation) && x.Fixity == fixity) == 1);
        }
Ejemplo n.º 5
0
 public void Merge(INodeDataComponent other)
 {
     if (other is NodeSupport)
     {
         NodeSupport otherS = (NodeSupport)other;
         Fixity    = Fixity.Or(otherS.Fixity);
         Stiffness = Stiffness.MergeMax(otherS.Stiffness);
         //TODO: Axis merging
     }
 }
Ejemplo n.º 6
0
 public PartialApplication(List<PartialCall> matches, Fixity fixity, string name)
     : base(ValueType.FunctionGroup)
 {
     if (fixity != Hype.Fixity.Prefix && matches.Any(m => m.ArgumentsLeft != 2))
     {
         throw new ExpressionException("Those overloads can't be added to an infix function because not all of them require exactly two arguments.");
     }
     PotentialMatches = matches;
     Fixity = fixity;
     funcName = name;
     Kind = ValueKind.Function;
 }
Ejemplo n.º 7
0
        public FunctionType(Fixity fixity, int numArguments = 2)
            : base("FunctionType")
        {
            Fixity = fixity;
            InputSignature = new List<ValueType>();

            if (fixity != Hype.Fixity.Prefix && numArguments != 2) throw new Exception("Infix functions can only take 2 arguments.");

            for (int i = 0; i < numArguments; ++i)
            {
                InputSignature.Add(ValueType.Uncertain);
            }
            OutputSignature = ValueType.Uncertain;
        }
Ejemplo n.º 8
0
        public Operator(Arity arity,
                        Associativity associativity,
                        OperatorType operatorType,
                        Fixity fixity,
                        params string[] denotations)
            : base(operatorType, -1)

            // priority will be calculated in runtime based on operators declaration in config files
            // otherwise it will be hard to maintain it properly
        {
            Arity         = arity;
            Associativity = associativity;
            Denotations   = denotations;
            Fixity        = fixity;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// This function defines a named frame end release.
        /// </summary>
        /// <param name="name">The name of a new or existing frame end release.</param>
        /// <param name="iEndRelease">Booleans indicating the I-End releases.</param>
        /// <param name="jEndRelease">Booleans indicating the J-End releases.</param>
        /// <param name="iEndFixity">Values indicating the I-End partial fixity springs.
        /// The value will be inactive if there is not a released specified for the corresponding degree of freedom.</param>
        /// <param name="jEndFixity">Values indicating the J-End partial fixity springs.
        /// The value will be inactive if there is not a released specified for the corresponding degree of freedom.</param>
        /// <exception cref="CSiException">API_DEFAULT_ERROR_CODE</exception>
        public void SetReleases(string name,
                                DegreesOfFreedomLocal iEndRelease,
                                DegreesOfFreedomLocal jEndRelease,
                                Fixity iEndFixity,
                                Fixity jEndFixity)
        {
            bool[]   csiiEndRelease = iEndRelease.ToArray();
            bool[]   csijEndRelease = jEndRelease.ToArray();
            double[] csiiEndFixity  = iEndFixity.ToArray();
            double[] csijEndFixity  = jEndFixity.ToArray();

            _callCode = _sapModel.NamedAssign.ReleaseFrame.SetReleases(name, ref csiiEndRelease, ref csijEndRelease, ref csiiEndFixity, ref csijEndFixity);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException(API_DEFAULT_ERROR_CODE);
            }
        }
Ejemplo n.º 10
0
 public Function(Fixity fixity, int numArguments)
     : base(ValueType.Function)
 {
     if (fixity > 0 && numArguments != 2) throw new Exception("This constructor can only be used for prefix functions");
     Signature = new FunctionType(fixity, numArguments);
     Kind = ValueKind.Function;
 }
Ejemplo n.º 11
0
 public CSharpFunction(Func<List<Value>, Value> function, Fixity fixity, int numArgs)
     : base(fixity, numArgs)
 {
     Function = function;
 }
Ejemplo n.º 12
0
 public CSharpFunction(Func<List<Value>, Value> function, Fixity fixity)
     : base(fixity)
 {
     Function = function;
 }
Ejemplo n.º 13
0
 public PartialApplication(List<IInvokable> matches, Fixity fixity, string name)
     : this(matches.Select(m => new PartialCall(m)).ToList(), fixity, name)
 {
 }
Ejemplo n.º 14
0
 public FunctionAttributes(Fixity fixity, string identifier, int priority = 0)
 {
     Fixity = fixity;
     Identifier = identifier;
     Priority = priority;
 }