Ejemplo n.º 1
0
        public int SizeInBytes()
        {
            int lowerIsBetter = LowerIsBetter ? 1 : 0;
            int valueOperator = (int)Operator;

            return(RawValue.SizeInBytes()
                   + Factor.SizeInBytes()
                   + LossFunctionName.SizeInBytes()
                   + lowerIsBetter.SizeInBytes()
                   + valueOperator.SizeInBytes());
        }
Ejemplo n.º 2
0
        public void ToByteArray(byte[] buffer, ref int offset)
        {
            LossFunctionName.ToByteArray(buffer, ref offset);
            RawValue.ToByteArray(buffer, ref offset);
            Factor.ToByteArray(buffer, ref offset);

            int lowerIsBetter = LowerIsBetter ? 1 : 0;

            lowerIsBetter.ToByteArray(buffer, ref offset);

            int valueOperator = (int)Operator;

            valueOperator.ToByteArray(buffer, ref offset);
        }