Mercurial > octave-nkf
annotate examples/code/addtwomatrices.cc @ 20654:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | 2f8500ca91d3 |
children |
rev | line source |
---|---|
6572 | 1 #include <octave/oct.h> |
2 | |
3 DEFUN_DLD (addtwomatrices, args, , "Add A to B") | |
4 { | |
20578
2f8500ca91d3
eliminate error_state from example files
John W. Eaton <jwe@octave.org>
parents:
19067
diff
changeset
|
5 if (args.length () != 2) |
6572 | 6 print_usage (); |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9053
diff
changeset
|
7 |
20578
2f8500ca91d3
eliminate error_state from example files
John W. Eaton <jwe@octave.org>
parents:
19067
diff
changeset
|
8 NDArray A = args(0).array_value (); |
2f8500ca91d3
eliminate error_state from example files
John W. Eaton <jwe@octave.org>
parents:
19067
diff
changeset
|
9 NDArray B = args(1).array_value (); |
2f8500ca91d3
eliminate error_state from example files
John W. Eaton <jwe@octave.org>
parents:
19067
diff
changeset
|
10 |
2f8500ca91d3
eliminate error_state from example files
John W. Eaton <jwe@octave.org>
parents:
19067
diff
changeset
|
11 return octave_value (A + B); |
6572 | 12 } |