-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpp_sumBuiltin.cpp
26 lines (26 loc) · 1.02 KB
/
cpp_sumBuiltin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//=============================================================================
// Copyright (c) 2018-present Allan CORNET (Nelson)
//
// This file is released under the 3-clause BSD license. See COPYING-BSD.
//=============================================================================
#include "cpp_sumBuiltin.hpp"
#include "cpp_sum.hpp"
#include "Error.hpp"
#include "Validators.hpp"
//=============================================================================
ArrayOfVector cpp_sumBuiltin(int nLhs, const ArrayOfVector& argIn)
{
ArrayOfVector retval;
nargincheck(argIn, 2, 2);
nargoutcheck(nLhs, 0, 1);
mustBeScalarOrEmpty(argIn, 0);
mustBeFloat(argIn, 0);
mustBeScalarOrEmpty(argIn, 1);
mustBeFloat(argIn, 1);
ArrayOf param1 = argIn[0];
ArrayOf param2 = argIn[1];
retval << ArrayOf::doubleConstructor(
cpp_sum(param1.getContentAsDoubleScalar(), param2.getContentAsDoubleScalar()));
return retval;
}
//=============================================================================