File: comp_pgauss.cc

package info (click to toggle)
octave-ltfat 2.3.1%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,712 kB
  • sloc: ansic: 30,379; cpp: 8,808; java: 1,499; objc: 345; makefile: 248; xml: 182; python: 124; sh: 18; javascript: 12
file content (29 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (4)
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
27
28
29
#include <octave/oct.h>
#include "ltfat.h"

DEFUN_DLD (comp_pgauss, args, ,
           "This function calls the C-library\n\
            c=comp_pgauss(L,w,c_t,c_f);\n")
{

    const int    L      = args(0).int_value();
    const double w      = args(1).double_value();
    const double c_t    = args(2).double_value();
    const double c_f    = args(3).double_value();

    if (c_f == 0.0)
    {
        Matrix g(L, 1);
        ltfat_pgauss_d(L, w, c_t, g.fortran_vec());

        return octave_value (g);
    }
    else
    {
        ComplexMatrix g(L, 1);
        ltfat_pgauss_dc(L, w, c_t, c_f,
                       reinterpret_cast<ltfat_complex_d*>(g.fortran_vec()));

        return octave_value (g);
    }
}