temptst.cpp File Reference

#include "mex.h"
#include "temptst.h"

Include dependency graph for temptst.cpp:

Go to the source code of this file.

Functions

N1< double > callsquare (N1< double > n1)
void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])


Function Documentation

N1<double> callsquare ( N1< double >  n1  ) 

Definition at line 3 of file temptst2.cpp.

References n1, and x.

Referenced by mexFunction().

00003                                      {
00004   double x = n1.sqr();
00005   return N1<double>(x);
00006 }

Here is the caller graph for this function:

void mexFunction ( int  nlhs,
mxArray plhs[],
int  nrhs,
const mxArray prhs[] 
)

Definition at line 6 of file temptst.cpp.

References callsquare(), N1< T >::data(), m, mexErrMsgTxt(), mexFunction, mxGetM(), mxGetPr(), mxREAL, and result.

00007 {
00008     if (nrhs < 1)
00009       mexErrMsgTxt("Need at least one argument");
00010     if (mxGetM(prhs[0]) == 0)
00011       mexErrMsgTxt("First argument must have at least one entry");
00012     double* m = mxGetPr(prhs[0]);
00013     
00014     N1<double> ans = callsquare(N1<double>(*m));
00015     mxArray* result = mxCreateDoubleMatrix(1,1,mxREAL);
00016     *mxGetPr(result) = ans.data();
00017     plhs[0] = result;
00018     return;
00019 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:10:27 2007 for Scilab [trunk] by  doxygen 1.5.1